diff --git a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/__init__.py b/build/lib.macosx-10.12-x86_64-3.6/pymolfile/__init__.py
deleted file mode 100644
index ce188204338b813f974e243d42bf3cf65d3d7fdc..0000000000000000000000000000000000000000
--- a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/__init__.py
+++ /dev/null
@@ -1,16 +0,0 @@
-
-from __future__ import absolute_import
-import warnings
-
-try:
-    from .molfile import libpymolfile
-except ImportError:
-    warnings.warn("libpymolfile package not available, pymolfile does not work without its library!")
-
-from . import plugin_list
-from . import pymolfile
-
-__all__ = [ "pymolfile" ]
-
-from .pymolfile import OpenMolfile, list_plugins
-
diff --git a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/__init__.py b/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/__init__.py
deleted file mode 100644
index 7d9a865f6f70451bcb9b0efc731be5bb612b7db6..0000000000000000000000000000000000000000
--- a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/__init__.py
+++ /dev/null
@@ -1,7 +0,0 @@
-
-# Stand-alone python bindings for libpymolfile
-# Copyright (c) 2017 Berk Onat <b.onat@warwick.ac.uk>
-# Published under the UIUC OpenSource LICENSE 
-"""libpymolfile library.
-
-"""
diff --git a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/_libpymolfile.cpython-36m-darwin.so b/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/_libpymolfile.cpython-36m-darwin.so
deleted file mode 100755
index c437417e9da254adebf07fc0600c9e12e507202a..0000000000000000000000000000000000000000
Binary files a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/_libpymolfile.cpython-36m-darwin.so and /dev/null differ
diff --git a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/libpymolfile.py b/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/libpymolfile.py
deleted file mode 100644
index 90760f2e13fdba86c47c99b9a0aed1d58325dd7d..0000000000000000000000000000000000000000
--- a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/molfile/libpymolfile.py
+++ /dev/null
@@ -1,163 +0,0 @@
-# This file was automatically generated by SWIG (http://www.swig.org).
-# Version 3.0.12
-#
-# Do not make changes to this file unless you know what you are doing--modify
-# the SWIG interface file instead.
-
-"""
-
-:Author:  Berk Onat <b.onat@warwick.ac.uk>
-:Year:    2017
-:Licence: UIUC LICENSE
-
-
-
-"""
-
-
-from sys import version_info as _swig_python_version_info
-if _swig_python_version_info >= (2, 7, 0):
-    def swig_import_helper():
-        import importlib
-        pkg = __name__.rpartition('.')[0]
-        mname = '.'.join((pkg, '_libpymolfile')).lstrip('.')
-        try:
-            return importlib.import_module(mname)
-        except ImportError:
-            return importlib.import_module('_libpymolfile')
-    _libpymolfile = swig_import_helper()
-    del swig_import_helper
-elif _swig_python_version_info >= (2, 6, 0):
-    def swig_import_helper():
-        from os.path import dirname
-        import imp
-        fp = None
-        try:
-            fp, pathname, description = imp.find_module('_libpymolfile', [dirname(__file__)])
-        except ImportError:
-            import _libpymolfile
-            return _libpymolfile
-        try:
-            _mod = imp.load_module('_libpymolfile', fp, pathname, description)
-        finally:
-            if fp is not None:
-                fp.close()
-        return _mod
-    _libpymolfile = swig_import_helper()
-    del swig_import_helper
-else:
-    import _libpymolfile
-del _swig_python_version_info
-
-try:
-    _swig_property = property
-except NameError:
-    pass  # Python < 2.2 doesn't have 'property'.
-
-try:
-    import builtins as __builtin__
-except ImportError:
-    import __builtin__
-
-def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
-    if (name == "thisown"):
-        return self.this.own(value)
-    if (name == "this"):
-        if type(value).__name__ == 'SwigPyObject':
-            self.__dict__[name] = value
-            return
-    method = class_type.__swig_setmethods__.get(name, None)
-    if method:
-        return method(self, value)
-    if (not static):
-        if _newclass:
-            object.__setattr__(self, name, value)
-        else:
-            self.__dict__[name] = value
-    else:
-        raise AttributeError("You cannot add attributes to %s" % self)
-
-
-def _swig_setattr(self, class_type, name, value):
-    return _swig_setattr_nondynamic(self, class_type, name, value, 0)
-
-
-def _swig_getattr(self, class_type, name):
-    if (name == "thisown"):
-        return self.this.own()
-    method = class_type.__swig_getmethods__.get(name, None)
-    if method:
-        return method(self)
-    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
-
-
-def _swig_repr(self):
-    try:
-        strthis = "proxy of " + self.this.__repr__()
-    except __builtin__.Exception:
-        strthis = ""
-    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
-
-try:
-    _object = object
-    _newclass = 1
-except __builtin__.Exception:
-    class _object:
-        pass
-    _newclass = 0
-
-
-def molfile_plugin_list(maxsize: 'int') -> "PyObject *":
-    """molfile_plugin_list(maxsize) -> PyObject *"""
-    return _libpymolfile.molfile_plugin_list(maxsize)
-
-def molfile_init() -> "int":
-    """molfile_init() -> int"""
-    return _libpymolfile.molfile_init()
-
-def molfile_finish() -> "int":
-    """molfile_finish() -> int"""
-    return _libpymolfile.molfile_finish()
-
-def get_plugin(molcapsule: 'PyObject *', plug_no: 'int') -> "PyObject *":
-    """get_plugin(molcapsule, plug_no) -> PyObject *"""
-    return _libpymolfile.get_plugin(molcapsule, plug_no)
-
-def molfile_plugin_info(molcapsule: 'PyObject *', plugin_no: 'int') -> "PyObject *":
-    """molfile_plugin_info(molcapsule, plugin_no) -> PyObject *"""
-    return _libpymolfile.molfile_plugin_info(molcapsule, plugin_no)
-
-def open_file_read(molcapsule: 'PyObject *', fname: 'char *', ftype: 'char *', natoms: 'int') -> "PyObject *":
-    """open_file_read(molcapsule, fname, ftype, natoms) -> PyObject *"""
-    return _libpymolfile.open_file_read(molcapsule, fname, ftype, natoms)
-
-def close_file_read(molpack: 'PyObject *') -> "PyObject *":
-    """close_file_read(molpack) -> PyObject *"""
-    return _libpymolfile.close_file_read(molpack)
-
-def read_fill_structure(molpack: 'PyObject *', prototype: 'PyObject *') -> "PyObject *":
-    """read_fill_structure(molpack, prototype) -> PyObject *"""
-    return _libpymolfile.read_fill_structure(molpack, prototype)
-
-def read_fill_bonds(molpack: 'PyObject *') -> "PyObject *":
-    """read_fill_bonds(molpack) -> PyObject *"""
-    return _libpymolfile.read_fill_bonds(molpack)
-
-def read_fill_angles(molpack: 'PyObject *') -> "PyObject *":
-    """read_fill_angles(molpack) -> PyObject *"""
-    return _libpymolfile.read_fill_angles(molpack)
-
-def read_fill_next_timestep(molpack: 'PyObject *') -> "PyObject *":
-    """read_fill_next_timestep(molpack) -> PyObject *"""
-    return _libpymolfile.read_fill_next_timestep(molpack)
-
-def are_plugins_same(molpack_a: 'PyObject *', molpack_b: 'PyObject *') -> "PyObject *":
-    """are_plugins_same(molpack_a, molpack_b) -> PyObject *"""
-    return _libpymolfile.are_plugins_same(molpack_a, molpack_b)
-
-def are_filehandles_same(molpack_a: 'PyObject *', molpack_b: 'PyObject *') -> "PyObject *":
-    """are_filehandles_same(molpack_a, molpack_b) -> PyObject *"""
-    return _libpymolfile.are_filehandles_same(molpack_a, molpack_b)
-# This file is compatible with both classic and new-style classes.
-
-
diff --git a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/plugin_list.py b/build/lib.macosx-10.12-x86_64-3.6/pymolfile/plugin_list.py
deleted file mode 100644
index 4d42855b224f7ed9a29592ee6320b350648feae8..0000000000000000000000000000000000000000
--- a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/plugin_list.py
+++ /dev/null
@@ -1,63 +0,0 @@
-import warnings
-import sys
-
-from .molfile import libpymolfile
-try:
-    from .molfile import libpymolfile
-except ImportError:
-    warnings.warn("libpymolfile package not available, pymolfile does not work without its library!")
-
-MAX_NUM_PLUGINS = 200
-C_MOLFILE_PLUGINS = libpymolfile.molfile_plugin_list(MAX_NUM_PLUGINS)
-
-def byte_str_decode(data, dectype=None):
-    try:
-        return data.decode(dectype).replace('\x00', '')
-    except AttributeError:
-        return data
-
-def plugins():
-    """ Information on the available molfile plugins
-
-        Example tuple: ('psf', 'psf', 1, 1, 1, 0, 1, 1, 1, 0, 
-            'CHARMM,NAMD,XPLOR PSF', 'mol file reader', 
-            'Justin Gullingsrud, John Stone', 1, 9, 17, 1)
-
-        The fields in the tuple represent info in ordered as follows:
-            1: format extension
-            2: format name
-            3: read_structure is avaliable if 1
-            4: read_bonds is avaliable if 1
-            5: read_angles is avaliable if 1
-            6: read_next_timestep is avaliable if 1
-            7: write_structure is avaliable if 1
-            8: write_bonds is avaliable if 1
-            9: write_angles is avaliable if 1
-           10: write_timestep is avaliable if 1
-           11: long name of the plugin
-           12: type of plugin
-           13: authors of the plugin
-           14: major version of the plugin
-           15: minor version of the plugin
-           16: ABI version of the plugin
-           17: 1 if is reentrant (returns is_reentrant) 
-
-    Returns: A list of tuples that includes the information and 
-             capabilities of each molfile plugin. The information is 
-             extracted from molfile_plugin_t. 
-    """
-    global C_MOLFILE_PLUGINS
-    numlist = libpymolfile.molfile_init()
-    if sys.version_info > (3,):
-        basestring = str
-    plugins_list = [
-        [byte_str_decode(item, 
-            dectype="unicode_escape") for item in libpymolfile.molfile_plugin_info(
-            C_MOLFILE_PLUGINS, i)
-            ] for i in range(numlist)
-        ]
-    libpymolfile.molfile_finish()
-    return plugins_list
-
-MOLFILE_PLUGINS = plugins()
-
diff --git a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/pymolfile.py b/build/lib.macosx-10.12-x86_64-3.6/pymolfile/pymolfile.py
deleted file mode 100644
index 9193965f1d2533806e2c32cb9844c2bd5e5ea93f..0000000000000000000000000000000000000000
--- a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/pymolfile.py
+++ /dev/null
@@ -1,583 +0,0 @@
-
-from __future__ import absolute_import
-from __future__ import print_function
-
-import os
-import re
-import sys
-import numpy as np
-from contextlib import contextmanager
-import warnings
-
-if sys.version_info > (3,):
-    long = int
-
-try:
-    from .molfile import libpymolfile
-except ImportError:
-    warnings.warn("libpymolfile package not available, pymolfile does not work without its library!")
-
-from .plugin_list import plugins, byte_str_decode, MOLFILE_PLUGINS, C_MOLFILE_PLUGINS
-
-def list_plugins():
-    global MOLFILE_PLUGINS
-    return MOLFILE_PLUGINS[:]
-
-def decode_array(inarray):
-    return np.array([
-            [byte_str_decode(element, 
-                dectype="unicode_escape") for element in item 
-                ] for item in inarray
-            ])
-
-# The function stdout_redirected is taken from 
-# https://stackoverflow.com/questions/5081657/how-do-i-prevent-a-c-shared-library-to-print-on-stdout-in-python
-# to supress the plugins from printing to standard output (stdout)
-
-@contextmanager
-def stdout_redirected(to=os.devnull):
-    '''
-    import os
-
-    with stdout_redirected(to=filename):
-        print("from Python")
-        os.system("echo non-Python applications are also supported")
-    '''
-    fd = sys.stdout.fileno()
-
-    ##### assert that Python and C stdio write using the same file descriptor
-    ####assert libc.fileno(ctypes.c_void_p.in_dll(libc, "stdout")) == fd == 1
-
-    def _redirect_stdout(to):
-        sys.stdout.close() # + implicit flush()
-        os.dup2(to.fileno(), fd) # fd writes to 'to' file
-        sys.stdout = os.fdopen(fd, 'w') # Python writes to fd
-
-    with os.fdopen(os.dup(fd), 'w') as old_stdout:
-        with open(to, 'w') as file:
-            _redirect_stdout(to=file)
-        try:
-            yield # allow code to be run with the redirected stdout
-        finally:
-            _redirect_stdout(to=old_stdout) # restore stdout.
-                                            # buffering and flags such as
-                                            # CLOEXEC may be different
-
-def get_dir_base_extension(file_name):
-    """ Splits directory, file base and file extensions
-
-        Returns: directory without leading '/', 
-                 file base name, and file extension without '.'
-    """
-    file_base, file_extension_with_dot = os.path.splitext(os.path.basename(file_name))
-    file_extension = file_extension_with_dot.split(".")[-1]
-    file_dir = os.path.dirname(file_name)
-    return file_dir, file_base, file_extension
-
-def get_listof_parts( filename, filepath, fileformats ):
-    pattern = re.escape(filename[1:-4]) + "\.part[0-9]{4,4}\.(xtc|trr)$"
-    parts = []
-    for f in os.listdir(directory):
-        m = re.match(pattern, f)
-        if m and os.path.isfile(os.path.join(directory, f)):
-            parts.append(os.path.join(directory, f))
-    return sorted(parts)
-
-def get_extension(file_name):
-    """ Gets file extension of a file
-
-        Returns: file extension without '.'
-    """
-    file_extension_with_dot  = os.path.splitext(os.path.basename(file_name))[1]
-    return file_extension_with_dot.split(".")[-1]
-
-def get_plugin_with_ext(file_ext):
-    """ Search molfile plugins list and returns the plugin info 
-        for the first matching extension.
-
-        Returns: Plugin no in the list and the list item (the plugin info tuple)
-    """
-    global MOLFILE_PLUGINS
-
-    if not MOLFILE_PLUGINS:
-        MOLFILE_PLUGINS = plugins()
-
-    if MOLFILE_PLUGINS:
-        plugin_no = -1
-        for plugin_info in MOLFILE_PLUGINS:
-            plugin_no += 1
-            plugin_ext_info = str(plugin_info[0]).replace('*|', 
-                    '').replace('*', '').replace('|', ',').replace(' ', '')
-            for ext_item in str(plugin_ext_info).split(','):
-                if str(file_ext) == str(ext_item):
-                    return (plugin_no, plugin_info)
-
-    return None
-
-def plugins_same(plugin_one, plugin_two):
-    if((plugin_one[0] == plugin_two[0]) and 
-       (plugin_one[1][1] == plugin_two[1][1])):
-        return True
-    else:
-        return False
-
-def get_plugin_with_name(plugin_name):
-    """ Search molfile plugins list and returns the plugin info 
-        for the first matching name in plugin name field.
-
-        Returns: Plugin no in the list and the list item (the plugin info tuple)
-    """
-    global MOLFILE_PLUGINS
-
-    if not MOLFILE_PLUGINS:
-        MOLFILE_PLUGINS = plugins()
-
-    if MOLFILE_PLUGINS:
-        plugin_no = -1
-        for plugin_info in MOLFILE_PLUGINS:
-            plugin_no += 1
-            if(str(plugin_name) in str(plugin_info[1]) or 
-               str(plugin_name) in str(plugin_info[10])):
-                return (plugin_no, plugin_info)
-
-    return None
-
-class Topology(object):
-
-    def __init__(self, fplugin, fname, ftype, natoms, silent):
-        self.natoms = None
-        self.structure = None
-        self.bonds = None
-        self.angles = None
-        self._structure = None
-        self._bonds = None
-        self._angles = None
-        self.pluginhandle = None
-        self.silent = silent
-        try:
-            if self.silent:
-                with stdout_redirected():
-                    self.pluginhandle = libpymolfile.open_file_read(fplugin, 
-                        fname, ftype, natoms)
-            else:
-                self.pluginhandle = libpymolfile.open_file_read(fplugin, 
-                    fname, ftype, natoms)
-            self.natoms = self.pluginhandle.natoms
-        except (IOError, OSError, AttributeError):
-            pass
-
-    def read_structure(self, prototype):
-        try:
-            if self.silent:
-                with stdout_redirected():
-                    self._structure = libpymolfile.read_fill_structure(
-                            self.pluginhandle, prototype)
-            else:
-                self._structure = libpymolfile.read_fill_structure(
-                        self.pluginhandle, prototype)
-            return self._structure
-        except (OSError, IOError, AttributeError, SystemError):
-            return None
-
-    def read_bonds(self):
-        try:
-            if self.silent:
-                with stdout_redirected():
-                    self._bonds = libpymolfile.read_fill_bonds(self.pluginhandle)
-            else:
-                self._bonds = libpymolfile.read_fill_bonds(self.pluginhandle)
-            return self._bonds
-        except (OSError, IOError, AttributeError, SystemError):
-            return None
-
-    def read_angles(self):
-        try:
-            if self.silent:
-                with stdout_redirected():
-                    self._angles = libpymolfile.read_fill_angles(self.pluginhandle)
-            else:
-                self._angles = libpymolfile.read_fill_angles(self.pluginhandle)
-            return self._angles
-        except (OSError, IOError, AttributeError, SystemError):
-            return None
-
-    def __del__( self ):
-        pass
-        #if self.pluginhandle is not None:
-        #    libpymolfile.close_file_read(self.pluginhandle)
-
-class Trajectory(object):
-    
-    def __init__(self, file_name, file_format, plugin, natoms, silent):
-        global MOLFILE_PLUGINS
-        global C_MOLFILE_PLUGINS
-        self.natoms = None
-        self.atoms = None
-        self.plugin = None
-        self.handle = None
-        self.fname = None
-        self.ftype = None
-        self.fname = file_name
-        self.ftype = file_format
-        self.plugin = plugin
-        self.natoms = 0
-        self.silent = silent
-
-        if natoms is not None:
-            self.natoms = natoms
-
-        numlist = libpymolfile.molfile_init()
-        self.fplugin = libpymolfile.get_plugin(C_MOLFILE_PLUGINS, 
-                                          self.plugin[0])
-        self.pluginhandle = None
-
-        if self.natoms > 0:
-            try:
-                if self.silent:
-                    with stdout_redirected():
-                        self.pluginhandle = libpymolfile.open_file_read(self.fplugin, 
-                            self.fname, self.ftype, self.natoms)
-                else:
-                    self.pluginhandle = libpymolfile.open_file_read(self.fplugin, 
-                        self.fname, self.ftype, self.natoms)
-            except (IOError, OSError, AttributeError):
-                pass
-                #if self.pluginhandle is not None:
-                #    libpymolfile.close_file_read(self.pluginhandle)
-
-    def read_next(self):
-        return libpymolfile.read_fill_next_timestep(self.pluginhandle)
-
-    def iter_on_traj(self):
-        try:
-            empty = False
-            self.step = 0
-            while not empty:
-                x = self.read_next()
-                if x is None:
-                    empty = True
-                else:
-                    self.step += 1
-                    yield x
-        except (IOError, AttributeError, OSError):
-            return
-
-    def iread(self):
-        iter_obj = iter(self.iter_on_traj())
-        try:
-            while True:
-                self.atoms = next(iter_obj)
-                return self.atoms
-        except StopIteration:
-            pass
-        finally:
-            del iter_obj
-
-#    def read_frame(self, index_no):
-#        numlist = libpymolfile.molfile_init()
-#        tplugin = libpymolfile.get_plugin(C_MOLFILE_PLUGINS, 
-#                                          self.plugin[1])
-#        pluginhandle = libpymolfile.open_file_read(tplugin, 
-#            file_name, file_format, natoms)
-#        libpymolfile.molfile_finish()
-
-#    def read(self, index_list, chunk=None):
-#        numlist = libpymolfile.molfile_init()
-#        tplugin = libpymolfile.get_plugin(C_MOLFILE_PLUGINS, 
-#                                          self.plugin[1])
-#        pluginhandle = libpymolfile.open_file_read(tplugin, 
-#            file_name, file_format, natoms)
-#        libpymolfile.molfile_finish()
-
-    def __del__(self):
-        pass
-        #if self.pluginhandle is not None:
-        #    libpymolfile.close_file_read(self.pluginhandle)
-
-def read_topology(file_name, file_format, plugin, silent):
-    """ Reads structure, bonds, angles, dihedrals, impropers and 
-        additional informations through molfile_plugin if the 
-        data is available
-     
-        The topology data in pymolfile is a list of tuples that include
-        the following fields:
-            (name, type, resname, resid, segid, chain, altloc, insertion, 
-             occupancy, bfactor, mass, charge, radius, atomicnumber)
-            
-        The data types are as follows in the tuple:
-            s = string, i = integer, f = float
-            (s, s, s, i, s, s, s, s, f, f, f, f, f, i)
-
-        Returns: Topology class if at least one of the topology
-                 data is available. If non of the data is accessible,
-                 function returns None
-    """
-    topo = None
-    structure = None
-    bonds = None
-    angles = None
-    if(file_name is not None and
-       file_format is not None and 
-       plugin is not None):
-        natoms=0
-        topo = Topology(plugin, file_name, file_format, natoms, silent)
-        #if 0 && vmdplugin_ABIVERSION > 17
-        #  /* The new PDB file formats allows for much larger structures, */
-        #  /* which can therefore require longer chain ID strings.  The   */
-        #  /* new PDBx/mmCIF file formats do not have length limits on    */
-        #  /* fields, so PDB chains could be arbitrarily long strings     */
-        #  /* in such files.  At present, we know we need at least 3-char */
-        #  /* chains for existing PDBx/mmCIF files.                       */
-        #  char chain[4];      /**< required chain name, or ""            */
-        #else
-        #  char chain[2];      /**< required chain name, or ""            */
-        #endif
-        #
-        # Change 'chain', S2 to S4
-        #
-        #if('pdb' in file_format or
-        #   'psf' in file_format):
-        chain_size = 'S4'
-        #else:
-        #    chain_size = 'S2'
-        if('dtr' in file_format or 
-           'stk' in file_format or 
-           'atr' in file_format):
-            prototype = np.array([
-                ('','','',0,'','','','',1.0,1.0,1.0,1.0,1.0,6,0), 
-                ('','','',0,'','','','',1.0,1.0,1.0,1.0,1.0,6,0)
-                ],
-                dtype=[
-                    ('name', 'S16'), ('type', 'S16'), ('resname', 'S8'),
-                    ('resid', 'i4'), ('segid', 'S8'), ('chain', chain_size),
-                    ('altloc', 'S2'), ('insertion', 'S2'), ('occupancy', 'f4'),
-                    ('bfactor', 'f4'), ('mass', 'f4'), ('charge', 'f4'),
-                    ('radius', 'f4'), ('atomicnumber', 'i4'), ('ctnumber', 'i4')
-                    ]
-                )
-        else:
-            prototype = np.array([
-                ('','','',0,'','','','',1.0,1.0,1.0,1.0,1.0,6),
-                ('','','',0,'','','','',1.0,1.0,1.0,1.0,1.0,6)
-                ],
-                dtype=[
-                    ('name', 'S16'), ('type', 'S16'), ('resname', 'S8'),
-                    ('resid', 'i4'), ('segid', 'S8'), ('chain', chain_size),
-                    ('altloc', 'S2'), ('insertion', 'S2'), ('occupancy', 'f4'),
-                    ('bfactor', 'f4'), ('mass', 'f4'), ('charge', 'f4'),
-                    ('radius', 'f4'), ('atomicnumber', 'i4')
-                    ]
-                )
-
-        if topo.read_structure(prototype) is not None:
-            topo.structure = decode_array(topo._structure)
-        if topo.read_bonds() is not None:
-            topo.bonds = topo._bonds
-        if topo.read_angles() is not None:
-            topo.angles = topo._angles
-
-    if(topo.structure is not None or 
-       topo.bonds is not None or
-       topo.angles is not None):
-        return topo
-    else:
-        del topo
-        return None
-
-class OpenMolfile(object):
-    """ The main class/function to read topology and 
-        trajectory files
-
-        Returns: Depends on the file format and arguments:
-                 If structure file is supplied, it returns topology class.
-                 If only trajectory file is supplied, it returns trajectory class 
-                     without topology information. (the number of atoms must be known)
-                 If both files are supplied, it returns trajectory class with 
-                     topology information.
-                 If file has both topology and trajectory info, both info will be 
-                     available in the class
-                 If none of the above is available, the topology and 
-                     trajectory will be None in the return object
-    """
-
-    def __init__(self, *args, **kwargs):
-        self.initialize_settings()
-        #super(OpenMolfile, self).__init__(*args, **kwargs)
-        global MOLFILE_PLUGINS
-        global C_MOLFILE_PLUGINS
-        file_name = None
-
-        if args:
-            for arg in args:
-                if isinstance(arg, dict):
-                    self.reset_kwords()
-                    for k, v in arg.items():
-                        if k in self.kwords:
-                            self.kwords[k] = v
-                elif isinstance(arg, (list, tuple)):
-                    self.kwords["file_name"] = arg[0]
-                elif isinstance(arg, str):
-                    self.kwords["file_name"] = arg
-                else:
-                    self.kwords["file_name"] = arg
-
-        if kwargs:
-            for k,v in kwargs.items():
-                if k in self.kwords:
-                    self.kwords[k] = v
-
-        if self.kwords["file_name"] is not None:
-            file_name = self.kwords["file_name"]
-
-        if file_name:
-            if self.kwords["file_format"] is None:
-               file_dir, file_base, file_ext = get_dir_base_extension(file_name)
-               if file_ext:
-                   self.kwords["file_format"] = file_ext
-               else:
-                   self.kwords["file_format"] = file_base
-
-            if self.kwords["file_plugin"] is None:
-                self.kwords["file_plugin"] = "auto"
-
-            if "auto" in self.kwords["file_plugin"]:
-                plugin_item = get_plugin_with_ext(self.kwords["file_format"])
-                if plugin_item:
-                    self.fplugin = plugin_item
-                    self.kwords["file_plugin"] = plugin_item[1][1]
-                else:
-                    self.kwords["file_plugin"] = None
-             
-            if self.kwords["file_plugin"]:
-                # Check if file_plugin reads structure info 
-                # for the given file format.
-                if self.fplugin[1][2] == 1:
-                    # Topology may be read with the plugin.
-                    # This will override topology information 
-                    # if a 'topology' is supplied in keywords.
-                    if self.kwords["file_format"] is not None:
-                        numlist = libpymolfile.molfile_init()
-                        self.smolplugin = libpymolfile.get_plugin(C_MOLFILE_PLUGINS, 
-                                                                  self.fplugin[0])
-                        self.topology = read_topology(file_name, 
-                                                      self.kwords["file_format"], 
-                                                      self.smolplugin,
-                                                      self.kwords["silent"])
-                        #libpymolfile.molfile_finish()
-
-                if(self.fplugin[1][2] == 0 or 
-                   self.topology is None):
-                    # Topology can not be read with plugin from 
-                    # the file. If 'topology' is not set but 'natoms' 
-                    # is set, only the trajectory will be available.
-                    if self.kwords["topology"] is not None:
-                        if isinstance(self.kwords["topology"], OpenMolfile):
-                            self.topology = self.kwords["topology"].topology
-                        elif isinstance(self.kwords["topology"], Topology):
-                            self.topology = self.kwords["topology"]
-                        else:
-                            topo_file_name = self.kwords["topology"]
-                            if self.kwords["topology_format"] is None:
-                               topo_file_dir, topo_file_base, topo_file_ext = get_dir_base_extension(
-                                       topo_file_name)
-                               if topo_file_ext:
-                                   self.kwords["topology_format"] = topo_file_ext
-                               else:
-                                   self.kwords["topology_format"] = topo_file_base
-
-                            if self.kwords["topology_plugin"] is None:
-                                self.kwords["topology_plugin"] = "auto"
-
-                            if "auto" in self.kwords["topology_plugin"]:
-                                topo_plugin_item = get_plugin_with_ext(self.kwords["topology_format"])
-                                if topo_plugin_item:
-                                    self.tplugin = topo_plugin_item
-                                    self.kwords["topology_plugin"] = topo_plugin_item[1][1]
-                                else:
-                                    self.kwords["topology_plugin"] = None
-
-                            if self.kwords["topology_plugin"]:
-                            # Check if topology_plugin reads structure info 
-                            # for the given file format.
-                                if self.tplugin[1][2] == 1:
-                                # Topology may be read with the plugin.
-                                # This will override the topology information. 
-                                    if self.kwords["topology_format"] is not None:
-                                        numlist = libpymolfile.molfile_init()
-                                        self.smolplugin = libpymolfile.get_plugin(C_MOLFILE_PLUGINS, 
-                                                                                  self.fplugin[0])
-                                        self.topology = read_topology(topo_file_name, 
-                                                                      self.kwords["topology_format"], 
-                                                                      self.smolplugin,
-                                                                      self.kwords["silent"])
-                                        #libpymolfile.molfile_finish()
-                            else:
-                                warnings.warn("Pymolfile can not find a plugin to open the '" + 
-                                      self.kwords["topology_format"] + "' file format of the file " + 
-                                      str(topo_file_base) + "." + str(topo_file_ext))
-
-                if self.fplugin[1][5] == 1:
-                    num_atoms = 0
-                    if self.topology:
-                        num_atoms = self.topology.natoms
-                    elif self.kwords["natoms"] is not None:
-                        num_atoms = natoms
-                    # Trajectory can be read if num_atoms is set
-                    if num_atoms>0:
-                        self.trajectory = Trajectory(file_name,
-                                self.kwords["file_format"],
-                                self.fplugin,
-                                num_atoms,
-                                self.kwords["silent"])
-            else:
-                warnings.warn("Pymolfile can not find a plugin to open the '" + self.kwords["file_format"] + 
-                      "' file format of the file " + str(file_base) + "." + str(file_ext))
-
-    def initialize_settings(self):
-        #global MOLFILE_PLUGINS
-        #global C_MOLFILE_PLUGINS
-        #self.plugin_list = MOLFILE_PLUGINS
-        #self.c_plugin_list = C_MOLFILE_PLUGINS
-        self.trajectory = None
-        self.topology = None
-        self.fplugin = None
-        self.tplugin = None
-        self.smolplugin = None
-        self.cmolplugin = None
-        self.kwords = { 
-            "file_name" : None,
-            "file_format" : None,
-            "file_plugin" : None,
-            "topology" : None,
-            "topology_format" : None,
-            "topology_plugin" : None,
-            "natoms" : None,
-            "silent" : False
-            }
-
-        #if not C_MOLFILE_PLUGINS:
-        #    C_MOLFILE_PLUGINS = libpymolfile.molfile_plugin_list(MAX_NUM_PLUGINS)
-        #if not MOLFILE_PLUGINS:
-        #    MOLFILE_PLUGINS = plugins()
-        #if(MOLFILE_PLUGINS and self.plugin_list is None):
-        #    self.plugin_list = MOLFILE_PLUGINS
-        #if(C_MOLFILE_PLUGINS and self.c_plugin_list is None):
-        #    self.c_plugin_list = C_MOLFILE_PLUGINS
-
-    def reset_kwords(self):
-        self.kwords.update({ 
-            "file_name" : None,
-            "file_format" : None,
-            "file_plugin" : None,
-            "topology" : None,
-            "topology_format" : None,
-            "topology_plugin" : None,
-            "natoms" : None,
-            "silent" : False
-            })
-
-    def __del__(self):
-        #del self.topology
-        #del self.trajectory
-        libpymolfile.molfile_finish()
-
diff --git a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/test_libpymolfile.py b/build/lib.macosx-10.12-x86_64-3.6/pymolfile/test_libpymolfile.py
deleted file mode 100644
index a509ef39b8dd2d91171f1cd1c4389330123337e1..0000000000000000000000000000000000000000
--- a/build/lib.macosx-10.12-x86_64-3.6/pymolfile/test_libpymolfile.py
+++ /dev/null
@@ -1,133 +0,0 @@
-import numpy
-import molfile.libpymolfile as pym
-
-mylist  = pym.molfile_plugin_list(200)
-print(mylist)
-numlist = pym.molfile_init()
-print(numlist)
-for i in range(numlist):
-    testplugin = pym.molfile_plugin_info(mylist, i)
-    print(i, testplugin)
-
-#splugin = pym.get_plugin(mylist, 99) #pdb
-#cplugin = pym.get_plugin(mylist, 83) #trr
-#cplugin = pym.get_plugin(mylist, 85) #xtc
-splugin = pym.get_plugin(mylist, 105) #psf
-#splugin = pym.get_plugin(mylist, 81) #gro
-cplugin = pym.get_plugin(mylist, 69) #dcd
-#cplugin = pym.get_plugin(mylist, 126) #nc
-print(splugin)
-print(cplugin)
-natoms=0
-#sfname="../test/DPDP.pdb"
-#cfname="../test/DPDP.nc"
-
-#sfname="../test/ala3.pdb"
-sfname="../test/ala3.psf"
-cfname="../test/ala3.dcd"
-
-#sfname="../test/md.gro"
-#cfname="../test/md.trr"
-#cfname="../test/md.xtc"
-
-#sfname="../test/md_1u19.gro"
-#cfname="../test/md_1u19.xtc"
-
-#sftype="pdb"
-#cftype="trr"
-#cftype="xtc"
-sftype="psf"
-#sftype="gro"
-cftype="dcd"
-#cftype="nc"
-
-print("Structure plugin:")
-spluginhandle = pym.open_file_read(splugin, sfname, sftype, natoms)
-print("Coordinate plugin:")
-cpluginhandle = pym.open_file_read(cplugin, cfname, cftype, natoms)
-print(cpluginhandle)
-print(cpluginhandle.natoms)
-print(spluginhandle)
-print(spluginhandle.natoms)
-if cpluginhandle.natoms != spluginhandle.natoms:
-    print("Number of atoms do not match in structure and coordinate files.")
-    
-
-if pym.is_plugin_same(spluginhandle, cpluginhandle):
-    pym.close_file_read(cpluginhandle)
-    cpluginhandle = spluginhandle
-
-#if 0 && vmdplugin_ABIVERSION > 17
-#  /* The new PDB file formats allows for much larger structures, */
-#  /* which can therefore require longer chain ID strings.  The   */
-#  /* new PDBx/mmCIF file formats do not have length limits on    */
-#  /* fields, so PDB chains could be arbitrarily long strings     */
-#  /* in such files.  At present, we know we need at least 3-char */
-#  /* chains for existing PDBx/mmCIF files.                       */
-#  char chain[4];      /**< required chain name, or ""            */
-#else
-#  char chain[2];      /**< required chain name, or ""            */
-#endif
-# Change 'chain', 'S4' to S2 for PDB
-if 'pdb' in [sftype, cftype]:
-    print("file chain is set to S2")
-    chain_size = 'S2'
-else:
-    chain_size = 'S4'
-x = numpy.array([
-    ('C1','C','ACE',0,'','','','',1.0,1.0,1.0,1.0,1.0,6), 
-    ('C2','C','ACE',0,'','','','',1.0,1.0,1.0,1.0,1.0,6)
-    ],
-    dtype=[
-        ('name', 'S16'), ('type', 'S16'), ('resname', 'S8'),
-        ('resid', 'i4'), ('segid', 'S8'), ('chain', chain_size),
-        ('altloc', 'S2'), ('insertion', 'S2'), ('occupancy', 'f4'),
-        ('bfactor', 'f4'), ('mass', 'f4'), ('charge', 'f4'),
-        ('radius', 'f4'), ('atomicnumber', 'i4')
-        ]
-    )
-y = pym.read_fill_structure(spluginhandle, x)
-if y is not None:
-    print(y)
-    print(len(y))
-
-try:
-    z = pym.read_fill_bonds(spluginhandle)
-    if z is not None:
-        print(z)
-        print(len(z))
-except (AttributeError, SystemError):
-    pass
-
-try:
-    a = pym.read_fill_angles(spluginhandle)
-    if a is not None:
-        print(a)
-        print(len(a))
-except (AttributeError, SystemError):
-    pass
-
-if pym.is_plugin_same(spluginhandle, cpluginhandle):
-    pass
-else:
-    pym.close_file_read(spluginhandle)
-
-step=0
-while True:
-#while False:
-    try:
-        c = pym.read_fill_next_timestep(cpluginhandle)
-        if c is None:
-            break
-        step=step+1
-        print("Step:",step)
-        print(c)
-        if c["coords"] is not None:
-            print(len(c["coords"]))
-    except (AttributeError,OSError):
-        pass
-
-pym.close_file_read(cpluginhandle)
-pym.molfile_finish()
-
-
diff --git a/build/temp.macosx-10.12-x86_64-3.6/pymolfile/molfile/libpymolfile_wrap.o b/build/temp.macosx-10.12-x86_64-3.6/pymolfile/molfile/libpymolfile_wrap.o
deleted file mode 100644
index ee305191287b01f5d73c4f034bc7d3f8a05612c7..0000000000000000000000000000000000000000
Binary files a/build/temp.macosx-10.12-x86_64-3.6/pymolfile/molfile/libpymolfile_wrap.o and /dev/null differ
diff --git a/build/temp.macosx-10.12-x86_64-3.6/pymolfile/molfile/pymolfile.o b/build/temp.macosx-10.12-x86_64-3.6/pymolfile/molfile/pymolfile.o
deleted file mode 100644
index cb164c83bfcb9fb74f8618859d07731000810861..0000000000000000000000000000000000000000
Binary files a/build/temp.macosx-10.12-x86_64-3.6/pymolfile/molfile/pymolfile.o and /dev/null differ
diff --git a/pymolfile/__init__.pyc b/pymolfile/__init__.pyc
deleted file mode 100644
index 24a3ba9da2eb1cdc0913e40427ff19bd48669b46..0000000000000000000000000000000000000000
Binary files a/pymolfile/__init__.pyc and /dev/null differ
diff --git a/pymolfile/__pycache__/__init__.cpython-36.pyc b/pymolfile/__pycache__/__init__.cpython-36.pyc
deleted file mode 100644
index 86cea0863cfaccd40ca38fde88a40b13b41f5567..0000000000000000000000000000000000000000
Binary files a/pymolfile/__pycache__/__init__.cpython-36.pyc and /dev/null differ
diff --git a/pymolfile/__pycache__/plugin_list.cpython-36.pyc b/pymolfile/__pycache__/plugin_list.cpython-36.pyc
deleted file mode 100644
index fba9748f4b8b25d0f8240c8ff6ea67646d4869c0..0000000000000000000000000000000000000000
Binary files a/pymolfile/__pycache__/plugin_list.cpython-36.pyc and /dev/null differ
diff --git a/pymolfile/__pycache__/pymolfile.cpython-36.pyc b/pymolfile/__pycache__/pymolfile.cpython-36.pyc
deleted file mode 100644
index ccdd1585d47955730b80527d4532b1010162af64..0000000000000000000000000000000000000000
Binary files a/pymolfile/__pycache__/pymolfile.cpython-36.pyc and /dev/null differ
diff --git a/pymolfile/molfile/CMakeLists.txt b/pymolfile/molfile/CMakeLists.txt
index 899602e7ae79b82caaf31dec29ebe9ddfdfd9784..c98109f0081df0d77fa25f20b723133f10bdb6a9 100644
--- a/pymolfile/molfile/CMakeLists.txt
+++ b/pymolfile/molfile/CMakeLists.txt
@@ -3,9 +3,10 @@ cmake_minimum_required(VERSION 2.8.12)
 project(molfile)
 
 add_subdirectory(external)
-add_subdirectory(molfile_plugins)
+add_subdirectory(molfile_plugins/compile)
 
-set_source_files_properties( external/tng/include/tng/tng_io.h PROPERTIES GENERATED TRUE )
+#set_source_files_properties( tng/include/tng/tng_io.h PROPERTIES GENERATED TRUE )
 
 add_dependencies( molfile_plugins_comp tngio_comp )
+#add_dependencies( molfile_plugins_comp TNGBuilder )
 
diff --git a/pymolfile/molfile/__init__.pyc b/pymolfile/molfile/__init__.pyc
deleted file mode 100644
index c7f427c1eb27c1e30e6a82be67f5fe5f3031bc4d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/__init__.pyc and /dev/null differ
diff --git a/pymolfile/molfile/__pycache__/__init__.cpython-36.pyc b/pymolfile/molfile/__pycache__/__init__.cpython-36.pyc
deleted file mode 100644
index f4bafae7c67b6c6045648c7b759850b862012a34..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/__pycache__/__init__.cpython-36.pyc and /dev/null differ
diff --git a/pymolfile/molfile/__pycache__/libpymolfile.cpython-36.pyc b/pymolfile/molfile/__pycache__/libpymolfile.cpython-36.pyc
deleted file mode 100644
index b4233063773af0022abbc264ef3ee5ad1151b326..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/__pycache__/libpymolfile.cpython-36.pyc and /dev/null differ
diff --git a/pymolfile/molfile/_libpymolfile.so b/pymolfile/molfile/_libpymolfile.so
deleted file mode 100755
index 58a54da2b26c083ba1eee9d6189b77aefaa96c5d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/_libpymolfile.so and /dev/null differ
diff --git a/pymolfile/molfile/_libpymolfile.so.dSYM/Contents/Info.plist b/pymolfile/molfile/_libpymolfile.so.dSYM/Contents/Info.plist
deleted file mode 100644
index a1ee3c17acbea1c02095f00322512685cdd3490d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/_libpymolfile.so.dSYM/Contents/Info.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-	<dict>
-		<key>CFBundleDevelopmentRegion</key>
-		<string>English</string>
-		<key>CFBundleIdentifier</key>
-		<string>com.apple.xcode.dsym._libpymolfile.so</string>
-		<key>CFBundleInfoDictionaryVersion</key>
-		<string>6.0</string>
-		<key>CFBundlePackageType</key>
-		<string>dSYM</string>
-		<key>CFBundleSignature</key>
-		<string>????</string>
-		<key>CFBundleShortVersionString</key>
-		<string>1.0</string>
-		<key>CFBundleVersion</key>
-		<string>1</string>
-	</dict>
-</plist>
diff --git a/pymolfile/molfile/_libpymolfile.so.dSYM/Contents/Resources/DWARF/_libpymolfile.so b/pymolfile/molfile/_libpymolfile.so.dSYM/Contents/Resources/DWARF/_libpymolfile.so
deleted file mode 100644
index 3cbfdcafecc3590c00907a06cf45670975f1ec57..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/_libpymolfile.so.dSYM/Contents/Resources/DWARF/_libpymolfile.so and /dev/null differ
diff --git a/pymolfile/molfile/compile-without-tng.sh b/pymolfile/molfile/compile-without-tng.sh
deleted file mode 100644
index 3f2ddc97294adb3c692ed46004874d49ea7dfb1b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/compile-without-tng.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
-swig -py3 -Wall -c++ -python libpymolfile.i
-echo "'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'"
-g++-7 -fPIC -Wall -Wextra -shared -g -Wunused-function -Wunused-parameter  \
-    -I/labEnv3/lib/python3.6/site-packages/numpy/core/include/  \
-    -I./include \
-    -I./include/molfile_plugin/include \
-    -I./lib/molfile_plugin/lib \
-    -I./include/plugin_src/include \
-    -I./include/netcdf/include \
-    -I./include/expat/include \
-    -I./include/tng/include \
-    libpymolfile_wrap.cxx pymolfile.c -o _libpymolfile.so  -L. \
-    -L./lib/molfile_plugin/lib \
-    -L./lib/netcdf/lib \
-    -L./lib/expat/lib \
-    -L./lib/tng/lib \
-    lib/molfile_plugin/lib/libmolfile_plugin.a  -I/labEnv3/include/python3.6m/  \
-    -L/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib  \
-    -lpython3.6 -lnetcdf 
diff --git a/pymolfile/molfile/compile.sh b/pymolfile/molfile/compile.sh
deleted file mode 100644
index 3cf2764facaa72266f7164e6610ebfed80a2615a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/compile.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
-swig -py3 -Wall -c++ -python libpymolfile.i
-echo "'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'"
-g++-7 -fPIC -Wall -Wextra -shared -g -Wunused-function -Wunused-parameter  \
-    -I/labEnv3/lib/python3.6/site-packages/numpy/core/include/  \
-    -I./include \
-    -I./include/molfile_plugin/include \
-    -I./lib/molfile_plugin/lib \
-    -I./include/plugin_src/include \
-    -I./include/netcdf/include \
-    -I./include/expat/include \
-    -I./include/tng/include \
-    libpymolfile_wrap.cxx pymolfile.cxx -o _libpymolfile.so  -L. \
-    -L./lib/molfile_plugin/lib \
-    -L./lib/netcdf/lib \
-    -L./lib/expat/lib \
-    -L./lib/tng/lib \
-    lib/molfile_plugin/lib/libmolfile_plugin.a  -I/labEnv3/include/python3.6m/  \
-    -L/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib  \
-    -lpython3.6 -ltng_io -lnetcdf -lexpat
diff --git a/pymolfile/molfile/compile27.sh b/pymolfile/molfile/compile27.sh
deleted file mode 100644
index 5863c883f775c4e6a1ec560c4a11a330b2a22bef..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/compile27.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
-#swig -py3 -Wall -c++ -python libpymolfile.i
-swig -Wall -c++ -python libpymolfile.i
-echo "'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'"
-g++-7 -fPIC -Wall -Wextra -Xlinker -export-dynamic -shared -g -Wunused-function -Wunused-parameter  \
-    -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/ \
-    -I./include \
-    -I./include/molfile_plugin/include \
-    -I./lib/molfile_plugin/lib \
-    -I./include/plugin_src/include \
-    -I./include/netcdf/include \
-    -I./include/expat/include \
-    -I./include/tng/include \
-    libpymolfile_wrap.cxx pymolfile.c -o _libpymolfile.so  -L. \
-    -L./lib/molfile_plugin/lib \
-    -L./lib/netcdf/lib \
-    -L./lib/expat/lib \
-    -L./lib/tng/lib \
-    lib/molfile_plugin/lib/libmolfile_plugin.a  \
-    -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/include/python2.7/  \
-    -L/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib \
-    -lpython2.7 -ltng_io -lnetcdf -lexpat
diff --git a/pymolfile/molfile/external/CMakeLists.txt b/pymolfile/molfile/external/CMakeLists.txt
index fc558ad746d7dc3a0ef960669993dbbf0d3280a7..1d899392de6a49c792d733b2588e3737358c2b3a 100644
--- a/pymolfile/molfile/external/CMakeLists.txt
+++ b/pymolfile/molfile/external/CMakeLists.txt
@@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 2.8.12)
 project(TNGBuilder)
 include(ExternalProject)
 
-set(TNG_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/external/tng")
-set(TNG_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/tng")
+set(TNG_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/tng")
+set(TNG_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/tng")
 set(TNG_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TNG_INSTALL_DIR})
 
 message("TNG_PREFIX='${TNG_PREFIX}'")
@@ -12,23 +12,23 @@ message("TNG_CMAKE_ARGS='${TNG_CMAKE_ARGS}'")
 message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
 
 ExternalProject_Add(tng
-    PREFIX ${TNG_PREFIX}
-    GIT_REPOSITORY https://github.com/gromacs/tng.git
-    INSTALL_DIR ${TNG_INSTALL_DIR}
-    CMAKE_ARGS ${TNG_CMAKE_ARGS}
+                    PREFIX ${TNG_PREFIX}
+                    GIT_REPOSITORY https://github.com/gromacs/tng.git
+                    INSTALL_DIR ${TNG_INSTALL_DIR}
+                    CMAKE_ARGS ${TNG_CMAKE_ARGS}
 )
 
 
-set(LIB_TNGIO_FILES
-    "${TNG_INSTALL_DIR}/tng/include/tng/tng_io.h")
-
-if (APPLE)
-   set(LIB_TNGIO_FILES ${LIB_TNGIO_FILES} "${TNG_INSTALL_DIR}/tng/lib/libtng_io.dylib")
-else()
-   set(LIB_TNGIO_FILES ${LIB_TNGIO_FILES} "${TNG_INSTALL_DIR}/tng/lib/libtng_io.so")
-endif()
-
+#set(LIB_TNGIO_FILES
+#    "${TNG_INSTALL_DIR}/include/tng/tng_io.h")
+#
+#if (APPLE)
+#   set(LIB_TNGIO_FILES ${LIB_TNGIO_FILES} "${TNG_INSTALL_DIR}/lib/libtng_io.dylib")
+#else()
+#   set(LIB_TNGIO_FILES ${LIB_TNGIO_FILES} "${TNG_INSTALL_DIR}/lib/libtng_io.so")
+#endif()
+#
 add_custom_target(tngio_comp ALL
-                  DEPENDS ${LIB_TNGIO_FILES}
-                 )
+	          DEPENDS ${TNG_INSTALL_DIR}
+)
 
diff --git a/pymolfile/molfile/include/expat/include b/pymolfile/molfile/include/expat/include
deleted file mode 120000
index a45f6e548a9b7ded09b8fb521af000c3155471dd..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/include/expat/include
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/Cellar/expat/2.2.4/include/
\ No newline at end of file
diff --git a/pymolfile/molfile/include/molfile_plugin/include b/pymolfile/molfile/include/molfile_plugin/include
deleted file mode 120000
index 1bd0850b4c8dae172e63d18738a959bdcc1da62c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/include/molfile_plugin/include
+++ /dev/null
@@ -1 +0,0 @@
-../../vmd_molfile_plugins/include
\ No newline at end of file
diff --git a/pymolfile/molfile/include/netcdf/include b/pymolfile/molfile/include/netcdf/include
deleted file mode 120000
index d138b766ed2f942368249e38ad6c126ae6d822ad..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/include/netcdf/include
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/Cellar/netcdf/4.4.1.1_6/include/
\ No newline at end of file
diff --git a/pymolfile/molfile/include/plugin_src/include b/pymolfile/molfile/include/plugin_src/include
deleted file mode 120000
index 39e22b22b0bf8e044a34b9286f24d914acb63ea6..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/include/plugin_src/include
+++ /dev/null
@@ -1 +0,0 @@
-../../vmd_molfile_plugins/molfile_plugin/src/
\ No newline at end of file
diff --git a/pymolfile/molfile/include/tng/include b/pymolfile/molfile/include/tng/include
deleted file mode 120000
index 2287fd0722437aa1b5eb177b81e5454ea5f19ca5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/include/tng/include
+++ /dev/null
@@ -1 +0,0 @@
-/Users/bonat/TNG/tng/include/
\ No newline at end of file
diff --git a/pymolfile/molfile/lib/expat/lib b/pymolfile/molfile/lib/expat/lib
deleted file mode 120000
index 9c11a0d8201819a7281bb6697eeb8d5b5689637a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/lib/expat/lib
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/Cellar/expat/2.2.4/lib
\ No newline at end of file
diff --git a/pymolfile/molfile/lib/molfile_plugin/lib b/pymolfile/molfile/lib/molfile_plugin/lib
deleted file mode 120000
index c48486662e964818f5129a8bf6cd701c63860494..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/lib/molfile_plugin/lib
+++ /dev/null
@@ -1 +0,0 @@
-../../vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/
\ No newline at end of file
diff --git a/pymolfile/molfile/lib/netcdf/lib b/pymolfile/molfile/lib/netcdf/lib
deleted file mode 120000
index 85b19849c8207227f75ee0a93a9921620436bf5e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/lib/netcdf/lib
+++ /dev/null
@@ -1 +0,0 @@
-/usr/local/Cellar/netcdf/4.4.1.1_6/lib/
\ No newline at end of file
diff --git a/pymolfile/molfile/lib/tng/lib b/pymolfile/molfile/lib/tng/lib
deleted file mode 120000
index c7f1b4db1aaa97d2cee7cc15d81226d60d900b59..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/lib/tng/lib
+++ /dev/null
@@ -1 +0,0 @@
-/Users/bonat/TNG/tng/build/lib/
\ No newline at end of file
diff --git a/pymolfile/molfile/libpymolfile.py b/pymolfile/molfile/libpymolfile.py
deleted file mode 100644
index 90760f2e13fdba86c47c99b9a0aed1d58325dd7d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/libpymolfile.py
+++ /dev/null
@@ -1,163 +0,0 @@
-# This file was automatically generated by SWIG (http://www.swig.org).
-# Version 3.0.12
-#
-# Do not make changes to this file unless you know what you are doing--modify
-# the SWIG interface file instead.
-
-"""
-
-:Author:  Berk Onat <b.onat@warwick.ac.uk>
-:Year:    2017
-:Licence: UIUC LICENSE
-
-
-
-"""
-
-
-from sys import version_info as _swig_python_version_info
-if _swig_python_version_info >= (2, 7, 0):
-    def swig_import_helper():
-        import importlib
-        pkg = __name__.rpartition('.')[0]
-        mname = '.'.join((pkg, '_libpymolfile')).lstrip('.')
-        try:
-            return importlib.import_module(mname)
-        except ImportError:
-            return importlib.import_module('_libpymolfile')
-    _libpymolfile = swig_import_helper()
-    del swig_import_helper
-elif _swig_python_version_info >= (2, 6, 0):
-    def swig_import_helper():
-        from os.path import dirname
-        import imp
-        fp = None
-        try:
-            fp, pathname, description = imp.find_module('_libpymolfile', [dirname(__file__)])
-        except ImportError:
-            import _libpymolfile
-            return _libpymolfile
-        try:
-            _mod = imp.load_module('_libpymolfile', fp, pathname, description)
-        finally:
-            if fp is not None:
-                fp.close()
-        return _mod
-    _libpymolfile = swig_import_helper()
-    del swig_import_helper
-else:
-    import _libpymolfile
-del _swig_python_version_info
-
-try:
-    _swig_property = property
-except NameError:
-    pass  # Python < 2.2 doesn't have 'property'.
-
-try:
-    import builtins as __builtin__
-except ImportError:
-    import __builtin__
-
-def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
-    if (name == "thisown"):
-        return self.this.own(value)
-    if (name == "this"):
-        if type(value).__name__ == 'SwigPyObject':
-            self.__dict__[name] = value
-            return
-    method = class_type.__swig_setmethods__.get(name, None)
-    if method:
-        return method(self, value)
-    if (not static):
-        if _newclass:
-            object.__setattr__(self, name, value)
-        else:
-            self.__dict__[name] = value
-    else:
-        raise AttributeError("You cannot add attributes to %s" % self)
-
-
-def _swig_setattr(self, class_type, name, value):
-    return _swig_setattr_nondynamic(self, class_type, name, value, 0)
-
-
-def _swig_getattr(self, class_type, name):
-    if (name == "thisown"):
-        return self.this.own()
-    method = class_type.__swig_getmethods__.get(name, None)
-    if method:
-        return method(self)
-    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
-
-
-def _swig_repr(self):
-    try:
-        strthis = "proxy of " + self.this.__repr__()
-    except __builtin__.Exception:
-        strthis = ""
-    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
-
-try:
-    _object = object
-    _newclass = 1
-except __builtin__.Exception:
-    class _object:
-        pass
-    _newclass = 0
-
-
-def molfile_plugin_list(maxsize: 'int') -> "PyObject *":
-    """molfile_plugin_list(maxsize) -> PyObject *"""
-    return _libpymolfile.molfile_plugin_list(maxsize)
-
-def molfile_init() -> "int":
-    """molfile_init() -> int"""
-    return _libpymolfile.molfile_init()
-
-def molfile_finish() -> "int":
-    """molfile_finish() -> int"""
-    return _libpymolfile.molfile_finish()
-
-def get_plugin(molcapsule: 'PyObject *', plug_no: 'int') -> "PyObject *":
-    """get_plugin(molcapsule, plug_no) -> PyObject *"""
-    return _libpymolfile.get_plugin(molcapsule, plug_no)
-
-def molfile_plugin_info(molcapsule: 'PyObject *', plugin_no: 'int') -> "PyObject *":
-    """molfile_plugin_info(molcapsule, plugin_no) -> PyObject *"""
-    return _libpymolfile.molfile_plugin_info(molcapsule, plugin_no)
-
-def open_file_read(molcapsule: 'PyObject *', fname: 'char *', ftype: 'char *', natoms: 'int') -> "PyObject *":
-    """open_file_read(molcapsule, fname, ftype, natoms) -> PyObject *"""
-    return _libpymolfile.open_file_read(molcapsule, fname, ftype, natoms)
-
-def close_file_read(molpack: 'PyObject *') -> "PyObject *":
-    """close_file_read(molpack) -> PyObject *"""
-    return _libpymolfile.close_file_read(molpack)
-
-def read_fill_structure(molpack: 'PyObject *', prototype: 'PyObject *') -> "PyObject *":
-    """read_fill_structure(molpack, prototype) -> PyObject *"""
-    return _libpymolfile.read_fill_structure(molpack, prototype)
-
-def read_fill_bonds(molpack: 'PyObject *') -> "PyObject *":
-    """read_fill_bonds(molpack) -> PyObject *"""
-    return _libpymolfile.read_fill_bonds(molpack)
-
-def read_fill_angles(molpack: 'PyObject *') -> "PyObject *":
-    """read_fill_angles(molpack) -> PyObject *"""
-    return _libpymolfile.read_fill_angles(molpack)
-
-def read_fill_next_timestep(molpack: 'PyObject *') -> "PyObject *":
-    """read_fill_next_timestep(molpack) -> PyObject *"""
-    return _libpymolfile.read_fill_next_timestep(molpack)
-
-def are_plugins_same(molpack_a: 'PyObject *', molpack_b: 'PyObject *') -> "PyObject *":
-    """are_plugins_same(molpack_a, molpack_b) -> PyObject *"""
-    return _libpymolfile.are_plugins_same(molpack_a, molpack_b)
-
-def are_filehandles_same(molpack_a: 'PyObject *', molpack_b: 'PyObject *') -> "PyObject *":
-    """are_filehandles_same(molpack_a, molpack_b) -> PyObject *"""
-    return _libpymolfile.are_filehandles_same(molpack_a, molpack_b)
-# This file is compatible with both classic and new-style classes.
-
-
diff --git a/pymolfile/molfile/libpymolfile_wrap.cpp b/pymolfile/molfile/libpymolfile_wrap.cpp
deleted file mode 100644
index 21fbdd140493760aa1268bf2b177d3062b585f28..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/libpymolfile_wrap.cpp
+++ /dev/null
@@ -1,4465 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.12
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-
-#ifndef SWIGPYTHON
-#define SWIGPYTHON
-#endif
-
-#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
-
-
-#ifdef __cplusplus
-/* SwigValueWrapper is described in swig.swg */
-template<typename T> class SwigValueWrapper {
-  struct SwigMovePointer {
-    T *ptr;
-    SwigMovePointer(T *p) : ptr(p) { }
-    ~SwigMovePointer() { delete ptr; }
-    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
-  } pointer;
-  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
-public:
-  SwigValueWrapper() : pointer(0) { }
-  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
-  operator T&() const { return *pointer.ptr; }
-  T *operator&() { return pointer.ptr; }
-};
-
-template <typename T> T SwigValueInit() {
-  return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- *  This section contains generic SWIG labels for method/variable
- *  declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-#  define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-#  define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-#  define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-#   define SWIGINLINE inline
-# else
-#   define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__))
-#   else
-#     define SWIGUNUSED
-#   endif
-# elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__))
-# else
-#   define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIG_MSC_UNSUPPRESS_4505
-# if defined(_MSC_VER)
-#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-#   define SWIGUNUSEDPARM(p)
-# else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if defined(__GNUC__)
-#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#    ifndef GCC_HASCLASSVISIBILITY
-#      define GCC_HASCLASSVISIBILITY
-#    endif
-#  endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   if defined(STATIC_LINKED)
-#     define SWIGEXPORT
-#   else
-#     define SWIGEXPORT __declspec(dllexport)
-#   endif
-# else
-#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-#     define SWIGEXPORT __attribute__ ((visibility("default")))
-#   else
-#     define SWIGEXPORT
-#   endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   define SWIGSTDCALL __stdcall
-# else
-#   define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
-#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
-# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
-#endif
-
-/* Intel's compiler complains if a variable which was never initialised is
- * cast to void, which is a common idiom which we use to indicate that we
- * are aware a variable isn't used.  So we just silence that warning.
- * See: https://github.com/swig/swig/issues/192 for more discussion.
- */
-#ifdef __INTEL_COMPILER
-# pragma warning disable 592
-#endif
-
-
-#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
-/* Use debug wrappers with the Python release dll */
-# undef _DEBUG
-# include <Python.h>
-# define _DEBUG
-#else
-# include <Python.h>
-#endif
-
-/* -----------------------------------------------------------------------------
- * swigrun.swg
- *
- * This file contains generic C API SWIG runtime support for pointer
- * type checking.
- * ----------------------------------------------------------------------------- */
-
-/* This should only be incremented when either the layout of swig_type_info changes,
-   or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "4"
-
-/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
-#ifdef SWIG_TYPE_TABLE
-# define SWIG_QUOTE_STRING(x) #x
-# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
-# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
-#else
-# define SWIG_TYPE_TABLE_NAME
-#endif
-
-/*
-  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the SWIG runtime code.
-  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
-
-  But only do this if strictly necessary, ie, if you have problems
-  with your compiler or suchlike.
-*/
-
-#ifndef SWIGRUNTIME
-# define SWIGRUNTIME SWIGINTERN
-#endif
-
-#ifndef SWIGRUNTIMEINLINE
-# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
-#endif
-
-/*  Generic buffer size */
-#ifndef SWIG_BUFFER_SIZE
-# define SWIG_BUFFER_SIZE 1024
-#endif
-
-/* Flags for pointer conversions */
-#define SWIG_POINTER_DISOWN        0x1
-#define SWIG_CAST_NEW_MEMORY       0x2
-
-/* Flags for new pointer objects */
-#define SWIG_POINTER_OWN           0x1
-
-
-/*
-   Flags/methods for returning states.
-
-   The SWIG conversion methods, as ConvertPtr, return an integer
-   that tells if the conversion was successful or not. And if not,
-   an error code can be returned (see swigerrors.swg for the codes).
-
-   Use the following macros/flags to set or process the returning
-   states.
-
-   In old versions of SWIG, code such as the following was usually written:
-
-     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
-       // success code
-     } else {
-       //fail code
-     }
-
-   Now you can be more explicit:
-
-    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
-    if (SWIG_IsOK(res)) {
-      // success code
-    } else {
-      // fail code
-    }
-
-   which is the same really, but now you can also do
-
-    Type *ptr;
-    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
-    if (SWIG_IsOK(res)) {
-      // success code
-      if (SWIG_IsNewObj(res) {
-        ...
-	delete *ptr;
-      } else {
-        ...
-      }
-    } else {
-      // fail code
-    }
-
-   I.e., now SWIG_ConvertPtr can return new objects and you can
-   identify the case and take care of the deallocation. Of course that
-   also requires SWIG_ConvertPtr to return new result values, such as
-
-      int SWIG_ConvertPtr(obj, ptr,...) {
-        if (<obj is ok>) {
-          if (<need new object>) {
-            *ptr = <ptr to new allocated object>;
-            return SWIG_NEWOBJ;
-          } else {
-            *ptr = <ptr to old object>;
-            return SWIG_OLDOBJ;
-          }
-        } else {
-          return SWIG_BADOBJ;
-        }
-      }
-
-   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
-   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   SWIG errors code.
-
-   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
-   allows to return the 'cast rank', for example, if you have this
-
-       int food(double)
-       int fooi(int);
-
-   and you call
-
-      food(1)   // cast rank '1'  (1 -> 1.0)
-      fooi(1)   // cast rank '0'
-
-   just use the SWIG_AddCast()/SWIG_CheckState()
-*/
-
-#define SWIG_OK                    (0)
-#define SWIG_ERROR                 (-1)
-#define SWIG_IsOK(r)               (r >= 0)
-#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
-
-/* The CastRankLimit says how many bits are used for the cast rank */
-#define SWIG_CASTRANKLIMIT         (1 << 8)
-/* The NewMask denotes the object was created (using new/malloc) */
-#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
-/* The TmpMask is for in/out typemaps that use temporal objects */
-#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
-/* Simple returning values */
-#define SWIG_BADOBJ                (SWIG_ERROR)
-#define SWIG_OLDOBJ                (SWIG_OK)
-#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
-#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
-/* Check, add and del mask methods */
-#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
-#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
-#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
-#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
-#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
-#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
-
-/* Cast-Rank Mode */
-#if defined(SWIG_CASTRANK_MODE)
-#  ifndef SWIG_TypeRank
-#    define SWIG_TypeRank             unsigned long
-#  endif
-#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
-#    define SWIG_MAXCASTRANK          (2)
-#  endif
-#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
-#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) {
-  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
-}
-SWIGINTERNINLINE int SWIG_CheckState(int r) {
-  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
-}
-#else /* no cast-rank mode */
-#  define SWIG_AddCast(r) (r)
-#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
-#endif
-
-
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void *(*swig_converter_func)(void *, int *);
-typedef struct swig_type_info *(*swig_dycast_func)(void **);
-
-/* Structure to store information on one type */
-typedef struct swig_type_info {
-  const char             *name;			/* mangled name of this type */
-  const char             *str;			/* human readable name of this type */
-  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
-  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
-  void                   *clientdata;		/* language specific type data */
-  int                    owndata;		/* flag if the structure owns the clientdata */
-} swig_type_info;
-
-/* Structure to store a type and conversion function used for casting */
-typedef struct swig_cast_info {
-  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
-  swig_converter_func     converter;		/* function to cast the void pointers */
-  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
-  struct swig_cast_info  *prev;			/* pointer to the previous cast */
-} swig_cast_info;
-
-/* Structure used to store module information
- * Each module generates one structure like this, and the runtime collects
- * all of these structures and stores them in a circularly linked list.*/
-typedef struct swig_module_info {
-  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
-  size_t                 size;		        /* Number of types in this module */
-  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
-  swig_type_info         **type_initial;	/* Array of initially generated type structures */
-  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
-  void                    *clientdata;		/* Language specific module data */
-} swig_module_info;
-
-/*
-  Compare two type names skipping the space characters, therefore
-  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
-
-  Return 0 when the two name types are equivalent, as in
-  strncmp, but skipping ' '.
-*/
-SWIGRUNTIME int
-SWIG_TypeNameComp(const char *f1, const char *l1,
-		  const char *f2, const char *l2) {
-  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
-    while ((*f1 == ' ') && (f1 != l1)) ++f1;
-    while ((*f2 == ' ') && (f2 != l2)) ++f2;
-    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
-  }
-  return (int)((l1 - f1) - (l2 - f2));
-}
-
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
-*/
-SWIGRUNTIME int
-SWIG_TypeCmp(const char *nb, const char *tb) {
-  int equiv = 1;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (equiv != 0 && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
-    if (*ne) ++ne;
-  }
-  return equiv;
-}
-
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
-*/
-SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
-}
-
-/*
-  Check the typename
-*/
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  if (ty) {
-    swig_cast_info *iter = ty->cast;
-    while (iter) {
-      if (strcmp(iter->type->name, c) == 0) {
-        if (iter == ty->cast)
-          return iter;
-        /* Move iter to the top of the linked list */
-        iter->prev->next = iter->next;
-        if (iter->next)
-          iter->next->prev = iter->prev;
-        iter->next = ty->cast;
-        iter->prev = 0;
-        if (ty->cast) ty->cast->prev = iter;
-        ty->cast = iter;
-        return iter;
-      }
-      iter = iter->next;
-    }
-  }
-  return 0;
-}
-
-/*
-  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
-*/
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
-  if (ty) {
-    swig_cast_info *iter = ty->cast;
-    while (iter) {
-      if (iter->type == from) {
-        if (iter == ty->cast)
-          return iter;
-        /* Move iter to the top of the linked list */
-        iter->prev->next = iter->next;
-        if (iter->next)
-          iter->next->prev = iter->prev;
-        iter->next = ty->cast;
-        iter->prev = 0;
-        if (ty->cast) ty->cast->prev = iter;
-        ty->cast = iter;
-        return iter;
-      }
-      iter = iter->next;
-    }
-  }
-  return 0;
-}
-
-/*
-  Cast a pointer up an inheritance hierarchy
-*/
-SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
-}
-
-/*
-   Dynamic pointer casting. Down an inheritance hierarchy
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
-  swig_type_info *lastty = ty;
-  if (!ty || !ty->dcast) return ty;
-  while (ty && (ty->dcast)) {
-    ty = (*ty->dcast)(ptr);
-    if (ty) lastty = ty;
-  }
-  return lastty;
-}
-
-/*
-  Return the name associated with this type
-*/
-SWIGRUNTIMEINLINE const char *
-SWIG_TypeName(const swig_type_info *ty) {
-  return ty->name;
-}
-
-/*
-  Return the pretty name associated with this type,
-  that is an unmangled type name in a form presentable to the user.
-*/
-SWIGRUNTIME const char *
-SWIG_TypePrettyName(const swig_type_info *type) {
-  /* The "str" field contains the equivalent pretty names of the
-     type, separated by vertical-bar characters.  We choose
-     to print the last name, as it is often (?) the most
-     specific. */
-  if (!type) return NULL;
-  if (type->str != NULL) {
-    const char *last_name = type->str;
-    const char *s;
-    for (s = type->str; *s; s++)
-      if (*s == '|') last_name = s+1;
-    return last_name;
-  }
-  else
-    return type->name;
-}
-
-/*
-   Set the clientdata field for a type
-*/
-SWIGRUNTIME void
-SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
-  swig_cast_info *cast = ti->cast;
-  /* if (ti->clientdata == clientdata) return; */
-  ti->clientdata = clientdata;
-
-  while (cast) {
-    if (!cast->converter) {
-      swig_type_info *tc = cast->type;
-      if (!tc->clientdata) {
-	SWIG_TypeClientData(tc, clientdata);
-      }
-    }
-    cast = cast->next;
-  }
-}
-SWIGRUNTIME void
-SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
-  SWIG_TypeClientData(ti, clientdata);
-  ti->owndata = 1;
-}
-
-/*
-  Search for a swig_type_info structure only by mangled name
-  Search is a O(log #types)
-
-  We start searching at module start, and finish searching when start == end.
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start,
-                            swig_module_info *end,
-		            const char *name) {
-  swig_module_info *iter = start;
-  do {
-    if (iter->size) {
-      size_t l = 0;
-      size_t r = iter->size - 1;
-      do {
-	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
-	size_t i = (l + r) >> 1;
-	const char *iname = iter->types[i]->name;
-	if (iname) {
-	  int compare = strcmp(name, iname);
-	  if (compare == 0) {
-	    return iter->types[i];
-	  } else if (compare < 0) {
-	    if (i) {
-	      r = i - 1;
-	    } else {
-	      break;
-	    }
-	  } else if (compare > 0) {
-	    l = i + 1;
-	  }
-	} else {
-	  break; /* should never happen */
-	}
-      } while (l <= r);
-    }
-    iter = iter->next;
-  } while (iter != end);
-  return 0;
-}
-
-/*
-  Search for a swig_type_info structure for either a mangled name or a human readable name.
-  It first searches the mangled names of the types, which is a O(log #types)
-  If a type is not found it then searches the human readable names, which is O(#types).
-
-  We start searching at module start, and finish searching when start == end.
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start,
-                     swig_module_info *end,
-		     const char *name) {
-  /* STEP 1: Search the name field using binary search */
-  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
-  if (ret) {
-    return ret;
-  } else {
-    /* STEP 2: If the type hasn't been found, do a complete search
-       of the str field (the human readable name) */
-    swig_module_info *iter = start;
-    do {
-      size_t i = 0;
-      for (; i < iter->size; ++i) {
-	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
-	  return iter->types[i];
-      }
-      iter = iter->next;
-    } while (iter != end);
-  }
-
-  /* neither found a match */
-  return 0;
-}
-
-/*
-   Pack binary data into a string
-*/
-SWIGRUNTIME char *
-SWIG_PackData(char *c, void *ptr, size_t sz) {
-  static const char hex[17] = "0123456789abcdef";
-  const unsigned char *u = (unsigned char *) ptr;
-  const unsigned char *eu =  u + sz;
-  for (; u != eu; ++u) {
-    unsigned char uu = *u;
-    *(c++) = hex[(uu & 0xf0) >> 4];
-    *(c++) = hex[uu & 0xf];
-  }
-  return c;
-}
-
-/*
-   Unpack binary data from a string
-*/
-SWIGRUNTIME const char *
-SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
-  unsigned char *u = (unsigned char *) ptr;
-  const unsigned char *eu = u + sz;
-  for (; u != eu; ++u) {
-    char d = *(c++);
-    unsigned char uu;
-    if ((d >= '0') && (d <= '9'))
-      uu = (unsigned char)((d - '0') << 4);
-    else if ((d >= 'a') && (d <= 'f'))
-      uu = (unsigned char)((d - ('a'-10)) << 4);
-    else
-      return (char *) 0;
-    d = *(c++);
-    if ((d >= '0') && (d <= '9'))
-      uu |= (unsigned char)(d - '0');
-    else if ((d >= 'a') && (d <= 'f'))
-      uu |= (unsigned char)(d - ('a'-10));
-    else
-      return (char *) 0;
-    *u = uu;
-  }
-  return c;
-}
-
-/*
-   Pack 'void *' into a string buffer.
-*/
-SWIGRUNTIME char *
-SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
-  char *r = buff;
-  if ((2*sizeof(void *) + 2) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,&ptr,sizeof(void *));
-  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
-  strcpy(r,name);
-  return buff;
-}
-
-SWIGRUNTIME const char *
-SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      *ptr = (void *) 0;
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sizeof(void *));
-}
-
-SWIGRUNTIME char *
-SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
-  char *r = buff;
-  size_t lname = (name ? strlen(name) : 0);
-  if ((2*sz + 2 + lname) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,ptr,sz);
-  if (lname) {
-    strncpy(r,name,lname+1);
-  } else {
-    *r = 0;
-  }
-  return buff;
-}
-
-SWIGRUNTIME const char *
-SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      memset(ptr,0,sz);
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sz);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-/*  Errors in SWIG */
-#define  SWIG_UnknownError    	   -1
-#define  SWIG_IOError        	   -2
-#define  SWIG_RuntimeError   	   -3
-#define  SWIG_IndexError     	   -4
-#define  SWIG_TypeError      	   -5
-#define  SWIG_DivisionByZero 	   -6
-#define  SWIG_OverflowError  	   -7
-#define  SWIG_SyntaxError    	   -8
-#define  SWIG_ValueError     	   -9
-#define  SWIG_SystemError    	   -10
-#define  SWIG_AttributeError 	   -11
-#define  SWIG_MemoryError    	   -12
-#define  SWIG_NullReferenceError   -13
-
-
-
-/* Compatibility macros for Python 3 */
-#if PY_VERSION_HEX >= 0x03000000
-
-#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
-#define PyInt_Check(x) PyLong_Check(x)
-#define PyInt_AsLong(x) PyLong_AsLong(x)
-#define PyInt_FromLong(x) PyLong_FromLong(x)
-#define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
-#define PyString_Check(name) PyBytes_Check(name)
-#define PyString_FromString(x) PyUnicode_FromString(x)
-#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
-#define PyString_AsString(str) PyBytes_AsString(str)
-#define PyString_Size(str) PyBytes_Size(str)	
-#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
-#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
-#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
-#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
-
-#endif
-
-#ifndef Py_TYPE
-#  define Py_TYPE(op) ((op)->ob_type)
-#endif
-
-/* SWIG APIs for compatibility of both Python 2 & 3 */
-
-#if PY_VERSION_HEX >= 0x03000000
-#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
-#else
-#  define SWIG_Python_str_FromFormat PyString_FromFormat
-#endif
-
-
-/* Warning: This function will allocate a new string in Python 3,
- * so please call SWIG_Python_str_DelForPy3(x) to free the space.
- */
-SWIGINTERN char*
-SWIG_Python_str_AsChar(PyObject *str)
-{
-#if PY_VERSION_HEX >= 0x03000000
-  char *cstr;
-  char *newstr;
-  Py_ssize_t len;
-  str = PyUnicode_AsUTF8String(str);
-  PyBytes_AsStringAndSize(str, &cstr, &len);
-  newstr = (char *) malloc(len+1);
-  memcpy(newstr, cstr, len+1);
-  Py_XDECREF(str);
-  return newstr;
-#else
-  return PyString_AsString(str);
-#endif
-}
-
-#if PY_VERSION_HEX >= 0x03000000
-#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
-#else
-#  define SWIG_Python_str_DelForPy3(x) 
-#endif
-
-
-SWIGINTERN PyObject*
-SWIG_Python_str_FromChar(const char *c)
-{
-#if PY_VERSION_HEX >= 0x03000000
-  return PyUnicode_FromString(c); 
-#else
-  return PyString_FromString(c);
-#endif
-}
-
-/* Add PyOS_snprintf for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
-#  define PyOS_snprintf _snprintf
-# else
-#  define PyOS_snprintf snprintf
-# endif
-#endif
-
-/* A crude PyString_FromFormat implementation for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-
-#ifndef SWIG_PYBUFFER_SIZE
-# define SWIG_PYBUFFER_SIZE 1024
-#endif
-
-static PyObject *
-PyString_FromFormat(const char *fmt, ...) {
-  va_list ap;
-  char buf[SWIG_PYBUFFER_SIZE * 2];
-  int res;
-  va_start(ap, fmt);
-  res = vsnprintf(buf, sizeof(buf), fmt, ap);
-  va_end(ap);
-  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
-}
-#endif
-
-#ifndef PyObject_DEL
-# define PyObject_DEL PyObject_Del
-#endif
-
-/* A crude PyExc_StopIteration exception for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-# ifndef PyExc_StopIteration
-#  define PyExc_StopIteration PyExc_RuntimeError
-# endif
-# ifndef PyObject_GenericGetAttr
-#  define PyObject_GenericGetAttr 0
-# endif
-#endif
-
-/* Py_NotImplemented is defined in 2.1 and up. */
-#if PY_VERSION_HEX < 0x02010000
-# ifndef Py_NotImplemented
-#  define Py_NotImplemented PyExc_RuntimeError
-# endif
-#endif
-
-/* A crude PyString_AsStringAndSize implementation for old Pythons */
-#if PY_VERSION_HEX < 0x02010000
-# ifndef PyString_AsStringAndSize
-#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
-# endif
-#endif
-
-/* PySequence_Size for old Pythons */
-#if PY_VERSION_HEX < 0x02000000
-# ifndef PySequence_Size
-#  define PySequence_Size PySequence_Length
-# endif
-#endif
-
-/* PyBool_FromLong for old Pythons */
-#if PY_VERSION_HEX < 0x02030000
-static
-PyObject *PyBool_FromLong(long ok)
-{
-  PyObject *result = ok ? Py_True : Py_False;
-  Py_INCREF(result);
-  return result;
-}
-#endif
-
-/* Py_ssize_t for old Pythons */
-/* This code is as recommended by: */
-/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-# define PY_SSIZE_T_MAX INT_MAX
-# define PY_SSIZE_T_MIN INT_MIN
-typedef inquiry lenfunc;
-typedef intargfunc ssizeargfunc;
-typedef intintargfunc ssizessizeargfunc;
-typedef intobjargproc ssizeobjargproc;
-typedef intintobjargproc ssizessizeobjargproc;
-typedef getreadbufferproc readbufferproc;
-typedef getwritebufferproc writebufferproc;
-typedef getsegcountproc segcountproc;
-typedef getcharbufferproc charbufferproc;
-static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
-{
-  long result = 0;
-  PyObject *i = PyNumber_Int(x);
-  if (i) {
-    result = PyInt_AsLong(i);
-    Py_DECREF(i);
-  }
-  return result;
-}
-#endif
-
-#if PY_VERSION_HEX < 0x02050000
-#define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
-#endif
-
-#if PY_VERSION_HEX < 0x02040000
-#define Py_VISIT(op)				\
-  do { 						\
-    if (op) {					\
-      int vret = visit((op), arg);		\
-      if (vret)					\
-        return vret;				\
-    }						\
-  } while (0)
-#endif
-
-#if PY_VERSION_HEX < 0x02030000
-typedef struct {
-  PyTypeObject type;
-  PyNumberMethods as_number;
-  PyMappingMethods as_mapping;
-  PySequenceMethods as_sequence;
-  PyBufferProcs as_buffer;
-  PyObject *name, *slots;
-} PyHeapTypeObject;
-#endif
-
-#if PY_VERSION_HEX < 0x02030000
-typedef destructor freefunc;
-#endif
-
-#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
-     (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
-     (PY_MAJOR_VERSION > 3))
-# define SWIGPY_USE_CAPSULE
-# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
-#endif
-
-#if PY_VERSION_HEX < 0x03020000
-#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
-#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
-#define Py_hash_t long
-#endif
-
-/* -----------------------------------------------------------------------------
- * error manipulation
- * ----------------------------------------------------------------------------- */
-
-SWIGRUNTIME PyObject*
-SWIG_Python_ErrorType(int code) {
-  PyObject* type = 0;
-  switch(code) {
-  case SWIG_MemoryError:
-    type = PyExc_MemoryError;
-    break;
-  case SWIG_IOError:
-    type = PyExc_IOError;
-    break;
-  case SWIG_RuntimeError:
-    type = PyExc_RuntimeError;
-    break;
-  case SWIG_IndexError:
-    type = PyExc_IndexError;
-    break;
-  case SWIG_TypeError:
-    type = PyExc_TypeError;
-    break;
-  case SWIG_DivisionByZero:
-    type = PyExc_ZeroDivisionError;
-    break;
-  case SWIG_OverflowError:
-    type = PyExc_OverflowError;
-    break;
-  case SWIG_SyntaxError:
-    type = PyExc_SyntaxError;
-    break;
-  case SWIG_ValueError:
-    type = PyExc_ValueError;
-    break;
-  case SWIG_SystemError:
-    type = PyExc_SystemError;
-    break;
-  case SWIG_AttributeError:
-    type = PyExc_AttributeError;
-    break;
-  default:
-    type = PyExc_RuntimeError;
-  }
-  return type;
-}
-
-
-SWIGRUNTIME void
-SWIG_Python_AddErrorMsg(const char* mesg)
-{
-  PyObject *type = 0;
-  PyObject *value = 0;
-  PyObject *traceback = 0;
-
-  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
-  if (value) {
-    char *tmp;
-    PyObject *old_str = PyObject_Str(value);
-    PyErr_Clear();
-    Py_XINCREF(type);
-
-    PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
-    SWIG_Python_str_DelForPy3(tmp);
-    Py_DECREF(old_str);
-    Py_DECREF(value);
-  } else {
-    PyErr_SetString(PyExc_RuntimeError, mesg);
-  }
-}
-
-#if defined(SWIG_PYTHON_NO_THREADS)
-#  if defined(SWIG_PYTHON_THREADS)
-#    undef SWIG_PYTHON_THREADS
-#  endif
-#endif
-#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
-#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
-#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
-#      define SWIG_PYTHON_USE_GIL
-#    endif
-#  endif
-#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
-#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
-#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
-#    endif
-#    ifdef __cplusplus /* C++ code */
-       class SWIG_Python_Thread_Block {
-         bool status;
-         PyGILState_STATE state;
-       public:
-         void end() { if (status) { PyGILState_Release(state); status = false;} }
-         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
-         ~SWIG_Python_Thread_Block() { end(); }
-       };
-       class SWIG_Python_Thread_Allow {
-         bool status;
-         PyThreadState *save;
-       public:
-         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
-         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
-         ~SWIG_Python_Thread_Allow() { end(); }
-       };
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
-#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
-#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
-#    else /* C code */
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
-#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
-#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
-#    endif
-#  else /* Old thread way, not implemented, user must provide it */
-#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
-#      define SWIG_PYTHON_INITIALIZE_THREADS
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
-#      define SWIG_PYTHON_THREAD_END_BLOCK
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
-#      define SWIG_PYTHON_THREAD_END_ALLOW
-#    endif
-#  endif
-#else /* No thread support */
-#  define SWIG_PYTHON_INITIALIZE_THREADS
-#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
-#  define SWIG_PYTHON_THREAD_END_BLOCK
-#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
-#  define SWIG_PYTHON_THREAD_END_ALLOW
-#endif
-
-/* -----------------------------------------------------------------------------
- * Python API portion that goes into the runtime
- * ----------------------------------------------------------------------------- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* -----------------------------------------------------------------------------
- * Constant declarations
- * ----------------------------------------------------------------------------- */
-
-/* Constant Types */
-#define SWIG_PY_POINTER 4
-#define SWIG_PY_BINARY  5
-
-/* Constant information structure */
-typedef struct swig_const_info {
-  int type;
-  char *name;
-  long lvalue;
-  double dvalue;
-  void   *pvalue;
-  swig_type_info **ptype;
-} swig_const_info;
-
-
-/* -----------------------------------------------------------------------------
- * Wrapper of PyInstanceMethod_New() used in Python 3
- * It is exported to the generated module, used for -fastproxy
- * ----------------------------------------------------------------------------- */
-#if PY_VERSION_HEX >= 0x03000000
-SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
-{
-  return PyInstanceMethod_New(func);
-}
-#else
-SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
-{
-  return NULL;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/* -----------------------------------------------------------------------------
- * pyrun.swg
- *
- * This file contains the runtime support for Python modules
- * and includes code for managing global variables and pointer
- * type checking.
- *
- * ----------------------------------------------------------------------------- */
-
-/* Common SWIG API */
-
-/* for raw pointers */
-#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
-#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
-#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
-
-#ifdef SWIGPYTHON_BUILTIN
-#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
-#else
-#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
-#endif
-
-#define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
-
-#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
-#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
-#define swig_owntype                                    int
-
-/* for raw packed data */
-#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
-#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
-
-/* for class or struct pointers */
-#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
-#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
-
-/* for C or C++ function pointers */
-#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
-#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
-
-/* for C++ member pointers, ie, member methods */
-#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
-#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
-
-
-/* Runtime API */
-
-#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
-#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
-#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
-
-#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
-#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
-#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
-#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
-#define SWIG_fail                        		goto fail					   
-
-
-/* Runtime API implementation */
-
-/* Error manipulation */
-
-SWIGINTERN void 
-SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
-  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
-  PyErr_SetObject(errtype, obj);
-  Py_DECREF(obj);
-  SWIG_PYTHON_THREAD_END_BLOCK;
-}
-
-SWIGINTERN void 
-SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
-  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-  PyErr_SetString(errtype, msg);
-  SWIG_PYTHON_THREAD_END_BLOCK;
-}
-
-#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
-
-/* Set a constant value */
-
-#if defined(SWIGPYTHON_BUILTIN)
-
-SWIGINTERN void
-SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
-  PyObject *s = PyString_InternFromString(key);
-  PyList_Append(seq, s);
-  Py_DECREF(s);
-}
-
-SWIGINTERN void
-SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {   
-#if PY_VERSION_HEX < 0x02030000
-  PyDict_SetItemString(d, (char *)name, obj);
-#else
-  PyDict_SetItemString(d, name, obj);
-#endif
-  Py_DECREF(obj);
-  if (public_interface)
-    SwigPyBuiltin_AddPublicSymbol(public_interface, name);
-}
-
-#else
-
-SWIGINTERN void
-SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
-#if PY_VERSION_HEX < 0x02030000
-  PyDict_SetItemString(d, (char *)name, obj);
-#else
-  PyDict_SetItemString(d, name, obj);
-#endif
-  Py_DECREF(obj);                            
-}
-
-#endif
-
-/* Append a value to the result obj */
-
-SWIGINTERN PyObject*
-SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
-#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
-  if (!result) {
-    result = obj;
-  } else if (result == Py_None) {
-    Py_DECREF(result);
-    result = obj;
-  } else {
-    if (!PyList_Check(result)) {
-      PyObject *o2 = result;
-      result = PyList_New(1);
-      PyList_SetItem(result, 0, o2);
-    }
-    PyList_Append(result,obj);
-    Py_DECREF(obj);
-  }
-  return result;
-#else
-  PyObject*   o2;
-  PyObject*   o3;
-  if (!result) {
-    result = obj;
-  } else if (result == Py_None) {
-    Py_DECREF(result);
-    result = obj;
-  } else {
-    if (!PyTuple_Check(result)) {
-      o2 = result;
-      result = PyTuple_New(1);
-      PyTuple_SET_ITEM(result, 0, o2);
-    }
-    o3 = PyTuple_New(1);
-    PyTuple_SET_ITEM(o3, 0, obj);
-    o2 = result;
-    result = PySequence_Concat(o2, o3);
-    Py_DECREF(o2);
-    Py_DECREF(o3);
-  }
-  return result;
-#endif
-}
-
-/* Unpack the argument tuple */
-
-SWIGINTERN Py_ssize_t
-SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
-{
-  if (!args) {
-    if (!min && !max) {
-      return 1;
-    } else {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
-		   name, (min == max ? "" : "at least "), (int)min);
-      return 0;
-    }
-  }  
-  if (!PyTuple_Check(args)) {
-    if (min <= 1 && max >= 1) {
-      Py_ssize_t i;
-      objs[0] = args;
-      for (i = 1; i < max; ++i) {
-	objs[i] = 0;
-      }
-      return 2;
-    }
-    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
-    return 0;
-  } else {
-    Py_ssize_t l = PyTuple_GET_SIZE(args);
-    if (l < min) {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
-		   name, (min == max ? "" : "at least "), (int)min, (int)l);
-      return 0;
-    } else if (l > max) {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
-		   name, (min == max ? "" : "at most "), (int)max, (int)l);
-      return 0;
-    } else {
-      Py_ssize_t i;
-      for (i = 0; i < l; ++i) {
-	objs[i] = PyTuple_GET_ITEM(args, i);
-      }
-      for (; l < max; ++l) {
-	objs[l] = 0;
-      }
-      return i + 1;
-    }    
-  }
-}
-
-/* A functor is a function object with one single object argument */
-#if PY_VERSION_HEX >= 0x02020000
-#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
-#else
-#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
-#endif
-
-/*
-  Helper for static pointer initialization for both C and C++ code, for example
-  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
-*/
-#ifdef __cplusplus
-#define SWIG_STATIC_POINTER(var)  var
-#else
-#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
-#endif
-
-/* -----------------------------------------------------------------------------
- * Pointer declarations
- * ----------------------------------------------------------------------------- */
-
-/* Flags for new pointer objects */
-#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
-#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
-
-#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
-
-#define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
-#define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*  How to access Py_None */
-#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#  ifndef SWIG_PYTHON_NO_BUILD_NONE
-#    ifndef SWIG_PYTHON_BUILD_NONE
-#      define SWIG_PYTHON_BUILD_NONE
-#    endif
-#  endif
-#endif
-
-#ifdef SWIG_PYTHON_BUILD_NONE
-#  ifdef Py_None
-#   undef Py_None
-#   define Py_None SWIG_Py_None()
-#  endif
-SWIGRUNTIMEINLINE PyObject * 
-_SWIG_Py_None(void)
-{
-  PyObject *none = Py_BuildValue((char*)"");
-  Py_DECREF(none);
-  return none;
-}
-SWIGRUNTIME PyObject * 
-SWIG_Py_None(void)
-{
-  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
-  return none;
-}
-#endif
-
-/* The python void return value */
-
-SWIGRUNTIMEINLINE PyObject * 
-SWIG_Py_Void(void)
-{
-  PyObject *none = Py_None;
-  Py_INCREF(none);
-  return none;
-}
-
-/* SwigPyClientData */
-
-typedef struct {
-  PyObject *klass;
-  PyObject *newraw;
-  PyObject *newargs;
-  PyObject *destroy;
-  int delargs;
-  int implicitconv;
-  PyTypeObject *pytype;
-} SwigPyClientData;
-
-SWIGRUNTIMEINLINE int 
-SWIG_Python_CheckImplicit(swig_type_info *ty)
-{
-  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
-  return data ? data->implicitconv : 0;
-}
-
-SWIGRUNTIMEINLINE PyObject *
-SWIG_Python_ExceptionType(swig_type_info *desc) {
-  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
-  PyObject *klass = data ? data->klass : 0;
-  return (klass ? klass : PyExc_RuntimeError);
-}
-
-
-SWIGRUNTIME SwigPyClientData * 
-SwigPyClientData_New(PyObject* obj)
-{
-  if (!obj) {
-    return 0;
-  } else {
-    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
-    /* the klass element */
-    data->klass = obj;
-    Py_INCREF(data->klass);
-    /* the newraw method and newargs arguments used to create a new raw instance */
-    if (PyClass_Check(obj)) {
-      data->newraw = 0;
-      data->newargs = obj;
-      Py_INCREF(obj);
-    } else {
-#if (PY_VERSION_HEX < 0x02020000)
-      data->newraw = 0;
-#else
-      data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
-#endif
-      if (data->newraw) {
-	Py_INCREF(data->newraw);
-	data->newargs = PyTuple_New(1);
-	PyTuple_SetItem(data->newargs, 0, obj);
-      } else {
-	data->newargs = obj;
-      }
-      Py_INCREF(data->newargs);
-    }
-    /* the destroy method, aka as the C++ delete method */
-    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
-    if (PyErr_Occurred()) {
-      PyErr_Clear();
-      data->destroy = 0;
-    }
-    if (data->destroy) {
-      int flags;
-      Py_INCREF(data->destroy);
-      flags = PyCFunction_GET_FLAGS(data->destroy);
-#ifdef METH_O
-      data->delargs = !(flags & (METH_O));
-#else
-      data->delargs = 0;
-#endif
-    } else {
-      data->delargs = 0;
-    }
-    data->implicitconv = 0;
-    data->pytype = 0;
-    return data;
-  }
-}
-
-SWIGRUNTIME void 
-SwigPyClientData_Del(SwigPyClientData *data) {
-  Py_XDECREF(data->newraw);
-  Py_XDECREF(data->newargs);
-  Py_XDECREF(data->destroy);
-}
-
-/* =============== SwigPyObject =====================*/
-
-typedef struct {
-  PyObject_HEAD
-  void *ptr;
-  swig_type_info *ty;
-  int own;
-  PyObject *next;
-#ifdef SWIGPYTHON_BUILTIN
-  PyObject *dict;
-#endif
-} SwigPyObject;
-
-
-#ifdef SWIGPYTHON_BUILTIN
-
-SWIGRUNTIME PyObject *
-SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
-{
-  SwigPyObject *sobj = (SwigPyObject *)v;
-
-  if (!sobj->dict)
-    sobj->dict = PyDict_New();
-
-  Py_INCREF(sobj->dict);
-  return sobj->dict;
-}
-
-#endif
-
-SWIGRUNTIME PyObject *
-SwigPyObject_long(SwigPyObject *v)
-{
-  return PyLong_FromVoidPtr(v->ptr);
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_format(const char* fmt, SwigPyObject *v)
-{
-  PyObject *res = NULL;
-  PyObject *args = PyTuple_New(1);
-  if (args) {
-    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
-      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
-      if (ofmt) {
-#if PY_VERSION_HEX >= 0x03000000
-	res = PyUnicode_Format(ofmt,args);
-#else
-	res = PyString_Format(ofmt,args);
-#endif
-	Py_DECREF(ofmt);
-      }
-      Py_DECREF(args);
-    }
-  }
-  return res;
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_oct(SwigPyObject *v)
-{
-  return SwigPyObject_format("%o",v);
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_hex(SwigPyObject *v)
-{
-  return SwigPyObject_format("%x",v);
-}
-
-SWIGRUNTIME PyObject *
-#ifdef METH_NOARGS
-SwigPyObject_repr(SwigPyObject *v)
-#else
-SwigPyObject_repr(SwigPyObject *v, PyObject *args)
-#endif
-{
-  const char *name = SWIG_TypePrettyName(v->ty);
-  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
-  if (v->next) {
-# ifdef METH_NOARGS
-    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
-# else
-    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
-# endif
-# if PY_VERSION_HEX >= 0x03000000
-    PyObject *joined = PyUnicode_Concat(repr, nrep);
-    Py_DecRef(repr);
-    Py_DecRef(nrep);
-    repr = joined;
-# else
-    PyString_ConcatAndDel(&repr,nrep);
-# endif
-  }
-  return repr;  
-}
-
-SWIGRUNTIME int
-SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
-{
-  void *i = v->ptr;
-  void *j = w->ptr;
-  return (i < j) ? -1 : ((i > j) ? 1 : 0);
-}
-
-/* Added for Python 3.x, would it also be useful for Python 2.x? */
-SWIGRUNTIME PyObject*
-SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
-{
-  PyObject* res;
-  if( op != Py_EQ && op != Py_NE ) {
-    Py_INCREF(Py_NotImplemented);
-    return Py_NotImplemented;
-  }
-  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
-  return res;  
-}
-
-
-SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
-
-#ifdef SWIGPYTHON_BUILTIN
-static swig_type_info *SwigPyObject_stype = 0;
-SWIGRUNTIME PyTypeObject*
-SwigPyObject_type(void) {
-    SwigPyClientData *cd;
-    assert(SwigPyObject_stype);
-    cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
-    assert(cd);
-    assert(cd->pytype);
-    return cd->pytype;
-}
-#else
-SWIGRUNTIME PyTypeObject*
-SwigPyObject_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
-  return type;
-}
-#endif
-
-SWIGRUNTIMEINLINE int
-SwigPyObject_Check(PyObject *op) {
-#ifdef SWIGPYTHON_BUILTIN
-  PyTypeObject *target_tp = SwigPyObject_type();
-  if (PyType_IsSubtype(op->ob_type, target_tp))
-    return 1;
-  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
-#else
-  return (Py_TYPE(op) == SwigPyObject_type())
-    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
-#endif
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
-
-SWIGRUNTIME void
-SwigPyObject_dealloc(PyObject *v)
-{
-  SwigPyObject *sobj = (SwigPyObject *) v;
-  PyObject *next = sobj->next;
-  if (sobj->own == SWIG_POINTER_OWN) {
-    swig_type_info *ty = sobj->ty;
-    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
-    PyObject *destroy = data ? data->destroy : 0;
-    if (destroy) {
-      /* destroy is always a VARARGS method */
-      PyObject *res;
-
-      /* PyObject_CallFunction() has the potential to silently drop
-         the active active exception.  In cases of unnamed temporary
-         variable or where we just finished iterating over a generator
-         StopIteration will be active right now, and this needs to
-         remain true upon return from SwigPyObject_dealloc.  So save
-         and restore. */
-      
-      PyObject *val = NULL, *type = NULL, *tb = NULL;
-      PyErr_Fetch(&val, &type, &tb);
-
-      if (data->delargs) {
-        /* we need to create a temporary object to carry the destroy operation */
-        PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
-        res = SWIG_Python_CallFunctor(destroy, tmp);
-        Py_DECREF(tmp);
-      } else {
-        PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
-        PyObject *mself = PyCFunction_GET_SELF(destroy);
-        res = ((*meth)(mself, v));
-      }
-      if (!res)
-        PyErr_WriteUnraisable(destroy);
-
-      PyErr_Restore(val, type, tb);
-
-      Py_XDECREF(res);
-    } 
-#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
-    else {
-      const char *name = SWIG_TypePrettyName(ty);
-      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
-    }
-#endif
-  } 
-  Py_XDECREF(next);
-  PyObject_DEL(v);
-}
-
-SWIGRUNTIME PyObject* 
-SwigPyObject_append(PyObject* v, PyObject* next)
-{
-  SwigPyObject *sobj = (SwigPyObject *) v;
-#ifndef METH_O
-  PyObject *tmp = 0;
-  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
-  next = tmp;
-#endif
-  if (!SwigPyObject_Check(next)) {
-    PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
-    return NULL;
-  }
-  sobj->next = next;
-  Py_INCREF(next);
-  return SWIG_Py_Void();
-}
-
-SWIGRUNTIME PyObject* 
-#ifdef METH_NOARGS
-SwigPyObject_next(PyObject* v)
-#else
-SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  SwigPyObject *sobj = (SwigPyObject *) v;
-  if (sobj->next) {    
-    Py_INCREF(sobj->next);
-    return sobj->next;
-  } else {
-    return SWIG_Py_Void();
-  }
-}
-
-SWIGINTERN PyObject*
-#ifdef METH_NOARGS
-SwigPyObject_disown(PyObject *v)
-#else
-SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  SwigPyObject *sobj = (SwigPyObject *)v;
-  sobj->own = 0;
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject*
-#ifdef METH_NOARGS
-SwigPyObject_acquire(PyObject *v)
-#else
-SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  SwigPyObject *sobj = (SwigPyObject *)v;
-  sobj->own = SWIG_POINTER_OWN;
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject*
-SwigPyObject_own(PyObject *v, PyObject *args)
-{
-  PyObject *val = 0;
-#if (PY_VERSION_HEX < 0x02020000)
-  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
-#elif (PY_VERSION_HEX < 0x02050000)
-  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
-#else
-  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) 
-#endif
-    {
-      return NULL;
-    } 
-  else
-    {
-      SwigPyObject *sobj = (SwigPyObject *)v;
-      PyObject *obj = PyBool_FromLong(sobj->own);
-      if (val) {
-#ifdef METH_NOARGS
-	if (PyObject_IsTrue(val)) {
-	  SwigPyObject_acquire(v);
-	} else {
-	  SwigPyObject_disown(v);
-	}
-#else
-	if (PyObject_IsTrue(val)) {
-	  SwigPyObject_acquire(v,args);
-	} else {
-	  SwigPyObject_disown(v,args);
-	}
-#endif
-      } 
-      return obj;
-    }
-}
-
-#ifdef METH_O
-static PyMethodDef
-swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"acquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
-  {0, 0, 0, 0}  
-};
-#else
-static PyMethodDef
-swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"acquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
-  {0, 0, 0, 0}  
-};
-#endif
-
-#if PY_VERSION_HEX < 0x02020000
-SWIGINTERN PyObject *
-SwigPyObject_getattr(SwigPyObject *sobj,char *name)
-{
-  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
-}
-#endif
-
-SWIGRUNTIME PyTypeObject*
-SwigPyObject_TypeOnce(void) {
-  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
-
-  static PyNumberMethods SwigPyObject_as_number = {
-    (binaryfunc)0, /*nb_add*/
-    (binaryfunc)0, /*nb_subtract*/
-    (binaryfunc)0, /*nb_multiply*/
-    /* nb_divide removed in Python 3 */
-#if PY_VERSION_HEX < 0x03000000
-    (binaryfunc)0, /*nb_divide*/
-#endif
-    (binaryfunc)0, /*nb_remainder*/
-    (binaryfunc)0, /*nb_divmod*/
-    (ternaryfunc)0,/*nb_power*/
-    (unaryfunc)0,  /*nb_negative*/
-    (unaryfunc)0,  /*nb_positive*/
-    (unaryfunc)0,  /*nb_absolute*/
-    (inquiry)0,    /*nb_nonzero*/
-    0,		   /*nb_invert*/
-    0,		   /*nb_lshift*/
-    0,		   /*nb_rshift*/
-    0,		   /*nb_and*/
-    0,		   /*nb_xor*/
-    0,		   /*nb_or*/
-#if PY_VERSION_HEX < 0x03000000
-    0,   /*nb_coerce*/
-#endif
-    (unaryfunc)SwigPyObject_long, /*nb_int*/
-#if PY_VERSION_HEX < 0x03000000
-    (unaryfunc)SwigPyObject_long, /*nb_long*/
-#else
-    0, /*nb_reserved*/
-#endif
-    (unaryfunc)0,                 /*nb_float*/
-#if PY_VERSION_HEX < 0x03000000
-    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
-    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
-#endif
-#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
-#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
-#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
-#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
-#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
-    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
-#endif
-  };
-
-  static PyTypeObject swigpyobject_type;
-  static int type_init = 0;
-  if (!type_init) {
-    const PyTypeObject tmp = {
-#if PY_VERSION_HEX >= 0x03000000
-      PyVarObject_HEAD_INIT(NULL, 0)
-#else
-      PyObject_HEAD_INIT(NULL)
-      0,                                    /* ob_size */
-#endif
-      (char *)"SwigPyObject",               /* tp_name */
-      sizeof(SwigPyObject),                 /* tp_basicsize */
-      0,                                    /* tp_itemsize */
-      (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
-      0,                                    /* tp_print */
-#if PY_VERSION_HEX < 0x02020000
-      (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
-#else
-      (getattrfunc)0,                       /* tp_getattr */
-#endif
-      (setattrfunc)0,                       /* tp_setattr */
-#if PY_VERSION_HEX >= 0x03000000
-      0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
-#else
-      (cmpfunc)SwigPyObject_compare,        /* tp_compare */
-#endif
-      (reprfunc)SwigPyObject_repr,          /* tp_repr */
-      &SwigPyObject_as_number,              /* tp_as_number */
-      0,                                    /* tp_as_sequence */
-      0,                                    /* tp_as_mapping */
-      (hashfunc)0,                          /* tp_hash */
-      (ternaryfunc)0,                       /* tp_call */
-      0,                                    /* tp_str */
-      PyObject_GenericGetAttr,              /* tp_getattro */
-      0,                                    /* tp_setattro */
-      0,                                    /* tp_as_buffer */
-      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
-      swigobject_doc,                       /* tp_doc */
-      0,                                    /* tp_traverse */
-      0,                                    /* tp_clear */
-      (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
-      0,                                    /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-      0,                                    /* tp_iter */
-      0,                                    /* tp_iternext */
-      swigobject_methods,                   /* tp_methods */
-      0,                                    /* tp_members */
-      0,                                    /* tp_getset */
-      0,                                    /* tp_base */
-      0,                                    /* tp_dict */
-      0,                                    /* tp_descr_get */
-      0,                                    /* tp_descr_set */
-      0,                                    /* tp_dictoffset */
-      0,                                    /* tp_init */
-      0,                                    /* tp_alloc */
-      0,                                    /* tp_new */
-      0,                                    /* tp_free */
-      0,                                    /* tp_is_gc */
-      0,                                    /* tp_bases */
-      0,                                    /* tp_mro */
-      0,                                    /* tp_cache */
-      0,                                    /* tp_subclasses */
-      0,                                    /* tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-      0,                                    /* tp_del */
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-      0,                                    /* tp_version_tag */
-#endif
-#if PY_VERSION_HEX >= 0x03040000
-      0,                                    /* tp_finalize */
-#endif
-#ifdef COUNT_ALLOCS
-      0,                                    /* tp_allocs */
-      0,                                    /* tp_frees */
-      0,                                    /* tp_maxalloc */
-#if PY_VERSION_HEX >= 0x02050000
-      0,                                    /* tp_prev */
-#endif
-      0                                     /* tp_next */
-#endif
-    };
-    swigpyobject_type = tmp;
-    type_init = 1;
-#if PY_VERSION_HEX < 0x02020000
-    swigpyobject_type.ob_type = &PyType_Type;
-#else
-    if (PyType_Ready(&swigpyobject_type) < 0)
-      return NULL;
-#endif
-  }
-  return &swigpyobject_type;
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
-{
-  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
-  if (sobj) {
-    sobj->ptr  = ptr;
-    sobj->ty   = ty;
-    sobj->own  = own;
-    sobj->next = 0;
-  }
-  return (PyObject *)sobj;
-}
-
-/* -----------------------------------------------------------------------------
- * Implements a simple Swig Packed type, and use it instead of string
- * ----------------------------------------------------------------------------- */
-
-typedef struct {
-  PyObject_HEAD
-  void *pack;
-  swig_type_info *ty;
-  size_t size;
-} SwigPyPacked;
-
-SWIGRUNTIME int
-SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
-{
-  char result[SWIG_BUFFER_SIZE];
-  fputs("<Swig Packed ", fp); 
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    fputs("at ", fp); 
-    fputs(result, fp); 
-  }
-  fputs(v->ty->name,fp); 
-  fputs(">", fp);
-  return 0; 
-}
-  
-SWIGRUNTIME PyObject *
-SwigPyPacked_repr(SwigPyPacked *v)
-{
-  char result[SWIG_BUFFER_SIZE];
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
-  } else {
-    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
-  }  
-}
-
-SWIGRUNTIME PyObject *
-SwigPyPacked_str(SwigPyPacked *v)
-{
-  char result[SWIG_BUFFER_SIZE];
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
-    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
-  } else {
-    return SWIG_Python_str_FromChar(v->ty->name);
-  }  
-}
-
-SWIGRUNTIME int
-SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
-{
-  size_t i = v->size;
-  size_t j = w->size;
-  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
-  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
-}
-
-SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
-
-SWIGRUNTIME PyTypeObject*
-SwigPyPacked_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
-  return type;
-}
-
-SWIGRUNTIMEINLINE int
-SwigPyPacked_Check(PyObject *op) {
-  return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
-    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
-}
-
-SWIGRUNTIME void
-SwigPyPacked_dealloc(PyObject *v)
-{
-  if (SwigPyPacked_Check(v)) {
-    SwigPyPacked *sobj = (SwigPyPacked *) v;
-    free(sobj->pack);
-  }
-  PyObject_DEL(v);
-}
-
-SWIGRUNTIME PyTypeObject*
-SwigPyPacked_TypeOnce(void) {
-  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
-  static PyTypeObject swigpypacked_type;
-  static int type_init = 0;
-  if (!type_init) {
-    const PyTypeObject tmp = {
-#if PY_VERSION_HEX>=0x03000000
-      PyVarObject_HEAD_INIT(NULL, 0)
-#else
-      PyObject_HEAD_INIT(NULL)
-      0,                                    /* ob_size */
-#endif
-      (char *)"SwigPyPacked",               /* tp_name */
-      sizeof(SwigPyPacked),                 /* tp_basicsize */
-      0,                                    /* tp_itemsize */
-      (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
-      (printfunc)SwigPyPacked_print,        /* tp_print */
-      (getattrfunc)0,                       /* tp_getattr */
-      (setattrfunc)0,                       /* tp_setattr */
-#if PY_VERSION_HEX>=0x03000000
-      0, /* tp_reserved in 3.0.1 */
-#else
-      (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
-#endif
-      (reprfunc)SwigPyPacked_repr,          /* tp_repr */
-      0,                                    /* tp_as_number */
-      0,                                    /* tp_as_sequence */
-      0,                                    /* tp_as_mapping */
-      (hashfunc)0,                          /* tp_hash */
-      (ternaryfunc)0,                       /* tp_call */
-      (reprfunc)SwigPyPacked_str,           /* tp_str */
-      PyObject_GenericGetAttr,              /* tp_getattro */
-      0,                                    /* tp_setattro */
-      0,                                    /* tp_as_buffer */
-      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
-      swigpacked_doc,                       /* tp_doc */
-      0,                                    /* tp_traverse */
-      0,                                    /* tp_clear */
-      0,                                    /* tp_richcompare */
-      0,                                    /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-      0,                                    /* tp_iter */
-      0,                                    /* tp_iternext */
-      0,                                    /* tp_methods */
-      0,                                    /* tp_members */
-      0,                                    /* tp_getset */
-      0,                                    /* tp_base */
-      0,                                    /* tp_dict */
-      0,                                    /* tp_descr_get */
-      0,                                    /* tp_descr_set */
-      0,                                    /* tp_dictoffset */
-      0,                                    /* tp_init */
-      0,                                    /* tp_alloc */
-      0,                                    /* tp_new */
-      0,                                    /* tp_free */
-      0,                                    /* tp_is_gc */
-      0,                                    /* tp_bases */
-      0,                                    /* tp_mro */
-      0,                                    /* tp_cache */
-      0,                                    /* tp_subclasses */
-      0,                                    /* tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-      0,                                    /* tp_del */
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-      0,                                    /* tp_version_tag */
-#endif
-#if PY_VERSION_HEX >= 0x03040000
-      0,                                    /* tp_finalize */
-#endif
-#ifdef COUNT_ALLOCS
-      0,                                    /* tp_allocs */
-      0,                                    /* tp_frees */
-      0,                                    /* tp_maxalloc */
-#if PY_VERSION_HEX >= 0x02050000
-      0,                                    /* tp_prev */
-#endif
-      0                                     /* tp_next */
-#endif
-    };
-    swigpypacked_type = tmp;
-    type_init = 1;
-#if PY_VERSION_HEX < 0x02020000
-    swigpypacked_type.ob_type = &PyType_Type;
-#else
-    if (PyType_Ready(&swigpypacked_type) < 0)
-      return NULL;
-#endif
-  }
-  return &swigpypacked_type;
-}
-
-SWIGRUNTIME PyObject *
-SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
-{
-  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
-  if (sobj) {
-    void *pack = malloc(size);
-    if (pack) {
-      memcpy(pack, ptr, size);
-      sobj->pack = pack;
-      sobj->ty   = ty;
-      sobj->size = size;
-    } else {
-      PyObject_DEL((PyObject *) sobj);
-      sobj = 0;
-    }
-  }
-  return (PyObject *) sobj;
-}
-
-SWIGRUNTIME swig_type_info *
-SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
-{
-  if (SwigPyPacked_Check(obj)) {
-    SwigPyPacked *sobj = (SwigPyPacked *)obj;
-    if (sobj->size != size) return 0;
-    memcpy(ptr, sobj->pack, size);
-    return sobj->ty;
-  } else {
-    return 0;
-  }
-}
-
-/* -----------------------------------------------------------------------------
- * pointers/data manipulation
- * ----------------------------------------------------------------------------- */
-
-SWIGRUNTIMEINLINE PyObject *
-_SWIG_This(void)
-{
-    return SWIG_Python_str_FromChar("this");
-}
-
-static PyObject *swig_this = NULL;
-
-SWIGRUNTIME PyObject *
-SWIG_This(void)
-{
-  if (swig_this == NULL)
-    swig_this = _SWIG_This();
-  return swig_this;
-}
-
-/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
-
-/* TODO: I don't know how to implement the fast getset in Python 3 right now */
-#if PY_VERSION_HEX>=0x03000000
-#define SWIG_PYTHON_SLOW_GETSET_THIS 
-#endif
-
-SWIGRUNTIME SwigPyObject *
-SWIG_Python_GetSwigThis(PyObject *pyobj) 
-{
-  PyObject *obj;
-
-  if (SwigPyObject_Check(pyobj))
-    return (SwigPyObject *) pyobj;
-
-#ifdef SWIGPYTHON_BUILTIN
-  (void)obj;
-# ifdef PyWeakref_CheckProxy
-  if (PyWeakref_CheckProxy(pyobj)) {
-    pyobj = PyWeakref_GET_OBJECT(pyobj);
-    if (pyobj && SwigPyObject_Check(pyobj))
-      return (SwigPyObject*) pyobj;
-  }
-# endif
-  return NULL;
-#else
-
-  obj = 0;
-
-#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
-  if (PyInstance_Check(pyobj)) {
-    obj = _PyInstance_Lookup(pyobj, SWIG_This());      
-  } else {
-    PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
-    if (dictptr != NULL) {
-      PyObject *dict = *dictptr;
-      obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
-    } else {
-#ifdef PyWeakref_CheckProxy
-      if (PyWeakref_CheckProxy(pyobj)) {
-	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
-	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
-      }
-#endif
-      obj = PyObject_GetAttr(pyobj,SWIG_This());
-      if (obj) {
-	Py_DECREF(obj);
-      } else {
-	if (PyErr_Occurred()) PyErr_Clear();
-	return 0;
-      }
-    }
-  }
-#else
-  obj = PyObject_GetAttr(pyobj,SWIG_This());
-  if (obj) {
-    Py_DECREF(obj);
-  } else {
-    if (PyErr_Occurred()) PyErr_Clear();
-    return 0;
-  }
-#endif
-  if (obj && !SwigPyObject_Check(obj)) {
-    /* a PyObject is called 'this', try to get the 'real this'
-       SwigPyObject from it */ 
-    return SWIG_Python_GetSwigThis(obj);
-  }
-  return (SwigPyObject *)obj;
-#endif
-}
-
-/* Acquire a pointer value */
-
-SWIGRUNTIME int
-SWIG_Python_AcquirePtr(PyObject *obj, int own) {
-  if (own == SWIG_POINTER_OWN) {
-    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
-    if (sobj) {
-      int oldown = sobj->own;
-      sobj->own = own;
-      return oldown;
-    }
-  }
-  return 0;
-}
-
-/* Convert a pointer value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
-  int res;
-  SwigPyObject *sobj;
-  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
-
-  if (!obj)
-    return SWIG_ERROR;
-  if (obj == Py_None && !implicit_conv) {
-    if (ptr)
-      *ptr = 0;
-    return SWIG_OK;
-  }
-
-  res = SWIG_ERROR;
-
-  sobj = SWIG_Python_GetSwigThis(obj);
-  if (own)
-    *own = 0;
-  while (sobj) {
-    void *vptr = sobj->ptr;
-    if (ty) {
-      swig_type_info *to = sobj->ty;
-      if (to == ty) {
-        /* no type cast needed */
-        if (ptr) *ptr = vptr;
-        break;
-      } else {
-        swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
-        if (!tc) {
-          sobj = (SwigPyObject *)sobj->next;
-        } else {
-          if (ptr) {
-            int newmemory = 0;
-            *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
-            if (newmemory == SWIG_CAST_NEW_MEMORY) {
-              assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
-              if (own)
-                *own = *own | SWIG_CAST_NEW_MEMORY;
-            }
-          }
-          break;
-        }
-      }
-    } else {
-      if (ptr) *ptr = vptr;
-      break;
-    }
-  }
-  if (sobj) {
-    if (own)
-      *own = *own | sobj->own;
-    if (flags & SWIG_POINTER_DISOWN) {
-      sobj->own = 0;
-    }
-    res = SWIG_OK;
-  } else {
-    if (implicit_conv) {
-      SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
-      if (data && !data->implicitconv) {
-        PyObject *klass = data->klass;
-        if (klass) {
-          PyObject *impconv;
-          data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
-          impconv = SWIG_Python_CallFunctor(klass, obj);
-          data->implicitconv = 0;
-          if (PyErr_Occurred()) {
-            PyErr_Clear();
-            impconv = 0;
-          }
-          if (impconv) {
-            SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
-            if (iobj) {
-              void *vptr;
-              res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
-              if (SWIG_IsOK(res)) {
-                if (ptr) {
-                  *ptr = vptr;
-                  /* transfer the ownership to 'ptr' */
-                  iobj->own = 0;
-                  res = SWIG_AddCast(res);
-                  res = SWIG_AddNewMask(res);
-                } else {
-                  res = SWIG_AddCast(res);		    
-                }
-              }
-            }
-            Py_DECREF(impconv);
-          }
-        }
-      }
-    }
-    if (!SWIG_IsOK(res) && obj == Py_None) {
-      if (ptr)
-        *ptr = 0;
-      if (PyErr_Occurred())
-        PyErr_Clear();
-      res = SWIG_OK;
-    }
-  }
-  return res;
-}
-
-/* Convert a function ptr value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
-  if (!PyCFunction_Check(obj)) {
-    return SWIG_ConvertPtr(obj, ptr, ty, 0);
-  } else {
-    void *vptr = 0;
-    
-    /* here we get the method pointer for callbacks */
-    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
-    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
-    if (desc)
-      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
-    if (!desc) 
-      return SWIG_ERROR;
-    if (ty) {
-      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
-      if (tc) {
-        int newmemory = 0;
-        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
-        assert(!newmemory); /* newmemory handling not yet implemented */
-      } else {
-        return SWIG_ERROR;
-      }
-    } else {
-      *ptr = vptr;
-    }
-    return SWIG_OK;
-  }
-}
-
-/* Convert a packed value value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
-  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
-  if (!to) return SWIG_ERROR;
-  if (ty) {
-    if (to != ty) {
-      /* check type cast? */
-      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
-      if (!tc) return SWIG_ERROR;
-    }
-  }
-  return SWIG_OK;
-}  
-
-/* -----------------------------------------------------------------------------
- * Create a new pointer object
- * ----------------------------------------------------------------------------- */
-
-/*
-  Create a new instance object, without calling __init__, and set the
-  'this' attribute.
-*/
-
-SWIGRUNTIME PyObject* 
-SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
-{
-#if (PY_VERSION_HEX >= 0x02020000)
-  PyObject *inst = 0;
-  PyObject *newraw = data->newraw;
-  if (newraw) {
-    inst = PyObject_Call(newraw, data->newargs, NULL);
-    if (inst) {
-#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
-      PyObject **dictptr = _PyObject_GetDictPtr(inst);
-      if (dictptr != NULL) {
-	PyObject *dict = *dictptr;
-	if (dict == NULL) {
-	  dict = PyDict_New();
-	  *dictptr = dict;
-	  PyDict_SetItem(dict, SWIG_This(), swig_this);
-	}
-      }
-#else
-      PyObject *key = SWIG_This();
-      PyObject_SetAttr(inst, key, swig_this);
-#endif
-    }
-  } else {
-#if PY_VERSION_HEX >= 0x03000000
-    inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
-    if (inst) {
-      PyObject_SetAttr(inst, SWIG_This(), swig_this);
-      Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
-    }
-#else
-    PyObject *dict = PyDict_New();
-    if (dict) {
-      PyDict_SetItem(dict, SWIG_This(), swig_this);
-      inst = PyInstance_NewRaw(data->newargs, dict);
-      Py_DECREF(dict);
-    }
-#endif
-  }
-  return inst;
-#else
-#if (PY_VERSION_HEX >= 0x02010000)
-  PyObject *inst = 0;
-  PyObject *dict = PyDict_New();
-  if (dict) {
-    PyDict_SetItem(dict, SWIG_This(), swig_this);
-    inst = PyInstance_NewRaw(data->newargs, dict);
-    Py_DECREF(dict);
-  }
-  return (PyObject *) inst;
-#else
-  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
-  if (inst == NULL) {
-    return NULL;
-  }
-  inst->in_class = (PyClassObject *)data->newargs;
-  Py_INCREF(inst->in_class);
-  inst->in_dict = PyDict_New();
-  if (inst->in_dict == NULL) {
-    Py_DECREF(inst);
-    return NULL;
-  }
-#ifdef Py_TPFLAGS_HAVE_WEAKREFS
-  inst->in_weakreflist = NULL;
-#endif
-#ifdef Py_TPFLAGS_GC
-  PyObject_GC_Init(inst);
-#endif
-  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
-  return (PyObject *) inst;
-#endif
-#endif
-}
-
-SWIGRUNTIME void
-SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
-{
- PyObject *dict;
-#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
- PyObject **dictptr = _PyObject_GetDictPtr(inst);
- if (dictptr != NULL) {
-   dict = *dictptr;
-   if (dict == NULL) {
-     dict = PyDict_New();
-     *dictptr = dict;
-   }
-   PyDict_SetItem(dict, SWIG_This(), swig_this);
-   return;
- }
-#endif
- dict = PyObject_GetAttrString(inst, (char*)"__dict__");
- PyDict_SetItem(dict, SWIG_This(), swig_this);
- Py_DECREF(dict);
-} 
-
-
-SWIGINTERN PyObject *
-SWIG_Python_InitShadowInstance(PyObject *args) {
-  PyObject *obj[2];
-  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
-    return NULL;
-  } else {
-    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
-    if (sthis) {
-      SwigPyObject_append((PyObject*) sthis, obj[1]);
-    } else {
-      SWIG_Python_SetSwigThis(obj[0], obj[1]);
-    }
-    return SWIG_Py_Void();
-  }
-}
-
-/* Create a new pointer object */
-
-SWIGRUNTIME PyObject *
-SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
-  SwigPyClientData *clientdata;
-  PyObject * robj;
-  int own;
-
-  if (!ptr)
-    return SWIG_Py_Void();
-
-  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
-  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
-  if (clientdata && clientdata->pytype) {
-    SwigPyObject *newobj;
-    if (flags & SWIG_BUILTIN_TP_INIT) {
-      newobj = (SwigPyObject*) self;
-      if (newobj->ptr) {
-        PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
-        while (newobj->next)
-	  newobj = (SwigPyObject *) newobj->next;
-        newobj->next = next_self;
-        newobj = (SwigPyObject *)next_self;
-#ifdef SWIGPYTHON_BUILTIN
-        newobj->dict = 0;
-#endif
-      }
-    } else {
-      newobj = PyObject_New(SwigPyObject, clientdata->pytype);
-#ifdef SWIGPYTHON_BUILTIN
-      newobj->dict = 0;
-#endif
-    }
-    if (newobj) {
-      newobj->ptr = ptr;
-      newobj->ty = type;
-      newobj->own = own;
-      newobj->next = 0;
-      return (PyObject*) newobj;
-    }
-    return SWIG_Py_Void();
-  }
-
-  assert(!(flags & SWIG_BUILTIN_TP_INIT));
-
-  robj = SwigPyObject_New(ptr, type, own);
-  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
-    PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
-    Py_DECREF(robj);
-    robj = inst;
-  }
-  return robj;
-}
-
-/* Create a new packed object */
-
-SWIGRUNTIMEINLINE PyObject *
-SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
-  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
-}
-
-/* -----------------------------------------------------------------------------*
- *  Get type list 
- * -----------------------------------------------------------------------------*/
-
-#ifdef SWIG_LINK_RUNTIME
-void *SWIG_ReturnGlobalTypeList(void *);
-#endif
-
-SWIGRUNTIME swig_module_info *
-SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
-  static void *type_pointer = (void *)0;
-  /* first check if module already created */
-  if (!type_pointer) {
-#ifdef SWIG_LINK_RUNTIME
-    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
-#else
-# ifdef SWIGPY_USE_CAPSULE
-    type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
-# else
-    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
-				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
-# endif
-    if (PyErr_Occurred()) {
-      PyErr_Clear();
-      type_pointer = (void *)0;
-    }
-#endif
-  }
-  return (swig_module_info *) type_pointer;
-}
-
-#if PY_MAJOR_VERSION < 2
-/* PyModule_AddObject function was introduced in Python 2.0.  The following function
-   is copied out of Python/modsupport.c in python version 2.3.4 */
-SWIGINTERN int
-PyModule_AddObject(PyObject *m, char *name, PyObject *o)
-{
-  PyObject *dict;
-  if (!PyModule_Check(m)) {
-    PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg");
-    return SWIG_ERROR;
-  }
-  if (!o) {
-    PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value");
-    return SWIG_ERROR;
-  }
-  
-  dict = PyModule_GetDict(m);
-  if (dict == NULL) {
-    /* Internal error -- modules must have a dict! */
-    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
-		 PyModule_GetName(m));
-    return SWIG_ERROR;
-  }
-  if (PyDict_SetItemString(dict, name, o))
-    return SWIG_ERROR;
-  Py_DECREF(o);
-  return SWIG_OK;
-}
-#endif
-
-SWIGRUNTIME void
-#ifdef SWIGPY_USE_CAPSULE
-SWIG_Python_DestroyModule(PyObject *obj)
-#else
-SWIG_Python_DestroyModule(void *vptr)
-#endif
-{
-#ifdef SWIGPY_USE_CAPSULE
-  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
-#else
-  swig_module_info *swig_module = (swig_module_info *) vptr;
-#endif
-  swig_type_info **types = swig_module->types;
-  size_t i;
-  for (i =0; i < swig_module->size; ++i) {
-    swig_type_info *ty = types[i];
-    if (ty->owndata) {
-      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
-      if (data) SwigPyClientData_Del(data);
-    }
-  }
-  Py_DECREF(SWIG_This());
-  swig_this = NULL;
-}
-
-SWIGRUNTIME void
-SWIG_Python_SetModule(swig_module_info *swig_module) {
-#if PY_VERSION_HEX >= 0x03000000
- /* Add a dummy module object into sys.modules */
-  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
-#else
-  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
-  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
-#endif
-#ifdef SWIGPY_USE_CAPSULE
-  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
-  if (pointer && module) {
-    PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
-  } else {
-    Py_XDECREF(pointer);
-  }
-#else
-  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
-  if (pointer && module) {
-    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
-  } else {
-    Py_XDECREF(pointer);
-  }
-#endif
-}
-
-/* The python cached type query */
-SWIGRUNTIME PyObject *
-SWIG_Python_TypeCache(void) {
-  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
-  return cache;
-}
-
-SWIGRUNTIME swig_type_info *
-SWIG_Python_TypeQuery(const char *type)
-{
-  PyObject *cache = SWIG_Python_TypeCache();
-  PyObject *key = SWIG_Python_str_FromChar(type); 
-  PyObject *obj = PyDict_GetItem(cache, key);
-  swig_type_info *descriptor;
-  if (obj) {
-#ifdef SWIGPY_USE_CAPSULE
-    descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
-#else
-    descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
-#endif
-  } else {
-    swig_module_info *swig_module = SWIG_GetModule(0);
-    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
-    if (descriptor) {
-#ifdef SWIGPY_USE_CAPSULE
-      obj = PyCapsule_New((void*) descriptor, NULL, NULL);
-#else
-      obj = PyCObject_FromVoidPtr(descriptor, NULL);
-#endif
-      PyDict_SetItem(cache, key, obj);
-      Py_DECREF(obj);
-    }
-  }
-  Py_DECREF(key);
-  return descriptor;
-}
-
-/* 
-   For backward compatibility only
-*/
-#define SWIG_POINTER_EXCEPTION  0
-#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
-#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
-
-SWIGRUNTIME int
-SWIG_Python_AddErrMesg(const char* mesg, int infront)
-{  
-  if (PyErr_Occurred()) {
-    PyObject *type = 0;
-    PyObject *value = 0;
-    PyObject *traceback = 0;
-    PyErr_Fetch(&type, &value, &traceback);
-    if (value) {
-      char *tmp;
-      PyObject *old_str = PyObject_Str(value);
-      Py_XINCREF(type);
-      PyErr_Clear();
-      if (infront) {
-	PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
-      } else {
-	PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
-      }
-      SWIG_Python_str_DelForPy3(tmp);
-      Py_DECREF(old_str);
-    }
-    return 1;
-  } else {
-    return 0;
-  }
-}
-  
-SWIGRUNTIME int
-SWIG_Python_ArgFail(int argnum)
-{
-  if (PyErr_Occurred()) {
-    /* add information about failing argument */
-    char mesg[256];
-    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
-    return SWIG_Python_AddErrMesg(mesg, 1);
-  } else {
-    return 0;
-  }
-}
-
-SWIGRUNTIMEINLINE const char *
-SwigPyObject_GetDesc(PyObject *self)
-{
-  SwigPyObject *v = (SwigPyObject *)self;
-  swig_type_info *ty = v ? v->ty : 0;
-  return ty ? ty->str : "";
-}
-
-SWIGRUNTIME void
-SWIG_Python_TypeError(const char *type, PyObject *obj)
-{
-  if (type) {
-#if defined(SWIG_COBJECT_TYPES)
-    if (obj && SwigPyObject_Check(obj)) {
-      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
-      if (otype) {
-	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
-		     type, otype);
-	return;
-      }
-    } else 
-#endif      
-    {
-      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
-      if (otype) {
-	PyObject *str = PyObject_Str(obj);
-	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
-	if (cstr) {
-	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
-		       type, otype, cstr);
-          SWIG_Python_str_DelForPy3(cstr);
-	} else {
-	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
-		       type, otype);
-	}
-	Py_XDECREF(str);
-	return;
-      }
-    }   
-    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
-  } else {
-    PyErr_Format(PyExc_TypeError, "unexpected type is received");
-  }
-}
-
-
-/* Convert a pointer value, signal an exception on a type mismatch */
-SWIGRUNTIME void *
-SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
-  void *result;
-  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
-    PyErr_Clear();
-#if SWIG_POINTER_EXCEPTION
-    if (flags) {
-      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
-      SWIG_Python_ArgFail(argnum);
-    }
-#endif
-  }
-  return result;
-}
-
-#ifdef SWIGPYTHON_BUILTIN
-SWIGRUNTIME int
-SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
-  PyTypeObject *tp = obj->ob_type;
-  PyObject *descr;
-  PyObject *encoded_name;
-  descrsetfunc f;
-  int res = -1;
-
-# ifdef Py_USING_UNICODE
-  if (PyString_Check(name)) {
-    name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
-    if (!name)
-      return -1;
-  } else if (!PyUnicode_Check(name))
-# else
-  if (!PyString_Check(name))
-# endif
-  {
-    PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
-    return -1;
-  } else {
-    Py_INCREF(name);
-  }
-
-  if (!tp->tp_dict) {
-    if (PyType_Ready(tp) < 0)
-      goto done;
-  }
-
-  descr = _PyType_Lookup(tp, name);
-  f = NULL;
-  if (descr != NULL)
-    f = descr->ob_type->tp_descr_set;
-  if (!f) {
-    if (PyString_Check(name)) {
-      encoded_name = name;
-      Py_INCREF(name);
-    } else {
-      encoded_name = PyUnicode_AsUTF8String(name);
-    }
-    PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
-    Py_DECREF(encoded_name);
-  } else {
-    res = f(descr, obj, value);
-  }
-  
-  done:
-  Py_DECREF(name);
-  return res;
-}
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
-
-#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
-
-
-
-/* -------- TYPES TABLE (BEGIN) -------- */
-
-#define SWIGTYPE_p_char swig_types[0]
-static swig_type_info *swig_types[2];
-static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
-#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
-#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
-
-/* -------- TYPES TABLE (END) -------- */
-
-#if (PY_VERSION_HEX <= 0x02000000)
-# if !defined(SWIG_PYTHON_CLASSIC)
-#  error "This python version requires swig to be run with the '-classic' option"
-# endif
-#endif
-
-/*-----------------------------------------------
-              @(target):= _libpymolfile.so
-  ------------------------------------------------*/
-#if PY_VERSION_HEX >= 0x03000000
-#  define SWIG_init    PyInit__libpymolfile
-
-#else
-#  define SWIG_init    init_libpymolfile
-
-#endif
-#define SWIG_name    "_libpymolfile"
-
-#define SWIGVERSION 0x030012 
-#define SWIG_VERSION SWIGVERSION
-
-
-#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
-#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
-
-
-#include <stdexcept>
-
-
-namespace swig {
-  class SwigPtr_PyObject {
-  protected:
-    PyObject *_obj;
-
-  public:
-    SwigPtr_PyObject() :_obj(0)
-    {
-    }
-
-    SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
-    {
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      Py_XINCREF(_obj);      
-      SWIG_PYTHON_THREAD_END_BLOCK;
-    }
-    
-    SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
-    {
-      if (initial_ref) {
-        SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-        Py_XINCREF(_obj);
-        SWIG_PYTHON_THREAD_END_BLOCK;
-      }
-    }
-    
-    SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
-    {
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      Py_XINCREF(item._obj);
-      Py_XDECREF(_obj);
-      _obj = item._obj;
-      SWIG_PYTHON_THREAD_END_BLOCK;
-      return *this;      
-    }
-    
-    ~SwigPtr_PyObject() 
-    {
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      Py_XDECREF(_obj);
-      SWIG_PYTHON_THREAD_END_BLOCK;
-    }
-    
-    operator PyObject *() const
-    {
-      return _obj;
-    }
-
-    PyObject *operator->() const
-    {
-      return _obj;
-    }
-  };
-}
-
-
-namespace swig {
-  struct SwigVar_PyObject : SwigPtr_PyObject {
-    SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
-    
-    SwigVar_PyObject & operator = (PyObject* obj)
-    {
-      Py_XDECREF(_obj);
-      _obj = obj;
-      return *this;      
-    }
-  };
-}
-
-
-/* Python SWIG interface to libpymolfile
-   Copyright (c) 2017 Berk Onat <b.onat@warwick.ac.uk>
-   Published with UIUC LICENSE
- */
-#define SWIG_FILE_WITH_INIT
-#define __STDC_FORMAT_MACROS
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <inttypes.h>
-#include "pymolfile.h"
-
-
-#ifndef SWIG_FILE_WITH_INIT
-#define NO_IMPORT_ARRAY
-#endif
-#include "stdio.h"
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-#include <numpy/arrayobject.h>
-
-
-#include <complex> 
-
-
-#include <limits.h>
-#if !defined(SWIG_NO_LLONG_MAX)
-# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
-#   define LLONG_MAX __LONG_LONG_MAX__
-#   define LLONG_MIN (-LLONG_MAX - 1LL)
-#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
-# endif
-#endif
-
-
-SWIGINTERN int
-SWIG_AsVal_double (PyObject *obj, double *val)
-{
-  int res = SWIG_TypeError;
-  if (PyFloat_Check(obj)) {
-    if (val) *val = PyFloat_AsDouble(obj);
-    return SWIG_OK;
-#if PY_VERSION_HEX < 0x03000000
-  } else if (PyInt_Check(obj)) {
-    if (val) *val = (double) PyInt_AsLong(obj);
-    return SWIG_OK;
-#endif
-  } else if (PyLong_Check(obj)) {
-    double v = PyLong_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    double d = PyFloat_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = d;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      long v = PyLong_AsLong(obj);
-      if (!PyErr_Occurred()) {
-	if (val) *val = v;
-	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
-      } else {
-	PyErr_Clear();
-      }
-    }
-  }
-#endif
-  return res;
-}
-
-
-#include <float.h>
-
-
-#include <math.h>
-
-
-SWIGINTERNINLINE int
-SWIG_CanCastAsInteger(double *d, double min, double max) {
-  double x = *d;
-  if ((min <= x && x <= max)) {
-   double fx = floor(x);
-   double cx = ceil(x);
-   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
-   if ((errno == EDOM) || (errno == ERANGE)) {
-     errno = 0;
-   } else {
-     double summ, reps, diff;
-     if (rd < x) {
-       diff = x - rd;
-     } else if (rd > x) {
-       diff = rd - x;
-     } else {
-       return 1;
-     }
-     summ = rd + x;
-     reps = diff/summ;
-     if (reps < 8*DBL_EPSILON) {
-       *d = rd;
-       return 1;
-     }
-   }
-  }
-  return 0;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_long (PyObject *obj, long* val)
-{
-#if PY_VERSION_HEX < 0x03000000
-  if (PyInt_Check(obj)) {
-    if (val) *val = PyInt_AsLong(obj);
-    return SWIG_OK;
-  } else
-#endif
-  if (PyLong_Check(obj)) {
-    long v = PyLong_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-      return SWIG_OverflowError;
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    long v = PyInt_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      double d;
-      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
-      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
-	if (val) *val = (long)(d);
-	return res;
-      }
-    }
-  }
-#endif
-  return SWIG_TypeError;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_int (PyObject * obj, int *val)
-{
-  long v;
-  int res = SWIG_AsVal_long (obj, &v);
-  if (SWIG_IsOK(res)) {
-    if ((v < INT_MIN || v > INT_MAX)) {
-      return SWIG_OverflowError;
-    } else {
-      if (val) *val = static_cast< int >(v);
-    }
-  }  
-  return res;
-}
-
-
-SWIGINTERNINLINE PyObject*
-  SWIG_From_int  (int value)
-{
-  return PyInt_FromLong((long) value);
-}
-
-
-PyObject * my_open_file_read(PyObject* molcapsule, char* fname, char* ftype, int natoms) {
-    if (PyType_Ready(&MolObjectType) < 0)
-        return NULL;
-    PyTypeObject *type = &MolObjectType;
-    MolObject *plugin_c;
-    molfile_plugin_t* plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(molcapsule);
-    plugin_c = (MolObject *)type->tp_alloc(type, 0);
-    /*plugin_c->plugin = plugin;*/
-    plugin_c->plugin = molcapsule;
-    void *file_handle = plugin->open_file_read(fname, ftype, &natoms);
-    plugin_c->file_handle = PyMolfileCapsule_FromVoidPtr(file_handle, del_molfile_file_handle);
-    if (!plugin_c->file_handle) {
-        Py_RETURN_NONE;
-    } else {
-        plugin_c->natoms = natoms;
-        return (PyObject *)plugin_c;
-    }
-  }
-
-
-SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor(void)
-{
-  static int init = 0;
-  static swig_type_info* info = 0;
-  if (!init) {
-    info = SWIG_TypeQuery("_p_char");
-    init = 1;
-  }
-  return info;
-}
-
-
-SWIGINTERN int
-SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
-{
-#if PY_VERSION_HEX>=0x03000000
-#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-  if (PyBytes_Check(obj))
-#else
-  if (PyUnicode_Check(obj))
-#endif
-#else  
-  if (PyString_Check(obj))
-#endif
-  {
-    char *cstr; Py_ssize_t len;
-#if PY_VERSION_HEX>=0x03000000
-#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-    if (!alloc && cptr) {
-        /* We can't allow converting without allocation, since the internal
-           representation of string in Python 3 is UCS-2/UCS-4 but we require
-           a UTF-8 representation.
-           TODO(bhy) More detailed explanation */
-        return SWIG_RuntimeError;
-    }
-    obj = PyUnicode_AsUTF8String(obj);
-    if(alloc) *alloc = SWIG_NEWOBJ;
-#endif
-    PyBytes_AsStringAndSize(obj, &cstr, &len);
-#else
-    PyString_AsStringAndSize(obj, &cstr, &len);
-#endif
-    if (cptr) {
-      if (alloc) {
-	/* 
-	   In python the user should not be able to modify the inner
-	   string representation. To warranty that, if you define
-	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
-	   buffer is always returned.
-
-	   The default behavior is just to return the pointer value,
-	   so, be careful.
-	*/ 
-#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
-	if (*alloc != SWIG_OLDOBJ) 
-#else
-	if (*alloc == SWIG_NEWOBJ) 
-#endif
-	{
-	  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
-	  *alloc = SWIG_NEWOBJ;
-	} else {
-	  *cptr = cstr;
-	  *alloc = SWIG_OLDOBJ;
-	}
-      } else {
-#if PY_VERSION_HEX>=0x03000000
-#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-	*cptr = PyBytes_AsString(obj);
-#else
-	assert(0); /* Should never reach here with Unicode strings in Python 3 */
-#endif
-#else
-	*cptr = SWIG_Python_str_AsChar(obj);
-#endif
-      }
-    }
-    if (psize) *psize = len + 1;
-#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-    Py_XDECREF(obj);
-#endif
-    return SWIG_OK;
-  } else {
-#if defined(SWIG_PYTHON_2_UNICODE)
-#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
-#endif
-#if PY_VERSION_HEX<0x03000000
-    if (PyUnicode_Check(obj)) {
-      char *cstr; Py_ssize_t len;
-      if (!alloc && cptr) {
-        return SWIG_RuntimeError;
-      }
-      obj = PyUnicode_AsUTF8String(obj);
-      if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
-        if (cptr) {
-          if (alloc) *alloc = SWIG_NEWOBJ;
-          *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
-        }
-        if (psize) *psize = len + 1;
-
-        Py_XDECREF(obj);
-        return SWIG_OK;
-      } else {
-        Py_XDECREF(obj);
-      }
-    }
-#endif
-#endif
-
-    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
-    if (pchar_descriptor) {
-      void* vptr = 0;
-      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
-	if (cptr) *cptr = (char *) vptr;
-	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
-	if (alloc) *alloc = SWIG_OLDOBJ;
-	return SWIG_OK;
-      }
-    }
-  }
-  return SWIG_TypeError;
-}
-
-
-
-
-
-PyObject * my_close_file_read(PyObject* molpack) {
-    MolObject* plugin_handle = (MolObject*) molpack;
-    PyObject* plugincapsule = plugin_handle->plugin;   
-    PyObject* filecapsule = plugin_handle->file_handle;
-    molfile_plugin_t* plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugincapsule);
-    void *file_handle = (void*) PyMolfileCapsule_AsVoidPtr(filecapsule);
-    plugin->close_file_read(file_handle);
-    Py_XDECREF(filecapsule);
-    Py_XDECREF(plugin_handle->file_handle);
-    return (PyObject *)plugin_handle;
-  }
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-SWIGINTERN PyObject *_wrap_molfile_plugin_list(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int arg1 ;
-  int val1 ;
-  int ecode1 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:molfile_plugin_list",&obj0)) SWIG_fail;
-  ecode1 = SWIG_AsVal_int(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "molfile_plugin_list" "', argument " "1"" of type '" "int""'");
-  } 
-  arg1 = static_cast< int >(val1);
-  result = (PyObject *)molfile_plugin_list(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_molfile_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int result;
-  
-  if (!PyArg_ParseTuple(args,(char *)":molfile_init")) SWIG_fail;
-  result = (int)molfile_init();
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_molfile_finish(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int result;
-  
-  if (!PyArg_ParseTuple(args,(char *)":molfile_finish")) SWIG_fail;
-  result = (int)molfile_finish();
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_get_plugin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  int arg2 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:get_plugin",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_plugin" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  result = (PyObject *)get_plugin(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_molfile_plugin_info(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  int arg2 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:molfile_plugin_info",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "molfile_plugin_info" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  result = (PyObject *)molfile_plugin_info(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_open_file_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  char *arg2 = (char *) 0 ;
-  char *arg3 = (char *) 0 ;
-  int arg4 ;
-  int res2 ;
-  char *buf2 = 0 ;
-  int alloc2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
-  int val4 ;
-  int ecode4 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:open_file_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  arg1 = obj0;
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_file_read" "', argument " "2"" of type '" "char *""'");
-  }
-  arg2 = reinterpret_cast< char * >(buf2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "open_file_read" "', argument " "3"" of type '" "char *""'");
-  }
-  arg3 = reinterpret_cast< char * >(buf3);
-  ecode4 = SWIG_AsVal_int(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "open_file_read" "', argument " "4"" of type '" "int""'");
-  } 
-  arg4 = static_cast< int >(val4);
-  {
-    result = (PyObject *)my_open_file_read(arg1,arg2,arg3,arg4);
-    if (PyErr_Occurred()) SWIG_fail;
-  }
-  resultobj = result;
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return resultobj;
-fail:
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_close_file_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:close_file_read",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  {
-    result = (PyObject *)my_close_file_read(arg1);
-    if (PyErr_Occurred()) SWIG_fail;
-  }
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_structure(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject *arg2 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:read_fill_structure",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  arg2 = obj1;
-  result = (PyObject *)read_fill_structure(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_bonds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:read_fill_bonds",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  result = (PyObject *)read_fill_bonds(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_angles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:read_fill_angles",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  result = (PyObject *)read_fill_angles(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_next_timestep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:read_fill_next_timestep",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  result = (PyObject *)read_fill_next_timestep(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_are_plugins_same(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject *arg2 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:are_plugins_same",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  arg2 = obj1;
-  result = (PyObject *)are_plugins_same(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_are_filehandles_same(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject *arg2 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:are_filehandles_same",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  arg2 = obj1;
-  result = (PyObject *)are_filehandles_same(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-static PyMethodDef SwigMethods[] = {
-	 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
-	 { (char *)"molfile_plugin_list", _wrap_molfile_plugin_list, METH_VARARGS, (char *)"molfile_plugin_list(maxsize) -> PyObject *"},
-	 { (char *)"molfile_init", _wrap_molfile_init, METH_VARARGS, (char *)"molfile_init() -> int"},
-	 { (char *)"molfile_finish", _wrap_molfile_finish, METH_VARARGS, (char *)"molfile_finish() -> int"},
-	 { (char *)"get_plugin", _wrap_get_plugin, METH_VARARGS, (char *)"get_plugin(molcapsule, plug_no) -> PyObject *"},
-	 { (char *)"molfile_plugin_info", _wrap_molfile_plugin_info, METH_VARARGS, (char *)"molfile_plugin_info(molcapsule, plugin_no) -> PyObject *"},
-	 { (char *)"open_file_read", _wrap_open_file_read, METH_VARARGS, (char *)"open_file_read(molcapsule, fname, ftype, natoms) -> PyObject *"},
-	 { (char *)"close_file_read", _wrap_close_file_read, METH_VARARGS, (char *)"close_file_read(molpack) -> PyObject *"},
-	 { (char *)"read_fill_structure", _wrap_read_fill_structure, METH_VARARGS, (char *)"read_fill_structure(molpack, prototype) -> PyObject *"},
-	 { (char *)"read_fill_bonds", _wrap_read_fill_bonds, METH_VARARGS, (char *)"read_fill_bonds(molpack) -> PyObject *"},
-	 { (char *)"read_fill_angles", _wrap_read_fill_angles, METH_VARARGS, (char *)"read_fill_angles(molpack) -> PyObject *"},
-	 { (char *)"read_fill_next_timestep", _wrap_read_fill_next_timestep, METH_VARARGS, (char *)"read_fill_next_timestep(molpack) -> PyObject *"},
-	 { (char *)"are_plugins_same", _wrap_are_plugins_same, METH_VARARGS, (char *)"are_plugins_same(molpack_a, molpack_b) -> PyObject *"},
-	 { (char *)"are_filehandles_same", _wrap_are_filehandles_same, METH_VARARGS, (char *)"are_filehandles_same(molpack_a, molpack_b) -> PyObject *"},
-	 { NULL, NULL, 0, NULL }
-};
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-
-static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
-
-static swig_type_info *swig_type_initial[] = {
-  &_swigt__p_char,
-};
-
-static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
-
-static swig_cast_info *swig_cast_initial[] = {
-  _swigc__p_char,
-};
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
-
-static swig_const_info swig_const_table[] = {
-{0, 0, 0, 0.0, 0, 0}};
-
-#ifdef __cplusplus
-}
-#endif
-/* -----------------------------------------------------------------------------
- * Type initialization:
- * This problem is tough by the requirement that no dynamic
- * memory is used. Also, since swig_type_info structures store pointers to
- * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization.
- * The idea is that swig generates all the structures that are needed.
- * The runtime then collects these partially filled structures.
- * The SWIG_InitializeModule function takes these initial arrays out of
- * swig_module, and does all the lookup, filling in the swig_module.types
- * array with the correct data and linking the correct swig_cast_info
- * structures together.
- *
- * The generated swig_type_info structures are assigned statically to an initial
- * array. We just loop through that array, and handle each type individually.
- * First we lookup if this type has been already loaded, and if so, use the
- * loaded structure instead of the generated one. Then we have to fill in the
- * cast linked list. The cast data is initially stored in something like a
- * two-dimensional array. Each row corresponds to a type (there are the same
- * number of rows as there are in the swig_type_initial array). Each entry in
- * a column is one of the swig_cast_info structures for that type.
- * The cast_initial array is actually an array of arrays, because each row has
- * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it
- * adding the casts to the list. The one last trick we need to do is making
- * sure the type pointer in the swig_cast_info struct is correct.
- *
- * First off, we lookup the cast->type name to see if it is already loaded.
- * There are three cases to handle:
- *  1) If the cast->type has already been loaded AND the type we are adding
- *     casting info to has not been loaded (it is in this module), THEN we
- *     replace the cast->type pointer with the type pointer that has already
- *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the
- *     cast->type) are loaded, THEN the cast info has already been loaded by
- *     the previous module so we just ignore it.
- *  3) Finally, if cast->type has not already been loaded, then we add that
- *     swig_cast_info to the linked list (because the cast->type) pointer will
- *     be correct.
- * ----------------------------------------------------------------------------- */
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* c-mode */
-#endif
-#endif
-
-#if 0
-#define SWIGRUNTIME_DEBUG
-#endif
-
-
-SWIGRUNTIME void
-SWIG_InitializeModule(void *clientdata) {
-  size_t i;
-  swig_module_info *module_head, *iter;
-  int init;
-  
-  /* check to see if the circular list has been setup, if not, set it up */
-  if (swig_module.next==0) {
-    /* Initialize the swig_module */
-    swig_module.type_initial = swig_type_initial;
-    swig_module.cast_initial = swig_cast_initial;
-    swig_module.next = &swig_module;
-    init = 1;
-  } else {
-    init = 0;
-  }
-  
-  /* Try and load any already created modules */
-  module_head = SWIG_GetModule(clientdata);
-  if (!module_head) {
-    /* This is the first module loaded for this interpreter */
-    /* so set the swig module into the interpreter */
-    SWIG_SetModule(clientdata, &swig_module);
-  } else {
-    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
-    iter=module_head;
-    do {
-      if (iter==&swig_module) {
-        /* Our module is already in the list, so there's nothing more to do. */
-        return;
-      }
-      iter=iter->next;
-    } while (iter!= module_head);
-    
-    /* otherwise we must add our module into the list */
-    swig_module.next = module_head->next;
-    module_head->next = &swig_module;
-  }
-  
-  /* When multiple interpreters are used, a module could have already been initialized in
-       a different interpreter, but not yet have a pointer in this interpreter.
-       In this case, we do not want to continue adding types... everything should be
-       set up already */
-  if (init == 0) return;
-  
-  /* Now work on filling in swig_module.types */
-#ifdef SWIGRUNTIME_DEBUG
-  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
-#endif
-  for (i = 0; i < swig_module.size; ++i) {
-    swig_type_info *type = 0;
-    swig_type_info *ret;
-    swig_cast_info *cast;
-    
-#ifdef SWIGRUNTIME_DEBUG
-    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
-#endif
-    
-    /* if there is another module already loaded */
-    if (swig_module.next != &swig_module) {
-      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
-    }
-    if (type) {
-      /* Overwrite clientdata field */
-#ifdef SWIGRUNTIME_DEBUG
-      printf("SWIG_InitializeModule: found type %s\n", type->name);
-#endif
-      if (swig_module.type_initial[i]->clientdata) {
-        type->clientdata = swig_module.type_initial[i]->clientdata;
-#ifdef SWIGRUNTIME_DEBUG
-        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
-#endif
-      }
-    } else {
-      type = swig_module.type_initial[i];
-    }
-    
-    /* Insert casting types */
-    cast = swig_module.cast_initial[i];
-    while (cast->type) {
-      /* Don't need to add information already in the list */
-      ret = 0;
-#ifdef SWIGRUNTIME_DEBUG
-      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
-#endif
-      if (swig_module.next != &swig_module) {
-        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
-#ifdef SWIGRUNTIME_DEBUG
-        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
-#endif
-      }
-      if (ret) {
-        if (type == swig_module.type_initial[i]) {
-#ifdef SWIGRUNTIME_DEBUG
-          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
-#endif
-          cast->type = ret;
-          ret = 0;
-        } else {
-          /* Check for casting already in the list */
-          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
-#ifdef SWIGRUNTIME_DEBUG
-          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
-#endif
-          if (!ocast) ret = 0;
-        }
-      }
-      
-      if (!ret) {
-#ifdef SWIGRUNTIME_DEBUG
-        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
-#endif
-        if (type->cast) {
-          type->cast->prev = cast;
-          cast->next = type->cast;
-        }
-        type->cast = cast;
-      }
-      cast++;
-    }
-    /* Set entry in modules->types array equal to the type */
-    swig_module.types[i] = type;
-  }
-  swig_module.types[i] = 0;
-  
-#ifdef SWIGRUNTIME_DEBUG
-  printf("**** SWIG_InitializeModule: Cast List ******\n");
-  for (i = 0; i < swig_module.size; ++i) {
-    int j = 0;
-    swig_cast_info *cast = swig_module.cast_initial[i];
-    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
-    while (cast->type) {
-      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
-      cast++;
-      ++j;
-    }
-    printf("---- Total casts: %d\n",j);
-  }
-  printf("**** SWIG_InitializeModule: Cast List ******\n");
-#endif
-}
-
-/* This function will propagate the clientdata field of type to
-* any new swig_type_info structures that have been added into the list
-* of equivalent types.  It is like calling
-* SWIG_TypeClientData(type, clientdata) a second time.
-*/
-SWIGRUNTIME void
-SWIG_PropagateClientData(void) {
-  size_t i;
-  swig_cast_info *equiv;
-  static int init_run = 0;
-  
-  if (init_run) return;
-  init_run = 1;
-  
-  for (i = 0; i < swig_module.size; i++) {
-    if (swig_module.types[i]->clientdata) {
-      equiv = swig_module.types[i]->cast;
-      while (equiv) {
-        if (!equiv->converter) {
-          if (equiv->type && !equiv->type->clientdata)
-          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
-        }
-        equiv = equiv->next;
-      }
-    }
-  }
-}
-
-#ifdef __cplusplus
-#if 0
-{
-  /* c-mode */
-#endif
-}
-#endif
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-  
-  /* Python-specific SWIG API */
-#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
-#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
-#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
-  
-  /* -----------------------------------------------------------------------------
-   * global variable support code.
-   * ----------------------------------------------------------------------------- */
-  
-  typedef struct swig_globalvar {
-    char       *name;                  /* Name of global variable */
-    PyObject *(*get_attr)(void);       /* Return the current value */
-    int       (*set_attr)(PyObject *); /* Set the value */
-    struct swig_globalvar *next;
-  } swig_globalvar;
-  
-  typedef struct swig_varlinkobject {
-    PyObject_HEAD
-    swig_globalvar *vars;
-  } swig_varlinkobject;
-  
-  SWIGINTERN PyObject *
-  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
-#if PY_VERSION_HEX >= 0x03000000
-    return PyUnicode_InternFromString("<Swig global variables>");
-#else
-    return PyString_FromString("<Swig global variables>");
-#endif
-  }
-  
-  SWIGINTERN PyObject *
-  swig_varlink_str(swig_varlinkobject *v) {
-#if PY_VERSION_HEX >= 0x03000000
-    PyObject *str = PyUnicode_InternFromString("(");
-    PyObject *tail;
-    PyObject *joined;
-    swig_globalvar *var;
-    for (var = v->vars; var; var=var->next) {
-      tail = PyUnicode_FromString(var->name);
-      joined = PyUnicode_Concat(str, tail);
-      Py_DecRef(str);
-      Py_DecRef(tail);
-      str = joined;
-      if (var->next) {
-        tail = PyUnicode_InternFromString(", ");
-        joined = PyUnicode_Concat(str, tail);
-        Py_DecRef(str);
-        Py_DecRef(tail);
-        str = joined;
-      }
-    }
-    tail = PyUnicode_InternFromString(")");
-    joined = PyUnicode_Concat(str, tail);
-    Py_DecRef(str);
-    Py_DecRef(tail);
-    str = joined;
-#else
-    PyObject *str = PyString_FromString("(");
-    swig_globalvar *var;
-    for (var = v->vars; var; var=var->next) {
-      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
-      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
-    }
-    PyString_ConcatAndDel(&str,PyString_FromString(")"));
-#endif
-    return str;
-  }
-  
-  SWIGINTERN int
-  swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
-    char *tmp;
-    PyObject *str = swig_varlink_str(v);
-    fprintf(fp,"Swig global variables ");
-    fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
-    SWIG_Python_str_DelForPy3(tmp);
-    Py_DECREF(str);
-    return 0;
-  }
-  
-  SWIGINTERN void
-  swig_varlink_dealloc(swig_varlinkobject *v) {
-    swig_globalvar *var = v->vars;
-    while (var) {
-      swig_globalvar *n = var->next;
-      free(var->name);
-      free(var);
-      var = n;
-    }
-  }
-  
-  SWIGINTERN PyObject *
-  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
-    PyObject *res = NULL;
-    swig_globalvar *var = v->vars;
-    while (var) {
-      if (strcmp(var->name,n) == 0) {
-        res = (*var->get_attr)();
-        break;
-      }
-      var = var->next;
-    }
-    if (res == NULL && !PyErr_Occurred()) {
-      PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
-    }
-    return res;
-  }
-  
-  SWIGINTERN int
-  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
-    int res = 1;
-    swig_globalvar *var = v->vars;
-    while (var) {
-      if (strcmp(var->name,n) == 0) {
-        res = (*var->set_attr)(p);
-        break;
-      }
-      var = var->next;
-    }
-    if (res == 1 && !PyErr_Occurred()) {
-      PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
-    }
-    return res;
-  }
-  
-  SWIGINTERN PyTypeObject*
-  swig_varlink_type(void) {
-    static char varlink__doc__[] = "Swig var link object";
-    static PyTypeObject varlink_type;
-    static int type_init = 0;
-    if (!type_init) {
-      const PyTypeObject tmp = {
-#if PY_VERSION_HEX >= 0x03000000
-        PyVarObject_HEAD_INIT(NULL, 0)
-#else
-        PyObject_HEAD_INIT(NULL)
-        0,                                  /* ob_size */
-#endif
-        (char *)"swigvarlink",              /* tp_name */
-        sizeof(swig_varlinkobject),         /* tp_basicsize */
-        0,                                  /* tp_itemsize */
-        (destructor) swig_varlink_dealloc,  /* tp_dealloc */
-        (printfunc) swig_varlink_print,     /* tp_print */
-        (getattrfunc) swig_varlink_getattr, /* tp_getattr */
-        (setattrfunc) swig_varlink_setattr, /* tp_setattr */
-        0,                                  /* tp_compare */
-        (reprfunc) swig_varlink_repr,       /* tp_repr */
-        0,                                  /* tp_as_number */
-        0,                                  /* tp_as_sequence */
-        0,                                  /* tp_as_mapping */
-        0,                                  /* tp_hash */
-        0,                                  /* tp_call */
-        (reprfunc) swig_varlink_str,        /* tp_str */
-        0,                                  /* tp_getattro */
-        0,                                  /* tp_setattro */
-        0,                                  /* tp_as_buffer */
-        0,                                  /* tp_flags */
-        varlink__doc__,                     /* tp_doc */
-        0,                                  /* tp_traverse */
-        0,                                  /* tp_clear */
-        0,                                  /* tp_richcompare */
-        0,                                  /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-        0,                                  /* tp_del */
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-        0,                                  /* tp_version_tag */
-#endif
-#if PY_VERSION_HEX >= 0x03040000
-        0,                                  /* tp_finalize */
-#endif
-#ifdef COUNT_ALLOCS
-        0,                                  /* tp_allocs */
-        0,                                  /* tp_frees */
-        0,                                  /* tp_maxalloc */
-#if PY_VERSION_HEX >= 0x02050000
-        0,                                  /* tp_prev */
-#endif
-        0                                   /* tp_next */
-#endif
-      };
-      varlink_type = tmp;
-      type_init = 1;
-#if PY_VERSION_HEX < 0x02020000
-      varlink_type.ob_type = &PyType_Type;
-#else
-      if (PyType_Ready(&varlink_type) < 0)
-      return NULL;
-#endif
-    }
-    return &varlink_type;
-  }
-  
-  /* Create a variable linking object for use later */
-  SWIGINTERN PyObject *
-  SWIG_Python_newvarlink(void) {
-    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
-    if (result) {
-      result->vars = 0;
-    }
-    return ((PyObject*) result);
-  }
-  
-  SWIGINTERN void 
-  SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
-    swig_varlinkobject *v = (swig_varlinkobject *) p;
-    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
-    if (gv) {
-      size_t size = strlen(name)+1;
-      gv->name = (char *)malloc(size);
-      if (gv->name) {
-        strncpy(gv->name,name,size);
-        gv->get_attr = get_attr;
-        gv->set_attr = set_attr;
-        gv->next = v->vars;
-      }
-    }
-    v->vars = gv;
-  }
-  
-  SWIGINTERN PyObject *
-  SWIG_globals(void) {
-    static PyObject *_SWIG_globals = 0; 
-    if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
-    return _SWIG_globals;
-  }
-  
-  /* -----------------------------------------------------------------------------
-   * constants/methods manipulation
-   * ----------------------------------------------------------------------------- */
-  
-  /* Install Constants */
-  SWIGINTERN void
-  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
-    PyObject *obj = 0;
-    size_t i;
-    for (i = 0; constants[i].type; ++i) {
-      switch(constants[i].type) {
-      case SWIG_PY_POINTER:
-        obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
-        break;
-      case SWIG_PY_BINARY:
-        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
-        break;
-      default:
-        obj = 0;
-        break;
-      }
-      if (obj) {
-        PyDict_SetItemString(d, constants[i].name, obj);
-        Py_DECREF(obj);
-      }
-    }
-  }
-  
-  /* -----------------------------------------------------------------------------*/
-  /* Fix SwigMethods to carry the callback ptrs when needed */
-  /* -----------------------------------------------------------------------------*/
-  
-  SWIGINTERN void
-  SWIG_Python_FixMethods(PyMethodDef *methods,
-    swig_const_info *const_table,
-    swig_type_info **types,
-    swig_type_info **types_initial) {
-    size_t i;
-    for (i = 0; methods[i].ml_name; ++i) {
-      const char *c = methods[i].ml_doc;
-      if (!c) continue;
-      c = strstr(c, "swig_ptr: ");
-      if (c) {
-        int j;
-        swig_const_info *ci = 0;
-        const char *name = c + 10;
-        for (j = 0; const_table[j].type; ++j) {
-          if (strncmp(const_table[j].name, name, 
-              strlen(const_table[j].name)) == 0) {
-            ci = &(const_table[j]);
-            break;
-          }
-        }
-        if (ci) {
-          void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
-          if (ptr) {
-            size_t shift = (ci->ptype) - types;
-            swig_type_info *ty = types_initial[shift];
-            size_t ldoc = (c - methods[i].ml_doc);
-            size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
-            char *ndoc = (char*)malloc(ldoc + lptr + 10);
-            if (ndoc) {
-              char *buff = ndoc;
-              strncpy(buff, methods[i].ml_doc, ldoc);
-              buff += ldoc;
-              strncpy(buff, "swig_ptr: ", 10);
-              buff += 10;
-              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
-              methods[i].ml_doc = ndoc;
-            }
-          }
-        }
-      }
-    }
-  } 
-  
-#ifdef __cplusplus
-}
-#endif
-
-/* -----------------------------------------------------------------------------*
- *  Partial Init method
- * -----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-SWIGEXPORT 
-#if PY_VERSION_HEX >= 0x03000000
-PyObject*
-#else
-void
-#endif
-SWIG_init(void) {
-  PyObject *m, *d, *md;
-#if PY_VERSION_HEX >= 0x03000000
-  static struct PyModuleDef SWIG_module = {
-# if PY_VERSION_HEX >= 0x03020000
-    PyModuleDef_HEAD_INIT,
-# else
-    {
-      PyObject_HEAD_INIT(NULL)
-      NULL, /* m_init */
-      0,    /* m_index */
-      NULL, /* m_copy */
-    },
-# endif
-    (char *) SWIG_name,
-    NULL,
-    -1,
-    SwigMethods,
-    NULL,
-    NULL,
-    NULL,
-    NULL
-  };
-#endif
-  
-#if defined(SWIGPYTHON_BUILTIN)
-  static SwigPyClientData SwigPyObject_clientdata = {
-    0, 0, 0, 0, 0, 0, 0
-  };
-  static PyGetSetDef this_getset_def = {
-    (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
-  };
-  static SwigPyGetSet thisown_getset_closure = {
-    (PyCFunction) SwigPyObject_own,
-    (PyCFunction) SwigPyObject_own
-  };
-  static PyGetSetDef thisown_getset_def = {
-    (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
-  };
-  PyTypeObject *builtin_pytype;
-  int builtin_base_count;
-  swig_type_info *builtin_basetype;
-  PyObject *tuple;
-  PyGetSetDescrObject *static_getset;
-  PyTypeObject *metatype;
-  PyTypeObject *swigpyobject;
-  SwigPyClientData *cd;
-  PyObject *public_interface, *public_symbol;
-  PyObject *this_descr;
-  PyObject *thisown_descr;
-  PyObject *self = 0;
-  int i;
-  
-  (void)builtin_pytype;
-  (void)builtin_base_count;
-  (void)builtin_basetype;
-  (void)tuple;
-  (void)static_getset;
-  (void)self;
-  
-  /* Metaclass is used to implement static member variables */
-  metatype = SwigPyObjectType();
-  assert(metatype);
-#endif
-  
-  /* Fix SwigMethods to carry the callback ptrs when needed */
-  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
-  
-#if PY_VERSION_HEX >= 0x03000000
-  m = PyModule_Create(&SWIG_module);
-#else
-  m = Py_InitModule((char *) SWIG_name, SwigMethods);
-#endif
-  
-  md = d = PyModule_GetDict(m);
-  (void)md;
-  
-  SWIG_InitializeModule(0);
-  
-#ifdef SWIGPYTHON_BUILTIN
-  swigpyobject = SwigPyObject_TypeOnce();
-  
-  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
-  assert(SwigPyObject_stype);
-  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
-  if (!cd) {
-    SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
-    SwigPyObject_clientdata.pytype = swigpyobject;
-  } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
-    PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
-# if PY_VERSION_HEX >= 0x03000000
-    return NULL;
-# else
-    return;
-# endif
-  }
-  
-  /* All objects have a 'this' attribute */
-  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
-  (void)this_descr;
-  
-  /* All objects have a 'thisown' attribute */
-  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
-  (void)thisown_descr;
-  
-  public_interface = PyList_New(0);
-  public_symbol = 0;
-  (void)public_symbol;
-  
-  PyDict_SetItemString(md, "__all__", public_interface);
-  Py_DECREF(public_interface);
-  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
-  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
-  for (i = 0; swig_const_table[i].name != 0; ++i)
-  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
-#endif
-  
-  SWIG_InstallConstants(d,swig_const_table);
-  
-  
-  Py_Initialize();
-  import_array();
-  
-#if PY_VERSION_HEX >= 0x03000000
-  return m;
-#else
-  return;
-#endif
-}
-
diff --git a/pymolfile/molfile/libpymolfile_wrap.cxx b/pymolfile/molfile/libpymolfile_wrap.cxx
deleted file mode 100644
index 21fbdd140493760aa1268bf2b177d3062b585f28..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/libpymolfile_wrap.cxx
+++ /dev/null
@@ -1,4465 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.12
- *
- * This file is not intended to be easily readable and contains a number of
- * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
- * ----------------------------------------------------------------------------- */
-
-
-#ifndef SWIGPYTHON
-#define SWIGPYTHON
-#endif
-
-#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
-
-
-#ifdef __cplusplus
-/* SwigValueWrapper is described in swig.swg */
-template<typename T> class SwigValueWrapper {
-  struct SwigMovePointer {
-    T *ptr;
-    SwigMovePointer(T *p) : ptr(p) { }
-    ~SwigMovePointer() { delete ptr; }
-    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
-  } pointer;
-  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
-public:
-  SwigValueWrapper() : pointer(0) { }
-  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
-  operator T&() const { return *pointer.ptr; }
-  T *operator&() { return pointer.ptr; }
-};
-
-template <typename T> T SwigValueInit() {
-  return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- *  This section contains generic SWIG labels for method/variable
- *  declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-#  define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-#  define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-#  define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-#   define SWIGINLINE inline
-# else
-#   define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__))
-#   else
-#     define SWIGUNUSED
-#   endif
-# elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__))
-# else
-#   define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIG_MSC_UNSUPPRESS_4505
-# if defined(_MSC_VER)
-#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-#   define SWIGUNUSEDPARM(p)
-# else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if defined(__GNUC__)
-#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#    ifndef GCC_HASCLASSVISIBILITY
-#      define GCC_HASCLASSVISIBILITY
-#    endif
-#  endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   if defined(STATIC_LINKED)
-#     define SWIGEXPORT
-#   else
-#     define SWIGEXPORT __declspec(dllexport)
-#   endif
-# else
-#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-#     define SWIGEXPORT __attribute__ ((visibility("default")))
-#   else
-#     define SWIGEXPORT
-#   endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#   define SWIGSTDCALL __stdcall
-# else
-#   define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
-#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
-# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
-#endif
-
-/* Intel's compiler complains if a variable which was never initialised is
- * cast to void, which is a common idiom which we use to indicate that we
- * are aware a variable isn't used.  So we just silence that warning.
- * See: https://github.com/swig/swig/issues/192 for more discussion.
- */
-#ifdef __INTEL_COMPILER
-# pragma warning disable 592
-#endif
-
-
-#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
-/* Use debug wrappers with the Python release dll */
-# undef _DEBUG
-# include <Python.h>
-# define _DEBUG
-#else
-# include <Python.h>
-#endif
-
-/* -----------------------------------------------------------------------------
- * swigrun.swg
- *
- * This file contains generic C API SWIG runtime support for pointer
- * type checking.
- * ----------------------------------------------------------------------------- */
-
-/* This should only be incremented when either the layout of swig_type_info changes,
-   or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "4"
-
-/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
-#ifdef SWIG_TYPE_TABLE
-# define SWIG_QUOTE_STRING(x) #x
-# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
-# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
-#else
-# define SWIG_TYPE_TABLE_NAME
-#endif
-
-/*
-  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the SWIG runtime code.
-  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
-
-  But only do this if strictly necessary, ie, if you have problems
-  with your compiler or suchlike.
-*/
-
-#ifndef SWIGRUNTIME
-# define SWIGRUNTIME SWIGINTERN
-#endif
-
-#ifndef SWIGRUNTIMEINLINE
-# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
-#endif
-
-/*  Generic buffer size */
-#ifndef SWIG_BUFFER_SIZE
-# define SWIG_BUFFER_SIZE 1024
-#endif
-
-/* Flags for pointer conversions */
-#define SWIG_POINTER_DISOWN        0x1
-#define SWIG_CAST_NEW_MEMORY       0x2
-
-/* Flags for new pointer objects */
-#define SWIG_POINTER_OWN           0x1
-
-
-/*
-   Flags/methods for returning states.
-
-   The SWIG conversion methods, as ConvertPtr, return an integer
-   that tells if the conversion was successful or not. And if not,
-   an error code can be returned (see swigerrors.swg for the codes).
-
-   Use the following macros/flags to set or process the returning
-   states.
-
-   In old versions of SWIG, code such as the following was usually written:
-
-     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
-       // success code
-     } else {
-       //fail code
-     }
-
-   Now you can be more explicit:
-
-    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
-    if (SWIG_IsOK(res)) {
-      // success code
-    } else {
-      // fail code
-    }
-
-   which is the same really, but now you can also do
-
-    Type *ptr;
-    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
-    if (SWIG_IsOK(res)) {
-      // success code
-      if (SWIG_IsNewObj(res) {
-        ...
-	delete *ptr;
-      } else {
-        ...
-      }
-    } else {
-      // fail code
-    }
-
-   I.e., now SWIG_ConvertPtr can return new objects and you can
-   identify the case and take care of the deallocation. Of course that
-   also requires SWIG_ConvertPtr to return new result values, such as
-
-      int SWIG_ConvertPtr(obj, ptr,...) {
-        if (<obj is ok>) {
-          if (<need new object>) {
-            *ptr = <ptr to new allocated object>;
-            return SWIG_NEWOBJ;
-          } else {
-            *ptr = <ptr to old object>;
-            return SWIG_OLDOBJ;
-          }
-        } else {
-          return SWIG_BADOBJ;
-        }
-      }
-
-   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
-   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   SWIG errors code.
-
-   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
-   allows to return the 'cast rank', for example, if you have this
-
-       int food(double)
-       int fooi(int);
-
-   and you call
-
-      food(1)   // cast rank '1'  (1 -> 1.0)
-      fooi(1)   // cast rank '0'
-
-   just use the SWIG_AddCast()/SWIG_CheckState()
-*/
-
-#define SWIG_OK                    (0)
-#define SWIG_ERROR                 (-1)
-#define SWIG_IsOK(r)               (r >= 0)
-#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
-
-/* The CastRankLimit says how many bits are used for the cast rank */
-#define SWIG_CASTRANKLIMIT         (1 << 8)
-/* The NewMask denotes the object was created (using new/malloc) */
-#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
-/* The TmpMask is for in/out typemaps that use temporal objects */
-#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
-/* Simple returning values */
-#define SWIG_BADOBJ                (SWIG_ERROR)
-#define SWIG_OLDOBJ                (SWIG_OK)
-#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
-#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
-/* Check, add and del mask methods */
-#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
-#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
-#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
-#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
-#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
-#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
-
-/* Cast-Rank Mode */
-#if defined(SWIG_CASTRANK_MODE)
-#  ifndef SWIG_TypeRank
-#    define SWIG_TypeRank             unsigned long
-#  endif
-#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
-#    define SWIG_MAXCASTRANK          (2)
-#  endif
-#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
-#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) {
-  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
-}
-SWIGINTERNINLINE int SWIG_CheckState(int r) {
-  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
-}
-#else /* no cast-rank mode */
-#  define SWIG_AddCast(r) (r)
-#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
-#endif
-
-
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void *(*swig_converter_func)(void *, int *);
-typedef struct swig_type_info *(*swig_dycast_func)(void **);
-
-/* Structure to store information on one type */
-typedef struct swig_type_info {
-  const char             *name;			/* mangled name of this type */
-  const char             *str;			/* human readable name of this type */
-  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
-  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
-  void                   *clientdata;		/* language specific type data */
-  int                    owndata;		/* flag if the structure owns the clientdata */
-} swig_type_info;
-
-/* Structure to store a type and conversion function used for casting */
-typedef struct swig_cast_info {
-  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
-  swig_converter_func     converter;		/* function to cast the void pointers */
-  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
-  struct swig_cast_info  *prev;			/* pointer to the previous cast */
-} swig_cast_info;
-
-/* Structure used to store module information
- * Each module generates one structure like this, and the runtime collects
- * all of these structures and stores them in a circularly linked list.*/
-typedef struct swig_module_info {
-  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
-  size_t                 size;		        /* Number of types in this module */
-  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
-  swig_type_info         **type_initial;	/* Array of initially generated type structures */
-  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
-  void                    *clientdata;		/* Language specific module data */
-} swig_module_info;
-
-/*
-  Compare two type names skipping the space characters, therefore
-  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
-
-  Return 0 when the two name types are equivalent, as in
-  strncmp, but skipping ' '.
-*/
-SWIGRUNTIME int
-SWIG_TypeNameComp(const char *f1, const char *l1,
-		  const char *f2, const char *l2) {
-  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
-    while ((*f1 == ' ') && (f1 != l1)) ++f1;
-    while ((*f2 == ' ') && (f2 != l2)) ++f2;
-    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
-  }
-  return (int)((l1 - f1) - (l2 - f2));
-}
-
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
-*/
-SWIGRUNTIME int
-SWIG_TypeCmp(const char *nb, const char *tb) {
-  int equiv = 1;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (equiv != 0 && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
-    if (*ne) ++ne;
-  }
-  return equiv;
-}
-
-/*
-  Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
-*/
-SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
-}
-
-/*
-  Check the typename
-*/
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  if (ty) {
-    swig_cast_info *iter = ty->cast;
-    while (iter) {
-      if (strcmp(iter->type->name, c) == 0) {
-        if (iter == ty->cast)
-          return iter;
-        /* Move iter to the top of the linked list */
-        iter->prev->next = iter->next;
-        if (iter->next)
-          iter->next->prev = iter->prev;
-        iter->next = ty->cast;
-        iter->prev = 0;
-        if (ty->cast) ty->cast->prev = iter;
-        ty->cast = iter;
-        return iter;
-      }
-      iter = iter->next;
-    }
-  }
-  return 0;
-}
-
-/*
-  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
-*/
-SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
-  if (ty) {
-    swig_cast_info *iter = ty->cast;
-    while (iter) {
-      if (iter->type == from) {
-        if (iter == ty->cast)
-          return iter;
-        /* Move iter to the top of the linked list */
-        iter->prev->next = iter->next;
-        if (iter->next)
-          iter->next->prev = iter->prev;
-        iter->next = ty->cast;
-        iter->prev = 0;
-        if (ty->cast) ty->cast->prev = iter;
-        ty->cast = iter;
-        return iter;
-      }
-      iter = iter->next;
-    }
-  }
-  return 0;
-}
-
-/*
-  Cast a pointer up an inheritance hierarchy
-*/
-SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
-}
-
-/*
-   Dynamic pointer casting. Down an inheritance hierarchy
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
-  swig_type_info *lastty = ty;
-  if (!ty || !ty->dcast) return ty;
-  while (ty && (ty->dcast)) {
-    ty = (*ty->dcast)(ptr);
-    if (ty) lastty = ty;
-  }
-  return lastty;
-}
-
-/*
-  Return the name associated with this type
-*/
-SWIGRUNTIMEINLINE const char *
-SWIG_TypeName(const swig_type_info *ty) {
-  return ty->name;
-}
-
-/*
-  Return the pretty name associated with this type,
-  that is an unmangled type name in a form presentable to the user.
-*/
-SWIGRUNTIME const char *
-SWIG_TypePrettyName(const swig_type_info *type) {
-  /* The "str" field contains the equivalent pretty names of the
-     type, separated by vertical-bar characters.  We choose
-     to print the last name, as it is often (?) the most
-     specific. */
-  if (!type) return NULL;
-  if (type->str != NULL) {
-    const char *last_name = type->str;
-    const char *s;
-    for (s = type->str; *s; s++)
-      if (*s == '|') last_name = s+1;
-    return last_name;
-  }
-  else
-    return type->name;
-}
-
-/*
-   Set the clientdata field for a type
-*/
-SWIGRUNTIME void
-SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
-  swig_cast_info *cast = ti->cast;
-  /* if (ti->clientdata == clientdata) return; */
-  ti->clientdata = clientdata;
-
-  while (cast) {
-    if (!cast->converter) {
-      swig_type_info *tc = cast->type;
-      if (!tc->clientdata) {
-	SWIG_TypeClientData(tc, clientdata);
-      }
-    }
-    cast = cast->next;
-  }
-}
-SWIGRUNTIME void
-SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
-  SWIG_TypeClientData(ti, clientdata);
-  ti->owndata = 1;
-}
-
-/*
-  Search for a swig_type_info structure only by mangled name
-  Search is a O(log #types)
-
-  We start searching at module start, and finish searching when start == end.
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start,
-                            swig_module_info *end,
-		            const char *name) {
-  swig_module_info *iter = start;
-  do {
-    if (iter->size) {
-      size_t l = 0;
-      size_t r = iter->size - 1;
-      do {
-	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
-	size_t i = (l + r) >> 1;
-	const char *iname = iter->types[i]->name;
-	if (iname) {
-	  int compare = strcmp(name, iname);
-	  if (compare == 0) {
-	    return iter->types[i];
-	  } else if (compare < 0) {
-	    if (i) {
-	      r = i - 1;
-	    } else {
-	      break;
-	    }
-	  } else if (compare > 0) {
-	    l = i + 1;
-	  }
-	} else {
-	  break; /* should never happen */
-	}
-      } while (l <= r);
-    }
-    iter = iter->next;
-  } while (iter != end);
-  return 0;
-}
-
-/*
-  Search for a swig_type_info structure for either a mangled name or a human readable name.
-  It first searches the mangled names of the types, which is a O(log #types)
-  If a type is not found it then searches the human readable names, which is O(#types).
-
-  We start searching at module start, and finish searching when start == end.
-  Note: if start == end at the beginning of the function, we go all the way around
-  the circular list.
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start,
-                     swig_module_info *end,
-		     const char *name) {
-  /* STEP 1: Search the name field using binary search */
-  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
-  if (ret) {
-    return ret;
-  } else {
-    /* STEP 2: If the type hasn't been found, do a complete search
-       of the str field (the human readable name) */
-    swig_module_info *iter = start;
-    do {
-      size_t i = 0;
-      for (; i < iter->size; ++i) {
-	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
-	  return iter->types[i];
-      }
-      iter = iter->next;
-    } while (iter != end);
-  }
-
-  /* neither found a match */
-  return 0;
-}
-
-/*
-   Pack binary data into a string
-*/
-SWIGRUNTIME char *
-SWIG_PackData(char *c, void *ptr, size_t sz) {
-  static const char hex[17] = "0123456789abcdef";
-  const unsigned char *u = (unsigned char *) ptr;
-  const unsigned char *eu =  u + sz;
-  for (; u != eu; ++u) {
-    unsigned char uu = *u;
-    *(c++) = hex[(uu & 0xf0) >> 4];
-    *(c++) = hex[uu & 0xf];
-  }
-  return c;
-}
-
-/*
-   Unpack binary data from a string
-*/
-SWIGRUNTIME const char *
-SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
-  unsigned char *u = (unsigned char *) ptr;
-  const unsigned char *eu = u + sz;
-  for (; u != eu; ++u) {
-    char d = *(c++);
-    unsigned char uu;
-    if ((d >= '0') && (d <= '9'))
-      uu = (unsigned char)((d - '0') << 4);
-    else if ((d >= 'a') && (d <= 'f'))
-      uu = (unsigned char)((d - ('a'-10)) << 4);
-    else
-      return (char *) 0;
-    d = *(c++);
-    if ((d >= '0') && (d <= '9'))
-      uu |= (unsigned char)(d - '0');
-    else if ((d >= 'a') && (d <= 'f'))
-      uu |= (unsigned char)(d - ('a'-10));
-    else
-      return (char *) 0;
-    *u = uu;
-  }
-  return c;
-}
-
-/*
-   Pack 'void *' into a string buffer.
-*/
-SWIGRUNTIME char *
-SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
-  char *r = buff;
-  if ((2*sizeof(void *) + 2) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,&ptr,sizeof(void *));
-  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
-  strcpy(r,name);
-  return buff;
-}
-
-SWIGRUNTIME const char *
-SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      *ptr = (void *) 0;
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sizeof(void *));
-}
-
-SWIGRUNTIME char *
-SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
-  char *r = buff;
-  size_t lname = (name ? strlen(name) : 0);
-  if ((2*sz + 2 + lname) > bsz) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r,ptr,sz);
-  if (lname) {
-    strncpy(r,name,lname+1);
-  } else {
-    *r = 0;
-  }
-  return buff;
-}
-
-SWIGRUNTIME const char *
-SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
-  if (*c != '_') {
-    if (strcmp(c,"NULL") == 0) {
-      memset(ptr,0,sz);
-      return name;
-    } else {
-      return 0;
-    }
-  }
-  return SWIG_UnpackData(++c,ptr,sz);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-/*  Errors in SWIG */
-#define  SWIG_UnknownError    	   -1
-#define  SWIG_IOError        	   -2
-#define  SWIG_RuntimeError   	   -3
-#define  SWIG_IndexError     	   -4
-#define  SWIG_TypeError      	   -5
-#define  SWIG_DivisionByZero 	   -6
-#define  SWIG_OverflowError  	   -7
-#define  SWIG_SyntaxError    	   -8
-#define  SWIG_ValueError     	   -9
-#define  SWIG_SystemError    	   -10
-#define  SWIG_AttributeError 	   -11
-#define  SWIG_MemoryError    	   -12
-#define  SWIG_NullReferenceError   -13
-
-
-
-/* Compatibility macros for Python 3 */
-#if PY_VERSION_HEX >= 0x03000000
-
-#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
-#define PyInt_Check(x) PyLong_Check(x)
-#define PyInt_AsLong(x) PyLong_AsLong(x)
-#define PyInt_FromLong(x) PyLong_FromLong(x)
-#define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
-#define PyString_Check(name) PyBytes_Check(name)
-#define PyString_FromString(x) PyUnicode_FromString(x)
-#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
-#define PyString_AsString(str) PyBytes_AsString(str)
-#define PyString_Size(str) PyBytes_Size(str)	
-#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
-#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
-#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
-#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
-
-#endif
-
-#ifndef Py_TYPE
-#  define Py_TYPE(op) ((op)->ob_type)
-#endif
-
-/* SWIG APIs for compatibility of both Python 2 & 3 */
-
-#if PY_VERSION_HEX >= 0x03000000
-#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
-#else
-#  define SWIG_Python_str_FromFormat PyString_FromFormat
-#endif
-
-
-/* Warning: This function will allocate a new string in Python 3,
- * so please call SWIG_Python_str_DelForPy3(x) to free the space.
- */
-SWIGINTERN char*
-SWIG_Python_str_AsChar(PyObject *str)
-{
-#if PY_VERSION_HEX >= 0x03000000
-  char *cstr;
-  char *newstr;
-  Py_ssize_t len;
-  str = PyUnicode_AsUTF8String(str);
-  PyBytes_AsStringAndSize(str, &cstr, &len);
-  newstr = (char *) malloc(len+1);
-  memcpy(newstr, cstr, len+1);
-  Py_XDECREF(str);
-  return newstr;
-#else
-  return PyString_AsString(str);
-#endif
-}
-
-#if PY_VERSION_HEX >= 0x03000000
-#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
-#else
-#  define SWIG_Python_str_DelForPy3(x) 
-#endif
-
-
-SWIGINTERN PyObject*
-SWIG_Python_str_FromChar(const char *c)
-{
-#if PY_VERSION_HEX >= 0x03000000
-  return PyUnicode_FromString(c); 
-#else
-  return PyString_FromString(c);
-#endif
-}
-
-/* Add PyOS_snprintf for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
-#  define PyOS_snprintf _snprintf
-# else
-#  define PyOS_snprintf snprintf
-# endif
-#endif
-
-/* A crude PyString_FromFormat implementation for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-
-#ifndef SWIG_PYBUFFER_SIZE
-# define SWIG_PYBUFFER_SIZE 1024
-#endif
-
-static PyObject *
-PyString_FromFormat(const char *fmt, ...) {
-  va_list ap;
-  char buf[SWIG_PYBUFFER_SIZE * 2];
-  int res;
-  va_start(ap, fmt);
-  res = vsnprintf(buf, sizeof(buf), fmt, ap);
-  va_end(ap);
-  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
-}
-#endif
-
-#ifndef PyObject_DEL
-# define PyObject_DEL PyObject_Del
-#endif
-
-/* A crude PyExc_StopIteration exception for old Pythons */
-#if PY_VERSION_HEX < 0x02020000
-# ifndef PyExc_StopIteration
-#  define PyExc_StopIteration PyExc_RuntimeError
-# endif
-# ifndef PyObject_GenericGetAttr
-#  define PyObject_GenericGetAttr 0
-# endif
-#endif
-
-/* Py_NotImplemented is defined in 2.1 and up. */
-#if PY_VERSION_HEX < 0x02010000
-# ifndef Py_NotImplemented
-#  define Py_NotImplemented PyExc_RuntimeError
-# endif
-#endif
-
-/* A crude PyString_AsStringAndSize implementation for old Pythons */
-#if PY_VERSION_HEX < 0x02010000
-# ifndef PyString_AsStringAndSize
-#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
-# endif
-#endif
-
-/* PySequence_Size for old Pythons */
-#if PY_VERSION_HEX < 0x02000000
-# ifndef PySequence_Size
-#  define PySequence_Size PySequence_Length
-# endif
-#endif
-
-/* PyBool_FromLong for old Pythons */
-#if PY_VERSION_HEX < 0x02030000
-static
-PyObject *PyBool_FromLong(long ok)
-{
-  PyObject *result = ok ? Py_True : Py_False;
-  Py_INCREF(result);
-  return result;
-}
-#endif
-
-/* Py_ssize_t for old Pythons */
-/* This code is as recommended by: */
-/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-# define PY_SSIZE_T_MAX INT_MAX
-# define PY_SSIZE_T_MIN INT_MIN
-typedef inquiry lenfunc;
-typedef intargfunc ssizeargfunc;
-typedef intintargfunc ssizessizeargfunc;
-typedef intobjargproc ssizeobjargproc;
-typedef intintobjargproc ssizessizeobjargproc;
-typedef getreadbufferproc readbufferproc;
-typedef getwritebufferproc writebufferproc;
-typedef getsegcountproc segcountproc;
-typedef getcharbufferproc charbufferproc;
-static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
-{
-  long result = 0;
-  PyObject *i = PyNumber_Int(x);
-  if (i) {
-    result = PyInt_AsLong(i);
-    Py_DECREF(i);
-  }
-  return result;
-}
-#endif
-
-#if PY_VERSION_HEX < 0x02050000
-#define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
-#endif
-
-#if PY_VERSION_HEX < 0x02040000
-#define Py_VISIT(op)				\
-  do { 						\
-    if (op) {					\
-      int vret = visit((op), arg);		\
-      if (vret)					\
-        return vret;				\
-    }						\
-  } while (0)
-#endif
-
-#if PY_VERSION_HEX < 0x02030000
-typedef struct {
-  PyTypeObject type;
-  PyNumberMethods as_number;
-  PyMappingMethods as_mapping;
-  PySequenceMethods as_sequence;
-  PyBufferProcs as_buffer;
-  PyObject *name, *slots;
-} PyHeapTypeObject;
-#endif
-
-#if PY_VERSION_HEX < 0x02030000
-typedef destructor freefunc;
-#endif
-
-#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
-     (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
-     (PY_MAJOR_VERSION > 3))
-# define SWIGPY_USE_CAPSULE
-# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
-#endif
-
-#if PY_VERSION_HEX < 0x03020000
-#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
-#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
-#define Py_hash_t long
-#endif
-
-/* -----------------------------------------------------------------------------
- * error manipulation
- * ----------------------------------------------------------------------------- */
-
-SWIGRUNTIME PyObject*
-SWIG_Python_ErrorType(int code) {
-  PyObject* type = 0;
-  switch(code) {
-  case SWIG_MemoryError:
-    type = PyExc_MemoryError;
-    break;
-  case SWIG_IOError:
-    type = PyExc_IOError;
-    break;
-  case SWIG_RuntimeError:
-    type = PyExc_RuntimeError;
-    break;
-  case SWIG_IndexError:
-    type = PyExc_IndexError;
-    break;
-  case SWIG_TypeError:
-    type = PyExc_TypeError;
-    break;
-  case SWIG_DivisionByZero:
-    type = PyExc_ZeroDivisionError;
-    break;
-  case SWIG_OverflowError:
-    type = PyExc_OverflowError;
-    break;
-  case SWIG_SyntaxError:
-    type = PyExc_SyntaxError;
-    break;
-  case SWIG_ValueError:
-    type = PyExc_ValueError;
-    break;
-  case SWIG_SystemError:
-    type = PyExc_SystemError;
-    break;
-  case SWIG_AttributeError:
-    type = PyExc_AttributeError;
-    break;
-  default:
-    type = PyExc_RuntimeError;
-  }
-  return type;
-}
-
-
-SWIGRUNTIME void
-SWIG_Python_AddErrorMsg(const char* mesg)
-{
-  PyObject *type = 0;
-  PyObject *value = 0;
-  PyObject *traceback = 0;
-
-  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
-  if (value) {
-    char *tmp;
-    PyObject *old_str = PyObject_Str(value);
-    PyErr_Clear();
-    Py_XINCREF(type);
-
-    PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
-    SWIG_Python_str_DelForPy3(tmp);
-    Py_DECREF(old_str);
-    Py_DECREF(value);
-  } else {
-    PyErr_SetString(PyExc_RuntimeError, mesg);
-  }
-}
-
-#if defined(SWIG_PYTHON_NO_THREADS)
-#  if defined(SWIG_PYTHON_THREADS)
-#    undef SWIG_PYTHON_THREADS
-#  endif
-#endif
-#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
-#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
-#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
-#      define SWIG_PYTHON_USE_GIL
-#    endif
-#  endif
-#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
-#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
-#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
-#    endif
-#    ifdef __cplusplus /* C++ code */
-       class SWIG_Python_Thread_Block {
-         bool status;
-         PyGILState_STATE state;
-       public:
-         void end() { if (status) { PyGILState_Release(state); status = false;} }
-         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
-         ~SWIG_Python_Thread_Block() { end(); }
-       };
-       class SWIG_Python_Thread_Allow {
-         bool status;
-         PyThreadState *save;
-       public:
-         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
-         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
-         ~SWIG_Python_Thread_Allow() { end(); }
-       };
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
-#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
-#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
-#    else /* C code */
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
-#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
-#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
-#    endif
-#  else /* Old thread way, not implemented, user must provide it */
-#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
-#      define SWIG_PYTHON_INITIALIZE_THREADS
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
-#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
-#      define SWIG_PYTHON_THREAD_END_BLOCK
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
-#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
-#    endif
-#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
-#      define SWIG_PYTHON_THREAD_END_ALLOW
-#    endif
-#  endif
-#else /* No thread support */
-#  define SWIG_PYTHON_INITIALIZE_THREADS
-#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
-#  define SWIG_PYTHON_THREAD_END_BLOCK
-#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
-#  define SWIG_PYTHON_THREAD_END_ALLOW
-#endif
-
-/* -----------------------------------------------------------------------------
- * Python API portion that goes into the runtime
- * ----------------------------------------------------------------------------- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* -----------------------------------------------------------------------------
- * Constant declarations
- * ----------------------------------------------------------------------------- */
-
-/* Constant Types */
-#define SWIG_PY_POINTER 4
-#define SWIG_PY_BINARY  5
-
-/* Constant information structure */
-typedef struct swig_const_info {
-  int type;
-  char *name;
-  long lvalue;
-  double dvalue;
-  void   *pvalue;
-  swig_type_info **ptype;
-} swig_const_info;
-
-
-/* -----------------------------------------------------------------------------
- * Wrapper of PyInstanceMethod_New() used in Python 3
- * It is exported to the generated module, used for -fastproxy
- * ----------------------------------------------------------------------------- */
-#if PY_VERSION_HEX >= 0x03000000
-SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
-{
-  return PyInstanceMethod_New(func);
-}
-#else
-SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
-{
-  return NULL;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/* -----------------------------------------------------------------------------
- * pyrun.swg
- *
- * This file contains the runtime support for Python modules
- * and includes code for managing global variables and pointer
- * type checking.
- *
- * ----------------------------------------------------------------------------- */
-
-/* Common SWIG API */
-
-/* for raw pointers */
-#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
-#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
-#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
-
-#ifdef SWIGPYTHON_BUILTIN
-#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
-#else
-#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
-#endif
-
-#define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
-
-#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
-#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
-#define swig_owntype                                    int
-
-/* for raw packed data */
-#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
-#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
-
-/* for class or struct pointers */
-#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
-#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
-
-/* for C or C++ function pointers */
-#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
-#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
-
-/* for C++ member pointers, ie, member methods */
-#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
-#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
-
-
-/* Runtime API */
-
-#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
-#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
-#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
-
-#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
-#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
-#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
-#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
-#define SWIG_fail                        		goto fail					   
-
-
-/* Runtime API implementation */
-
-/* Error manipulation */
-
-SWIGINTERN void 
-SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
-  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
-  PyErr_SetObject(errtype, obj);
-  Py_DECREF(obj);
-  SWIG_PYTHON_THREAD_END_BLOCK;
-}
-
-SWIGINTERN void 
-SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
-  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-  PyErr_SetString(errtype, msg);
-  SWIG_PYTHON_THREAD_END_BLOCK;
-}
-
-#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
-
-/* Set a constant value */
-
-#if defined(SWIGPYTHON_BUILTIN)
-
-SWIGINTERN void
-SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
-  PyObject *s = PyString_InternFromString(key);
-  PyList_Append(seq, s);
-  Py_DECREF(s);
-}
-
-SWIGINTERN void
-SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {   
-#if PY_VERSION_HEX < 0x02030000
-  PyDict_SetItemString(d, (char *)name, obj);
-#else
-  PyDict_SetItemString(d, name, obj);
-#endif
-  Py_DECREF(obj);
-  if (public_interface)
-    SwigPyBuiltin_AddPublicSymbol(public_interface, name);
-}
-
-#else
-
-SWIGINTERN void
-SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
-#if PY_VERSION_HEX < 0x02030000
-  PyDict_SetItemString(d, (char *)name, obj);
-#else
-  PyDict_SetItemString(d, name, obj);
-#endif
-  Py_DECREF(obj);                            
-}
-
-#endif
-
-/* Append a value to the result obj */
-
-SWIGINTERN PyObject*
-SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
-#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
-  if (!result) {
-    result = obj;
-  } else if (result == Py_None) {
-    Py_DECREF(result);
-    result = obj;
-  } else {
-    if (!PyList_Check(result)) {
-      PyObject *o2 = result;
-      result = PyList_New(1);
-      PyList_SetItem(result, 0, o2);
-    }
-    PyList_Append(result,obj);
-    Py_DECREF(obj);
-  }
-  return result;
-#else
-  PyObject*   o2;
-  PyObject*   o3;
-  if (!result) {
-    result = obj;
-  } else if (result == Py_None) {
-    Py_DECREF(result);
-    result = obj;
-  } else {
-    if (!PyTuple_Check(result)) {
-      o2 = result;
-      result = PyTuple_New(1);
-      PyTuple_SET_ITEM(result, 0, o2);
-    }
-    o3 = PyTuple_New(1);
-    PyTuple_SET_ITEM(o3, 0, obj);
-    o2 = result;
-    result = PySequence_Concat(o2, o3);
-    Py_DECREF(o2);
-    Py_DECREF(o3);
-  }
-  return result;
-#endif
-}
-
-/* Unpack the argument tuple */
-
-SWIGINTERN Py_ssize_t
-SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
-{
-  if (!args) {
-    if (!min && !max) {
-      return 1;
-    } else {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
-		   name, (min == max ? "" : "at least "), (int)min);
-      return 0;
-    }
-  }  
-  if (!PyTuple_Check(args)) {
-    if (min <= 1 && max >= 1) {
-      Py_ssize_t i;
-      objs[0] = args;
-      for (i = 1; i < max; ++i) {
-	objs[i] = 0;
-      }
-      return 2;
-    }
-    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
-    return 0;
-  } else {
-    Py_ssize_t l = PyTuple_GET_SIZE(args);
-    if (l < min) {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
-		   name, (min == max ? "" : "at least "), (int)min, (int)l);
-      return 0;
-    } else if (l > max) {
-      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
-		   name, (min == max ? "" : "at most "), (int)max, (int)l);
-      return 0;
-    } else {
-      Py_ssize_t i;
-      for (i = 0; i < l; ++i) {
-	objs[i] = PyTuple_GET_ITEM(args, i);
-      }
-      for (; l < max; ++l) {
-	objs[l] = 0;
-      }
-      return i + 1;
-    }    
-  }
-}
-
-/* A functor is a function object with one single object argument */
-#if PY_VERSION_HEX >= 0x02020000
-#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
-#else
-#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
-#endif
-
-/*
-  Helper for static pointer initialization for both C and C++ code, for example
-  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
-*/
-#ifdef __cplusplus
-#define SWIG_STATIC_POINTER(var)  var
-#else
-#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
-#endif
-
-/* -----------------------------------------------------------------------------
- * Pointer declarations
- * ----------------------------------------------------------------------------- */
-
-/* Flags for new pointer objects */
-#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
-#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
-
-#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
-
-#define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
-#define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*  How to access Py_None */
-#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#  ifndef SWIG_PYTHON_NO_BUILD_NONE
-#    ifndef SWIG_PYTHON_BUILD_NONE
-#      define SWIG_PYTHON_BUILD_NONE
-#    endif
-#  endif
-#endif
-
-#ifdef SWIG_PYTHON_BUILD_NONE
-#  ifdef Py_None
-#   undef Py_None
-#   define Py_None SWIG_Py_None()
-#  endif
-SWIGRUNTIMEINLINE PyObject * 
-_SWIG_Py_None(void)
-{
-  PyObject *none = Py_BuildValue((char*)"");
-  Py_DECREF(none);
-  return none;
-}
-SWIGRUNTIME PyObject * 
-SWIG_Py_None(void)
-{
-  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
-  return none;
-}
-#endif
-
-/* The python void return value */
-
-SWIGRUNTIMEINLINE PyObject * 
-SWIG_Py_Void(void)
-{
-  PyObject *none = Py_None;
-  Py_INCREF(none);
-  return none;
-}
-
-/* SwigPyClientData */
-
-typedef struct {
-  PyObject *klass;
-  PyObject *newraw;
-  PyObject *newargs;
-  PyObject *destroy;
-  int delargs;
-  int implicitconv;
-  PyTypeObject *pytype;
-} SwigPyClientData;
-
-SWIGRUNTIMEINLINE int 
-SWIG_Python_CheckImplicit(swig_type_info *ty)
-{
-  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
-  return data ? data->implicitconv : 0;
-}
-
-SWIGRUNTIMEINLINE PyObject *
-SWIG_Python_ExceptionType(swig_type_info *desc) {
-  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
-  PyObject *klass = data ? data->klass : 0;
-  return (klass ? klass : PyExc_RuntimeError);
-}
-
-
-SWIGRUNTIME SwigPyClientData * 
-SwigPyClientData_New(PyObject* obj)
-{
-  if (!obj) {
-    return 0;
-  } else {
-    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
-    /* the klass element */
-    data->klass = obj;
-    Py_INCREF(data->klass);
-    /* the newraw method and newargs arguments used to create a new raw instance */
-    if (PyClass_Check(obj)) {
-      data->newraw = 0;
-      data->newargs = obj;
-      Py_INCREF(obj);
-    } else {
-#if (PY_VERSION_HEX < 0x02020000)
-      data->newraw = 0;
-#else
-      data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
-#endif
-      if (data->newraw) {
-	Py_INCREF(data->newraw);
-	data->newargs = PyTuple_New(1);
-	PyTuple_SetItem(data->newargs, 0, obj);
-      } else {
-	data->newargs = obj;
-      }
-      Py_INCREF(data->newargs);
-    }
-    /* the destroy method, aka as the C++ delete method */
-    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
-    if (PyErr_Occurred()) {
-      PyErr_Clear();
-      data->destroy = 0;
-    }
-    if (data->destroy) {
-      int flags;
-      Py_INCREF(data->destroy);
-      flags = PyCFunction_GET_FLAGS(data->destroy);
-#ifdef METH_O
-      data->delargs = !(flags & (METH_O));
-#else
-      data->delargs = 0;
-#endif
-    } else {
-      data->delargs = 0;
-    }
-    data->implicitconv = 0;
-    data->pytype = 0;
-    return data;
-  }
-}
-
-SWIGRUNTIME void 
-SwigPyClientData_Del(SwigPyClientData *data) {
-  Py_XDECREF(data->newraw);
-  Py_XDECREF(data->newargs);
-  Py_XDECREF(data->destroy);
-}
-
-/* =============== SwigPyObject =====================*/
-
-typedef struct {
-  PyObject_HEAD
-  void *ptr;
-  swig_type_info *ty;
-  int own;
-  PyObject *next;
-#ifdef SWIGPYTHON_BUILTIN
-  PyObject *dict;
-#endif
-} SwigPyObject;
-
-
-#ifdef SWIGPYTHON_BUILTIN
-
-SWIGRUNTIME PyObject *
-SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
-{
-  SwigPyObject *sobj = (SwigPyObject *)v;
-
-  if (!sobj->dict)
-    sobj->dict = PyDict_New();
-
-  Py_INCREF(sobj->dict);
-  return sobj->dict;
-}
-
-#endif
-
-SWIGRUNTIME PyObject *
-SwigPyObject_long(SwigPyObject *v)
-{
-  return PyLong_FromVoidPtr(v->ptr);
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_format(const char* fmt, SwigPyObject *v)
-{
-  PyObject *res = NULL;
-  PyObject *args = PyTuple_New(1);
-  if (args) {
-    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
-      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
-      if (ofmt) {
-#if PY_VERSION_HEX >= 0x03000000
-	res = PyUnicode_Format(ofmt,args);
-#else
-	res = PyString_Format(ofmt,args);
-#endif
-	Py_DECREF(ofmt);
-      }
-      Py_DECREF(args);
-    }
-  }
-  return res;
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_oct(SwigPyObject *v)
-{
-  return SwigPyObject_format("%o",v);
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_hex(SwigPyObject *v)
-{
-  return SwigPyObject_format("%x",v);
-}
-
-SWIGRUNTIME PyObject *
-#ifdef METH_NOARGS
-SwigPyObject_repr(SwigPyObject *v)
-#else
-SwigPyObject_repr(SwigPyObject *v, PyObject *args)
-#endif
-{
-  const char *name = SWIG_TypePrettyName(v->ty);
-  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
-  if (v->next) {
-# ifdef METH_NOARGS
-    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
-# else
-    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
-# endif
-# if PY_VERSION_HEX >= 0x03000000
-    PyObject *joined = PyUnicode_Concat(repr, nrep);
-    Py_DecRef(repr);
-    Py_DecRef(nrep);
-    repr = joined;
-# else
-    PyString_ConcatAndDel(&repr,nrep);
-# endif
-  }
-  return repr;  
-}
-
-SWIGRUNTIME int
-SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
-{
-  void *i = v->ptr;
-  void *j = w->ptr;
-  return (i < j) ? -1 : ((i > j) ? 1 : 0);
-}
-
-/* Added for Python 3.x, would it also be useful for Python 2.x? */
-SWIGRUNTIME PyObject*
-SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
-{
-  PyObject* res;
-  if( op != Py_EQ && op != Py_NE ) {
-    Py_INCREF(Py_NotImplemented);
-    return Py_NotImplemented;
-  }
-  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
-  return res;  
-}
-
-
-SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
-
-#ifdef SWIGPYTHON_BUILTIN
-static swig_type_info *SwigPyObject_stype = 0;
-SWIGRUNTIME PyTypeObject*
-SwigPyObject_type(void) {
-    SwigPyClientData *cd;
-    assert(SwigPyObject_stype);
-    cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
-    assert(cd);
-    assert(cd->pytype);
-    return cd->pytype;
-}
-#else
-SWIGRUNTIME PyTypeObject*
-SwigPyObject_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
-  return type;
-}
-#endif
-
-SWIGRUNTIMEINLINE int
-SwigPyObject_Check(PyObject *op) {
-#ifdef SWIGPYTHON_BUILTIN
-  PyTypeObject *target_tp = SwigPyObject_type();
-  if (PyType_IsSubtype(op->ob_type, target_tp))
-    return 1;
-  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
-#else
-  return (Py_TYPE(op) == SwigPyObject_type())
-    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
-#endif
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
-
-SWIGRUNTIME void
-SwigPyObject_dealloc(PyObject *v)
-{
-  SwigPyObject *sobj = (SwigPyObject *) v;
-  PyObject *next = sobj->next;
-  if (sobj->own == SWIG_POINTER_OWN) {
-    swig_type_info *ty = sobj->ty;
-    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
-    PyObject *destroy = data ? data->destroy : 0;
-    if (destroy) {
-      /* destroy is always a VARARGS method */
-      PyObject *res;
-
-      /* PyObject_CallFunction() has the potential to silently drop
-         the active active exception.  In cases of unnamed temporary
-         variable or where we just finished iterating over a generator
-         StopIteration will be active right now, and this needs to
-         remain true upon return from SwigPyObject_dealloc.  So save
-         and restore. */
-      
-      PyObject *val = NULL, *type = NULL, *tb = NULL;
-      PyErr_Fetch(&val, &type, &tb);
-
-      if (data->delargs) {
-        /* we need to create a temporary object to carry the destroy operation */
-        PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
-        res = SWIG_Python_CallFunctor(destroy, tmp);
-        Py_DECREF(tmp);
-      } else {
-        PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
-        PyObject *mself = PyCFunction_GET_SELF(destroy);
-        res = ((*meth)(mself, v));
-      }
-      if (!res)
-        PyErr_WriteUnraisable(destroy);
-
-      PyErr_Restore(val, type, tb);
-
-      Py_XDECREF(res);
-    } 
-#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
-    else {
-      const char *name = SWIG_TypePrettyName(ty);
-      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
-    }
-#endif
-  } 
-  Py_XDECREF(next);
-  PyObject_DEL(v);
-}
-
-SWIGRUNTIME PyObject* 
-SwigPyObject_append(PyObject* v, PyObject* next)
-{
-  SwigPyObject *sobj = (SwigPyObject *) v;
-#ifndef METH_O
-  PyObject *tmp = 0;
-  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
-  next = tmp;
-#endif
-  if (!SwigPyObject_Check(next)) {
-    PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
-    return NULL;
-  }
-  sobj->next = next;
-  Py_INCREF(next);
-  return SWIG_Py_Void();
-}
-
-SWIGRUNTIME PyObject* 
-#ifdef METH_NOARGS
-SwigPyObject_next(PyObject* v)
-#else
-SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  SwigPyObject *sobj = (SwigPyObject *) v;
-  if (sobj->next) {    
-    Py_INCREF(sobj->next);
-    return sobj->next;
-  } else {
-    return SWIG_Py_Void();
-  }
-}
-
-SWIGINTERN PyObject*
-#ifdef METH_NOARGS
-SwigPyObject_disown(PyObject *v)
-#else
-SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  SwigPyObject *sobj = (SwigPyObject *)v;
-  sobj->own = 0;
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject*
-#ifdef METH_NOARGS
-SwigPyObject_acquire(PyObject *v)
-#else
-SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
-#endif
-{
-  SwigPyObject *sobj = (SwigPyObject *)v;
-  sobj->own = SWIG_POINTER_OWN;
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject*
-SwigPyObject_own(PyObject *v, PyObject *args)
-{
-  PyObject *val = 0;
-#if (PY_VERSION_HEX < 0x02020000)
-  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
-#elif (PY_VERSION_HEX < 0x02050000)
-  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
-#else
-  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) 
-#endif
-    {
-      return NULL;
-    } 
-  else
-    {
-      SwigPyObject *sobj = (SwigPyObject *)v;
-      PyObject *obj = PyBool_FromLong(sobj->own);
-      if (val) {
-#ifdef METH_NOARGS
-	if (PyObject_IsTrue(val)) {
-	  SwigPyObject_acquire(v);
-	} else {
-	  SwigPyObject_disown(v);
-	}
-#else
-	if (PyObject_IsTrue(val)) {
-	  SwigPyObject_acquire(v,args);
-	} else {
-	  SwigPyObject_disown(v,args);
-	}
-#endif
-      } 
-      return obj;
-    }
-}
-
-#ifdef METH_O
-static PyMethodDef
-swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"acquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
-  {0, 0, 0, 0}  
-};
-#else
-static PyMethodDef
-swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"acquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
-  {0, 0, 0, 0}  
-};
-#endif
-
-#if PY_VERSION_HEX < 0x02020000
-SWIGINTERN PyObject *
-SwigPyObject_getattr(SwigPyObject *sobj,char *name)
-{
-  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
-}
-#endif
-
-SWIGRUNTIME PyTypeObject*
-SwigPyObject_TypeOnce(void) {
-  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
-
-  static PyNumberMethods SwigPyObject_as_number = {
-    (binaryfunc)0, /*nb_add*/
-    (binaryfunc)0, /*nb_subtract*/
-    (binaryfunc)0, /*nb_multiply*/
-    /* nb_divide removed in Python 3 */
-#if PY_VERSION_HEX < 0x03000000
-    (binaryfunc)0, /*nb_divide*/
-#endif
-    (binaryfunc)0, /*nb_remainder*/
-    (binaryfunc)0, /*nb_divmod*/
-    (ternaryfunc)0,/*nb_power*/
-    (unaryfunc)0,  /*nb_negative*/
-    (unaryfunc)0,  /*nb_positive*/
-    (unaryfunc)0,  /*nb_absolute*/
-    (inquiry)0,    /*nb_nonzero*/
-    0,		   /*nb_invert*/
-    0,		   /*nb_lshift*/
-    0,		   /*nb_rshift*/
-    0,		   /*nb_and*/
-    0,		   /*nb_xor*/
-    0,		   /*nb_or*/
-#if PY_VERSION_HEX < 0x03000000
-    0,   /*nb_coerce*/
-#endif
-    (unaryfunc)SwigPyObject_long, /*nb_int*/
-#if PY_VERSION_HEX < 0x03000000
-    (unaryfunc)SwigPyObject_long, /*nb_long*/
-#else
-    0, /*nb_reserved*/
-#endif
-    (unaryfunc)0,                 /*nb_float*/
-#if PY_VERSION_HEX < 0x03000000
-    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
-    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
-#endif
-#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
-#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
-#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
-#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
-#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
-    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
-#endif
-  };
-
-  static PyTypeObject swigpyobject_type;
-  static int type_init = 0;
-  if (!type_init) {
-    const PyTypeObject tmp = {
-#if PY_VERSION_HEX >= 0x03000000
-      PyVarObject_HEAD_INIT(NULL, 0)
-#else
-      PyObject_HEAD_INIT(NULL)
-      0,                                    /* ob_size */
-#endif
-      (char *)"SwigPyObject",               /* tp_name */
-      sizeof(SwigPyObject),                 /* tp_basicsize */
-      0,                                    /* tp_itemsize */
-      (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
-      0,                                    /* tp_print */
-#if PY_VERSION_HEX < 0x02020000
-      (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
-#else
-      (getattrfunc)0,                       /* tp_getattr */
-#endif
-      (setattrfunc)0,                       /* tp_setattr */
-#if PY_VERSION_HEX >= 0x03000000
-      0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
-#else
-      (cmpfunc)SwigPyObject_compare,        /* tp_compare */
-#endif
-      (reprfunc)SwigPyObject_repr,          /* tp_repr */
-      &SwigPyObject_as_number,              /* tp_as_number */
-      0,                                    /* tp_as_sequence */
-      0,                                    /* tp_as_mapping */
-      (hashfunc)0,                          /* tp_hash */
-      (ternaryfunc)0,                       /* tp_call */
-      0,                                    /* tp_str */
-      PyObject_GenericGetAttr,              /* tp_getattro */
-      0,                                    /* tp_setattro */
-      0,                                    /* tp_as_buffer */
-      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
-      swigobject_doc,                       /* tp_doc */
-      0,                                    /* tp_traverse */
-      0,                                    /* tp_clear */
-      (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
-      0,                                    /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-      0,                                    /* tp_iter */
-      0,                                    /* tp_iternext */
-      swigobject_methods,                   /* tp_methods */
-      0,                                    /* tp_members */
-      0,                                    /* tp_getset */
-      0,                                    /* tp_base */
-      0,                                    /* tp_dict */
-      0,                                    /* tp_descr_get */
-      0,                                    /* tp_descr_set */
-      0,                                    /* tp_dictoffset */
-      0,                                    /* tp_init */
-      0,                                    /* tp_alloc */
-      0,                                    /* tp_new */
-      0,                                    /* tp_free */
-      0,                                    /* tp_is_gc */
-      0,                                    /* tp_bases */
-      0,                                    /* tp_mro */
-      0,                                    /* tp_cache */
-      0,                                    /* tp_subclasses */
-      0,                                    /* tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-      0,                                    /* tp_del */
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-      0,                                    /* tp_version_tag */
-#endif
-#if PY_VERSION_HEX >= 0x03040000
-      0,                                    /* tp_finalize */
-#endif
-#ifdef COUNT_ALLOCS
-      0,                                    /* tp_allocs */
-      0,                                    /* tp_frees */
-      0,                                    /* tp_maxalloc */
-#if PY_VERSION_HEX >= 0x02050000
-      0,                                    /* tp_prev */
-#endif
-      0                                     /* tp_next */
-#endif
-    };
-    swigpyobject_type = tmp;
-    type_init = 1;
-#if PY_VERSION_HEX < 0x02020000
-    swigpyobject_type.ob_type = &PyType_Type;
-#else
-    if (PyType_Ready(&swigpyobject_type) < 0)
-      return NULL;
-#endif
-  }
-  return &swigpyobject_type;
-}
-
-SWIGRUNTIME PyObject *
-SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
-{
-  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
-  if (sobj) {
-    sobj->ptr  = ptr;
-    sobj->ty   = ty;
-    sobj->own  = own;
-    sobj->next = 0;
-  }
-  return (PyObject *)sobj;
-}
-
-/* -----------------------------------------------------------------------------
- * Implements a simple Swig Packed type, and use it instead of string
- * ----------------------------------------------------------------------------- */
-
-typedef struct {
-  PyObject_HEAD
-  void *pack;
-  swig_type_info *ty;
-  size_t size;
-} SwigPyPacked;
-
-SWIGRUNTIME int
-SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
-{
-  char result[SWIG_BUFFER_SIZE];
-  fputs("<Swig Packed ", fp); 
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    fputs("at ", fp); 
-    fputs(result, fp); 
-  }
-  fputs(v->ty->name,fp); 
-  fputs(">", fp);
-  return 0; 
-}
-  
-SWIGRUNTIME PyObject *
-SwigPyPacked_repr(SwigPyPacked *v)
-{
-  char result[SWIG_BUFFER_SIZE];
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
-  } else {
-    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
-  }  
-}
-
-SWIGRUNTIME PyObject *
-SwigPyPacked_str(SwigPyPacked *v)
-{
-  char result[SWIG_BUFFER_SIZE];
-  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
-    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
-  } else {
-    return SWIG_Python_str_FromChar(v->ty->name);
-  }  
-}
-
-SWIGRUNTIME int
-SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
-{
-  size_t i = v->size;
-  size_t j = w->size;
-  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
-  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
-}
-
-SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
-
-SWIGRUNTIME PyTypeObject*
-SwigPyPacked_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
-  return type;
-}
-
-SWIGRUNTIMEINLINE int
-SwigPyPacked_Check(PyObject *op) {
-  return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
-    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
-}
-
-SWIGRUNTIME void
-SwigPyPacked_dealloc(PyObject *v)
-{
-  if (SwigPyPacked_Check(v)) {
-    SwigPyPacked *sobj = (SwigPyPacked *) v;
-    free(sobj->pack);
-  }
-  PyObject_DEL(v);
-}
-
-SWIGRUNTIME PyTypeObject*
-SwigPyPacked_TypeOnce(void) {
-  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
-  static PyTypeObject swigpypacked_type;
-  static int type_init = 0;
-  if (!type_init) {
-    const PyTypeObject tmp = {
-#if PY_VERSION_HEX>=0x03000000
-      PyVarObject_HEAD_INIT(NULL, 0)
-#else
-      PyObject_HEAD_INIT(NULL)
-      0,                                    /* ob_size */
-#endif
-      (char *)"SwigPyPacked",               /* tp_name */
-      sizeof(SwigPyPacked),                 /* tp_basicsize */
-      0,                                    /* tp_itemsize */
-      (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
-      (printfunc)SwigPyPacked_print,        /* tp_print */
-      (getattrfunc)0,                       /* tp_getattr */
-      (setattrfunc)0,                       /* tp_setattr */
-#if PY_VERSION_HEX>=0x03000000
-      0, /* tp_reserved in 3.0.1 */
-#else
-      (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
-#endif
-      (reprfunc)SwigPyPacked_repr,          /* tp_repr */
-      0,                                    /* tp_as_number */
-      0,                                    /* tp_as_sequence */
-      0,                                    /* tp_as_mapping */
-      (hashfunc)0,                          /* tp_hash */
-      (ternaryfunc)0,                       /* tp_call */
-      (reprfunc)SwigPyPacked_str,           /* tp_str */
-      PyObject_GenericGetAttr,              /* tp_getattro */
-      0,                                    /* tp_setattro */
-      0,                                    /* tp_as_buffer */
-      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
-      swigpacked_doc,                       /* tp_doc */
-      0,                                    /* tp_traverse */
-      0,                                    /* tp_clear */
-      0,                                    /* tp_richcompare */
-      0,                                    /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-      0,                                    /* tp_iter */
-      0,                                    /* tp_iternext */
-      0,                                    /* tp_methods */
-      0,                                    /* tp_members */
-      0,                                    /* tp_getset */
-      0,                                    /* tp_base */
-      0,                                    /* tp_dict */
-      0,                                    /* tp_descr_get */
-      0,                                    /* tp_descr_set */
-      0,                                    /* tp_dictoffset */
-      0,                                    /* tp_init */
-      0,                                    /* tp_alloc */
-      0,                                    /* tp_new */
-      0,                                    /* tp_free */
-      0,                                    /* tp_is_gc */
-      0,                                    /* tp_bases */
-      0,                                    /* tp_mro */
-      0,                                    /* tp_cache */
-      0,                                    /* tp_subclasses */
-      0,                                    /* tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-      0,                                    /* tp_del */
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-      0,                                    /* tp_version_tag */
-#endif
-#if PY_VERSION_HEX >= 0x03040000
-      0,                                    /* tp_finalize */
-#endif
-#ifdef COUNT_ALLOCS
-      0,                                    /* tp_allocs */
-      0,                                    /* tp_frees */
-      0,                                    /* tp_maxalloc */
-#if PY_VERSION_HEX >= 0x02050000
-      0,                                    /* tp_prev */
-#endif
-      0                                     /* tp_next */
-#endif
-    };
-    swigpypacked_type = tmp;
-    type_init = 1;
-#if PY_VERSION_HEX < 0x02020000
-    swigpypacked_type.ob_type = &PyType_Type;
-#else
-    if (PyType_Ready(&swigpypacked_type) < 0)
-      return NULL;
-#endif
-  }
-  return &swigpypacked_type;
-}
-
-SWIGRUNTIME PyObject *
-SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
-{
-  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
-  if (sobj) {
-    void *pack = malloc(size);
-    if (pack) {
-      memcpy(pack, ptr, size);
-      sobj->pack = pack;
-      sobj->ty   = ty;
-      sobj->size = size;
-    } else {
-      PyObject_DEL((PyObject *) sobj);
-      sobj = 0;
-    }
-  }
-  return (PyObject *) sobj;
-}
-
-SWIGRUNTIME swig_type_info *
-SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
-{
-  if (SwigPyPacked_Check(obj)) {
-    SwigPyPacked *sobj = (SwigPyPacked *)obj;
-    if (sobj->size != size) return 0;
-    memcpy(ptr, sobj->pack, size);
-    return sobj->ty;
-  } else {
-    return 0;
-  }
-}
-
-/* -----------------------------------------------------------------------------
- * pointers/data manipulation
- * ----------------------------------------------------------------------------- */
-
-SWIGRUNTIMEINLINE PyObject *
-_SWIG_This(void)
-{
-    return SWIG_Python_str_FromChar("this");
-}
-
-static PyObject *swig_this = NULL;
-
-SWIGRUNTIME PyObject *
-SWIG_This(void)
-{
-  if (swig_this == NULL)
-    swig_this = _SWIG_This();
-  return swig_this;
-}
-
-/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
-
-/* TODO: I don't know how to implement the fast getset in Python 3 right now */
-#if PY_VERSION_HEX>=0x03000000
-#define SWIG_PYTHON_SLOW_GETSET_THIS 
-#endif
-
-SWIGRUNTIME SwigPyObject *
-SWIG_Python_GetSwigThis(PyObject *pyobj) 
-{
-  PyObject *obj;
-
-  if (SwigPyObject_Check(pyobj))
-    return (SwigPyObject *) pyobj;
-
-#ifdef SWIGPYTHON_BUILTIN
-  (void)obj;
-# ifdef PyWeakref_CheckProxy
-  if (PyWeakref_CheckProxy(pyobj)) {
-    pyobj = PyWeakref_GET_OBJECT(pyobj);
-    if (pyobj && SwigPyObject_Check(pyobj))
-      return (SwigPyObject*) pyobj;
-  }
-# endif
-  return NULL;
-#else
-
-  obj = 0;
-
-#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
-  if (PyInstance_Check(pyobj)) {
-    obj = _PyInstance_Lookup(pyobj, SWIG_This());      
-  } else {
-    PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
-    if (dictptr != NULL) {
-      PyObject *dict = *dictptr;
-      obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
-    } else {
-#ifdef PyWeakref_CheckProxy
-      if (PyWeakref_CheckProxy(pyobj)) {
-	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
-	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
-      }
-#endif
-      obj = PyObject_GetAttr(pyobj,SWIG_This());
-      if (obj) {
-	Py_DECREF(obj);
-      } else {
-	if (PyErr_Occurred()) PyErr_Clear();
-	return 0;
-      }
-    }
-  }
-#else
-  obj = PyObject_GetAttr(pyobj,SWIG_This());
-  if (obj) {
-    Py_DECREF(obj);
-  } else {
-    if (PyErr_Occurred()) PyErr_Clear();
-    return 0;
-  }
-#endif
-  if (obj && !SwigPyObject_Check(obj)) {
-    /* a PyObject is called 'this', try to get the 'real this'
-       SwigPyObject from it */ 
-    return SWIG_Python_GetSwigThis(obj);
-  }
-  return (SwigPyObject *)obj;
-#endif
-}
-
-/* Acquire a pointer value */
-
-SWIGRUNTIME int
-SWIG_Python_AcquirePtr(PyObject *obj, int own) {
-  if (own == SWIG_POINTER_OWN) {
-    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
-    if (sobj) {
-      int oldown = sobj->own;
-      sobj->own = own;
-      return oldown;
-    }
-  }
-  return 0;
-}
-
-/* Convert a pointer value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
-  int res;
-  SwigPyObject *sobj;
-  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
-
-  if (!obj)
-    return SWIG_ERROR;
-  if (obj == Py_None && !implicit_conv) {
-    if (ptr)
-      *ptr = 0;
-    return SWIG_OK;
-  }
-
-  res = SWIG_ERROR;
-
-  sobj = SWIG_Python_GetSwigThis(obj);
-  if (own)
-    *own = 0;
-  while (sobj) {
-    void *vptr = sobj->ptr;
-    if (ty) {
-      swig_type_info *to = sobj->ty;
-      if (to == ty) {
-        /* no type cast needed */
-        if (ptr) *ptr = vptr;
-        break;
-      } else {
-        swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
-        if (!tc) {
-          sobj = (SwigPyObject *)sobj->next;
-        } else {
-          if (ptr) {
-            int newmemory = 0;
-            *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
-            if (newmemory == SWIG_CAST_NEW_MEMORY) {
-              assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
-              if (own)
-                *own = *own | SWIG_CAST_NEW_MEMORY;
-            }
-          }
-          break;
-        }
-      }
-    } else {
-      if (ptr) *ptr = vptr;
-      break;
-    }
-  }
-  if (sobj) {
-    if (own)
-      *own = *own | sobj->own;
-    if (flags & SWIG_POINTER_DISOWN) {
-      sobj->own = 0;
-    }
-    res = SWIG_OK;
-  } else {
-    if (implicit_conv) {
-      SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
-      if (data && !data->implicitconv) {
-        PyObject *klass = data->klass;
-        if (klass) {
-          PyObject *impconv;
-          data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
-          impconv = SWIG_Python_CallFunctor(klass, obj);
-          data->implicitconv = 0;
-          if (PyErr_Occurred()) {
-            PyErr_Clear();
-            impconv = 0;
-          }
-          if (impconv) {
-            SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
-            if (iobj) {
-              void *vptr;
-              res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
-              if (SWIG_IsOK(res)) {
-                if (ptr) {
-                  *ptr = vptr;
-                  /* transfer the ownership to 'ptr' */
-                  iobj->own = 0;
-                  res = SWIG_AddCast(res);
-                  res = SWIG_AddNewMask(res);
-                } else {
-                  res = SWIG_AddCast(res);		    
-                }
-              }
-            }
-            Py_DECREF(impconv);
-          }
-        }
-      }
-    }
-    if (!SWIG_IsOK(res) && obj == Py_None) {
-      if (ptr)
-        *ptr = 0;
-      if (PyErr_Occurred())
-        PyErr_Clear();
-      res = SWIG_OK;
-    }
-  }
-  return res;
-}
-
-/* Convert a function ptr value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
-  if (!PyCFunction_Check(obj)) {
-    return SWIG_ConvertPtr(obj, ptr, ty, 0);
-  } else {
-    void *vptr = 0;
-    
-    /* here we get the method pointer for callbacks */
-    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
-    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
-    if (desc)
-      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
-    if (!desc) 
-      return SWIG_ERROR;
-    if (ty) {
-      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
-      if (tc) {
-        int newmemory = 0;
-        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
-        assert(!newmemory); /* newmemory handling not yet implemented */
-      } else {
-        return SWIG_ERROR;
-      }
-    } else {
-      *ptr = vptr;
-    }
-    return SWIG_OK;
-  }
-}
-
-/* Convert a packed value value */
-
-SWIGRUNTIME int
-SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
-  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
-  if (!to) return SWIG_ERROR;
-  if (ty) {
-    if (to != ty) {
-      /* check type cast? */
-      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
-      if (!tc) return SWIG_ERROR;
-    }
-  }
-  return SWIG_OK;
-}  
-
-/* -----------------------------------------------------------------------------
- * Create a new pointer object
- * ----------------------------------------------------------------------------- */
-
-/*
-  Create a new instance object, without calling __init__, and set the
-  'this' attribute.
-*/
-
-SWIGRUNTIME PyObject* 
-SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
-{
-#if (PY_VERSION_HEX >= 0x02020000)
-  PyObject *inst = 0;
-  PyObject *newraw = data->newraw;
-  if (newraw) {
-    inst = PyObject_Call(newraw, data->newargs, NULL);
-    if (inst) {
-#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
-      PyObject **dictptr = _PyObject_GetDictPtr(inst);
-      if (dictptr != NULL) {
-	PyObject *dict = *dictptr;
-	if (dict == NULL) {
-	  dict = PyDict_New();
-	  *dictptr = dict;
-	  PyDict_SetItem(dict, SWIG_This(), swig_this);
-	}
-      }
-#else
-      PyObject *key = SWIG_This();
-      PyObject_SetAttr(inst, key, swig_this);
-#endif
-    }
-  } else {
-#if PY_VERSION_HEX >= 0x03000000
-    inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
-    if (inst) {
-      PyObject_SetAttr(inst, SWIG_This(), swig_this);
-      Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
-    }
-#else
-    PyObject *dict = PyDict_New();
-    if (dict) {
-      PyDict_SetItem(dict, SWIG_This(), swig_this);
-      inst = PyInstance_NewRaw(data->newargs, dict);
-      Py_DECREF(dict);
-    }
-#endif
-  }
-  return inst;
-#else
-#if (PY_VERSION_HEX >= 0x02010000)
-  PyObject *inst = 0;
-  PyObject *dict = PyDict_New();
-  if (dict) {
-    PyDict_SetItem(dict, SWIG_This(), swig_this);
-    inst = PyInstance_NewRaw(data->newargs, dict);
-    Py_DECREF(dict);
-  }
-  return (PyObject *) inst;
-#else
-  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
-  if (inst == NULL) {
-    return NULL;
-  }
-  inst->in_class = (PyClassObject *)data->newargs;
-  Py_INCREF(inst->in_class);
-  inst->in_dict = PyDict_New();
-  if (inst->in_dict == NULL) {
-    Py_DECREF(inst);
-    return NULL;
-  }
-#ifdef Py_TPFLAGS_HAVE_WEAKREFS
-  inst->in_weakreflist = NULL;
-#endif
-#ifdef Py_TPFLAGS_GC
-  PyObject_GC_Init(inst);
-#endif
-  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
-  return (PyObject *) inst;
-#endif
-#endif
-}
-
-SWIGRUNTIME void
-SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
-{
- PyObject *dict;
-#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
- PyObject **dictptr = _PyObject_GetDictPtr(inst);
- if (dictptr != NULL) {
-   dict = *dictptr;
-   if (dict == NULL) {
-     dict = PyDict_New();
-     *dictptr = dict;
-   }
-   PyDict_SetItem(dict, SWIG_This(), swig_this);
-   return;
- }
-#endif
- dict = PyObject_GetAttrString(inst, (char*)"__dict__");
- PyDict_SetItem(dict, SWIG_This(), swig_this);
- Py_DECREF(dict);
-} 
-
-
-SWIGINTERN PyObject *
-SWIG_Python_InitShadowInstance(PyObject *args) {
-  PyObject *obj[2];
-  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
-    return NULL;
-  } else {
-    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
-    if (sthis) {
-      SwigPyObject_append((PyObject*) sthis, obj[1]);
-    } else {
-      SWIG_Python_SetSwigThis(obj[0], obj[1]);
-    }
-    return SWIG_Py_Void();
-  }
-}
-
-/* Create a new pointer object */
-
-SWIGRUNTIME PyObject *
-SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
-  SwigPyClientData *clientdata;
-  PyObject * robj;
-  int own;
-
-  if (!ptr)
-    return SWIG_Py_Void();
-
-  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
-  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
-  if (clientdata && clientdata->pytype) {
-    SwigPyObject *newobj;
-    if (flags & SWIG_BUILTIN_TP_INIT) {
-      newobj = (SwigPyObject*) self;
-      if (newobj->ptr) {
-        PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
-        while (newobj->next)
-	  newobj = (SwigPyObject *) newobj->next;
-        newobj->next = next_self;
-        newobj = (SwigPyObject *)next_self;
-#ifdef SWIGPYTHON_BUILTIN
-        newobj->dict = 0;
-#endif
-      }
-    } else {
-      newobj = PyObject_New(SwigPyObject, clientdata->pytype);
-#ifdef SWIGPYTHON_BUILTIN
-      newobj->dict = 0;
-#endif
-    }
-    if (newobj) {
-      newobj->ptr = ptr;
-      newobj->ty = type;
-      newobj->own = own;
-      newobj->next = 0;
-      return (PyObject*) newobj;
-    }
-    return SWIG_Py_Void();
-  }
-
-  assert(!(flags & SWIG_BUILTIN_TP_INIT));
-
-  robj = SwigPyObject_New(ptr, type, own);
-  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
-    PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
-    Py_DECREF(robj);
-    robj = inst;
-  }
-  return robj;
-}
-
-/* Create a new packed object */
-
-SWIGRUNTIMEINLINE PyObject *
-SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
-  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
-}
-
-/* -----------------------------------------------------------------------------*
- *  Get type list 
- * -----------------------------------------------------------------------------*/
-
-#ifdef SWIG_LINK_RUNTIME
-void *SWIG_ReturnGlobalTypeList(void *);
-#endif
-
-SWIGRUNTIME swig_module_info *
-SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
-  static void *type_pointer = (void *)0;
-  /* first check if module already created */
-  if (!type_pointer) {
-#ifdef SWIG_LINK_RUNTIME
-    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
-#else
-# ifdef SWIGPY_USE_CAPSULE
-    type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
-# else
-    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
-				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
-# endif
-    if (PyErr_Occurred()) {
-      PyErr_Clear();
-      type_pointer = (void *)0;
-    }
-#endif
-  }
-  return (swig_module_info *) type_pointer;
-}
-
-#if PY_MAJOR_VERSION < 2
-/* PyModule_AddObject function was introduced in Python 2.0.  The following function
-   is copied out of Python/modsupport.c in python version 2.3.4 */
-SWIGINTERN int
-PyModule_AddObject(PyObject *m, char *name, PyObject *o)
-{
-  PyObject *dict;
-  if (!PyModule_Check(m)) {
-    PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg");
-    return SWIG_ERROR;
-  }
-  if (!o) {
-    PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value");
-    return SWIG_ERROR;
-  }
-  
-  dict = PyModule_GetDict(m);
-  if (dict == NULL) {
-    /* Internal error -- modules must have a dict! */
-    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
-		 PyModule_GetName(m));
-    return SWIG_ERROR;
-  }
-  if (PyDict_SetItemString(dict, name, o))
-    return SWIG_ERROR;
-  Py_DECREF(o);
-  return SWIG_OK;
-}
-#endif
-
-SWIGRUNTIME void
-#ifdef SWIGPY_USE_CAPSULE
-SWIG_Python_DestroyModule(PyObject *obj)
-#else
-SWIG_Python_DestroyModule(void *vptr)
-#endif
-{
-#ifdef SWIGPY_USE_CAPSULE
-  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
-#else
-  swig_module_info *swig_module = (swig_module_info *) vptr;
-#endif
-  swig_type_info **types = swig_module->types;
-  size_t i;
-  for (i =0; i < swig_module->size; ++i) {
-    swig_type_info *ty = types[i];
-    if (ty->owndata) {
-      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
-      if (data) SwigPyClientData_Del(data);
-    }
-  }
-  Py_DECREF(SWIG_This());
-  swig_this = NULL;
-}
-
-SWIGRUNTIME void
-SWIG_Python_SetModule(swig_module_info *swig_module) {
-#if PY_VERSION_HEX >= 0x03000000
- /* Add a dummy module object into sys.modules */
-  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
-#else
-  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
-  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
-#endif
-#ifdef SWIGPY_USE_CAPSULE
-  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
-  if (pointer && module) {
-    PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
-  } else {
-    Py_XDECREF(pointer);
-  }
-#else
-  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
-  if (pointer && module) {
-    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
-  } else {
-    Py_XDECREF(pointer);
-  }
-#endif
-}
-
-/* The python cached type query */
-SWIGRUNTIME PyObject *
-SWIG_Python_TypeCache(void) {
-  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
-  return cache;
-}
-
-SWIGRUNTIME swig_type_info *
-SWIG_Python_TypeQuery(const char *type)
-{
-  PyObject *cache = SWIG_Python_TypeCache();
-  PyObject *key = SWIG_Python_str_FromChar(type); 
-  PyObject *obj = PyDict_GetItem(cache, key);
-  swig_type_info *descriptor;
-  if (obj) {
-#ifdef SWIGPY_USE_CAPSULE
-    descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
-#else
-    descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
-#endif
-  } else {
-    swig_module_info *swig_module = SWIG_GetModule(0);
-    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
-    if (descriptor) {
-#ifdef SWIGPY_USE_CAPSULE
-      obj = PyCapsule_New((void*) descriptor, NULL, NULL);
-#else
-      obj = PyCObject_FromVoidPtr(descriptor, NULL);
-#endif
-      PyDict_SetItem(cache, key, obj);
-      Py_DECREF(obj);
-    }
-  }
-  Py_DECREF(key);
-  return descriptor;
-}
-
-/* 
-   For backward compatibility only
-*/
-#define SWIG_POINTER_EXCEPTION  0
-#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
-#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
-
-SWIGRUNTIME int
-SWIG_Python_AddErrMesg(const char* mesg, int infront)
-{  
-  if (PyErr_Occurred()) {
-    PyObject *type = 0;
-    PyObject *value = 0;
-    PyObject *traceback = 0;
-    PyErr_Fetch(&type, &value, &traceback);
-    if (value) {
-      char *tmp;
-      PyObject *old_str = PyObject_Str(value);
-      Py_XINCREF(type);
-      PyErr_Clear();
-      if (infront) {
-	PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
-      } else {
-	PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
-      }
-      SWIG_Python_str_DelForPy3(tmp);
-      Py_DECREF(old_str);
-    }
-    return 1;
-  } else {
-    return 0;
-  }
-}
-  
-SWIGRUNTIME int
-SWIG_Python_ArgFail(int argnum)
-{
-  if (PyErr_Occurred()) {
-    /* add information about failing argument */
-    char mesg[256];
-    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
-    return SWIG_Python_AddErrMesg(mesg, 1);
-  } else {
-    return 0;
-  }
-}
-
-SWIGRUNTIMEINLINE const char *
-SwigPyObject_GetDesc(PyObject *self)
-{
-  SwigPyObject *v = (SwigPyObject *)self;
-  swig_type_info *ty = v ? v->ty : 0;
-  return ty ? ty->str : "";
-}
-
-SWIGRUNTIME void
-SWIG_Python_TypeError(const char *type, PyObject *obj)
-{
-  if (type) {
-#if defined(SWIG_COBJECT_TYPES)
-    if (obj && SwigPyObject_Check(obj)) {
-      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
-      if (otype) {
-	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
-		     type, otype);
-	return;
-      }
-    } else 
-#endif      
-    {
-      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
-      if (otype) {
-	PyObject *str = PyObject_Str(obj);
-	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
-	if (cstr) {
-	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
-		       type, otype, cstr);
-          SWIG_Python_str_DelForPy3(cstr);
-	} else {
-	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
-		       type, otype);
-	}
-	Py_XDECREF(str);
-	return;
-      }
-    }   
-    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
-  } else {
-    PyErr_Format(PyExc_TypeError, "unexpected type is received");
-  }
-}
-
-
-/* Convert a pointer value, signal an exception on a type mismatch */
-SWIGRUNTIME void *
-SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
-  void *result;
-  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
-    PyErr_Clear();
-#if SWIG_POINTER_EXCEPTION
-    if (flags) {
-      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
-      SWIG_Python_ArgFail(argnum);
-    }
-#endif
-  }
-  return result;
-}
-
-#ifdef SWIGPYTHON_BUILTIN
-SWIGRUNTIME int
-SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
-  PyTypeObject *tp = obj->ob_type;
-  PyObject *descr;
-  PyObject *encoded_name;
-  descrsetfunc f;
-  int res = -1;
-
-# ifdef Py_USING_UNICODE
-  if (PyString_Check(name)) {
-    name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
-    if (!name)
-      return -1;
-  } else if (!PyUnicode_Check(name))
-# else
-  if (!PyString_Check(name))
-# endif
-  {
-    PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
-    return -1;
-  } else {
-    Py_INCREF(name);
-  }
-
-  if (!tp->tp_dict) {
-    if (PyType_Ready(tp) < 0)
-      goto done;
-  }
-
-  descr = _PyType_Lookup(tp, name);
-  f = NULL;
-  if (descr != NULL)
-    f = descr->ob_type->tp_descr_set;
-  if (!f) {
-    if (PyString_Check(name)) {
-      encoded_name = name;
-      Py_INCREF(name);
-    } else {
-      encoded_name = PyUnicode_AsUTF8String(name);
-    }
-    PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
-    Py_DECREF(encoded_name);
-  } else {
-    res = f(descr, obj, value);
-  }
-  
-  done:
-  Py_DECREF(name);
-  return res;
-}
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
-
-#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
-
-
-
-/* -------- TYPES TABLE (BEGIN) -------- */
-
-#define SWIGTYPE_p_char swig_types[0]
-static swig_type_info *swig_types[2];
-static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
-#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
-#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
-
-/* -------- TYPES TABLE (END) -------- */
-
-#if (PY_VERSION_HEX <= 0x02000000)
-# if !defined(SWIG_PYTHON_CLASSIC)
-#  error "This python version requires swig to be run with the '-classic' option"
-# endif
-#endif
-
-/*-----------------------------------------------
-              @(target):= _libpymolfile.so
-  ------------------------------------------------*/
-#if PY_VERSION_HEX >= 0x03000000
-#  define SWIG_init    PyInit__libpymolfile
-
-#else
-#  define SWIG_init    init_libpymolfile
-
-#endif
-#define SWIG_name    "_libpymolfile"
-
-#define SWIGVERSION 0x030012 
-#define SWIG_VERSION SWIGVERSION
-
-
-#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
-#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
-
-
-#include <stdexcept>
-
-
-namespace swig {
-  class SwigPtr_PyObject {
-  protected:
-    PyObject *_obj;
-
-  public:
-    SwigPtr_PyObject() :_obj(0)
-    {
-    }
-
-    SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
-    {
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      Py_XINCREF(_obj);      
-      SWIG_PYTHON_THREAD_END_BLOCK;
-    }
-    
-    SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
-    {
-      if (initial_ref) {
-        SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-        Py_XINCREF(_obj);
-        SWIG_PYTHON_THREAD_END_BLOCK;
-      }
-    }
-    
-    SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
-    {
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      Py_XINCREF(item._obj);
-      Py_XDECREF(_obj);
-      _obj = item._obj;
-      SWIG_PYTHON_THREAD_END_BLOCK;
-      return *this;      
-    }
-    
-    ~SwigPtr_PyObject() 
-    {
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      Py_XDECREF(_obj);
-      SWIG_PYTHON_THREAD_END_BLOCK;
-    }
-    
-    operator PyObject *() const
-    {
-      return _obj;
-    }
-
-    PyObject *operator->() const
-    {
-      return _obj;
-    }
-  };
-}
-
-
-namespace swig {
-  struct SwigVar_PyObject : SwigPtr_PyObject {
-    SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
-    
-    SwigVar_PyObject & operator = (PyObject* obj)
-    {
-      Py_XDECREF(_obj);
-      _obj = obj;
-      return *this;      
-    }
-  };
-}
-
-
-/* Python SWIG interface to libpymolfile
-   Copyright (c) 2017 Berk Onat <b.onat@warwick.ac.uk>
-   Published with UIUC LICENSE
- */
-#define SWIG_FILE_WITH_INIT
-#define __STDC_FORMAT_MACROS
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <inttypes.h>
-#include "pymolfile.h"
-
-
-#ifndef SWIG_FILE_WITH_INIT
-#define NO_IMPORT_ARRAY
-#endif
-#include "stdio.h"
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-#include <numpy/arrayobject.h>
-
-
-#include <complex> 
-
-
-#include <limits.h>
-#if !defined(SWIG_NO_LLONG_MAX)
-# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
-#   define LLONG_MAX __LONG_LONG_MAX__
-#   define LLONG_MIN (-LLONG_MAX - 1LL)
-#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
-# endif
-#endif
-
-
-SWIGINTERN int
-SWIG_AsVal_double (PyObject *obj, double *val)
-{
-  int res = SWIG_TypeError;
-  if (PyFloat_Check(obj)) {
-    if (val) *val = PyFloat_AsDouble(obj);
-    return SWIG_OK;
-#if PY_VERSION_HEX < 0x03000000
-  } else if (PyInt_Check(obj)) {
-    if (val) *val = (double) PyInt_AsLong(obj);
-    return SWIG_OK;
-#endif
-  } else if (PyLong_Check(obj)) {
-    double v = PyLong_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    double d = PyFloat_AsDouble(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = d;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      long v = PyLong_AsLong(obj);
-      if (!PyErr_Occurred()) {
-	if (val) *val = v;
-	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
-      } else {
-	PyErr_Clear();
-      }
-    }
-  }
-#endif
-  return res;
-}
-
-
-#include <float.h>
-
-
-#include <math.h>
-
-
-SWIGINTERNINLINE int
-SWIG_CanCastAsInteger(double *d, double min, double max) {
-  double x = *d;
-  if ((min <= x && x <= max)) {
-   double fx = floor(x);
-   double cx = ceil(x);
-   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
-   if ((errno == EDOM) || (errno == ERANGE)) {
-     errno = 0;
-   } else {
-     double summ, reps, diff;
-     if (rd < x) {
-       diff = x - rd;
-     } else if (rd > x) {
-       diff = rd - x;
-     } else {
-       return 1;
-     }
-     summ = rd + x;
-     reps = diff/summ;
-     if (reps < 8*DBL_EPSILON) {
-       *d = rd;
-       return 1;
-     }
-   }
-  }
-  return 0;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_long (PyObject *obj, long* val)
-{
-#if PY_VERSION_HEX < 0x03000000
-  if (PyInt_Check(obj)) {
-    if (val) *val = PyInt_AsLong(obj);
-    return SWIG_OK;
-  } else
-#endif
-  if (PyLong_Check(obj)) {
-    long v = PyLong_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-      return SWIG_OverflowError;
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    int dispatch = 0;
-    long v = PyInt_AsLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_AddCast(SWIG_OK);
-    } else {
-      PyErr_Clear();
-    }
-    if (!dispatch) {
-      double d;
-      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
-      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
-	if (val) *val = (long)(d);
-	return res;
-      }
-    }
-  }
-#endif
-  return SWIG_TypeError;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_int (PyObject * obj, int *val)
-{
-  long v;
-  int res = SWIG_AsVal_long (obj, &v);
-  if (SWIG_IsOK(res)) {
-    if ((v < INT_MIN || v > INT_MAX)) {
-      return SWIG_OverflowError;
-    } else {
-      if (val) *val = static_cast< int >(v);
-    }
-  }  
-  return res;
-}
-
-
-SWIGINTERNINLINE PyObject*
-  SWIG_From_int  (int value)
-{
-  return PyInt_FromLong((long) value);
-}
-
-
-PyObject * my_open_file_read(PyObject* molcapsule, char* fname, char* ftype, int natoms) {
-    if (PyType_Ready(&MolObjectType) < 0)
-        return NULL;
-    PyTypeObject *type = &MolObjectType;
-    MolObject *plugin_c;
-    molfile_plugin_t* plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(molcapsule);
-    plugin_c = (MolObject *)type->tp_alloc(type, 0);
-    /*plugin_c->plugin = plugin;*/
-    plugin_c->plugin = molcapsule;
-    void *file_handle = plugin->open_file_read(fname, ftype, &natoms);
-    plugin_c->file_handle = PyMolfileCapsule_FromVoidPtr(file_handle, del_molfile_file_handle);
-    if (!plugin_c->file_handle) {
-        Py_RETURN_NONE;
-    } else {
-        plugin_c->natoms = natoms;
-        return (PyObject *)plugin_c;
-    }
-  }
-
-
-SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor(void)
-{
-  static int init = 0;
-  static swig_type_info* info = 0;
-  if (!init) {
-    info = SWIG_TypeQuery("_p_char");
-    init = 1;
-  }
-  return info;
-}
-
-
-SWIGINTERN int
-SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
-{
-#if PY_VERSION_HEX>=0x03000000
-#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-  if (PyBytes_Check(obj))
-#else
-  if (PyUnicode_Check(obj))
-#endif
-#else  
-  if (PyString_Check(obj))
-#endif
-  {
-    char *cstr; Py_ssize_t len;
-#if PY_VERSION_HEX>=0x03000000
-#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-    if (!alloc && cptr) {
-        /* We can't allow converting without allocation, since the internal
-           representation of string in Python 3 is UCS-2/UCS-4 but we require
-           a UTF-8 representation.
-           TODO(bhy) More detailed explanation */
-        return SWIG_RuntimeError;
-    }
-    obj = PyUnicode_AsUTF8String(obj);
-    if(alloc) *alloc = SWIG_NEWOBJ;
-#endif
-    PyBytes_AsStringAndSize(obj, &cstr, &len);
-#else
-    PyString_AsStringAndSize(obj, &cstr, &len);
-#endif
-    if (cptr) {
-      if (alloc) {
-	/* 
-	   In python the user should not be able to modify the inner
-	   string representation. To warranty that, if you define
-	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
-	   buffer is always returned.
-
-	   The default behavior is just to return the pointer value,
-	   so, be careful.
-	*/ 
-#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
-	if (*alloc != SWIG_OLDOBJ) 
-#else
-	if (*alloc == SWIG_NEWOBJ) 
-#endif
-	{
-	  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
-	  *alloc = SWIG_NEWOBJ;
-	} else {
-	  *cptr = cstr;
-	  *alloc = SWIG_OLDOBJ;
-	}
-      } else {
-#if PY_VERSION_HEX>=0x03000000
-#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-	*cptr = PyBytes_AsString(obj);
-#else
-	assert(0); /* Should never reach here with Unicode strings in Python 3 */
-#endif
-#else
-	*cptr = SWIG_Python_str_AsChar(obj);
-#endif
-      }
-    }
-    if (psize) *psize = len + 1;
-#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-    Py_XDECREF(obj);
-#endif
-    return SWIG_OK;
-  } else {
-#if defined(SWIG_PYTHON_2_UNICODE)
-#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
-#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
-#endif
-#if PY_VERSION_HEX<0x03000000
-    if (PyUnicode_Check(obj)) {
-      char *cstr; Py_ssize_t len;
-      if (!alloc && cptr) {
-        return SWIG_RuntimeError;
-      }
-      obj = PyUnicode_AsUTF8String(obj);
-      if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
-        if (cptr) {
-          if (alloc) *alloc = SWIG_NEWOBJ;
-          *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
-        }
-        if (psize) *psize = len + 1;
-
-        Py_XDECREF(obj);
-        return SWIG_OK;
-      } else {
-        Py_XDECREF(obj);
-      }
-    }
-#endif
-#endif
-
-    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
-    if (pchar_descriptor) {
-      void* vptr = 0;
-      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
-	if (cptr) *cptr = (char *) vptr;
-	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
-	if (alloc) *alloc = SWIG_OLDOBJ;
-	return SWIG_OK;
-      }
-    }
-  }
-  return SWIG_TypeError;
-}
-
-
-
-
-
-PyObject * my_close_file_read(PyObject* molpack) {
-    MolObject* plugin_handle = (MolObject*) molpack;
-    PyObject* plugincapsule = plugin_handle->plugin;   
-    PyObject* filecapsule = plugin_handle->file_handle;
-    molfile_plugin_t* plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugincapsule);
-    void *file_handle = (void*) PyMolfileCapsule_AsVoidPtr(filecapsule);
-    plugin->close_file_read(file_handle);
-    Py_XDECREF(filecapsule);
-    Py_XDECREF(plugin_handle->file_handle);
-    return (PyObject *)plugin_handle;
-  }
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-SWIGINTERN PyObject *_wrap_molfile_plugin_list(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int arg1 ;
-  int val1 ;
-  int ecode1 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:molfile_plugin_list",&obj0)) SWIG_fail;
-  ecode1 = SWIG_AsVal_int(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "molfile_plugin_list" "', argument " "1"" of type '" "int""'");
-  } 
-  arg1 = static_cast< int >(val1);
-  result = (PyObject *)molfile_plugin_list(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_molfile_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int result;
-  
-  if (!PyArg_ParseTuple(args,(char *)":molfile_init")) SWIG_fail;
-  result = (int)molfile_init();
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_molfile_finish(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int result;
-  
-  if (!PyArg_ParseTuple(args,(char *)":molfile_finish")) SWIG_fail;
-  result = (int)molfile_finish();
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_get_plugin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  int arg2 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:get_plugin",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_plugin" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  result = (PyObject *)get_plugin(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_molfile_plugin_info(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  int arg2 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:molfile_plugin_info",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "molfile_plugin_info" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  result = (PyObject *)molfile_plugin_info(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_open_file_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  char *arg2 = (char *) 0 ;
-  char *arg3 = (char *) 0 ;
-  int arg4 ;
-  int res2 ;
-  char *buf2 = 0 ;
-  int alloc2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
-  int val4 ;
-  int ecode4 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:open_file_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  arg1 = obj0;
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_file_read" "', argument " "2"" of type '" "char *""'");
-  }
-  arg2 = reinterpret_cast< char * >(buf2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "open_file_read" "', argument " "3"" of type '" "char *""'");
-  }
-  arg3 = reinterpret_cast< char * >(buf3);
-  ecode4 = SWIG_AsVal_int(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "open_file_read" "', argument " "4"" of type '" "int""'");
-  } 
-  arg4 = static_cast< int >(val4);
-  {
-    result = (PyObject *)my_open_file_read(arg1,arg2,arg3,arg4);
-    if (PyErr_Occurred()) SWIG_fail;
-  }
-  resultobj = result;
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return resultobj;
-fail:
-  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_close_file_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:close_file_read",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  {
-    result = (PyObject *)my_close_file_read(arg1);
-    if (PyErr_Occurred()) SWIG_fail;
-  }
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_structure(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject *arg2 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:read_fill_structure",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  arg2 = obj1;
-  result = (PyObject *)read_fill_structure(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_bonds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:read_fill_bonds",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  result = (PyObject *)read_fill_bonds(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_angles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:read_fill_angles",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  result = (PyObject *)read_fill_angles(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_read_fill_next_timestep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:read_fill_next_timestep",&obj0)) SWIG_fail;
-  arg1 = obj0;
-  result = (PyObject *)read_fill_next_timestep(arg1);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_are_plugins_same(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject *arg2 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:are_plugins_same",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  arg2 = obj1;
-  result = (PyObject *)are_plugins_same(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_are_filehandles_same(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  PyObject *arg1 = (PyObject *) 0 ;
-  PyObject *arg2 = (PyObject *) 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:are_filehandles_same",&obj0,&obj1)) SWIG_fail;
-  arg1 = obj0;
-  arg2 = obj1;
-  result = (PyObject *)are_filehandles_same(arg1,arg2);
-  resultobj = result;
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-static PyMethodDef SwigMethods[] = {
-	 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
-	 { (char *)"molfile_plugin_list", _wrap_molfile_plugin_list, METH_VARARGS, (char *)"molfile_plugin_list(maxsize) -> PyObject *"},
-	 { (char *)"molfile_init", _wrap_molfile_init, METH_VARARGS, (char *)"molfile_init() -> int"},
-	 { (char *)"molfile_finish", _wrap_molfile_finish, METH_VARARGS, (char *)"molfile_finish() -> int"},
-	 { (char *)"get_plugin", _wrap_get_plugin, METH_VARARGS, (char *)"get_plugin(molcapsule, plug_no) -> PyObject *"},
-	 { (char *)"molfile_plugin_info", _wrap_molfile_plugin_info, METH_VARARGS, (char *)"molfile_plugin_info(molcapsule, plugin_no) -> PyObject *"},
-	 { (char *)"open_file_read", _wrap_open_file_read, METH_VARARGS, (char *)"open_file_read(molcapsule, fname, ftype, natoms) -> PyObject *"},
-	 { (char *)"close_file_read", _wrap_close_file_read, METH_VARARGS, (char *)"close_file_read(molpack) -> PyObject *"},
-	 { (char *)"read_fill_structure", _wrap_read_fill_structure, METH_VARARGS, (char *)"read_fill_structure(molpack, prototype) -> PyObject *"},
-	 { (char *)"read_fill_bonds", _wrap_read_fill_bonds, METH_VARARGS, (char *)"read_fill_bonds(molpack) -> PyObject *"},
-	 { (char *)"read_fill_angles", _wrap_read_fill_angles, METH_VARARGS, (char *)"read_fill_angles(molpack) -> PyObject *"},
-	 { (char *)"read_fill_next_timestep", _wrap_read_fill_next_timestep, METH_VARARGS, (char *)"read_fill_next_timestep(molpack) -> PyObject *"},
-	 { (char *)"are_plugins_same", _wrap_are_plugins_same, METH_VARARGS, (char *)"are_plugins_same(molpack_a, molpack_b) -> PyObject *"},
-	 { (char *)"are_filehandles_same", _wrap_are_filehandles_same, METH_VARARGS, (char *)"are_filehandles_same(molpack_a, molpack_b) -> PyObject *"},
-	 { NULL, NULL, 0, NULL }
-};
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-
-static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
-
-static swig_type_info *swig_type_initial[] = {
-  &_swigt__p_char,
-};
-
-static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
-
-static swig_cast_info *swig_cast_initial[] = {
-  _swigc__p_char,
-};
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
-
-static swig_const_info swig_const_table[] = {
-{0, 0, 0, 0.0, 0, 0}};
-
-#ifdef __cplusplus
-}
-#endif
-/* -----------------------------------------------------------------------------
- * Type initialization:
- * This problem is tough by the requirement that no dynamic
- * memory is used. Also, since swig_type_info structures store pointers to
- * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization.
- * The idea is that swig generates all the structures that are needed.
- * The runtime then collects these partially filled structures.
- * The SWIG_InitializeModule function takes these initial arrays out of
- * swig_module, and does all the lookup, filling in the swig_module.types
- * array with the correct data and linking the correct swig_cast_info
- * structures together.
- *
- * The generated swig_type_info structures are assigned statically to an initial
- * array. We just loop through that array, and handle each type individually.
- * First we lookup if this type has been already loaded, and if so, use the
- * loaded structure instead of the generated one. Then we have to fill in the
- * cast linked list. The cast data is initially stored in something like a
- * two-dimensional array. Each row corresponds to a type (there are the same
- * number of rows as there are in the swig_type_initial array). Each entry in
- * a column is one of the swig_cast_info structures for that type.
- * The cast_initial array is actually an array of arrays, because each row has
- * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it
- * adding the casts to the list. The one last trick we need to do is making
- * sure the type pointer in the swig_cast_info struct is correct.
- *
- * First off, we lookup the cast->type name to see if it is already loaded.
- * There are three cases to handle:
- *  1) If the cast->type has already been loaded AND the type we are adding
- *     casting info to has not been loaded (it is in this module), THEN we
- *     replace the cast->type pointer with the type pointer that has already
- *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the
- *     cast->type) are loaded, THEN the cast info has already been loaded by
- *     the previous module so we just ignore it.
- *  3) Finally, if cast->type has not already been loaded, then we add that
- *     swig_cast_info to the linked list (because the cast->type) pointer will
- *     be correct.
- * ----------------------------------------------------------------------------- */
-
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* c-mode */
-#endif
-#endif
-
-#if 0
-#define SWIGRUNTIME_DEBUG
-#endif
-
-
-SWIGRUNTIME void
-SWIG_InitializeModule(void *clientdata) {
-  size_t i;
-  swig_module_info *module_head, *iter;
-  int init;
-  
-  /* check to see if the circular list has been setup, if not, set it up */
-  if (swig_module.next==0) {
-    /* Initialize the swig_module */
-    swig_module.type_initial = swig_type_initial;
-    swig_module.cast_initial = swig_cast_initial;
-    swig_module.next = &swig_module;
-    init = 1;
-  } else {
-    init = 0;
-  }
-  
-  /* Try and load any already created modules */
-  module_head = SWIG_GetModule(clientdata);
-  if (!module_head) {
-    /* This is the first module loaded for this interpreter */
-    /* so set the swig module into the interpreter */
-    SWIG_SetModule(clientdata, &swig_module);
-  } else {
-    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
-    iter=module_head;
-    do {
-      if (iter==&swig_module) {
-        /* Our module is already in the list, so there's nothing more to do. */
-        return;
-      }
-      iter=iter->next;
-    } while (iter!= module_head);
-    
-    /* otherwise we must add our module into the list */
-    swig_module.next = module_head->next;
-    module_head->next = &swig_module;
-  }
-  
-  /* When multiple interpreters are used, a module could have already been initialized in
-       a different interpreter, but not yet have a pointer in this interpreter.
-       In this case, we do not want to continue adding types... everything should be
-       set up already */
-  if (init == 0) return;
-  
-  /* Now work on filling in swig_module.types */
-#ifdef SWIGRUNTIME_DEBUG
-  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
-#endif
-  for (i = 0; i < swig_module.size; ++i) {
-    swig_type_info *type = 0;
-    swig_type_info *ret;
-    swig_cast_info *cast;
-    
-#ifdef SWIGRUNTIME_DEBUG
-    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
-#endif
-    
-    /* if there is another module already loaded */
-    if (swig_module.next != &swig_module) {
-      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
-    }
-    if (type) {
-      /* Overwrite clientdata field */
-#ifdef SWIGRUNTIME_DEBUG
-      printf("SWIG_InitializeModule: found type %s\n", type->name);
-#endif
-      if (swig_module.type_initial[i]->clientdata) {
-        type->clientdata = swig_module.type_initial[i]->clientdata;
-#ifdef SWIGRUNTIME_DEBUG
-        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
-#endif
-      }
-    } else {
-      type = swig_module.type_initial[i];
-    }
-    
-    /* Insert casting types */
-    cast = swig_module.cast_initial[i];
-    while (cast->type) {
-      /* Don't need to add information already in the list */
-      ret = 0;
-#ifdef SWIGRUNTIME_DEBUG
-      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
-#endif
-      if (swig_module.next != &swig_module) {
-        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
-#ifdef SWIGRUNTIME_DEBUG
-        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
-#endif
-      }
-      if (ret) {
-        if (type == swig_module.type_initial[i]) {
-#ifdef SWIGRUNTIME_DEBUG
-          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
-#endif
-          cast->type = ret;
-          ret = 0;
-        } else {
-          /* Check for casting already in the list */
-          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
-#ifdef SWIGRUNTIME_DEBUG
-          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
-#endif
-          if (!ocast) ret = 0;
-        }
-      }
-      
-      if (!ret) {
-#ifdef SWIGRUNTIME_DEBUG
-        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
-#endif
-        if (type->cast) {
-          type->cast->prev = cast;
-          cast->next = type->cast;
-        }
-        type->cast = cast;
-      }
-      cast++;
-    }
-    /* Set entry in modules->types array equal to the type */
-    swig_module.types[i] = type;
-  }
-  swig_module.types[i] = 0;
-  
-#ifdef SWIGRUNTIME_DEBUG
-  printf("**** SWIG_InitializeModule: Cast List ******\n");
-  for (i = 0; i < swig_module.size; ++i) {
-    int j = 0;
-    swig_cast_info *cast = swig_module.cast_initial[i];
-    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
-    while (cast->type) {
-      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
-      cast++;
-      ++j;
-    }
-    printf("---- Total casts: %d\n",j);
-  }
-  printf("**** SWIG_InitializeModule: Cast List ******\n");
-#endif
-}
-
-/* This function will propagate the clientdata field of type to
-* any new swig_type_info structures that have been added into the list
-* of equivalent types.  It is like calling
-* SWIG_TypeClientData(type, clientdata) a second time.
-*/
-SWIGRUNTIME void
-SWIG_PropagateClientData(void) {
-  size_t i;
-  swig_cast_info *equiv;
-  static int init_run = 0;
-  
-  if (init_run) return;
-  init_run = 1;
-  
-  for (i = 0; i < swig_module.size; i++) {
-    if (swig_module.types[i]->clientdata) {
-      equiv = swig_module.types[i]->cast;
-      while (equiv) {
-        if (!equiv->converter) {
-          if (equiv->type && !equiv->type->clientdata)
-          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
-        }
-        equiv = equiv->next;
-      }
-    }
-  }
-}
-
-#ifdef __cplusplus
-#if 0
-{
-  /* c-mode */
-#endif
-}
-#endif
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-  
-  /* Python-specific SWIG API */
-#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
-#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
-#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
-  
-  /* -----------------------------------------------------------------------------
-   * global variable support code.
-   * ----------------------------------------------------------------------------- */
-  
-  typedef struct swig_globalvar {
-    char       *name;                  /* Name of global variable */
-    PyObject *(*get_attr)(void);       /* Return the current value */
-    int       (*set_attr)(PyObject *); /* Set the value */
-    struct swig_globalvar *next;
-  } swig_globalvar;
-  
-  typedef struct swig_varlinkobject {
-    PyObject_HEAD
-    swig_globalvar *vars;
-  } swig_varlinkobject;
-  
-  SWIGINTERN PyObject *
-  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
-#if PY_VERSION_HEX >= 0x03000000
-    return PyUnicode_InternFromString("<Swig global variables>");
-#else
-    return PyString_FromString("<Swig global variables>");
-#endif
-  }
-  
-  SWIGINTERN PyObject *
-  swig_varlink_str(swig_varlinkobject *v) {
-#if PY_VERSION_HEX >= 0x03000000
-    PyObject *str = PyUnicode_InternFromString("(");
-    PyObject *tail;
-    PyObject *joined;
-    swig_globalvar *var;
-    for (var = v->vars; var; var=var->next) {
-      tail = PyUnicode_FromString(var->name);
-      joined = PyUnicode_Concat(str, tail);
-      Py_DecRef(str);
-      Py_DecRef(tail);
-      str = joined;
-      if (var->next) {
-        tail = PyUnicode_InternFromString(", ");
-        joined = PyUnicode_Concat(str, tail);
-        Py_DecRef(str);
-        Py_DecRef(tail);
-        str = joined;
-      }
-    }
-    tail = PyUnicode_InternFromString(")");
-    joined = PyUnicode_Concat(str, tail);
-    Py_DecRef(str);
-    Py_DecRef(tail);
-    str = joined;
-#else
-    PyObject *str = PyString_FromString("(");
-    swig_globalvar *var;
-    for (var = v->vars; var; var=var->next) {
-      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
-      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
-    }
-    PyString_ConcatAndDel(&str,PyString_FromString(")"));
-#endif
-    return str;
-  }
-  
-  SWIGINTERN int
-  swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
-    char *tmp;
-    PyObject *str = swig_varlink_str(v);
-    fprintf(fp,"Swig global variables ");
-    fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
-    SWIG_Python_str_DelForPy3(tmp);
-    Py_DECREF(str);
-    return 0;
-  }
-  
-  SWIGINTERN void
-  swig_varlink_dealloc(swig_varlinkobject *v) {
-    swig_globalvar *var = v->vars;
-    while (var) {
-      swig_globalvar *n = var->next;
-      free(var->name);
-      free(var);
-      var = n;
-    }
-  }
-  
-  SWIGINTERN PyObject *
-  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
-    PyObject *res = NULL;
-    swig_globalvar *var = v->vars;
-    while (var) {
-      if (strcmp(var->name,n) == 0) {
-        res = (*var->get_attr)();
-        break;
-      }
-      var = var->next;
-    }
-    if (res == NULL && !PyErr_Occurred()) {
-      PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
-    }
-    return res;
-  }
-  
-  SWIGINTERN int
-  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
-    int res = 1;
-    swig_globalvar *var = v->vars;
-    while (var) {
-      if (strcmp(var->name,n) == 0) {
-        res = (*var->set_attr)(p);
-        break;
-      }
-      var = var->next;
-    }
-    if (res == 1 && !PyErr_Occurred()) {
-      PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
-    }
-    return res;
-  }
-  
-  SWIGINTERN PyTypeObject*
-  swig_varlink_type(void) {
-    static char varlink__doc__[] = "Swig var link object";
-    static PyTypeObject varlink_type;
-    static int type_init = 0;
-    if (!type_init) {
-      const PyTypeObject tmp = {
-#if PY_VERSION_HEX >= 0x03000000
-        PyVarObject_HEAD_INIT(NULL, 0)
-#else
-        PyObject_HEAD_INIT(NULL)
-        0,                                  /* ob_size */
-#endif
-        (char *)"swigvarlink",              /* tp_name */
-        sizeof(swig_varlinkobject),         /* tp_basicsize */
-        0,                                  /* tp_itemsize */
-        (destructor) swig_varlink_dealloc,  /* tp_dealloc */
-        (printfunc) swig_varlink_print,     /* tp_print */
-        (getattrfunc) swig_varlink_getattr, /* tp_getattr */
-        (setattrfunc) swig_varlink_setattr, /* tp_setattr */
-        0,                                  /* tp_compare */
-        (reprfunc) swig_varlink_repr,       /* tp_repr */
-        0,                                  /* tp_as_number */
-        0,                                  /* tp_as_sequence */
-        0,                                  /* tp_as_mapping */
-        0,                                  /* tp_hash */
-        0,                                  /* tp_call */
-        (reprfunc) swig_varlink_str,        /* tp_str */
-        0,                                  /* tp_getattro */
-        0,                                  /* tp_setattro */
-        0,                                  /* tp_as_buffer */
-        0,                                  /* tp_flags */
-        varlink__doc__,                     /* tp_doc */
-        0,                                  /* tp_traverse */
-        0,                                  /* tp_clear */
-        0,                                  /* tp_richcompare */
-        0,                                  /* tp_weaklistoffset */
-#if PY_VERSION_HEX >= 0x02020000
-        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
-#endif
-#if PY_VERSION_HEX >= 0x02030000
-        0,                                  /* tp_del */
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-        0,                                  /* tp_version_tag */
-#endif
-#if PY_VERSION_HEX >= 0x03040000
-        0,                                  /* tp_finalize */
-#endif
-#ifdef COUNT_ALLOCS
-        0,                                  /* tp_allocs */
-        0,                                  /* tp_frees */
-        0,                                  /* tp_maxalloc */
-#if PY_VERSION_HEX >= 0x02050000
-        0,                                  /* tp_prev */
-#endif
-        0                                   /* tp_next */
-#endif
-      };
-      varlink_type = tmp;
-      type_init = 1;
-#if PY_VERSION_HEX < 0x02020000
-      varlink_type.ob_type = &PyType_Type;
-#else
-      if (PyType_Ready(&varlink_type) < 0)
-      return NULL;
-#endif
-    }
-    return &varlink_type;
-  }
-  
-  /* Create a variable linking object for use later */
-  SWIGINTERN PyObject *
-  SWIG_Python_newvarlink(void) {
-    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
-    if (result) {
-      result->vars = 0;
-    }
-    return ((PyObject*) result);
-  }
-  
-  SWIGINTERN void 
-  SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
-    swig_varlinkobject *v = (swig_varlinkobject *) p;
-    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
-    if (gv) {
-      size_t size = strlen(name)+1;
-      gv->name = (char *)malloc(size);
-      if (gv->name) {
-        strncpy(gv->name,name,size);
-        gv->get_attr = get_attr;
-        gv->set_attr = set_attr;
-        gv->next = v->vars;
-      }
-    }
-    v->vars = gv;
-  }
-  
-  SWIGINTERN PyObject *
-  SWIG_globals(void) {
-    static PyObject *_SWIG_globals = 0; 
-    if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
-    return _SWIG_globals;
-  }
-  
-  /* -----------------------------------------------------------------------------
-   * constants/methods manipulation
-   * ----------------------------------------------------------------------------- */
-  
-  /* Install Constants */
-  SWIGINTERN void
-  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
-    PyObject *obj = 0;
-    size_t i;
-    for (i = 0; constants[i].type; ++i) {
-      switch(constants[i].type) {
-      case SWIG_PY_POINTER:
-        obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
-        break;
-      case SWIG_PY_BINARY:
-        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
-        break;
-      default:
-        obj = 0;
-        break;
-      }
-      if (obj) {
-        PyDict_SetItemString(d, constants[i].name, obj);
-        Py_DECREF(obj);
-      }
-    }
-  }
-  
-  /* -----------------------------------------------------------------------------*/
-  /* Fix SwigMethods to carry the callback ptrs when needed */
-  /* -----------------------------------------------------------------------------*/
-  
-  SWIGINTERN void
-  SWIG_Python_FixMethods(PyMethodDef *methods,
-    swig_const_info *const_table,
-    swig_type_info **types,
-    swig_type_info **types_initial) {
-    size_t i;
-    for (i = 0; methods[i].ml_name; ++i) {
-      const char *c = methods[i].ml_doc;
-      if (!c) continue;
-      c = strstr(c, "swig_ptr: ");
-      if (c) {
-        int j;
-        swig_const_info *ci = 0;
-        const char *name = c + 10;
-        for (j = 0; const_table[j].type; ++j) {
-          if (strncmp(const_table[j].name, name, 
-              strlen(const_table[j].name)) == 0) {
-            ci = &(const_table[j]);
-            break;
-          }
-        }
-        if (ci) {
-          void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
-          if (ptr) {
-            size_t shift = (ci->ptype) - types;
-            swig_type_info *ty = types_initial[shift];
-            size_t ldoc = (c - methods[i].ml_doc);
-            size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
-            char *ndoc = (char*)malloc(ldoc + lptr + 10);
-            if (ndoc) {
-              char *buff = ndoc;
-              strncpy(buff, methods[i].ml_doc, ldoc);
-              buff += ldoc;
-              strncpy(buff, "swig_ptr: ", 10);
-              buff += 10;
-              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
-              methods[i].ml_doc = ndoc;
-            }
-          }
-        }
-      }
-    }
-  } 
-  
-#ifdef __cplusplus
-}
-#endif
-
-/* -----------------------------------------------------------------------------*
- *  Partial Init method
- * -----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-SWIGEXPORT 
-#if PY_VERSION_HEX >= 0x03000000
-PyObject*
-#else
-void
-#endif
-SWIG_init(void) {
-  PyObject *m, *d, *md;
-#if PY_VERSION_HEX >= 0x03000000
-  static struct PyModuleDef SWIG_module = {
-# if PY_VERSION_HEX >= 0x03020000
-    PyModuleDef_HEAD_INIT,
-# else
-    {
-      PyObject_HEAD_INIT(NULL)
-      NULL, /* m_init */
-      0,    /* m_index */
-      NULL, /* m_copy */
-    },
-# endif
-    (char *) SWIG_name,
-    NULL,
-    -1,
-    SwigMethods,
-    NULL,
-    NULL,
-    NULL,
-    NULL
-  };
-#endif
-  
-#if defined(SWIGPYTHON_BUILTIN)
-  static SwigPyClientData SwigPyObject_clientdata = {
-    0, 0, 0, 0, 0, 0, 0
-  };
-  static PyGetSetDef this_getset_def = {
-    (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
-  };
-  static SwigPyGetSet thisown_getset_closure = {
-    (PyCFunction) SwigPyObject_own,
-    (PyCFunction) SwigPyObject_own
-  };
-  static PyGetSetDef thisown_getset_def = {
-    (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
-  };
-  PyTypeObject *builtin_pytype;
-  int builtin_base_count;
-  swig_type_info *builtin_basetype;
-  PyObject *tuple;
-  PyGetSetDescrObject *static_getset;
-  PyTypeObject *metatype;
-  PyTypeObject *swigpyobject;
-  SwigPyClientData *cd;
-  PyObject *public_interface, *public_symbol;
-  PyObject *this_descr;
-  PyObject *thisown_descr;
-  PyObject *self = 0;
-  int i;
-  
-  (void)builtin_pytype;
-  (void)builtin_base_count;
-  (void)builtin_basetype;
-  (void)tuple;
-  (void)static_getset;
-  (void)self;
-  
-  /* Metaclass is used to implement static member variables */
-  metatype = SwigPyObjectType();
-  assert(metatype);
-#endif
-  
-  /* Fix SwigMethods to carry the callback ptrs when needed */
-  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
-  
-#if PY_VERSION_HEX >= 0x03000000
-  m = PyModule_Create(&SWIG_module);
-#else
-  m = Py_InitModule((char *) SWIG_name, SwigMethods);
-#endif
-  
-  md = d = PyModule_GetDict(m);
-  (void)md;
-  
-  SWIG_InitializeModule(0);
-  
-#ifdef SWIGPYTHON_BUILTIN
-  swigpyobject = SwigPyObject_TypeOnce();
-  
-  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
-  assert(SwigPyObject_stype);
-  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
-  if (!cd) {
-    SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
-    SwigPyObject_clientdata.pytype = swigpyobject;
-  } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
-    PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
-# if PY_VERSION_HEX >= 0x03000000
-    return NULL;
-# else
-    return;
-# endif
-  }
-  
-  /* All objects have a 'this' attribute */
-  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
-  (void)this_descr;
-  
-  /* All objects have a 'thisown' attribute */
-  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
-  (void)thisown_descr;
-  
-  public_interface = PyList_New(0);
-  public_symbol = 0;
-  (void)public_symbol;
-  
-  PyDict_SetItemString(md, "__all__", public_interface);
-  Py_DECREF(public_interface);
-  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
-  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
-  for (i = 0; swig_const_table[i].name != 0; ++i)
-  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
-#endif
-  
-  SWIG_InstallConstants(d,swig_const_table);
-  
-  
-  Py_Initialize();
-  import_array();
-  
-#if PY_VERSION_HEX >= 0x03000000
-  return m;
-#else
-  return;
-#endif
-}
-
diff --git a/pymolfile/molfile/molfile_plugins/Makefile b/pymolfile/molfile/molfile_plugins/Makefile
index ec8d07237c1dc2bc7f291ab4960c9f2bc43deb50..51e8810378822ba340c39309f0e23069f9393e2e 100755
--- a/pymolfile/molfile/molfile_plugins/Makefile
+++ b/pymolfile/molfile/molfile_plugins/Makefile
@@ -72,7 +72,7 @@ win32bins:
 
 clean:
 	find compile \( -name \*.o -o -name \*.a -o -name \*.so -o -name \*.exp -o -name \*.lib -o -name \*.h \) -print | xargs rm -f
-	find compile \( -name lib\* \) -print | xargs rm -rf
+	find compile \( -name lib_\* \) -print | xargs rm -rf
 	rm -f log.*
 	rm -f molfile_plugin/so_locations
 
diff --git a/pymolfile/molfile/molfile_plugins/CMakeLists.txt b/pymolfile/molfile/molfile_plugins/compile/CMakeLists.txt
similarity index 93%
rename from pymolfile/molfile/molfile_plugins/CMakeLists.txt
rename to pymolfile/molfile/molfile_plugins/compile/CMakeLists.txt
index 107afcff3c18cd2bd0620d3c34a17cf1c57a5e55..55ba3f65a7c108cf069ed64ed32bf5e9408f498c 100644
--- a/pymolfile/molfile/molfile_plugins/CMakeLists.txt
+++ b/pymolfile/molfile/molfile_plugins/compile/CMakeLists.txt
@@ -6,9 +6,9 @@ find_package(EXPAT)
 find_package(NetCDF)
 find_package(TCL)
 
-if (EXISTS "${TNG_INSTALL_DIR}/tng/lib/libtng_io.dylib"
-    OR EXISTS "${TNG_INSTALL_DIR}/tng/lib/libtng_io.so"
-    OR EXISTS "${TNG_INSTALL_DIR}/tng/include/tng/tng_io.h")
+if (EXISTS "${TNG_INSTALL_DIR}/lib/libtng_io.dylib"
+    OR EXISTS "${TNG_INSTALL_DIR}/lib/libtng_io.so"
+    OR EXISTS "${TNG_INSTALL_DIR}/include/tng/tng_io.h")
    set(TNGIO_FOUND TRUE)
    set(TNGIO_LIBRARIES "${TNG_INSTALL_DIR}/lib/")
    set(TNGIO_INLCUDE_DIRS "${TNG_INSTALL_DIR}/include/")
@@ -32,8 +32,8 @@ if(TARGET_ARCH MATCHES "^.*64.*$")
 endif()
 
 set(LIB_MOLFILE_FILES
-    "${CMAKE_CURRENT_BINARY_DIR}/molfile_plugins/compile/lib/libmolfile_plugins.a"
-    "${CMAKE_CURRENT_BINARY_DIR}/molfile_plugins/compile/lib/libmolfile_plugins.h")
+    "${CMAKE_CURRENT_BINARY_DIR}/lib/libmolfile_plugins.a"
+    "${CMAKE_CURRENT_BINARY_DIR}/lib/libmolfile_plugins.h")
 
 if(UNIX AND NOT APPLE)
 	set(LINUX TRUE)
@@ -124,7 +124,7 @@ if(UNIX)
       OUTPUT ${LIB_MOLFILE_FILES}
       COMMAND make dynlibs staticlibs bins \"ARCH = ${TARGET_ARCH}\" \"COPTO = ${TARGET_COPT} \" \"LOPTO = ${TARGET_LOPT} \" \"CC = ${CMAKE_C_COMPILER} \" \"CXX = ${CMAKE_CXX_COMPILER} \" \"DEF = ${TARGET_DEF}\" \"CCFLAGS = ${TARGET_CFLAGS} \" \"CXXFLAGS = ${TARGET_CXXFLG} \" \"AR = ${TARGET_AR}\" \"NM = ${TARGET_NM}\" \"RANLIB = ${TARGET_RANLIB}\" \"LIBTOOL = ${TARGET_LIBTOOL} \" ${TARGET_MOL_LIBS}
       COMMENT "Compiling libmolfile_plugin.a"
-      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/molfile_plugins/molfile_plugin"
+      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../molfile_plugin"
    ) 
 endif()
 
diff --git a/pymolfile/molfile/pymolfile.c b/pymolfile/molfile/pymolfile.c
deleted file mode 100644
index d62d28ef607a99653f7e61fe41b88fcf35775aff..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/pymolfile.c
+++ /dev/null
@@ -1,740 +0,0 @@
-/* Hey emacs this is -*- C -*- and this is my editor vim.
- * 
- * pymolfile.c : C and Python interfaces for molfile_plugins
- * Copyright (c) Berk Onat <b.onat@warwick.ac.uk> 2017
- *
- * This program is under UIUC Open Source License please see LICENSE file
- */
-
-/*
- * The code is written following the plugin test 
- * context of main.c in molfile_plugin/src/ 
- */
-
-/* Get HAVE_CONFIG_H */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
-#include <ctype.h>
-
-/* get fixed-width types if we are using ANSI C99 */
-#ifdef HAVE_STDINT_H
-#  include <stdint.h>
-#elif (defined HAVE_INTTYPES_H)
-#  include <inttypes.h>
-#endif
-
-#include "pymolfile.h"
-
-int numplugins=0;
-molfile_plugin_t** plugin_list;
-
-#if PY_VERSION_HEX >= 0x03000000
-#define PyInt_AsLong PyLong_AsLong
-#define PyString_FromString PyBytes_FromString
-#define PyInt_FromLong PyLong_FromLong
-
-void del_molfile_plugin_list(PyObject* molcapsule)
-{
-    plugin_list = (molfile_plugin_t**) PyMolfileCapsule_AsVoidPtr(molcapsule);   
-    free(plugin_list); 
-    Py_XDECREF(molcapsule);
-}
-void del_molfile_file_handle(PyObject* molcapsule)
-{
-    void *file_handle = (void*) PyMolfileCapsule_AsVoidPtr(molcapsule);   
-    free(file_handle); 
-    Py_XDECREF(molcapsule);
-}
-#else
-void* del_molfile_plugin_list(void* molcapsule)
-{
-    plugin_list = PyMolfileCapsule_AsVoidPtr((PyObject*)molcapsule);   
-    free(plugin_list); 
-    Py_XDECREF(molcapsule);
-}
-void* del_molfile_file_handle(void* molcapsule)
-{
-    void *file_handle = PyMolfileCapsule_AsVoidPtr((PyObject*)molcapsule);   
-    free(file_handle); 
-    Py_XDECREF(molcapsule);
-}
-#endif
-
-/* * * * * * * * * * * * * * * * * * * * * * *
- * Helper functions to set and store plugins *
- * * * * * * * * * * * * * * * * * * * * * * */
-
-PyObject* get_plugin(PyObject* molcapsule, int plug_no)
-{
-    molfile_plugin_t* plugin;
-    molfile_plugin_t** plug_list = (molfile_plugin_t**) PyMolfileCapsule_AsVoidPtr(molcapsule);   
-    if(plug_no < 0){
-	plugin = NULL;
-    } else {
-	if(plug_list != NULL){
-	    plugin = plug_list[plug_no];
-	} else {
-	    plugin = NULL;
-	}
-    }
-    return PyMolfileCapsule_FromVoidPtr((void *)plugin, NULL);
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Interface functions to initialize molfile plugins *
- * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* check validity of plugins and register them. */
-static int molfile_register(void*, vmdplugin_t *plugin) {
-    if (!plugin->type || !plugin->name || !plugin->author) {
-        // skipping plugin with incomplete header
-        return VMDPLUGIN_ERROR;
-    }
-    else if (plugin->abiversion != vmdplugin_ABIVERSION) {
-        // skipping plugin with incompatible ABI
-        return VMDPLUGIN_ERROR;
-    }
-    else if (0 != strncmp(plugin->type, "mol file", 8)) {
-        // skipping plugin of incompatible type
-        return VMDPLUGIN_ERROR;
-    } 
-    else if (numplugins >= MAXPLUGINS) {
-        // too many plugins: increase MAXPLUGINS
-        return VMDPLUGIN_ERROR;
-    }
-
-        plugin_list[numplugins] = (molfile_plugin_t *) plugin;
-        ++numplugins;
-        return VMDPLUGIN_SUCCESS;
-}
-
-PyObject* molfile_plugin_list(int maxsize)
-{
-    if(maxsize < MAXPLUGINS){
-        maxsize = MAXPLUGINS;
-    }
-    plugin_list = (molfile_plugin_t**) malloc(sizeof(molfile_plugin_t*)*maxsize);
-    return PyMolfileCapsule_FromVoidPtr((void *)plugin_list, del_molfile_plugin_list);
-}
-
-/* register all available plugins and clear handles. */
-int molfile_init(void) 
-{
-    MOLFILE_INIT_ALL;
-    MOLFILE_REGISTER_ALL(NULL,molfile_register);
-    return numplugins;
-}
-
-/* unregister all available plugins */
-int molfile_finish(void) 
-{
-    MOLFILE_FINI_ALL;
-    return 0;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * *
- * Wrappers to directly access molfile plugin*
- *         functions and settings            *
- * * * * * * * * * * * * * * * * * * * * * * */
-
-/* molfile_plugin_t access */
-
-/* Functions in molfile_plugin_t */
-
-PyObject * molfile_plugin_info(PyObject* molcapsule, int plugin_no) {
-    molfile_plugin_t *plugin;
-    molfile_plugin_t** plugin_list = (molfile_plugin_t**) PyMolfileCapsule_AsVoidPtr(molcapsule);   
-    int *plugno = &plugin_no;
-    int has_readstructure = 0;
-    int has_readbonds = 0;
-    int has_readangles = 0;
-    int has_writestructure = 0;
-    int has_writebonds = 0;
-    int has_writeangles = 0;
-    int has_readnexttimestep = 0;
-    int has_writetimestep = 0;
-    int plugin_list_size = sizeof(plugin_list) / sizeof(molfile_plugin_t**);
-    if (plugno==NULL || plugin_no<0){
-      PyErr_Format(PyExc_IOError, "Error: molfile plugin handle no should be given, be positive value and should not exceed the list length'%d'. You set '%d'", plugin_list_size, plugin_no);
-      return 0;
-    }
-    plugin = plugin_list[plugin_no];
-    if(plugin==NULL || !plugin->open_file_read){
-      PyErr_Format(PyExc_IOError, "Error: molfile plugin '%d' is not initialized.", plugin_no);
-      return 0;
-    }
-    if (plugin->read_structure) has_readstructure = 1;
-    if (plugin->read_bonds) has_readbonds = 1;
-    if (plugin->read_angles) has_readangles = 1;
-    if (plugin->read_next_timestep) has_readnexttimestep = 1;
-    if (plugin->write_structure) has_writestructure = 1;
-    if (plugin->write_bonds) has_writebonds = 1;
-    if (plugin->write_angles) has_writeangles = 1;
-    if (plugin->write_timestep) has_writetimestep = 1;
-    PyObject *tuple = PyTuple_New(17);
-    PyTuple_SET_ITEM(tuple, 0, PyString_FromString(plugin->filename_extension));
-    PyTuple_SET_ITEM(tuple, 1, PyString_FromString(plugin->name));
-    PyTuple_SET_ITEM(tuple, 2, PyInt_FromLong((long)has_readstructure));
-    PyTuple_SET_ITEM(tuple, 3, PyInt_FromLong((long)has_readbonds));
-    PyTuple_SET_ITEM(tuple, 4, PyInt_FromLong((long)has_readangles));
-    PyTuple_SET_ITEM(tuple, 5, PyInt_FromLong((long)has_readnexttimestep));
-    PyTuple_SET_ITEM(tuple, 6, PyInt_FromLong((long)has_writestructure));
-    PyTuple_SET_ITEM(tuple, 7, PyInt_FromLong((long)has_writebonds));
-    PyTuple_SET_ITEM(tuple, 8, PyInt_FromLong((long)has_writeangles));
-    PyTuple_SET_ITEM(tuple, 9, PyInt_FromLong((long)has_writetimestep));
-    PyTuple_SET_ITEM(tuple, 10, PyString_FromString(plugin->prettyname));
-    PyTuple_SET_ITEM(tuple, 11, PyString_FromString(plugin->type));
-    PyTuple_SET_ITEM(tuple, 12, PyString_FromString(plugin->author));
-    PyTuple_SET_ITEM(tuple, 13, PyInt_FromLong((long)plugin->majorv));
-    PyTuple_SET_ITEM(tuple, 14, PyInt_FromLong((long)plugin->minorv));
-    PyTuple_SET_ITEM(tuple, 15, PyInt_FromLong((long)plugin->abiversion));
-    PyTuple_SET_ITEM(tuple, 16, PyInt_FromLong((long)plugin->is_reentrant));
-    return tuple;
-}
-
-PyObject* read_fill_structure(PyObject* molpack, PyObject* prototype)
-{
-//    Py_Initialize();
-    import_array();
-    int options = 0;
-    molfile_plugin_t* plugin;
-    void* file_handle;
-    molfile_atom_t* data;
-    int numatoms, status;
-    int nd;
-    PyObject *ret = NULL;
-    // Access plugin_handle values
-    MolObject* plugin_handle = (MolObject*) molpack;
-    if (plugin_handle->plugin) {
-        plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugin_handle->plugin);
-        //plugin = plugin_handle->plugin;   
-    } else {
-        PyErr_Format(PyExc_IOError, "molfile plugin is not active.");
-	return NULL;
-    } 
-    if (plugin_handle->file_handle) {
-        file_handle = (void*) PyMolfileCapsule_AsVoidPtr(plugin_handle->file_handle);
-        //file_handle = plugin_handle->file_handle;
-    } else {
-        PyErr_Format(PyExc_IOError, "no file handle in molfile plugin handle.");
-	return NULL; 
-    } 
-    if (plugin_handle->natoms) {
-        numatoms = plugin_handle->natoms;
-    } else { 
-        PyErr_Format(PyExc_IOError, "no assigned number of atoms in molfile plugin handle.");
-	return NULL;
-    } 
-    // Allocate memory for array of molfile_atom_t struct
-    data = (molfile_atom_t *)calloc(numatoms,sizeof(molfile_atom_t));
-    // Get array values in molfile_atom_t
-    if (plugin->read_structure) {
-        status = plugin->read_structure(file_handle, &options, data);
-        // Check if the plugin returns the results
-        if (status!=0){
-            PyErr_Format(PyExc_IOError, "Error accessing molfile_atom_t in read_structure function of plugin.");
-            return NULL;
-        }
-	if(numatoms>0){
-            nd = 1;
-            npy_intp dims[1] = { numatoms };
-            npy_intp strides[1] = { sizeof(molfile_atom_t) };
-            Py_INCREF(prototype);
-            ret = PyArray_NewFromDescr(Py_TYPE(prototype), PyArray_DESCR((PyArrayObject*)prototype), 
-	       	                       nd, dims,
-		                       strides, data, 
-			               PyArray_FLAGS((PyArrayObject*)prototype), prototype);
-            Py_DECREF(prototype);
-            return (PyObject*) ret;
-	} else {
-            PyErr_Format(PyExc_AttributeError, "plugin read_structure does not have atoms information.");
-	    Py_RETURN_NONE;
-	}
-    } else {
-        PyErr_Format(PyExc_AttributeError, "molfile plugin does not have read_structure function.");
-	Py_RETURN_NONE;
-    }
-}
-
-PyObject* read_fill_bonds(PyObject* molpack)
-{
-    import_array();
-    int options = 0;
-    molfile_plugin_t* plugin;
-    void* file_handle;
-    molfile_atom_t* data;
-    int numatoms, status;
-    int nd;
-    PyObject *ret = NULL;
-    // Access plugin_handle values
-    MolObject* plugin_handle = (MolObject*) molpack;
-    if (plugin_handle->plugin) {
-        plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugin_handle->plugin);
-        //plugin = plugin_handle->plugin;   
-    } else {
-        PyErr_Format(PyExc_IOError, "molfile plugin is not active.");
-	return NULL;
-    } 
-    if (plugin_handle->file_handle) {
-        file_handle = (void*) PyMolfileCapsule_AsVoidPtr(plugin_handle->file_handle);
-        //file_handle = plugin_handle->file_handle;
-    } else {
-        PyErr_Format(PyExc_IOError, "no file handle in molfile plugin handle.");
-	return NULL; 
-    } 
-    numatoms = plugin_handle->natoms;
-    if (plugin->read_bonds) {
-        int nbonds, *from, *to, *bondtype, nbondtypes;
-        float *bondorder;
-        char **bondtypename;
-        if ((status = plugin->read_bonds(file_handle, &nbonds, &from, &to, 
-				         &bondorder, &bondtype, &nbondtypes, &bondtypename))) {
-            PyErr_Format(PyExc_IOError, "Error accessing read_bonds function of plugin.");
-            return NULL;
-        }
-        PyArrayInterface *inter = NULL;
-        inter = (PyArrayInterface*)malloc(sizeof(PyArrayInterface));
-        if (inter==NULL)
-            return PyErr_NoMemory();
-        inter->flags = NPY_ARRAY_NOTSWAPPED | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE;
-	ret = PyDict_New();
-        nd = 1;
-        npy_intp istrides[1] = { NPY_SIZEOF_INT };
-        npy_intp fstrides[1] = { NPY_SIZEOF_FLOAT };
-        npy_intp cstrides[1] = { sizeof(NPY_STRING) };
-	if (nbonds>0) {
-            PyObject *from_arr = NULL;
-            PyObject *to_arr = NULL;
-            npy_intp dims[1] = { nbonds };
-            from_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                            nd, dims,
-                                            istrides, from, 
-                                            inter->flags, NULL);
-	    PyDict_SetItemString(ret, "from", from_arr);
-            to_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                          nd, dims,
-                                          istrides, to, 
-                                          inter->flags, NULL);
-	    PyDict_SetItemString(ret, "to", to_arr);
-	    if (bondorder!=NULL) {
-                PyObject *bondorder_arr = NULL;
-                bondorder_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_FLOAT), 
-                                                     nd, dims,
-                                                     fstrides, bondorder, 
-			                             inter->flags, NULL);
-	        PyDict_SetItemString(ret, "bondorder", bondorder_arr);
-	    }
-	    if (bondtype!=NULL && nbondtypes>0) {
-                PyObject *bondtype_arr = NULL;
-                bondtype_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                                    nd, dims,
-                                                    istrides, bondtype, 
-			                            inter->flags, NULL);
-	        PyDict_SetItemString(ret, "bondtype", bondtype_arr);
-	    }
-	    if (bondtypename!=NULL && nbondtypes>0) {
-                PyObject *bondtypename_arr = NULL;
-                npy_intp cdims[1] = { nbondtypes };
-                bondtypename_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_STRING), 
-                                                        nd, cdims,
-                                                        cstrides, bondtypename, 
-	                                                inter->flags, NULL);
-	        PyDict_SetItemString(ret, "bondtypename", bondtypename_arr);
-	    }
-            return (PyObject*) ret;
-	} else {
-            Py_RETURN_NONE;
-	}
-    } else {
-        PyErr_Format(PyExc_AttributeError, "molfile plugin does not have read_bonds function.");
-        Py_RETURN_NONE;
-    }
-}
-
-PyObject* read_fill_angles(PyObject* molpack)
-{
-    import_array();
-    int options = 0;
-    molfile_plugin_t* plugin;
-    void* file_handle;
-    molfile_atom_t* data;
-    int numatoms, status;
-    int nd;
-    int nodata = 0;
-    PyObject *ret = NULL;
-    // Access plugin_handle values
-    MolObject* plugin_handle = (MolObject*) molpack;
-    if (plugin_handle->plugin) {
-        plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugin_handle->plugin);
-        //plugin = plugin_handle->plugin;   
-    } else {
-        PyErr_Format(PyExc_IOError, "molfile plugin is not active.");
-	return NULL;
-    } 
-    if (plugin_handle->file_handle) {
-        file_handle = (void*) PyMolfileCapsule_AsVoidPtr(plugin_handle->file_handle);
-        //file_handle = plugin_handle->file_handle;
-    } else {
-        PyErr_Format(PyExc_IOError, "no file handle in molfile plugin handle.");
-	return NULL; 
-    } 
-    numatoms = plugin_handle->natoms;
-    // Check if there is read_angles support in this plugin
-    if (plugin->read_angles) {
-	// Angles
-        int numangles;
-        int *angles = NULL;
-	int *angletypes = NULL;
-        int numangletypes;
-	char **angletypenames = NULL; 
-	// Dihedrals
-	int numdihedrals; 
-	int *dihedrals = NULL;
-	int *dihedraltypes = NULL;
-	int numdihedraltypes;
-        char **dihedraltypenames = NULL; 
-	// Impropers
-	int numimpropers;
-        int *impropers = NULL;
-        int *impropertypes = NULL;
-	int numimpropertypes;
-	char **impropertypenames = NULL;
-	// Cterms
-        int numcterms, ctermcols, ctermrows;
-	int *cterms = NULL; 
-	// Initilize zeros to number of angles, dihedrals, so on ...
-	numangles = 0;
-	numangletypes = 0;
-	numdihedrals = 0;
-	numdihedraltypes = 0;
-	numimpropers = 0;
-	numimpropertypes = 0;
-	numcterms = 0;
-	// Calling read_angles to gather the information
-        if ((status = plugin->read_angles(file_handle, &numangles, &angles, &angletypes,
-                                          &numangletypes, &angletypenames, &numdihedrals,
-                                          &dihedrals, &dihedraltypes, &numdihedraltypes,
-                                          &dihedraltypenames, &numimpropers, &impropers,        
-                                          &impropertypes, &numimpropertypes, &impropertypenames,
-                                          &numcterms, &cterms, &ctermcols, &ctermrows))) {
-            PyErr_Format(PyExc_IOError, "Error accessing read_angles function of plugin.");
-            return NULL;
-        }
-        PyArrayInterface *inter = NULL;
-        inter = (PyArrayInterface*)malloc(sizeof(PyArrayInterface));
-        if (inter==NULL)
-            return PyErr_NoMemory();
-        inter->flags = NPY_ARRAY_NOTSWAPPED | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE;
-	ret = PyDict_New();
-        nd = 1;
-        npy_intp istrides[1] = { NPY_SIZEOF_INT };
-        npy_intp sstrides[1] = { sizeof(NPY_STRING) };
-	if (numangles>0 && angles!=NULL) {
-	    nodata = 1;
-            PyObject *angles_arr = NULL;
-            npy_intp adims[1] = { numangles };
-            angles_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                              nd, adims,
-                                              istrides, angles, 
-                                              inter->flags, NULL);
-	    PyDict_SetItemString(ret, "angles", angles_arr);
-	    if (angletypes!=NULL) {
-                PyObject *angletypes_arr = NULL;
-                angletypes_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                                      nd, adims,
-                                                      istrides, angletypes, 
-                                                      inter->flags, NULL);
-	        PyDict_SetItemString(ret, "angletypes", angletypes_arr);
-	    }
-	}
-	if (numangletypes>0 && angletypenames!=NULL) {
-	    nodata = 1;
-            PyObject *angletypenames_arr = NULL;
-            npy_intp atdims[1] = { numangletypes };
-            angletypenames_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_STRING), 
-                                                      nd, atdims,
-                                                      sstrides, angletypenames, 
-			                              inter->flags, NULL);
-	    PyDict_SetItemString(ret, "angletypenames", angletypenames_arr);
-	}
-	if (numdihedrals>0 && dihedrals!=NULL) {
-	    nodata = 1;
-            PyObject *dihedrals_arr = NULL;
-            npy_intp ddims[1] = { numdihedrals };
-            dihedrals_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                                 nd, ddims,
-                                                 istrides, dihedrals, 
-			                         inter->flags, NULL);
-	    PyDict_SetItemString(ret, "dihedrals", dihedrals_arr);
-	    if (dihedraltypes!=NULL) {
-                PyObject *dihedraltypes_arr = NULL;
-                dihedraltypes_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                                    nd, ddims,
-                                                    istrides, dihedraltypes, 
-                                                    inter->flags, NULL);
-	        PyDict_SetItemString(ret, "dihedraltypes", dihedraltypes_arr);
-	    }
-	}
-	if (numdihedraltypes>0 && dihedraltypenames!=NULL) {
-            PyObject *dihedraltypenames_arr = NULL;
-            npy_intp dtdims[1] = { numdihedraltypes };
-            dihedraltypenames_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_STRING), 
-                                                         nd, dtdims,
-                                                         sstrides, dihedraltypenames, 
-	                                                 inter->flags, NULL);
-	    PyDict_SetItemString(ret, "dihedraltypenames", dihedraltypenames_arr);
-	}
-	if (numimpropers>0 && impropers!=NULL) {
-	    nodata = 1;
-            PyObject *impropers_arr = NULL;
-            npy_intp idims[1] = { numimpropers };
-            impropers_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                                 nd, idims,
-                                                 istrides, impropers, 
-			                         inter->flags, NULL);
-	    PyDict_SetItemString(ret, "impropers", impropers_arr);
-	    if (impropertypes!=NULL) {
-                PyObject *impropertypes_arr = NULL;
-                impropertypes_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                                         nd, idims,
-                                                         istrides, impropertypes, 
-                                                         inter->flags, NULL);
-	        PyDict_SetItemString(ret, "impropertypes", impropertypes_arr);
-	    }
-	}
-	if (numimpropertypes>0 && impropertypenames!=NULL) {
-            PyObject *impropertypenames_arr = NULL;
-            npy_intp itdims[1] = { numimpropertypes };
-            impropertypenames_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_STRING), 
-                                                         nd, itdims,
-                                                         sstrides, impropertypenames, 
-	                                                 inter->flags, NULL);
-	    PyDict_SetItemString(ret, "impropertypenames", impropertypenames_arr);
-	}
-	if (numcterms>0 && cterms!=NULL) {
-	    nodata = 1;
-	    int ctermnd;
-            npy_intp *ctermdims;
-	    npy_intp *ctermstrides;
-            PyObject *cterms_arr = NULL;
-	    if (ctermrows>0 || ctermcols>0) {
-		ctermnd = 2;
-                ctermdims = (npy_intp*)calloc(ctermnd,sizeof(int));
-                ctermstrides = (npy_intp*)calloc(ctermnd,sizeof(int));
-	        ctermdims[0] = ctermrows;
-	        ctermdims[1] = ctermcols;
-	        ctermstrides[0] = NPY_SIZEOF_INT;
-	        ctermstrides[1] = ctermcols*NPY_SIZEOF_INT;
-	    } else {
-		ctermnd = 1;
-                ctermdims = (npy_intp*)calloc(ctermnd,sizeof(int));
-                ctermstrides = (npy_intp*)calloc(ctermnd,sizeof(int));
-	        ctermdims[0] = 8*numcterms;
-	        ctermstrides[0] = NPY_SIZEOF_INT;
-	    }
-            cterms_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_INT), 
-                                              ctermnd, ctermdims,
-                                              ctermstrides, cterms, 
-			                      inter->flags, NULL);
-	    PyDict_SetItemString(ret, "cterms", cterms_arr);
-	}
-	if (nodata>0) {
-            return (PyObject*) ret;
-	} else {
-            Py_RETURN_NONE;
-	}
-    } else {
-        PyErr_Format(PyExc_AttributeError, "molfile plugin does not have read_angles function.");
-        Py_RETURN_NONE;
-    }
-}
-
-
-PyObject* read_fill_next_timestep(PyObject* molpack)
-{
-    import_array();
-    molfile_plugin_t* plugin;
-    void* file_handle;
-    int numatoms, status;
-    int nd;
-    int i, d;
-    PyObject *ret = NULL;
-    // Access plugin_handle values
-    MolObject* plugin_handle = (MolObject*) molpack;
-    if (plugin_handle->plugin) {
-        plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugin_handle->plugin);
-        //plugin = plugin_handle->plugin;   
-    } else {
-        PyErr_Format(PyExc_IOError, "molfile plugin is not active.");
-	return NULL;
-    } 
-    if (plugin_handle->file_handle) {
-        file_handle = (void*) PyMolfileCapsule_AsVoidPtr(plugin_handle->file_handle);
-        //file_handle = plugin_handle->file_handle;
-    } else {
-        PyErr_Format(PyExc_IOError, "no file handle in molfile plugin handle.");
-	return NULL; 
-    } 
-    if (plugin_handle->natoms) {
-        numatoms = plugin_handle->natoms;
-    } else { 
-        PyErr_Format(PyExc_IOError, "no assigned number of atoms in molfile plugin handle.");
-	return NULL;
-    }
-    if (plugin->read_next_timestep) {
-        PyArrayInterface *inter = NULL;
-        inter = (PyArrayInterface*)malloc(sizeof(PyArrayInterface));
-        if (inter==NULL)
-            return PyErr_NoMemory();
-        inter->flags = NPY_ARRAY_NOTSWAPPED | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE;
-	ret = PyDict_New();
-        molfile_timestep_t timestep;
-	// Check if the velocities will be supplied from this plugin
-	int has_velocities = -1;
-	unsigned int total_steps = 0;
-	unsigned int bytes_per_step = 0;
-	molfile_timestep_metadata_t timestep_metadata;
-        if (plugin->read_timestep_metadata) {
-	    plugin->read_timestep_metadata(file_handle, &timestep_metadata);
-            total_steps = timestep_metadata.count; 
-	    has_velocities = timestep_metadata.has_velocities;
-	    bytes_per_step = timestep_metadata.avg_bytes_per_timestep;
-	} else {
-	    total_steps = 0;
-	    has_velocities = -2;
-	}
-	timestep.A=-1;
-	timestep.B=-1;
-	timestep.C=-1;
-	timestep.alpha=-1;
-	timestep.beta=-1;
-	timestep.gamma=-1;
-	timestep.physical_time=-1;
-        timestep.coords = (float *)malloc(3*numatoms*sizeof(float));
-	if(has_velocities == -2 || has_velocities == 1) { 
-            timestep.velocities = (float *)malloc(3*numatoms*sizeof(float));
-	    for(i=0;i<numatoms;i++)
-	        for(d=0;d<3;d++)
-	            timestep.velocities[i*3+d] = -1111*(d+1);
-	}
-        status = plugin->read_next_timestep(file_handle, numatoms, &timestep);
-        if (status == MOLFILE_EOF) {
-	    Py_RETURN_NONE;
-	}
-	else if (status != MOLFILE_SUCCESS) {
-            PyErr_Format(PyExc_AttributeError, "Failed in calling read_next_timestep function of plugin.");
-	    Py_RETURN_NONE;
-        } 
-	else {
-            nd = 2;
-            PyObject *coords_arr = NULL;
-            npy_intp dims[2] = { numatoms, 3 };
-            npy_intp strides[2] = { 3*sizeof(float), sizeof(float) };
-            coords_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_FLOAT), 
-                                              nd, dims,
-                                              strides, timestep.coords, 
-	                                      inter->flags, NULL);
-	    PyDict_SetItemString(ret, "coords", coords_arr);
-	    if (timestep.velocities!=NULL && (has_velocities == -2 || has_velocities == 1)) {
-		if (-1111 != (int)timestep.velocities[0] && 
-		    -2222 != (int)timestep.velocities[1] && 
-		    -3333 != (int)timestep.velocities[2]) {
-                    PyObject *velocities_arr = NULL;
-                    velocities_arr = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(NPY_FLOAT), 
-                                                          nd, dims,
-                                                          strides, timestep.velocities, 
-	                                                  inter->flags, NULL);
-	            PyDict_SetItemString(ret, "velocities", velocities_arr);
-		}
-	    } else {
-		if(has_velocities == -2 || has_velocities == 1)
-		    free(timestep.velocities);
-	    }
-            if(timestep.A > -1)
-	        PyDict_SetItemString(ret, "A", PyFloat_FromDouble((double)timestep.A));
-            if(timestep.B > -1)
-	        PyDict_SetItemString(ret, "B", PyFloat_FromDouble((double)timestep.B));
-            if(timestep.C > -1)
-	        PyDict_SetItemString(ret, "C", PyFloat_FromDouble((double)timestep.C));
-            if(timestep.alpha > -1)
-	        PyDict_SetItemString(ret, "alpha", PyFloat_FromDouble((double)timestep.alpha));
-	    if(timestep.beta > -1)
-	        PyDict_SetItemString(ret, "beta", PyFloat_FromDouble((double)timestep.beta));
-	    if(timestep.gamma > -1)
-	        PyDict_SetItemString(ret, "gamma", PyFloat_FromDouble((double)timestep.gamma));
-	    if(timestep.physical_time > -1)
-	        PyDict_SetItemString(ret, "physical_time", PyFloat_FromDouble(timestep.physical_time));
-	    //if(has_velocities > -1)
-	    //    PyDict_SetItemString(ret, "has_velocities", PyLong_FromLong((long)has_velocities));
-	    if(total_steps > -1)
-	        PyDict_SetItemString(ret, "total_steps", PyLong_FromLong((long)total_steps));
-	    PyDict_SetItemString(ret, "has_velocities", PyLong_FromLong((long)has_velocities));
-            return (PyObject*) ret;
-	}
-    } else {
-        PyErr_Format(PyExc_AttributeError, "molfile plugin does not have read_next_timestep function.");
-	Py_RETURN_NONE;
-    }
-}
-
-PyObject* are_plugins_same(PyObject* molpack_a, PyObject* molpack_b)
-{
-    molfile_plugin_t* plugin_a;
-    molfile_plugin_t* plugin_b;
-    PyObject *ret = NULL;
-    MolObject* plugin_handle_a = (MolObject*) molpack_a;
-    MolObject* plugin_handle_b = (MolObject*) molpack_b;
-    if (plugin_handle_a->plugin) {
-        plugin_a = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugin_handle_a->plugin);
-        //plugin_a = plugin_handle_a->plugin;   
-    } else {
-        PyErr_Format(PyExc_IOError, "Arg 1 of the molfile plugin is not active.");
-	return NULL;
-    } 
-    if (plugin_handle_b->plugin) {
-        plugin_b = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(plugin_handle_b->plugin);
-        //plugin_b = plugin_handle_b->plugin;   
-    } else {
-        PyErr_Format(PyExc_IOError, "Arg 2 of the molfile plugin is not active.");
-	return NULL; 
-    } 
-    if(plugin_a == plugin_b){
-      Py_RETURN_TRUE;
-    } else {
-      Py_RETURN_FALSE;
-    }
-}
-
-PyObject* are_filehandles_same(PyObject* molpack_a, PyObject* molpack_b)
-{
-    MolObject* plugin_handle_a = (MolObject*) molpack_a;
-    MolObject* plugin_handle_b = (MolObject*) molpack_b;
-    void* file_handle_a; 
-    void* file_handle_b; 
-    if (plugin_handle_a->file_handle) {
-        file_handle_a = (void*) PyMolfileCapsule_AsVoidPtr(plugin_handle_a->file_handle);
-        //file_handle_a = plugin_handle_a->file_handle;   
-    } else {
-        PyErr_Format(PyExc_IOError, "no file handle in arg 1 of molfile plugin.");
-	return NULL;
-    } 
-    if (plugin_handle_b->file_handle) {
-        file_handle_b = (void*) PyMolfileCapsule_AsVoidPtr(plugin_handle_b->file_handle);
-        //file_handle_b = plugin_handle_b->file_handle;   
-    } else {
-        PyErr_Format(PyExc_IOError, "no file handle in arg 2 of molfile plugin.");
-	return NULL;
-    } 
-    if(file_handle_a == file_handle_b){
-      Py_RETURN_TRUE;
-    } else {
-      Py_RETURN_FALSE;
-    }
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/LICENSE b/pymolfile/molfile/vmd_molfile_plugins-clang/LICENSE
deleted file mode 100644
index 9032b635eee892ca4e414f17d0434d89f0e4bc1e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/LICENSE
+++ /dev/null
@@ -1,58 +0,0 @@
-
-With the exception of specifically marked plugins or source files
-which have different license terms due to inclusion of source code
-or data under different restrictions, the software contained
-within the VMD plugin tree is subject to the UIUC Open Source license 
-which is included below the explicitly listed exceptions below:
-
-Specifically listed exceptions: 
-  hesstrans -- Includes the "newmat10B" free C++ matrix library by
-               Robert Davies (robert@statsresearch.co.nz)
-  intersurf -- See Intersurf INRIA license text
-     pmepot -- NAMD License
-     psfgen -- NAMD License
-      stamp -- See STAMP license
-   vmdtkcon -- See TkCon license
-
-   Prof. A. MacKerell's CHARMM Empirical Force Fields -- 
-     (excerpts included with plugins: 
-      'autoionize', 'membrane', 'readcharmmtop', 'readcharmmpar', 'solvate')
-     http://www.pharmacy.umaryland.edu/faculty/amackere/force_fields.htm   
-
-------------------------------------------------------------------------------
-
-University of Illinois Open Source License
-Copyright 2006 Theoretical and Computational Biophysics Group, 
-All rights reserved.
-
-Developed by:		Theoretical and Computational Biophysics Group
-			University of Illinois at Urbana-Champaign
-			http://www.ks.uiuc.edu/
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the Software), to deal with 
-the Software without restriction, including without limitation the rights to 
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
-of the Software, and to permit persons to whom the Software is furnished to 
-do so, subject to the following conditions:
-
-Redistributions of source code must retain the above copyright notice, 
-this list of conditions and the following disclaimers.
-
-Redistributions in binary form must reproduce the above copyright notice, 
-this list of conditions and the following disclaimers in the documentation 
-and/or other materials provided with the distribution.
-
-Neither the names of Theoretical and Computational Biophysics Group, 
-University of Illinois at Urbana-Champaign, nor the names of its contributors 
-may be used to endorse or promote products derived from this Software without 
-specific prior written permission.
-
-THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
-OTHER DEALINGS WITH THE SOFTWARE.
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/Make-arch b/pymolfile/molfile/vmd_molfile_plugins-clang/Make-arch
deleted file mode 100755
index 8af3539213fe5017ec050b6f92d061ebf21cba14..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/Make-arch
+++ /dev/null
@@ -1,705 +0,0 @@
-##
-## Per-architecture plugin compilation rules 
-## Copyright 2002, Board of Trustees of the University of Illinois
-## Theoretical Biophysics Group
-##
-
-make-arch-help:
-	@echo "Type 'make arch' where arch is one of the platforms listed below:"
-	@echo "--------------------------------------"
-	@echo " AIX4"
-	@echo " AIX5"
-	@echo " AIX5_64"
-	@echo " AIX6_64"
-	@echo " BLUEGENEQ"
-	@echo " BLUEWATERS"
-	@echo " CRAY_XC"
-	@echo " CRAY_XK"
-	@echo " FREEBSD"
-	@echo " FREEBSDAMD64"
-	@echo " HPUX11"
-	@echo " IRIX6"
-	@echo " IRIX6_64"
-	@echo " LINUX"
-	@echo " LINUXALPHA"
-	@echo " LINUXAMD64"
-	@echo " LINUXPPC"
-	@echo " LINUXPPC64"
-	@echo " LINUXIA64"
-	@echo " MACOSX"
-	@echo " MACOSXX86"
-	@echo " MACOSXX86_64"
-	@echo " NETBSD"
-	@echo " OPENPOWER"
-	@echo " SOLARIS2"
-	@echo " SOLARIS2_64"
-	@echo " SOLARISX86"
-	@echo " SOLARISX86_64"
-	@echo " SUMMIT"
-	@echo " TRU64"
-	@echo " T3E"
-	@echo " WIN32"
-	@echo " WIN32-debug"
-	@echo " WIN64"
-	@echo "--------------------------------------"
-	@echo "Type 'make clean' to clean the compilation area"
-	@echo "Type 'make arch OPT=myopt' to specfy additional options."
-	@echo "Options include: "
-	@echo "  TCLINC: Include path for Tcl"
-	@echo "  TCLLIB: Library path for Tcl"
-
-##
-## Android specific configuration items
-##
-ANDROIDBINS = /Projects/collaboratory/kvandivo/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin
-ANDROIDINCS = -DANDROID -I/home/kvandivo/Proj/ndk/sources/cxx-stl/stlport/stlport -I/home/kvandivo/Proj/ndk/sources/cxx-stl/system/include -I/home/kvandivo/Proj/ndk/platforms/android-14/arch-arm/usr/include 
-ANDROIDABI = arm-linux-androideabi-
-ANDROIDLIBS = -L/home/kvandivo/Proj/ndk/platforms/android-14/arch-arm/usr/lib
-ANDROIDSYSROOT = --sysroot=/home/kvandivo/Proj/ndk/platforms/android-14/arch-arm
-
-AIX4:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX4" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -qarch=com -qtune=pwr3" \
-	"CXXFLAGS = -w -qstrict -Q -qarch=com -qtune=pwr3" \
-	"LDFLAGS = -qarch=com -qtune=pwr3" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -qarch=com -qtune=pwr3"
-
-AIX5:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX5" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -qarch=com -qtune=pwr5" \
-	"CXXFLAGS = -w -qstrict -Q -qarch=com -qtune=pwr5" \
-	"LDFLAGS = -qarch=com -qtune=pwr5" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -qarch=com -qtune=pwr5"
-
-AIX5_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX5_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -q64 -qarch=com -qtune=pwr5" \
-	"CXXFLAGS = -w -qstrict -Q -q64 -qarch=com -qtune=pwr5" \
-	"LDFLAGS = -q64 -qarch=com -qtune=pwr5" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar -X64" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -q64 -qarch=com -qtune=pwr5"
-
-AIX6_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX6_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -q64 -qarch=com -qtune=pwr5" \
-	"CXXFLAGS = -w -qstrict -Q -q64 -qarch=com -qtune=pwr5" \
-	"LDFLAGS = -q64 -qarch=com -qtune=pwr5" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar -X64" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -q64 -qarch=com -qtune=pwr5"
-
-ANDROIDARMV7A:
-	$(MAKE) staticlibs \
-	"ARCH = ANDROIDARMV7A" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = $(ANDROIDBINS)/$(ANDROIDABI)gcc" \
-	"CXX = $(ANDROIDBINS)/$(ANDROIDABI)g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC -Wall -Wno-psabi -MMD -MP -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv7-a -msoft-float -mfpu=vfp -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstac $(ANDROIDINCS)" \
-	"CXXFLAGS = -O2 -fPIC -Wall -Wno-psabi -MMD -MP -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv7-a -msoft-float -mfpu=vfp -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstac $(ANDROIDINCS)" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = echo"
-
-BLUEGENEQ:
-	$(MAKE) staticlibs \
-	"ARCH = BGQ" \
-	"COPTO = -qpic -o " \
-	"LOPTO = -qpic -c -o " \
-	"CC = bgxlc_r" \
-	"CXX = bgxlC_r" \
-	"DEF = -D" \
-	"CCFLAGS = -w " \
-	"CXXFLAGS = -w " \
-	"LDFLAGS = -q64 -qarch=qp -qtune=qp" \
-	"TCLLDFLAGS = -ltcl8.4" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar " \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -lm -q64 -qarch=qp -qtune=qp"
-
-BLUEWATERS:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = BLUEWATERS" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-CRAY_XC:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = CRAY_XC" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-CRAY_XK:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = CRAY_XK" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-	
-HPUX11:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = HPUX11" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc" \
-	"CXX = aCC" \
-	"DEF = -D" \
-	"CCFLAGS = +O2 +DAportable -Ae +z" \
-	"CXXFLAGS = +O2 +DAportable +z" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = ld -b"
-
-IRIX6:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = IRIX6" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -n32 -mips3 -KPIC" \
-	"CXX = CC -n32 -mips3 -KPIC" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fullwarn" \
-	"CXXFLAGS = -O2 -fullwarn" \
-	"LDFLAGS = -n32 -mips3" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -shared"
- 
-IRIX6_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = IRIX6_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -64 -mips4 -KPIC" \
-	"CXX = CC -64 -mips4 -KPIC" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fullwarn" \
-	"CXXFLAGS = -O2 -fullwarn" \
-	"LDFLAGS = -64 -mips4" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -shared -64 -mips4"
- 
-FREEBSD:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = FREEBSD" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -Wall -I/usr/local/include/tcl8.5" \
-	"CXXFLAGS = -O2 -Wall" \
-	"TCLLDFLAGS = -L/usr/local/lib -ltcl85" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-FREEBSDAMD64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = FREEBSD" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -Wall -I/usr/local/include/tcl8.5" \
-	"CXXFLAGS = -m64 -O2 -Wall" \
-	"TCLLDFLAGS = -L/usr/local/lib -ltcl85" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUX:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUX" \
-	"COPTO = -fPIC -m32 -o " \
-	"LOPTO = -fPIC -m32 -lstdc++ -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m32 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m32 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-	
-LINUXALPHA:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXALPHA" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = ccc" \
-	"CXX = cxx" \
-	"DEF = -D" \
-	"CCFLAGS = -O4 -arch host -tune host" \
-	"CXXFLAGS = -O4 -arch host -tune host" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXAMD64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXAMD64" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -lstdc++ -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXCARMA:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXCARMA" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O3 -fPIC -Wall -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3-d16 -ffast-math -fno-strict-aliasing" \
-	"CXXFLAGS = -O3 -fPIC -Wall -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3-d16 -ffast-math -fno-strict-aliasing" \
-	"TCLLDFLAGS = -ltcl8.6 -lz -ldl -lpthread" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-	
-LINUXPPC:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXPPC" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -lstdc++ -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC -Wall" \
-	"CXXFLAGS = -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXPPC64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXPPC64" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXIA64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXIA64" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC -Wall" \
-	"CXXFLAGS = -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -shared"
-
-LINUXIA64-icc:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXIA64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = icc" \
-	"CXX = icpc" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC" \
-	"CXXFLAGS = -O2 -fPIC" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = icc -shared"
-	
-MACOSX:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSX" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -framework Tcl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = c++ -bundle" \
-	"TCLSHLD = c++ -dynamiclib"
-
-MACOSXX86:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSXX86" \
-	"COPTO = -m32 -fPIC -o " \
-	"LOPTO = -m32 -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -m32 -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -m32 -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -framework Tcl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = c++ -bundle" \
-	"TCLSHLD = c++ -dynamiclib"
-
-MACOSXX86_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSXX86_64" \
-	"COPTO = -m64 -fPIC -o " \
-	"LOPTO = -m64 -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = c++ -bundle" \
-	"TCLSHLD = c++ -dynamiclib"
-
-NETBSD:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = NETBSD" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -Wall -ansi" \
-	"CXXFLAGS = -O2 -Wall" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-OPENPOWER:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = OPENPOWER" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-SOLARIS2:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARIS2" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -mt -fast -xarch=v8plusa" \
-	"CXX = CC -mt -fast -xarch=v8plusa" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -mt -fast -xarch=v8plusa -G"
-
-SOLARIS2_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARIS2_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -D__EXTENSIONS__ -fast -mt -xarch=v9a" \
-	"CXX = CC -D__EXTENSIONS__ -fast -mt -xarch=v9a" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -D__EXTENSIONS__ -xarch=v9a -G"
-
-SOLARISX86:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARISX86" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -mt -fast -xarch=native" \
-	"CXX = CC -mt -fast -xarch=native" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -mt -fast -xarch=native -G"
-
-SOLARISX86_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARISX86_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -D__EXTENSIONS__ -fast -mt -xarch=native64" \
-	"CXX = CC -D__EXTENSIONS__ -fast -mt -xarch=native64" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -D__EXTENSIONS__ -xarch=native64 -G"
-
-SUMMIT:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SUMMIT" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-T3E:
-	$(MAKE) staticlibs \
-	"ARCH = T3E" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -O2" \
-	"CXXFLAGS = -O2" \
-	"LDFLAGS = " \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm" \
-	"RANLIB = touch" \
-	"SHLD = echo"
-
-TRU64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = TRU64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc" \
-	"CXX = cxx" \
-	"DEF = -D" \
- 	"CCFLAGS = -fast" \
- 	"CXXFLAGS = -fast" \
-	"TCLLDFLAGS = -ltcl8.5 -lm" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = ld -shared"
-
-WIN32:
-	$(MAKE) dynlibs win32staticlibs win32bins \
-	"ARCH = WIN32" \
-	"COPTO = /Fo" \
-	"LOPTO = /OUT:" \
-	"CC = cl.exe /nologo /MT /DWIN32" \
-	"CXX = cl.exe /nologo /MT /TP /DWIN32" \
-	"DEF = /D" \
-	"CCFLAGS = /O2 /G5" \
-	"CXXFLAGS = /O2 /G5" \
-	"TCLLDFLAGS = tcl85.lib" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLDFLAGS = /D\"VMDPLUGIN_EXPORTS\"" \
-	"SHLD = link /DLL /nologo /incremental:no \
-		kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
-		advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
-		odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib /OPT:REF"
-
-WIN32-debug:
-	$(MAKE) dynlibs win32staticlibs win32bins \
-	"ARCH = WIN32-debug" \
-	"COPTO = /Fo" \
-	"LOPTO = /OUT:" \
-	"CC = cl.exe /nologo /MTd /DWIN32" \
-	"CXX = cl.exe /nologo /MTd /TP /DWIN32" \
-	"DEF = /D" \
-	"CCFLAGS = /ZI /Od /G5 /D\"_DEBUG\"" \
-	"CXXFLAGS = /ZI /Od /G5 /D\"_DEBUG\"" \
-	"TCLLDFLAGS = tcl85.lib" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLDFLAGS = /D\"VMDPLUGIN_EXPORTS\"" \
-	"SHLD = link /DLL /nologo /incremental:no /debug /warn:4 \
-		kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
-		advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
-		odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib /OPT:REF"
-
-
-WIN64:
-	$(MAKE) dynlibs win32staticlibs win32bins \
-	"ARCH = WIN64" \
-	"COPTO = /Fo" \
-	"LOPTO = /OUT:" \
-	"CC = cl.exe /nologo /MT /DWIN64" \
-	"CXX = cl.exe /nologo /MT /TP /DWIN64" \
-	"DEF = /D" \
-	"CCFLAGS =  /EHsc /Wp64 /wd4996 /O2 /D\"_CRT_SECURE_NO_DEPRECATE\"" \
-	"CXXFLAGS = /EHsc /Wp64 /wd4996 /O2 /D\"_CRT_SECURE_NO_DEPRECATE\"" \
-	"TCLLDFLAGS = tcl85.lib" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLDFLAGS = /D\"VMDPLUGIN_EXPORTS\"" \
-	"SHLD = link /DLL /nologo /incremental:no \
-		kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
-		advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
-		odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib /MACHINE:X64 /OPT:REF"
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/Makefile b/pymolfile/molfile/vmd_molfile_plugins-clang/Makefile
deleted file mode 100755
index 51e8810378822ba340c39309f0e23069f9393e2e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/Makefile
+++ /dev/null
@@ -1,82 +0,0 @@
-##
-## Plugin compilation and distribution rules
-## Copyright 2002-2011, Board of Trustees of the University of Illinois
-## Theoretical and Computational Biophysics Group
-##
-## $Id: Makefile,v 1.141 2016/07/13 19:24:24 johns Exp $
-## 
-.SILENT:
-
-default: make-arch-help
-
-world:
-	@echo "Building all supported targets..."
-	csh -f build.csh
-
-# These plugins were, at one time, kept in a separate multiseq CVS tree and 
-# need to be periodically synced up with the main VMD plugin CVS when updated.
-# They are listed separately here to make this distinction more transparent.
-#MSEQBUILDDIRS = blast clustalw libbiokit \
-                multiseq multiseqdialog phylotree \
-                psipred seqdata seqedit stamp
-
-# When building from the independent multiseq tree, we'll use an empty list
-# since the dependency will be dealt with manually.
-MSEQBUILDDIRS = 
-
-# The Intersurf plugin is compiled manually and should only be
-# listed if the binaries are up-to-date for the target platform(s)
-#INTERSURF = intersurf
-INTERSURF = 
-
-# List of plugins to build
-#   Note: molfile plugins must be first since some of the 
-#         other plugins directly depend on them
-BUILDDIRS = \
-  $(MSEQBUILDDIRS) \
-  $(INTERSURF)
-
-INCLUDEDIR = include
-PLUGINHEADERS = vmdplugin.h molfile_plugin.h vmdconio.h
-
-distrib: 
-	@echo "Populating distribution directory with compiled plugins"
-	-mkdir -p $(PLUGINDIR)/include
-	for header in $(PLUGINHEADERS); do cp -p $(INCLUDEDIR)/$$header $(PLUGINDIR)/include || exit 1 ; done
-	for dir in molfile_plugin $(BUILDDIRS); do cd $$dir && $(MAKE) distrib && cd .. || exit 1 ; done
-
-include Make-arch
-
-molfilelibs:
-	cd molfile_plugin; $(MAKE) dynlibs && cd .. || exit 1
-	cd molfile_plugin; $(MAKE) staticlibs && cd .. || exit 1
-
-win32molfilelibs:
-	cd molfile_plugin; $(MAKE) dynlibs && cd .. || exit 1
-	cd molfile_plugin; $(MAKE) win32staticlibs && cd .. || exit 1
-
-dynlibs: molfilelibs
-	for dir in $(BUILDDIRS); do cd $$dir && $(MAKE) dynlibs && cd .. || exit 1 ; done
-
-staticlibs: molfilelibs
-	for dir in $(BUILDDIRS); do cd $$dir && $(MAKE) staticlibs && cd .. || exit 1 ; done
-
-win32staticlibs: win32molfilelibs
-	for dir in $(BUILDDIRS); do cd $$dir && $(MAKE) win32staticlibs && cd .. || exit 1 ; done
-
-bins:
-	for dir in molfile_plugin $(BUILDDIRS); do cd $$dir && $(MAKE) bins && cd .. || exit 1 ; done
-
-win32bins:
-	for dir in molfile_plugin $(BUILDDIRS); do cd $$dir && $(MAKE) win32bins && cd .. || exit 1 ; done
-
-clean:
-	find compile \( -name \*.o -o -name \*.a -o -name \*.so -o -name \*.exp -o -name \*.lib -o -name \*.h \) -print | xargs rm -f
-	find compile \( -name lib_\* \) -print | xargs rm -rf
-	rm -f log.*
-	rm -f molfile_plugin/so_locations
-
-checkperms:
-	@echo "Looking for bad file permissions..."
-	find . ! -perm +004
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/README b/pymolfile/molfile/vmd_molfile_plugins-clang/README
deleted file mode 100644
index 57d5187ce476e3844ae89fe645f9e974c6ed2eb8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/README
+++ /dev/null
@@ -1,43 +0,0 @@
-VMD Plugin README
------------------
-  This directory is the root of the plugin directory for VMD.  
-VMD plugins are designed to add new functionality and support for new types
-of files or external programs without compiling that functionality into the
-main body of VMD's code.  Most plugins take the form of a shared library 
-(files named xxx.so or xxx.dll) which can be detected by VMD and loaded at 
-run time.  The plugin and the application communicate through a well-defined 
-API, which makes the plugin more reusable by avoiding direct coupling to 
-VMD's internal data structures.  Similarly, plugins can be upgraded at
-any time, independent of VMD itself.
-
-For additional information on compiling the plugins and building VMD,
-please read the web-based plugin documentation here:
-  http://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/
-
-Plugin directory structure
---------------------------
-/_plugin: 
-  Directories that end in _plugin are plugin source repositories.  All 
-plugins of a given type (i.e., which use the same API) should be placed in the
-corresponding directory.  Each plugin directory contains the following 
-subdirectories:
- - src: source code for all plugins of that type;
- - msvc: Microsoft Visual Studio project files for each plugin;
- - doc: documentation for each plugin.
-The plugin directory also contains a Makefile for compiling all the plugins.
-The Makefile currently is for a gcc target only.
-
-/compile:
-  Contains compiled binary plugins, both static and dynamic, as well as
-related header files, etc. 
-
-/include: 
-  This directory contains the VMD plugin API header files, including
-vmdplugin.h (the base-level plugin header) as well as headers for other plugin
-types.  Alternatively, these files may be linked from the VMD source tree.
-
-/msvc: 
-  Contains a Microsoft Visual Studio workspace file for compiling all
-the plugins for the Win32 platform.
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin-s.o
deleted file mode 100644
index e63882aa42026ea9bc5d8b8ff67100b025519fc9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin.o
deleted file mode 100644
index ad1c085ed27d6387c88d24178650c7d4f89a7b04..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin.so
deleted file mode 100755
index 30d5ddc5dae0b93507558bea1276c2699ac215a6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/abinitplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin-s.o
deleted file mode 100644
index 2f57ebcf5a7f3b10060da9cdae7702d0975a13c1..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin.o
deleted file mode 100644
index 861efe19c236194fc651a241833ff4929f14c9b6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin.so
deleted file mode 100755
index d965e101a0e96efe1a9cbfef03ffcc5c3fe3137a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/avsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin-s.o
deleted file mode 100644
index 9fbace44cd585c4f42ac8777892827d9909f07db..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin.o
deleted file mode 100644
index b9baec76f428491cc29c9263a2da64befe2435b4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin.so
deleted file mode 100755
index f73537cc041d04ad4b5d5d6ae490768b3993997a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/babelplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin-s.o
deleted file mode 100644
index 0be909a693d5976ddee00f889b4b4083559e3ba9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin.o
deleted file mode 100644
index 5d7097ec3b8133b0b6be1272ef44f96d457aca24..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin.so
deleted file mode 100755
index d6639a30008202ab98e27d26b996222efb175750..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/basissetplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin-s.o
deleted file mode 100644
index 7907006c78cd9a98043233d13c07135b452ca982..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin.o
deleted file mode 100644
index b23399fe2ffbca5ece7b6a6c968c16a8793b072d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin.so
deleted file mode 100755
index 739041dd283c70b4f394f33f9a6ff9302fea47fa..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/bgfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin-s.o
deleted file mode 100644
index 9328dfb1de4d79960a44a3ff6e554f4ef597e412..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin.o
deleted file mode 100644
index 4e01fc05ddfb5728b85d8d998f02491c5e83459b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin.so
deleted file mode 100755
index 68c79977ab403efb29a317019c65020e1b3217a4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/binposplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin-s.o
deleted file mode 100644
index 4b5015e3e9260afc3bacceb5e8221e0ce302b2f9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin.o
deleted file mode 100644
index be4f09d26fcd46c17ec04720e4d839478a529198..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin.so
deleted file mode 100755
index e337b224f216f46a411d961188a51f0bb2021f46..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/biomoccaplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin-s.o
deleted file mode 100644
index 20c25fc1f3d5ff99ac0525f7b4cf6029f773b240..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin.o
deleted file mode 100644
index 87e9a3d4a1e4b5e8b1aa4bbecd2dd7c462c919d8..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin.so
deleted file mode 100755
index 00f131c345a50e97833f8f887c918a7ca9dafbc3..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/brixplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin-s.o
deleted file mode 100644
index da3ebfc8e0021dd4dc66a3bee026addd9388145c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin.o
deleted file mode 100644
index 8bffb8a31c8d23018eef5bde89cc411f1fa75b5d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin.so
deleted file mode 100755
index 4c4a01d482fedf3d2e0a5278cfcea6e3da46871e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/carplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin-s.o
deleted file mode 100644
index 63b5bc2fa7df563f91bae904641d4652c0182ae6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin.o
deleted file mode 100644
index 27b8c57c1afecab1f9ab3b7494b385a6cb2c6366..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin.so
deleted file mode 100755
index 02e1147cf622550777b24b43fbd34e86338bc516..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/ccp4plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin-s.o
deleted file mode 100644
index 34573d93af3773518ffb5a3e94054497f710983a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin.o
deleted file mode 100644
index 8fc15d4758b77a482e1b18d67a3fda69da31361c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin.so
deleted file mode 100755
index 9b22f32fc3bbedbb422f9689ea1f38adf30226d2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/corplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin-s.o
deleted file mode 100644
index c4f35a3230d9b770cc43e39e2e9f77fbde2c3e56..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin.o
deleted file mode 100644
index 0c1ca39e15cb8700057ef92367445d636f80de81..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin.so
deleted file mode 100755
index b91b0760db0d73e3927443c2d296bed34260b000..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cpmdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin-s.o
deleted file mode 100644
index 3256f52551ef4ae6a98fb86d95d820ebdd371264..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin.o
deleted file mode 100644
index c3f0fe7b2290caae4fd6b2218a9276bf41ee9d5c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin.so
deleted file mode 100755
index 3f3520137f3c9fb0b104f80379815acda1ade8f7..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/crdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin-s.o
deleted file mode 100644
index 843ede9a25c59a147d18d4d83af10fc305f0c0ec..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin.o
deleted file mode 100644
index 42aaff38d4b48e1daa5c17ac0eb1727a0d0f6f27..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin.so
deleted file mode 100755
index 15eef41a2077289db6e0ebf87a32ca4b926118b1..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/cubeplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin-s.o
deleted file mode 100644
index 140126dd85f95f19c2a4e3dcdbb658a640763506..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin.o
deleted file mode 100644
index ac2832c1bad81e311843b05f4f2fd6b4af82d05b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin.so
deleted file mode 100755
index cd6933e05d80d4b6382f280e53fc53a904450339..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dcdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin-s.o
deleted file mode 100644
index 8ee8b2f9d9be3ca84d3dce89a2a53c32d5c9c242..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin.o
deleted file mode 100644
index 43e7b8e4c4fcb4557a99d63839a1d1aa47890e44..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin.so
deleted file mode 100755
index 0ebcdc32da8cd1059cc8a1c632340cd6dff4fe2d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dlpolyplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin-s.o
deleted file mode 100644
index 14e292f10a3b6c025e9066c6c97366ba7f721c8a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin.o
deleted file mode 100644
index 8c3979ebb0b76ac4b092011234bb319f9e6f4beb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin.so
deleted file mode 100755
index c214c52d81c58f5dfa7d7de10c6ec24d4e48d826..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dsn6plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin-s.o
deleted file mode 100644
index a98d02fec77a33a6fc20f41d6d9402e08f6ea878..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin.o
deleted file mode 100644
index d5cd6ad302d9a7b534a7c38c6a8df7a4f13848e5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin.so
deleted file mode 100755
index 45776e1510de77375509e9e9397d97370c36145e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dtrplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin-s.o
deleted file mode 100644
index 94dbda9a07a7745cdc2a7cba09af400dbdf266f4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin.o
deleted file mode 100644
index f3c4512c9fd48bd14e6a5c381f3fc6332068be1c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin.so
deleted file mode 100755
index 00db3d6f0ef5fd1368be2fc4d37a8cf4a9f06acf..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/dxplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin-s.o
deleted file mode 100644
index aaf40518f8f0445844af88cd15bcaf54a28a9830..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin.o
deleted file mode 100644
index 87b6eedaad5d5de559dfd05b54ca034611de81e1..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin.so
deleted file mode 100755
index 3a883ecdeb2e4801ace7d3eab7658ff536f3b31d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/edmplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin-s.o
deleted file mode 100644
index 9e25129cc0e7b592172cdf905c904ea3034a9496..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin.o
deleted file mode 100644
index a0d889263c34495e168e247818581bbaa42421dc..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin.so
deleted file mode 100755
index 351a05ace79e9a583663f022e0061b1177c76806..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/fs4plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin-s.o
deleted file mode 100644
index 7ef2e0589316ec1defd093f5886f442ab21ebc9b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin.o
deleted file mode 100644
index 711a521866501db2acb840ce03a254384d2fb79d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin.so
deleted file mode 100755
index 1c3ee31f8017f7b87d390d9f0c9a30c8321548e5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gamessplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin-s.o
deleted file mode 100644
index 9b10414f5507a9a10635f5dcf315c3c2afd8b208..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin.o
deleted file mode 100644
index 8c1db6f820b348fd7de432e6257cb36669b43431..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin.so
deleted file mode 100755
index 5de9a73a8b81dea5854359967177f60a74d12496..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/graspplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin-s.o
deleted file mode 100644
index dd6893a451d5e373c2c90b7d6829eac82d4308d2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin.o
deleted file mode 100644
index 7baef5f1388ce66abd5d7bf6121ef41bdc060a31..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin.so
deleted file mode 100755
index 7128006bb48c4bed9ac3cefb81ee9cc10d3ce994..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/grdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin-s.o
deleted file mode 100644
index 45ad000770f416fdd8ea07a07e6237fc670294f5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin.o
deleted file mode 100644
index 770de466d6e4108e75d09e3fe48ef733b3aa7242..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin.so
deleted file mode 100755
index e65ff75b6a5f437350c807af45160ab9d84d33f1..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gridplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin-s.o
deleted file mode 100644
index b127abb405c44ca157c822124b74edee962ae42a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin.o
deleted file mode 100644
index b466d319d111cf2b08f5fa913fdc60ef607d649f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin.so
deleted file mode 100755
index 9bfec9184e0dfe1804ac3453ba2412bdcfe5c73e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/gromacsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin-s.o
deleted file mode 100644
index 0104e4824f34681b715153d9372b1e6453d2b202..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin.o
deleted file mode 100644
index 379bde65966d97a5312b7e0e5a00189fa7c74253..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin.so
deleted file mode 100755
index 121e7b33de20c72b3654d75d6d4a6d8e1255e1de..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/jsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin-s.o
deleted file mode 100644
index 36ec11f6457c4c7f5feb1eb077906269f863efcf..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin.o
deleted file mode 100644
index f40df555d6362a2a203882b05cdc9a386b7c8615..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin.so
deleted file mode 100755
index 843ca0120df1e3d40b445b0ff3d6edbd9d1dc843..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/lammpsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.a b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.a
deleted file mode 100644
index 83aeb16c114a05532be1581f2c9953bf8d743c68..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.a and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.dylib b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.dylib
deleted file mode 100755
index 552430c781785a97e23bf1681dcb11e4a3e2bcde..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.dylib and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.h b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.h
deleted file mode 100644
index 8c2fbe80bd14b3bc77ee489e1ca54a953e5e973d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/libmolfile_plugin.h
+++ /dev/null
@@ -1,409 +0,0 @@
-#ifndef LIBMOLFILE_PLUGIN_H
-#define LIBMOLFILE_PLUGIN_H
-#include "vmdplugin.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int molfile_abinitplugin_init(void);
-extern int molfile_abinitplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_abinitplugin_fini(void);
-extern int molfile_avsplugin_init(void);
-extern int molfile_avsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_avsplugin_fini(void);
-extern int molfile_babelplugin_init(void);
-extern int molfile_babelplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_babelplugin_fini(void);
-extern int molfile_basissetplugin_init(void);
-extern int molfile_basissetplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_basissetplugin_fini(void);
-extern int molfile_bgfplugin_init(void);
-extern int molfile_bgfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_bgfplugin_fini(void);
-extern int molfile_binposplugin_init(void);
-extern int molfile_binposplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_binposplugin_fini(void);
-extern int molfile_biomoccaplugin_init(void);
-extern int molfile_biomoccaplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_biomoccaplugin_fini(void);
-extern int molfile_brixplugin_init(void);
-extern int molfile_brixplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_brixplugin_fini(void);
-extern int molfile_carplugin_init(void);
-extern int molfile_carplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_carplugin_fini(void);
-extern int molfile_ccp4plugin_init(void);
-extern int molfile_ccp4plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_ccp4plugin_fini(void);
-extern int molfile_corplugin_init(void);
-extern int molfile_corplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_corplugin_fini(void);
-extern int molfile_cpmdplugin_init(void);
-extern int molfile_cpmdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_cpmdplugin_fini(void);
-extern int molfile_crdplugin_init(void);
-extern int molfile_crdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_crdplugin_fini(void);
-extern int molfile_cubeplugin_init(void);
-extern int molfile_cubeplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_cubeplugin_fini(void);
-extern int molfile_dcdplugin_init(void);
-extern int molfile_dcdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dcdplugin_fini(void);
-extern int molfile_dlpolyplugin_init(void);
-extern int molfile_dlpolyplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dlpolyplugin_fini(void);
-extern int molfile_dsn6plugin_init(void);
-extern int molfile_dsn6plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dsn6plugin_fini(void);
-extern int molfile_dxplugin_init(void);
-extern int molfile_dxplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dxplugin_fini(void);
-extern int molfile_edmplugin_init(void);
-extern int molfile_edmplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_edmplugin_fini(void);
-extern int molfile_fs4plugin_init(void);
-extern int molfile_fs4plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_fs4plugin_fini(void);
-extern int molfile_gamessplugin_init(void);
-extern int molfile_gamessplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_gamessplugin_fini(void);
-extern int molfile_graspplugin_init(void);
-extern int molfile_graspplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_graspplugin_fini(void);
-extern int molfile_grdplugin_init(void);
-extern int molfile_grdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_grdplugin_fini(void);
-extern int molfile_gridplugin_init(void);
-extern int molfile_gridplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_gridplugin_fini(void);
-extern int molfile_gromacsplugin_init(void);
-extern int molfile_gromacsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_gromacsplugin_fini(void);
-extern int molfile_jsplugin_init(void);
-extern int molfile_jsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_jsplugin_fini(void);
-extern int molfile_lammpsplugin_init(void);
-extern int molfile_lammpsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_lammpsplugin_fini(void);
-extern int molfile_mapplugin_init(void);
-extern int molfile_mapplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_mapplugin_fini(void);
-extern int molfile_mdfplugin_init(void);
-extern int molfile_mdfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_mdfplugin_fini(void);
-extern int molfile_mol2plugin_init(void);
-extern int molfile_mol2plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_mol2plugin_fini(void);
-extern int molfile_moldenplugin_init(void);
-extern int molfile_moldenplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_moldenplugin_fini(void);
-extern int molfile_molemeshplugin_init(void);
-extern int molfile_molemeshplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_molemeshplugin_fini(void);
-extern int molfile_msmsplugin_init(void);
-extern int molfile_msmsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_msmsplugin_fini(void);
-extern int molfile_namdbinplugin_init(void);
-extern int molfile_namdbinplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_namdbinplugin_fini(void);
-extern int molfile_offplugin_init(void);
-extern int molfile_offplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_offplugin_fini(void);
-extern int molfile_parm7plugin_init(void);
-extern int molfile_parm7plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_parm7plugin_fini(void);
-extern int molfile_parmplugin_init(void);
-extern int molfile_parmplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_parmplugin_fini(void);
-extern int molfile_pbeqplugin_init(void);
-extern int molfile_pbeqplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pbeqplugin_fini(void);
-extern int molfile_pdbplugin_init(void);
-extern int molfile_pdbplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pdbplugin_fini(void);
-extern int molfile_pdbxplugin_init(void);
-extern int molfile_pdbxplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pdbxplugin_fini(void);
-extern int molfile_phiplugin_init(void);
-extern int molfile_phiplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_phiplugin_fini(void);
-extern int molfile_pltplugin_init(void);
-extern int molfile_pltplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pltplugin_fini(void);
-extern int molfile_plyplugin_init(void);
-extern int molfile_plyplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_plyplugin_fini(void);
-extern int molfile_pqrplugin_init(void);
-extern int molfile_pqrplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pqrplugin_fini(void);
-extern int molfile_psfplugin_init(void);
-extern int molfile_psfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_psfplugin_fini(void);
-extern int molfile_raster3dplugin_init(void);
-extern int molfile_raster3dplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_raster3dplugin_fini(void);
-extern int molfile_rst7plugin_init(void);
-extern int molfile_rst7plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_rst7plugin_fini(void);
-extern int molfile_situsplugin_init(void);
-extern int molfile_situsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_situsplugin_fini(void);
-extern int molfile_spiderplugin_init(void);
-extern int molfile_spiderplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_spiderplugin_fini(void);
-extern int molfile_stlplugin_init(void);
-extern int molfile_stlplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_stlplugin_fini(void);
-extern int molfile_tinkerplugin_init(void);
-extern int molfile_tinkerplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_tinkerplugin_fini(void);
-extern int molfile_uhbdplugin_init(void);
-extern int molfile_uhbdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_uhbdplugin_fini(void);
-extern int molfile_vaspchgcarplugin_init(void);
-extern int molfile_vaspchgcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspchgcarplugin_fini(void);
-extern int molfile_vaspoutcarplugin_init(void);
-extern int molfile_vaspoutcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspoutcarplugin_fini(void);
-extern int molfile_vaspparchgplugin_init(void);
-extern int molfile_vaspparchgplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspparchgplugin_fini(void);
-extern int molfile_vaspposcarplugin_init(void);
-extern int molfile_vaspposcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspposcarplugin_fini(void);
-extern int molfile_vasp5xdatcarplugin_init(void);
-extern int molfile_vasp5xdatcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vasp5xdatcarplugin_fini(void);
-extern int molfile_vaspxdatcarplugin_init(void);
-extern int molfile_vaspxdatcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspxdatcarplugin_fini(void);
-extern int molfile_vaspxmlplugin_init(void);
-extern int molfile_vaspxmlplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspxmlplugin_fini(void);
-extern int molfile_vtkplugin_init(void);
-extern int molfile_vtkplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vtkplugin_fini(void);
-extern int molfile_xbgfplugin_init(void);
-extern int molfile_xbgfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_xbgfplugin_fini(void);
-extern int molfile_xsfplugin_init(void);
-extern int molfile_xsfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_xsfplugin_fini(void);
-extern int molfile_xyzplugin_init(void);
-extern int molfile_xyzplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_xyzplugin_fini(void);
-extern int molfile_dtrplugin_init(void);
-extern int molfile_dtrplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dtrplugin_fini(void);
-extern int molfile_maeffplugin_init(void);
-extern int molfile_maeffplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_maeffplugin_fini(void);
-
-#define MOLFILE_INIT_ALL \
-    molfile_abinitplugin_init(); \
-    molfile_avsplugin_init(); \
-    molfile_babelplugin_init(); \
-    molfile_basissetplugin_init(); \
-    molfile_bgfplugin_init(); \
-    molfile_binposplugin_init(); \
-    molfile_biomoccaplugin_init(); \
-    molfile_brixplugin_init(); \
-    molfile_carplugin_init(); \
-    molfile_ccp4plugin_init(); \
-    molfile_corplugin_init(); \
-    molfile_cpmdplugin_init(); \
-    molfile_crdplugin_init(); \
-    molfile_cubeplugin_init(); \
-    molfile_dcdplugin_init(); \
-    molfile_dlpolyplugin_init(); \
-    molfile_dsn6plugin_init(); \
-    molfile_dxplugin_init(); \
-    molfile_edmplugin_init(); \
-    molfile_fs4plugin_init(); \
-    molfile_gamessplugin_init(); \
-    molfile_graspplugin_init(); \
-    molfile_grdplugin_init(); \
-    molfile_gridplugin_init(); \
-    molfile_gromacsplugin_init(); \
-    molfile_jsplugin_init(); \
-    molfile_lammpsplugin_init(); \
-    molfile_mapplugin_init(); \
-    molfile_mdfplugin_init(); \
-    molfile_mol2plugin_init(); \
-    molfile_moldenplugin_init(); \
-    molfile_molemeshplugin_init(); \
-    molfile_msmsplugin_init(); \
-    molfile_namdbinplugin_init(); \
-    molfile_offplugin_init(); \
-    molfile_parm7plugin_init(); \
-    molfile_parmplugin_init(); \
-    molfile_pbeqplugin_init(); \
-    molfile_pdbplugin_init(); \
-    molfile_pdbxplugin_init(); \
-    molfile_phiplugin_init(); \
-    molfile_pltplugin_init(); \
-    molfile_plyplugin_init(); \
-    molfile_pqrplugin_init(); \
-    molfile_psfplugin_init(); \
-    molfile_raster3dplugin_init(); \
-    molfile_rst7plugin_init(); \
-    molfile_situsplugin_init(); \
-    molfile_spiderplugin_init(); \
-    molfile_stlplugin_init(); \
-    molfile_tinkerplugin_init(); \
-    molfile_uhbdplugin_init(); \
-    molfile_vaspchgcarplugin_init(); \
-    molfile_vaspoutcarplugin_init(); \
-    molfile_vaspparchgplugin_init(); \
-    molfile_vaspposcarplugin_init(); \
-    molfile_vasp5xdatcarplugin_init(); \
-    molfile_vaspxdatcarplugin_init(); \
-    molfile_vaspxmlplugin_init(); \
-    molfile_vtkplugin_init(); \
-    molfile_xbgfplugin_init(); \
-    molfile_xsfplugin_init(); \
-    molfile_xyzplugin_init(); \
-    molfile_dtrplugin_init(); \
-    molfile_maeffplugin_init(); \
-
-#define MOLFILE_REGISTER_ALL(v, cb) \
-    molfile_abinitplugin_register(v, cb); \
-    molfile_avsplugin_register(v, cb); \
-    molfile_babelplugin_register(v, cb); \
-    molfile_basissetplugin_register(v, cb); \
-    molfile_bgfplugin_register(v, cb); \
-    molfile_binposplugin_register(v, cb); \
-    molfile_biomoccaplugin_register(v, cb); \
-    molfile_brixplugin_register(v, cb); \
-    molfile_carplugin_register(v, cb); \
-    molfile_ccp4plugin_register(v, cb); \
-    molfile_corplugin_register(v, cb); \
-    molfile_cpmdplugin_register(v, cb); \
-    molfile_crdplugin_register(v, cb); \
-    molfile_cubeplugin_register(v, cb); \
-    molfile_dcdplugin_register(v, cb); \
-    molfile_dlpolyplugin_register(v, cb); \
-    molfile_dsn6plugin_register(v, cb); \
-    molfile_dxplugin_register(v, cb); \
-    molfile_edmplugin_register(v, cb); \
-    molfile_fs4plugin_register(v, cb); \
-    molfile_gamessplugin_register(v, cb); \
-    molfile_graspplugin_register(v, cb); \
-    molfile_grdplugin_register(v, cb); \
-    molfile_gridplugin_register(v, cb); \
-    molfile_gromacsplugin_register(v, cb); \
-    molfile_jsplugin_register(v, cb); \
-    molfile_lammpsplugin_register(v, cb); \
-    molfile_mapplugin_register(v, cb); \
-    molfile_mdfplugin_register(v, cb); \
-    molfile_mol2plugin_register(v, cb); \
-    molfile_moldenplugin_register(v, cb); \
-    molfile_molemeshplugin_register(v, cb); \
-    molfile_msmsplugin_register(v, cb); \
-    molfile_namdbinplugin_register(v, cb); \
-    molfile_offplugin_register(v, cb); \
-    molfile_parm7plugin_register(v, cb); \
-    molfile_parmplugin_register(v, cb); \
-    molfile_pbeqplugin_register(v, cb); \
-    molfile_pdbplugin_register(v, cb); \
-    molfile_pdbxplugin_register(v, cb); \
-    molfile_phiplugin_register(v, cb); \
-    molfile_pltplugin_register(v, cb); \
-    molfile_plyplugin_register(v, cb); \
-    molfile_pqrplugin_register(v, cb); \
-    molfile_psfplugin_register(v, cb); \
-    molfile_raster3dplugin_register(v, cb); \
-    molfile_rst7plugin_register(v, cb); \
-    molfile_situsplugin_register(v, cb); \
-    molfile_spiderplugin_register(v, cb); \
-    molfile_stlplugin_register(v, cb); \
-    molfile_tinkerplugin_register(v, cb); \
-    molfile_uhbdplugin_register(v, cb); \
-    molfile_vaspchgcarplugin_register(v, cb); \
-    molfile_vaspoutcarplugin_register(v, cb); \
-    molfile_vaspparchgplugin_register(v, cb); \
-    molfile_vaspposcarplugin_register(v, cb); \
-    molfile_vasp5xdatcarplugin_register(v, cb); \
-    molfile_vaspxdatcarplugin_register(v, cb); \
-    molfile_vaspxmlplugin_register(v, cb); \
-    molfile_vtkplugin_register(v, cb); \
-    molfile_xbgfplugin_register(v, cb); \
-    molfile_xsfplugin_register(v, cb); \
-    molfile_xyzplugin_register(v, cb); \
-    molfile_dtrplugin_register(v, cb); \
-    molfile_maeffplugin_register(v, cb); \
-
-#define MOLFILE_FINI_ALL \
-    molfile_abinitplugin_fini(); \
-    molfile_avsplugin_fini(); \
-    molfile_babelplugin_fini(); \
-    molfile_basissetplugin_fini(); \
-    molfile_bgfplugin_fini(); \
-    molfile_binposplugin_fini(); \
-    molfile_biomoccaplugin_fini(); \
-    molfile_brixplugin_fini(); \
-    molfile_carplugin_fini(); \
-    molfile_ccp4plugin_fini(); \
-    molfile_corplugin_fini(); \
-    molfile_cpmdplugin_fini(); \
-    molfile_crdplugin_fini(); \
-    molfile_cubeplugin_fini(); \
-    molfile_dcdplugin_fini(); \
-    molfile_dlpolyplugin_fini(); \
-    molfile_dsn6plugin_fini(); \
-    molfile_dxplugin_fini(); \
-    molfile_edmplugin_fini(); \
-    molfile_fs4plugin_fini(); \
-    molfile_gamessplugin_fini(); \
-    molfile_graspplugin_fini(); \
-    molfile_grdplugin_fini(); \
-    molfile_gridplugin_fini(); \
-    molfile_gromacsplugin_fini(); \
-    molfile_jsplugin_fini(); \
-    molfile_lammpsplugin_fini(); \
-    molfile_mapplugin_fini(); \
-    molfile_mdfplugin_fini(); \
-    molfile_mol2plugin_fini(); \
-    molfile_moldenplugin_fini(); \
-    molfile_molemeshplugin_fini(); \
-    molfile_msmsplugin_fini(); \
-    molfile_namdbinplugin_fini(); \
-    molfile_offplugin_fini(); \
-    molfile_parm7plugin_fini(); \
-    molfile_parmplugin_fini(); \
-    molfile_pbeqplugin_fini(); \
-    molfile_pdbplugin_fini(); \
-    molfile_pdbxplugin_fini(); \
-    molfile_phiplugin_fini(); \
-    molfile_pltplugin_fini(); \
-    molfile_plyplugin_fini(); \
-    molfile_pqrplugin_fini(); \
-    molfile_psfplugin_fini(); \
-    molfile_raster3dplugin_fini(); \
-    molfile_rst7plugin_fini(); \
-    molfile_situsplugin_fini(); \
-    molfile_spiderplugin_fini(); \
-    molfile_stlplugin_fini(); \
-    molfile_tinkerplugin_fini(); \
-    molfile_uhbdplugin_fini(); \
-    molfile_vaspchgcarplugin_fini(); \
-    molfile_vaspoutcarplugin_fini(); \
-    molfile_vaspparchgplugin_fini(); \
-    molfile_vaspposcarplugin_fini(); \
-    molfile_vasp5xdatcarplugin_fini(); \
-    molfile_vaspxdatcarplugin_fini(); \
-    molfile_vaspxmlplugin_fini(); \
-    molfile_vtkplugin_fini(); \
-    molfile_xbgfplugin_fini(); \
-    molfile_xsfplugin_fini(); \
-    molfile_xyzplugin_fini(); \
-    molfile_dtrplugin_fini(); \
-    molfile_maeffplugin_fini(); \
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin-s.o
deleted file mode 100644
index 97d8137b3394f2f199d1038df7ec4e829fbe6674..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin.o
deleted file mode 100644
index 992843b22114b8d9339c61f73f48a96fb1e32c9a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin.so
deleted file mode 100755
index d4ae7e268c5c2ccc9a6f5e0982854290fe3b3e9a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/maeffplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin-s.o
deleted file mode 100644
index c9ff944b24c9a000cce5f3290926f368fa529c2a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin.o
deleted file mode 100644
index b39d41458548d9f0b82717f7dbfefbdfbb83e1a5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin.so
deleted file mode 100755
index fb5e862694ccb31bb360d09df8453244d0c108eb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mapplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin-s.o
deleted file mode 100644
index a76a696ff57795044b60b2cbac94a96298336486..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin.o
deleted file mode 100644
index f01fc37a0ea3a80a90b7dfa8b90a343165c79aef..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin.so
deleted file mode 100755
index 4c3b6ca7da0e9f29f81e77b6aae7b05a1351afff..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mdfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin-s.o
deleted file mode 100644
index cb4c8341450daa80ad9c6fbfc05ff8f9b7bee4f5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin.o
deleted file mode 100644
index 51657d6159abd7d7871c73c8277362b91a648866..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin.so
deleted file mode 100755
index d27d63e330eeba5bfbf46ff4c605107db792fdde..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/mol2plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin-s.o
deleted file mode 100644
index b3159c9c3707ed847d52ec003b02b2abd5e3ab8f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin.o
deleted file mode 100644
index 5761a5bcbddb639db92895b22bde76add6ec041e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin.so
deleted file mode 100755
index e28c36843135cc9b27e9c8f8805d9bce09ad51ed..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/moldenplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin-s.o
deleted file mode 100644
index db7565f466be6768a4711593a18c3546ed3a8d0f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin.o
deleted file mode 100644
index 2fa3ef6cb4996afd0263b20cb7e9f41a4bf0db26..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin.so
deleted file mode 100755
index 83a265c6695b80a4c70bb392c8e3648c182103e4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/molemeshplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin-s.o
deleted file mode 100644
index 329b0d57ccba0e1fbe0f8b39a629b7f9c4f17ee2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin.o
deleted file mode 100644
index 0a0bcaa29378d16717bbc1ea4d6bcbb072a8cc59..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin.so
deleted file mode 100755
index 583acc612ba83e63720f2e68b8822ffc1b20f5e8..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/msmsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin-s.o
deleted file mode 100644
index e70a760684b3dc1c1f0dda79ee944895bddf4e85..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin.o
deleted file mode 100644
index d1b5d87067cb0a80f7b98db2da600e838ebd5529..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin.so
deleted file mode 100755
index c9de9cc017f7094ea2d31151e9f14f2c338a5f16..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/namdbinplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin-s.o
deleted file mode 100644
index 64e0e586d873250df066502d4dced25b8bf1cfbc..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin.o
deleted file mode 100644
index f4c2ea28088cce82466a13b1dab5661357b30a55..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin.so
deleted file mode 100755
index 12aa1363192304173000dbf8762c335fa10f9dff..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/offplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin-s.o
deleted file mode 100644
index 4c41f6e50c3d707d23c18c316ba7a533915126eb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin.o
deleted file mode 100644
index 00c83d673a97e4de110db3c3ecd93b50a7e40e80..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin.so
deleted file mode 100755
index 2fd696c9da32a106546699b528361719562f736e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parm7plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin-s.o
deleted file mode 100644
index f246dff8b8c03d36a1ea031b42a91a632a48272e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin.o
deleted file mode 100644
index 034c80faa678e1c4e05a34cbbd032b0e1dac5ede..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin.so
deleted file mode 100755
index f8d2c569b2ce73e1ab6863895619b99f65728e61..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/parmplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin-s.o
deleted file mode 100644
index ccbb7add7c102bb0ebf597ff3abd7d845299ef05..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin.o
deleted file mode 100644
index 46c41887e1774915d3699be126b68adc5590d88c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin.so
deleted file mode 100755
index e12d3f2d81bf66d642c8cd897a8bb4aa0922b0e0..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pbeqplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin-s.o
deleted file mode 100644
index 492177f5c2d92e936c30c30f1a48f02cf7096b8c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin.o
deleted file mode 100644
index efaac24639f04b0c8cb979a4128bbd235890136e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin.so
deleted file mode 100755
index 2ffb850b04ebb5afe2c057d701324f1440e4d478..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin-s.o
deleted file mode 100644
index 2022d35009baaad24bc66879f8d68c8a5a8640ea..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin.o
deleted file mode 100644
index 7c8cafe48c906ea1f936fe9c806d053566d183fb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin.so
deleted file mode 100755
index c0e8028a7496060136cbd37b17abe2d34d6a2f50..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pdbxplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin-s.o
deleted file mode 100644
index 361ac50197763456a1ef59e29edb1bb6df6ea606..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin.o
deleted file mode 100644
index 6c25b7aa59f714e9af0bd5edd363df0fc8b2582c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin.so
deleted file mode 100755
index f65891925666b0ef414f479f797e0191a28e1526..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/phiplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin-s.o
deleted file mode 100644
index 6deb824918a8470c97b4b32cb93b8e869ea9e18e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin.o
deleted file mode 100644
index 618f03f19d88edaf604d8b5c1c59e931a5c9cfcf..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin.so
deleted file mode 100755
index f2d5743392c99ac4a05b31d8460ac20511192967..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pltplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin-s.o
deleted file mode 100644
index 3eddd2f7866845d732154183b66ef978472fb0c9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin.o
deleted file mode 100644
index 1d9332b2d6ea662407035b19681e4bcee9614c8b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin.so
deleted file mode 100755
index f1c127676c6af03f3d05e2900575f3784fa14f5f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/plyplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin-s.o
deleted file mode 100644
index 18e8c64c8b76780e202a6be3c6ea034c6e003384..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin.o
deleted file mode 100644
index 67276190c0e29e56b74bb3863487a5a7920836a1..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin.so
deleted file mode 100755
index 4dbf0c73cb307eaa89f31998540bf6bb847ea237..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/pqrplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin-s.o
deleted file mode 100644
index 7e7f93caa4abbc18937ee5d915115601dacd9d2e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin.o
deleted file mode 100644
index 410b8cedc33064a012152209f5cc10de25de4a05..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin.so
deleted file mode 100755
index 377f830c1f6894776cf26d5415873c8dfe2327ea..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/psfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin-s.o
deleted file mode 100644
index 696eb44d37cf8abef24a05444ce7b4ac9f07b972..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin.o
deleted file mode 100644
index 751e64433c3f07e53d87d495f09f6662d0e470b5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin.so
deleted file mode 100755
index cb626043696773609167d721ba44bbb028bdf985..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/raster3dplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin-s.o
deleted file mode 100644
index 639730de11d2c453c4fad42f027d725e86beeb34..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin.o
deleted file mode 100644
index fef914cc55b374852ecbe5033ac777afda18cda9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin.so
deleted file mode 100755
index 6b8e0ef8357e2688b550d908601721bf0dad30a7..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/rst7plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin-s.o
deleted file mode 100644
index b43288b348b0a6b43ad8db8ecf31e80923db3b81..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin.o
deleted file mode 100644
index 96b38468f677f0f1263520af6ac839987611ac1c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin.so
deleted file mode 100755
index 43bea6ab112214bbd6b548ab006b8c4730a38c65..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/situsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin-s.o
deleted file mode 100644
index 0053b44bf7df82fe0bea1fb2ca2d43f2c8324fe9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin.o
deleted file mode 100644
index d0b67f3ed32d584ed51f5e12bb1a11fa2a2a200a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin.so
deleted file mode 100755
index 4cda333adab29d8728d8ccbf4242d3a2194732a7..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/spiderplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin-s.o
deleted file mode 100644
index f6386ffa913ff604580d9cb2db858412fb1183f2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin.o
deleted file mode 100644
index af0e3d69baa243d7472f8b2dfe549db8e4c962b7..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin.so
deleted file mode 100755
index 45a6f9c631124a9cd063ac0ff85b93e9a703eaae..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/stlplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin-s.o
deleted file mode 100644
index d30d2d7cc3ad765c8f1708112974c2f5dd51b712..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin.o
deleted file mode 100644
index 2f6437d5fe5071c9e1407260198e8f0e885328bd..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin.so
deleted file mode 100755
index 1bd838cbfc1c504b266363f44c7c1badbe14ac43..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/tinkerplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin-s.o
deleted file mode 100644
index 28ef3011e264b218404b5a3ce76239d7ba9e9d97..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin.o
deleted file mode 100644
index 7858605049739650777e90414167bd9d750398e0..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin.so
deleted file mode 100755
index 9eb6aefe2c2393ad3000a70bde773a9493de499d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/uhbdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin-s.o
deleted file mode 100644
index 10161348795ede676af7206de430650b7b87b5d0..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin.o
deleted file mode 100644
index 6abfcfb728a87ff3ba5b16c9f069a26ce32c310d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin.so
deleted file mode 100755
index 07cf79f8c25e125117a1e77c2036c2976f3c5fbc..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vasp5xdatcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin-s.o
deleted file mode 100644
index 536574bf57c26f94bef7a9d24a158d67f442b3bc..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin.o
deleted file mode 100644
index 509365977200b377fdf4cb529d0124b82e8b946c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin.so
deleted file mode 100755
index f43eb575008fcf8e5b82b9472cdd1a0d1fa9a5f4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspchgcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin-s.o
deleted file mode 100644
index d0918b87b1a6b592024914835961763f6ea22980..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin.o
deleted file mode 100644
index 6a42b4d7fbd5322e2e379583401c8fd94d8ca43f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin.so
deleted file mode 100755
index 6930f672d9b1e89b67384eb03e7efda97d08c889..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspoutcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin-s.o
deleted file mode 100644
index 383a4a89108dc02cc0787a52fe0ba2452d8bd109..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin.o
deleted file mode 100644
index cb789dd6a96357b4f36d03cbb1fd6823308b8950..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin.so
deleted file mode 100755
index b48a2fc5c2e66a4eb1ef87a6d6524a4acbd47b4d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspparchgplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin-s.o
deleted file mode 100644
index 01c6dd01143b4dafe544506e06365b43794dc89c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin.o
deleted file mode 100644
index 585e7fe5edfe97184299b9cf8ea713ce934cf4a5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin.so
deleted file mode 100755
index 1e2622857f927849b5d6ea1216648bc04b5d0203..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspposcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin-s.o
deleted file mode 100644
index eac8aa9db58e2a78411828de445d4e8bb10c23f1..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin.o
deleted file mode 100644
index 93078e9c707a413f34c328fd5d90b3529f27cb97..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin.so
deleted file mode 100755
index 3c9fb551f0e1ab19b813650ccf7295187835cb19..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxdatcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin-s.o
deleted file mode 100644
index d6c62b2a0f13d33a5ffce537a03147ac62c3afac..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin.o
deleted file mode 100644
index 0bf5f8fce9b7f1d1bbbfd0ec78eeea5dd8043fab..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin.so
deleted file mode 100755
index 238804205a5fa08e9db8f21b21e48e95b614519a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vaspxmlplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin-s.o
deleted file mode 100644
index 24513cf9adf895fcc44a267cf29e05c30881bfb9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin.o
deleted file mode 100644
index b97b7802498411009535fe15ef16ea6d3dc517f9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin.so
deleted file mode 100755
index ced8577b2040ee8bd9ea295a26a8882a5860bbc4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/vtkplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin-s.o
deleted file mode 100644
index 2c6a5dbaed7c9353c19f53985abb8e7d175eed42..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin.o
deleted file mode 100644
index b29568ac4d34a2cdac123dcac9b28d49bd9072b9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin.so
deleted file mode 100755
index 504df400db34a44a61014f0470c2c9a08772ec6e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xbgfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin-s.o
deleted file mode 100644
index e57d72f83e9bc28659b3edd2c8e4663e05453b59..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin.o
deleted file mode 100644
index 83ce008d055b3dedbb7558bedfeac9ba14981fac..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin.so
deleted file mode 100755
index 6a512925b02e14ebde864127807f1bd3e352af27..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xsfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin-s.o
deleted file mode 100644
index 2720e6e6293754b6ccbc90b11b35de209b669e0c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin.o b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin.o
deleted file mode 100644
index 92a7a0312cf0fada37d7a40e69d45ae23ca9deea..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin.so b/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin.so
deleted file mode 100755
index 78465b989687147fe82006bdecb351cb6dcf3a51..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/compile/lib_MACOSXX86_64/molfile/xyzplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/create_static_header.sh b/pymolfile/molfile/vmd_molfile_plugins-clang/create_static_header.sh
deleted file mode 100755
index 459701651f3a40863ab8656e0059eee21b762dd7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/create_static_header.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-# Script for creating header file for static libraries
-
-libname=$1
-shift
-prefix=$1
-shift
-target=$1
-shift
-plugins=$*
-
-#
-# boilerplate header
-#
-echo "#ifndef LIB${libname}_PLUGIN_H" >> $target
-echo "#define LIB${libname}_PLUGIN_H" >> $target
-
-#
-# include the generic vmd plugin header
-#
-echo "#include \"vmdplugin.h\"" >> $target
-echo "" >> $target
-
-#
-# all plugin API's are extern "C".
-#
-echo "#ifdef __cplusplus" >> $target
-echo "extern \"C\" {" >> $target
-echo "#endif" >> $target
-echo "" >> $target
-
-#
-# Function declarations
-#
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "extern int ${prefix}_${p}_init(void);" >> $target
-  echo "extern int ${prefix}_${p}_register(void *, vmdplugin_register_cb);" >> $target
-  echo "extern int ${prefix}_${p}_fini(void);" >> $target
-done
-echo "" >> $target
-
-# macros for init, register, fini
-echo "#define ${libname}_INIT_ALL \\" >> $target
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "    ${prefix}_${p}_init(); \\" >> $target
-done
-echo "" >> $target
-
-echo "#define ${libname}_REGISTER_ALL(v, cb) \\" >> $target
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "    ${prefix}_${p}_register(v, cb); \\" >> $target
-done
-echo "" >> $target
-
-echo "#define ${libname}_FINI_ALL \\" >> $target
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "    ${prefix}_${p}_fini(); \\" >> $target
-done
-echo "" >> $target
-
-#
-# wrap it up
-#
-echo "#ifdef __cplusplus" >> $target
-echo "}" >> $target
-echo "#endif" >> $target
-echo "#endif" >> $target
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Entries
deleted file mode 100644
index f6167d7cd0bd8276919a0c93d64277aa886a8fd8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Entries
+++ /dev/null
@@ -1,5 +0,0 @@
-/import_graphics_plugin.h/1.5/Fri Sep 21 19:43:10 2007//
-/vmdconio.h/1.4/Sun Oct 11 22:36:27 2015//
-/vmdplugin.h/1.33/Thu Oct 29 05:10:54 2015//
-/molfile_plugin.h/1.108/Fri Feb 26 03:17:01 2016//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Repository
deleted file mode 100644
index 5532d96ba52478c2594be1c6cf75840ad026d0a8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/include
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/include/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/include/import_graphics_plugin.h b/pymolfile/molfile/vmd_molfile_plugins-clang/include/import_graphics_plugin.h
deleted file mode 100644
index 78ead23942fae14a3aa1882eb2d66901c902a352..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/include/import_graphics_plugin.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2006 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: import_graphics_plugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.5 $       $Date: 2006/04/25 21:32:05 $
- *
- ***************************************************************************/
-
-#ifndef IMPORT_GRAPHICS_PLUGIN_H
-#define IMPORT_GRAPHICS_PLUGIN_H
-
-/* 
- * API for C extensions to define a way to import low-level graphics primitives 
- */ 
-
-#include "vmdplugin.h"
-
-/*
- * Define a common plugin type to be used when registering the plugin.
- */
-#define IMPORT_GRAPHICS_PLUGIN_TYPE "import graphics"
-
-typedef enum {
-	IMPORT_GRAPHICS_LINE_SOLID, IMPORT_GRAPHICS_LINE_DASHED
-} import_graphics_linestyle_t;
-
-/* 
- * Application-provided callbacks for specifying graphics primitives.  
- * Items must be maintained in order by the application for the purpose of 
- * coloring; see below.
- */
-typedef struct {
-
-  /*
-   * Draw a point at the specified location in 3-D space.
-   */
-  int (* add_point)(void *, const float *x);
-  int (* add_triangle)(void *, const float *x1, const float *x2, const float *x3);
-  int (* add_trinorm)(void *, const float *x1, const float *x2, const float *x3,
-		 const float *n1, const float *n2, const float *n3);
-  int (* add_line)(void *, const float *x, const float *y, int line_style, 
-		  int width); 
-  int (* add_cylinder)(void *, const float *x, const float *y, float radius,
-		  int resolution, int filled);
-  int (* add_sphere)(void *, const float *x, float rad, int resolution);
-  int (* add_text)(void *, const float *x, const char *text, float size);
-  /*
-   * Color to use for subsequent primitives.  If primitives are added before
-   * any call to use_color, the application is free to do whatever it likes.
-   */
-  int (* use_color)(void *, float r, float g, float b);
-
-  /*
-   * Indicate whether the set of primitives is to be lit or not.  Either all
-   * or none of the primitives will be lit.
-   */ 
-  int (* use_materials)(void *, int yes_no);
-} import_graphics_cb_t;
-
-
-/*
- * Main file reader API begins here.  Any function in this struct may be NULL
- * if not implemented by the plugin; the application checks this to determine
- * what functionality is present in the plugin. 
- */ 
-typedef struct {
-  /*
-   * Required header
-   */
-  vmdplugin_HEAD
-
-  /*
-   * Filename extension for this file type.  May be NULL if no filename 
-   * extension exists and/or is known.
-   */
-  const char *filename_extension;
-
-  /* 
-   * Try to open the file for reading.  Return an opaque handle, or NULL on
-   * failure. filetype should be the name under which this plugin was 
-   * registered; this is provided so that plugins can provide the same 
-   * function pointer * to handle multiple file types.
-   */
-  void *(* open_file_read)(const char *filepath, const char *filetype); 
-  
-  /*
-   * Read data and return it to the application in the supplied
-   * callbacks.  The first void * is an opaque application handle which 
-   * should be passed to all the callbacks in import_cb_t.  The second 
-   * void * is the plugin handle returned by open_file_read.  
-   */
-  int (* read_data)(void *, void *mydata, import_graphics_cb_t *);
-
-  /* 
-   * Close the file and release all data.  The handle cannot be reused.
-   */
-  void (* close_file_read)(void *);
-
-} import_graphics_plugin_t;
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/include/molfile_plugin.h b/pymolfile/molfile/vmd_molfile_plugins-clang/include/molfile_plugin.h
deleted file mode 100644
index 714b06539fb061dd73b3575fdf68e881508c91ec..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/include/molfile_plugin.h
+++ /dev/null
@@ -1,903 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2006 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: molfile_plugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.108 $       $Date: 2016/02/26 03:17:01 $
- *
- ***************************************************************************/
-
-/** @file 
- * API for C extensions to define a way to load structure, coordinate,
- * trajectory, and volumetric data files  
- */ 
-
-#ifndef MOL_FILE_PLUGIN_H
-#define MOL_FILE_PLUGIN_H
-
-#include "vmdplugin.h"
-
-#if defined(DESRES_READ_TIMESTEP2)
-/* includes needed for large integer types used for frame counts */
-#include <sys/types.h>
-typedef ssize_t molfile_ssize_t;      /**< for frame counts */
-#endif
-
-/**
- * Define a common plugin type to be used when registering the plugin.
- */
-#define MOLFILE_PLUGIN_TYPE "mol file reader"
-
-/**
- * File converter plugins use the same API  but register under a different
- * type so that regular file readers can have priority.
- */
-#define MOLFILE_CONVERTER_PLUGIN_TYPE "mol file converter"
-
-/* File plugin symbolic constants for better code readability */
-#define MOLFILE_SUCCESS           0   /**< succeeded in reading file      */
-#define MOLFILE_EOF              -1   /**< end of file                    */
-#define MOLFILE_ERROR            -1   /**< error reading/opening a file   */
-#define MOLFILE_NOSTRUCTUREDATA  -2   /**< no structure data in this file */
-
-#define MOLFILE_NUMATOMS_UNKNOWN -1   /**< unknown number of atoms       */
-#define MOLFILE_NUMATOMS_NONE     0   /**< no atoms in this file type    */
-
-/**
- * Maximum string size macro
- */
-#define MOLFILE_BUFSIZ           81   /**< maximum chars in string data  */
-#define MOLFILE_BIGBUFSIZ        4096 /**< maximum chars in long strings */
-
-#define MOLFILE_MAXWAVEPERTS     25   /**< maximum number of wavefunctions
-                                       *   per timestep */
-
-/**
- * Hard-coded direct-I/O page size constants for use by both VMD
- * and the plugins that want to use direct, unbuffered I/O for high
- * performance with SSDs etc.  We use two constants to define the 
- * range of hardware page sizes that we can support, so that we can 
- * add support for larger 8KB or 16KB page sizes in the future 
- * as they become more prevalent in high-end storage systems.
- *
- * At present, VMD uses a hard-coded 4KB page size to reduce memory
- * fragmentation, but these constants will make it easier to enable the
- * use of larger page sizes in the future if it becomes necessary.
- */
-#define MOLFILE_DIRECTIO_MIN_BLOCK_SIZE 4096
-#define MOLFILE_DIRECTIO_MAX_BLOCK_SIZE 4096
-
-
-/**
- * File level comments, origin information, and annotations.
- */
-typedef struct {
-  char database[81];   /**< database of origin, if any        */
-  char accession[81];  /**< database accession code, if any   */
-  char date[81];       /**< date/time stamp for this data     */
-  char title[81];      /**< brief title for this data         */
-  int remarklen;       /**< length of remarks string          */
-  char *remarks;       /**< free-form remarks about data      */
-} molfile_metadata_t;
-
-
-/* 
- * Struct for specifying atoms in a molecular structure.  The first 
- * six components are required, the rest are optional and their presence is 
- * indicating by setting the corresponding bit in optsflag.  When omitted,
- * the application (for read_structure) or plugin (for write_structure) 
- * must be able to supply default values if the missing parameters are 
- * part of its internal data structure.
- * Note that it is not possible to specify coordinates with this structure.
- * This is intentional; all coordinate I/O is done with the read_timestep and 
- * write_timestep functions. 
- */
-
-/**
- * Per-atom attributes and information.
- */
-typedef struct {
-  /* these fields absolutely must be set or initialized to empty */
-  char name[16];      /**< required atom name string             */
-  char type[16];      /**< required atom type string             */
-  char resname[8];    /**< required residue name string          */
-  int resid;          /**< required integer residue ID           */
-  char segid[8];      /**< required segment name string, or ""   */
-#if 0 && vmdplugin_ABIVERSION > 17
-  /* The new PDB file formats allows for much larger structures, */
-  /* which can therefore require longer chain ID strings.  The   */
-  /* new PDBx/mmCIF file formats do not have length limits on    */
-  /* fields, so PDB chains could be arbitrarily long strings     */
-  /* in such files.  At present, we know we need at least 3-char */
-  /* chains for existing PDBx/mmCIF files.                       */
-  char chain[4];      /**< required chain name, or ""            */
-#else
-  char chain[2];      /**< required chain name, or ""            */
-#endif
-  /* rest are optional; use optflags to specify what's present   */
-  char altloc[2];     /**< optional PDB alternate location code  */
-  char insertion[2];  /**< optional PDB insertion code           */
-  float occupancy;    /**< optional occupancy value              */
-  float bfactor;      /**< optional B-factor value               */
-  float mass;         /**< optional mass value                   */
-  float charge;       /**< optional charge value                 */
-  float radius;       /**< optional radius value                 */
-  int atomicnumber;   /**< optional element atomic number        */
-
-#if 0
-  char complex[16];
-  char assembly[16];
-  int qmregion;
-  int qmregionlink;
-  int qmlayer;
-  int qmlayerlink;
-  int qmfrag;
-  int qmfraglink;
-  string qmecp;
-  int qmadapt;
-  int qmect;          /**< boolean */
-  int qmparam;
-  int autoparam;
-#endif
-
-#if defined(DESRES_CTNUMBER)
-  int ctnumber;       /**< mae ct block, 0-based, including meta */
-#endif
-} molfile_atom_t;
-
-/*@{*/
-/** Plugin optional data field availability flag */
-#define MOLFILE_NOOPTIONS     0x0000 /**< no optional data                 */
-#define MOLFILE_INSERTION     0x0001 /**< insertion codes provided         */
-#define MOLFILE_OCCUPANCY     0x0002 /**< occupancy data provided          */
-#define MOLFILE_BFACTOR       0x0004 /**< B-factor data provided           */
-#define MOLFILE_MASS          0x0008 /**< Atomic mass provided             */
-#define MOLFILE_CHARGE        0x0010 /**< Atomic charge provided           */
-#define MOLFILE_RADIUS        0x0020 /**< Atomic VDW radius provided       */
-#define MOLFILE_ALTLOC        0x0040 /**< Multiple conformations present   */
-#define MOLFILE_ATOMICNUMBER  0x0080 /**< Atomic element number provided   */
-#define MOLFILE_BONDSSPECIAL  0x0100 /**< Only non-standard bonds provided */
-#if defined(DESRES_CTNUMBER)
-#define MOLFILE_CTNUMBER      0x0200 /**< ctnumber provided */
-#endif
-#define MOLFILE_BADOPTIONS    0xFFFFFFFF /**< Detect badly behaved plugins */
-                              
-/*@}*/
-
-/*@{*/
-/** Flags indicating availability of optional data fields
- *  for QM timesteps
- */
-#define MOLFILE_QMTS_NOOPTIONS     0x0000 /**< no optional data               */
-#define MOLFILE_QMTS_GRADIENT      0x0001 /**< energy gradients provided      */
-#define MOLFILE_QMTS_SCFITER       0x0002
-/*@}*/
-
-typedef struct molfile_timestep_metadata {
-  unsigned int count;                  /**< total # timesteps; -1 if unknown */
-  unsigned int avg_bytes_per_timestep; /** bytes per timestep                */
-  int has_velocities;                  /**< if timesteps have velocities     */
-} molfile_timestep_metadata_t;
-
-/*
- * Per-timestep atom coordinates and periodic cell information
- */ 
-typedef struct {
-  float *coords;        /**< coordinates of all atoms, arranged xyzxyzxyz   */
-  float *velocities;    /**< space for velocities of all atoms; same layout */
-                        /**< NULL unless has_velocities is set              */
-
-  /*@{*/   
-  /**
-   * Unit cell specification of the form A, B, C, alpha, beta, gamma.
-   * notes: A, B, C are side lengths of the unit cell
-   * alpha = angle between b and c
-   *  beta = angle between a and c
-   * gamma = angle between a and b
-   */ 
-  float A, B, C, alpha, beta, gamma; 
-  /*@}*/   
-
-  double physical_time; /**< physical time point associated with this frame */
-
-#if defined(DESRES_READ_TIMESTEP2)
-  /* HACK to support generic trajectory information */
-  double total_energy;
-  double potential_energy;
-  double kinetic_energy;
-  double extended_energy;
-  double force_energy;
-  double total_pressure;
-#endif
-
-} molfile_timestep_t;
-
-
-/**
- * Metadata for volumetric datasets, read initially and used for subsequent
- * memory allocations and file loading.  
- */
-typedef struct {
-  char dataname[256];   /**< name of volumetric data set                    */
-  float origin[3];      /**< origin: origin of volume (x=0, y=0, z=0 corner */
-
-  /*
-   * x/y/z axis:
-   * These the three cell sides, providing both direction and length
-   * (not unit vectors) for the x, y, and z axes.  In the simplest
-   * case, these would be <size,0,0> <0,size,0> and <0,0,size) for 
-   * an orthogonal cubic volume set.  For other cell shapes these
-   * axes can be oriented non-orthogonally, and the parallelpiped
-   * may have different side lengths, not just a cube/rhombus.
-   */
-  float xaxis[3];       /**< direction (and length) for X axis              */ 
-  float yaxis[3];       /**< direction (and length) for Y axis              */
-  float zaxis[3];       /**< direction (and length) for Z axis              */
-
-  /*
-   * x/y/z size: 
-   * Number of grid cells along each axis.  This is _not_ the
-   * physical size of the box, this is the number of voxels in each
-   * direction, independent of the shape of the volume set. 
-   */
-  int xsize;            /**< number of grid cells along the X axis           */
-  int ysize;            /**< number of grid cells along the Y axis           */
-  int zsize;            /**< number of grid cells along the Z axis           */
-
-#if vmdplugin_ABIVERSION > 16
-  int has_scalar;       /**< flag indicating presence of scalar volume       */
-  int has_gradient;     /**< flag indicating presence of vector volume       */
-  int has_variance;     /**< flag indicating presence of variance map        */
-#endif
-  int has_color;        /**< flag indicating presence of voxel color data    */
-} molfile_volumetric_t;
-
-
-#if vmdplugin_ABIVERSION > 16
-/**
- * Volumetric dataset read/write structure with both flag/parameter sets
- * and VMD-allocated pointers for fields to be used by the plugin.
- */
-typedef struct {
-  int setidx;           /**< volumetric dataset index to load/save */
-  float *scalar;        /**< scalar density/potential field data   */
-  float *gradient;      /**< gradient vector field                 */
-  float *variance;      /**< variance map indicating signal/noise  */
-  float *rgb3f;         /**< RGB floating point color texture map  */
-  unsigned char *rgb3u; /**< RGB unsigned byte color texture map   */
-} molfile_volumetric_readwrite_t;
-#endif
-
-
-/**************************************************************
- **************************************************************
- ****                                                      ****
- ****          Data structures for QM files                ****
- ****                                                      ****
- **************************************************************
- **************************************************************/
-
-/* macros for the convergence status of a QM calculation. */
-#define MOLFILE_QMSTATUS_UNKNOWN       -1 /* don't know yet */
-#define MOLFILE_QMSTATUS_OPT_CONV       0 /* optimization converged */
-#define MOLFILE_QMSTATUS_SCF_NOT_CONV   1 /* SCF convergence failed */
-#define MOLFILE_QMSTATUS_OPT_NOT_CONV   2 /* optimization not converged */
-#define MOLFILE_QMSTATUS_FILE_TRUNCATED 3 /* file was truncated */
-
-/* macros describing the SCF method (SCFTYP in GAMESS) */
-#define MOLFILE_SCFTYPE_UNKNOWN -1 /* no info about the method  */
-#define MOLFILE_SCFTYPE_NONE     0 /* calculation didn't make use of SCF */
-#define MOLFILE_SCFTYPE_RHF      1 /* restricted Hartree-Fock   */
-#define MOLFILE_SCFTYPE_UHF      2 /* unrestricted Hartree-Fock */
-#define MOLFILE_SCFTYPE_ROHF     3 /* restricted open-shell Hartree-Fock */
-#define MOLFILE_SCFTYPE_GVB      4 /* generalized valence bond orbitals  */
-#define MOLFILE_SCFTYPE_MCSCF    5 /* multi-configuration SCF   */
-#define MOLFILE_SCFTYPE_FF       6 /* classical force-field based sim.   */
-
-/* macros describing the type of calculation (RUNTYP in GAMESS) */
-#define MOLFILE_RUNTYPE_UNKNOWN    0  /* single point run */
-#define MOLFILE_RUNTYPE_ENERGY     1  /* single point run */
-#define MOLFILE_RUNTYPE_OPTIMIZE   2  /* geometry optimization */
-#define MOLFILE_RUNTYPE_SADPOINT   3  /* saddle point search */
-#define MOLFILE_RUNTYPE_HESSIAN    4  /* Hessian/frequency calculation */
-#define MOLFILE_RUNTYPE_SURFACE    5  /* potential surface scan */
-#define MOLFILE_RUNTYPE_GRADIENT   6  /* energy gradient calculation */
-#define MOLFILE_RUNTYPE_MEX        7  /* minimum energy crossing */
-#define MOLFILE_RUNTYPE_DYNAMICS   8  /* Any type of molecular dynamics
-                                       * e.g. Born-Oppenheimer, Car-Parinello,
-                                       * or classical MD */
-#define MOLFILE_RUNTYPE_PROPERTIES 9  /* Properties were calculated from a
-                                       * wavefunction that was read from file */
-
-
-/**
- * Sizes of various QM-related, timestep independent data arrays
- * which must be allocated by the caller (VMD) so that the plugin
- * can fill in the arrays with data.
- */
-typedef struct {
-  /* hessian data */
-  int nimag;                    /**< number of imaginary modes */
-  int nintcoords;               /**< number internal coordinates */
-  int ncart;                    /**< number cartesian coordinates */
-
-  /* orbital/basisset data */
-  int num_basis_funcs;          /**< number of uncontracted basis functions in basis array */
-  int num_basis_atoms;          /**< number of atoms in basis set */
-  int num_shells;               /**< total number of atomic shells */
-  int wavef_size;               /**< size of the wavefunction
-                                 *   i.e. size of secular eq. or
-                                 *   # of cartesian contracted
-                                 *   gaussian basis functions */
-
-  /* everything else */
-  int have_sysinfo;
-  int have_carthessian;         /**< hessian in cartesian coords available  */
-  int have_inthessian;          /**< hessian in internal coords available  */
-  int have_normalmodes;         /**< normal modes available  */
-} molfile_qm_metadata_t;
-
-
-/**
- * QM run info. Parameters that stay unchanged during a single file.
- */ 
-typedef struct {
-  int nproc;             /**< number of processors used. */
-  int memory;            /**< amount of memory used in Mbyte. */ 
-  int runtype;           /**< flag indicating the calculation method. */
-  int scftype;           /**< SCF type: RHF, UHF, ROHF, GVB or MCSCF wfn. */
-  int status;            /**< indicates wether SCF and geometry optimization
-                          *   have converged properly. */
-  int num_electrons;     /**< number of electrons.    XXX: can be fractional in some DFT codes */
-  int totalcharge;       /**< total charge of system. XXX: can be fractional in some DFT codes */
-  int num_occupied_A;    /**< number of occupied alpha orbitals */
-  int num_occupied_B;    /**< number of occupied beta orbitals */
-
-  double *nuc_charge;    /**< array(natom) containing the nuclear charge of atom i */
-
-  char basis_string[MOLFILE_BUFSIZ];    /**< basis name as "nice" string. */
-  char runtitle[MOLFILE_BIGBUFSIZ];     /**< title of run.                */
-  char geometry[MOLFILE_BUFSIZ];        /**< type of provided geometry,   XXX: remove?
-                                         * e.g. UNIQUE, ZMT, CART, ...    */
-  char version_string[MOLFILE_BUFSIZ];  /**< QM code version information. */
-} molfile_qm_sysinfo_t;
-
-
-/**
- * Data for QM basis set
- */
-typedef struct {
-  int *num_shells_per_atom; /**< number of shells per atom */
-  int *num_prim_per_shell;  /**< number of shell primitives shell */
-
-  float *basis;             /**< contraction coeffients and exponents for
-                             *   the basis functions in the form
-                             *   {exp(1), c-coeff(1), exp(2), c-coeff(2), ...};
-                             *   array size = 2*num_basis_funcs
-                             *   The basis must NOT be normalized. */
-  int *atomic_number;       /**< atomic numbers (chem. element) of atoms in basis set */
-  int *angular_momentum;    /**< 3 ints per wave function coefficient do describe the 
-                             *   cartesian components of the angular momentum.
-                             *   E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}. 
-                             */
-  int *shell_types;         /**< type for each shell in basis */
-} molfile_qm_basis_t;
-
-
-/**
- * Data from QM Hessian/normal mode runs
- *
- * A noteworthy comment from one of Axel's emails:
- * The molfile_qm_hessian_t, I'd rename to molfile_hessian_t (one
- * can do vibrational analysis without QM) and would make this a
- * completely separate entity. This could then be also used to
- * read in data from, say, principal component analysis or normal
- * mode analysis and VMD could contain code to either project a
- * trajectory on the contained eigenvectors or animate them and
- * so on. There is a bunch of possible applications...
- */
-typedef struct {
-  double *carthessian;  /**< hessian matrix in cartesian coordinates (ncart)*(ncart)
-                         *   as a single array of doubles (row(1), ...,row(natoms)) */
-  int    *imag_modes;   /**< list(nimag) of imaginary modes */
-  double *inthessian;   /**< hessian matrix in internal coordinates
-                         *   (nintcoords*nintcoords) as a single array of
-                         *   doubles (row(1), ...,row(nintcoords)) */
-  float *wavenumbers;   /**< array(ncart) of wavenumbers of normal modes */
-  float *intensities;   /**< array(ncart) of intensities of normal modes */
-  float *normalmodes;   /**< matrix(ncart*ncart) of normal modes  */
-} molfile_qm_hessian_t;
-
-
-/**
- * QM related information that is timestep independent
- */
-typedef struct {
-  molfile_qm_sysinfo_t run;             /* system info  */
-  molfile_qm_basis_t   basis;           /* basis set info */
-  molfile_qm_hessian_t hess;            /* hessian info */
-} molfile_qm_t;
-
-
-
-/**
- *  Enumeration of all of the wavefunction types that can be read
- *  from QM file reader plugins.
- *
- *  CANON    = canonical (i.e diagonalized) wavefunction
- *  GEMINAL  = GVB-ROHF geminal pairs
- *  MCSCFNAT = Multi-Configuration SCF natural orbitals
- *  MCSCFOPT = Multi-Configuration SCF optimized orbitals
- *  CINATUR  = Configuration-Interaction natural orbitals
- *  BOYS     = Boys localization
- *  RUEDEN   = Ruedenberg localization
- *  PIPEK    = Pipek-Mezey population localization
- *
- *  NBO related localizations:
- *  --------------------------
- *  NAO      = Natural Atomic Orbitals
- *  PNAO     = pre-orthogonal NAOs
- *  NBO      = Natural Bond Orbitals
- *  PNBO     = pre-orthogonal NBOs
- *  NHO      = Natural Hybrid Orbitals
- *  PNHO     = pre-orthogonal NHOs
- *  NLMO     = Natural Localized Molecular Orbitals
- *  PNLMO    = pre-orthogonal NLMOs
- *
- *  UNKNOWN  = Use this for any type not listed here
- *             You can use the string field for description
- */
-enum molfile_qm_wavefunc_type {
-  MOLFILE_WAVE_CANON,    MOLFILE_WAVE_GEMINAL,
-  MOLFILE_WAVE_MCSCFNAT, MOLFILE_WAVE_MCSCFOPT,
-  MOLFILE_WAVE_CINATUR,
-  MOLFILE_WAVE_PIPEK,  MOLFILE_WAVE_BOYS, MOLFILE_WAVE_RUEDEN,
-  MOLFILE_WAVE_NAO,    MOLFILE_WAVE_PNAO, MOLFILE_WAVE_NHO, 
-  MOLFILE_WAVE_PNHO,   MOLFILE_WAVE_NBO,  MOLFILE_WAVE_PNBO, 
-  MOLFILE_WAVE_PNLMO,  MOLFILE_WAVE_NLMO, MOLFILE_WAVE_MOAO, 
-  MOLFILE_WAVE_NATO,   MOLFILE_WAVE_UNKNOWN
-};
-
-
-/**
- *  Enumeration of all of the supported QM related charge
- *  types
- */
-enum molfile_qm_charge_type {
-  MOLFILE_QMCHARGE_UNKNOWN,
-  MOLFILE_QMCHARGE_MULLIKEN, MOLFILE_QMCHARGE_LOWDIN,
-  MOLFILE_QMCHARGE_ESP, MOLFILE_QMCHARGE_NPA
-};
-
-
-
-/**
- * Sizes of various QM-related, per-timestep data arrays
- * which must be allocated by the caller (VMD) so that the plugin
- * can fill in the arrays with data.
- */
-typedef struct molfile_qm_timestep_metadata {
-  unsigned int count;                  /**< total # timesteps; -1 if unknown */
-  unsigned int avg_bytes_per_timestep; /**< bytes per timestep                */
-  int has_gradient;                    /**< if timestep contains gradient    */
-  int num_scfiter;                     /**< # scf iterations for this ts     */
-  int num_orbitals_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< # orbitals for each wavefunction */
-  int has_orben_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital energy flags */
-  int has_occup_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital occupancy flags */
-  int num_wavef ;                      /**< # wavefunctions in this ts     */
-  int wavef_size;                      /**< size of one wavefunction 
-                                        *   (# of gaussian basis fctns)    */
-  int num_charge_sets;                 /**< # of charge values per atom */
-} molfile_qm_timestep_metadata_t;
-
-
-/**
- * QM wavefunction
- */
-typedef struct {
-  int   type;               /**< MOLFILE_WAVE_CANON, MOLFILE_WAVE_MCSCFNAT, ... */
-  int   spin;               /**< 1 for alpha, -1 for beta */
-  int   excitation;         /**< 0 for ground state, 1,2,3,... for excited states */
-  int   multiplicity;       /**< spin multiplicity of the state, zero if unknown */
-  char info[MOLFILE_BUFSIZ]; /**< string for additional type info */
-
-  double energy;            /**< energy of the electronic state.
-                             *   i.e. HF-SCF energy, CI state energy,
-                             *   MCSCF energy, etc. */
-
-  float *wave_coeffs;       /**< expansion coefficients for wavefunction in the
-                             *   form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */
-  float *orbital_energies;  /**< list of orbital energies for wavefunction */
-  float *occupancies;       /**< orbital occupancies */
-  int   *orbital_ids;       /**< orbital ID numbers; If NULL then VMD will
-                             *   assume 1,2,3,...num_orbs.     */
-} molfile_qm_wavefunction_t;
-
-
-/**
- * QM per trajectory timestep info
- * Note that each timestep can contain multiple wavefunctions.
- */
-typedef struct {
-  molfile_qm_wavefunction_t *wave; /**< array of wavefunction objects */
-  float  *gradient;         /**< force on each atom (=gradient of energy) */
-
-  double *scfenergies;      /**< energies from the SCF cycles */
-  double *charges;          /**< per-atom charges */
-  int    *charge_types;     /**< type of each charge set */
-} molfile_qm_timestep_t;
-
-
-/**************************************************************
- **************************************************************/
-
-
-
-
-/**
- *  Enumeration of all of the supported graphics objects that can be read
- *  from graphics file reader plugins.
- */
-enum molfile_graphics_type {
-  MOLFILE_POINT,  MOLFILE_TRIANGLE, MOLFILE_TRINORM, MOLFILE_NORMS, 
-  MOLFILE_LINE,   MOLFILE_CYLINDER, MOLFILE_CAPCYL,  MOLFILE_CONE,    
-  MOLFILE_SPHERE, MOLFILE_TEXT,     MOLFILE_COLOR,   MOLFILE_TRICOLOR
-};
-
-/**
- *  Individual graphics object/element data
- */ 
-typedef struct {
-  int type;             /* One of molfile_graphics_type */
-  int style;            /* A general style parameter    */
-  float size;           /* A general size parameter     */
-  float data[9];        /* All data for the element     */
-} molfile_graphics_t;
-
-
-/*
- * Types for raw graphics elements stored in files.  Data for each type
- * should be stored by the plugin as follows:
-
-type        data                                     style       size
-----        ----                                     -----       ----
-point       x, y, z                                              pixel size
-triangle    x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-trinorm     x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-            the next array element must be NORMS
-tricolor    x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-            the next array elements must be NORMS
-            the following element must be COLOR, with three RGB triples
-norms       x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-line        x1,y1,z1,x2,y2,z2                        0=solid     pixel width
-                                                     1=stippled
-cylinder    x1,y1,z1,x2,y2,z2                        resolution  radius
-capcyl      x1,y1,z1,x2,y2,z2                        resolution  radius
-sphere      x1,y1,z1                                 resolution  radius
-text        x, y, z, up to 24 bytes of text                      pixel size
-color       r, g, b
-*/
-
-
-/**
- * Main file reader API.  Any function in this struct may be NULL
- * if not implemented by the plugin; the application checks this to determine
- * what functionality is present in the plugin. 
- */ 
-typedef struct {
-  /**
-   * Required header 
-   */
-  vmdplugin_HEAD
-
-  /**
-   * Filename extension for this file type.  May be NULL if no filename 
-   * extension exists and/or is known.  For file types that match several
-   * common extensions, list them in a comma separated list such as:
-   *  "pdb,ent,foo,bar,baz,ban"
-   * The comma separated list will be expanded when filename extension matching
-   * is performed.  If multiple plugins solicit the same filename extensions,
-   * the one that lists the extension earliest in its list is selected. In the 
-   * case of a "tie", the first one tried/checked "wins".
-   */
-  const char *filename_extension;
-
-  /**
-   * Try to open the file for reading.  Return an opaque handle, or NULL on
-   * failure. Set the number of atoms; if the number of atoms cannot be 
-   * determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN. 
-   * Filetype should be the name under which this plugin was registered;
-   * this is provided so that plugins can provide the same function pointer
-   * to handle multiple file types.
-   */
-  void *(* open_file_read)(const char *filepath, const char *filetype, 
-      int *natoms);
-  
-  /**
-   * Read molecular structure from the given file handle.  atoms is allocated
-   * by the caller and points to space for natoms.
-   * On success, place atom information in the passed-in pointer.  
-   * optflags specifies which optional fields in the atoms will be set by
-   * the plugin.
-   */
-  int (*read_structure)(void *, int *optflags, molfile_atom_t *atoms);
-
-  /**
-   * Read bond information for the molecule.  On success the arrays from
-   * and to should point to the (one-based) indices of bonded atoms.
-   * Each unique bond should be specified only once, so file formats that list
-   * bonds twice will need post-processing before the results are returned to
-   * the caller.
-   * If the plugin provides bond information, but the file loaded doesn't 
-   * actually contain any bond info, the nbonds parameter should be
-   * set to 0 and from/to should be set to NULL to indicate that no bond
-   * information was actually present, and automatic bond search should be
-   * performed.  
-   *
-   * If the plugin provides bond order information, the bondorder array
-   * will contain the bond order for each from/to pair.  If not, the bondorder
-   * pointer should be set to NULL, in which case the caller will provide a 
-   * default bond order value of 1.0.
-   *
-   * If the plugin provides bond type information, the bondtype array
-   * will contain the bond type index for each from/to pair. These numbers
-   * are consecutive integers starting from 0.
-   * the bondtypenames list, contains the corresponding names, if available,
-   * as a NULL string terminated list. nbondtypes is provided for convenience
-   * and consistency checking.
-   *
-   * These arrays must be freed by the plugin in the close_file_read function.
-   * This function can be called only after read_structure().  
-   * Return MOLFILE_SUCCESS if no errors occur. 
-   */
-  int (*read_bonds)(void *, int *nbonds, int **from, int **to, float **bondorder, 
-                    int **bondtype, int *nbondtypes, char ***bondtypename);
-
-  /**
-   * XXX this function will be augmented and possibly superceded by a 
-   *     new QM-capable version named read_timestep(), when finished.
-   *
-   * Read the next timestep from the file.  Return MOLFILE_SUCCESS, or 
-   * MOLFILE_EOF on EOF.  If the molfile_timestep_t argument is NULL, then 
-   * the frame should be skipped.  Otherwise, the application must prepare 
-   * molfile_timestep_t by allocating space in coords for the corresponding 
-   * number of coordinates.  
-   * The natoms parameter exists because some coordinate file formats 
-   * (like CRD) cannot determine for themselves how many atoms are in a 
-   * timestep; the app must therefore obtain this information elsewhere
-   * and provide it to the plugin.
-   */
-  int (* read_next_timestep)(void *, int natoms, molfile_timestep_t *);
-
-  /**
-   * Close the file and release all data.  The handle cannot be reused.
-   */
-  void (* close_file_read)(void *);
-   
-  /**
-   * Open a coordinate file for writing using the given header information.
-   * Return an opaque handle, or NULL on failure.  The application must
-   * specify the number of atoms to be written. 
-   * filetype should be the name under which this plugin was registered.
-   */
-  void *(* open_file_write)(const char *filepath, const char *filetype, 
-      int natoms);
-  
-  /**
-   * Write structure information.  Return success.
-   */
-  int (* write_structure)(void *, int optflags, const molfile_atom_t *atoms);
-
-  /**
-   * Write a timestep to the coordinate file.  Return MOLFILE_SUCCESS if no
-   * errors occur.  If the file contains structure information in each 
-   * timestep (like a multi-entry PDB), it will have to cache the information 
-   * from the initial calls from write_structure.
-   */
-  int (* write_timestep)(void *, const molfile_timestep_t *);
-  
-  /**
-   * Close the file and release all data.  The handle cannot be reused.
-   */
-  void (* close_file_write)(void *);
-
-  /**
-   * Retrieve metadata pertaining to volumetric datasets in this file.
-   * Set nsets to the number of volumetric data sets, and set *metadata
-   * to point to an array of molfile_volumetric_t.  The array is owned by
-   * the plugin and should be freed by close_file_read().  The application
-   * may call this function any number of times.
-   */
-  int (* read_volumetric_metadata)(void *, int *nsets, 
-        molfile_volumetric_t **metadata);
-
-  /** 
-   * Read the specified volumetric data set into the space pointed to by 
-   * datablock.  The set is specified with a zero-based index.  The space 
-   * allocated for the datablock must be equal to
-   * xsize * ysize * zsize.  No space will be allocated for colorblock 
-   * unless has_color is nonzero; in that case, colorblock should be
-   * filled in with three RGB floats per datapoint.
-   */
-  int (* read_volumetric_data)(void *, int set, float *datablock, 
-        float *colorblock);
-#if vmdplugin_ABIVERSION > 16
-  int (* read_volumetric_data_ex)(void *, molfile_volumetric_readwrite_t *v);
-#endif
-
-  /**
-   * Read raw graphics data stored in this file.   Return the number of data
-   * elements and the data itself as an array of molfile_graphics_t in the 
-   * pointer provided by the application.  The plugin is responsible for 
-   * freeing the data when the file is closed.
-   */
-  int (* read_rawgraphics)(void *, int *nelem, const molfile_graphics_t **data);
-
-  /**
-   * Read molecule metadata such as what database (if any) this file/data
-   * came from, what the accession code for the database is, textual remarks
-   * and other notes pertaining to the contained structure/trajectory/volume
-   * and anything else that's informative at the whole file level.
-   */ 
-  int (* read_molecule_metadata)(void *, molfile_metadata_t **metadata);
-  
-  /**
-   * Write bond information for the molecule.  The arrays from
-   * and to point to the (one-based) indices of bonded atoms.
-   * Each unique bond will be specified only once by the caller. 
-   * File formats that list bonds twice will need to emit both the 
-   * from/to and to/from versions of each.
-   * This function must be called before write_structure().  
-   *
-   * Like the read_bonds() routine, the bondorder pointer is set to NULL
-   * if the caller doesn't have such information, in which case the 
-   * plugin should assume a bond order of 1.0 if the file format requires
-   * bond order information.
-   *
-   * Support for bond types follows the bondorder rules. bondtype is
-   * an integer array of the size nbonds that contains the bond type
-   * index (consecutive integers starting from 0) and bondtypenames
-   * contain the corresponding strings, in case the naming/numbering
-   * scheme is different from the index numbers.
-   * if the pointers are set to NULL, then this information is not available.
-   * bondtypenames can only be used of bondtypes is also given.
-   * Return MOLFILE_SUCCESS if no errors occur. 
-   */
-  int (* write_bonds)(void *, int nbonds, int *from, int *to, float *bondorder, 
-                     int *bondtype, int nbondtypes, char **bondtypename);
-
-  /**
-   * Write the specified volumetric data set into the space pointed to by 
-   * datablock.  The * allocated for the datablock must be equal to
-   * xsize * ysize * zsize.  No space will be allocated for colorblock 
-   * unless has_color is nonzero; in that case, colorblock should be
-   * filled in with three RGB floats per datapoint.
-   */
-  int (* write_volumetric_data)(void *, molfile_volumetric_t *metadata,
-                                float *datablock, float *colorblock);
-#if vmdplugin_ABIVERSION > 16
-  int (* write_volumetric_data_ex)(void *, molfile_volumetric_t *metadata,
-                                   molfile_volumetric_readwrite_t *v);
-#endif
-
-  /** 
-   * Read in Angles, Dihedrals, Impropers, and Cross Terms and optionally types.
-   * (Cross terms pertain to the CHARMM/NAMD CMAP feature) 
-   */
-  int (* read_angles)(void *handle, int *numangles, int **angles, int **angletypes,
-                      int *numangletypes, char ***angletypenames, int *numdihedrals,
-                      int **dihedrals, int **dihedraltypes, int *numdihedraltypes,
-                      char ***dihedraltypenames, int *numimpropers, int **impropers,        
-                      int **impropertypes, int *numimpropertypes, char ***impropertypenames,
-                      int *numcterms, int **cterms, int *ctermcols, int *ctermrows);
-
-  /** 
-   * Write out Angles, Dihedrals, Impropers, and Cross Terms
-   * (Cross terms pertain to the CHARMM/NAMD CMAP feature) 
-   */
-  int (* write_angles)(void *handle, int numangles, const int *angles, const int *angletypes,
-                       int numangletypes, const char **angletypenames, int numdihedrals,
-                       const int *dihedrals, const int *dihedraltypes, int numdihedraltypes,
-                       const char **dihedraltypenames, int numimpropers, 
-                       const int *impropers, const int *impropertypes, int numimpropertypes,
-                       const char **impropertypenames, int numcterms,  const int *cterms, 
-                       int ctermcols, int ctermrows);
-
-
-  /**
-   * Retrieve metadata pertaining to timestep independent
-   * QM datasets in this file.
-   *
-   * The metadata are the sizes of the QM related data structure
-   * arrays that will be populated by the plugin when 
-   * read_qm_rundata() is called. Since the allocation of these
-   * arrays is done by VMD rather than the plugin, VMD needs to
-   * know the sizes beforehand. Consequently read_qm_metadata()
-   * has to be called before read_qm_rundata().
-   */
-  int (* read_qm_metadata)(void *, molfile_qm_metadata_t *metadata);
-
-
-  /**
-   * Read timestep independent QM data.
-   *
-   * Typical data that are defined only once per trajectory are
-   * general info about the calculation (such as the used method), 
-   * the basis set and normal modes.
-   * The data structures to be populated must have been allocated
-   * before by VMD according to sizes obtained through
-   * read_qm_metadata().
-   */
-  int (* read_qm_rundata)(void *, molfile_qm_t *qmdata);
-
-
-  /**
-   * Read the next timestep from the file.  Return MOLFILE_SUCCESS, or 
-   * MOLFILE_EOF on EOF.  If the molfile_timestep_t or molfile_qm_metadata_t
-   * arguments are NULL, then the coordinate or qm data should be skipped.  
-   * Otherwise, the application must prepare molfile_timestep_t and 
-   * molfile_qm_timestep_t by allocating space for the corresponding 
-   * number of coordinates, orbital wavefunction coefficients, etc.
-   * Since it is common for users to want to load only the final timestep 
-   * data from a QM run, the application may provide any combination of
-   * valid, or NULL pointers for the molfile_timestep_t and 
-   * molfile_qm_timestep_t parameters, depending on what information the
-   * user is interested in.
-   * The natoms and qm metadata parameters exist because some file formats 
-   * cannot determine for themselves how many atoms etc are in a 
-   * timestep; the app must therefore obtain this information elsewhere
-   * and provide it to the plugin.
-   */
-  int (* read_timestep)(void *, int natoms, molfile_timestep_t *,
-                        molfile_qm_metadata_t *, molfile_qm_timestep_t *);
-
-  int (* read_timestep_metadata)(void *, molfile_timestep_metadata_t *);
-  int (* read_qm_timestep_metadata)(void *, molfile_qm_timestep_metadata_t *);
-
-#if defined(DESRES_READ_TIMESTEP2)
-  /**
-    * Read a specified timestep!
-    */
-  int (* read_timestep2)(void *, molfile_ssize_t index, molfile_timestep_t *);
-
-  /**
-    * write up to count times beginning at index start into the given
-    * space.  Return the number read, or -1 on error.
-    */
-  molfile_ssize_t (* read_times)( void *,
-                                  molfile_ssize_t start,
-                                  molfile_ssize_t count,
-                                  double * times );
-#endif
-
-  /**
-   *  Console output, READ-ONLY function pointer.
-   *  Function pointer that plugins can use for printing to the host
-   *  application's text console.  This provides a clean way for plugins
-   *  to send message strings back to the calling application, giving the
-   *  caller the ability to prioritize, buffer, and redirect console messages
-   *  to an appropriate output channel, window, etc.  This enables the use of
-   *  graphical consoles like TkCon without losing console output from plugins.
-   *  If the function pointer is NULL, no console output service is provided
-   *  by the calling application, and the output should default to stdout
-   *  stream.  If the function pointer is non-NULL, all output will be
-   *  subsequently dealt with by the calling application.
-   *
-   *  XXX this should really be put into a separate block of
-   *      application-provided read-only function pointers for any
-   *      application-provided services
-   */
-  int (* cons_fputs)(const int, const char*);
-
-} molfile_plugin_t;
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/include/vmdconio.h b/pymolfile/molfile/vmd_molfile_plugins-clang/include/vmdconio.h
deleted file mode 100644
index 740c48d8f581b9a4914f08d0df26f4e7726017e7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/include/vmdconio.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 2009 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vmdconio.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.4 $       $Date: 2015/10/11 22:36:27 $
- *
- ***************************************************************************/
-
-/** @file
- * APIs for console output management.  The calling application may 
- * optionally provide callback routines for console output that direct 
- * output to GUI consoles and other places besides stdout.
- */
-
-#ifndef VMDCON_PLUGIN_H
-#define VMDCON_PLUGIN_H
-
-/* this has to correspond to vmdconsole.h */
-#define VMDCON_ALL       0      /**< "print all messages" log level   */
-#define VMDCON_INFO      1      /**< informational messages log level */
-#define VMDCON_WARN      2      /**< warning messages" log level      */
-#define VMDCON_ERROR     3      /**< error messages log level         */
-#define VMDCON_ALWAYS    4      /**< print always log level           */
-#define VMDCON_LOG       5      /**< store only in syslog log level   */
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* set default */
-#if !defined(THISPLUGIN)
-#define THISPLUGIN plugin
-#endif
-
-/* forward declaration */
-static molfile_plugin_t THISPLUGIN;
-
-/* 
- * Emulate printf. unfortunately, we cannot rely on 
- * snprintf being available, so we have to write to
- * a very large buffer and then free it. :-( 
- */
-static int vmdcon_printf(int lvl, const char *fmt, ...) {
-  va_list ap;
-  char *buf;
-  int len;
-
-  /* expand formatted output into a single string */
-  buf = (char *)malloc(MOLFILE_BIGBUFSIZ);
-  va_start(ap, fmt);
-  len = vsprintf(buf, fmt, ap);
-
-  /* 
-   * Check result. we may get a segfault, but if not
-   * let the user know that he/she is in trouble. 
-   */
-  if (len >= MOLFILE_BIGBUFSIZ) {
-    fprintf(stderr,"WARNING! buffer overflow in vmdcon_printf. %d vs %d.\n",
-            len, MOLFILE_BIGBUFSIZ);
-    free(buf);
-#if 0
-    errno=ERANGE; /* this is inherently thread-unsafe */
-#endif
-    return -1;
-  }
-
-  /* 
-   * write to registered console output function.
-   * fall back to stdout, if vmdcon not available. 
-   */
-  if (THISPLUGIN.cons_fputs) {
-    (*THISPLUGIN.cons_fputs)(lvl, buf);
-  } else {
-    fputs(buf, stdout);
-  }
-  free(buf);
-  return 0;    
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* VMDCON_PLUGIN_H */
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/include/vmdplugin.h b/pymolfile/molfile/vmd_molfile_plugins-clang/include/vmdplugin.h
deleted file mode 100644
index bbbc53c9bbfd9980028a7fff6ece2d06cfa08127..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/include/vmdplugin.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2006 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vmdplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.33 $       $Date: 2015/10/29 05:10:54 $
- *
- ***************************************************************************/
-
-/** @file
- * This header must be included by every VMD plugin library.  It defines the
- * API for every plugin so that VMD can organize the plugins it finds.  
- */
-
-#ifndef VMD_PLUGIN_H
-#define VMD_PLUGIN_H
-
-
-/* 
- * Preprocessor tricks to make it easier for us to redefine the names of
- * functions when building static plugins.
- */
-#if !defined(VMDPLUGIN)
-/** 
-  * macro defining VMDPLUGIN if it hasn't already been set to the name of 
-  * a static plugin that is being compiled.  This is the catch-all case.
-  */
-#define VMDPLUGIN vmdplugin
-#endif
-/** concatenation macro, joins args x and y together as a single string */
-#define xcat(x, y) cat(x, y)
-/** concatenation macro, joins args x and y together as a single string */
-#define cat(x, y) x ## y 
-
-/*
- *  macros to correctly define plugin function names depending on whether 
- *  the plugin is being compiled for static linkage or dynamic loading. 
- *  When compiled for static linkage, each plugin needs to have unique
- *  function names for all of its entry points.  When compiled for dynamic
- *  loading, the plugins must name their entry points consistently so that
- *  the plugin loading mechanism can find the register, register_tcl, init,
- *  and fini routines via dlopen() or similar operating system interfaces.
- */
-/*@{*/
-/** Macro names entry points correctly for static linkage or dynamic loading */
-#define VMDPLUGIN_register     xcat(VMDPLUGIN, _register)
-#define VMDPLUGIN_register_tcl xcat(VMDPLUGIN, _register_tcl)
-#define VMDPLUGIN_init         xcat(VMDPLUGIN, _init)
-#define VMDPLUGIN_fini         xcat(VMDPLUGIN, _fini)
-/*@}*/
-
-
-/** "WIN32" is defined on both WIN32 and WIN64 platforms... */
-#if (defined(WIN32)) 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#if !defined(STATIC_PLUGIN)
-#if defined(VMDPLUGIN_EXPORTS)
-/** 
- *  Only define DllMain for plugins, not in VMD or in statically linked plugins
- *  VMDPLUGIN_EXPORTS is only defined when compiling dynamically loaded plugins
- */
-BOOL APIENTRY DllMain( HANDLE hModule,
-                       DWORD ul_reason_for_call,
-                       LPVOID lpReserved
-                     )
-{
-  return TRUE;
-}
-
-#define VMDPLUGIN_API __declspec(dllexport)
-#else
-#define VMDPLUGIN_API __declspec(dllimport)
-#endif /* VMDPLUGIN_EXPORTS */
-#else  /* ! STATIC_PLUGIN */
-#define VMDPLUGIN_API
-#endif /* ! STATIC_PLUGIN */
-#else
-/** If we're not compiling on Windows, then this macro is defined empty */
-#define VMDPLUGIN_API 
-#endif
-
-/** define plugin linkage correctly for both C and C++ based plugins */
-#ifdef __cplusplus
-#define VMDPLUGIN_EXTERN extern "C" VMDPLUGIN_API
-#else
-#define VMDPLUGIN_EXTERN extern VMDPLUGIN_API
-#endif  /* __cplusplus */
-
-/* 
- * Plugin API functions start here 
- */
-
-
-/** 
- * Init routine: called the first time the library is loaded by the 
- * application and before any other API functions are referenced.
- * Return 0 on success.
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_init(void);
-
-/**
- * Macro for creating a struct header used in all plugin structures.
- * 
- * This header should be placed at the top of every plugin API definition 
- * so that it can be treated as a subtype of the base plugin type.
- *
- * abiversion: Defines the ABI for the base plugin type (not for other plugins)
- * type: A string descriptor of the plugin type.
- * name: A name for the plugin.
- * author: A string identifier, possibly including newlines.
- * Major and minor version.  
- * is_reentrant: Whether this library can be run concurrently with itself.
- */
-#define vmdplugin_HEAD \
-  int abiversion; \
-  const char *type; \
-  const char *name; \
-  const char *prettyname; \
-  const char *author; \
-  int majorv; \
-  int minorv; \
-  int is_reentrant; 
-
-/** 
-  * Typedef for generic plugin header, individual plugins can
-  * make their own structures as long as the header info remains 
-  * the same as the generic plugin header, most easily done by 
-  * using the vmdplugin_HEAD macro.
-  */
-typedef struct {
-  vmdplugin_HEAD
-} vmdplugin_t;
-
-/**
- * Use this macro to initialize the abiversion member of each plugin
- */
-#define vmdplugin_ABIVERSION  17
-
-/*@{*/
-/** Use this macro to indicate a plugin's thread-safety at registration time */
-#define VMDPLUGIN_THREADUNSAFE 0
-#define VMDPLUGIN_THREADSAFE   1
-/*@}*/
-
-/*@{*/
-/** Error return code for use in the plugin registration and init functions */
-#define VMDPLUGIN_SUCCESS      0
-#define VMDPLUGIN_ERROR       -1
-/*@}*/
-
-/** 
- * Function pointer typedef for register callback functions
- */
-typedef int (*vmdplugin_register_cb)(void *, vmdplugin_t *);
-
-/**
- * Allow the library to register plugins with the application.
- * The callback should be called using the passed-in void pointer, which
- * should not be interpreted in any way by the library.  Each vmdplugin_t
- * pointer passed to the application should point to statically-allocated
- * or heap-allocated memory and should never be later modified by the plugin.
- * Applications must be permitted to retain only a copy of the the plugin
- * pointer, without making any deep copy of the items in the struct.
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_register(void *, vmdplugin_register_cb);
-
-/**
- * Allow the library to register Tcl extensions.  
- * This API is optional; if found by dlopen, it will be called after first
- * calling init and register.  
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_register_tcl(void *, void *tcl_interp, 
-    vmdplugin_register_cb);
-
-/**
- * The Fini method is called when the application will no longer use 
- * any plugins in the library.  
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_fini(void);
-
-#endif   /* VMD_PLUGIN_H */
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Entries
deleted file mode 100644
index a016e062d486da9a444105b5e41722882999cf90..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Entries
+++ /dev/null
@@ -1,6 +0,0 @@
-D/doc////
-D/msvc////
-D/src////
-D/f77////
-/LICENSE/1.1/Thu Nov  6 21:15:38 2003//
-/Makefile/1.126/Tue Dec 15 21:12:07 2015//
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Repository
deleted file mode 100644
index 89b4780c5e329d247e2caabb66773256a797a8fc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/LICENSE b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/LICENSE
deleted file mode 100644
index 1a92efa01157bd599b2668a6d9f751f548ad2719..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/LICENSE
+++ /dev/null
@@ -1,35 +0,0 @@
-University of Illinois Open Source License
-Copyright 2003 Theoretical and Computational Biophysics Group, 
-All rights reserved.
-
-Developed by:		Theoretical and Computational Biophysics Group
-			University of Illinois at Urbana-Champaign
-			http://www.ks.uiuc.edu/
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the Software), to deal with 
-the Software without restriction, including without limitation the rights to 
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
-of the Software, and to permit persons to whom the Software is furnished to 
-do so, subject to the following conditions:
-
-Redistributions of source code must retain the above copyright notice, 
-this list of conditions and the following disclaimers.
-
-Redistributions in binary form must reproduce the above copyright notice, 
-this list of conditions and the following disclaimers in the documentation 
-and/or other materials provided with the distribution.
-
-Neither the names of Theoretical and Computational Biophysics Group, 
-University of Illinois at Urbana-Champaign, nor the names of its contributors 
-may be used to endorse or promote products derived from this Software without 
-specific prior written permission.
-
-THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
-OTHER DEALINGS WITH THE SOFTWARE.
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile
deleted file mode 100644
index 2c856687048bd7d7eb13b369564089b8d40c8a43..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile
+++ /dev/null
@@ -1,969 +0,0 @@
-# Makefile for molecule file readers
-# $Id: Makefile,v 1.126 2015/12/15 21:12:07 johns Exp $
-
-.SILENT:
-
-.SUFFIXES:
-
-PLUGINAPI = molfile_plugin.h vmdplugin.h vmdconio.h
-COMPILEDIR = ../compile
-ARCHDIR=${COMPILEDIR}/lib_${ARCH}/molfile
-
-SRCDIR = src
-INCDIR = -I../include -I${SRCDIR}
-
-VPATH = src ../include ${ARCHDIR}
-
-SCCFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-SCXXFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-
-#
-# Rules
-#
-
-STATICPLUGINS = abinitplugin avsplugin babelplugin basissetplugin bgfplugin binposplugin biomoccaplugin brixplugin carplugin ccp4plugin corplugin cpmdplugin crdplugin cubeplugin dcdplugin dlpolyplugin dsn6plugin dxplugin edmplugin fs4plugin gamessplugin graspplugin grdplugin gridplugin gromacsplugin jsplugin lammpsplugin mapplugin mdfplugin mol2plugin moldenplugin molemeshplugin msmsplugin namdbinplugin offplugin parm7plugin parmplugin pbeqplugin pdbplugin pdbxplugin phiplugin pltplugin plyplugin pqrplugin psfplugin raster3dplugin rst7plugin situsplugin spiderplugin stlplugin tinkerplugin uhbdplugin vaspchgcarplugin vaspoutcarplugin vaspparchgplugin vaspposcarplugin vasp5xdatcarplugin vaspxdatcarplugin vaspxmlplugin vtkplugin xbgfplugin xsfplugin xyzplugin
-
-PLUGINS = abinitplugin.so avsplugin.so babelplugin.so basissetplugin.so bgfplugin.so binposplugin.so biomoccaplugin.so brixplugin.so carplugin.so ccp4plugin.so corplugin.so cpmdplugin.so crdplugin.so cubeplugin.so dcdplugin.so dlpolyplugin.so dsn6plugin.so dxplugin.so edmplugin.so fs4plugin.so gamessplugin.so graspplugin.so grdplugin.so gridplugin.so gromacsplugin.so jsplugin.so lammpsplugin.so mapplugin.so mdfplugin.so mol2plugin.so moldenplugin.so molemeshplugin.so msmsplugin.so namdbinplugin.so offplugin.so parm7plugin.so parmplugin.so pbeqplugin.so pdbplugin.so pdbxplugin.so phiplugin.so pltplugin.so plyplugin.so pqrplugin.so psfplugin.so raster3dplugin.so rst7plugin.so situsplugin.so spiderplugin.so stlplugin.so tinkerplugin.so uhbdplugin.so vaspchgcarplugin.so vaspoutcarplugin.so vaspparchgplugin.so vaspposcarplugin.so vasp5xdatcarplugin.so vaspxdatcarplugin.so vaspxmlplugin.so vtkplugin.so xbgfplugin.so xsfplugin.so xyzplugin.so
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-STATICPLUGINS += dtrplugin maeffplugin
-PLUGINS       += dtrplugin.so maeffplugin.so
-endif
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-# XXX We can safetly assume that VMD is compiled against Tcl, so there is
-#     no need to check if the Tcl libs are static or dynamic here.
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-STATICPLUGINS += vtfplugin webpdbplugin
-PLUGINS       += vtfplugin.so webpdbplugin.so
-endif
-endif
-endif
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-# Only add the NetCDF plugin as a static plugin if we compiled against
-# a static libnetcdf.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += netcdfplugin
-endif
-PLUGINS       += netcdfplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-# Only add the HOOMD plugin as a static plugin if we compiled against
-# a static libexpat.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += hoomdplugin
-endif
-PLUGINS       += hoomdplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional sqlite-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef SQLITELIB
-ifdef SQLITEINC
-ifdef SQLITELDFLAGS
-ifndef SQLITEDYNAMIC
-# Only add the dmsplugin as a static plugin if we compiled against
-# a static sqlite.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += dmsplugin
-endif
-PLUGINS       += dmsplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ifndef TNGDYNAMIC
-STATICPLUGINS += tngplugin
-endif
-PLUGINS       += tngplugin.so
-endif
-endif
-endif
-
-
-# list of all optional plugins for use by distrib target
-OPTPLUGINS = dmsplugin.so hoomdplugin.so netcdfplugin.so tngplugin.so vtfplugin.so webpdbplugin.so 
-
-STATICS = libmolfile_plugin.a libmolfile_plugin.h
-ifeq ($(ARCH),$(filter $(ARCH),MACOSX MAXOSXX86 MACOSXX86_64))
-SODYNLIB = libmolfile_plugin.dylib
-endif
-WIN32STATICS = libmolfile_plugin.lib libmolfile_plugin.h
-DISTFILES = $(PLUGINS) $(OPTPLUGINS) $(STATICS) $(WIN32STATICS)
-
-bins:
-win32bins:
-dynlibs: ${ARCHDIR} mesg $(PLUGINS)
-ifeq ($(ARCH),$(filter $(ARCH),MACOSX MAXOSXX86 MACOSXX86_64))
-staticlibs: ${ARCHDIR} $(STATICS) $(SODYNLIB)
-else
-staticlibs: ${ARCHDIR} $(STATICS)
-endif
-win32staticlibs: ${ARCHDIR} $(WIN32STATICS)
-
-distrib:
-	@echo "Copying molfile plugins to $(PLUGINDIR) destination area"
-	for file in $(DISTFILES) ; do \
-		echo "    $$file ..."; \
-		for localname in `find ../compile -name $$file -print`; do \
-			pluginname=`echo $$localname | sed s/..\\\/compile\\\/lib_// `; \
-			dir=`dirname $(PLUGINDIR)/$$pluginname`; \
-			mkdir -p $$dir; \
-			cp -p $$localname $(PLUGINDIR)/$$pluginname; \
-		done; \
-	done;
-
-mesg:
-	@echo "Building Molecule File Reader plugins"
-
-
-#
-# plugin library rules
-#
-
-abinitplugin.so: ${ARCHDIR}/abinitplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-avsplugin.so: ${ARCHDIR}/avsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-babelplugin.so: ${ARCHDIR}/babelplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-basissetplugin.so: ${ARCHDIR}/basissetplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-bgfplugin.so: ${ARCHDIR}/bgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-binposplugin.so: ${ARCHDIR}/binposplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-biomoccaplugin.so: ${ARCHDIR}/biomoccaplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-brixplugin.so: ${ARCHDIR}/brixplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-carplugin.so: ${ARCHDIR}/carplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-ccp4plugin.so: ${ARCHDIR}/ccp4plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-corplugin.so: ${ARCHDIR}/corplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cpmdplugin.so: ${ARCHDIR}/cpmdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-crdplugin.so: ${ARCHDIR}/crdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cubeplugin.so: ${ARCHDIR}/cubeplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dcdplugin.so: ${ARCHDIR}/dcdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dlpolyplugin.so: ${ARCHDIR}/dlpolyplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dsn6plugin.so: ${ARCHDIR}/dsn6plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dxplugin.so: ${ARCHDIR}/dxplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-edmplugin.so: ${ARCHDIR}/edmplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-fs4plugin.so: ${ARCHDIR}/fs4plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gamessplugin.so: ${ARCHDIR}/gamessplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-graspplugin.so: ${ARCHDIR}/graspplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-grdplugin.so: ${ARCHDIR}/grdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gridplugin.so: ${ARCHDIR}/gridplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gromacsplugin.so: ${ARCHDIR}/gromacsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-jsplugin.so: ${ARCHDIR}/jsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-lammpsplugin.so: ${ARCHDIR}/lammpsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mapplugin.so: ${ARCHDIR}/mapplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mdfplugin.so: ${ARCHDIR}/mdfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mol2plugin.so: ${ARCHDIR}/mol2plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-moldenplugin.so: ${ARCHDIR}/moldenplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-molemeshplugin.so: ${ARCHDIR}/molemeshplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-msmsplugin.so: ${ARCHDIR}/msmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-namdbinplugin.so: ${ARCHDIR}/namdbinplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-offplugin.so: ${ARCHDIR}/offplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parm7plugin.so: ${ARCHDIR}/parm7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parmplugin.so: ${ARCHDIR}/parmplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pbeqplugin.so: ${ARCHDIR}/pbeqplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pdbplugin.so: ${ARCHDIR}/pdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pdbxplugin.so: ${ARCHDIR}/pdbxplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-phiplugin.so: ${ARCHDIR}/phiplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pltplugin.so: ${ARCHDIR}/pltplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-plyplugin.so: ${ARCHDIR}/plyplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pqrplugin.so: ${ARCHDIR}/pqrplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-psfplugin.so: ${ARCHDIR}/psfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-raster3dplugin.so: ${ARCHDIR}/raster3dplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-rst7plugin.so: ${ARCHDIR}/rst7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-situsplugin.so: ${ARCHDIR}/situsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-spiderplugin.so: ${ARCHDIR}/spiderplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-stlplugin.so: ${ARCHDIR}/stlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tinkerplugin.so: ${ARCHDIR}/tinkerplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-uhbdplugin.so: ${ARCHDIR}/uhbdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspchgcarplugin.so: ${ARCHDIR}/vaspchgcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspoutcarplugin.so: ${ARCHDIR}/vaspoutcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspparchgplugin.so: ${ARCHDIR}/vaspparchgplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspposcarplugin.so: ${ARCHDIR}/vaspposcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vasp5xdatcarplugin.so: ${ARCHDIR}/vasp5xdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxdatcarplugin.so: ${ARCHDIR}/vaspxdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxmlplugin.so: ${ARCHDIR}/vaspxmlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vtkplugin.so: ${ARCHDIR}/vtkplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xbgfplugin.so: ${ARCHDIR}/xbgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xsfplugin.so: ${ARCHDIR}/xsfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xyzplugin.so: ${ARCHDIR}/xyzplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-cpmdlogplugin.so: ${ARCHDIR}/cpmdlogplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gaussianplugin.so: ${ARCHDIR}/gaussianplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-hoomdplugin.so: ${ARCHDIR}/hoomdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(EXPATLIB) $(EXPATLDFLAGS) $(LDFLAGS)
-
-netcdfplugin.so: ${ARCHDIR}/netcdfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(NETCDFLIB) $(NETCDFLDFLAGS) $(LDFLAGS)
-
-vtfplugin.so: ${ARCHDIR}/vtfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-webpdbplugin.so: ${ARCHDIR}/webpdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-dmsplugin.so: ${ARCHDIR}/dmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(SQLITELIB) $(SQLITELDFLAGS) $(LDFLAGS)
-
-dtrplugin.so: ${ARCHDIR}/dtrplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-maeffplugin.so: ${ARCHDIR}/maeffplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tngplugin.so: ${ARCHDIR}/tngplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TNGLIB) $(TNGLDFLAGS) $(LDFLAGS)
-
-
-#
-# object files
-#
-${ARCHDIR}/abinitplugin.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin.o: avsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin.o: bgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin.o: binposplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin.o: biomoccaplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin.o: brixplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin.o: carplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin.o: ccp4plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin.o: corplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin.o: crdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin.o: dcdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin.o: dlpolyplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin.o: dsn6plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin.o: dxplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin.o: edmplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin.o: fs4plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin.o: graspplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin.o: grdplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin.o: gridplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin.o: jsplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin.o: mapplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin.o: mdfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin.o: mol2plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin.o: molemeshplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin.o: msmsplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin.o: namdbinplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin.o: offplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin.o: parm7plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin.o: parmplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin.o: pbeqplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbxplugin.o: pdbxplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin.o: phiplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin.o: pltplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/plyplugin.o: plyplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin.o: pqrplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin.o: psfplugin.c fortread.h ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin.o: raster3dplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin.o: rst7plugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin.o: situsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin.o: spiderplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin.o: stlplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin.o: tinkerplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin.o: uhbdplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/hoomdplugin.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(EXPATINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin.o: netcdfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(NETCDFINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin.o: vtfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vtkplugin.o: vtkplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin.o: xbgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin.o: gaussianplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/dmsplugin.o: dmsplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(SQLITEINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin.o: dtrplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin.o: maeffplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${CXXFLAGS} $(SHLDFLAGS) $(TNGINC) $(INCDIR) -c $< $(COPTO)$@
-
-
-
-#
-# archive rules
-#
-ARCHIVEOBJS = ${ARCHDIR}/abinitplugin-s.o ${ARCHDIR}/avsplugin-s.o ${ARCHDIR}/babelplugin-s.o ${ARCHDIR}/basissetplugin-s.o ${ARCHDIR}/bgfplugin-s.o ${ARCHDIR}/binposplugin-s.o ${ARCHDIR}/biomoccaplugin-s.o ${ARCHDIR}/brixplugin-s.o ${ARCHDIR}/carplugin-s.o ${ARCHDIR}/ccp4plugin-s.o ${ARCHDIR}/corplugin-s.o ${ARCHDIR}/cpmdplugin-s.o ${ARCHDIR}/crdplugin-s.o ${ARCHDIR}/cubeplugin-s.o ${ARCHDIR}/dcdplugin-s.o ${ARCHDIR}/dlpolyplugin-s.o ${ARCHDIR}/dsn6plugin-s.o ${ARCHDIR}/dxplugin-s.o ${ARCHDIR}/edmplugin-s.o ${ARCHDIR}/fs4plugin-s.o ${ARCHDIR}/gamessplugin-s.o ${ARCHDIR}/graspplugin-s.o ${ARCHDIR}/grdplugin-s.o ${ARCHDIR}/gridplugin-s.o ${ARCHDIR}/gromacsplugin-s.o ${ARCHDIR}/jsplugin-s.o ${ARCHDIR}/lammpsplugin-s.o ${ARCHDIR}/mapplugin-s.o ${ARCHDIR}/mdfplugin-s.o ${ARCHDIR}/mol2plugin-s.o ${ARCHDIR}/moldenplugin-s.o ${ARCHDIR}/molemeshplugin-s.o ${ARCHDIR}/msmsplugin-s.o ${ARCHDIR}/namdbinplugin-s.o ${ARCHDIR}/offplugin-s.o ${ARCHDIR}/parm7plugin-s.o ${ARCHDIR}/parmplugin-s.o ${ARCHDIR}/pbeqplugin-s.o ${ARCHDIR}/pdbplugin-s.o ${ARCHDIR}/pdbxplugin-s.o ${ARCHDIR}/phiplugin-s.o ${ARCHDIR}/pltplugin-s.o ${ARCHDIR}/plyplugin-s.o ${ARCHDIR}/pqrplugin-s.o ${ARCHDIR}/psfplugin-s.o ${ARCHDIR}/raster3dplugin-s.o ${ARCHDIR}/rst7plugin-s.o ${ARCHDIR}/situsplugin-s.o ${ARCHDIR}/spiderplugin-s.o ${ARCHDIR}/stlplugin-s.o ${ARCHDIR}/tinkerplugin-s.o ${ARCHDIR}/uhbdplugin-s.o ${ARCHDIR}/vaspchgcarplugin-s.o ${ARCHDIR}/vaspoutcarplugin-s.o ${ARCHDIR}/vaspparchgplugin-s.o ${ARCHDIR}/vaspposcarplugin-s.o ${ARCHDIR}/vasp5xdatcarplugin-s.o ${ARCHDIR}/vaspxdatcarplugin-s.o ${ARCHDIR}/vaspxmlplugin-s.o ${ARCHDIR}/vtkplugin-s.o ${ARCHDIR}/xbgfplugin-s.o ${ARCHDIR}/xsfplugin-s.o ${ARCHDIR}/xyzplugin-s.o
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-ARCHIVEOBJS += ${ARCHDIR}/dtrplugin-s.o ${ARCHDIR}/maeffplugin-s.o
-endif
-
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/vtfplugin-s.o ${ARCHDIR}/webpdbplugin-s.o
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/netcdfplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/hoomdplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/tngplugin-s.o
-endif
-endif
-endif
-
-
-ifeq ($(ARCH),$(filter $(ARCH),MACOSX MAXOSXX86 MACOSXX86_64))
-libmolfile_plugin.dylib: ${ARCHIVEOBJS} libmolfile_plugin.h
-	rm -f ${ARCHDIR}/$@
-	$(CXX) -dynamiclib ${INCDIR} ${ARCHDIR}/libmolfile_plugin.a -I${ARCHDIR}/libmolfile_plugin.h -o ${ARCHDIR}/$@ ${ARCHIVEOBJS}
-endif
-
-libmolfile_plugin.a: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	$(AR) cr ${ARCHDIR}/$@ ${ARCHIVEOBJS} 
-	$(RANLIB) ${ARCHDIR}/$@
-
-libmolfile_plugin.lib: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	lib /OUT:${ARCHDIR}/$@ ${ARCHIVEOBJS}
-
-libmolfile_plugin.h: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@
-	touch ${ARCHDIR}/$@
-	../create_static_header.sh MOLFILE molfile ${ARCHDIR}/$@ ${STATICPLUGINS}
-
-#
-# object files suitable for static linking
-#
-${ARCHDIR}/abinitplugin-s.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_abinitplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin-s.o: avsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_avsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin-s.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_babelplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin-s.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_basissetplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin-s.o: bgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_bgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin-s.o: binposplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_binposplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin-s.o: biomoccaplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_biomoccaplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin-s.o: brixplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_brixplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin-s.o: carplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_carplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin-s.o: ccp4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_ccp4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin-s.o: corplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_corplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin-s.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin-s.o: crdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_crdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin-s.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cubeplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin-s.o: dcdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dcdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin-s.o: dlpolyplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dlpolyplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin-s.o: dsn6plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dsn6plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin-s.o: dxplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dxplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin-s.o: edmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_edmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin-s.o: fs4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_fs4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin-s.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gamessplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin-s.o: graspplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_graspplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin-s.o: grdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_grdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin-s.o: gridplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gridplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin-s.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gromacsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin-s.o: jsplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_jsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin-s.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_lammpsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin-s.o: mapplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mapplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin-s.o: mdfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin-s.o: mol2plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mol2plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin-s.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_moldenplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin-s.o: molemeshplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_molemeshplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin-s.o: msmsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_msmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin-s.o: namdbinplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_namdbinplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin-s.o: offplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_offplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin-s.o: parm7plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parm7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin-s.o: parmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin-s.o: pbeqplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pbeqplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin-s.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbxplugin-s.o: pdbxplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pdbxplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin-s.o: phiplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_phiplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin-s.o: pltplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pltplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/plyplugin-s.o: plyplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_plyplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin-s.o: pqrplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pqrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin-s.o: psfplugin.c fortread.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_psfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin-s.o: raster3dplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_raster3dplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin-s.o: rst7plugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_rst7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin-s.o: situsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_situsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin-s.o: spiderplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_spiderplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin-s.o: stlplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_stlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin-s.o: tinkerplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tinkerplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin-s.o: uhbdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_uhbdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin-s.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspchgcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin-s.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspoutcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin-s.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspparchgplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin-s.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspposcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin-s.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vasp5xdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin-s.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin-s.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxmlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vtkplugin-s.o: vtkplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vtkplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin-s.o: xbgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xbgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin-s.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xsfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin-s.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xyzplugin" -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin-s.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdlogplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin-s.o: gaussianplugin.c ${PLUGINAPI}  gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gaussianplugin" -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/hoomdplugin-s.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(EXPATINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_hoomdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin-s.o: netcdfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(NETCDFINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_netcdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin-s.o: vtfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_vtfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin-s.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_webpdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dmsplugin-s.o: dmsplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(SQLITEINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin-s.o: dtrplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dtrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin-s.o: maeffplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_maeffplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin-s.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(TNGINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tngplugin" -c $< $(COPTO)$@
-
-
-${ARCHDIR} :
-	mkdir -p ${ARCHDIR}
-
-clean:
-	find ${COMPILEDIR} \( -name *.o -o -name *.a -o -name *.so -o -name *.dll \) -print | xargs rm -f
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile.orig b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile.orig
deleted file mode 100644
index 2eb41a3ddc90114a2e3932d0c9a38192b17dcee9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile.orig
+++ /dev/null
@@ -1,929 +0,0 @@
-# Makefile for molecule file readers
-# $Id: Makefile,v 1.123 2014/12/05 22:02:00 johns Exp $
-
-.SILENT:
-
-.SUFFIXES:
-
-PLUGINAPI = molfile_plugin.h vmdplugin.h vmdconio.h
-COMPILEDIR = ../compile
-ARCHDIR=${COMPILEDIR}/lib_${ARCH}/molfile
-
-SRCDIR = src
-INCDIR = -I../include -I${SRCDIR}
-
-VPATH = src ../include ${ARCHDIR}
-
-SCCFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-SCXXFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-
-#
-# Rules
-#
-
-STATICPLUGINS = abinitplugin avsplugin babelplugin basissetplugin bgfplugin binposplugin biomoccaplugin brixplugin carplugin ccp4plugin corplugin cpmdplugin crdplugin cubeplugin dcdplugin dlpolyplugin dsn6plugin dxplugin edmplugin fs4plugin gamessplugin graspplugin grdplugin gridplugin gromacsplugin jsplugin lammpsplugin mapplugin mdfplugin mol2plugin moldenplugin molemeshplugin msmsplugin namdbinplugin offplugin parm7plugin parmplugin pbeqplugin pdbplugin phiplugin pltplugin pqrplugin psfplugin raster3dplugin rst7plugin situsplugin spiderplugin stlplugin tinkerplugin uhbdplugin vaspchgcarplugin vaspoutcarplugin vaspparchgplugin vaspposcarplugin vasp5xdatcarplugin vaspxdatcarplugin vaspxmlplugin xbgfplugin xsfplugin xyzplugin
-
-PLUGINS = abinitplugin.so avsplugin.so babelplugin.so basissetplugin.so bgfplugin.so binposplugin.so biomoccaplugin.so brixplugin.so carplugin.so ccp4plugin.so corplugin.so cpmdplugin.so crdplugin.so cubeplugin.so dcdplugin.so dlpolyplugin.so dsn6plugin.so dxplugin.so edmplugin.so fs4plugin.so gamessplugin.so graspplugin.so grdplugin.so gridplugin.so gromacsplugin.so jsplugin.so lammpsplugin.so mapplugin.so mdfplugin.so mol2plugin.so moldenplugin.so molemeshplugin.so msmsplugin.so namdbinplugin.so offplugin.so parm7plugin.so parmplugin.so pbeqplugin.so pdbplugin.so phiplugin.so pltplugin.so pqrplugin.so psfplugin.so raster3dplugin.so rst7plugin.so situsplugin.so spiderplugin.so stlplugin.so tinkerplugin.so uhbdplugin.so vaspchgcarplugin.so vaspoutcarplugin.so vaspparchgplugin.so vaspposcarplugin.so vasp5xdatcarplugin.so vaspxdatcarplugin.so vaspxmlplugin.so xbgfplugin.so xsfplugin.so xyzplugin.so
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-STATICPLUGINS += dtrplugin maeffplugin
-PLUGINS       += dtrplugin.so maeffplugin.so
-endif
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-# XXX We can safetly assume that VMD is compiled against Tcl, so there is
-#     no need to check if the Tcl libs are static or dynamic here.
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-STATICPLUGINS += vtfplugin webpdbplugin
-PLUGINS       += vtfplugin.so webpdbplugin.so
-endif
-endif
-endif
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-# Only add the NetCDF plugin as a static plugin if we compiled against
-# a static libnetcdf.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += netcdfplugin
-endif
-PLUGINS       += netcdfplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-# Only add the HOOMD plugin as a static plugin if we compiled against
-# a static libexpat.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += hoomdplugin
-endif
-PLUGINS       += hoomdplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional sqlite-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef SQLITELIB
-ifdef SQLITEINC
-ifdef SQLITELDFLAGS
-ifndef SQLITEDYNAMIC
-# Only add the dmsplugin as a static plugin if we compiled against
-# a static sqlite.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += dmsplugin
-endif
-PLUGINS       += dmsplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ifndef TNGDYNAMIC
-STATICPLUGINS += tngplugin
-endif
-PLUGINS       += tngplugin.so
-endif
-endif
-endif
-
-
-# list of all optional plugins for use by distrib target
-OPTPLUGINS = dmsplugin.so hoomdplugin.so netcdfplugin.so tngplugin.so vtfplugin.so webpdbplugin.so 
-
-STATICS = libmolfile_plugin.a libmolfile_plugin.h
-WIN32STATICS = libmolfile_plugin.lib libmolfile_plugin.h
-DISTFILES = $(PLUGINS) $(OPTPLUGINS) $(STATICS) $(WIN32STATICS)
-
-bins:
-win32bins:
-dynlibs: ${ARCHDIR} mesg $(PLUGINS)
-staticlibs: ${ARCHDIR} $(STATICS) 
-win32staticlibs: ${ARCHDIR} $(WIN32STATICS)
-
-distrib:
-	@echo "Copying molfile plugins to $(PLUGINDIR) destination area"
-	for file in $(DISTFILES) ; do \
-		echo "    $$file ..."; \
-		for localname in `find ../compile -name $$file -print`; do \
-			pluginname=`echo $$localname | sed s/..\\\/compile\\\/lib_// `; \
-			dir=`dirname $(PLUGINDIR)/$$pluginname`; \
-			mkdir -p $$dir; \
-			cp -p $$localname $(PLUGINDIR)/$$pluginname; \
-		done; \
-	done;
-
-mesg:
-	@echo "Building Molecule File Reader plugins"
-
-
-#
-# plugin library rules
-#
-
-abinitplugin.so: ${ARCHDIR}/abinitplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-avsplugin.so: ${ARCHDIR}/avsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-babelplugin.so: ${ARCHDIR}/babelplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-basissetplugin.so: ${ARCHDIR}/basissetplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-bgfplugin.so: ${ARCHDIR}/bgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-binposplugin.so: ${ARCHDIR}/binposplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-biomoccaplugin.so: ${ARCHDIR}/biomoccaplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-brixplugin.so: ${ARCHDIR}/brixplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-carplugin.so: ${ARCHDIR}/carplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-ccp4plugin.so: ${ARCHDIR}/ccp4plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-corplugin.so: ${ARCHDIR}/corplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cpmdplugin.so: ${ARCHDIR}/cpmdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-crdplugin.so: ${ARCHDIR}/crdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cubeplugin.so: ${ARCHDIR}/cubeplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dcdplugin.so: ${ARCHDIR}/dcdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dlpolyplugin.so: ${ARCHDIR}/dlpolyplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dsn6plugin.so: ${ARCHDIR}/dsn6plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dxplugin.so: ${ARCHDIR}/dxplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-edmplugin.so: ${ARCHDIR}/edmplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-fs4plugin.so: ${ARCHDIR}/fs4plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gamessplugin.so: ${ARCHDIR}/gamessplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-graspplugin.so: ${ARCHDIR}/graspplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-grdplugin.so: ${ARCHDIR}/grdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gridplugin.so: ${ARCHDIR}/gridplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gromacsplugin.so: ${ARCHDIR}/gromacsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-jsplugin.so: ${ARCHDIR}/jsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-lammpsplugin.so: ${ARCHDIR}/lammpsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mapplugin.so: ${ARCHDIR}/mapplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mdfplugin.so: ${ARCHDIR}/mdfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mol2plugin.so: ${ARCHDIR}/mol2plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-moldenplugin.so: ${ARCHDIR}/moldenplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-molemeshplugin.so: ${ARCHDIR}/molemeshplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-msmsplugin.so: ${ARCHDIR}/msmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-namdbinplugin.so: ${ARCHDIR}/namdbinplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-offplugin.so: ${ARCHDIR}/offplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parm7plugin.so: ${ARCHDIR}/parm7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parmplugin.so: ${ARCHDIR}/parmplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pbeqplugin.so: ${ARCHDIR}/pbeqplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pdbplugin.so: ${ARCHDIR}/pdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-phiplugin.so: ${ARCHDIR}/phiplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pltplugin.so: ${ARCHDIR}/pltplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pqrplugin.so: ${ARCHDIR}/pqrplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-psfplugin.so: ${ARCHDIR}/psfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-raster3dplugin.so: ${ARCHDIR}/raster3dplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-rst7plugin.so: ${ARCHDIR}/rst7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-situsplugin.so: ${ARCHDIR}/situsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-spiderplugin.so: ${ARCHDIR}/spiderplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-stlplugin.so: ${ARCHDIR}/stlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tinkerplugin.so: ${ARCHDIR}/tinkerplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-uhbdplugin.so: ${ARCHDIR}/uhbdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspchgcarplugin.so: ${ARCHDIR}/vaspchgcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspoutcarplugin.so: ${ARCHDIR}/vaspoutcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspparchgplugin.so: ${ARCHDIR}/vaspparchgplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspposcarplugin.so: ${ARCHDIR}/vaspposcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vasp5xdatcarplugin.so: ${ARCHDIR}/vasp5xdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxdatcarplugin.so: ${ARCHDIR}/vaspxdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxmlplugin.so: ${ARCHDIR}/vaspxmlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xbgfplugin.so: ${ARCHDIR}/xbgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xsfplugin.so: ${ARCHDIR}/xsfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xyzplugin.so: ${ARCHDIR}/xyzplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-cpmdlogplugin.so: ${ARCHDIR}/cpmdlogplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gaussianplugin.so: ${ARCHDIR}/gaussianplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-hoomdplugin.so: ${ARCHDIR}/hoomdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(EXPATLIB) $(EXPATLDFLAGS) $(LDFLAGS)
-
-netcdfplugin.so: ${ARCHDIR}/netcdfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(NETCDFLIB) $(NETCDFLDFLAGS) $(LDFLAGS)
-
-vtfplugin.so: ${ARCHDIR}/vtfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-webpdbplugin.so: ${ARCHDIR}/webpdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-dmsplugin.so: ${ARCHDIR}/dmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(SQLITELIB) $(SQLITELDFLAGS) $(LDFLAGS)
-
-dtrplugin.so: ${ARCHDIR}/dtrplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-maeffplugin.so: ${ARCHDIR}/maeffplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tngplugin.so: ${ARCHDIR}/tngplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TNGLIB) $(TNGLDFLAGS) $(LDFLAGS)
-
-
-#
-# object files
-#
-${ARCHDIR}/abinitplugin.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin.o: avsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin.o: bgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin.o: binposplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin.o: biomoccaplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin.o: brixplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin.o: carplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin.o: ccp4plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin.o: corplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin.o: crdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin.o: dcdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin.o: dlpolyplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin.o: dsn6plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin.o: dxplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin.o: edmplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin.o: fs4plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin.o: graspplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin.o: grdplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin.o: gridplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin.o: jsplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin.o: mapplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin.o: mdfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin.o: mol2plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin.o: molemeshplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin.o: msmsplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin.o: namdbinplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin.o: offplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin.o: parm7plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin.o: parmplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin.o: pbeqplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin.o: phiplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin.o: pltplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin.o: pqrplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin.o: psfplugin.c fortread.h ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin.o: raster3dplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin.o: rst7plugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin.o: situsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin.o: spiderplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin.o: stlplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin.o: tinkerplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin.o: uhbdplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/hoomdplugin.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(EXPATINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin.o: netcdfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(NETCDFINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin.o: vtfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin.o: xbgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin.o: gaussianplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/dmsplugin.o: dmsplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(SQLITEINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin.o: dtrplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin.o: maeffplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${CXXFLAGS} $(SHLDFLAGS) $(TNGINC) $(INCDIR) -c $< $(COPTO)$@
-
-
-
-#
-# archive rules
-#
-ARCHIVEOBJS = ${ARCHDIR}/abinitplugin-s.o ${ARCHDIR}/avsplugin-s.o ${ARCHDIR}/babelplugin-s.o ${ARCHDIR}/basissetplugin-s.o ${ARCHDIR}/bgfplugin-s.o ${ARCHDIR}/binposplugin-s.o ${ARCHDIR}/biomoccaplugin-s.o ${ARCHDIR}/brixplugin-s.o ${ARCHDIR}/carplugin-s.o ${ARCHDIR}/ccp4plugin-s.o ${ARCHDIR}/corplugin-s.o ${ARCHDIR}/cpmdplugin-s.o ${ARCHDIR}/crdplugin-s.o ${ARCHDIR}/cubeplugin-s.o ${ARCHDIR}/dcdplugin-s.o ${ARCHDIR}/dlpolyplugin-s.o ${ARCHDIR}/dsn6plugin-s.o ${ARCHDIR}/dxplugin-s.o ${ARCHDIR}/edmplugin-s.o ${ARCHDIR}/fs4plugin-s.o ${ARCHDIR}/gamessplugin-s.o ${ARCHDIR}/graspplugin-s.o ${ARCHDIR}/grdplugin-s.o ${ARCHDIR}/gridplugin-s.o ${ARCHDIR}/gromacsplugin-s.o ${ARCHDIR}/jsplugin-s.o ${ARCHDIR}/lammpsplugin-s.o ${ARCHDIR}/mapplugin-s.o ${ARCHDIR}/mdfplugin-s.o ${ARCHDIR}/mol2plugin-s.o ${ARCHDIR}/moldenplugin-s.o ${ARCHDIR}/molemeshplugin-s.o ${ARCHDIR}/msmsplugin-s.o ${ARCHDIR}/namdbinplugin-s.o ${ARCHDIR}/offplugin-s.o ${ARCHDIR}/parm7plugin-s.o ${ARCHDIR}/parmplugin-s.o ${ARCHDIR}/pbeqplugin-s.o ${ARCHDIR}/pdbplugin-s.o ${ARCHDIR}/phiplugin-s.o ${ARCHDIR}/pltplugin-s.o ${ARCHDIR}/pqrplugin-s.o ${ARCHDIR}/psfplugin-s.o ${ARCHDIR}/raster3dplugin-s.o ${ARCHDIR}/rst7plugin-s.o ${ARCHDIR}/situsplugin-s.o ${ARCHDIR}/spiderplugin-s.o ${ARCHDIR}/stlplugin-s.o ${ARCHDIR}/tinkerplugin-s.o ${ARCHDIR}/uhbdplugin-s.o ${ARCHDIR}/vaspchgcarplugin-s.o ${ARCHDIR}/vaspoutcarplugin-s.o ${ARCHDIR}/vaspparchgplugin-s.o ${ARCHDIR}/vaspposcarplugin-s.o ${ARCHDIR}/vasp5xdatcarplugin-s.o ${ARCHDIR}/vaspxdatcarplugin-s.o ${ARCHDIR}/vaspxmlplugin-s.o ${ARCHDIR}/xbgfplugin-s.o ${ARCHDIR}/xsfplugin-s.o ${ARCHDIR}/xyzplugin-s.o
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-ARCHIVEOBJS += ${ARCHDIR}/dtrplugin-s.o ${ARCHDIR}/maeffplugin-s.o
-endif
-
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/vtfplugin-s.o ${ARCHDIR}/webpdbplugin-s.o
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/netcdfplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/hoomdplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/tngplugin-s.o
-endif
-endif
-endif
-
-
-libmolfile_plugin.a: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	$(AR) cr ${ARCHDIR}/$@ ${ARCHIVEOBJS} 
-	$(RANLIB) ${ARCHDIR}/$@
-
-libmolfile_plugin.lib: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	lib /OUT:${ARCHDIR}/$@ ${ARCHIVEOBJS}
-
-libmolfile_plugin.h: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@
-	touch ${ARCHDIR}/$@
-	../create_static_header.sh MOLFILE molfile ${ARCHDIR}/$@ ${STATICPLUGINS}
-
-#
-# object files suitable for static linking
-#
-${ARCHDIR}/abinitplugin-s.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_abinitplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin-s.o: avsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_avsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin-s.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_babelplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin-s.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_basissetplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin-s.o: bgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_bgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin-s.o: binposplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_binposplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin-s.o: biomoccaplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_biomoccaplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin-s.o: brixplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_brixplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin-s.o: carplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_carplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin-s.o: ccp4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_ccp4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin-s.o: corplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_corplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin-s.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin-s.o: crdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_crdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin-s.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cubeplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin-s.o: dcdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dcdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin-s.o: dlpolyplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dlpolyplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin-s.o: dsn6plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dsn6plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin-s.o: dxplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dxplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin-s.o: edmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_edmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin-s.o: fs4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_fs4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin-s.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gamessplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin-s.o: graspplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_graspplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin-s.o: grdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_grdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin-s.o: gridplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gridplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin-s.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gromacsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin-s.o: jsplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_jsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin-s.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_lammpsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin-s.o: mapplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mapplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin-s.o: mdfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin-s.o: mol2plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mol2plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin-s.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_moldenplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin-s.o: molemeshplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_molemeshplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin-s.o: msmsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_msmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin-s.o: namdbinplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_namdbinplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin-s.o: offplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_offplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin-s.o: parm7plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parm7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin-s.o: parmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin-s.o: pbeqplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pbeqplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin-s.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin-s.o: phiplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_phiplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin-s.o: pltplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pltplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin-s.o: pqrplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pqrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin-s.o: psfplugin.c fortread.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_psfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin-s.o: raster3dplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_raster3dplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin-s.o: rst7plugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_rst7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin-s.o: situsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_situsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin-s.o: spiderplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_spiderplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin-s.o: stlplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_stlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin-s.o: tinkerplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tinkerplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin-s.o: uhbdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_uhbdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin-s.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspchgcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin-s.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspoutcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin-s.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspparchgplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin-s.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspposcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin-s.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vasp5xdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin-s.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin-s.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxmlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin-s.o: xbgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xbgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin-s.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xsfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin-s.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xyzplugin" -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin-s.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdlogplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin-s.o: gaussianplugin.c ${PLUGINAPI}  gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gaussianplugin" -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/hoomdplugin-s.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(EXPATINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_hoomdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin-s.o: netcdfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(NETCDFINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_netcdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin-s.o: vtfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_vtfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin-s.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_webpdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dmsplugin-s.o: dmsplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(SQLITEINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin-s.o: dtrplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dtrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin-s.o: maeffplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_maeffplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin-s.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(TNGINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tngplugin" -c $< $(COPTO)$@
-
-
-${ARCHDIR} :
-	mkdir -p ${ARCHDIR}
-
-clean:
-	find ${COMPILEDIR} \( -name *.o -o -name *.a -o -name *.so -o -name *.dll \) -print | xargs rm -f
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile.rej b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile.rej
deleted file mode 100644
index 784d6328cd21a010705dc1c9cd5cac334a81ae54..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/Makefile.rej
+++ /dev/null
@@ -1,49 +0,0 @@
---- Makefile	20 Jul 2013 14:28:56 -0000	1.9
-+++ Makefile	7 Apr 2015 00:01:25 -0000
-@@ -42,11 +42,11 @@
- 
- # Win32/Win64 compiles
- ${ARCHDIR}/catdcd.exe : ${CATDCDOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.lib
--	LINK ${CATDCDOBJS} /OUT:${ARCHDIR}/catdcd.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS}
-+	LINK ${CATDCDOBJS} /OUT:${ARCHDIR}/catdcd.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS}
- 
- # all other platforms
- ${ARCHDIR}/catdcd : ${CATDCDOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.a
--	${CXX} ${CXXFLAGS} ${CATDCDOBJS} -o ${ARCHDIR}/catdcd -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} -lm
-+	${CXX} ${CXXFLAGS} ${CATDCDOBJS} -o ${ARCHDIR}/catdcd -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} -lm
- 
- ${ARCHDIR}/hash.o: hash.h hash.c
- 	${CXX} ${CXXFLAGS} ${INCDIR} -c ${SRCDIR}/hash.c $(COPTO)${ARCHDIR}/hash.o
---- Makefile	30 May 2007 02:41:51 -0000	1.9
-+++ Makefile	7 Apr 2015 00:01:25 -0000
-@@ -49,11 +49,11 @@
- 
- # Win32/Win64 compiles
- ${ARCHDIR}/cionize.exe : ${IONIZEOBJS} ${MGPOTOBJS} ${ARCHDIR}/cionize.o ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.lib
--	LINK ${IONIZEOBJS} ${MGPOTOBJS} /OUT:${ARCHDIR}/cionize.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS}
-+	LINK ${IONIZEOBJS} ${MGPOTOBJS} /OUT:${ARCHDIR}/cionize.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS}
- 
- # all other platforms
- ${ARCHDIR}/cionize: ${IONIZEOBJS} ${MGPOTOBJS} ${ARCHDIR}/cionize.o ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.a
--	${CXX} ${CXXFLAGS} ${ARCHDIR}/cionize.o ${IONIZEOBJS} ${MGPOTOBJS} -o ${ARCHDIR}/cionize -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} -lm
-+	${CXX} ${CXXFLAGS} ${ARCHDIR}/cionize.o ${IONIZEOBJS} ${MGPOTOBJS} -o ${ARCHDIR}/cionize -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} -lm
- 
- ${ARCHDIR}/hash.o: hash.h hash.c
- 	${CC}  ${CCFLAGS} ${INCDIR} -c ${SRCDIR}/hash.c $(COPTO)${ARCHDIR}/hash.o
---- Makefile	22 Feb 2011 18:45:04 -0000	1.4
-+++ Makefile	7 Apr 2015 00:01:25 -0000
-@@ -62,12 +62,12 @@
- 
- # Win32/Win64 compiles
- ${ARCHDIR}/volutil.exe : ${VOLUTILOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.lib
--	LINK ${VOLUTILOBJS} /OUT:${ARCHDIR}/volutil.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} wsock32.lib
-+	LINK ${VOLUTILOBJS} /OUT:${ARCHDIR}/volutil.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} wsock32.lib
- 
- # all other platforms
-   
- ${ARCHDIR}/volutil: ${VOLUTILOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.a
--	${CXX} ${CXXFLAGS} ${VOLUTILOBJS} -o ${ARCHDIR}/volutil -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} -lm
-+	${CXX} ${CXXFLAGS} ${VOLUTILOBJS} -o ${ARCHDIR}/volutil -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} -lm
-      
- ${ARCHDIR}/volmap.o: ${SRCDIR}/volmap.C
- 	${CXX} ${CXXFLAGS} ${INCDIR} -c ${SRCDIR}/volmap.C ${COPTO}${ARCHDIR}/volmap.o
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Entries
deleted file mode 100644
index 5635bf2f93ea6e03be73670975c9ea19de5bb4c3..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Entries
+++ /dev/null
@@ -1,57 +0,0 @@
-/babelplugin.html/1.8/Sat Mar 24 21:37:13 2007//
-/binposplugin.html/1.5/Sun May  7 02:13:45 2006//
-/biomoccaplugin.html/1.3/Sun May  7 02:30:18 2006//
-/brixplugin.html/1.7/Sat Mar 24 21:37:34 2007//
-/cpmdplugin.html/1.6/Sun May  7 02:40:24 2006//
-/dlpolyplugin.html/1.6/Sat Mar 24 21:38:31 2007//
-/dsn6plugin.html/1.7/Sat Mar 24 21:38:44 2007//
-/fs4plugin.html/1.8/Sat Mar 24 21:39:12 2007//
-/graspplugin.html/1.8/Sat Mar 24 21:40:02 2007//
-/grdplugin.html/1.7/Sat Mar 24 21:40:13 2007//
-/gridplugin.html/1.4/Sat Mar 24 21:40:19 2007//
-/namdbinplugin.html/1.5/Sat Mar 24 21:41:36 2007//
-/phiplugin.html/1.10/Sat Mar 24 21:43:12 2007//
-/pltplugin.html/1.7/Sat Mar 24 21:43:17 2007//
-/raster3dplugin.html/1.6/Sat Mar 24 21:45:34 2007//
-/spiderplugin.html/1.6/Sat Mar 24 21:45:54 2007//
-/stlplugin.html/1.6/Sat Mar 24 21:46:22 2007//
-/template.html/1.3/Wed Mar  8 20:09:10 2006//
-/tinkerplugin.html/1.4/Sat Mar 24 21:46:30 2007//
-/uhbdplugin.html/1.3/Sat Mar 24 21:46:39 2007//
-/xyzplugin.html/1.13/Sat Mar 24 21:47:36 2007//
-/xsfplugin.html/1.7/Fri Apr 18 21:10:31 2008//
-/avsplugin.html/1.6/Wed Jun 10 17:38:46 2009//
-/mapplugin.html/1.8/Wed Jun 10 17:38:46 2009//
-/bgfplugin.html/1.4/Mon Jun 15 14:48:35 2009//
-/cubeplugin.html/1.10/Mon Jun 15 14:48:35 2009//
-/dxplugin.html/1.11/Mon Jun 15 14:48:35 2009//
-/edmplugin.html/1.9/Mon Jun 15 14:48:36 2009//
-/g96plugin.html/1.5/Mon Jun 15 14:48:36 2009//
-/groplugin.html/1.5/Mon Jun 15 14:48:36 2009//
-/mol2plugin.html/1.8/Mon Jun 15 14:48:36 2009//
-/msmsplugin.html/1.6/Mon Jun 15 14:48:36 2009//
-/netcdfplugin.html/1.4/Mon Jun 15 14:48:36 2009//
-/pdbplugin.html/1.7/Mon Jun 15 14:48:36 2009//
-/situsplugin.html/1.5/Mon Jun 15 14:48:36 2009//
-/trrplugin.html/1.6/Mon Jun 15 14:48:37 2009//
-/webpdbplugin.html/1.8/Mon Jun 15 14:48:37 2009//
-/xbgfplugin.html/1.4/Mon Jun 15 14:48:37 2009//
-/vaspplugin.html/1.6/Tue Jun 23 20:43:43 2009//
-/parm7plugin.html/1.9/Tue Feb 22 03:41:35 2011//
-/parmplugin.html/1.7/Tue Feb 22 03:42:28 2011//
-/rst7plugin.html/1.6/Tue Feb 22 03:44:00 2011//
-/corplugin.html/1.9/Tue Feb 22 04:04:30 2011//
-/psfplugin.html/1.11/Tue Feb 22 04:05:31 2011//
-/gamessplugin.html/1.8/Tue Feb 22 04:06:36 2011//
-/moldenplugin.html/1.7/Tue Feb 22 04:08:47 2011//
-/mdfplugin.html/1.6/Tue Feb 22 04:09:31 2011//
-/pqrplugin.html/1.6/Tue Feb 22 04:11:14 2011//
-/dcdplugin.html/1.15/Tue Feb 22 04:17:22 2011//
-/ccp4plugin.html/1.10/Tue Feb 22 04:20:24 2011//
-/crdplugin.html/1.6/Mon Mar 14 16:08:13 2011//
-/lammpsplugin.html/1.7/Mon Jun 27 18:17:27 2011//
-/vtfplugin.html/1.5/Tue Sep 17 06:14:25 2013//
-/tngplugin.html/1.1/Thu Apr  9 21:06:48 2015//
-/index.html/1.60/Thu Apr  9 21:04:00 2015//
-/carplugin.html/1.6/Fri May  8 04:24:30 2015//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Repository
deleted file mode 100644
index 0834af27d6dd55fa53436a1f0d8549864f156a67..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/doc
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/avsplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/avsplugin.html
deleted file mode 100755
index 83f59ba45f0cb49d2f79408abad41ea1fe7ed1d0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/avsplugin.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--#set var="TITLE" value="AVS Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads AVS Field files, which can be used to store a variety
-of volumetric data. This plugin currently supports only a small subset of
-possible AVS Field file features, specifically it reads files created by 
-<a href="http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/Using_AutoDock_305.21.html#pgfId=10734">AutoDock</a>,
-for storing potential maps. 
-More information on this file format can be found at 
-<!-- <a href="http://astronomy.swin.edu.au/~pbourke/geomformats/field/">http://astronomy.swin.edu.au/~pbourke/geomformats/field/</a>. -->
-<a href="http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf">http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf</a>.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Field types</b>
-<br>All fields must be "uniform". "Irregular" and "rectilinear" fields are
-not yet supported.</p>
-
-<p><b>Data format</b>
-<br>Only ASCII files with data stored as floating-point numbers can be read
-by this plugin. Other combinations of file type and data format cannot be
-used.</p>
-
-<p><b>Unit Cell</b>
-<br>The unit cell must be three dimensional (<i>ndim</i> and <i>nspace</i>
-should both be three), and orthogonal.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/babelplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/babelplugin.html
deleted file mode 100755
index 14968396d6044206b2b23c7ce64002fe40a948e9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/babelplugin.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!--#set var="TITLE" value="Babel Plugin, Version 1.12"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays molecular structure files in 
-   several formats using the Babel program to translate them into
-   PDB files which are easily read by VMD.  In order to use this plugin
-   Babel 1.6 must be installed on your computer and must be executable 
-   in your default command path so that the Babel plugin can run it 
-   via calls to system().  Babel 1.6 is available from the
-   <a href="http://www.eyesopen.com/products/applications/babel.html">OpenEye Babel web site</a>
-</p>
-
-<p>This table lists all of the molecule file formats that Babel will 
-   translate to the PDB format which can be loaded by VMD:
-</p>
-
-<table>
-<tr>
-<td>Alchemy</td>
-<td>AMBER PREP</td>
-<td>Ball and Stick</td>
-
-<tr>
-<td>Biosym .CAR</td>
-<td>Boogie</td> 
-<td>Cacao Cartesian</td>
-
-<tr>
-<td>Cambridge CADPAC</td>
-<td>CHARMm</td>
-<td>Chem3D Cartesian 1</td>
-
-<tr>
-<td>Chem3D Cartesian 2</td>
-<td>CSD CSSR</td>
-<td>CSD FDAT</td>
-
-<tr>
-<td>CSD GSTAT</td>
-<td>Free Form Fractional</td>
-<td>GAMESS Output</td>
-
-<tr>
-<td>Gaussian Z-Matrix</td>
-<td>Gaussian Output</td>
-<td>Hyperchem HIN</td>
-
-<tr>
-<td>Mac Molecule</td>
-<td>Macromodel</td>
-<td>Micro World</td>
-
-<tr>
-<td>MM2 Input</td>
-<td>MM2 Ouput</td>
-<td>MM3</td>
-
-<tr>
-<td>MMADS</td>
-<td>MDL MOLfile</td>
-<td>MOLIN</td>
-
-<tr>
-<td>Mopac Cartesian</td>
-<td>Mopac Internal</td>
-<td>Mopac Output</td>
-
-<tr>
-<td></td>
-<td>ShelX</td>
-<td>Sybyl Mol</td>
-
-<tr>
-<td></td>
-<td>Sybyl Mol2</td>
-<td>XYZ</td>
-</table>  
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-    writing to these formats.</p>
-</p>
-
-<p><b>Unused data</b>
-<br>Babel performs a reasonable translation in most cases, however 
-    it is unavoidable that some formats may contain information which
-    doesn't have a corresponding record in PDB files, so this information
-    may be lost in the translation, and thus unavailble when loaded into VMD.
-</p>
-
-<p><b>Compressed files</b>
-<br>Compressed files will need to be expanded before this plugin can read
-them.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/bgfplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/bgfplugin.html
deleted file mode 100755
index 207d6ac5883a4d08758bde26098457fd870a6b35..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/bgfplugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="Biograf Plugin, Version 0.16"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-The bgf plugin reads files produced by Biograf
-  
-<p>
-<h3>Notes:</h3>
-<p>
-<b>Lone pairs and bonds fields:</b>
-<p>The VMD BGF plugin currently ignores the lone pair and valence fields, since these have no equivalent piece of data in VMD.</p>
-
-<p>
-<b>Forcefield types</b>
-<p>VMD equates the VMD "type" field with the BGF forcefield type; this means that DREIDING typing, for example, must be done manually (for example, with a tcl script).</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/binposplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/binposplugin.html
deleted file mode 100644
index 4a4ec10f9cc08dd587fda2dc35e3a929866cb146..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/binposplugin.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!--#set var="TITLE" value="Scripps 'binpos' Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads trajectory files written in the Scripps 
-"binpos" format, as produced by 
-<a href="http://amber.scripps.edu/">Amber</a> 
-and Thomas Cheatham's 
-<a href="http://www.chpc.utah.edu/~cheatham/ptraj.html">Ptraj</a> 
-trajectory analysis program.
-</p>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/biomoccaplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/biomoccaplugin.html
deleted file mode 100755
index 706a52967a7f003dde51bc1956f9f0d94c1381fa..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/biomoccaplugin.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--#set var="TITLE" value="Biomocca Plugin, Version 0.2"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin volumetric occupancy maps created by the 'biomocca' program
-developed by the Computational Electronics Group at UIUC:
-<a href=http://www.ceg.uiuc.edu/>http://www.ceg.uiuc.edu/</a>
-
-The biomocca map format is quite simple and constists of ASCII floating
-point numbers:
-<ul>
-<li>Origin of the map
-<li>integer X/Y/Z counts
-<li>voxel size in Angstroms
-<li>voxels follow in Z fastest, Y next fastest, X slowest
-</ul>
-
-<h3>Notes:</h3>
-<p>
-<b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/brixplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/brixplugin.html
deleted file mode 100755
index d3ded00ac57ce747f044a274aec19937af9b216c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/brixplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="BRIX Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the BRIX format, 
-used by 
-<a href="http://imsb.au.dk/~mok/o/">O</a>
-and other programs. More information on this file format can be found at 
-<a href="http://zombie.imsb.au.dk/~mok/brix/brix-1.html#ss1.2">http://zombie.imsb.au.dk/~mok/brix/brix-1.html#ss1.2</a>.
-</p> 
-
-<h3>Notes:</h3>
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>The header of the BRIX file contains the value of the RMS 
-deviation of the electron density map. This value is not used by 
-VMD presently.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/carplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/carplugin.html
deleted file mode 100755
index 403810fabab1239a2623de966e3a6d1e3f912ff9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/carplugin.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--#set var="TITLE" value="CAR Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads molecular coordinate data stored in Insight II/Discover
-Cartesian Coordinate format. More information about this file format can be
-found here:
-<a href="http://hincklab.uthscsa.edu/~ahinck/html/soft_packs/msi_docs/insight980/insight/a_FF-CLASSIC.fcs.html">http://hincklab.uthscsa.edu/~ahinck/html/soft_packs/msi_docs/insight980/insight/a_FF-CLASSIC.fcs.html</a>.
-<!--
-<a href="http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#781840">http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#781840</a>.
--->
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Multiple molecules</b>
-<br>CAR files can contain multiple molecule entries; only the first of these
-is read by the plugin. Multiple molecule support may be available in the
-future.
-
-<p><b>Periodic Boundary Condition (PBC) information</b>
-<br>This plugin currently ignores any two-dimensional PBC information that
-may be present. 3D PBC info, however, is loaded into VMD.
-
-<p><b>Helix records</b>
-<br>These records are also ignored by VMD.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/ccp4plugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/ccp4plugin.html
deleted file mode 100755
index 46d6429e4baea2e4ca8845e24b746a4812811bb8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/ccp4plugin.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--#set var="TITLE" value="CCP4, MRC Plugin, Version 1.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps written in the 
-MRC format, also used by the 
-<a href="http://www.ccp4.ac.uk/">CCP4 suite</a>. 
-More information on this file format can be found in the CCP4 
-documentation at 
-<a href="http://www.ccp4.ac.uk/html/maplib.html#description">http://www.ccp4.ac.uk/html/maplib.html#description</a>.
-</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Byte-order</b>
-<br>CCP4 files are created using the native byte-order (i.e., "little-endian"
-or "big-endian") of the machine used to create them. This plugin can read maps
-created with either byte-order.</p>
-
-<p><b>Density values</b>
-<br>Only "mode 2" maps (those with density values stored as 32-bit floating
-point values) can currently be read.</p>
-
-<p><b>Symmetry Records:</b>
-<br>CCP4 maps contain information useful in crystallography, including a
-collection of records that describe the symmetry of the crystal. Since VMD does
-not make use of such information currently, these symmetry records are only
-printed to the terminal when the file is read, and ignored otherwise.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/corplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/corplugin.html
deleted file mode 100755
index 4cf9b1f11a846544cc29ba5429beb723cfcdde8a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/corplugin.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--#set var="TITLE" value="COR Plugin, Version 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads molecular coordinate data stored in 
-<a href="http://brooks.scripps.edu/charmm_docs/TSRI_docs-list.htm">CHARMM</a>
-Cartesian Coordinate format. More information about this file format can be
-found below.
-
-<p>Note that the files created by CHARMM normally carry the extension
-<tt>.crd</tt>. Since this extension is also used by 
-<a href="crdplugin.html">Amber 7</a> trajectory files, the filetype must be
-explicitly set to <tt>cor</tt> when opening a Cartesian Coordinate File in
-VMD. This extra step can be omitted by renaming the file and changing the
-the extension to <tt>cor</tt>.</p>
-
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>The <tt>Weight</tt> field, which can be used to store atom-dependent
-data such as mass or charge is ignored by VMD.</p>
-
-<p><b>ASCII format</b>
-<br>This plugin reads only ASCII, or "formatted" COOR files. Binary
-coordinated files produced by CHARMM are presently not supported by VMD.
-</p>
-
-<h3>Format of the CHARMm coordinate file</h3>
-<pre>
-CHARMm coordinate files contain information about the location of each atom in Cartesian (3D) space. The format of the ASCII (CARD) CHARMm coordinate files is:
-    * Title line(s)
-    * Number of atoms in file
-    * Coordinate line (one for each atom in the file)
-
-The coordinate lines contain specific information about each atom in the model and consist of the following fields:
-    * Atom number (sequential)
-    * Residue number (specified relative to first residue in the PSF)
-    * Residue name
-    * Atom type
-    * X-coordinate
-    * Y-coordinate
-    * Z-coordinate
-    * Segment identifier
-    * Residue identifier
-    * Weighting array value
-
-The FORTRAN FORMAT statement for the coordinate lines is:
-
-I5, I5, 1X, A4, 1X, A4, 3(F10.5), 1X, A4, 1X, A4, F10.5
-</pre>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/cpmdplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/cpmdplugin.html
deleted file mode 100644
index ead9ebfd8b8f8f34dbca9c701e7791433e764241..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/cpmdplugin.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!--#set var="TITLE" value="CPMD Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads 
-<a href="http://www.cpmd.org/">CPMD trajectories</a> 
-from the <b>TRAJECTORY</b> file. 
-The file consists of many lines in the form
-<pre>
-timestep  x  y  z   vx  vy  vz
-</pre>
-which contain the timestep number (NFI), the x-, y-, and z-positions
-and the x-, y-, and z-velocities respectively (in atomic units) for each
-atom. If a trajectory file is continued, CPMD will insert a line
-with the string 
-<b>&lt;&lt;&lt;&lt;&lt;&lt;&nbsp;&nbsp;NEW&nbsp;DATA&nbsp;&nbsp;&gt;&gt;&gt;&gt;&gt;&gt;</b>
-which will be recognized and ignored by this plugin.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type. Saving in either binary DCD format (to reduce disk space
-requirements and enable much faster loading) or XYZ format (to avoid having to load
-a file with the atom name assignments first) instead is recommended.</p>
-
-<p><b>Automatic File Format Detection</b>
-<br>TRAJECTORY has no filename extension, so VMD will ask you to provide
-a file type manually or try to read it as PDB as last resort (which will fail). However, if you rename the file to a name ending in
-<b>.cpmd</b> VMD will atomatically detect the format.
-
-<p><b>Atom Names</b>
-<br>The TRAJECTORY file does not contain any information about the
-respective elements for the recorded positions. You have to 
-load a file containing that information in the same order, 
-e.g. the corresponding <b>GEOMETRY.xyz</b> file first and then
-use <b>Load Data Into Molecule...</b>.
-
-<p><b>Periodic Boundary Conditions</b>
-<br>CPMD does not apply periodic boundary conditions before writing
-to the TRAJECTORY file, so you may either preprocess the data
-accordingly or use a script like the pbcswrap script from the VMD
-script library to translate the atoms back into the unitcell.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/crdplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/crdplugin.html
deleted file mode 100755
index c5c841422e7a2e99f38ef5f3a755ac7b20cde826..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/crdplugin.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--#set var="TITLE" value="CRD Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes 
-<a href="http://amber.scripps.edu/">Amber</a> trajectory files. 
-More information can be found at 
-<a href="http://amber.scripps.edu/formats.html#trajectory">http://amber.scripps.edu/formats.html#trajectory</a>.
-</p>
-
-<p>
-Note that this plugin is not used for CHARMM "cartesian coordinate
-files", which often have the same extension. 
-Use the <a href="corplugin.html">COR plugin</a> for these <tt>crd</tt> files.
-</p>
-
-<h3>Notes:</h3>
-
-<p><b>Unused data</b>
-<br>Velocity information is ignored by VMD.</p>
-
-<p><b>Periodic Box</b>
-<br>This format makes no distinction between files that contain periodic box
-information and those that do not. When opening a crd file, the file type
-must be explicitly set to either <tt>crd</tt> or <tt>crdbox</tt> to ensure
-that the information is properly read by the plugin.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/cubeplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/cubeplugin.html
deleted file mode 100755
index a26f5c619bfe0965c8ed45f80ffd264a30dcc319..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/cubeplugin.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!--#set var="TITLE" value="Cube Plugin, Version 1.1"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads the atom positions and volumetric data sets in the 
-plain text "cube" format as created by the 
-<a href="http://www.gaussian.com/">Gaussian program package</a>. 
-The plugin supports cube files with single grid (e.g. densities,
-laplacian, electrostatic potential) and orbital cube files with
-multiple orbitals.<br>
-There are other programs that can create "cube" files natively
-or convert native data to the "cube" files. This plugin can only
-read those files, that comply with the following description:
-<pre>
-C     WRITE A FORMATTED CUBEFILE VERY SIMILAR TO THOSE CREATED BY 
-C     THE GAUSSIAN PROGRAM OR THE CUBEGEN UTILITY.
-C     THE FORMAT IS AS FOLLOWS (LAST CHECKED AGAINST GAUSSIAN 98):
-C
-C     LINE   FORMAT      CONTENTS
-C     ===============================================================
-C      1     A           TITLE
-C      2     A           DESCRIPTION OF PROPERTY STORED IN CUBEFILE
-C      3     I5,3F12.6   #ATOMS, X-,Y-,Z-COORDINATES OF ORIGIN
-C      4-6   I5,3F12.6   #GRIDPOINTS, INCREMENT VECTOR
-C      #ATOMS LINES OF ATOM COORDINATES:
-C      ...   I5,4F12.6   ATOM NUMBER, CHARGE, X-,Y-,Z-COORDINATE
-C      REST: 6E13.5      CUBE DATA (WITH Z INCREMENT MOVING FASTEST, THEN
-C                        Y AND THEN X)
-C
-C     FOR ORBITAL CUBE FILES, #ATOMS WILL BE < 0 AND THERE WILL BE ONE
-C     ADDITIONAL LINE AFTER THE FINAL ATOM GIVING THE NUMBER OF ORBITALS
-C     AND THEIR RESPECTIVE NUMBERS. ALSO THE ORBITAL NUMBER WILL BE
-C     THE FASTEST MOVING INCREMENT.
-C
-C     ALL COORDINATES ARE GIVEN IN ATOMIC UNITS.
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Coordinate Rotation / Periodic Display</b>
-<br>VMD currently can only display periodic images of the 
-unit cell correctly, if the first cell vector is collinear
-with the x-axis and the second cell vector in the xy-plane.
-Upon loading of the cube file, the coordinates and the 
-grid vectors are rotated accordingly. Unfortunately, that
-may make the atomic positions incompatible to some other
-coordinate files containing matching coordinates.
-
-<p><b>Read-only</b>
-<br>This plugin is only used to read files. 
-VMD does not currently support writing this file type.</p>
-
-<p><b>Memory Usage / Large Cube Files</b>
-<br>Due to the way cube files with multiple grids (e.g. orbitals)
-are written, the plugin will temporarily hold all gridded data
-in memory to get a <b>huge</b> performance increase. So 
-loading a single orbital data set from a large cube file with
-many orbitals may need a machine with a lot of available 
-memory and/or swap space. Also the plugin uses some features
-internally, which may not work for files larger than 2GB
-on 32-bit systems.
-
-<p><b>Atom Masses</b>
-<br>The plugin assigns masses to the atoms according to the 
-natural isotope distribution of the elements (see e.g.
-<a href="http://www.webelements.com/">http://www.webelements.com/</a>).
-If an element could not been recognized, a mass of 0 is assigned.
-To set the mass for those elements or assign a different mass for
-the other atoms, you have to use to create a selection with
-<b>atomselect</b> and then use the selection subcommands to set
-the mass.
-
-<p><b>Binary Cube Files</b>
-<br>Unformatted binary cube files, as they were created by
-versions before Gaussian 98 are not supported by this plugin.
-
-<p><b>Atomic Positions in Angstrom</b>
-<br>The atomic positions and the grid vectors in a cube file 
-are <b>always</b> in atomic units. There is a comment in 
-the Gaussian documentation, that describes, how you can 
-provide a custom grid in angstrom in the <b>input</b> of 
-a gaussian job.
-
-<p><b>Incompatibilities</b>
-<br>If VMD cannot read your cube file, please check the above
-notices. If your cube file has a negative number of atoms, 
-but is missing the orbitals line, you may still be able
-to read it, by changing the sign of the number of atoms.
-But most likely the positions and the grid will be given 
-in angstrom then (see the comment above), so all distances
-will be too short by a factor of about 1.9.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dcdplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dcdplugin.html
deleted file mode 100644
index 74727e06b1eb6b074bfb603ae591f168f22370a0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dcdplugin.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--#set var="TITLE" value="DCD Plugin, Version 1.11"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads and writes the "DCD" binary trajectory file format
-used by 
-<a href="http://www.charmm.org/">CHARMM</a>,
-<a href="http://www.ks.uiuc.edu/Research/namd/">NAMD</a>, 
-and 
-<a href="http://atb.csb.yale.edu/xplor/">X-PLOR</a>.
-
-The plugin performs automatic byte
-swapping to correctly read files written on machines with different endianness.
-The plugin supports reading of X-PLOR files, Charmm with fixed atoms
-and unit cell information, and NAMD files with fixed atoms and unit
-cell information.  The DCD plugin writes trajectories in Charmm 24 format
-with unit cell data and without fixed atoms.
-
-<p>
-<h3>Some basic DCD binary trajectory format specifications:</h3>
-<p>
-There's a description of the
-<a href="http://atb.csb.yale.edu/xplor/">X-PLOR</a>
-variation of the
-<a href="http://www.lrz-muenchen.de/~heller/ego/manual/node93.html">DCD format here</a>:
-<p>
-The DCD format is structured as follows (FORTRAN UNFORMATTED, with Fortran
-data type descriptions):
-<pre>
-HDR     NSET    ISTRT   NSAVC   5-ZEROS NATOM-NFREAT    DELTA   9-ZEROS
-`CORD'  #files  step 1  step    zeroes  (zero)          timestep  (zeroes)
-                        interval
-C*4     INT     INT     INT     5INT    INT             DOUBLE  9INT
-==========================================================================
-NTITLE          TITLE
-INT (=2)        C*MAXTITL
-                (=32)
-==========================================================================
-NATOM
-#atoms
-INT
-==========================================================================
-X(I), I=1,NATOM         (DOUBLE)
-Y(I), I=1,NATOM         
-Z(I), I=1,NATOM         
-==========================================================================
-</pre>
-
-<p>
-and the following describes the difference between X-PLOR
-<a href="http://www.ocms.ox.ac.uk/mirrored/xplor/manual/htmlman/node230.html">and CHARMM formats</a>:
-<p>
-Binary Trajectory Files
-<p>
-The file format is identical to the CHARMm-DCD format (Brooks et al. 1983,
-which can be read by QUANTA  and a variety of other programs. The only
-exception is that the number of coordinate sets written to the trajectory
-file is explicitly written into the header of CHARMm-DCD files, whereas  
-XPLOR writes a zero instead.
-<a href="http://www.bio.unizh.ch/docu/acc_docs/doc/charmm_principles/Ch04_mol_dyn.FM5.html#678927">Brief CHARMm format description</a>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dlpolyplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dlpolyplugin.html
deleted file mode 100755
index 15cfc260c13be5533ada17962bebf694072e715d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dlpolyplugin.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--#set var="TITLE" value="DLPOLY Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads formatted DLPOLY HISTORY (trajectory) files, 
-a minimalistic plain text format for storing molecular coordinate trajectories. 
-This plugin can't read binary history files, and may not handle all 
-variants yet but should work for the most common files.
-
-<p>
-The DLPOLY formatted HISTORY file spcecification 
-<a href="http://hidra.iqfr.csic.es/man/dlpoly/USRMAN/node156.html">is available here</a>
-
-<h3>Notes:</h3>
-
-<p><b>Periodic Cell Data</b>
-The plugin will read periodic cell information from the DLPOLY history file
-as long as the cell basis vectors are orthogonal.  The plugin doesn't presently
-convert non-orthogonal DLPOLY unit cell basis vectors to alpha/beta/gamma
-cell angles.
-</p>
-
-<p><b>Unused Data</b>
-<br>
-This plugin only reads the index and coordinates for each atom. Any
-additional data recorded for an atom is ignored presently.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dsn6plugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dsn6plugin.html
deleted file mode 100755
index 8cc9039520190155223570c90824daf5b5a3735d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dsn6plugin.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--#set var="TITLE" value="DSN6 Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the DSN6 format. More
-information on this file format can be found at <a
-  href="http://www.uoxray.uoregon.edu/tnt/manual/node104.html">http://www.uoxray.uoregon.edu/tnt/manual/node104.html</a>.</p>
-  
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>The DSN6 file format does not contain any data that is not read and used by
-VMD.</p>
-
-<p><b>Byte-order</b>
-<br>DSN6 files are created using the native byte-order (e.g., "little-endian"
-or "big-endian") of the machine used to create them. This plugin can read DSN6
-maps created with either byte-order.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dxplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dxplugin.html
deleted file mode 100755
index 44d8e81c7eea8d493113a3f4e2b924a2d107df8e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/dxplugin.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!--#set var="TITLE" value="DX Plugin, Version 1.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads potential maps stored in 
-<a href=http://opendx.npaci.edu/docs/html/>Data Explorerer "DX"</a> 
-format used by 
-<a href="http://agave.wustl.edu/apbs/">APBS</a>. 
-It may not read DX-format files produced by other applications, 
-though this could change in the future.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unit Cell</b>
-<br>All files are assumed to have an orthogonal unit cell.</p>
-
-<p><b>Example</b>
-<pre>
-   DX potential maps
-  
-   Format of the file is:
-   # Comments
-   .
-   .
-   .
-   object 1 class gridpositions counts xn yn zn
-   origin xorg yorg zorg
-   delta xdel 0 0
-   delta 0 ydel 0
-   delta 0 0 zdel
-   object 2 class gridconnections counts xn yn zn
-   object 3 class array type double rank 0 items [ xn*yn*zn ] data follows
-   f1 f2 f3
-   f4 f5 f6
-   .
-   .
-   .
-   object "Dataset name" class field
-  
-   Where xn, yn, and zn are the number of data points along each axis;
-   xorg, yorg, and zorg is the origin of the grid, in angstroms;
-   xdel, ydel, and zdel are the scaling factors to convert grid units to
-   angstroms.
-   Grid data follows, with three values per line, ordered z fast, y medium,
-   and x slow.
-  
-   Note: this plugin was written to read the OpenDX files created by the
-   APBS program, and doesn't support all of the features in the file format.
-</pre>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/edmplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/edmplugin.html
deleted file mode 100644
index 92b88b998c69727fb7198d5292fea71ccdb860b1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/edmplugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="X-PLOR and CNS EDM Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the CNS and X-PLOR
-ASCII format. More information on this file format can be found in the
-<a href="http://cns.csb.yale.edu/v1.1/">CNS</a> 
-or 
-<a href="http://atb.csb.yale.edu/xplor/">X-PLOR</a>, 
-documentation.
-  
-<h1>Notes:</h1>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/fs4plugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/fs4plugin.html
deleted file mode 100755
index 3caafed104cc4227581eeb37f97dea28618030d0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/fs4plugin.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--#set var="TITLE" value="Fsfour Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps written in Fsfour format, used by
-<a href="http://www.scripps.edu/pub/dem-web/toc.html">XtalView</a>. The
-format is briefly described at <a
-  href="http://www.csb.yale.edu/userguides/datamanip/phases/FSFOUR.html">http://www.csb.yale.edu/userguides/datamanip/phases/FSFOUR.html</a>.</p>
-
-<h1>Feature-specific notes:</h1>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Byte-order</b>
-<br>Fsfour files are created using the native byte-order of the machine used
-to create them. This plugin can read maps created with either
-byte-order.</p>
-
-<p><b>Symmetry Records</b>
-<br>Fsfour maps may contain a collection of records that describe the
-symmetry of the crystal. Since VMD does not make use of such information
-currently, these records are ignored.</p>
-
-<p><b>Unit Cell Geometry</b>
-<br>Old versions of the <a
-  href="http://www.scripps.edu/~cdputnam/software/cns2fsfour.html">cns2fsfour</a>
-and <a
-  href="http://www.scripps.edu/~cdputnam/software/ccp2fsfour.html">ccp2fsfour</a>
-utilities produced files that lacked the unit cell information that was not
-used by XTalView. This plugin can currently load these files, but the unit
-cell will almost certainly be incorrect. Support for such files may become
-deprecated, users are encouraged to upgrade the the newest versions of
-these tools.
-
-<p><b>Unit Cell Origin</b>
-<br>Fsfour maps assume a periodic unit cell; therefore, each file contains
-data for a unit cell beginning at the point <0, 0, 0>. 
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/g96plugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/g96plugin.html
deleted file mode 100755
index 80262bca18035b7631a11ad51baea05a347eaefb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/g96plugin.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--#set var="TITLE" value="G96 Plugin, Version 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays structure/trajectory files in <a
-  href="http://www.igc.ethz.ch/gromos/">Gromos 96</a> format as recognized
-by <a href="http://www.gromacs.org/">GROMACS</a>. More information can be found
-  at <a
-    href="http://www.gromacs.org/documentation/reference_3.1/online/g96.html">http://www.gromacs.org/documentation/reference_3.1/online/g96.html</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Trajectories</b>
-<br>G96 files can contain multiple timesteps.</p>
-
-<p><b>Unused data</b>
-<br>G96 files may contain an optional "velocity" block. This data is not
-used by VMD.</p>
-
-<p><b>Compressed files</b>
-<br>Compressed files will need to be expanded before this plugin can read
-them.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/gamessplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/gamessplugin.html
deleted file mode 100644
index 1d147e19e014b98ebd9f222566159b52342dcc9a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/gamessplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="GAMESS Plugin, Version 0.12"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads GAMESS output files.
-
-<h3>Notes:</h3>
-
-<p><b>Structural Data</b>
-<br>The plugin can parse GAMESS output (*.log) files and
-extract structural information. 
-<br>Currently we support output
-files generated by the following GAMESS runtypes: 
-<br>
-<br> RUNTYP = ENERGY (extract single point geometry)
-<br> RUNTYP = OPTIMIZE (extract trajectory information) 
-<br> RUNTYP = SADPOINT (extract trajectory information)
-<br>
-<br> We plan to support additional runtypes in future releases.
-</p>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/graspplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/graspplugin.html
deleted file mode 100644
index 367693d8d1baa0e7b397068fe66e6b05a0f71ba6..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/graspplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="GRASP Plugin, Version 0.7"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays GRASP binary surface files 
-This format uses triangles exclusively to to represent 3-D geometry. 
-Short documents describing the GRASP surface file format can
-be found at these two sites:
-<li><a href="http://www.msg.ucsf.edu/local/programs/grasp/html/Appendix%20A.html">http://www.msg.ucsf.edu/local/programs/grasp/html/Appendix%20A.html</a>.
-<li><a href="http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.1">http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.1</a>
-</ul>
-
-<h3>Notes:</h3>
-Since GRASP surface files are a 'finished product' type of data,
-they can't be manipulated very much within VMD, though they can be
-displayed.
-
-<p><b>Unused data</b>
-At present, the plugin doesn't provide color data from 
-the GRASP surface file, the surface is loaded using the active
-user-defined graphics drawing color.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/grdplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/grdplugin.html
deleted file mode 100755
index 17f06e289c3eab71c213c853825a822ccbfe989c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/grdplugin.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--#set var="TITLE" value="GRD Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads binary potential maps in the format used by <a
-  href="http://trantor.bioc.columbia.edu/delphi/">DelPhi</a> and <a
-  href="http://honiglab.cpmc.columbia.edu/grasp/">Grasp</a>. More
-information on this format can be found at <a
-  href="http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.2">http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.2</a>
-and <a
-  href="http://trantor.bioc.columbia.edu/delphi/doc/file_format.html">http://trantor.bioc.columbia.edu/delphi/doc/file_format.html</a>.
-
-To read the "formatted ASCII" files created by <a
-  href="http://www.msg.ucsf.edu/local/programs/insightII/doc/life/insight2000.1/delphi/B_Utilities.html#696658">format_phi</a>,
-use the <a href="phiplugin.html">phiplugin</a>.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Grid Points</b>
-<br>It is assumed that the density values of all files are arranged in a
-cubic grid. This plugin is not limited to 65x65x65 grid points as earlier
-versions of the file format are.</p>
-
-<p><b>Unit Cell</b>
-<br>Since PHI maps do not explicitly state the angles of the basis vectors,
-it is assumed that they are orthogonal.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/gridplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/gridplugin.html
deleted file mode 100644
index ebbcdf405d56a5200fedebe2a538c61d7373ebbb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/gridplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="Molecular Discovery GRID Plugin, Version 0.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps created by Molecular Discovery's
-<a href="http://www.moldiscovery.com/soft_grid.php">GRID program</a>, also
-used by UHBD, and other software. 
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Format Uncertainty</b>
-Not sure if slicing order is the same in every file.
-</p>
-
-<p><b>Unused data</b>
-This plugin doesn't read in all data stored in the file, in particular
-various plane metadata.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/groplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/groplugin.html
deleted file mode 100755
index 1691a9aaedf033873d0dc458c30b2d34eae14e8a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/groplugin.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--#set var="TITLE" value="GRO Plugin, Version 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays molecular structure files in 
-<a href="http://www.gmd.de/SCAI/europort-1/H1.HTM">Gromos87</a> 
-format, as recognized by 
-<a href="http://www.gromacs.org/">GROMACS</a>. 
-More information can be found at 
-<a href="http://www.gromacs.org/documentation/reference_3.1/online/gro.html">http://www.gromacs.org/documentation/reference_3.1/online/gro.html</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>GRO files may contain an optional "velocity" block. This data is not
-used by VMD.</p>
-
-<p><b>Compressed files</b>
-<br>Compressed files will need to be expanded before this plugin can read
-them.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/index.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/index.html
deleted file mode 100755
index 9cb1f048ceb5badbe9659bf5d1fa24d7110a1567..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/index.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!--#set var="TITLE" value="Molfile Plugin Documentation"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<b>Molfile</b> plugins act as translators between the on-disk file
-representations of molecular structures, trajectories, volumetric
-data sets, and graphics geometry data, and the in-memory 
-representation of these data in VMD.  This page contains a 
-list of all of the currently available file reader plugins for VMD.
-For each plugin, we try to maintain an up-to-date document which 
-explains what limitations the plugin has, whether it reads all data or
-only some of the data from the file format, any known bugs, and any
-other useful information, often with links to the file format specifications
-which were used to develop the plugin.
-
-
-<h3>Calling VMD molfile plugins from your own code</h3>
-Although the molfile plugins were primarily developed for use within VMD,
-they can also be used by other scientific software written 
-in C/C++/Fortran.  They are provided under the 
-<a href=/Research/vmd/plugins/pluginlicense.html>UIUC Open Source License</a>.
-See the 
-<a href="/Research/vmd/plugins/doxygen/">VMD Plugin Programmer's Guide</a> 
-for more information on using VMD plugins in other software.
-
-
-<h3>Molecule Coordinate/Structure File Plugins</h3>
-<ul>
-<li><a href="parmplugin.html">AMBER 4-6 structure file(.parm)</a>
-<li><a href="parm7plugin.html">AMBER 7-9 structure file(.prmtop, .parm7)</a>
-<li><a href="rst7plugin.html">AMBER 7-9 restart file(.rst7)</a>
-<li><a href="babelplugin.html">Babel file translator plugin</a>
-<li><a href="bgfplugin.html">Biograf structure files (.bgf)</a>
-<li><a href="carplugin.html">Insight II/Discover coordinate file (.car)</a>
-<li><a href="corplugin.html">CHARMM coordinate file (.crd)</a>
-<li><a href="psfplugin.html">CHARMM, CNS, NAMD, X-PLOR PSF structure file (.psf)</a>
-<li><a href="gamessplugin.html">GAMESS log file (.log)</a>
-<li><a href="groplugin.html">Gromos 87, Gromacs structure file (.gro)</a>
-<li><a href="g96plugin.html">Gromos 96, Gromacs coordinate and trajectory (.g96)</a>
-<li><a href="https://github.com/h5md/VMD-h5mdplugin">H5MD plugin (.h5)</a>
-<li><a href="namdbinplugin.html">NAMD Restart file (.namdbin)</a>
-<li><a href="mdfplugin.html">Insight II/Discover structure file (.mdf)</a>
-<li><a href="netcdfplugin.html">MMTK NetCDF structure reader (.nc)</a>
-<li><a href="moldenplugin.html">Molden structure files (.molden)</a>
-<li><a href="pdbplugin.html">PDB (Protein Data Bank) files (.pdb)</a>
-<li><a href="pqrplugin.html">PQR (coordinate, charge, and radii) (.pqr)</a>
-<li><a href="mol2plugin.html">SYBYL Mol2 structure files (.mol2)</a>
-<li><a href="tinkerplugin.html">Tinker coordinate and trajectory reader (.arc)</a>
-<li><a href="vaspplugin.html">VASP atomic configurations (.POSCAR, .CONTCAR)</a>
-<li><a href="xbgfplugin.html">VMD XBGF structure files (.xbgf)</a>
-<li><a href="vtfplugin.html">VTF structure files (.vsf, .vcf)</a>
-<li><a href="webpdbplugin.html">WebPDB (web-based PDB downloader)</a>
-<li><a href="xsfplugin.html">XCrySDen, Quantum Espresso XSF/AXSF coordinate files (.axsf, .xsf)</a>
-<li><a href="xyzplugin.html">XYZ coordinate files (.xyz)</a>
-</ul>
-
-<h3>Molecular Dynamics Trajectory File Plugins</h3>
-<ul>
-<li><a href="binposplugin.html">AMBER 'binpos' trajectory reader (.binpos)</a>
-<li><a href="crdplugin.html">AMBER "CRD" trajectory reader (.crd, .crdbox)</a>
-<li><a href="netcdfplugin.html">AMBER NetCDF trajectory reader (.nc)</a>
-<li><a href="dcdplugin.html">CHARMM, NAMD, X-PLOR "DCD" reader/writer (.dcd)</a>
-<li><a href="cpmdplugin.html">CPMD (CPMD trajectory) reader (.cpmd)</a>
-<li><a href="dlpolyplugin.html">DLPOLY HISTORY file reader (.dlpolyhist)</a>
-<li><a href="trrplugin.html">Gromacs TRR/XTC reader (.trr, .xtc)</a>
-<li><a href="tngplugin.html">Gromacs TNG reader (.tng)</a>
-<li><a href="https://github.com/h5md/VMD-h5mdplugin">H5MD plugin (.h5)</a>
-<li><a href="lammpsplugin.html">LAMMPS trajectory reader (.lammpstrj)</a>
-<li><a href="netcdfplugin.html">MMTK NetCDF trajectory reader (.nc)</a>
-<li><a href="vaspplugin.html">VASP trajectories of ionic steps (.xml, .OUTCAR, .XCATCAR)</a>
-<li><a href="vtfplugin.html">VTF trajectory files (.vtf)</a>
-<li><a href="xsfplugin.html">XCrySDen, Quantum Espresso XSF/AXSF trajectory files (.axsf, .xsf)</a>
-<li><a href="xyzplugin.html">XYZ trajectory files (.xyz)</a>
-</ul>
-
-<h3>Volumetric Data/Density/Potential Map Plugins</h3>
-<ul>
-<li><a href="mapplugin.html">Autodock Grid Map File reader (.map)</a>
-<li><a href="avsplugin.html">AVS Field File reader (.fld)</a>
-<li><a href="biomoccaplugin.html">Biomocca volumetric occupancy map reader (.bmcg) </a>
-<li><a href="brixplugin.html">Brix format electron density map reader (.brix)</a>
-<li><a href="ccp4plugin.html">CCP4, MRC format electron density map reader (.ccp4, .mrc)</a> 
-<li><a href="dxplugin.html">Data Explorer (DX) format volumetric grid (.dx) </a>
-<li><a href="grdplugin.html">Delphi, GRASP unformatted binary phimap reader (.grd, .phi)</a>
-<li><a href="phiplugin.html">Delphi, GRASP formatted ASCII phimap reader (.big)</a>
-<li><a href="cubeplugin.html">Gaussian "cube" file reader (.cube)</a>
-<li><a href="gridplugin.html">Molecular Discovery, UHBD GRID map reader (.grid)</a>
-<li><a href="pltplugin.html">gOpenmol PLT format electron density map reader (.plt)</a> 
-<li><a href="dsn6plugin.html">"O" DSN6 format electron density map reader (.ds6, .dsn6, .omap)</a> 
-<li><a href="situsplugin.html">Situs volumetric grids (.sit, .situs)</a>
-<li><a href="spiderplugin.html">SPIDER volumetric images (.spi, .spider)</a>
-<li><a href="uhbdplugin.html">UHBD potential maps (.uhbd)</a>
-<li><a href="vaspplugin.html">VASP charge densities and electron localization functions (.CHGCAR, .ELFCAR, .LOCPOT, .PARCHG)</a>
-<li><a href="edmplugin.html">X-PLOR, CNS format electron density map reader (.cns, .edm, .xplor)</a>
-<li><a href="xsfplugin.html">XCrySDen, Quantum Espresso XSF/AXSF trajectory files (.axsf, .xsf)</a>
-<li><a href="fs4plugin.html">XtalView "fsfour" electron density map reader (.fs, .fs4)</a>
-</ul>
-
-<h3>Graphics Plugins</h3> 
-<ul>
-<li><a href="graspplugin.html">GRASP surface file reader (.grasp, .srf)</a>
-<li><a href="msmsplugin.html">MSMS surface file reader (.face, .vert)</a>
-<li><a href="raster3dplugin.html">Raster3D scene reader (.r3d)</a>
-<li><a href="stlplugin.html">STL solid model triangulated geometry files (.stl)</a>
-</ul>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/lammpsplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/lammpsplugin.html
deleted file mode 100755
index aa2922223e165ac5c91c16a2dc5d161595a8e7dc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/lammpsplugin.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!--#set var="TITLE" value="LAMMPS Plugin, Version 0.18"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads text mode LAMMPS trajectory files (aka dumps) in
-atom style or custom style. Not all fields of the custom style
-output are supported in the molfile API and thus cannot be
-communicated directly to VMD. Also the file format itself allows
-for a variable number of atoms which VMD currently cannot handle.
-Therefore the plugin will stop reading any trajectory file
-with an error message at the first frame that has a different
-number of atoms compared the previous ones.</p>
-
-<p>
-A brief summary of the "atom" LAMMPS trajectory 
-<a href="http://lammps.sandia.gov/doc/dump.html">dump</a> format
-for orthorhombic boxes is below. LAMMPS also supports a
-"custom" dump style that is very similar to the "atom" style,
-but it allows to output a custom selection of a large variety 
-of per-atom properties, including data created by "fix"es
-or "compute"s.  Upon writing VMD will currently only write
-"atom" style dump files.</p>
-
-<p>The characters following the BOX BOUNDS keyword indicate the 
-boundary conditions for each side in x-, y-, and z-direction respectively.
-'p' stands for periodic boundaries, but also 'f' (=fixed), 's' (=shrinkwrap),
-and 'm' (=shrinkwrap with minimum) are possible or combinations 
-thereof. When writing LAMMPS dumps, periodic boundaries are assumed
-if non-zero box dimensions are given; if not, then shrinkwrap
-is assumed and the corresponding lo-/hi-values are determined by 
-the plugin.</p>
-
-<p>Coordinates can be given in different variants: regular or
-as fractional coordinates (indicated by the postfix 's'). Similarly
-can they be output as wrapped back into the principal unitcell
-or unwrapped (indicated by the postfix 'u'). In addition to 
-wrapped coordinates, also the image flags ('ix', 'iy', 'iz')
-that are counters for how many times an atom has passed through
-the cell in the respective direction. In "atom" style dumps, the 
-<a href="http://lammps.sandia.gov/doc/dump_modify.html">dump_modify</a>
-command in LAMMPS can be used to change the output format.
-Multiple coordinate representations can be present in "custom" style 
-dumps. The lammpsplugin will make the best effort to reconstruct 
-unscaled (=regular) and unwrapped coordinates from the available 
-information and the simulation cell dimension information.</p>
-
-<p>If the BOX BOUNDS line also optionally contains the 'xy yz yz'
-flags, then the box is no longer orthorhombic and the corresponding
-'tilt factors' are written out in a 3rd column of numbers in the
-following three lines with the box boundaries. The plugin </p>
-
-<pre>
-ITEM: TIMESTEP
- %d (timestep number)
-ITEM: NUMBER OF ATOMS
-  %d (number of atoms)
-ITEM: BOX BOUNDS pp pp pp
-  %f %f (xlo, xhi)
-  %f %f (ylo, yhi)
-  %f %f (zlo, zhi)
-ITEM: ATOMS id type xs ys zs 
-  %d %d %f %f %f  (atomid, type, x-, y-, z, coordinates)
-  ...
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Triclinic Cells</b>
-<p>Support for automatic unscaling and unwrapping of coordinates
-from simulations using triclinic cells is currently not supported.</p>
-
-<p><b>Unused Data</b>
-<p>This plugin only reads from the available data what is compatible
-with the molfile plugin API. Also in keeping with the plugin API only
-coordinates and velocities are read in for every frame; all other 
-properties are taken from the very first frame. Any additional data 
-recorded for an atom is ignored, unless the environment variable
-LAMMPSREMAPFIELDS is used to replace a supported property with an
-unsupported one. For details see below.</p>
-
-<p><b>Legacy LAMMPS Dump Files</b>
-<p>The LAMMPS dump file format described above corresponds to recent
-versions of LAMMPS. It has been incrementally improved over the years.
-Older versions may not provide all the detail. The plugin will make 
-a best effort to guess missing information, but that may not always 
-produce the desired result.</p>
-
-<p><b>Environment Variables</b>
-<p>
-Some aspects of the behavior of the plugin can be controlled 
-through environment variables, that can be set either externally 
-before launching VMD or from the VMD console via manipulation of
-the <tt>env</tt> array (use "global env;" to access it in a subroutine).</p>
-
-<b>LAMMPSDIPOLE2ATOMS</b>
-<p>With this environment variable set to a number > 0.0 any point dipolar
-particle will be converted into two particles a certain distance away
-from the center and thus signifying the direction of the dipole. The
-numerical value of the LAMMPSDIPOLE2ATOMS environment variable is 
-interpreted as a scaling factor for this conversion with respect to
-the magnitude of the dipole moment.
-</p>
-<b>LAMMPSREMAPFIELDS</b>
-<p>
-This environment variable allows to map certain columns in a LAMMPS
-trajectory file to others and thus allows to read in properies, which
-VMD is normally not able to read. The content of the variable
-is the list of mappings in the format <code>old=new</code> and 
-separated by commas. For example to read in forces into the velocities
-fields, the following mapping is required: <code>vx=fx,vy=fy,vz=fz</code>.
-This approach can be applied to any data in the dump file, even the 
-output from variables, fixes, or computes.
-
-Only the fields for coordinates and velocities will be read and
-stored in every time step and thus a suitable to transferring 
-per timestep data into VMD through this mechanism. In addition
-VMD will read in the fields name, type, mass, radius/diameter, 
-and charge and thus those can also be remapped, but those will
-only be read in on the first timestep. 
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mapplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mapplugin.html
deleted file mode 100755
index ed59b4556725aad5aedbc5b731e092d50e2ea6a0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mapplugin.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--#set var="TITLE" value="MAP Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads 
-<a href="http://www.scripps.edu/pub/olson-web/doc/autodock/">AutoDock</a>
-Grid Map files, used by the package to store potential maps. 
-More information on this file format can be found at 
-<!-- <a href="http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/Using_AutoDock_305.21.html#pgfId=34041">http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/Using_AutoDock_305.21.html#pgfId=34041</a>. -->
-<a href="http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf">http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf</a>.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unit Cell</b>
-<br>This file format only supports orthogonal unit cells.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mdfplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mdfplugin.html
deleted file mode 100755
index 94ec83e6e337e17294f1a138ba80edffd2de4f40..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mdfplugin.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--#set var="TITLE" value="MDF Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-Molecular data file (.mdf) reader
-Insight II, Discover, etc.  Structure and bond information. This plugin
-reads only the topology section, ignoring the optional symmertry and
-atomset sections.
-
-<p>
-Format specification can be found at:
-<a href="http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#484257">
-http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#484257
-</a>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>TODO:</b>
-<br>
-The current code reads the file *four* times -- once on open, once
-to read the structure, and twice to read the bonds. Perhaps these could
-be consolidated, e.g. by counting the bonds and populating the hash
-tables during open or read_structure.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mol2plugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mol2plugin.html
deleted file mode 100644
index 9b64a3c581c5205fe17ac81a4e2a8fbbfa75936f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/mol2plugin.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--#set var="TITLE" value="Mol2 Plugin, Version 0.16"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes molecular coordinate and bonding data 
-stored in the
-<a href="http://www.tripos.com/custResources/mol2Files/">Mol2</a> 
-<a href="http://www.tripos.com/mol2/index.html">Mol2</a>
-file format.
-
-<h3>Notes:</h3>
-
-<p><b>Recognized data</b>
-<br>Only the following record types are currently recognized by the Mol2
-plugin: molecule, atom, and bond. All others are ignored.  The plugin 
-returns charges when they are available, and bond orders for each bond.
-
-<br>The mol2 plugin doesn't currently read SUBSTRUCTURE records which
-contain chain, information, residue names, etc.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/moldenplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/moldenplugin.html
deleted file mode 100644
index 8631dc5c374749b73565639a4ee053cc421b0bce..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/moldenplugin.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!--#set var="TITLE" value="Molden Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads in molecular structures in the file format used 
-<a href="http://www.cmbi.kun.nl/~schaft/molden/molden.html">by Molden</a>.
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/msmsplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/msmsplugin.html
deleted file mode 100644
index 104fccf9afa9aa3e1993a128ac2e6d1cc0926dbf..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/msmsplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="MSMS Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays MSMS surface files described
-by the MSMS vertex and facet output files.
-
-<h3>Notes:</h3>
-This plugin requires both the vertex and the facet file in order
-to successfully load the MSMS surface data.  The two files are
-expected to be named filename.vert and filename.face, as they 
-would be produced by MSMS.
-Since MSMS surface files are a 'finished product' type of data,
-they can't be manipulated very much within VMD when they are
-computed outside of VMD, though they can be displayed.
-
-<p><b>Unused data</b>
-At present, the plugin doesn't provide atom index data from 
-the surface facet file.  The surface is loaded using the active
-user-defined graphics drawing color.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/namdbinplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/namdbinplugin.html
deleted file mode 100644
index 24f90df38a42dd0475d2fec3654d35e52efa6852..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/namdbinplugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="NAMDBin Plugin, Version 0.2"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes NAMD binary restart files produced by 
-   all versions of NAMD dating all the way back to NAMD 1.x. 
-
-<h3>Notes:</h3>
-<p><b>Floating Point Precision</b>
-<p>
-This plugin reads and writes NAMD binary coordinate files, however
-the full precision of coordinates are not maintained in either
-the read or write processes, since the plugin interface currently uses 
-single precision floating point numbers for atom coordinates.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/netcdfplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/netcdfplugin.html
deleted file mode 100755
index e349421fb69c54f08663b2efd5b21aaec1a76646..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/netcdfplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="NetCDF Plugin, Version 0.10"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-The NetCDF plugin reads structure and trajectory data written as
-<a href=http://www.unidata.ucar.edu/software/netcdf/>NetCDF files</a>, by 
-<a href=http://amber.scripps.edu/>AMBER 9</a> and
-<a href=http://dirac.cnrs-orleans.fr/MMTK/>MMTK</a>.  
-  
-<p>
-<h3>Notes:</h3>
-<ul>
-<li>The routines for reading 
-    <a href="http://amber.scripps.edu/formats.html#netcdf">AMBER 9 NetCDF files</a> 
-    accept a subset of the possible combinations of data fields.  
-    In particular, VMD doesn't currently read the AMBER velocity data.
-<li>The MMTK routines currently parse atom data with a simple method that
-    ignores atom grouping information and other high level organization stored
-    in the "description" data.
-</ul>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/parm7plugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/parm7plugin.html
deleted file mode 100755
index 03707cb6385a9b0f1508529d073c0cfc9775353f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/parm7plugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="AMBER 7-11 Parm Plugin, Version 0.13"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads molecular structure in Parm format, used by <a
-  href="http://ambermd.org/">Amber</a> versions 7 through 11.</p>
-
-The Amber file formats are 
-<a href="http://ambermd.org/formats.html">described in detail</a>
-on the Amber home page.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused Data</b>
-<br>The Amber box data is not currently used by VMD. Atom radii are also
-ignored.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/parmplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/parmplugin.html
deleted file mode 100755
index c20dcf687c78f1582758b3b0eba3b3c43bba45eb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/parmplugin.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--#set var="TITLE" value="AMBER 4-6 Parm Plugin, Version 4.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-This plugin reads molecular structure in Parm format, used by <a
-  href="http://ambermd.org/">Amber</a> versions 4-6.
-
-The Amber file formats are 
-<a href="http://ambermd.org/formats.html">described in detail</a> 
-on the Amber home page.
-
-<p>
-<h3>Notes:</h3>
-
-<p>
-<b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.
-
-<p>
-<b>Unused Data</b>
-<br>The Amber box data is not currently used by VMD.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pdbplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pdbplugin.html
deleted file mode 100644
index 6ca126926f7fe44fd19bf70d1935fec4c4c94891..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pdbplugin.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!--#set var="TITLE" value="PDB Plugin, Version 1.16"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes molecular coordinate data stored in the
-RCSB Protein Data Bank
-<a href="http://www.rcsb.org/pdb/file_formats/pdb/pdbguide2.2/guide2.2_frame.html">PDB file format</a>.
-
-<h3>Notes:</h3>
-<p><b>Support for non-standard PDB files</b>
-The PDB plugin will accept a number of variations of the PDB
-file format which are technically violations of the specification.
-These include files containing more than 99,999 ATOM/HETATM records,
-ATOM records with serial number fields extending into the space reserved
-for record keywords, and various other transgressions.
-
-<p><b>ATOM, HETATM records</b>
-The PDB plugin processes all fields in the ATOM and HETATM records.
-
-<p><b>CONECT records</b>
-VMD reads all CONECT records and treats them as an indication of
-"special" bonds that are noteworthy beyond the obvious ones that a
-simple distance based search would find.  VMD reads all of the bonds
-from the CONECT records, and then adds the bonds found by an automatic
-distance search, skipping any duplicates.
-
-<p><b>HEADER record</b>
-The PDB header accession code, data, and classification
-information information are read from the header, but only the 
-accession code and date are returned by the plugin.
-
-<p><b>REMARK records</b>
-All REMARK records are read and returned to VMD by the plugin.
-
-<p><b>Alternate Location Identifiers</b>
-Some PDB files contain ATOM records with non-empty alternate location
-identifiers (AltLoc) which indicate alternative conformations for parts of the
-structure.  VMD 1.8.4 and above reads the AltLoc fields and uses them to 
-prevent generation of spurious bonds between conformations of the structure,
-and to allow differet conformations to be selected using the "altloc" atom
-selection keyword.
-
-<p><b>Interpretation of atom serial numbers</b>
-<br>
-Since PDB files can only store 99,999 atoms without overrunning the
-columns designated for atom indices etc, the PDB plugin doesn't directly 
-use the atom indices specified in the PDB file as its own indices, instead 
-it keeps its own independent atom index counter, allowing it to read files
-containing millions of atoms.  The atom index field for atoms beyond 99,999
-may contain alphanumeric characters, or some other unique string scheme,
-as has commonly been used in software such as X-PLOR/CNS, and other packages.
-</p>
-
-<p><b>Unit Cell</b>
-<br>
-The PDB plugin reads in the CRYST1 unit cell information for use with 
-periodic image display when available. 
-
-<p><b>Multi-structure PDB files</b>
-The PDB plugin reads multi-structure PDB files and treats them 
-as an trajectory of atom positions, if each structure contains
-the same number of atoms.  If the subsequent structures have mismatched
-atom counts, only the first structure is returned.
-
-<p><b>Unused data</b>
-<br>
-Various PDB record types and fields are ignored by VMD, in general
-VMD doesn't do anything with the sequence data or crystallography-specific 
-fields in the format presently.  
-<br>
-All unused PDB records are returned as remark data by the PDB plugin,
-allowing this information to be parsed and accessed by plugins.
-While somewhat hackish and generally not how we'd prefer to do things,
-much of the information provided in PDB files is fairly free format,
-or provided in REMARK lines anyway, so this provides a means of getting
-at it, for plugins that are crafty enough to read this information.
-</p>
-
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/phiplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/phiplugin.html
deleted file mode 100755
index 30594a8998cc5b08aa72cdcac0d21021548efcac..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/phiplugin.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--#set var="TITLE" value="PHI Plugin, Version 0.7"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads "formatted ASCII" '.big' potential maps created by the
-<a href="http://www.msg.ucsf.edu/local/programs/insightII/doc/life/insight2000.1/delphi/B_Utilities.html#696658">format_phi</a> utility, or the 
-<a href=http://www.csb.yale.edu/userguides/datamanip/delphi/manual.html#ASCIIPHI>ASCIIPHI</a> utility.
-
-To read the "unformatted" binary phi maps produced by DelPhi, use the 
-<a href="grdplugin.html">grdplugin</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Grid Points</b>
-<br>It is assumed that the density values of all files are arranged in a
-cubic grid.</p>
-
-<p><b>Unit Cell</b>
-<br>Since ASCII PHI maps do not explicitly state the angles of the basis 
-vectors, it is assumed that they are orthogonal.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pltplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pltplugin.html
deleted file mode 100755
index 01fecefcc4134451b9436a7953633f916721f38c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pltplugin.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--#set var="TITLE" value="PLT Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the PLT format used by 
-<a href="http://www.csc.fi/gopenmol/">gOpenMol</a>. 
-More information on this file format can be found at 
-<a href="http://www.csc.fi/gopenmol/developers/plt_format.phtml">http://www.csc.fi/gopenmol/developers/plt_format.phtml</a>.</p>
-  
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>VMD ignores the "surface type" value.</p>
-
-<p><b>Unit Cell</b>
-<br>Since PLT files don't contain any information about the geometry of the
-unit cell, it is assumed that the basis vectors are orthogonal.</p>
-
-<p><b>ASCII and Binary Files:</b>
-<br>This plugin can read binary plt files regardless of the byte-order of
-the platform used to create them. It does not currently support the
-"formatted ASCII" files used by the <tt>pltfile</tt> program included with
-gOpenMol.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pqrplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pqrplugin.html
deleted file mode 100644
index 1eab7bd285804663a51f503ce77e130a495bd6a6..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/pqrplugin.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--#set var="TITLE" value="PQR Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes molecular coordinate data stored in the PQR
-file format. This variant of the PDB format contains atom charge and radius
-information, and does not store many of fields found in PDB files.
-
-<h3>Notes:</h3>
-The PQR files written by this plugin currently contain the same radius and
-charge information used for VMD's internal atom representation. Since this
-may not be appropriate for some applications, it may be necessary to
-override these values in VMD using atomselect commands. Consult the VMD
-User's Guide for information on changing atom data using atomselections.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/psfplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/psfplugin.html
deleted file mode 100644
index 656da5931148f3597aa336c0395228ef447e62bd..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/psfplugin.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--#set var="TITLE" value="PSF Plugin, Version 1.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes the PSF ASCII structure file format
-   used by CHARMM, CNS, NAMD, and X-PLOR.
-
-<h3>Notes:</h3>
-<p><b>CHARMM extensions</b>
-<br>
-The current versions of the PSF plugin support the 
-Charmm31 CMAP, CHEQ, and EXT extensions when reading, but
-only the CMAP extension is supported for writing.
-
-<p><b>Bonds</b>
-<br>
-Bond information is read and written by the PSF plugin.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/raster3dplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/raster3dplugin.html
deleted file mode 100644
index 91317b3b89e0fd411e3d589c0e95324532136c90..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/raster3dplugin.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--#set var="TITLE" value="Raster3D Plugin, Version 0.2"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays Raster3D scene files in VMD.  
-  
-<h1>Notes:</h1>
-<p><b>Unused data</b>
-<br>
-The Raster3D scene file format has changed, adding new features and
-capabilities over the last few years.  VMD supports a limited 
-subset of these features, those geometric and scene description 
-elements that are representable within VMD's rendering built-in
-system.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/rst7plugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/rst7plugin.html
deleted file mode 100755
index 783a0cd8ac114d33b361b62c56784685e09ca579..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/rst7plugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="Amber 7-11 Restart File Plugin, Version 0.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes 
-<a href="http://amber.scripps.edu/">Amber</a> 'coord' restart files for
-AMBER versions 7 through 11.
-More information can be found at 
-<a href="http://ambermd.org/formats.html#restart">http://ambermd.org/formats.html#restart</a>.</p>
-  
-<h3>Notes:</h3>
-
-<p><b>Unused data</b>
-<br>Velocity and periodic box information are not presently used by VMD.</p>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/situsplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/situsplugin.html
deleted file mode 100755
index 7676eaef382d237e086161958ec42cb7a53be6cf..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/situsplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="Situs Plugin, Version 1.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the 
-<a href="http://situs.biomachina.org/">Situs format</a>.
-
-The Situs map format is quite simple and constists of ASCII floating
-point numbers:
-<ul>
-<li>voxel size in Angstroms
-<li>coordinates of first voxel
-<li>integer X/Y/Z counts
-<li>voxels follow in X fastest, Y next fastest, Z slowest
-</ul>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/spiderplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/spiderplugin.html
deleted file mode 100755
index 6cd9b827d4164901f8437201a2bbc103c6bad222..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/spiderplugin.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--#set var="TITLE" value="SPIDER Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads volumetric data sets produced with the
-<a href=http://www.wadsworth.org/spider_doc/spider/docs/master.html>SPIDER</a>
-image processing system.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Format Specification</b>
-<br>
-File format specifications for SPIDER volumetric datasets are 
-<a href="http://www.wadsworth.org/spider_doc/spider/docs/image_doc.html">available online</a>.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/stlplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/stlplugin.html
deleted file mode 100755
index 54b912bfb83a7fd399478f30f206fefc9e87bddb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/stlplugin.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--#set var="TITLE" value="STL Plugin, Version 2.0"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads and displays files in STL (stereo lithography) format, the
-standard data format for automated fabricators. This format uses triangles
-exclusively to to represent 3-D geometry. More information can be found at 
-<a href="http://rpdrc.ic.polyu.edu.hk/old_files/stl_introduction.htm">http://rpdrc.ic.polyu.edu.hk/old_files/stl_introduction.htm</a>.</p>
-and at
-<a href="http://www.csit.fsu.edu/~burkardt/data/stla/stla.html">http://www.csit.fsu.edu/~burkardt/data/stla/stla.html</a>
-  
-<h3>Notes:</h3>
-
-<p><b>Unused data</b>
-<br>The STL specification dictates that the normal for each facet is to be
-stored with the vertex coordinates. Since this information is superfluous, it
-is ignored by the plugin.</p>
-
-<p><b>ASCII and Binary STL Files</b>
-<br>Currently, there is no support for the 
-<a href="http://www.csit.fsu.edu/~burkardt/data/stlb/stlb.html">binary STL format</a>. 
-Only files in the ASCII format can be read.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/template.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/template.html
deleted file mode 100755
index 6e0c5c57b95045780687f9d25b295a06e8ed3cc6..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/template.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--#set var="TITLE" value="FOO Plugin, Version 0.1"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-This plugin lorem ipsum.
-  
-<p>
-<h1>Feature-specific notes:</h1>
-<p>
-<b>Note 1:</b>
-<br>Lorem ipsum
-
-<b>Note 2:</b>
-<br>dolor sit amet
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/tinkerplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/tinkerplugin.html
deleted file mode 100755
index 412023b9c7bc9554684b417f26d0426c3e07b9d1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/tinkerplugin.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--#set var="TITLE" value="Tinker Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads 
-<a href="http://dasher.wustl.edu/tinker/">Tinker</a> 
-files, a minimalistic plain text file format for storing molecular 
-coordinates, bonds, angles, and torsions. 
-
-<p>
-A brief summary of the format, as read by VMD follows:
-<pre>
-    Tinker molecule file format:
-    [ N ] ...             # of atoms, and molecule name
-    idx1 atom1 x y z ...  atom index, followed by name, xyz coords,
-    idx2 atom2 x y z ...  atom type index, bond, angle, torsion
-    ...
-    idx3 atomN x y z ... 
-                        
-    Note that this plugin only reads the atom name and coordinate fields, 
-    all other fields are ignored at present.
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Trajectories</b>
-<br>Tinker files can contain multiple timesteps. All timesteps, however 
-have to have the same number of atoms. Also the atoms must be in the same
-order, only the first timestep will be used to read the element names.
-Only the coordinates will be read fom successive timesteps.
-</p>
-
-<p><b>Unused Data</b>
-<br>This plugin only reads the label and coordinates for each atom. Any
-additional data recorded for an atom is ignored.</p>
-
-<p><b>Atom Count</b>
-<br>VMD requires that the first non-comment line of the file contain the
-number of atoms.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/tngplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/tngplugin.html
deleted file mode 100755
index 0a30b68ad411f9801fecc0d9dfafc4d8a809e96f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/tngplugin.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!--#set var="TITLE" value="Gromacs TNG Plugin, Versions 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>These plugins read the portable TNG binary trajectory file formats used by 
-<a href="http://www.gromacs.org/">GROMACS</a>. 
-The TNG file format is explained in detail in
-<a href="http://onlinelibrary.wiley.com/doi/10.1002/jcc.23495/abstract">
-"An efficient and extensible format, library, and API for
- binary trajectory data from molecular simulations"</a>
-  and more information can be found at
-<a href="http://manual.gromacs.org/online/tng.html">http://manual.gromacs.org/online/tng.html</a>.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/trrplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/trrplugin.html
deleted file mode 100755
index f2a744e04d1ada117467d3edcb9aabb1e61290c5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/trrplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="TRR/XTC Plugin, Versions 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>These plugins read the portable binary trajectory file formats used by <a
-  href="http://www.gromacs.org/">GROMACS</a>. The xtc file format is explained
-  in detail at <a
-    href="http://www.gromacs.org/documentation/reference_3.1/online/xtc.html">http://www.gromacs.org/documentation/reference_3.1/online/xtc.html</a>,
-  and more information on the trr file format can be found at <a
-    href="http://www.gromacs.org/documentation/reference_3.1/online/trr.html">http://www.gromacs.org/documentation/reference_3.1/online/trr.html</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>These plugins are used only to read files. VMD does not currently
-support writing these file types.</p>
-
-<p><b>Unused data</b>
-<br>Velocities, forces, and energies stored in the trajectory file are
-ignored by VMD.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/uhbdplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/uhbdplugin.html
deleted file mode 100755
index 9e705a0d3391f7305f375db01aeac94c5dd0a7fe..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/uhbdplugin.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!--#set var="TITLE" value="UHBD Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electrostatic potential maps stored in the UHBD format.
-
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/vaspplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/vaspplugin.html
deleted file mode 100644
index d49b970a0df49afc774f35020afd680cfa1f158d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/vaspplugin.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!--#set var="TITLE" value="VASP Plugins, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-<a href="http://www.uni-ulm.de/~ssakong/vmdplugins">VASP plugins</a>
-are developed to read 
-<a href="http://cms.mpi.univie.ac.at/vasp/">VASP input/output files</a>
-and display atomic/charge configurations/trajectories in VMD.
-
-<p>
-What can I do with VASP plugins?
-
-<p>
-If you are VASP user and tired to use converting scripts output data 
-to pdb and xyz format to visualize it, then VASP plugins for VMD 
-natively handles following file formats:
-<ul>
-<li>vasprun.xml/OUTCAR : Plot trajectory of each ionic steps.
-<li>POSCAR/CONTCAR : Display atomic configuration.
-<li>XDATCAR : Plot trajectory of each ionic step.
-<li>CHGCAR/LOCPOT/ELFCAR/PARCHG : Display isosurfaces of charge density 
-    and electron localization function (ELF).
-</ul>
-
-<p>
-For further information, visit Sung Sakong's 
-<a href="http://www.uni-ulm.de/~ssakong/vmdplugins">VASP plugin home page</a>
-
-<p>
-<h3>Known bugs</h3>
-<ul>
-<li>Occassionally OUTCAR read plugin has problems recognizing atom types.
-I am using atomic mass to recognize the type of atom, but POTCAR files 
-contain POMASS values which is somewhat different from widely used
-atomic mass. I cannot match each atom type between periodic_table.h
-and POTCARs. Thus, I set a margin of 0.01 for atomic mass recognition 
-routine. It works for most of atoms, however in several POTCARs the 
-margin is not sufficient.
-<li>I found that file structure of vasprun.xml is frequently changed. I am 
-not so sure whether xml read plugin will work with next version VASP, 
-or not.
-</ul>
-
-<p>
-<h3>Fixed bugs</h3>
-<ul>
-<li>Memory leak is fixed. Common data structure for VASP data is designed 
-    by Rob Lahaye. (June 29, 2006)
-<li>CHGCAR plugin reads spin polarized charge again. (May 18, 2006)
-<li>VMD can save the coordinates in POSCAR. (May 17, 2006)
-<li>Plugins for VMD 1.8.4 are ready. I thank Rob Lahaye <lahaye at skku.edu> 
-    for many debugging and good advices. (May 15, 2006)
-<li>CHGCAR plugin reads 3d-mesh properly. (April 27, 2006)
-</ul>
-
-<p>                                       
-<h3>Bug report</h3>
-Sung Sakong (sung.sakong at uni-ulm.de)
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/vtfplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/vtfplugin.html
deleted file mode 100755
index 37081a62ccc09c78199ba95f8ef7f9cf0a9c9d16..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/vtfplugin.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--#set var="TITLE" value="VTF Plugin, Version 1.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-The plugin reads files written in the VTF 
-trajectory/structure/coordinate format, which is described in 
-<a href="https://github.com/olenz/vtfplugin/wiki/VTF-format">more detail here</a>.
-
-The format was designed especially for VMD and is useful for hand-written 
-simulation codes and coarse-grained simulations. It is currently used by the 
-<a href="http://espressomd.org/">ESPResSo</a> coarse-grained
-simulation package.
-
-<h3>Notes:</h3>
-<p>
-<b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/webpdbplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/webpdbplugin.html
deleted file mode 100644
index 72eed6a72b27d670bf204764fb7d926ebab1f8c4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/webpdbplugin.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--#set var="TITLE" value="WebPDB Plugin, Version 1.15"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin automatically downloads PDB structures over the web,
-   and loads them into VMD.  Structures are specified by their 
-   four-letter PDB accession code.
-
-<p>This plugin depends on Tcl in order to run.  On MacOS X and
-   Windows this means that the plugin must be able to find the
-   dyanmic link libraries for Tcl by automatic means.
-
-<h3>Notes:</h3>
-<p><b>PDB Format</b>
-This plugin shares the same behavior and limitations with the
-standard <a href="pdbplugin.html">PDB Plugin</a>.
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xbgfplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xbgfplugin.html
deleted file mode 100755
index 01b8451c26ed53c43b08744a0eda75df2650fa18..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xbgfplugin.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!--#set var="TITLE" value="XBGF Plugin, Version 0.13"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-The "xbgf" plugin is a modified version of the biograf file format
-used by various structure building tools in VMD.  It doesn't exist as
-a format out in the wild, and the files are only intended to be used
-internally, between these structure building tools.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xsfplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xsfplugin.html
deleted file mode 100644
index c1334d05fdb855d7def212d4795eadffce82e742..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xsfplugin.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!--#set var="TITLE" value="XSF Plugin, Version 0.7"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads the regular and the animated form of XCrySDen structure
-files (.xsf and .axsf) as they are read and written by the 
-<a href="http://www.xcrysden.org/">XCrySDen</a> visualization 
-program and created by the <a href="http://www.quantum-espresso/">Quantum Espresso</a>
-(also known as <a href="http://www.pwscf.org/">PWScf</a>)
-package of plane wave DFT based electronic 
-structure and MD programs. The format allows storing of atomic
-data with or without periodicity in 1, 2, or 3 dimensions, variable
-cell size trajectories and multiple 2d, and 3d grid data set.
-See the extensive
-<a href="http://www.xcrysden.org/doc/XSF.html">format description</a>
-on the XCrySDen home page for more details.
-
-<h3>Notes:</h3>
-
-<p><b>Trajectories</b>
-<br>This plugin supports animation XSF files (axsf) even in 
-combination with grid data sets.  All timesteps, however 
-have to have the same number of atoms (VMD does not support this
-currently anyways). Also the elements have to always be in the same
-order, only the first timestep will be used to read the element names.
-From all successive timesteps only the coordinates will be read.
-
-<p><b>Coordinate Rotation / Periodic Display</b>
-<br>VMD currently can only display periodic images of the 
-unit cell correctly, if the first cell vector is collinear
-with the x-axis and the second cell vector in the xy-plane.
-Upon loading of the xsf file, the coordinates and the 
-grid vectors are rotated accordingly. Unfortunately, that
-may make the atomic positions incompatible to some other
-coordinate files containing matching coordinates, but no
-unit cell information.
-
-<p><b>Atom Masses</b>
-<br>The plugin assigns masses to the atoms according to the 
-natural isotope distribution of the elements (see e.g.
-<a href="http://www.webelements.com/">http://www.webelements.com/</a>).
-If an element could not been recognized, a mass of 0 is assigned.
-To set the mass for those elements or assign a different mass for
-the other atoms, you have to use to create a selection with
-<b>atomselect</b> and then use the selection subcommands to set
-the mass.
-
-<p><b>Conventional Cell Coordinates</b>
-<br>This plugin currently only reads the primitive unit
-cell vectors and coordinates. Data for the conventional
-cell will be ignored.
-
-<p><b>2D Data Grids</b>
-<br>VMD does not currently provide visualizations for 
-two-dimensional data grids or means to store them, so this
-plugin ignores those data sets.
-
-<p><b>Incompatibilities</b>
-<br>The plugin follows the description of the format on the XCrySDen
-homepage, but due to the differences between the parsers, files that may
-be readable without a problem in XCrySDen, will not read completely or
-correctly by this plugin. A few examples were already spotted 'in the
-wild' and the required amendmends to the plugins were made.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xyzplugin.html b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xyzplugin.html
deleted file mode 100755
index 3eb8f178285f10fc9e5196a9f2e4c173ba721873..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/doc/xyzplugin.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!--#set var="TITLE" value="XYZ Plugin, Version 1.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads and writes XYZ files, a minimalistic plain text format for
-storing molecular coordinates. The format basically follows the format,
-that was read and written by the old XMol program, but also tries to
-be as compatible as possible to other variations of the XYZ format.
-
-<p>
-A brief summary of the format, as read by VMD follows:
-<pre>
-    XYZ molecule file format:
-      XYZ files are a simple molecule file format suitable for output
-      by homegrown software since they are very minimalistic.  They don't
-      even include bonding information.
-  
-    [ # optional comment line ] comment line (can be blank)
-                                ^^^ NOTE: comment lines aren't supported by 
-                                    the current version of this plugin.
-    [ N                       ] # of atoms, required by this xyz reader plugin
-    [ molecule name           ] name of molecule (can be blank)
-    atom1 x y z [optional data] atom name followed by xyz coords
-    atom2 x y z [ ...         ] and and (optionally) other data.
-    ...                         instead of atom name the atom number in
-    atomN x y z [ ...         ] the PTE can be given.
-                        
-    Note that this plugin currently ignores everything following the z 
-    coordinate (the optional data fields).
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Trajectories</b>
-<br>XYZ files can contain multiple timesteps. All timesteps, however 
-have to have the same number of atoms (VMD does not support this
-currently anyways). Also the elements have to always be in the same
-order, only the first timestep will be used to read the element names.
-From all successive timesteps only the coordinates will be read.
-</p>
-
-<p><b>Unused Data</b>
-<br>This plugin only reads the label and coordinates for each atom. Any
-additional data recorded for an atom is ignored.</p>
-
-<p><b>Atom Count</b>
-<br>VMD requires that the first non-comment line of the file contain the
-number of atoms.</p>
-
-<p><b>Ordinal Numbers</b>
-<br>Atoms in an XYZ file can be labeled with either the atom name or ordinal
-number.</p>
-
-<p><b>Atom Masses</b>
-<br>The plugin assigns masses to the atoms according to the 
-natural isotope distribution of the elements (see e.g.
-<a href="http://www.webelements.com/">http://www.webelements.com/</a>).
-If an element name could not been recognized, a mass of 0 is assigned.
-To set the mass for those elements or assign a different mass for
-the other atoms, you have to use to create a selection with
-<b>atomselect</b> and then use the selection subcommands to set
-the mass.
-
-<p><b>Incompatibilities</b>
-<br>XYZ file as they are produced by the <a href="http://dasher.wustl.edu/tinker/">Tinker</a> package are <b>not</b> compatible to this plugin. Also some other
-XYZ format versions, that are missing the atom count or the title line
-will not work. You have to either convert them to a different format,
-that is understood by VMD or add the missing information.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Entries
deleted file mode 100644
index dc524ff1e227353031dd1ca2920de48385bc8554..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Entries
+++ /dev/null
@@ -1,5 +0,0 @@
-/Makefile/1.1/Fri Mar 10 22:48:47 2006//
-/README/1.1/Fri Mar 10 22:40:59 2006//
-/f77_molfile.c/1.1/Fri Mar 10 22:48:49 2006//
-/tester.f/1.1/Fri Mar 10 22:48:49 2006//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Repository
deleted file mode 100644
index c6a4f7e0afae2a6c1c40c571ea2b68b628ca01f3..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/f77
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/Makefile b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/Makefile
deleted file mode 100644
index 4162302e825ef4729e90b5d0df29e6d40fd031cc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-# hello emacs this is a -*- makefile -*-
-# $Id: Makefile,v 1.1 2006/03/10 22:48:47 johns Exp $
-########################################################################
-ARCH           = LINUX
-ARCHDIR        = ../../compile/lib_$(ARCH)/molfile
-#FC            = gfortran
-FC             = g77 #-fno-second-underscore
-CC             = gcc
-LD             = $(FC)
-OPT            = -O2 -Wall
-CPPFLAGS       = -I../../include -I$(ARCHDIR) -D_F77_F2C_UNDERSCORE
-CFLAGS         = -c $(CPPFLAGS) $(OPT)
-FFLAGS         = -c $(OPT)
-NETCDFLIB      = -L../../../vmd/lib/netcdf/lib_LINUX
-NETCDFLDFLAGS  = -lnetcdf
-TCLLIB         = -L../../../vmd/lib/tcl/lib_LINUX
-TCLLDFLAGS     = -ltcl8.4
-LDFLAGS        = -L$(ARCHDIR) $(TCLLIB) $(NETCDFLIB)
-LDLIBS         =  -lmolfile_plugin $(NETCDFLDFLAGS) $(TCLLDFLAGS) -lstdc++ -ldl
-########################################################################
-OBJECTS  = tester.o f77_molfile.o 
-
-default: tester
-
-tester: $(OBJECTS)
-	$(FC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
-
-clean:
-	rm -f tester $(OBJECTS)
-########################################################################
-# pattern rules
-.SUFFIXES:
-.SUFFIXES: .c .f .o
-
-.c.o:
-	$(CC) $(CFLAGS) $< -o $@
-
-.f.o:
-	$(FC) $(FFLAGS) $< -o $@
-
-# dependencies
-tester.o     : tester.f
-f77_molfile.o: f77_molfile.c
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/README b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/README
deleted file mode 100644
index 22847ba6a39755aefeed5df27a62c7873049620c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/README
+++ /dev/null
@@ -1,87 +0,0 @@
-
-Fortran bindings for the VMD molfile plugins. v0.01
-Quick and dirty instructions, feel free to improve.
-
-Copyright 2006 (c) Axel Kohlmeyer <akohlmey@cmm.chem.upenn.edu>
-
-
-1. Compilation/Configuration/Compatibility
-
-a) compile the molfile plugins in the usual way.
-b) edit the config section of the Makefile:
-   - set your architecure, c and fortran compiler
-   - set fortran name mangling via define in CPPFLAGS.
-     no define            : fortran names are lowercase and 
-                            one underscore appended
-     -D_F77_NO_UNDERSCORE : fortran names are lowercase and
-                            without underscore appended
-     -D_F77_F2C_UNDERSCORE: fortran names are lowercase and 
-                            follow f2c/g77 underscoring conventions
-   - currently only Sun string length conventions (i.e. the length
-     of the strings is added to the list of arguments after all
-     other arguments) are supported.
-c) type: make
-   this will compile the interface code and a test/example program,
-   which will combine the interface with the static molfile lib.
-   if it does not link, see b) 
-d) adapt and try the tester with your own files.
-e) tested platforms: 
-   - Linux 32-bit with gcc/g77/gfortran, VMD-1.8.4b12cvs.
-
-2.) Usage/API
-
-a) currently only reading coordinates and static plugins are
-   supported. more to come...
-
-b) usage:
-   - you have to initialize the plugins and the interface by:
-     call f77_molfile_init
-
-   - to open a file for reading do:
-     call f77_molfile_open_read(handle, natom, infile, intype)
-     'handle' is of type integer*4 and a file descriptor 
-     (i.e. like an i/o channel) that identifies this file 
-     and will be set by the subroutine and has to be used
-     for all consecutive operations on the same opened file.
-     note that this number is not connected in any way whatsorever
-     to a fortran i/o channel number.
-     'natom' is of type integer*4 and will contain the number
-     of atoms in the opened file on exit.
-     'infile' is of type character*(*) and contains the
-     name of the file to open.
-     'intype' is the file type. it can be any valid molfile
-     plugin name or 'auto' for automatic detection based on
-     the filename extension. first matching plugin wins.
-
-    - to read a set of coordinates do:
-     call f77_molfile_read_next(handle, natom, xyz, box, status);
-     'handle' is the handle from the call to f77_molfile_open().
-     'natom' is the number of atoms from the call to f77_molfile_open().
-     'xyx' is an array of type real*4 and will contain the 
-     coordinates in angstrom after the successful read. the coordinates 
-     are stored in the order x(1),y(1),z(1),x(2),y(2),z(2),...
-     so xyz(:) has to be at least of size 3*natom.
-     'box' is of type real*4(6) and contains the box dimensions 
-     as, a, b, c, alpha, beta, gamma with a,b,c in angstrom and 
-     alpha, beta, gamma in degrees.
-     'status' is of type integer*4 and if set to zero on enter
-     will instruct the reader to skip this frame.
-     on exit it will be set to zero if there was a problem or
-     to 1 on success.
-
-    - to close the file do:
-    call f77_molfile_close_read(handle)
-    this will clear the file descriptor for the corresponding 
-    open call and close the file.
-     
-
-3.) Implementation and Limitations
-   The current implementation does use static variables
-   and arrays to handle the list of plugins, and concurrent
-   open files. so the code is not meant to be thread safe. 
-   If you want to use more plugins and use more simultaneously
-   open files, you can add -DMAXPLUGINS=<your number> and/or
-   -DMAXHANDLES=<your number> to CPPFLAGS, make clean and recompile.
-   
-
-2006/02/16.
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/f77_molfile.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/f77_molfile.c
deleted file mode 100644
index 1bb6aee33f8e61628d32f88fa160be5f8813234f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/f77_molfile.c
+++ /dev/null
@@ -1,363 +0,0 @@
-
-/* 
- * molfile fortran interface
- * $Id: f77_molfile.c,v 1.1 2006/03/10 22:48:49 johns Exp $
- * (c) 2006 Axel Kohlmeyer <akohlmey@cmm.chem.upenn.edu>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "libmolfile_plugin.h"
-#include "vmdplugin.h"
-
-#define F77TESTME 1
-
-/* fortran name mangling */ 
-#if defined(_F77_NO_UNDERSCORE)
-#define FNAME(n) n
-#elif defined(_F77_F2C_UNDERSCORE)
-#define FNAME(n) n ## __
-#else
-#define FNAME(n) n ## _
-#endif
-
-/* interface typedef magic */
-typedef int int4;
-
-struct molfile_f77_handle 
-{
-    void  *handle;
-    const char *fname;
-    const char *ftype;
-    molfile_plugin_t *plugin;
-};
-typedef struct molfile_f77_handle f77_fd;
-
-/* plugin list */
-#ifndef MAXPLUGINS
-#define MAXPLUGINS 200
-#endif
-static int numplugins=0;
-static molfile_plugin_t *plugin_list[MAXPLUGINS];
-
-/* we maintain a static list of assigned handles */
-#ifndef MAXHADNLES
-#define MAXHANDLES 200
-#endif
-static int4 numhandles=0;
-static f77_fd handle_list[MAXHANDLES];
-
-/* helper functions */
-/* helper function to copy fortran style (a la sun fortran) strings into
- * valid c style strings. just using the string pointers will not work,
- * since the strings are NOT zero terminated.
- *
- * WARNING: do not forget to free(2) them later, 
- * or you'll have a memory leak!
- */
-static char *f77strdup(const char *s,const int sz)
-{
-    char *r;
-
-    r = (char *)malloc(sz + 1);
-    r = (char *)memcpy(r, s, sz);
-    r[sz] = '\0';
-    return r;
-}
-
-/* trim off whitespace at the end of a string */
-static void f77trim(char *s,const int sz)
-{
-    int i;
-
-    i=1;
-    while( (i++ < sz) && isspace(s[sz-i]) ) {
-        s[sz-i] ='\0';
-    }
-}
-
-/* get the filename extension */
-static const char *f77getfnext(const char *s)
-{
-    int i,len;
-
-    len = strlen(s);
-    for (i=len; i>=0; --i) {
-        if(s[i] == '.') {
-            return &s[i+1];
-        }
-    }
-    return NULL;
-}
-
-/* check validity of plugins and register them. */
-static int f77register(void *ptr, vmdplugin_t *plugin) {
-
-    if (!plugin->type || !plugin->name || !plugin->author) {
-        fprintf(stderr," skipping plugin with incomplete header\n");
-        return -1;
-    }
-
-#if F77TESTME    
-    fprintf(stderr, " trying to register plugin #%d: %s,  type:    %s/%d\n"
-            " written by: %s\n\n", numplugins+1, plugin->name, 
-            plugin->type, plugin->abiversion, plugin->author);
-#endif
-
-    if (plugin->abiversion != vmdplugin_ABIVERSION) {
-        fprintf(stderr, " skipping plugin with incompatible ABI:%d/%d\n",
-                plugin->abiversion, vmdplugin_ABIVERSION);
-        return -2;
-    }
-
-    if (0 != strncmp(plugin->type, "mol file", 8)) {
-        fprintf(stderr, " skipping plugin of incompatible type:%s\n",
-                plugin->type);
-        return -3;
-    }
-
-    if (numplugins < MAXPLUGINS) {
-        plugin_list[numplugins] = (molfile_plugin_t *) plugin;
-        ++numplugins;
-        return 0;
-    }
-    
-    fprintf(stderr, " too many plugins: %d. increase MAXPLUGINS, "
-            "recompile, and try again.\n", numplugins);
-    
-    return -4;
-}
-
-
-/* the official fortran API */
-
-/* register all available plugins and clear handles. */
-void FNAME(f77_molfile_init)(void) 
-{
-    int i;
-    
-    MOLFILE_INIT_ALL;
-
-    for (i=0; i<MAXHANDLES; ++i) {
-        handle_list[i].handle = NULL;
-    }
-
-    MOLFILE_REGISTER_ALL(NULL,f77register);
-
-    /* 
-     * FIXME: check all plugins and make 
-     * sure the babel plugin(s) are last.
-     */
-}
-
-/* unregister all available plugins */
-void FNAME(f77_molfile_finish)(void) 
-{
-#if 0
-    int i;
-
-    /* FIXME: add code to close and nullify all open handles */
-    for (i=0; i<MAXHANDLES; ++i) {
-        handle_list[i] = NULL;
-    }
-#endif
-
-    MOLFILE_FINI_ALL;
-}
-
-
-/* open a file and provide file descriptor */
-void FNAME(f77_molfile_open_read)(int4 *handle, int4 *natoms,
-                        const char *infile, const char *intype, 
-                        const int len_if, const int len_it)
-{
-    char *fname, *ftype;
-    molfile_plugin_t *plugin;
-    int i;
-    
-    if (numhandles >= MAXHANDLES) {
-        fprintf(stderr, "too many molfile f77 handles.\n");
-        *handle = -666;
-        return;
-    }
-
-    fname = f77strdup(infile, len_if);
-    f77trim(fname,len_if);
-    
-    ftype = f77strdup(intype, len_it);
-    f77trim(ftype,len_it);
-            
-    fprintf(stderr, " %s: trying for: %s/%d, %s/%d\n", 
-            __FUNCTION__, fname, len_if, ftype, len_it);
-
-    plugin = NULL;
-    /* determine plugin type automatically */
-    if(0 == strncmp(intype, "auto", 4)) {
-        const char *fext;
-        
-        fext = f77getfnext(fname);
-        if (fext == NULL) {
-            fprintf(stderr, " could not determine file name extension "
-                    "for automatic plugin guess\n");
-            *handle = -111;
-            return;
-        }
-#if F77TESTME
-        fprintf(stderr, " filename extension: %s\n", fext);
-#endif
-
-        for (i=0; (i<numplugins) && plugin==NULL; ++i) {
-#if F77TESTME
-            fprintf(stderr, " tying filename extension: %s\n",
-                    plugin_list[i]->filename_extension);
-#endif
-            if (0 == strcmp(plugin_list[i]->filename_extension, fext)) {
-                fprintf(stderr, " using plugin: %s\n", 
-                        plugin_list[i]->prettyname);
-                
-                plugin = plugin_list[i];
-            }
-        }
-        if (plugin == NULL) {
-            fprintf(stderr, " could not determine matching plugin type"
-                    "from file name extension\n");
-            *handle = -222;
-            return;
-        }
-    } else {
-        
-        for (i=0; (i<numplugins) && (plugin==NULL); ++i) {
-#if F77TESTME
-            fprintf(stderr, " tying plugin type: %s\n",
-                    plugin_list[i]->name);
-#endif
-            if (0 == strcmp(plugin_list[i]->name, ftype)) {
-                fprintf(stderr, " using plugin: %s\n", 
-                        plugin_list[i]->prettyname);
-                plugin = plugin_list[i];
-            }
-        }
-        if (plugin == NULL) {
-            fprintf(stderr, " could not find plugin for type %s\n",ftype);
-            *handle = -333;
-            return;
-        }
-    }
-    
-    if(plugin == NULL) { /* this should not happen, but... */
-        fprintf(stderr, " no plugin found.\n");
-        *handle = -444;
-        return;
-    }
-    
-    /* build handle */
-    ++numhandles;
-    for (i=0; i<numhandles; ++i) {
-        if(handle_list[i].plugin == NULL) {
-            *handle = i;
-            handle_list[i].fname=fname;
-            handle_list[i].ftype=plugin->name;
-            handle_list[i].plugin=plugin;
-        }
-    }
-
-    /* open file for reading and detect number of atoms */
-    *natoms=MOLFILE_NUMATOMS_UNKNOWN;
-    handle_list[*handle].handle= 
-        plugin->open_file_read(fname,plugin->name,natoms);
-    if(handle_list[*handle].handle == NULL) {
-        fprintf(stderr, " open of %s-plugin for file %s failed\n",
-                plugin->type, fname);
-        --numhandles;
-        handle_list[*handle].plugin=NULL;
-        *handle=-777;
-        return;
-    }
-    
-    return;
-}
-
-/* read next time step */
-void FNAME(f77_molfile_read_next)(int4 *handle, int4 *natoms, float *xyz, 
-                             float *box, int4 *status)
-{
-    molfile_plugin_t *plugin;
-    molfile_timestep_t step;
-    int retval;
-
-    /* do some sanity checks on the handle */
-    if((*handle < 0) || (*handle >= MAXHANDLES)) {
-        fprintf(stderr, " %s: illegal handle: %d\n",
-                __FUNCTION__, *handle);
-        *status = 0;
-        return;
-    }
-
-    plugin = handle_list[*handle].plugin;
-    if(plugin==NULL) {
-        fprintf(stderr, " %s: inactive handle: %d\n",
-                __FUNCTION__, *handle);
-        *status = 0;
-        return;
-    }
-
-    /* skip or read the timestep as demanded */
-    if(status == 0) {
-        retval = plugin->read_next_timestep(handle_list[*handle].handle,
-                                             *natoms, NULL);
-    } else {
-        step.coords = xyz;
-        retval = plugin->read_next_timestep(handle_list[*handle].handle,
-                                             *natoms, &step);
-    }
-
-    /* copy the box parameters */
-    if (retval == MOLFILE_SUCCESS) {
-        *status = 1;
-        box[0]=step.A;
-        box[1]=step.B;
-        box[2]=step.C;
-        box[3]=step.alpha;
-        box[4]=step.beta;
-        box[5]=step.gamma;
-    } else {
-        *status = 0;
-    }
-}
-            
-/* close a read file descriptor */
-void FNAME(f77_molfile_close_read)(int4 *handle)
-{
-    molfile_plugin_t *plugin;
-    
-    /* do some sanity checks on the handle */
-    if((*handle < 0) || (*handle >= MAXHANDLES)) {
-        fprintf(stderr, " %s: illegal handle: %d\n",
-                __FUNCTION__, *handle);
-        *handle = -111;
-        return;
-    }
-
-    plugin = handle_list[*handle].plugin;
-    if(plugin==NULL) {
-        fprintf(stderr, " %s: inactive handle: %d\n",
-                __FUNCTION__, *handle);
-        *handle = -222;
-        return;
-    }
-
-#if F77TESTME
-    fprintf(stderr, " %s: trying to close handle %d"
-            " for file %s\n", __FUNCTION__, *handle, 
-            handle_list[*handle].fname);
-#endif
-
-    plugin->close_file_read(handle_list[*handle].handle);
-    --numhandles;
-    handle_list[*handle].plugin=NULL;
-    *handle=-1;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/tester.f b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/tester.f
deleted file mode 100644
index 40e250bb80cc1ad0d8446dd5d37f2726679b5636..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/f77/tester.f
+++ /dev/null
@@ -1,110 +0,0 @@
-c     testing frontend for the molfile plugin fortran interface
-c     $Id: tester.f,v 1.1 2006/03/10 22:48:49 johns Exp $
-c     (c) 2006 Axel Kohlmeyer <akohlmey@cmm.chem.upenn.edu>
-
-      program molfile
-      implicit none
-
-      integer*4 natom, maxatom, handle(4), status
-      parameter (maxatom=3000*3)
-      real*4    xyz(maxatom), box(6)
-
-      character infile*200, intype*10
-      integer i,j
-
-      print*,'molfile fortran tester v0.01'
-
-C     set some default values
-      infile = 'TRAJEC.dcd'
-      intype = 'auto'
-      natom  = -1
-      handle(1) = -1
-      handle(2) = -1
-      handle(3) = -1
-      handle(4) = -1
-      
-      print*,'filename: ', infile
-      print*,'type:     ', intype
-
-C     set up everything and 
-C     register all static plugins
-      call f77_molfile_init
-
-      call f77_molfile_open_read(handle(1),natom,infile,intype)
-
-      if (handle(1).lt.0) then
-         print*,'file type unknown or not registered'
-      else
-         print*,'file successfully opened:'
-         print*,'handle:',handle(1)
-         print*,'natom: ',natom
-      end if
-
-      do i=1,2000
-         status = 1   ! status=1 on entry means read
-         call f77_molfile_read_next(handle(1),natom,xyz(1),box,status);
-         print*,'read ',i,'  status:',status
-         print*,'atom(1)', (xyz(j),j=1,3)
-         print*,'atom(10)',(xyz(j),j=31,33)
-         print*,'atom(100)',(xyz(j),j=301,303)
-         print*,'box',box
-         if(status.eq.0) go to 666
-         status = 0   ! status=0 on entry means skip
-         call f77_molfile_read_next(handle(1),natom,xyz,box,status);
-         print*,'read ',i,'  status:',status
-         if(status.eq.0) go to 666
-      end do
- 666  continue
-
-      infile='li-nh3_4-end.pdb'
-      intype='pdb'
-      call f77_molfile_open_read(handle(2),natom,infile,intype)
-
-      if (handle(2).lt.0) then
-         print*,'file type unknown or not registered'
-      else
-         print*,'file successfully opened:'
-         print*,'handle:',handle(2)
-         print*,'natom: ',natom
-      end if
-
-      do i=1,2000
-         status = 1   ! status=1 on entry means read
-         call f77_molfile_read_next(handle(2),natom,xyz(1),box,status);
-         print*,'read ',i,'  status:',status
-         if(status.eq.0) go to 6666
-         print*,'atom(1)',  (xyz(j),j=1,3)
-         print*,'atom(10)', (xyz(j),j=31,33)
-         print*,'atom(100)',(xyz(j),j=301,303)
-         print*,'box',box
-         status = 0   ! status=0 on entry means skip
-         call f77_molfile_read_next(handle(2),natom,xyz,box,status);
-         print*,'read ',i,'  status:',status
-         if(status.eq.0) go to 6666
-      end do
- 6666 continue
-      call f77_molfile_open_read(handle(3),natom,infile,intype)
-      print*,'handle:',handle(3)
-
-      call f77_molfile_close_read(handle(1),status)
-      print*,'handle:',handle(1)
-      call f77_molfile_open_read(handle(1),natom,infile,intype)
-      print*,'handle:',handle(1)
-      call f77_molfile_open_read(handle(4),natom,infile,intype)
-      print*,'handle:',handle(4)
-
-
-      call f77_molfile_close_read(handle(2),status)
-      print*,'handle:',handle(2)
-      call f77_molfile_close_read(handle(1),status)
-      print*,'handle:',handle(1)
-      call f77_molfile_close_read(handle(3),status)
-      print*,'handle:',handle(3)
-      call f77_molfile_close_read(handle(2),status)
-      print*,'handle:',handle(2)
-      call f77_molfile_close_read(handle(4),status)
-      print*,'handle:',handle(4)
-
-      call f77_molfile_finish
-
-      end
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Entries
deleted file mode 100644
index c5313a23dcd400388b3b06083fa87f3bd22ad110..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Entries
+++ /dev/null
@@ -1,9 +0,0 @@
-/babelplugin.dsp/1.1/Thu Jan 10 06:58:25 2002//
-/dcdplugin.dsp/1.1/Thu Jan 10 06:58:25 2002//
-/gromacsplugin.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/pdbplugin.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/psfplugin.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/template.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/vc60.idb/1.1/Thu Jan 10 06:58:27 2002//
-/vc60.pdb/1.1/Thu Jan 10 06:58:27 2002//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Repository
deleted file mode 100644
index c04963fb0bc3dc941e407375a2968f3b74a94e9f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/msvc
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/babelplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/babelplugin.dsp
deleted file mode 100755
index 71aaa1b22289a90f9e53d1eb76ff944f606e3cb5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/babelplugin.dsp
+++ /dev/null
@@ -1,131 +0,0 @@
-# Microsoft Developer Studio Project File - Name="babelplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=babelplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "babelplugin.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "babelplugin.mak" CFG="babelplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "babelplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "babelplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "babelplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "babelplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "babelplugin - Win32 Release"
-# Name "babelplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\babelplugin.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\vmddir.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\vmddir.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/dcdplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/dcdplugin.dsp
deleted file mode 100755
index f91ef31f67a8a7c7a0cefd128cb9421ebb5bd99c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/dcdplugin.dsp
+++ /dev/null
@@ -1,123 +0,0 @@
-# Microsoft Developer Studio Project File - Name="dcdplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=dcdplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="dcdplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "dcdplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "dcdplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "dcdplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "dcdplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /dcdtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /dcdtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "dcdplugin - Win32 Release"
-# Name "dcdplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readdcd.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\dcdplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readdcd.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/gromacsplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/gromacsplugin.dsp
deleted file mode 100755
index 0b458452f0e7357f3b0c86724ddf72a8186e3826..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/gromacsplugin.dsp
+++ /dev/null
@@ -1,124 +0,0 @@
-# Microsoft Developer Studio Project File - Name="gromacsplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=gromacsplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "gromacsplugin.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "gromacsplugin.mak" CFG="gromacsplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "gromacsplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "gromacsplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "gromacsplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "gromacsplugin___Win32_Release"
-# PROP BASE Intermediate_Dir "gromacsplugin___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GROMACSPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /TP /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "gromacsplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "gromacsplugin___Win32_Debug"
-# PROP BASE Intermediate_Dir "gromacsplugin___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GROMACSPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GROMACSPLUGIN_EXPORTS" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "gromacsplugin - Win32 Release"
-# Name "gromacsplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\Gromacs.C
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\gromacsplugin.C
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\Gromacs.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/pdbplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/pdbplugin.dsp
deleted file mode 100755
index 0c235e8a5548a6822ae42f0bc70597da0db0c5f8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/pdbplugin.dsp
+++ /dev/null
@@ -1,123 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pdbplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=pdbplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="pdbplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "pdbplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pdbplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "pdbplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "pdbplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "pdbplugin - Win32 Release"
-# Name "pdbplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\pdbplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/psfplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/psfplugin.dsp
deleted file mode 100755
index 8bf1c51d18499146f5521d453f8b82d3d9b34818..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/psfplugin.dsp
+++ /dev/null
@@ -1,115 +0,0 @@
-# Microsoft Developer Studio Project File - Name="psfplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=psfplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="psfplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "psfplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "psfplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "psfplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "psfplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "psfplugin - Win32 Release"
-# Name "psfplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\psfplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/template.dsp b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/template.dsp
deleted file mode 100755
index 8b27cd83580573d9c3468f4bf083f26014cc1121..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/template.dsp
+++ /dev/null
@@ -1,115 +0,0 @@
-# Microsoft Developer Studio Project File - Name="templateplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=templateplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="templateplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "templateplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "templateplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "templateplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "templateplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "templateplugin - Win32 Release"
-# Name "templateplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\templateplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/vc60.idb b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/vc60.idb
deleted file mode 100755
index 5952223b9b20b79ff753677f66be2526154cc64c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/vc60.idb and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/vc60.pdb b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/vc60.pdb
deleted file mode 100755
index 3e0e8fe2d8eeedbee4b45a98a55bbba2d82ee556..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/msvc/vc60.pdb and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/.#dlpolyplugin.c.1.21 b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/.#dlpolyplugin.c.1.21
deleted file mode 100644
index b4cb83670d1735a641e81bddd7dae551cc501837..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/.#dlpolyplugin.c.1.21
+++ /dev/null
@@ -1,505 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2009 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dlpolyplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.21 $       $Date: 2009/04/29 15:45:29 $
- *
- ***************************************************************************/
-
-/*
- * DLPOLY formatted history file format:
- *   http://www.cse.clrc.ac.uk/msi/software/DL_POLY/MANUALS/USRMAN3/node141.html
- *   http://hidra.iqfr.csic.es/man/dlpoly/USRMAN/node156.html
- *
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-typedef struct {
-  FILE *file;
-  int dlpolyversion;
-  int numatoms;
-  int cellwarnflag;
-} dlpolydata;
- 
-
-static void *open_dlpoly_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  dlpolydata *data;
-  char fbuffer[4096], buf[4096];
-  int dlpolyversion, scancount, nstep, keytrj, atomcount;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-
-  if (NULL == fgets(fbuffer, 1024, fd))  
-    return NULL;
-
-  if (!strcmp(filetype, "dlpolyhist")) {
-    dlpolyversion=2;
-  } else if (!strcmp(filetype, "dlpoly3hist")) {
-    dlpolyversion=3;
-  } else {
-    dlpolyversion=2;
-  }
- 
-  /* check to see if the first line is a "timestep" record */ 
-  scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, natoms);
-  if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, natoms);
-    if (scancount != 3) {
-      printf("open_dlpoly_read) unrecognized header record\n");
-      return NULL;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, &atomcount);
-    if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-      printf("open_dlpoly_read) unrecognized timestep record\n");
-      return NULL;
-    }
-
-    if (atomcount != *natoms) {
-      printf("open_dlpoly_read) mismatched atom count\n");
-      return NULL;
-    }
-  }
- 
-  data = (dlpolydata *) malloc(sizeof(dlpolydata));
-  memset(data, 0, sizeof(dlpolydata));
-  data->file = fd;
-  data->numatoms= *natoms;
-  data->cellwarnflag = 0;
-  data->dlpolyversion = dlpolyversion;
-
-  rewind(data->file); /* prepare for first read_timestep call */
-  return data;
-}
-
-
-static int read_dlpoly_structure(void *mydata, int *optflags,
-                              molfile_atom_t *atoms) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge;
-  dlpolydata *data = (dlpolydata *)mydata;
- 
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  /* check to see if the first line is a "timestep" record */
-  scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                     &nstep, &atomcount, &keytrj, &imcon, &tstep);
-  if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-    if (scancount != 3) {
-      printf("dlpoly structure) unrecognized header record\n");
-      return MOLFILE_ERROR;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                       &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-    if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-      printf("dlpoly structure) unrecognized timestep record\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check atom count */
-    if (atomcount != atomcount2) {
-      printf("dlpoly structure) header/timestep mismatched atom count\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* check atom count */
-  if (atomcount != data->numatoms) {
-    printf("dlpoly structure) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    /* eat the data but don't use it for anything */
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms + i;
-
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly structure v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly structure v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly structure) failed reading atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly structure) failed reading atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    strncpy(atom->name, buf, sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_dlpoly_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge, elapsedps;
-  dlpolydata *data = (dlpolydata *)mydata;
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  switch (data->dlpolyversion) {
-    case 3:
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount, &keytrj, &imcon, &tstep, &elapsedps);
-      if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v3) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount2, &keytrj, &imcon, &tstep, &elapsedps);
-        if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v3) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v3) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-
-    case 2:
-    default: 
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                         &nstep, &atomcount, &keytrj, &imcon, &tstep);
-      if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v2) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                           &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-        if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v2) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v2) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-  }
-
-  /* check atom count */
-  if (atomcount != natoms) {
-    printf("dlpoly timestep) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check and copy in periodic cell info */
-    if (ts != NULL) {
-      if (xaxis[1] != 0.0 || xaxis[2] != 0.0 || 
-          yaxis[0] != 0.0 || yaxis[2] != 0.0 || 
-          zaxis[0] != 0.0 || zaxis[1] != 0.0) {
-        if (data->cellwarnflag != 1)
-          printf("dlpoly timestep) non-orthogonal DLPOLY periodic cell data unsupported\n");
-        data->cellwarnflag = 1;
-      } else {
-        ts->A = xaxis[0];
-        ts->B = yaxis[1];
-        ts->C = zaxis[2];
-        if (data->cellwarnflag != 2)
-          printf("dlpoly timestep) converting DLPOLY periodic cell data\n");
-        data->cellwarnflag = 2;
-      }
-    }
-  }
-
-  /* read all per-atom data */
-  for (i=0; i<natoms; i++) {
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly timestep v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly timestep v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly timestep) failed parsing atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly timestep) failed parsing atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    if (ts != NULL) { 
-      if (atomid > 0 && atomid <= natoms) {
-        int addr = 3 * (atomid - 1);
-        ts->coords[addr    ] = x;
-        ts->coords[addr + 1] = y;
-        ts->coords[addr + 2] = z;
-      } else {
-        fprintf(stderr, "dlpoly timestep) ignoring illegal atom index %d\n", atomid);
-      }
-    } 
-  }
-
-  /* eat remaining spaces and LF character */
-  fgets(fbuffer, 1024, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_dlpoly_read(void *mydata) {
-  dlpolydata *data = (dlpolydata *)mydata;
-  fclose(data->file);
-  free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t dlpoly2plugin;
-static molfile_plugin_t dlpoly3plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&dlpoly2plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly2plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly2plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly2plugin.name = "dlpolyhist";
-  dlpoly2plugin.prettyname = "DLPOLY V2 History";
-  dlpoly2plugin.author = "John Stone";
-  dlpoly2plugin.majorv = 0;
-  dlpoly2plugin.minorv = 8;
-  dlpoly2plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly2plugin.filename_extension = "dlpolyhist";
-  dlpoly2plugin.open_file_read = open_dlpoly_read;
-  dlpoly2plugin.read_structure = read_dlpoly_structure;
-  dlpoly2plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly2plugin.close_file_read = close_dlpoly_read;
-
-  memset(&dlpoly3plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly3plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly3plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly3plugin.name = "dlpoly3hist";
-  dlpoly3plugin.prettyname = "DLPOLY V3 History";
-  dlpoly3plugin.author = "John Stone";
-  dlpoly3plugin.majorv = 0;
-  dlpoly3plugin.minorv = 8;
-  dlpoly3plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly3plugin.filename_extension = "dlpolyhist";
-  dlpoly3plugin.open_file_read = open_dlpoly_read;
-  dlpoly3plugin.read_structure = read_dlpoly_structure;
-  dlpoly3plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly3plugin.close_file_read = close_dlpoly_read;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&dlpoly2plugin);
-  (*cb)(v, (vmdplugin_t *)&dlpoly3plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_dlpoly_read(*argv, "dlpoly", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_dlpoly_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_dlpoly_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_dlpoly_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_dlpoly_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/.main.c.swp b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/.main.c.swp
deleted file mode 100644
index 0018b9cb4534222f0f4ea2f1cf96ac8736c91c58..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/.main.c.swp and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Entries
deleted file mode 100644
index 02948dda28f5e9eac237f98a967715279e57ad3c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Entries
+++ /dev/null
@@ -1,97 +0,0 @@
-/dmsplugin.cxx/1.2/Wed Nov 30 19:33:50 2011//
-/maeffplugin.cxx/1.28/Sun Nov  6 17:49:24 2016//
-/dtrplugin.hxx/1.5/Sun Nov  6 19:16:52 2016//
-/dtrplugin.cxx/1.26/Sun Nov  6 19:25:35 2016//
-/pdbxplugin.C/1.17/Mon Nov 28 05:01:22 2016//
-/Gromacs.h/1.34/Mon Nov 28 05:01:53 2016//
-/avsplugin.C/1.23/Mon Nov 28 05:01:53 2016//
-/babelplugin.c/1.49/Mon Nov 28 05:01:53 2016//
-/basissetplugin.c/1.14/Mon Nov 28 05:01:53 2016//
-/bgfplugin.C/1.29/Mon Nov 28 05:01:53 2016//
-/binposplugin.c/1.12/Mon Nov 28 05:01:53 2016//
-/biomoccaplugin.C/1.6/Mon Nov 28 05:01:53 2016//
-/brixplugin.C/1.20/Mon Nov 28 05:01:53 2016//
-/carplugin.c/1.18/Mon Nov 28 05:01:53 2016//
-/ccp4plugin.C/1.38/Mon Nov 28 05:01:53 2016//
-/corplugin.c/1.33/Mon Nov 28 05:01:53 2016//
-/cpmdlogplugin.c/1.17/Mon Nov 28 05:00:25 2016//
-/cpmdplugin.c/1.15/Mon Nov 28 05:01:53 2016//
-/crdplugin.c/1.40/Mon Nov 28 05:01:53 2016//
-/cubeplugin.C/1.32/Mon Nov 28 05:01:53 2016//
-/dcdplugin.c/1.79/Mon Nov 28 05:01:53 2016//
-/dlpolyplugin.c/1.24/Mon Nov 28 05:01:53 2016//
-/dsn6plugin.C/1.25/Mon Nov 28 05:01:53 2016//
-/dxplugin.C/1.43/Mon Nov 28 05:01:53 2016//
-/edmplugin.C/1.34/Mon Nov 28 05:01:53 2016//
-/endianswap.h/1.7/Mon Nov 28 05:01:53 2016//
-/fastio.h/1.34/Mon Nov 28 05:01:53 2016//
-/fortread.h/1.10/Mon Nov 28 05:01:54 2016//
-/fs4plugin.C/1.23/Mon Nov 28 05:01:54 2016//
-/gamessplugin.c/1.211/Mon Nov 28 05:01:54 2016//
-/gaussianplugin.c/1.21/Mon Nov 28 05:00:26 2016//
-/gaussianplugin.h/1.10/Mon Nov 28 05:01:54 2016//
-/graspplugin.C/1.23/Mon Nov 28 05:01:54 2016//
-/grdplugin.C/1.17/Mon Nov 28 05:01:54 2016//
-/gridplugin.C/1.15/Mon Nov 28 05:01:54 2016//
-/gromacsplugin.C/1.52/Mon Nov 28 05:01:54 2016//
-/hash.c/1.7/Mon Nov 28 05:01:54 2016//
-/hash.h/1.9/Mon Nov 28 05:01:54 2016//
-/inthash.c/1.3/Mon Nov 28 05:01:54 2016//
-/inthash.h/1.4/Mon Nov 28 05:01:54 2016//
-/lammpsplugin.c/1.49/Mon Nov 28 05:01:54 2016//
-/largefiles.h/1.4/Mon Nov 28 05:01:54 2016//
-/main.c/1.16/Mon Nov 28 05:01:54 2016//
-/mapplugin.C/1.15/Mon Nov 28 05:01:54 2016//
-/mdfplugin.C/1.21/Mon Nov 28 05:01:54 2016//
-/mmcif.C/1.7/Mon Nov 28 05:01:54 2016//
-/mol2plugin.C/1.38/Mon Nov 28 05:01:54 2016//
-/moldenplugin.c/1.40/Mon Nov 28 05:01:54 2016//
-/molemeshplugin.C/1.3/Mon Nov 28 05:01:54 2016//
-/msmsplugin.C/1.13/Mon Nov 28 05:01:54 2016//
-/namdbinplugin.c/1.23/Mon Nov 28 05:01:54 2016//
-/netcdfplugin.c/1.29/Mon Nov 28 05:01:54 2016//
-/parm7plugin.C/1.34/Mon Nov 28 05:01:54 2016//
-/parmplugin.C/1.35/Mon Nov 28 05:01:54 2016//
-/pbeqplugin.C/1.7/Mon Nov 28 05:01:54 2016//
-/pdbplugin.c/1.73/Mon Nov 28 05:01:54 2016//
-/phiplugin.C/1.28/Mon Nov 28 05:01:54 2016//
-/pltplugin.C/1.14/Mon Nov 28 05:01:54 2016//
-/plyplugin.C/1.8/Mon Nov 28 05:01:54 2016//
-/pqrplugin.c/1.21/Mon Nov 28 05:01:54 2016//
-/psfplugin.c/1.83/Mon Nov 28 05:01:54 2016//
-/qmplugin.h/1.23/Mon Nov 28 05:01:54 2016//
-/raster3dplugin.C/1.18/Mon Nov 28 05:00:28 2016//
-/readpdb.h/1.43/Mon Nov 28 05:01:54 2016//
-/rst7plugin.c/1.20/Mon Nov 28 05:01:54 2016//
-/situsplugin.C/1.16/Mon Nov 28 05:01:54 2016//
-/spiderplugin.C/1.17/Mon Nov 28 05:01:54 2016//
-/stlplugin.C/1.16/Mon Nov 28 05:01:54 2016//
-/tinkerplugin.c/1.14/Mon Nov 28 05:01:54 2016//
-/uhbdplugin.C/1.14/Mon Nov 28 05:01:54 2016//
-/vmddir.h/1.12/Mon Nov 28 05:01:54 2016//
-/webpdbplugin.c/1.54/Mon Nov 28 05:01:55 2016//
-/xbgfplugin.C/1.34/Mon Nov 28 05:01:55 2016//
-/xyzplugin.c/1.37/Mon Nov 28 05:01:55 2016//
-/ReadPARM.h/1.15/Mon Nov 28 05:00:28 2016//
-/ReadPARM7.h/1.32/Mon Nov 28 05:00:28 2016//
-/abinitplugin.c/1.2/Mon Nov 28 05:00:25 2016//
-/hoomdplugin.c/1.16/Mon Nov 28 05:00:26 2016//
-/offplugin.C/1.7/Mon Nov 28 05:00:27 2016//
-/periodic_table.h/1.12/Mon Nov 28 05:00:27 2016//
-/ply.c/1.1/Mon Nov 28 05:00:27 2016//
-/ply.h/1.1/Mon Nov 28 05:00:28 2016//
-/tngplugin.C/1.7/Mon Nov 28 05:00:28 2016//
-/unit_conversion.h/1.3/Mon Nov 28 05:00:28 2016//
-/vasp5xdatcarplugin.c/1.3/Mon Nov 28 05:00:28 2016//
-/vaspchgcarplugin.c/1.13/Mon Nov 28 05:00:28 2016//
-/vaspoutcarplugin.c/1.9/Mon Nov 28 05:00:28 2016//
-/vaspparchgplugin.c/1.2/Mon Nov 28 05:00:28 2016//
-/vaspplugin.h/1.5/Mon Nov 28 05:00:28 2016//
-/vaspposcarplugin.c/1.9/Mon Nov 28 05:00:28 2016//
-/vaspxdatcarplugin.c/1.10/Mon Nov 28 05:00:28 2016//
-/vaspxmlplugin.c/1.9/Mon Nov 28 05:00:28 2016//
-/vtfplugin.c/1.18/Mon Nov 28 05:00:29 2016//
-/vtkplugin.C/1.5/Mon Nov 28 05:00:29 2016//
-/xsfplugin.C/1.20/Mon Nov 28 05:00:29 2016//
-/jsplugin.c/1.77/Wed Nov 30 23:28:53 2016//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Repository
deleted file mode 100644
index 28a8325a6d5f8c345694cb97b2ef7df2112de6de..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/src
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/mmCIF.C,t b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/CVS/mmCIF.C,t
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/Gromacs.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/Gromacs.h
deleted file mode 100644
index d2d790adf1008fc3fdecd8fce0f0296ca74f0da7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/Gromacs.h
+++ /dev/null
@@ -1,1967 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *      $RCSfile: Gromacs.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:53 $
- ***************************************************************************/
-
-/*
- * GROMACS file format reader for VMD
- *
- * This code provides a high level I/O library for reading
- * and writing the following file formats:
- *	gro	GROMACS format or trajectory
- *	g96	GROMOS-96 format or trajectory
- *	trj	Trajectory - x, v and f (binary, full precision)
- *	trr	Trajectory - x, v and f (binary, full precision, portable)
- *	xtc	Trajectory - x only (compressed, portable, any precision)
- *      top
- * Currently supported: gro trj trr g96 [xtc]
- *
- * TODO list
- *   o  velocities are ignored because VMD doesn't use them, but some other 
- *      program might ...
- *   o  gro_rec() assumes positions in .gro files are nanometers and
- *      converts to angstroms, whereas they really could be any unit
- */
-
-#ifndef GROMACS_H
-#define GROMACS_H
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "endianswap.h"
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-// Error codes for mdio_errno
-#define MDIO_SUCCESS		0
-#define MDIO_BADFORMAT		1
-#define MDIO_EOF		2
-#define MDIO_BADPARAMS		3
-#define MDIO_IOERROR		4
-#define MDIO_BADPRECISION	5
-#define MDIO_BADMALLOC		6
-#define MDIO_CANTOPEN		7
-#define MDIO_BADEXTENSION	8
-#define MDIO_UNKNOWNFMT		9
-#define MDIO_CANTCLOSE		10
-#define MDIO_WRONGFORMAT	11
-#define MDIO_SIZEERROR		12
-#define MDIO_UNKNOWNERROR	1000
-
-#define MDIO_READ	0
-#define MDIO_WRITE	1
-
-#define MDIO_MAX_ERRVAL		11
-
-// Format extensions
-const char *mdio_fmtexts[] = {
-    "",
-    ".gro",
-    ".trr",
-    ".g96",
-    ".trj",
-    ".xtc",
-    NULL
-};
-
-
-static int mdio_errcode;	// Last error code
-
-#define TRX_MAGIC	1993	// Magic number for .trX files
-#define XTC_MAGIC	1995	// Magic number for .xtc files
-#define MAX_GRO_LINE	500	// Maximum line length of .gro files
-#define MAX_G96_LINE	500	// Maximum line length of .g96 files
-#define MAX_TRX_TITLE	80	// Maximum length of a title in .trX
-#define MAX_MDIO_TITLE	80	// Maximum supported title length
-#define ANGS_PER_NM	10	// Unit conversion factor
-#define ANGS2_PER_NM2	100	// Unit conversion factor
-
-
-// All the supported file types and their respective extensions
-#define MDFMT_GRO		1
-#define MDFMT_TRR		2
-#define MDFMT_G96		3
-#define MDFMT_TRJ		4
-#define MDFMT_XTC		5
-
-
-// A structure to hold .trX file format header information. This
-// is an optional member of the md_file structure that is used
-// when .trX files are being dealt with.
-typedef struct {
-	int version;		// File version number
-	char title[MAX_TRX_TITLE + 1];	// File title
-	int ir_size;
-	int e_size;
-	int box_size;
-	int vir_size;
-	int pres_size;
-	int top_size;
-	int sym_size;
-	int x_size;		// Positions of atoms
-	int v_size;		// Velocities of atoms
-	int f_size;
-	int natoms;		// Number of atoms in the system
-	int step;
-	int nre;
-	float t;
-	float lambda;
-} trx_hdr;
-
-
-// A generic i/o structure that contains information about the
-// file itself and the input/output state
-typedef struct {
-	FILE *	f;	// Pointer to the file
-	int	fmt;	// The file format
-	int	prec;	// Real number precision
-	int	rev;	// Reverse endiannism?
-	trx_hdr * trx;	// Trx files require a great deal more
-			// header data to be stored.
-} md_file;
-
-
-// A format-independent structure to hold header data from files
-typedef struct {
-	char title[MAX_MDIO_TITLE + 1];
-	int natoms;
-	float timeval;
-} md_header;
-
-
-// A format-independent structure to hold unit cell data
-typedef struct {
-  float A, B, C, alpha, beta, gamma;
-} md_box;
-
-
-// Timestep information
-typedef struct {
-	float *pos;	// Position array (3 * natoms)
-	//float *vel;	// Velocity array ** (VMD doesn't use this) **
-	//float *f;	// Force array ** (VMD doesn't use this) **
-	//float *box;	// Computational box ** (VMD doesn't use this) **
-	int natoms;	// Number of atoms
-	int step;	// Simulation step
-	float time;	// Time of simulation
-  md_box *box;
-} md_ts;
-
-
-// Atom information
-typedef struct {
-	char resid[7];		// Residue index number
-	char resname[7];	// Residue name
-	int atomnum;		// Atom index number
-	char atomname[7];	// Atom name
-	float pos[3];		// Position array (3 * natoms)
-	//float vel[3];	// Velocity array ** (VMD doesn't use this) **
-} md_atom;
-
-
-// Open a molecular dynamics file. The second parameter specifies
-// the format of the file. If it is zero, the format is determined
-// from the file extension. the third argument (if given) decides
-// whether to read (==0) or to write (!= 0).
-// using a default argument set to read for backward compatibility.
-static md_file *mdio_open(const char *, const int, const int=MDIO_READ);
-
-// Closes a molecular dynamics file.
-static int mdio_close(md_file *);
-
-
-// Format-independent file I/O routines
-static int mdio_header(md_file *, md_header *);
-static int mdio_timestep(md_file *, md_ts *);
-
-
-// .gro file functions
-static int gro_header(md_file *, char *, int, float *, int *, int = 1);
-static int gro_rec(md_file *, md_atom *);
-static int gro_timestep(md_file *, md_ts *);
-
-
-// .trX file functions
-static int trx_header(md_file *, int = 0);
-static int trx_int(md_file *, int *);
-static int trx_real(md_file *, float *);
-
-static int trx_rvector(md_file *, float *);
-static int trx_string(md_file *, char *, int);
-static int trx_timestep(md_file *, md_ts *);
-
-// .g96 file functions
-static int g96_header(md_file *, char *, int, float *);
-static int g96_timestep(md_file *, md_ts *);
-static int g96_rec(md_file *, md_atom *);
-static int g96_countatoms(md_file *);
-
-
-// .xtc file functions
-static int xtc_int(md_file *, int *);
-static int xtc_float(md_file *, float *);
-/* 
-static int xtc_receivebits(int *, int);
-static void xtc_receiveints(int *, int, int, const unsigned *, int *);
-*/
-static int xtc_timestep(md_file *, md_ts *);
-static int xtc_3dfcoord(md_file *, float *, int *, float *);
-
-
-// Error reporting functions
-static int mdio_errno(void);
-static const char *mdio_errmsg(int);
-static int mdio_seterror(int);
-
-
-// Miscellaneous functions
-static int strip_white(char *);
-static int mdio_readline(md_file *, char *, int, int = 1);
-static int mdio_tsfree(md_ts *, int = 0);
-static int mdio_readbox(md_box *, float *, float *, float *);
-
-
-
-static int xtc_receivebits(int *, int);
-
-// Error descriptions for mdio_errno
-static const char *mdio_errdescs[] = {
-	"no error",
-	"file does not match format",
-	"unexpected end-of-file reached",
-	"function called with bad parameters",
-	"file i/o error",
-	"unsupported precision",
-	"out of memory",
-	"cannot open file",
-	"bad file extension",
-	"unknown file format",
-	"cannot close file",
-	"wrong file format for this function",
-	"binary i/o error: sizeof(int) != 4",
-	NULL
-};
-
-/*! \fn static inline bool host_is_little_endian(void)
- * detect endiannes of host machine. returns true on little endian machines. */
-static inline int host_is_little_endian(void) 
-{
-  const union { unsigned char c[4]; unsigned int i; } 
-  fixed = { { 0x10 , 0x20 , 0x40 , 0x80 } };
-  const unsigned int i = 0x80402010U;
-        
-  if (fixed.i == i) {
-    return 1;
-  }
-  return 0;
-}
-
-
-
-// Open a molecular dynamics file. The second parameter specifies
-// the format of the file. If it is zero, the format is determined
-// from the file extension.
-md_file *mdio_open(const char *fn, const int fmt, const int rw) {
-	md_file *mf;
-
-	if (!fn) {
-		mdio_seterror(MDIO_BADPARAMS);
-		return NULL;
-	}
-
-	// Allocate memory
-	mf = (md_file *) malloc(sizeof(md_file));
-	if (!mf) {
-		mdio_seterror(MDIO_BADMALLOC);
-		return NULL;
-	}
-
-	// Zero out the structure
-	memset(mf, 0, sizeof(md_file));
-
-	// Determine the file type from the extension
-	if (!fmt) {
-		char *p;
-		int n;
-
-		// Seek to the extension part of the filename
-		for (p = (char *) &fn[strlen(fn) - 1]; *p != '.' && p > fn; p--);
-		if (p == fn) {
-			free(mf);
-			mdio_seterror(MDIO_BADEXTENSION);
-			return NULL;
-		}
-
-		// Check the extension against known extensions
-		for (n = 1; mdio_fmtexts[n]; n++)
-			if (!strcasecmp(p, mdio_fmtexts[n])) break;
-
-		// If !mdio_fmtexts[n], we failed (unknown ext)
-		if (!mdio_fmtexts[n]) {
-			free(mf);
-			mdio_seterror(MDIO_UNKNOWNFMT);
-			return NULL;
-		}
-
-		// All set
-		mf->fmt = n;
-	}
-	else {
-		mf->fmt = fmt;
-	}
-
-	// Differentiate between binary and ascii files. Also,
-	// .trX files need a header information structure allocated.
-	switch (mf->fmt) {
-    case MDFMT_GRO:
-	case MDFMT_G96: /* fallthrough */
-        if (rw) 
-            mf->f = fopen(fn, "wt");
-        else
-            mf->f = fopen(fn, "rt");
-
-		break;
-	case MDFMT_TRR:
-	case MDFMT_TRJ: /* fallthrough */
-		// Allocate the trx header data struct
-		mf->trx = (trx_hdr *) malloc(sizeof(trx_hdr));
-		if (!mf->trx) {
-			free(mf);
-			mdio_seterror(MDIO_BADMALLOC);
-			return NULL;
-		}
-		memset(mf->trx, 0, sizeof(trx_hdr));
-	case MDFMT_XTC:  /* fallthrough */
-		// Finally, open the file
-        if (rw)
-            mf->f = fopen(fn, "wb");
-        else
-            mf->f = fopen(fn, "rb");
-
-		break;
-	default:
-		free(mf);
-		mdio_seterror(MDIO_UNKNOWNFMT);
-		return NULL;
-	}
-
-	// Check for opening error
-	if (!mf->f) {
-		if (mf->trx) free(mf->trx);
-		free(mf);
-		mdio_seterror(MDIO_CANTOPEN);
-		return NULL;
-	}
-
-	// File is opened, we're all set!
-	mdio_seterror(MDIO_SUCCESS);
-	return mf;
-}
-
-
-// Closes a molecular dynamics file.
-static int mdio_close(md_file *mf) {
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (fclose(mf->f) == EOF) return mdio_seterror(MDIO_CANTCLOSE);
-
-	// Free the dynamically allocated memory
-	if (mf->trx) free(mf->trx);
-	free(mf);
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Returns the last error code reported by any of the mdio functions
-static int mdio_errno(void) {
-	return mdio_errcode;
-}
-
-
-// Returns a textual message regarding an mdio error code
-static const char *mdio_errmsg(int n) {
-	if (n < 0 || n > MDIO_MAX_ERRVAL) return (char *) "unknown error";
-	else return mdio_errdescs[n];
-}
-
-
-// Sets the error code and returns an appropriate return value
-// for the calling function to return to its parent
-static int mdio_seterror(int code) {
-	mdio_errcode = code;
-	return code ? -1 : 0;
-}
-
-
-// Reads a line from the text file, strips leading/trailing whitespace
-// and newline, checks for errors, and returns the number of characters
-// in the string on success or -1 on error.
-static int mdio_readline(md_file *mf, char *buf, int n, int strip) {
-	if (!buf || n < 1 || !mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	// Read the line
-	fgets(buf, n, mf->f);
-
-	// End of file reached?
-	if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-
-	// File I/O error?
-	if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-
-        // comment line?
-        if (buf[0] == '#') return mdio_readline(mf,buf,n,strip);
-
-	// Strip whitespace
-	if (strip) strip_white(buf);
-
-	return strlen(buf);
-}
-
-
-// Strips leading and trailing whitespace from a string. Tabs,
-// spaces, newlines and carriage returns are stripped. Example:
-// "\n   hello\t \r" becomes "hello".
-static int strip_white(char *buf) {
-	int i, j, k;
-
-	// Protect against NULL pointer
-	if (!buf) return -1;
-	if (!strlen(buf)) return -1;
-
-	// Kill trailing whitespace first
-	for (i = strlen(buf) - 1;
-	     buf[i] == ' ' || buf[i] == '\t' ||
-	     buf[i] == '\n' || buf[i] == '\r';
-	     i--)
-		buf[i] = 0;
-
-	// Skip past leading whitespace
-	for (i = 0; buf[i] == ' ' || buf[i] == '\t' ||
-	     buf[i] == '\n' || buf[i] == '\r'; i++);
-	if (i) {
-		k = 0;
-		for (j = i; buf[j]; j++)
-			buf[k++] = buf[j];
-		buf[k] = 0;
-	}
-
-	return strlen(buf);
-}
-
-
-// Frees the memory allocated in a ts structure. The holderror
-// parameter defaults to zero. Programs that are calling this
-// function because of an error reported by another function should
-// set holderror so that mdio_tsfree() does not overwrite the error
-// code with mdio_seterror().
-static int mdio_tsfree(md_ts *ts, int holderror) {
-	if (!ts) {
-		if (holderror) return -1;
-		else return mdio_seterror(MDIO_BADPARAMS);
-	}
-
-	if (ts->pos && ts->natoms > 0) free(ts->pos);
-
-  if (ts->box) free(ts->box);
-
-	if (holderror) return -1;
-	else return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Converts box basis vectors to A, B, C, alpha, beta, and gamma.  
-// Stores values in md_box struct, which should be allocated before calling
-// this function.
-static int mdio_readbox(md_box *box, float *x, float *y, float *z) {
-  float A, B, C;
-
-  if (!box) {
-    return mdio_seterror(MDIO_BADPARAMS);
-  }
-
-  // A, B, C are the lengths of the x, y, z vectors, respectively
-  A = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] ) * ANGS_PER_NM;
-  B = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] ) * ANGS_PER_NM;
-  C = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] ) * ANGS_PER_NM;
-  if ((A<=0) || (B<=0) || (C<=0)) {
-    /* Use zero-length box size and set angles to 90. */
-    box->A = box->B = box->C = 0;
-    box->alpha = box->beta = box->gamma = 90;
-  } else {
-    box->A = A;
-    box->B = B;
-    box->C = C;
-  
-    // gamma, beta, alpha are the angles between the x & y, x & z, y & z
-    // vectors, respectively
-    box->gamma = acos( (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])*ANGS2_PER_NM2/(A*B) ) * 90.0/M_PI_2;
-    box->beta = acos( (x[0]*z[0]+x[1]*z[1]+x[2]*z[2])*ANGS2_PER_NM2/(A*C) ) * 90.0/M_PI_2;
-    box->alpha = acos( (y[0]*z[0]+y[1]*z[1]+y[2]*z[2])*ANGS2_PER_NM2/(B*C) ) * 90.0/M_PI_2; 
-  }
-  return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Reads the header of a file (format independent)
-static int mdio_header(md_file *mf, md_header *mdh) {
-	int n;
-	if (!mf || !mdh) return mdio_seterror(MDIO_BADPARAMS);
-	if (!mf->f) return mdio_seterror(MDIO_BADPARAMS);
-
-	switch (mf->fmt) {
-	case MDFMT_GRO:
-		if (gro_header(mf, mdh->title, MAX_MDIO_TITLE,
-		&mdh->timeval, &mdh->natoms, 1) < 0)
-			return -1;
-		return 0;
-
-	case MDFMT_TRR: 
-	case MDFMT_TRJ: /* fallthrough */
-		if (trx_header(mf, 1) < 0) return -1;
-		mdh->natoms = mf->trx->natoms;
-		mdh->timeval = (float) mf->trx->t;
-		strncpy(mdh->title, mf->trx->title, MAX_MDIO_TITLE);
-		return 0;
-
-	case MDFMT_G96:
-		if (g96_header(mf, mdh->title, MAX_MDIO_TITLE,
-		&mdh->timeval) < 0) return -1;
-		mdh->natoms = -1;
-		return 0;
-
-	case MDFMT_XTC:
-		memset(mdh, 0, sizeof(md_header));
-		// Check magic number
-		if (xtc_int(mf, &n) < 0) return -1;
-		if (n != XTC_MAGIC) return mdio_seterror(MDIO_BADFORMAT);
-
-		// Get number of atoms
-		if (xtc_int(mf, &n) < 0) return -1;
-		mdh->natoms = n;
-		rewind(mf->f);
-		return 0;
-
-	default:
-		return mdio_seterror(MDIO_UNKNOWNFMT);
-	}
-}
-
-
-// Reads in a timestep from a file (format independent)
-static int mdio_timestep(md_file *mf, md_ts *ts) {
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-	if (!mf->f) return mdio_seterror(MDIO_BADPARAMS);
-
-	switch (mf->fmt) {
-	case MDFMT_GRO:
-		return gro_timestep(mf, ts);
-
-	case MDFMT_TRR:
-	case MDFMT_TRJ: /* fallthrough */
-		return trx_timestep(mf, ts);
-
-	case MDFMT_G96:
-		return g96_timestep(mf, ts);
-
-	case MDFMT_XTC:
-		return xtc_timestep(mf, ts);
-
-	default:
-		return mdio_seterror(MDIO_UNKNOWNFMT);
-	}
-}
-
-
-
-static int g96_header(md_file *mf, char *title, int titlelen, float *timeval) {
-	char buf[MAX_G96_LINE + 1];
-	char *p;
-
-	// Check parameters
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	// The header consists of blocks. The title block
-	// is mandatory, and a TIMESTEP block is optional.
-	// Example:
-	//
-	// TITLE
-	// Generated by trjconv :  t=  90.00000
-	// more title info
-	// .
-	// .
-	// .
-	// END
-	// .
-	// .
-	// .
-
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-	if (strcasecmp(buf, "TITLE")) return mdio_seterror(MDIO_BADFORMAT);
-
-	// Read in the title itself
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-        // The timevalue can be included in the title string
-        // after a "t=" prefix.
-        if ((p = (char *) strstr(buf, "t="))) {
-                char *q = p;
-                *(q--) = 0;
-
-                // Skip the `t=' and strip whitespace from
-                // the resulting strings
-                p += 2;
-                strip_white(p);
-                strip_white(buf);
-
-                // Grab the timevalue from the title string
-                if (timeval) *timeval = (float) atof(p);
-        }
-        else {
-                // No timevalue - just copy the string and strip
-                // any leading/trailing whitespace
-                if (timeval) *timeval = 0;
-                strip_white(buf);
-        }
-
-	// Copy the title string
-	if (title && titlelen) strncpy(title, buf, titlelen);
-
-	// Now ignore subsequent title lines and get the END string
-	while (strcasecmp(buf, "END"))
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-	// Done!
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Used to determine the number of atoms in a g96 file, because
-// VMD needs to know this for some reason.
-static int g96_countatoms(md_file *mf) {
-	char buf[MAX_G96_LINE + 1];
-	int natoms;
-	int n;
-	long fpos;
-	float lastf;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	fpos = ftell(mf->f);
-
-	natoms = 0;
-	for (;;) {
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1, 0) < 0)
-			break;
-		n = sscanf(buf, "%*6c%*6c%*6c%*6c %*f %*f %f", &lastf);
-		if (n == 1) natoms++;
-		else {
-			strip_white(buf);
-			if (!strcasecmp(buf, "END")) break;
-		}
-	}
-
-	fseek(mf->f, fpos, SEEK_SET);
-	return natoms;
-}
-
-
-// Reads an atom line from the G96 file
-static int g96_rec(md_file *mf, md_atom *ma) {
-	char buf[MAX_G96_LINE + 1];
-	char atomnum[7];
-	int n;
-
-	// Check parameters
-	if (!mf || !ma) return mdio_seterror(MDIO_BADPARAMS);
-
-	// Read in a line, assuming it is an atom line
-	do {
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1, 0) < 0) return -1;
-	} while (buf[0] == '#' || strlen(buf) == 0);
-
-	n = sscanf(buf, "%6c%6c%6c%6c %f %f %f",
-		ma->resid, ma->resname, ma->atomname, atomnum,
-		&ma->pos[0], &ma->pos[1], &ma->pos[2]);
-	if (n == 7) {
-		atomnum[6] = 0;
-		ma->resid[6] = 0;
-		ma->resname[6] = 0;
-		ma->atomname[6] = 0;
-
-		strip_white(atomnum);
-		strip_white(ma->resid);
-		strip_white(ma->resname);
-		strip_white(ma->atomname);
-
-		ma->atomnum = atoi(atomnum);
-
-		ma->pos[0] *= ANGS_PER_NM;
-		ma->pos[1] *= ANGS_PER_NM;
-		ma->pos[2] *= ANGS_PER_NM;
-
-		return 0;
-	}
-
-	return mdio_seterror(MDIO_BADFORMAT);
-}
-
-
-// Reads a timestep from a G96 file and stores the data in
-// the generic md_ts structure. Returns 0 on success or a
-// negative number on error and sets mdio_errcode.
-static int g96_timestep(md_file *mf, md_ts *ts) {
-	char		buf[MAX_G96_LINE + 1];
-	char		stripbuf[MAX_G96_LINE + 1];
-	float		pos[3], x[3], y[3], z[3], *currAtom;
-	long		fpos;
-	int		n, i, boxItems;
-
-	// Check parameters
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-
-  // Allocate data space for the timestep, using the number of atoms
-  // determined by open_g96_read().
-	ts->pos = (float *) malloc(sizeof(float) * 3 * ts->natoms);
-	if (!ts->pos) {
-		return mdio_seterror(MDIO_BADMALLOC);
-	}
-  currAtom = ts->pos;
-
-	// The timesteps follow the header in a fixed block
-	// format:
-	//
-	// TIMESTEP
-	//         <step number> <time value>
-	// END
-	// POSITIONRED
-	//     <x float> <y float> <z float>
-	//     .         .         .
-	//     .         .         .
-	//     .         .         .
-	// END
-	// VELOCITYRED
-	//     <x float> <y float> <z float>
-	//     .         .         .
-	//     .         .         .
-	//     .         .         .
-	// END
-	// BOX
-	//     <x float> <y float> <z float>
-	// END
-	//
-	// -----
-	//
-	// The TIMESTEP, VELOCITY and BOX blocks are optional.
-	// Floats are written in 15.9 precision.
-	//
-	// Reference: GROMACS 2.0 user manual
-	//            http://rugmd4.chem.rug.nl/~gmx/online2.0/g96.html
-
-	// First, look for an (optional) title block and skip it
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-  if (!strcasecmp(buf, "TITLE")) {
-    // skip over the text until we reach 'END'
-    while (strcasecmp(buf, "END")) {
-      if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-    }
-
-    // Read in the next line
-    if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-  }
-
-	// Next, look for a timestep block
-	if (!strcasecmp(buf, "TIMESTEP")) {
-		// Read in the value line
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-		// Extract the time value and the timestep index
-		n = sscanf(buf, "%d %f", &ts->step, &ts->time);
-		if (n != 2) return mdio_seterror(MDIO_BADFORMAT);
-
-		// Read the "END" line
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-		if (strcasecmp(buf, "END"))
-			return mdio_seterror(MDIO_BADFORMAT);
-
-		// Read in the next line
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-	}
-	else {
-		// No timestep specified -- set to zero
-		ts->step = 0;
-		ts->time = 0;
-	}
-
-	// At this point a POSITION or POSITIONRED block
-	// is REQUIRED by the format
-	if (!strcasecmp(buf, "POSITIONRED")) {
-
-    // So now we read in some atoms
-    i = 0;
-		while (i < ts->natoms) {
-			// Read in an atom
-			if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0)
-				return -1;
- 
-      // We shouldn't reach the end yet
-      if (!strcasecmp(buf, "END"))
-        return mdio_seterror(MDIO_BADFORMAT);
-
-			// Get the x,y,z coordinates
-			n = sscanf(buf, "%f %f %f", &pos[0], &pos[1], &pos[2]);
-      
-      // Ignore improperly formatted lines
-			if (n == 3) {
-				pos[0] *= ANGS_PER_NM;
-				pos[1] *= ANGS_PER_NM;
-				pos[2] *= ANGS_PER_NM;
-
-				// Copy the atom data into the array
-				memcpy(currAtom, pos, sizeof(float) * 3);
-        currAtom += 3;
-        i++;
-			}
-		}
-	}
-	else if (!strcasecmp(buf, "POSITION") || !strcasecmp(buf, "REFPOSITION")) {
-		/*
-		char resnum[7];
-		char resname[7];
-		char atomname[7];
-		char atomnum[7];
-		*/
-
-		// So now we read in some atoms
-    i = 0;
-		while (i < ts->natoms) {
-			// Read in the first line
-			if (mdio_readline(mf, buf, MAX_G96_LINE + 1, 0) < 0)
-				return -1;
- 
-      // We shouldn't reach the end yet
-      strcpy(stripbuf, buf);
-      strip_white(stripbuf); 
-      if (!strcasecmp(stripbuf, "END"))
-        return mdio_seterror(MDIO_BADFORMAT);
-
-			// Get the x,y,z coordinates and name data
-			n = sscanf(buf, "%*6c%*6c%*6c%*6c %f %f %f",
-				&pos[0], &pos[1], &pos[2]);
-
-      // Ignore improperly formatted lines
-			if (n == 3) {
-				pos[0] *= ANGS_PER_NM;
-				pos[1] *= ANGS_PER_NM;
-				pos[2] *= ANGS_PER_NM;
-
-				// Copy the atom data into the linked list item
-				memcpy(currAtom, pos, sizeof(float) * 3);
-				currAtom += 3;
-        i++;
-			}
-		}
-	}
-	else {
-		return mdio_seterror(MDIO_BADFORMAT);
-	}
-
-  // Read the END keyword
-  if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0)
-    return -1;
-  if (strcasecmp(buf, "END"))
-    return mdio_seterror(MDIO_BADFORMAT);
-
-	// ... another problem: there may or may not be a VELOCITY
-	// block or a BOX block, so we need to read one line beyond
-	// the POSITION block to determine this. If neither VEL. nor
-	// BOX are present we've read a line too far and infringed
-	// on the next timestep, so we need to keep track of the
-	// position now for a possible fseek() later to backtrack.
-	fpos = ftell(mf->f);
-
-	// Now we must read in the velocities and the box, if present
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) {
-    // It's okay if we end the file here; any other errors need to be
-    // reported.
-    if (mdio_errcode == MDIO_EOF) 
-      return mdio_seterror(MDIO_SUCCESS);
-    else 
-      return -1;
-  }
-
-	// Is there a velocity block present ?
-	if (!strcasecmp(buf, "VELOCITY") || !strcasecmp(buf, "VELOCITYRED")) {
-		// Ignore all the coordinates - VMD doesn't use them
-		for (;;) {
-			if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0)
-				return -1;
-			if (!strcasecmp(buf, "END")) break;
-		}
-
-		// Again, record our position because we may need
-		// to fseek here later if we read too far.
-		fpos = ftell(mf->f);
-
-		// Go ahead and read the next line.
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-	}
-
-	// Is there a box present ?
-	if (!strcasecmp(buf, "BOX")) {
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-    boxItems = sscanf(buf, " %f %f %f %f %f %f %f %f %f", 
-               &x[0], &y[1], &z[2], &x[1], &x[2], &y[0], &y[2], &z[0], &z[1]);
-    if (boxItems == 3) {
-      x[1] = x[2] = 0;
-      y[0] = y[2] = 0;
-      z[0] = z[1] = 0;
-    }
-    else if (boxItems != 9) 
-      return mdio_seterror(MDIO_BADFORMAT);
-
-    // Allocate the box and convert the vectors.
-    ts->box = (md_box *) malloc(sizeof(md_box));
-    if (mdio_readbox(ts->box, x, y, z) < 0) {
-      free(ts->box);
-      ts->box = NULL;
-      return mdio_seterror(MDIO_BADFORMAT);
-    }
-
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) {
-      free(ts->box);
-      ts->box = NULL;
-      return -1;
-    }
-		if (strcasecmp(buf, "END")) {
-      free(ts->box);
-      ts->box = NULL;
-			return mdio_seterror(MDIO_BADFORMAT);
-    }
-	}
-	else {
-		// We have read too far, so fseek back to the
-		// last known safe position so we don't return
-		// with the file pointer set infringing on the
-		// next timestep data.
-		fseek(mf->f, fpos, SEEK_SET);
-	}
-
-	// We're done!
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Attempts to read header data from a GROMACS structure file
-// The GROMACS header format is as follows (fixed, 2 lines ASCII):
-// <title> [ n= <timevalue> ]
-//     <num atoms>
-static int gro_header(md_file *mf, char *title, int titlelen, float *timeval,
-               int *natoms, int rewind) {
-  char buf[MAX_GRO_LINE + 1];
-  long fpos;
-  char *p;
-
-  // Check parameters
-  if (!mf)
-    return mdio_seterror(MDIO_BADPARAMS);
-
-  // Get the current file position for rewinding later
-  fpos = ftell(mf->f);
-
-  // The header consists of 2 lines - get the first line
-  if (mdio_readline(mf, buf, MAX_GRO_LINE + 1) < 0) return -1;
-
-  // The timevalue can be included in the title string
-  // after a "t=" prefix.
-  if ((p = (char *) strstr(buf, "t="))) {
-    char *q = p;
-    *(q--) = 0;
-
-    // Skip the `t=' and strip whitespace from
-    // the resulting strings
-    p += 2;
-    strip_white(p);
-    strip_white(buf);
-
-    // Grab the timevalue from the title string
-    if (timeval) *timeval = (float) atof(p);
-  } else {
-    // No timevalue - just copy the string
-    if (timeval) *timeval = 0;
-  }
-
-  // Copy the title string
-  if (title && titlelen) strncpy(title, buf, titlelen);
-
-  // Get the second line and grab the number of atoms
-  if (mdio_readline(mf, buf, MAX_GRO_LINE + 1) < 0) return -1;
-
-  // Store the number of atoms
-  if (natoms && (!(*natoms = atoi(buf))))
-    return mdio_seterror(MDIO_BADFORMAT);
-
-  // Now we rewind the file so that subsequent calls to
-  // gro_timestep() will succeed. gro_timestep() requires
-  // the header to be at the current file pointer.
-  if (rewind)
-    fseek(mf->f, fpos, SEEK_SET);
-
-  return 0; // Done!
-}
-
-
-// Reads one atom record from a GROMACS file. Returns GMX_SUCCESS
-// on success or a negative number on error.
-//
-// Record format (one line, fixed):
-//    rrrrrRRRRRaaaaaAAAAA <x pos> <y pos> <z pos> <x vel> <y vel> <z vel>
-//
-//    r = residue number
-//    R = residue name
-//    a = atom name
-//    A = atom number
-//
-static int gro_rec(md_file *mf, md_atom *ma) {
-  char buf[MAX_GRO_LINE + 1];
-  char atomnum[6];
-  char xposc[12], yposc[12], zposc[12];
-  int n;
-
-  if (!mf)
-    return mdio_seterror(MDIO_BADPARAMS);
-
-  do {
-    if (mdio_readline(mf, buf, MAX_GRO_LINE + 1, 0) < 0)
-      return -1;
-  } while (buf[0] == '#' || !strlen(buf));
-
-  // Read in the fields
-  n = sscanf(buf, "%5c%5c%5c%5c%8c%8c%8c", 
-             ma->resid, ma->resname, ma->atomname, atomnum, 
-             xposc, yposc, zposc);
-
-  if (n != 7)
-    return mdio_seterror(MDIO_BADFORMAT);
-
-  // Null terminate the strings
-  ma->resname[5] = 0;
-  ma->atomname[5] = 0;
-  ma->resid[5] = 0;
-  atomnum[5] = 0;
-  xposc[8] = 0;
-  yposc[8] = 0;
-  zposc[8] = 0;
- 
-  if ((sscanf(xposc, "%f", &ma->pos[0]) != 1) ||
-      (sscanf(yposc, "%f", &ma->pos[1]) != 1) ||
-      (sscanf(zposc, "%f", &ma->pos[2]) != 1)) {
-    return mdio_seterror(MDIO_BADFORMAT);
-  }
-
-  // Convert strings to numbers
-  strip_white(atomnum);
-  ma->atomnum = atoi(atomnum);
-
-  // Convert nanometers to angstroms
-  ma->pos[0] *= ANGS_PER_NM;
-  ma->pos[1] *= ANGS_PER_NM;
-  ma->pos[2] *= ANGS_PER_NM;
-
-  // Strip leading and trailing whitespace
-  strip_white(ma->atomname);
-  strip_white(ma->resname);
-  strip_white(ma->resid);
-
-  return 0;
-}
-
-
-// Reads in a timestep from a .gro file. Ignores the data
-// not needed for a timestep, so is a little faster than
-// calling gro_rec() for each atom. Also reads in the
-// header block.
-//
-static int gro_timestep(md_file *mf, md_ts *ts) {
-	char buf[MAX_GRO_LINE + 1];
-	long coord;
-	int i, n, boxItems;
-  float x[3], y[3], z[3];
-  char xposc[12], yposc[12], zposc[12];
-
-  if (!mf || !ts) 
-    return mdio_seterror(MDIO_BADPARAMS);
-
-  if (gro_header(mf, NULL, 0, &ts->time, &ts->natoms, 0) < 0)
-    return -1;
-
-  ts->pos = (float *) malloc(3 * sizeof(float) * ts->natoms);
-  if (!ts->pos)
-    return mdio_seterror(MDIO_BADMALLOC);
-
-  coord = 0;
-  for (i = 0; i < ts->natoms; i++) {
-    if (mdio_readline(mf, buf, MAX_GRO_LINE + 1, 0) < 0) {
-      free(ts->pos);
-      return -1;
-    }
-	
-    n = sscanf(buf, "%*5c%*5c%*5c%*5c%8c%8c%8c", xposc, yposc, zposc);
-    if (n != 3) 
-      return mdio_seterror(MDIO_BADFORMAT);
-
-    if ((sscanf(xposc, "%f", &ts->pos[coord    ]) != 1) ||
-        (sscanf(yposc, "%f", &ts->pos[coord + 1]) != 1) ||
-        (sscanf(zposc, "%f", &ts->pos[coord + 2]) != 1)) {
-      return mdio_seterror(MDIO_BADFORMAT);
-    }
-
-    ts->pos[coord    ] *= ANGS_PER_NM;
-    ts->pos[coord + 1] *= ANGS_PER_NM;
-    ts->pos[coord + 2] *= ANGS_PER_NM;
-
-    coord += 3;
-  }
-
-  // Read the box, stored as three vectors representing its edges
-  if (mdio_readline(mf, buf, MAX_GRO_LINE + 1, 0) < 0) {
-    free(ts->pos);
-    return -1;
-  }
-
-  boxItems = sscanf(buf, " %f %f %f %f %f %f %f %f %f", 
-             &x[0], &y[1], &z[2], &x[1], &x[2], &y[0], &y[2], &z[0], &z[1]);
-
-  // File may only include three scalars for the box information -- if
-  // that's the case, the box is orthoganal.
-  if (boxItems == 3) {
-    x[1] = x[2] = 0;
-    y[0] = y[2] = 0;
-    z[0] = z[1] = 0;
-  } else if (boxItems != 9) {
-    free(ts->pos);
-    return -1;
-  }
-
-  // Allocate the box and convert the vectors.
-  ts->box = (md_box *) malloc(sizeof(md_box));
-  if (mdio_readbox(ts->box, x, y, z) < 0) {
-    free(ts->pos);
-    free(ts->box);
-    ts->box = NULL;
-    return -1;
-  }
-
-  return 0;
-}
-
-
-// Attempts to read header data from a .trX trajectory file
-//
-// The .trX header format is as follows:
-//
-//	4 bytes		- magic number (0x07C9)
-//	...
-//
-static int trx_header(md_file *mf, int rewind) {
-	int magic;
-	trx_hdr *hdr;
-	long fpos;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	// In case we need to rewind
-	fpos = ftell(mf->f);
-
-	// We need to store some data to the trX header data
-	// structure inside the md_file structure
-	hdr = mf->trx;
-	if (!mf->trx) return mdio_seterror(MDIO_BADPARAMS);
-
-	// Read the magic number
-	if (trx_int(mf, &magic) < 0) return -1;
-	if (magic != TRX_MAGIC) {
-		// Try reverse endianism
-		swap4_aligned(&magic, 1);
-		if (magic != TRX_MAGIC) return mdio_seterror(MDIO_BADFORMAT);
-
-		// Enable byte swapping (actually works, too!)
-		mf->rev = 1;
-	}
-
-	// Read the version number. 
-        // XXX. this is not the version number, but the storage size
-	// of the following XDR encoded string.
-	// the 'title' string is in fact the version identifier.
-	// since VMD does not use any of that, it does no harm,
-	// but is should still be fixed occasionally. AK 2005/01/08.
-
-	if(mf->fmt!=MDFMT_TRJ) {
-		// It appears that TRJ files either don't contain a version
-		// number or don't have a length-delimiter on the string,
-		// whereas TRR files do contain both.  Thus, with TRJ, we just
-		// assume that the version number is the string length and 
-		// just hope for the best. -- WLD 2006/07/09
-		if (trx_int(mf, &hdr->version) < 0) return -1;
-	}
-
-	// Read in the title string
-	if (trx_string(mf, hdr->title, MAX_TRX_TITLE) < 0)
-		return -1;
-
-	// Read in some size data
-	if (trx_int(mf, &hdr->ir_size) < 0) return -1;
-	if (trx_int(mf, &hdr->e_size) < 0) return -1;
-	if (trx_int(mf, &hdr->box_size) < 0) return -1;
-	if (trx_int(mf, &hdr->vir_size) < 0) return -1;
-	if (trx_int(mf, &hdr->pres_size) < 0) return -1;
-	if (trx_int(mf, &hdr->top_size) < 0) return -1;
-	if (trx_int(mf, &hdr->sym_size) < 0) return -1;
-	if (trx_int(mf, &hdr->x_size) < 0) return -1;
-	if (trx_int(mf, &hdr->v_size) < 0) return -1;
-	if (trx_int(mf, &hdr->f_size) < 0) return -1;
-	if (trx_int(mf, &hdr->natoms) < 0) return -1;
-	if (trx_int(mf, &hdr->step) < 0) return -1;
-	if (trx_int(mf, &hdr->nre) < 0) return -1;
-
-	// Make sure there are atoms...
-	if (!hdr->natoms) return mdio_seterror(MDIO_BADFORMAT);
-
-	// Try to determine precision (float? double?)
-	if (hdr->x_size) mf->prec = hdr->x_size / (hdr->natoms * 3);
-	else if (hdr->v_size) mf->prec = hdr->v_size / (hdr->natoms * 3);
-	else if (hdr->f_size) mf->prec = hdr->f_size / (hdr->natoms * 3);
-	else return mdio_seterror(MDIO_BADPRECISION);
-
-	if (mf->prec != sizeof(float) && mf->prec != sizeof(double)) {
-		// We have no data types this size! The
-		// file must've been generated on another
-		// platform
-		return mdio_seterror(MDIO_BADPRECISION);
-	}
-
-	// Read in timestep and lambda
-	if (trx_real(mf, &hdr->t) < 0) return -1;
-	if (trx_real(mf, &hdr->lambda) < 0) return -1;
-
-	// Rewind if necessary
-	if (rewind) fseek(mf->f, fpos, SEEK_SET);
-
-	return 0;
-}
-
-
-// Reads in an integer and stores it in y. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int trx_int(md_file *mf, int *y) {
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-        // sanity check.
-        if (sizeof(int) != 4) return mdio_seterror(MDIO_SIZEERROR);
-
-	if (y) {
-		if (fread(y, 4, 1, mf->f) != 1)
-			return mdio_seterror(MDIO_IOERROR);
-		if (mf->rev) swap4_aligned(y, 1);
-	}
-	else if (fseek(mf->f, 4, SEEK_CUR) != 0)
-		return mdio_seterror(MDIO_IOERROR);
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Reads in either a float or a double, depending on the
-// precision, and stores that number in y. Returns
-// GMX_SUCCESS on success or a negative number on error.
-static int trx_real(md_file *mf, float *y) {
-	double x;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	switch (mf->prec) {
-		case sizeof(float):
-			if (!y) {
-				if (fseek(mf->f, mf->prec, SEEK_CUR) != 0)
-					return mdio_seterror(MDIO_IOERROR);
-			} else {
-				if (fread(y, mf->prec, 1, mf->f) != 1)
-					return mdio_seterror(MDIO_IOERROR);
-				if (mf->rev) swap4_aligned(y, 1);
-			}
-			return mdio_seterror(MDIO_SUCCESS);
-
-		case sizeof(double):
-			if (!y) {
-				if (fseek(mf->f, mf->prec, SEEK_CUR) != 0)
-					return mdio_seterror(MDIO_IOERROR);
-			} else {
-				if (fread(&x, mf->prec, 1, mf->f) != 1)
-					return mdio_seterror(MDIO_IOERROR);
-				if (mf->rev) swap8_aligned(&x, 1);
-				*y = (float) x;
-			}
-			return mdio_seterror(MDIO_SUCCESS);
-
-		default:
-			return mdio_seterror(MDIO_BADPRECISION);
-	}
-
-}
-
-
-// Reads in a real-valued vector (taking precision into account).
-// Stores the vector in vec, and returns GMX_SUCCESS on success
-// or a negative number on error.
-static int trx_rvector(md_file *mf, float *vec) {
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (!vec) {
-		if (trx_real(mf, NULL) < 0) return -1;
-		if (trx_real(mf, NULL) < 0) return -1;
-		if (trx_real(mf, NULL) < 0) return -1;
-		return mdio_seterror(MDIO_SUCCESS);
-	} else {
-		if (trx_real(mf, &vec[0]) < 0) return -1;
-		if (trx_real(mf, &vec[1]) < 0) return -1;
-		if (trx_real(mf, &vec[2]) < 0) return -1;
-		return mdio_seterror(MDIO_SUCCESS);
-	}
-}
-
-
-// Reads in a string by first reading an integer containing the
-// string's length, then reading in the string itself and storing
-// it in str. If the length is greater than max, it is truncated
-// and the rest of the string is skipped in the file. Returns the
-// length of the string on success or a negative number on error.
-static int trx_string(md_file *mf, char *str, int max) {
-	int size;
-  size_t ssize;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (trx_int(mf, &size) < 0) return -1;
-  ssize = (size_t)size;
-
-	if (str && size <= max) {
-		if (fread(str, 1, size, mf->f) != ssize)
-			return mdio_seterror(MDIO_IOERROR);
-		str[size] = 0;
-		return size;
-	} else if (str) {
-		if (fread(str, 1, max, mf->f) != ssize)
-			return mdio_seterror(MDIO_IOERROR);
-		if (fseek(mf->f, size - max, SEEK_CUR) != 0)
-			return mdio_seterror(MDIO_IOERROR);
-		str[max] = 0;
-		return max;
-	} else {
-		if (fseek(mf->f, size, SEEK_CUR) != 0)
-			return mdio_seterror(MDIO_IOERROR);
-		return 0;
-	}
-}
-
-
-// Reads in a timestep frame from the .trX file and returns the
-// data in a timestep structure. Returns NULL on error.
-static int trx_timestep(md_file *mf, md_ts *ts) {
-	int i;
-  float x[3], y[3], z[3];
-	trx_hdr *hdr;
-
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-	if (mf->fmt != MDFMT_TRJ && mf->fmt != MDFMT_TRR)
-		return mdio_seterror(MDIO_WRONGFORMAT);
-
-	// Read the header
-	if (trx_header(mf) < 0) return -1;
-
-	// We need some data from the trX header
-	hdr = mf->trx;
-	if (!hdr) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (hdr->box_size) { // XXX need to check value of box_size!!
-		if (trx_rvector(mf, x) < 0) return -1;
-		if (trx_rvector(mf, y) < 0) return -1;
-		if (trx_rvector(mf, z) < 0) return -1;
-    // Allocate the box and convert the vectors.
-    ts->box = (md_box *) malloc(sizeof(md_box));
-    if (mdio_readbox(ts->box, x, y, z) < 0) {
-      free(ts->box);
-      ts->box = NULL;
-      return -1;
-    }
-	}
-
-	if (hdr->vir_size) {
-		if (trx_rvector(mf, NULL) < 0) return -1;
-		if (trx_rvector(mf, NULL) < 0) return -1;
-		if (trx_rvector(mf, NULL) < 0) return -1;
-	}
-
-        if (hdr->pres_size) {
-                if (trx_rvector(mf, NULL) < 0) return -1;
-                if (trx_rvector(mf, NULL) < 0) return -1;
-                if (trx_rvector(mf, NULL) < 0) return -1;
-        }
-
-        if (hdr->x_size) {
-                ts->pos = (float *) malloc(sizeof(float) * 3 * hdr->natoms);
-                if (!ts->pos) return mdio_seterror(MDIO_BADMALLOC);
-
-		ts->natoms = hdr->natoms;
-
-		for (i = 0; i < hdr->natoms; i++) {
-			if (trx_rvector(mf, &ts->pos[i * 3]) < 0) {
-				mdio_tsfree(ts, 1);
-				return -1;
-			}
-			ts->pos[i * 3] *= ANGS_PER_NM;
-			ts->pos[i * 3 + 1] *= ANGS_PER_NM;
-			ts->pos[i * 3 + 2] *= ANGS_PER_NM;
-		}
-        }
-
-        if (hdr->v_size) {
-		for (i = 0; i < hdr->natoms; i++) {
-			if (trx_rvector(mf, NULL) < 0) {
-				mdio_tsfree(ts, 1);
-				return -1;
-			}
-		}
-        }
-
-        if (hdr->f_size) {
-		for (i = 0; i < hdr->natoms; i++) {
-			if (trx_rvector(mf, NULL) < 0) {
-				mdio_tsfree(ts, 1);
-				return -1;
-			}
-		}
-        }
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// writes an int in big endian. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int put_trx_int(md_file *mf, int y) {
-      if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-      // sanity check.
-      if (sizeof(int) != 4) return mdio_seterror(MDIO_SIZEERROR);
-
-      if (mf->rev) swap4_aligned(&y, 1);
-      if (fwrite(&y, 4, 1, mf->f) != 1)
-    return mdio_seterror(MDIO_IOERROR);
-
-  return mdio_seterror(MDIO_SUCCESS);
-}
-
-// writes a real in big-endian. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int put_trx_real(md_file *mf, float y) {
-      if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-      if (mf->rev) swap4_aligned(&y, 1);
-      if (fwrite(&y, 4, 1, mf->f) != 1)
-        return mdio_seterror(MDIO_IOERROR);
-
-      return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// writes an xdr encoded string. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int put_trx_string(md_file *mf, const char *s) {
-	if (!mf || !s) return mdio_seterror(MDIO_BADPARAMS);
-        
-        // write: size of object, string length, string data
-        size_t len = strlen(s);
-        if ( put_trx_int(mf, len+1)
-             || put_trx_int(mf, len)
-             || (fwrite(s, len, 1, mf->f) != 1))
-          return mdio_seterror(MDIO_IOERROR);
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// xtc_int() - reads an integer from an xtc file
-static int xtc_int(md_file *mf, int *i) {
-	unsigned char c[4];
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-        // sanity check.
-        if (sizeof(int) != 4) return mdio_seterror(MDIO_SIZEERROR);
-
-	if (fread(c, 1, 4, mf->f) != 4) {
-		if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-		else if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-		else return mdio_seterror(MDIO_UNKNOWNERROR);
-	}
-
-	if (i) *i = c[3] + (c[2] << 8) + (c[1] << 16) + (c[0] << 24);
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// xtc_float() - reads a float from an xtc file
-static int xtc_float(md_file *mf, float *f) {
-	unsigned char c[4];
-	int i;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (fread(c, 1, 4, mf->f) != 4) {
-		if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-		else if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-		else return mdio_seterror(MDIO_UNKNOWNERROR);
-	}
-
-	if (f) {
-		// By reading the number in as an integer and then
-		// copying it to a floating point number we can
-		// ensure proper endianness
-		i = c[3] + (c[2] << 8) + (c[1] << 16) + (c[0] << 24);
-		memcpy(f, &i, 4);
-	}
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// xtc_data() - reads a specific amount of data from an xtc
-// file using the xdr format.
-static int xtc_data(md_file *mf, char *buf, int len) {
-	if (!mf || len < 1) return mdio_seterror(MDIO_BADPARAMS);
-  size_t slen = (size_t)len;
-	if (buf) {
-		if (fread(buf, 1, slen, mf->f) != slen) {
-			if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-			if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-			else return mdio_seterror(MDIO_UNKNOWNERROR);
-		}
-		if (len % 4) {
-			if (fseek(mf->f, 4 - (len % 4), SEEK_CUR)) {
-				if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-				if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-				else return mdio_seterror(MDIO_UNKNOWNERROR);
-			}
-		}
-	}
-	else {
-		int newlen;
-		newlen = len;
-		if (len % 4) newlen += (4 - (len % 4));
-		if (fseek(mf->f, newlen, SEEK_CUR)) {
-			if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-			if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-			else return mdio_seterror(MDIO_UNKNOWNERROR);
-		}
-	}
-	return len;
-}
-
-
-// xtc_timestep() - reads a timestep from an .xtc file.
-static int xtc_timestep(md_file *mf, md_ts *ts) {
-	int n;
-	float f, x[3], y[3], z[3];
-
-	int size = 0; // explicitly initialized to zero.
-	float precision;
-
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-	if (!mf->f) return mdio_seterror(MDIO_BADPARAMS);
-	if (mf->fmt != MDFMT_XTC) return mdio_seterror(MDIO_WRONGFORMAT);
-
-	// Check magic number
-	if (xtc_int(mf, &n) < 0) return -1;
-	if (n != XTC_MAGIC) return mdio_seterror(MDIO_BADFORMAT);
-
-	// Get number of atoms
-	if (xtc_int(mf, &n) < 0) return -1;
-	ts->natoms = n;
-
-	// Get the simulation step
-	if (xtc_int(mf, &n) < 0) return -1;
-	ts->step = n;
-
-	// Get the time value
-	if (xtc_float(mf, &f) < 0) return -1;
-	ts->time = f;
-
-	// Read the basis vectors of the box
-  if ( (xtc_float(mf, &x[0]) < 0) ||
-       (xtc_float(mf, &x[1]) < 0) ||
-       (xtc_float(mf, &x[2]) < 0) ||
-       (xtc_float(mf, &y[0]) < 0) ||
-       (xtc_float(mf, &y[1]) < 0) ||
-       (xtc_float(mf, &y[2]) < 0) ||
-       (xtc_float(mf, &z[0]) < 0) ||
-       (xtc_float(mf, &z[1]) < 0) ||
-       (xtc_float(mf, &z[2]) < 0) )
-    return -1;
-  // Allocate the box and convert the vectors.
-  ts->box = (md_box *) malloc(sizeof(md_box));
-  if (mdio_readbox(ts->box, x, y, z) < 0) {
-    free(ts->box);
-    ts->box = NULL;
-    return -1;
-  }
-
-	ts->pos = (float *) malloc(sizeof(float) * 3 * ts->natoms);
-	if (!ts->pos) return mdio_seterror(MDIO_BADMALLOC);
-	n = xtc_3dfcoord(mf, ts->pos, &size, &precision);
-	if (n < 0) return -1;
-
-	/* Now we're left with the job of scaling... */
-	for (n = 0; n < ts->natoms * 3; n++)
-		ts->pos[n] *= ANGS_PER_NM;
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-///////////////////////////////////////////////////////////////////////
-// This algorithm is an implementation of the 3dfcoord algorithm
-// written by Frans van Hoesel (hoesel@chem.rug.nl) as part of the
-// Europort project in 1995.
-///////////////////////////////////////////////////////////////////////
-
-// integer table used in decompression
-static int xtc_magicints[] = {
-	0, 0, 0, 0, 0, 0, 0, 0, 0,8, 10, 12, 16, 20, 25, 32, 40, 50, 64,
-	80, 101, 128, 161, 203, 256, 322, 406, 512, 645, 812, 1024, 1290,
-	1625, 2048, 2580, 3250, 4096, 5060, 6501, 8192, 10321, 13003, 16384,
-	20642, 26007, 32768, 41285, 52015, 65536, 82570, 104031, 131072,
-	165140, 208063, 262144, 330280, 416127, 524287, 660561, 832255,
-	1048576, 1321122, 1664510, 2097152, 2642245, 3329021, 4194304,
-	5284491, 6658042, 8388607, 10568983, 13316085, 16777216 };
-
-#define FIRSTIDX 9
-/* note that magicints[FIRSTIDX-1] == 0 */
-#define LASTIDX (sizeof(xtc_magicints) / sizeof(*xtc_magicints))
-
-
-// returns the number of bits in the binary expansion of
-// the given integer.
-static int xtc_sizeofint(int size) {
-	unsigned int num = 1;
-  unsigned int ssize = (unsigned int)size;
-	int nbits = 0;
-
-	while (ssize >= num && nbits < 32) {
-		nbits++;
-		num <<= 1;
-	}
-	return nbits;
-}
-
-// calculates the number of bits a set of integers, when compressed,
-// will take up.
-static int xtc_sizeofints(int nints, unsigned int *sizes) {
-	int i;
-  unsigned int num;
-	unsigned int nbytes, nbits, bytes[32], bytecnt, tmp;
-	nbytes = 1;
-	bytes[0] = 1;
-	nbits = 0;
-	for (i=0; i < nints; i++) {	
-		tmp = 0;
-		for (bytecnt = 0; bytecnt < nbytes; bytecnt++) {
-			tmp = bytes[bytecnt] * sizes[i] + tmp;
-			bytes[bytecnt] = tmp & 0xff;
-			tmp >>= 8;
-		}
-		while (tmp != 0) {
-			bytes[bytecnt++] = tmp & 0xff;
-			tmp >>= 8;
-		}
-		nbytes = bytecnt;
-	}
-	num = 1;
-	nbytes--;
-	while (bytes[nbytes] >= num) {
-		nbits++;
-		num *= 2;
-	}
-	return nbits + nbytes * 8;
-}
-
-// reads bits from a buffer.    
-static int xtc_receivebits(int *buf, int nbits) {
-	int cnt, num; 
-	unsigned int lastbits, lastbyte;
-	unsigned char * cbuf;
-	int mask = (1 << nbits) -1;
-
-	cbuf = ((unsigned char *)buf) + 3 * sizeof(*buf);
-	cnt = buf[0];
-	lastbits = (unsigned int) buf[1];
-	lastbyte = (unsigned int) buf[2];
-
-	num = 0;
-	while (nbits >= 8) {
-		lastbyte = ( lastbyte << 8 ) | cbuf[cnt++];
-		num |=  (lastbyte >> lastbits) << (nbits - 8);
-		nbits -=8;
-	}
-	if (nbits > 0) {
-		if (lastbits < (unsigned int)nbits) {
-			lastbits += 8;
-			lastbyte = (lastbyte << 8) | cbuf[cnt++];
-		}
-		lastbits -= nbits;
-		num |= (lastbyte >> lastbits) & ((1 << nbits) -1);
-	}
-	num &= mask;
-	buf[0] = cnt;
-	buf[1] = lastbits;
-	buf[2] = lastbyte;
-	return num; 
-}
-
-// decompresses small integers from the buffer
-// sizes parameter has to be non-zero to prevent divide-by-zero
-static void xtc_receiveints(int *buf, const int nints, int nbits,
-			unsigned int *sizes, int *nums) {
-	int bytes[32];
-	int i, j, nbytes, p, num;
-
-	bytes[1] = bytes[2] = bytes[3] = 0;
-	nbytes = 0;
-	while (nbits > 8) {
-		bytes[nbytes++] = xtc_receivebits(buf, 8);
-		nbits -= 8;
-	}
-	if (nbits > 0) {
-		bytes[nbytes++] = xtc_receivebits(buf, nbits);
-	}
-	for (i = nints-1; i > 0; i--) {
-		num = 0;
-		for (j = nbytes-1; j >=0; j--) {
-			num = (num << 8) | bytes[j];
-			p = num / sizes[i];
-			bytes[j] = p;
-			num = num - p * sizes[i];
-		}
-		nums[i] = num;
-	}
-	nums[0] = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
-}
-
-// function that actually reads and writes compressed coordinates    
-static int xtc_3dfcoord(md_file *mf, float *fp, int *size, float *precision) {
-	static int *ip = NULL;
-	static int oldsize;
-	static int *buf;
-
-	int minint[3], maxint[3], *lip;
-	int smallidx;
-	unsigned sizeint[3], sizesmall[3], bitsizeint[3], size3;
-	int flag, k;
-	int small, smaller, i, is_smaller, run;
-	float *lfp;
-	int tmp, *thiscoord,  prevcoord[3];
-
-	int bufsize, lsize;
-	unsigned int bitsize;
-	float inv_precision;
-
-        /* avoid uninitialized data compiler warnings */
-        bitsizeint[0] = 0;
-        bitsizeint[1] = 0;
-        bitsizeint[2] = 0;
-
-	if (xtc_int(mf, &lsize) < 0) return -1;
-
-	if (*size != 0 && lsize != *size) return mdio_seterror(MDIO_BADFORMAT);
-
-	*size = lsize;
-	size3 = *size * 3;
-	if (*size <= 9) {
-		for (i = 0; i < *size; i++) {
-			if (xtc_float(mf, fp + (3 * i)) < 0) return -1;
-			if (xtc_float(mf, fp + (3 * i) + 1) < 0) return -1;
-			if (xtc_float(mf, fp + (3 * i) + 2) < 0) return -1;
-		}
-		return *size;
-	}
-	xtc_float(mf, precision);
-	if (ip == NULL) {
-		ip = (int *)malloc(size3 * sizeof(*ip));
-		if (ip == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		bufsize = (int) (size3 * 1.2);
-		buf = (int *)malloc(bufsize * sizeof(*buf));
-		if (buf == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		oldsize = *size;
-	} else if (*size > oldsize) {
-		ip = (int *)realloc(ip, size3 * sizeof(*ip));
-		if (ip == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		bufsize = (int) (size3 * 1.2);
-		buf = (int *)realloc(buf, bufsize * sizeof(*buf));
-		if (buf == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		oldsize = *size;
-	}
-	buf[0] = buf[1] = buf[2] = 0;
-
-	xtc_int(mf, &(minint[0]));
-	xtc_int(mf, &(minint[1]));
-	xtc_int(mf, &(minint[2]));
-
-	xtc_int(mf, &(maxint[0]));
-	xtc_int(mf, &(maxint[1]));
-	xtc_int(mf, &(maxint[2]));
-		
-	sizeint[0] = maxint[0] - minint[0]+1;
-	sizeint[1] = maxint[1] - minint[1]+1;
-	sizeint[2] = maxint[2] - minint[2]+1;
-	
-	/* check if one of the sizes is to big to be multiplied */
-	if ((sizeint[0] | sizeint[1] | sizeint[2] ) > 0xffffff) {
-		bitsizeint[0] = xtc_sizeofint(sizeint[0]);
-		bitsizeint[1] = xtc_sizeofint(sizeint[1]);
-		bitsizeint[2] = xtc_sizeofint(sizeint[2]);
-		bitsize = 0; /* flag the use of large sizes */
-	} else {
-		bitsize = xtc_sizeofints(3, sizeint);
-	}
-
-	xtc_int(mf, &smallidx);
-	smaller = xtc_magicints[FIRSTIDX > smallidx - 1 ? FIRSTIDX : smallidx - 1] / 2;
-	small = xtc_magicints[smallidx] / 2;
-	sizesmall[0] = sizesmall[1] = sizesmall[2] = xtc_magicints[smallidx];
-
-	/* check for zero values that would yield corrupted data */
-	if ( !sizesmall[0] || !sizesmall[1] || !sizesmall[2] ) {
-		printf("XTC corrupted, sizesmall==0 (case 1)\n");
-		return -1;
-	}
-
-
-	/* buf[0] holds the length in bytes */
-	if (xtc_int(mf, &(buf[0])) < 0) return -1;
-
-	if (xtc_data(mf, (char *) &buf[3], (int) buf[0]) < 0) return -1;
-
-	buf[0] = buf[1] = buf[2] = 0;
-
-	lfp = fp;
-	inv_precision = 1.0f / (*precision);
-	run = 0;
-	i = 0;
-	lip = ip;
-	while (i < lsize) {
-		thiscoord = (int *)(lip) + i * 3;
-
-		if (bitsize == 0) {
-			thiscoord[0] = xtc_receivebits(buf, bitsizeint[0]);
-			thiscoord[1] = xtc_receivebits(buf, bitsizeint[1]);
-			thiscoord[2] = xtc_receivebits(buf, bitsizeint[2]);
-		} else {
-			xtc_receiveints(buf, 3, bitsize, sizeint, thiscoord);
-		}
-
-		i++;
-		thiscoord[0] += minint[0];
-		thiscoord[1] += minint[1];
-		thiscoord[2] += minint[2];
-
-		prevcoord[0] = thiscoord[0];
-		prevcoord[1] = thiscoord[1];
-		prevcoord[2] = thiscoord[2];
- 
-
-		flag = xtc_receivebits(buf, 1);
-		is_smaller = 0;
-		if (flag == 1) {
-			run = xtc_receivebits(buf, 5);
-			is_smaller = run % 3;
-			run -= is_smaller;
-			is_smaller--;
-		}
-		if (run > 0) {
-			thiscoord += 3;
-			for (k = 0; k < run; k+=3) {
-				xtc_receiveints(buf, 3, smallidx, sizesmall, thiscoord);
-				i++;
-				thiscoord[0] += prevcoord[0] - small;
-				thiscoord[1] += prevcoord[1] - small;
-				thiscoord[2] += prevcoord[2] - small;
-				if (k == 0) {
-					/* interchange first with second atom for better
-					 * compression of water molecules
-					 */
-					tmp = thiscoord[0]; thiscoord[0] = prevcoord[0];
-					prevcoord[0] = tmp;
-					tmp = thiscoord[1]; thiscoord[1] = prevcoord[1];
-					prevcoord[1] = tmp;
-					tmp = thiscoord[2]; thiscoord[2] = prevcoord[2];
-					prevcoord[2] = tmp;
-					*lfp++ = prevcoord[0] * inv_precision;
-					*lfp++ = prevcoord[1] * inv_precision;
-					*lfp++ = prevcoord[2] * inv_precision;
-
-					if ( !sizesmall[0] || !sizesmall[1] || !sizesmall[2] ) {
-						printf("XTC corrupted, sizesmall==0 (case 2)\n");
-						return -1;
-					}
-
-				} else {
-					prevcoord[0] = thiscoord[0];
-					prevcoord[1] = thiscoord[1];
-					prevcoord[2] = thiscoord[2];
-				}
-				*lfp++ = thiscoord[0] * inv_precision;
-				*lfp++ = thiscoord[1] * inv_precision;
-				*lfp++ = thiscoord[2] * inv_precision;
-			}
-		} else {
-			*lfp++ = thiscoord[0] * inv_precision;
-			*lfp++ = thiscoord[1] * inv_precision;
-			*lfp++ = thiscoord[2] * inv_precision;		
-		}
-		smallidx += is_smaller;
-		if (is_smaller < 0) {
-			small = smaller;
-			if (smallidx > FIRSTIDX) {
-				smaller = xtc_magicints[smallidx - 1] /2;
-			} else {
-				smaller = 0;
-			}
-		} else if (is_smaller > 0) {
-			smaller = small;
-			small = xtc_magicints[smallidx] / 2;
-		}
-		sizesmall[0] = sizesmall[1] = sizesmall[2] = xtc_magicints[smallidx] ;
-	}
-	return 1;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ReadPARM.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ReadPARM.h
deleted file mode 100644
index 2b0e6803fa014162c4c167b03bac895292b32738..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ReadPARM.h
+++ /dev/null
@@ -1,976 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: ReadPARM.h,v $
- *      $Author: johns $        $Locker:  $                $State: Exp $
- *      $Revision: 1.15 $      $Date: 2016/11/06 17:54:57 $
- *
- ***************************************************************************
- * DESCRIPTION:
- * NOTE:: Significant were made to the VMD version of
- *        Bill Ross's original code in order to make it easy to hook
- *        into VMD plugin structures.
- * Here is what was changed:
- *     Functions became Class Methods, data became instance variables
- *     The Code to check for compressed files before opening was disabled
- *     Methods get_parm_atom, get_parm_bond, get_hydrogen_bond,
- *     get_parm_natoms, get_parm_nbonds, get_parm_boxInfo were added in 
- *     order to convert from prm.c parlance to VMD conventions.
- *     RCS Information headers and footers were added.
- ***************************************************************************/
-
-/*
- * COPYRIGHT 1992, REGENTS OF THE UNIVERSITY OF CALIFORNIA
- *
- *  prm.c - read information from an amber PARM topology file:
- *      atom/residue/bond/charge info, plus force field data.
- *      This file and the accompanying prm.h may be distributed
- *      provided this notice is retained unmodified and provided
- *      that any modifications to the rest of the file are noted
- *      in comments.
- *
- *      Bill Ross, UCSF 1994
- */
-
-#ifndef READPARM_H
-#define READPARM_H
-
-// XXX enable the new AMBER reading code, deals with packed 
-// fortran 12I6 integer formats.
-#define USENEWCODE 1
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include "molfile_plugin.h"  // needed for molfile return codes etc
-
-#if 0 
-#define _REAL		double
-#define DBLFMT          "%lf"
-#else
-#define _REAL		float
-#define DBLFMT          "%f"
-#endif
-
-typedef struct parm {
-	char	ititl[81];
-	int 	IfBox, Nmxrs, IfCap,
-		 Natom,  Ntypes,  Nbonh,  Mbona,  Ntheth,  Mtheta, 
-		 Nphih,  Mphia,  Nhparm, Nparm, Nnb, Nres,
-		 Nbona,  Ntheta,  Nphia,  Numbnd,  Numang,  Nptra,
-		 Natyp,  Nphb, Nat3, Ntype2d, Nttyp, Nspm, Iptres, Nspsol,
-		 Ipatm, Natcap;
-	char 	*AtomNames, *ResNames, *AtomSym, *AtomTree;
-	_REAL	*Charges, *Masses, *Rk, *Req, *Tk, *Teq, *Pk, *Pn, *Phase,
-		 *Solty, *Cn1, *Cn2, *HB12, *HB6;
-	_REAL	Box[3], Cutcap, Xcap, Ycap, Zcap;
-	int 	*Iac, *Iblo, *Cno, *Ipres, *ExclAt, *TreeJoin, 
-		*AtomRes, *BondHAt1, *BondHAt2, *BondHNum, *BondAt1, *BondAt2, 
-		*BondNum, *AngleHAt1, *AngleHAt2, *AngleHAt3, *AngleHNum, 
-		*AngleAt1, *AngleAt2, *AngleAt3, *AngleNum, *DihHAt1, 
-		*DihHAt2, *DihHAt3, *DihHAt4, *DihHNum, *DihAt1, *DihAt2, 
-		*DihAt3, *DihAt4, *DihNum, *Boundary;
-} parmstruct;
-
-// put the class in an anonymous namespace to give it internal linkage
-namespace {
-  class ReadPARM {
-  public:
-    ReadPARM() {popn = 0;}
-    ~ReadPARM(void) {}
- 
-    int popn;
-    parmstruct *prm;
-    FILE *open_parm_file(const char *name);
-    void close_parm_file(FILE *fileptr);
-    char *get(int size);
-    int preadln(FILE *file, char *string);
-    int readparm(FILE *file);
-    void get_parm_atom(int, char *, char *, char *, char *, int *, float *,
-                       float *);
-
-    void get_parm_bond(int, int fromAtom[], int toAtom[]);
-    void get_hydrogen_bond(int, int fromAtom[], int toAtom[]);
-    int get_parm_natoms();
-    int get_parm_nbonds();
-    int get_parm_boxInfo();
-    int read_fortran_12I6(FILE *fp, int *data, int count);  
-  };
-}
-
-
-/*	fortran formats 
- *	 9118 FORMAT(12I6)
- *	 9128 FORMAT(5E16.8)
-static char	*f9118 = (char *) "%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d\n";
- */
-
-static int readtoeoln(FILE *f) {
-  int c;
-
-  /* skip to eoln */
-  while((c = getc(f)) != '\n') {
-    if (c == EOF) 
-      return -1;
-  }
-
-  return 0;
-}  
-
-/***********************************************************************
- 			    	open_parm_file()
-************************************************************************/
-
-/*
- *  open_parm_file() - fopen regular or popen compressed file for reading
- */
-
-FILE *ReadPARM::open_parm_file(const char *name) {
-	struct stat	buf;
-	char		cbuf[120];
-	int		length, compressed;
-	FILE		*fp;
-
-	length = strlen(name);
-	compressed = 0;  // Just to start
-//	compressed = iscompressed(name);
-	strcpy(cbuf, name);
-
-	/*
-	 *  if file doesn't exist, maybe it has been compressed/decompressed
-	 */
-
-	if (stat(cbuf, &buf) == -1) {
-		switch (errno) {
-		case ENOENT:	{
-			if (!compressed) {
-				strcat(cbuf, ".Z");
-				if (stat(cbuf, &buf) == -1) {
-					printf("%s, %s: does not exist\n", 
-						name, cbuf);
-					return(NULL);
-				}
-				compressed++;
-                                // Don't modify the filename
-				//strcat(name, ".Z"); /* TODO: add protection */
-			} else {
-				cbuf[length-2] = '\0';
-				if (stat(cbuf, &buf) == -1) {
-					printf("%s, %s: does not exist\n", 
-							name, cbuf);
-					return(NULL);
-				}
-				compressed = 0;
-			}
-			break;
-		}
-		default:
-			return(NULL);
-		}
-	}
-
-	/*
-	 *  open the file
-	 */
-#if defined(_MSC_VER) || defined(__MINGW32__)
-        if (compressed) {
-          /* NO "zcat" on Win32 */
-          printf("Cannot load compressed PARM files on Windows.\n");
-          return NULL;
-        }
-#else
-	if (compressed) {
-		char pcmd[sizeof(cbuf) + 7];
-		popn = 1;
-
-		sprintf(pcmd, "zcat '%s'", cbuf);
-		if ((fp = popen(pcmd, "r")) == NULL) {
-			perror(pcmd);
-                        return NULL;
-		}
-        }
-#endif
-	else {
-		if ((fp = fopen(cbuf, "r")) == NULL) {
-			perror(cbuf);
-                        return NULL;
-		}
-	}
-	return(fp);
-}
-
-/***********************************************************************
- 			    close_parm_file   
-************************************************************************/
-
-/*
- *  close_parm_file() - close fopened or popened file
- */
-void ReadPARM::close_parm_file(FILE *fileptr) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  if (popn) {
-    printf("pclose() no such function on win32!\n");
-  } else {
-    if (fclose(fileptr) == -1)
-      perror("fclose");
-  }
-#else
-  if (popn) {
-    if (pclose(fileptr) == -1)
-      perror("pclose");
-  } else {
-    if (fclose(fileptr) == -1)
-      perror("fclose");
-  }
-#endif
-}
-
-
-/***********************************************************************
-                                      GET()
-************************************************************************/
-char *ReadPARM::get(int size) {
-	char	*ptr;
-
-#ifdef DEBUG
-	printf("malloc %d\n", size);
-	fflush(stdout);
-#endif
-	if (size ==0)
-		return((char *) NULL);
-
-	if ((ptr = (char *) malloc((unsigned)size)) == NULL) {
-		printf("malloc %d", size);
-		fflush(stdout);
-		perror("malloc err:");
-        fprintf(stderr, "Exiting due to ReadPARM memory allocation error.\n");
-	}
-	return(ptr);
-}
-
-/***********************************************************************
- 			  	PREADLN()
-************************************************************************/
-int ReadPARM::preadln(FILE *file, char *string) {
-  int i, j;
-
-  for (i=0; i<81; i++) {
-    if ((j = getc(file)) == EOF) {
-      printf("Error: unexpected EOF in Parm file\n");
-      return MOLFILE_ERROR;
-    }
-
-    string[i] = (char) j;
-    if (string[i] == '\n') {
-      break;
-    }
-  }
-
-  if (i == 80  &&  string[i] != '\n') {
-    printf("Error: line too long in Parm file:\n%.80s", string);
-    return MOLFILE_ERROR;
-  }
-
-  return 0; /* success */
-}
-
-/***************************************************************************
-		      		READPARM()
-****************************************************************************/
-/*
- * readparm() - instantiate a given parmstruct
- */
-int ReadPARM::readparm(FILE *file) {
-        //
-        // XXX This code leaks memory every time it's run!  prm is allocated
-        // but its data is never freed, even when ReadPARM itself is deleted.
-        // I've added exception code so we at least have a chance of 
-        // recovering gracefully from a memory allocation error.
-
-	_REAL 		*H;
-	int		i, res, ifpert;
-        int *buffer; // used for reading fortran integer blocks
-
-	prm = (parmstruct *) get(sizeof(parmstruct));
-        if (prm == NULL) {
-          return MOLFILE_ERROR; /* allocation failure */
-        }
-
-	/* READ TITLE */
-	if (preadln(file, prm->ititl) != 0) {
-          return MOLFILE_ERROR;
-        }
-
-	/* READ CONTROL INTEGERS */
-#if !defined(USENEWCODE)
-	fscanf(file, f9118, 
-		&prm->Natom,  &prm->Ntypes, &prm->Nbonh, &prm->Mbona, 
-		&prm->Ntheth, &prm->Mtheta, &prm->Nphih, &prm->Mphia, 
-		&prm->Nhparm, &prm->Nparm,  &prm->Nnb,   &prm->Nres);
-
-	fscanf(file, f9118, 
-		&prm->Nbona,  &prm->Ntheta, &prm->Nphia, &prm->Numbnd, 
-		&prm->Numang, &prm->Nptra,  &prm->Natyp, &prm->Nphb, 
-		&ifpert,      &idum,        &idum,       &idum);
-
-	fscanf(file, " %d %d %d %d %d %d", 
-		&idum, &idum,&idum,&prm->IfBox,&prm->Nmxrs,&prm->IfCap);
-#else
-        buffer = new int[30];
-        if (!read_fortran_12I6(file,buffer,30)) { 
-          return MOLFILE_ERROR;
-        }
-        prm->Natom = buffer[0];
-        prm->Ntypes = buffer[1];
-        prm->Nbonh = buffer[2];
-        prm->Mbona = buffer[3];
-        prm->Ntheth = buffer[4];
-        prm->Mtheta = buffer[5];
-        prm->Nphih = buffer[6];
-        prm->Mphia = buffer[7];
-        prm->Nhparm = buffer[8];
-        prm->Nparm = buffer[9];
-        prm->Nnb = buffer[10];
-        prm->Nres = buffer[11];
-        prm->Nbona = buffer[12];
-        prm->Ntheta = buffer[13];
-        prm->Nphia = buffer[14];
-        prm->Numbnd = buffer[15];
-        prm->Numang = buffer[16];
-        prm->Nptra = buffer[17];
-        prm->Natyp = buffer[18];
-        prm->Nphb = buffer[19];
-        ifpert = buffer[20];
-        // items 21 through 26 are ignored currently.
-        prm->IfBox = buffer[27];
-        prm->Nmxrs = buffer[28];
-        prm->IfCap = buffer[29];
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-
-       if (ifpert) {
-         printf("not equipped to read perturbation prmtop\n");
-         free(prm);
-         return MOLFILE_ERROR;
-       }
-
-
-	/* ALLOCATE MEMORY */
-	prm->Nat3 = 3 * prm->Natom;
-	prm->Ntype2d = prm->Ntypes * prm->Ntypes;
-	prm->Nttyp = prm->Ntypes*(prm->Ntypes+1)/2;
-
-	/*
-	 * get most of the indirect stuff; some extra allowed for char arrays
-	 */
-	prm->AtomNames = (char *) get(4*prm->Natom+81);
-	prm->Charges = (_REAL *) get(sizeof(_REAL)*prm->Natom);
-	prm->Masses = (_REAL *) get(sizeof(_REAL)*prm->Natom);
-	prm->Iac = (int *) get(sizeof(int)*prm->Natom);
-	prm->Iblo = (int *) get(sizeof(int)*prm->Natom);
-	prm->Cno = (int *) get(sizeof(int)* prm->Ntype2d);
-	prm->ResNames = (char *) get(4* prm->Nres+81);
-	prm->Ipres = (int *) get(sizeof(int)*( prm->Nres+1));
-        prm->Rk = (_REAL *) get(sizeof(_REAL)* prm->Numbnd);
-        prm->Req = (_REAL *) get(sizeof(_REAL)* prm->Numbnd);
-        prm->Tk = (_REAL *) get(sizeof(_REAL)* prm->Numang);
-        prm->Teq = (_REAL *) get(sizeof(_REAL)* prm->Numang);
-        prm->Pk = (_REAL *) get(sizeof(_REAL)* prm->Nptra);
-        prm->Pn = (_REAL *) get(sizeof(_REAL)* prm->Nptra);
-        prm->Phase = (_REAL *) get(sizeof(_REAL)* prm->Nptra);
-        prm->Solty = (_REAL *) get(sizeof(_REAL)* prm->Natyp);
-        prm->Cn1 = (_REAL *) get(sizeof(_REAL)* prm->Nttyp);
-        prm->Cn2 = (_REAL *) get(sizeof(_REAL)* prm->Nttyp);
-	prm->BondHAt1 = (int *) get(sizeof(int)* prm->Nbonh);
-	prm->BondHAt2 = (int *) get(sizeof(int)* prm->Nbonh);
-	prm->BondHNum = (int *) get(sizeof(int)* prm->Nbonh);
-	prm->BondAt1 = (int *) get(sizeof(int)* prm->Nbona);
-	prm->BondAt2 = (int *) get(sizeof(int)* prm->Nbona);
-	prm->BondNum = (int *) get(sizeof(int)* prm->Nbona);
-	prm->AngleHAt1 = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleHAt2 = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleHAt3 = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleHNum = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleAt1 = (int *) get(sizeof(int)* prm->Ntheta);
-	prm->AngleAt2 = (int *) get(sizeof(int)*prm->Ntheta);
-	prm->AngleAt3 = (int *) get(sizeof(int)*prm->Ntheta);
-	prm->AngleNum = (int *) get(sizeof(int)*prm->Ntheta);
-	prm->DihHAt1 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHAt2 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHAt3 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHAt4 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHNum = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihAt1 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihAt2 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihAt3 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihAt4 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihNum = (int *) get(sizeof(int)*prm->Nphia);
-	prm->ExclAt = (int *) get(sizeof(int)*prm->Nnb);
-	prm->HB12 = (_REAL *) get(sizeof(_REAL)*prm->Nphb);
-	prm->HB6 = (_REAL *) get(sizeof(_REAL)*prm->Nphb);
-	prm->AtomSym = (char *) get(4*prm->Natom+81);
-	prm->AtomTree = (char *) get(4*prm->Natom+81);
-	prm->TreeJoin = (int *) get(sizeof(int)*prm->Natom);
-	prm->AtomRes = (int *) get(sizeof(int)*prm->Natom);
-
-	/* 
-	 * READ ATOM NAMES -IH(M04)
-	 */
-	for (i=0; i<(prm->Natom/20 + (prm->Natom%20 ? 1 : 0)); i++) {
-		preadln(file, &prm->AtomNames[i*80]);
-        }
-
-	/* 
-	 * READ ATOM CHARGES -X(L15)
-	 *	(pre-multiplied by an energy factor of 18.2223 == sqrt(332)
-	 *	 for faster force field calculations)
-	 */
-	for (i=0; i<prm->Natom; i++) {
-          fscanf(file, " " DBLFMT, &prm->Charges[i]);
-          prm->Charges[i] *= 0.0548778; /* convert back to elementary charge units */
-        }
-        readtoeoln(file);
-
-	/* 
-	 * READ ATOM MASSES -X(L20)
-	 */
-	for (i=0; i<prm->Natom; i++)
-	  fscanf(file, " " DBLFMT, &prm->Masses[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ ATOM L-J TYPES -IX(I04)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++) 
-          fscanf(file, " %d", &prm->Iac[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Iac, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ ATOM INDEX TO 1st IN EXCLUDED ATOM LIST "NATEX" -IX(I08)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++)
-          fscanf(file, " %d", &prm->Iblo[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Iblo, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ TYPE INDEX TO N-B TYPE -IX(I06)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Ntype2d; i++)
-          fscanf(file, " %d", &prm->Cno[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Cno, prm->Ntype2d)) {
-          return MOLFILE_ERROR;
-        } 
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ RES NAMES (4 chars each, 4th blank) -IH(M02)
-	 */
-	for (i=0; i<(prm->Nres/20 + (prm->Nres%20 ? 1 : 0)); i++)
-          preadln(file, &prm->ResNames[i*80]);
-
-	/* 
-	 * READ RES POINTERS TO 1st ATOM 		-IX(I02)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nres; i++) 
-          fscanf(file, " %d", &prm->Ipres[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Ipres, prm->Nres)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-	prm->Ipres[prm->Nres] = prm->Natom + 1;
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND FORCE CONSTANTS 			-RK()
-	 */
-	for (i=0; i< prm->Numbnd; i++) 
-          fscanf(file, " " DBLFMT, &prm->Rk[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND LENGTH OF MINIMUM ENERGY  		-REQ()
-	 */
-	for (i=0; i< prm->Numbnd; i++) 
-          fscanf(file, " " DBLFMT, &prm->Req[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND ANGLE FORCE CONSTANTS (following Rk nomen) -TK()
-	 */
-	for (i=0; i< prm->Numang; i++) 
-          fscanf(file, " " DBLFMT, &prm->Tk[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND ANGLE OF MINIMUM ENERGY (following Req nomen) -TEQ()
-	 */
-	for (i=0; i< prm->Numang; i++) 
-          fscanf(file, " " DBLFMT, &prm->Teq[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL PEAK MAGNITUDE 		-PK()
-	 */
-	for (i=0; i< prm->Nptra; i++) 
-          fscanf(file, " " DBLFMT, &prm->Pk[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL PERIODICITY 			-PN()
-	 */
-	for (i=0; i< prm->Nptra; i++) 
-          fscanf(file, " " DBLFMT, &prm->Pn[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL PHASE  			-PHASE()
-	 */
-	for (i=0; i< prm->Nptra; i++) 
-          fscanf(file, " " DBLFMT, &prm->Phase[i]);
-        readtoeoln(file);
-
-	/* 
-	 * ?? "RESERVED" 				-SOLTY()
-	 */
-	for (i=0; i< prm->Natyp; i++) 
-          fscanf(file, " " DBLFMT, &prm->Solty[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ L-J R**12 FOR ALL PAIRS OF ATOM TYPES  	-CN1()
-	 *	(SHOULD BE 0 WHERE H-BONDS)
-	 */
-	for (i=0; i< prm->Nttyp; i++) 
-          fscanf(file, " " DBLFMT, &prm->Cn1[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ L-J R**6 FOR ALL PAIRS OF ATOM TYPES 	-CN2()
-	 *	(SHOULD BE 0 WHERE H-BONDS)
-	 */
-	for (i=0; i< prm->Nttyp; i++) 
-          fscanf(file, " " DBLFMT, &prm->Cn2[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ COVALENT BOND W/ HYDROGEN (3*(atnum-1)): 
-	 *	IBH = ATOM1 		-IX(I12)
-	 *	JBH = ATOM2 		-IX(I14)
-	 *	ICBH = BOND ARRAY PTR	-IX(I16)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nbonh; i++) 
-          fscanf(file, " %d %d %d", 
-                 &prm->BondHAt1[i], &prm->BondHAt2[i], &prm->BondHNum[i]);
-#else
-        buffer = new int[3*prm->Nbonh];
-        if (!read_fortran_12I6(file, buffer, 3*prm->Nbonh)) { 
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nbonh; i++) { 
-          prm->BondHAt1[i] = buffer[3*i];
-          prm->BondHAt2[i] = buffer[3*i+1];
-          prm->BondHNum[i] = buffer[3*i+2];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ COVALENT BOND W/OUT HYDROGEN (3*(atnum-1)):
-	 *	IB = ATOM1		-IX(I18)
-	 *	JB = ATOM2		-IX(I20)
-	 *	ICB = BOND ARRAY PTR	-IX(I22)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nbona; i++)
-          fscanf(file, " %d %d %d", 
-                 &prm->BondAt1[i], &prm->BondAt2[i], &prm->BondNum[i]);
-#else
-        buffer = new int[3*prm->Nbona];
-        if (!read_fortran_12I6(file, buffer, 3*prm->Nbona)) { 
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nbona; i++) { 
-          prm->BondAt1[i] = buffer[3*i];
-          prm->BondAt2[i] = buffer[3*i+1];
-          prm->BondNum[i] = buffer[3*i+2];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ ANGLE W/ HYDROGEN: 
-	 *	ITH = ATOM1			-IX(I24)
-	 *	JTH = ATOM2			-IX(I26)
-	 *	KTH = ATOM3			-IX(I28)
-	 *	ICTH = ANGLE ARRAY PTR		-IX(I30)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Ntheth; i++)
-          fscanf(file, " %d %d %d %d", 
-                 &prm->AngleHAt1[i], &prm->AngleHAt2[i], 
-                 &prm->AngleHAt3[i], &prm->AngleHNum[i]);
-#else
-        buffer = new int[4*prm->Ntheth];
-        if (!read_fortran_12I6(file, buffer, 4*prm->Ntheth)) { 
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Ntheth; i++) { 
-          prm->AngleHAt1[i] = buffer[4*i];
-          prm->AngleHAt2[i] = buffer[4*i+1];
-          prm->AngleHAt3[i] = buffer[4*i+2];
-          prm->AngleHNum[i] = buffer[4*i+3];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ ANGLE W/OUT HYDROGEN: 
-	 *	IT = ATOM1			-IX(I32)
-	 *	JT = ATOM2			-IX(I34)
-	 *	KT = ATOM3			-IX(I36)
-	 *	ICT = ANGLE ARRAY PTR		-IX(I38)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Ntheta; i++)
-          fscanf(file, " %d %d %d %d", 
-                 &prm->AngleAt1[i], &prm->AngleAt2[i], 
-                 &prm->AngleAt3[i], &prm->AngleNum[i]);
-#else
-        buffer = new int[4*prm->Ntheta];
-        if (!read_fortran_12I6(file, buffer, 4*prm->Ntheta)) {
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Ntheta; i++) { 
-          prm->AngleAt1[i] = buffer[4*i];
-          prm->AngleAt2[i] = buffer[4*i+1];
-          prm->AngleAt3[i] = buffer[4*i+2];
-          prm->AngleNum[i] = buffer[4*i+3];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL W/ HYDROGEN: 
-	 *	ITH = ATOM1			-IX(40)
-	 *	JTH = ATOM2			-IX(42)
-	 *	KTH = ATOM3			-IX(44)
-	 *	LTH = ATOM4			-IX(46)
-	 *	ICTH = DIHEDRAL ARRAY PTR	-IX(48)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nphih; i++)
-          fscanf(file, " %d %d %d %d %d", 
-                 &prm->DihHAt1[i], &prm->DihHAt2[i], &prm->DihHAt3[i], 
-                 &prm->DihHAt4[i], &prm->DihHNum[i]);
-#else
-        buffer = new int[5*prm->Nphih];
-        if (!read_fortran_12I6(file, buffer, 5*prm->Nphih)) {
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nphih; i++) { 
-          prm->DihHAt1[i] = buffer[5*i];
-          prm->DihHAt2[i] = buffer[5*i+1];
-          prm->DihHAt3[i] = buffer[5*i+2];
-          prm->DihHAt4[i] = buffer[5*i+3];
-          prm->DihHNum[i] = buffer[5*i+4];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL W/OUT HYDROGEN: 
-	 *	IT = ATOM1
-	 *	JT = ATOM2
-	 *	KT = ATOM3
-	 *	LT = ATOM4
-	 *	ICT = DIHEDRAL ARRAY PTR
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nphia; i++) {
-          fscanf(file, " %d %d %d %d %d", 
-                 &prm->DihAt1[i], &prm->DihAt2[i], &prm->DihAt3[i], 
-                 &prm->DihAt4[i], &prm->DihNum[i]);
-	}
-#else
-        buffer = new int[5*prm->Nphia];
-        if (!read_fortran_12I6(file, buffer, 5*prm->Nphia)) {
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nphia; i++) {
-          prm->DihAt1[i] = buffer[5*i];
-          prm->DihAt2[i] = buffer[5*i+1];
-          prm->DihAt3[i] = buffer[5*i+2];
-          prm->DihAt4[i] = buffer[5*i+3];
-          prm->DihNum[i] = buffer[5*i+4];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/*
-	 * READ EXCLUDED ATOM LIST	-IX(I10)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nnb; i++)
-		fscanf(file, " %d", &prm->ExclAt[i]);
-#else
-        if (!read_fortran_12I6(file, prm->ExclAt, prm->Nnb)) {
-           return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/*
-	 * READ H-BOND R**12 TERM FOR ALL N-B TYPES	-ASOL()
-	 */
-	for (i=0; i<prm->Nphb; i++) 
-          fscanf(file, " " DBLFMT, &prm->HB12[i]);
-        readtoeoln(file);
-
-	/*
-	 * READ H-BOND R**6 TERM FOR ALL N-B TYPES	-BSOL()
-	 */
-	for (i=0; i<prm->Nphb; i++) 
-          fscanf(file, " " DBLFMT, &prm->HB6[i]);
-        readtoeoln(file);
-
-	/*
-	 * READ H-BOND CUTOFF (NOT USED) ??		-HBCUT()
-	 */
-	H = (_REAL *) get(prm->Nphb * sizeof(_REAL));
-	for (i=0; i<prm->Nphb; i++) 
-          fscanf(file, " " DBLFMT, &H[i]);
-	free((char *)H);
-        readtoeoln(file);
-
-	/*
-	 * READ ATOM SYMBOLS (FOR ANALYSIS PROGS)	-IH(M06)
-	 */
-	for (i=0; i<(prm->Natom/20 + (prm->Natom%20 ? 1 : 0)); i++)
-          preadln(file, &prm->AtomSym[i*80]);
-
-	/*
-	 * READ TREE SYMBOLS (FOR ANALYSIS PROGS)	-IH(M08)
-	 */
-	for (i=0; i<(prm->Natom/20 + (prm->Natom%20 ? 1 : 0)); i++)
-          preadln(file, &prm->AtomTree[i*80]);
-      
-	/*
-	 * READ TREE JOIN INFO (FOR ANALYSIS PROGS)	-IX(I64)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++)
-          fscanf(file, " %d", &prm->TreeJoin[i]);
-#else
-        if (!read_fortran_12I6(file, prm->TreeJoin, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/*
-	 * READ PER-ATOM RES NUMBER			-IX(I66)
-	 *	NOTE: this appears to be something entirely different
-	 *	NOTE: overwriting this with correct PER-ATOM RES NUMBERs
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++)
-          fscanf(file, " %d", &prm->AtomRes[i]);
-#else
-        if (!read_fortran_12I6(file, prm->AtomRes, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        res = 0;
-	for (i=0; i<prm->Natom; i++) {
-          if (i+1 == prm->Ipres[res+1])	/* atom is 1st of next res */
-            res++;
-          prm->AtomRes[i] = res;
-	}
-      
-	/*
-	 * BOUNDARY CONDITION STUFF
-	 */
-	if (!prm->IfBox) {
-		prm->Nspm = 1;
-		prm->Boundary = (int *) get(sizeof(int)*prm->Nspm);
-		prm->Boundary[0] = prm->Natom;
-	} else {
-                readtoeoln(file);
-#if !defined(USENEWCODE)
-		fscanf(file, " %d %d %d", &prm->Iptres, &prm->Nspm, 
-								&prm->Nspsol);
-#else
-                buffer = new int[3];
-                if (!read_fortran_12I6(file, buffer, 3)) { 
-                  return MOLFILE_ERROR;
-                }
-                prm->Iptres = buffer[0];
-                prm->Nspm = buffer[1];
-                prm->Nspsol = buffer[2];
-                delete [] buffer;
-#endif
-                readtoeoln(file);
-		prm->Boundary = (int *) get(sizeof(int)*prm->Nspm);
-#if !defined(USENEWCODE)
-		for (i=0; i<prm->Nspm; i++)
-			fscanf(file, " %d", &prm->Boundary[i]);
-#else
-                if (!read_fortran_12I6(file, prm->Boundary, prm->Nspm)) {
-                  return MOLFILE_ERROR;
-                }
-#endif
-                readtoeoln(file);
-		fscanf(file, " " DBLFMT " " DBLFMT " " DBLFMT, 
-				&prm->Box[0], &prm->Box[1], &prm->Box[2]);
-                readtoeoln(file);
-		if (prm->Iptres)
-			prm->Ipatm = prm->Ipres[prm->Iptres] - 1; 
-      		/* IF(IPTRES.GT.0) IPTATM = IX(I02+IPTRES-1+1)-1 */
-	}
-
-	/*
-	 * ----- LOAD THE CAP INFORMATION IF NEEDED -----
-	 */
-	if (prm->IfCap) {
-		/* if (prm->IfBox) 
-			skipeoln(file); */
-		fscanf(file, " %d " DBLFMT " " DBLFMT " " DBLFMT " " DBLFMT,
-				&prm->Natcap, &prm->Cutcap, 
-				&prm->Xcap, &prm->Ycap, &prm->Zcap);
-	}
-
-  return MOLFILE_SUCCESS;
-}
-
-
-void ReadPARM::get_parm_atom(int i, char *name, char *atype, char *resname,
-char *segname, int *resid, float *q, float *m) {
-  int nres = prm->Nres;
-
-  int j,k;
-  int flag = 0;
-  char *blank = (char *) " ";
-
-  *q = prm->Charges[i];
-  *m = prm->Masses[i];
-
-  for (k = 0; k < 4; k++) {
-    if (prm->AtomNames[i*4+k] == *blank)
-       name[k] = '\0';
-    else
-       name[k] = prm->AtomNames[i*4+k];
-  }
-  name[k] = '\0';
-
-  for (k = 0; k < 4; k++) {
-    if ((prm->AtomSym[i*4+k]) == *blank)
-       atype[k] = '\0';
-    else
-       atype[k] = prm->AtomSym[i*4+k];
-  }
-  atype[k] = '\0';
-
-  for (j = 0; j < nres-1; j++)
-    if (((i+1) >= prm->Ipres[j]) && ((i+1) < prm->Ipres[j+1])) {
-      *resid = j;
-      resname[0] = prm->ResNames[j*4];
-      resname[1] = prm->ResNames[j*4+1];
-      resname[2] = prm->ResNames[j*4+2];
-      resname[3] = '\0';
-      flag = 1;
-    }
-  if (flag == 0) {
-     *resid = j;
-     resname[0] = prm->ResNames[j*4];
-     resname[1] = prm->ResNames[j*4+1];
-     resname[2] = prm->ResNames[j*4+2];
-     resname[3] = '\0';
-     flag = 1;
-  }
-
-  segname[0] = '\0'; 
-
-}
-
-void ReadPARM::get_parm_bond (int i, int fromAtom[], int toAtom[]) {
-
-  if (i < prm->Nbona) {
-     fromAtom[i] = (int) ((prm->BondAt1[i])/3 + 1);
-     toAtom[i] =   (int) ((prm->BondAt2[i])/3 + 1);
-  }
-  else get_hydrogen_bond (i, fromAtom, toAtom);
-}
-
-void ReadPARM::get_hydrogen_bond(int i, int fromAtom[], int toAtom[]) {
-  fromAtom[i] = (int) ((prm->BondHAt1[i-prm->Nbona])/3 + 1);
-  toAtom[i] = (int) ((prm->BondHAt2[i-prm->Nbona])/3 + 1);
-}
-
-
-int ReadPARM::get_parm_natoms() {return prm->Natom;}
-
-int ReadPARM::get_parm_nbonds() {return (prm->Nbona + prm->Nbonh);}
-
-int ReadPARM::get_parm_boxInfo() {return(prm->IfBox);}
-
-
-// Read FORTRAN 12I6 format data (no space between adjacent data is assumed)
-// One needs to read the whole data block into the buffer here
-// fp - file pointer.
-// data - buffer to hold the whole block. Should be allocated before the call
-// count - number of ints in the block.
-int ReadPARM::read_fortran_12I6(FILE *fp, int *data, int count) {
-  int i, j;
-  char buf[7];
-
-  for (i=0; i<count; ++i) { 
-    for (j=0; j<6; ++j) { 
-      buf[j]=getc(fp);
-      if (buf[j]=='\n' || buf[j]=='\0' || buf[j]==EOF)
-        return 0;
-    }
-    buf[6] = '\0';
-
-    if (sscanf(buf,"%d",data+i) != 1)
-      return 0;
-
-    if (i%12==11 && i<count-1)
-      readtoeoln(fp);
-  }
-
-  return 1;
-}
-
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ReadPARM7.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ReadPARM7.h
deleted file mode 100644
index 21d967d796975e63e6ef6b5013762f66e00aaae4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ReadPARM7.h
+++ /dev/null
@@ -1,462 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: ReadPARM7.h,v $
- *      $Author: johns $        $Locker:  $                $State: Exp $
- *      $Revision: 1.32 $      $Date: 2016/11/06 17:54:56 $
- *
- ***************************************************************************
- * DESCRIPTION:
- * NOTE:: Significant modifications were made to the VMD version of 
- *        Bill Ross's original code in order to make it easy to hook 
- *        into VMD plugin structures.  
- *        Further modifications were made to the VMD code to 
- *        read amber 7 parm files, courtesy of Brian Bennion
- * Here is what has changed:
- *     Functions became Class Methods, data became instance variables
- *     The Code to check for compressed files before opening was disabled
- *     Methods get_parm7_atom, get_parm7_bond, get_hydrogen_bond,
- *     get_parm7_natoms, get_parm7_nbonds, get_parm7_boxInfo were added in 
- *     order to convert from prm.c parlance to VMD conventions.
- ***************************************************************************/
-
-/*
- * COPYRIGHT 1992, REGENTS OF THE UNIVERSITY OF CALIFORNIA
- *
- *  prm.c - read information from an amber PARM topology file:
- *      atom/residue/bond/charge info, plus force field data.
- *      This file and the accompanying prm.h may be distributed
- *      provided this notice is retained unmodified and provided
- *      that any modifications to the rest of the file are noted
- *      in comments.
- *
- *      Bill Ross, UCSF 1994
- */
-
-#ifndef READPARM7_H
-#define READPARM7_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include "molfile_plugin.h"  // needed for molfile return codes etc
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#if 0 
-#define _REAL   double
-#define DBLFMT  "%lf"
-#else
-#define _REAL   float
-#define DBLFMT  "%f"
-#endif
-
-
-typedef struct parm {
-  char title[85];
-  char version[85];
-  int   IfBox, Nmxrs, IfCap,
-        Natom,  Ntypes,  Nbonds, Nbonh,  Mbona,  Ntheth,  Mtheta, 
-        Nphih,  Mphia,  Nhparm, Nparm, Nnb, Nres,Mptra,
-        Nbona,  Ntheta,  Nphia,  Numbnd,  Numang,  Nptra,Jparm,
-        Natyp,  Nphb, Nat3, Ntype2d, Nttyp, Nspm, Iptres, Nspsol,
-        Ipatm, Natcap,Ifpert,Nbper,Ngper,Ndper,Mbper,Mgper,Mdper,
-        Numextra;
-  _REAL Box[3], Cutcap, Xcap, Ycap, Zcap;
-} parmstruct;
-
-static int read_parm7_flag(FILE *file, const char *flag, const char *format) {
-  char buf[1024];
-    
-  /* read the %FLAG text */
-  fscanf(file, "%s\n", buf);
-  if (strcmp("%FLAG", buf)) {
-    printf("AMBER 7 parm read error, at flag section %s,\n", flag);
-    printf("        expected %%FLAG but got %s\n", buf);
-    return 0; /* read of flag data failed */
-  }
-
-  /* read field name specifier */
-  fscanf(file, "%s\n", buf);
-  if (flag != NULL) {
-    if (strcmp(flag, buf)) {
-      printf("AMBER 7 parm read error at flag section %s,\n", flag);
-      printf("      expected flag field %s but got %s\n", flag, buf);
-      return 0; /* read of flag data failed */
-    }
-  }
-
-  /* read format string */
-  fscanf(file, "%s\n", buf);
-  if (format != NULL) {
-    if (strcmp(format, buf)) {
-      if ( (!strcmp(flag, "TITLE") || !strcmp(flag, "CTITLE") )
-          && !strcmp(format, "%FORMAT(20a4)")) {
-        if (!strcmp(buf, "%FORMAT(a80)"))
-          return 1; /* accept a80 as substitute for 20a4 */
-      }
-      printf("AMBER 7 parm read error at flag section %s,\n", flag);
-      printf("      expected format %s but got %s\n", format, buf);
-      return 0; /* read of flag data failed */
-    }
-  }
-
-  return 1; /* read of flag data succeeded */
-}
-
-/*
- *  open_parm7_file() - fopen regular or popen compressed file for reading
- *  Return FILE handle on success.
- *  set as_pipe to 1 if opened with popen, or 0 if opened with fopen.
- */
-
-static FILE *open_parm7_file(const char *name, int *as_pipe) {
-  struct stat buf;
-  char cbuf[8192];
-  int length;
-  int &compressed = *as_pipe;
-  FILE *fp;
-
-  length = strlen(name);
-  compressed = 0;  // Just to start
-  strcpy(cbuf, name);
-
-  /*
-   *  if file doesn't exist, maybe it has been compressed/decompressed
-   */
-  if (stat(cbuf, &buf) == -1) {
-    switch (errno) {
-      case ENOENT:
-        if (!compressed) {
-          strcat(cbuf, ".Z");
-          if (stat(cbuf, &buf) == -1) {
-            printf("%s, %s: does not exist\n", name, cbuf);
-            return(NULL);
-          }
-          compressed++;
-
-          // Don't modify the filename
-          //strcat(name, ".Z"); /* TODO: add protection */
-        } else {
-          cbuf[length-2] = '\0';
-          if (stat(cbuf, &buf) == -1) {
-            printf("%s, %s: does not exist\n", name, cbuf);
-            return(NULL);
-          }
-          compressed = 0;
-        }
-        break;
-
-      default:
-        return(NULL);
-    }
-  }
-
-  /*
-   *  open the file
-   */
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  if (compressed) {
-    /* NO "zcat" on Win32 */
-    printf("Cannot load compressed PARM files on Windows.\n");
-    return NULL;
-  }
-#else
-  if (compressed) {
-    char pcmd[sizeof(cbuf) + 7];
-    sprintf(pcmd, "zcat '%s'", cbuf);
-    if ((fp = popen(pcmd, "r")) == NULL) {
-      perror(pcmd);
-      return NULL;
-    }
-  }
-#endif
-  else {
-    if ((fp = fopen(cbuf, "r")) == NULL) {
-      perror(cbuf);
-      return NULL;
-    }
-  }
-
-  return(fp);
-}
-
-
-static int parse_parm7_atoms(const char *fmt, 
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  char buf[85];
-
-  if (strncasecmp(fmt, "%FORMAT(20a4)", 13))
-    return 0;
-
-  int j=0;
-  for (int i=0; i<natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (!(i%20)) {
-      j=0;
-      fgets(buf, 85, file);
-    }
-    strncpy(atom->name, buf+4*j, 4);
-    atom->name[4]='\0';
-    j++;
-  }
-  return 1;
-}
-
-
-static int parse_parm7_charge(const char *fmt, 
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(5E16.8)", 15) &&
-      strncasecmp(fmt, "%FORMAT(3E24.16)", 16)) 
-    return 0;
-
-  for (int i=0; i<natoms; i++) {
-    double q=0;
-    if (fscanf(file, " %lf", &q) != 1) {
-      fprintf(stderr, "PARM7: error reading charge at index %d\n", i);
-      return 0;
-    }
-    atoms[i].charge = 0.0548778 * (float)q; /* convert to elementary charge units */
-  }
-
-  return 1;
-}
-
-
-static int parse_parm7_mass(const char *fmt,
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(5E16.8)", 15)) return 0;
-  for (int i=0; i<natoms; i++) {
-    double m=0;
-    if (fscanf(file, " %lf", &m) != 1) {
-      fprintf(stderr, "PARM7: error reading mass at index %d\n", i);
-      return 0;
-    }
-    atoms[i].mass = (float)m;
-  }
-  return 1;
-}
-
-
-static int parse_parm7_atype(const char *fmt,
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(20a4)", 13)) return 0;
-  char buf[85];
-  int j=0;
-  for (int i=0; i<natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (!(i%20)) {
-      j=0;
-      fgets(buf, 85, file);
-    }
-    strncpy(atom->type, buf+4*j, 4);
-    atom->type[4]='\0';
-    j++;
-  }
-  return 1;
-}
-
-
-static int parse_parm7_resnames(const char *fmt,
-    int nres, char *resnames, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(20a4)", 13)) return 0;
-  char buf[85];
-  int j=0;
-  for (int i=0; i<nres; i++) {
-    if (!(i%20)) {
-      j=0;
-      fgets(buf, 85, file);
-    }
-    strncpy(resnames, buf+4*j, 4);
-    resnames += 4;
-    j++;
-  }
-
-  return 1;
-}
-
-static int parse_parm7_respointers(const char *fmt, int natoms, 
-    molfile_atom_t *atoms, int nres, const char *resnames, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(10I8)", 13)) return 0;
-  int cur, next;
-  fscanf(file, " %d", &cur);
-  for (int i=1; i<nres; i++) {
-    if (fscanf(file, " %d", &next) != 1) {
-      fprintf(stderr, "PARM7: error reading respointer records at residue %d\n", i);
-      return 0;
-    }
-    while (cur < next) {
-      if (cur > natoms) {
-        fprintf(stderr, "invalid atom index: %d\n", cur);
-        return 0;
-      }
-      strncpy(atoms[cur-1].resname, resnames, 4);
-      atoms[cur-1].resname[4] = '\0';
-      atoms[cur-1].resid = i;
-      cur++;
-    }
-    resnames += 4;
-  }
-  // store the last residue name
-  while (cur <= natoms) {
-    strncpy(atoms[cur-1].resname, resnames, 4);
-    atoms[cur-1].resname[4] = '\0';
-    atoms[cur-1].resid = nres;
-    cur++;
-  }
-
-  return 1;
-}
-
-
-static int parse_parm7_bonds(const char *fmt,
-    int nbonds, int *from, int *to, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(10I8)", 13)) 
-    return 0;
-
-  int a, b, tmp;
-  for (int i=0; i<nbonds; i++) {
-    if (fscanf(file, " %d %d %d", &a, &b, &tmp) != 3) {
-      fprintf(stderr, "PARM7: error reading bond number %d\n", i);
-      return 0;
-    }
-    from[i] = a/3 + 1;
-    to[i]   = b/3 + 1;
-  }
-
-  return 1;
-}
-
-
-/*
- *  close_parm7_file() - close fopened or popened file
- */
-static void close_parm7_file(FILE *fileptr, int popn) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  if (popn) {
-    printf("pclose() no such function on win32!\n");
-  } else {
-   if (fclose(fileptr) == -1)
-     perror("fclose");
-  }
-#else
-  if (popn) {
-    if (pclose(fileptr) == -1)
-      perror("pclose");
-  } else {
-    if (fclose(fileptr) == -1)
-      perror("fclose");
-  }
-#endif
-}
-
-static const char *parm7 = "%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d\n";
-
-static parmstruct *read_parm7_header(FILE *file) {
-  char sdum[512]; 
-  parmstruct *prm;
-  prm = new parmstruct;
-
-  /* READ VERSION */
-  fgets(sdum, 512, file);
-
-  /* READ TITLE */
-  fscanf(file, "%s\n", sdum); // "%FLAG"
-  if (strcmp("%FLAG", sdum)) {
-    printf("AMBER 7 parm read error, can't find TITLE flag.\n");
-    printf("        expected %%FLAG, got %s\n", sdum);
-    delete prm;
-    return NULL;
-  }
-  fscanf(file, "%s\n", sdum); // "TITLE" or "CTITLE"
-  if (strcmp("TITLE", sdum) && strcmp("CTITLE", sdum)) {
-    printf("AMBER 7 parm read error, at flag section TITLE,\n");
-    printf("        expected TITLE or CTITLE but got %s,\n", sdum);
-    delete prm;
-    return NULL;
-  }
-  fscanf(file, "%s\n", sdum); // "FORMAT (20a4)"
-  if (strcmp(sdum, "%FORMAT(20a4)") && strcmp(sdum, "%FORMAT(a80)")) {
-    printf("AMBER 7 parm read error, at flag section TITLE,\n");
-    printf("        expected %%FLAG but got %s,\n", sdum);
-    delete prm;
-    return NULL;
-  }
-
-  // read the title string itself, and handle empty lines
-#if 0
-  // XXX this code fails with some AMBER 9 test files
-  fscanf(file, "%s\n", prm->title);
-#else
-  // XXX this hack causes AMBER 9 prmtop files to load
-  fgets(prm->title, sizeof(prm->title), file);
-#endif
-
-  if (strstr(prm->title, "%FLAG") == NULL) {
-    // Got a title string
-    if (!read_parm7_flag(file, "POINTERS", "%FORMAT(10I8)")) {
-      delete prm;
-      return NULL;
-    }
-  } else {
-    // NO title string, use a special method to pick up next flag
-#if 0
-    fscanf(file,"%s\n", sdum);
-    if (strcmp("POINTERS", sdum)) {
-      printf("AMBER 7 parm read error at flag section POINTERS\n");
-      printf("      expected flag field POINTERS but got %s\n", sdum);
-#else
-    if (strstr(prm->title, "POINTERS") == NULL) {
-      printf("AMBER 7 parm read error at flag section POINTERS\n");
-      printf("      expected flag field POINTERS but got %s\n", prm->title);
-#endif
-      delete prm;
-      return NULL;
-    }
-#if 0
-    fscanf(file,"%s\n", sdum);
-    if (strcasecmp("%FORMAT(10I8)", sdum)) {
-#else
-    fgets(sdum, sizeof(sdum), file);
-    if ((strstr(sdum, "%FORMAT(10I8)") == NULL) &&
-        (strstr(sdum, "%FORMAT(10i8)") == NULL)) {
-#endif
-      printf("AMBER 7 parm read error at flag section POINTERS,\n");
-      printf("      expected format %%FORMAT(10I8) but got %s\n", sdum);
-      delete prm;
-      return NULL;
-    }
-  }
-
-  /* READ POINTERS (CONTROL INTEGERS) */
-  fscanf(file,parm7,
-         &prm->Natom,  &prm->Ntypes, &prm->Nbonh, &prm->Nbona,
-         &prm->Ntheth, &prm->Ntheta, &prm->Nphih, &prm->Nphia,
-         &prm->Jparm,  &prm->Nparm);
-  fscanf(file, parm7,  
-         &prm->Nnb,   &prm->Nres,   &prm->Mbona,  &prm->Mtheta,
-         &prm->Mphia, &prm->Numbnd, &prm->Numang, &prm->Mptra,
-         &prm->Natyp, &prm->Nphb);
-  fscanf(file, parm7,  &prm->Ifpert, &prm->Nbper,  &prm->Ngper,
-         &prm->Ndper, &prm->Mbper,  &prm->Mgper, &prm->Mdper,
-         &prm->IfBox, &prm->Nmxrs,  &prm->IfCap);
-
-  fscanf(file,"%8d",&prm->Numextra); //BB
-  prm->Nptra=prm->Mptra; //BB new to amber 7 files...
-
-  prm->Nat3 = 3 * prm->Natom;
-  prm->Ntype2d = prm->Ntypes * prm->Ntypes;
-  prm->Nttyp = prm->Ntypes*(prm->Ntypes+1)/2;
-
-  return prm;
-}
-
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/abinitplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/abinitplugin.c
deleted file mode 100644
index 5b51c29f6451198ac9e47889c31ba1631a8b7201..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/abinitplugin.c
+++ /dev/null
@@ -1,1930 +0,0 @@
-/*
- *  ABINIT plugin for VMD
- *  Rob Lahaye, Sungkyunkwan University, Korea
- *  August 2010
- *
- *  LICENSE:
- *    You can include my code for as long as it is part of an 
- *  open source project. Hence: I do not allow my code to be 
- *  part of any closed source project.
- *
- *  ABINIT manual   
- *  http://www.abinit.org/
- * 
- *  LINUX
- *  gcc -O2 -Wall -fPIC -I. -I$VMDBASEDIR/plugins/include -c abinitplugin.c
- *  gcc -shared -o abinitplugin.so abinitplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c abinitplugin.c
- *  c++ -bundle -o abinitplugin.so abinitplugin.o
- *
- *  Install
- *  copy abinitplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
- /*
-  * This plugin does NOT read the general input (*.in) and output (*.out) files of abinit;
-  * their syntax is far too flexible and complex to be read in all its varieties.
-  * Most (soon hopefully: all) other output files can be read by this plugin. 
-  *
-  * The VMD generic plugin routines jump to the appropriate routine, depending on the
-  * selected file type:
-  *
-  * open_file_read / read_structure / read_next_timestep / 
-  *            |__ GEO_open_file_read/read_structure/read_next_timestep
-  *            |__ DEN_POT_WFK_open_file_read/read_structure/read_next_timestep
-  *
-  * read_volumetric_metadata / read_volumetric_data
-  *            |__ DEN_read_volumetric_metadata/read_volumetric_data
-  *            |__ POT_read_volumetric_metadata/read_volumetric_data
-  *            |__ WFK_read_volumetric_metadata/read_volumetric_data (NOT YET IMPLEMENTED)
-  *
-  * open_file_write / write_structure / write_timestep / close_file_write
-  *            |
-  *            |__ the output format is in a sloppy abinit input file format; however,
-  *                this file cannot serve as an input file to abinit, although its
-  *                syntax is supposed to be easy to understand for a human :).
-  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#if defined(_MSC_VER)
-#include <io.h>
-#define F_OK 0
-// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs
-// on Windows, which is supposed to be POSIX compliant...
-#define access _access
-#else
-#include <unistd.h>
-#endif
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "periodic_table.h"
-#include "unit_conversion.h"
-
-#define LINESIZE 2048  /* maximum length of a line */
-#define NATOM_MAX 300  /* maximum number of atoms */
-
-#define DBGPRINT if(1) fprintf
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-/* Structure to store a file's binary type */
-enum Endianness { little_endian, big_endian };
-typedef struct {
-  enum Endianness endian; /* little or big endian*/
-  int recordmarker;       /* 4 or 8 bytes */
-} binary_t;
-
-
-/* Structure to store the header data of an abinit binary file
- * See for example
- *   http://www.abinit.org/documentation/helpfiles/for-v6.0/users/abinit_help.html#6
- */
-typedef struct {
-  binary_t bintype;
-  char codvsn[7];
-  int headform,fform;
-  int bantot, date, intxc, ixc, natom, ngfft[3], nkpt, npsp,
-      nspden, nspinor, nsppol, nsym, ntypat, occopt, pertcase, usepaw;
-  double ecut, ecutdg, ecutsm, ecut_eff, qptn[3], rprimd[3][3], stmbias, tphysel, tsmear;
-  int usewvl, *istwfk, *nband, *npwarr, *so_psp, *symafm, *symrel[3][3], *typat;
-  double *kpt[3], *occ, *tnons[3], *znucltypat, *wtk;
-
-  char title[133];
-  double znuclpsp, zionpsp;
-  int pspso, pspdat, pspcod, pspxc, lmn_size;
-
-  double residm, *xred[3], etotal, fermie;
-
-  int cplex;
-} abinit_binary_header_t;
-
-
-/* Structure to store important abinit data so that it can be easily shared among the routines */
-typedef struct {
-  FILE *file;                  /* file pointer for reading or writing */
-  char *filename;              /* file name for reading or writing */
-  char filetype[4];            /* type of data file: e.g. GEOmetric or DENsity file */
-
-  float rotmat[3][3];          /* rotation matrix, stored for periodic display hack */
-
-  /* variables for atomic structure */
-  float rprimd[3][3];          /* Real space PRIMitive translations of the unit cell */
-  int natom;                   /* total number of atoms */
-  int typat[NATOM_MAX];        /* number of atoms per atom type */
-  molfile_atom_t *atomlist;
-
-  /* volumetric variables for data of charge density, wavefunction, etc. */
-  int nvolsets;                /* number of volumetric datasets */
-  molfile_volumetric_t *vol;   /* volume set metadata */
-
-  abinit_binary_header_t *hdr; /* header info of an abinit binary file */
-} abinit_plugindata_t;
-
-
-static int binread(void *, size_t, FILE *, binary_t);
-static abinit_binary_header_t *abinit_header(FILE *);
-
-
-/* Allocate memory for header */
-static abinit_binary_header_t *abinit_header_malloc()
-{
-  abinit_binary_header_t *hdr = (abinit_binary_header_t *)malloc(sizeof(abinit_binary_header_t));
-
-  /* zero all bytes in the structure */
-  if (hdr) memset(hdr, 0, sizeof(abinit_binary_header_t));
-  else fprintf(stderr, "\n\nABINIT plugin) ERROR: cannot allocate memory for header.\n");
-
-  return hdr;
-}
-
-
-/* Allocate memory for plugin data */
-static abinit_plugindata_t *abinit_plugindata_malloc()
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)malloc(sizeof(abinit_plugindata_t));
-
-  /* zero all bytes in the structure */
-  if (data) memset(data, 0, sizeof(abinit_plugindata_t));
-  else fprintf(stderr, "\n\nABINIT plugin) ERROR: cannot allocate memory for plugin data.\n");
-
-  return data;
-}
-
-
-/* Free up the header data */
-static void abinit_header_free(abinit_binary_header_t *hdr)
-{
-  int i;
-
-  if (!hdr) return;
-
-  if (hdr->istwfk) free(hdr->istwfk);
-  if (hdr->nband) free(hdr->nband);
-  if (hdr->npwarr) free(hdr->npwarr);
-  if (hdr->so_psp) free(hdr->so_psp);
-  if (hdr->symafm) free(hdr->symafm);
-  for (i = 0; i < 3; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) if (hdr->symrel[i][j]) free(hdr->symrel[i][j]);
-    if (hdr->kpt[i]) free(hdr->kpt[i]);
-    if (hdr->tnons[i]) free(hdr->tnons[i]);
-    if (hdr->xred[i]) free(hdr->xred[i]);
-  }
-  if (hdr->typat) free(hdr->typat);
-  if (hdr->occ) free(hdr->occ);
-  if (hdr->znucltypat) free(hdr->znucltypat);
-  if (hdr->wtk) free(hdr->wtk);
-
-  free(hdr);
-  hdr = NULL;
-}
-
-
-/* Free up the plugin data */
-static void abinit_plugindata_free(abinit_plugindata_t *data)
-{
-  if (!data) return;
-
-  if (data->file) fclose(data->file);
-  if (data->filename) free(data->filename);
-  if (data->atomlist) free(data->atomlist);
-  if (data->vol) free(data->vol);
-
-  abinit_header_free(data->hdr);
-
-  free(data);
-  data = NULL;
-}
-
-
-/* This rotation matrix is determined by two vectors.
- * The matrix aligns the first vector along the x-axis
- * and places the second vector in the xy-plane.
- *
- * Input: data-structure, which contains the matrix
- */
-static void abinit_buildrotmat(abinit_plugindata_t *data)
-{
-  float const *const a = data->rprimd[0];
-  float const *const b = data->rprimd[1];
-
-  /* Rotate first about y-axis and z-axis to align vector a along the x-axis.
-   * phi  : angle between vector a and its projection on the xy-plane
-   * theta: angle between projection of vector a on the xy-plane and the x-axis
-   */
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  /* Rotate about x-axis to place b in the xy-plane. */
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  data->rotmat[0][0] =  cph * cth;
-  data->rotmat[0][1] =  cph * sth;
-  data->rotmat[0][2] =  sph;
-  data->rotmat[1][0] = -sth * cps - sph * cth * sps;
-  data->rotmat[1][1] =  cth * cps - sph * sth * sps;
-  data->rotmat[1][2] =  cph * sps; 
-  data->rotmat[2][0] =  sth * sps - sph * cth * cps;
-  data->rotmat[2][1] = -cth * sps - sph * sth * cps; 
-  data->rotmat[2][2] =  cph * cps;
-
-  DBGPRINT(stderr, "   ROTATION MATRIX: %f   %f   %f\n", data->rotmat[0][0], data->rotmat[0][1], data->rotmat[0][2]);
-  DBGPRINT(stderr, "                    %f   %f   %f\n", data->rotmat[1][0], data->rotmat[1][1], data->rotmat[1][2]);
-  DBGPRINT(stderr, "                    %f   %f   %f\n", data->rotmat[2][0], data->rotmat[2][1], data->rotmat[2][2]);
-}
-
-
-/* Read a non-empty line from stream, remove comments (#... or !...)
- * and strip redundant whitespaces.
- *
- * Input: string, which can contain the line
- *        input stream
- *
- * Return: the stripped line, or NULL when EOF is reached
- */
-static char *abinit_readline(char *line, FILE *stream)
-{
-  char *lineptr;
-
-  if (!line || !stream) return NULL;
-
-  do {
-    int i;
-    char *cptr;
-
-    /* read one line from the stream */
-    lineptr = fgets(line, LINESIZE, stream);
-
-    /* first remove comment from the line */
-    for (i = 0; i < strlen(line); ++i) {
-        if (line[i] == '#' || line[i] == '!') {line[i] = '\0'; break;}
-    }
-
-    /* next remove redundant white spaces at the end of the line */
-    for (cptr = &line[strlen(line) - 1]; isspace(*cptr); --cptr) *cptr = '\0';
-
-    /* continue for as long as EOF is not reached and the line is empty */
-  } while (lineptr != NULL && strlen(line) == 0);
-
-  return lineptr;
-}
-
-
-/* Abinit uses and generates several types of files:
- *   foobar_GEO: geometry file (formatted/ascii text)
- *   foobar_DEN: charge density file (unformatted/binary)
- *   foobar_WFK: wavefunction file (unformatted/binary)
- *   foobar_POT: potential file (unformatted/binary)
- *
- * If the filetype is already set, then we only compare the
- * filetype with the given string, otherwise we first find
- * out about the filetype and then do the compare.
- *
- * Input: abinit-data-structure (may or may not have the filetype set)
-          string to compare with
- *
- * Return: comparison result: 1 (equal), 0 (not equal or error)
- */
-static int abinit_filetype(abinit_plugindata_t *data, char const *cmp)
-{
-  char lineptr[LINESIZE];
-
-  if (!data || !cmp) return 0;
-
-  /* if filetype is already set, then only compare */
-  if (strlen(data->filetype) != 0) return (strncmp(data->filetype, cmp, 3) == 0);
-
-  /* first try to read the abinit binary header */
-  data->hdr = abinit_header(data->file);
-  if (data->hdr) {
-    /* header is read successfully,
-     * therefore it must be an abinit unformatted (binary) file
-     */
-
-    switch(data->hdr->fform) {
-    case   2: /* WFK Wave Function file */
-              strcpy(data->filetype, "WFK");
-              break;
-    case  52: /* DEN Charge Density file */
-              strcpy(data->filetype, "DEN");
-              break;
-    case 102: /* POT Potential file */
-              strcpy(data->filetype, "POT");
-              break;
-    default:  /* Error */
-              strcpy(data->filetype, "ERR");
-              break;
-    }
-
-  } else {
-    /* reading the abinit binary header failed;
-     * we now resort to formatted (ascii text) file.
-     */
-
-    /* read the first non-empty line of the file */
-    rewind(data->file);
-    abinit_readline(lineptr, data->file);
-
-    if (strstr(lineptr, " GEO file"))
-      strcpy(data->filetype, "GEO"); /* GEO geometry file */
-    else
-      strcpy(data->filetype, "ERR"); /* Error */
-
-    /* set the file pointer back to the beginning of the file */
-    rewind(data->file);
-  }
-
-  return (strncmp(data->filetype, cmp, 3) == 0);
-}
-
-
-/* Construct a new file name by finding the first integer number
- * in the existing file name, and create the same file name but
- * with this integer number incremented.
- *
- * Note: the string 'filename' is changed into the new filename
- * ONLY if the file with the new filename exists! 
- *
- * Input: filename
- *
- * Return: 0 (success), 1 (no more files), 2 (error)
- */
-static int increment_filename(char *filename)
-{
-  int i;
-  char *newfilename = NULL, *endpart = NULL;
-
-  DBGPRINT(stderr, "Enter increment_filename\n");
-
-  DBGPRINT(stderr, "increment_filename: filename = %s \n", filename);
-  /* search for integer in the filename starting from the end of the string */
-  for (i = strlen(filename) - 1; i >= 0 && !newfilename; --i) {
-
-    /* endpart points to the string AFTER the integer */
-    if (!endpart && isdigit(filename[i])) endpart = strdup(filename + i + 1);
-
-    /* allocate newfilename when integer is found */
-    if (endpart && !newfilename && !isdigit(filename[i])) {
-       newfilename = (char *)malloc(sizeof(char) * (2 + strlen(filename)));
-       if (!newfilename) {
-         free(endpart);
-         return 2;
-       }
-
-       /* first copy part of the string BEFORE the integer number */
-       strncpy(newfilename, filename, i + 1);
-
-       /* second append the incremented integer number and add 'endpart' of the filename */
-       sprintf(newfilename + i + 1, "%d%s", 1 + atoi(filename + i + 1), endpart);
-    }
-  }
-
-  /* if the endpart is not found, then the file name does not have a number in it,
-   * and therefore this filename is not part of a series of timesteps.
-   * note that if this occurs, then 'newfilename' must also still be NULL !
-   */
-  if (!endpart) {
-    DBGPRINT(stderr, "Exit increment_filename\n");
-    return 1;
-  }
-  
-  /* clean up */
-  free(endpart);
-
-  /* check if we can access the new file */
-  if (access(newfilename, F_OK) != 0) {
-    /* the new file cannot be accessed, so it does not exist */
-    free(newfilename);
-    DBGPRINT(stderr, "Exit increment_filename\n");
-    return 1;
-  } else {
-    /* the new filename exists! Replace the old file name. */
-    strcpy(filename, newfilename);
-    free(newfilename);
-    DBGPRINT(stderr, "increment_filename: filename = %s \n", filename);
-    DBGPRINT(stderr, "Exit increment_filename\n");
-    return 0;
-  }
-}
-
-
-/* Geometry files are generated by ABINIT when "prtgeo 1" is given in
- * the input file. Note that this is NOT the abinit default!
- *
- * Input: data-structure
- *        reference to the number of atoms
- *
- * Return: data-structure, or NULL on error
- */
-static void *GEO_open_file_read(abinit_plugindata_t *data, int *natoms)
-{
-  char lineptr[LINESIZE], atomname[NATOM_MAX][10];
-  int i, idx;
-
-  DBGPRINT(stderr, "Enter GEO_open_file_read\n");
-
-  /* go to the line with the text 'XMOL data' */
-  while (abinit_readline(lineptr, data->file) != NULL) {
-    if (strstr(lineptr, "XMOL data")) break;
-  }
-  if (!strstr(lineptr, "XMOL data")) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: '%s' has no 'XMOL data...' lines.\n", data->filename);
-    return NULL;
-  }
-
-  /* next non-empty line has the number of atoms */
-  if (abinit_readline(lineptr, data->file) == NULL) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: cannot find the number of atoms in file '%s'.\n", data->filename);
-    return NULL;
-  }
-  data->natom = atoi(lineptr);
-  if (data->natom <= 0 || data->natom > NATOM_MAX) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: file '%s' has %d number of atoms.\n", data->filename, data->natom);
-    return NULL;
-  }
-
-  /* read through the list of atom names and ignore their positions */
-  for (i = 0; i < NATOM_MAX; ++i) data->typat[i] = atomname[i][0] = '\0';
-  for (idx = i = 0; i < data->natom; ++i) {
-    int n;
-    char name[10];
-    if (1 != fscanf(data->file, "%s %*f %*f %*f", name)) {
-      fprintf(stderr, "\n\nABINIT read) ERROR: file '%s' does not have the atom list.\n", data->filename);
-      return NULL;
-    }
-
-    /* compare current atom name with previous read list and set typat accordingly */
-    for (n = 0; n < idx; ++n) if (strcmp(atomname[n], name) == 0) break;
-    if (n == idx) strcpy(atomname[idx++], name);
-    data->typat[i] = n + 1;
-
-    DBGPRINT(stderr, "   \"%s\": name = %s : data->typat[%d] = %d\n", data->filetype, atomname[n], i, data->typat[i]);
-  }
-
-  rewind(data->file);
-
-  *natoms = data->natom;
-
-  DBGPRINT(stderr, "Exit GEO_open_file_read\n");
-  return data;
-}
-
-
-static int GEO_read_structure(abinit_plugindata_t *data, int *optflags, molfile_atom_t *atomlist)
-{
-  char lineptr[LINESIZE];
-  int i, status;
-
-  DBGPRINT(stderr, "Enter GEO_read_structure\n");
-
-  /* go to the line with the 'XMOL data' */
-  do {
-    char *line = abinit_readline(lineptr, data->file);
-    status = line != NULL && !strstr(lineptr, "XMOL data");
-  } while (status);
-
-  /* skip line with atom numbers */
-  abinit_readline(lineptr, data->file);
-
-  /* find atom types in XMOL list */
-  for (i = 0; i < data->natom; ++i) {
-    molfile_atom_t *const atom = &(atomlist[i]);
-
-    /* required fields */
-    if (1 != fscanf(data->file, "%s %*f %*f %*f", atom->name)) {
-      fprintf(stderr, "\n\nABINIT read) ERROR: file '%s' does not have the atom list.\n", data->filename);
-      return MOLFILE_ERROR;
-    }
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->segid[0]='\0';
-    atom->chain[0]='\0';
-
-    /* Optional fields (defined in *optflags) */
-    atom->atomicnumber = get_pte_idx(atom->name);
-    atom->mass = get_pte_mass(atom->atomicnumber);
-    atom->radius = get_pte_vdw_radius(atom->atomicnumber);
-
-    DBGPRINT(stderr, "   atom %d : %d (%s)\n", i, atom->atomicnumber, atom->name);
-  }
-
-  /* tell which of the optional fields in the molfile_atom_t structure are provided */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS; 
-
-  rewind(data->file);
-
-  DBGPRINT(stderr, "Exit GEO_read_structure\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int GEO_read_next_timestep(abinit_plugindata_t *data, int natoms, molfile_timestep_t *ts)
-{
-  char lineptr[LINESIZE];
-  float *a, *b, *c;
-  int i , status;
-
-  DBGPRINT(stderr, "Enter GEO_read_next_timestep\n");
-
-  /* At the very first call the file pointer will be non-NULL.
-   * All consecutive calls will have a NULL file pointer (see at the end
-   * of this routine) and in that case "increment" the filename for the
-   * data of the next timestep; if this file does not exist, then there
-   * are no more timesteps.
-   */
-  if (!data->file) {
-    if (increment_filename(data->filename) != 0) return MOLFILE_EOF;
-
-    data->file = fopen(data->filename, "r");
-    if (!data->file) return MOLFILE_EOF;
-  }
-
-  DBGPRINT(stderr, "GEO_read_next_timestep: filename = %s \n", data->filename);
-
-  /* go to the line with 'Primitive vectors...' */
-  do {
-    char *line = abinit_readline(lineptr, data->file);
-    status = ( line != NULL && !strstr(lineptr, "Primitive vectors") );
-  } while (status);
-
-  /* read unit cell vectors from file */
-  for (i = 0; i < 3; ++i) {
-    float length, *r = data->rprimd[i];
-    if (3 != fscanf(data->file, "%*s %f %f %f", &r[0], &r[1], &r[2])) return MOLFILE_EOF;
-
-    /* convert length units from Bohr to Angstrom */
-    r[0] *= BOHR_TO_ANGS;
-    r[1] *= BOHR_TO_ANGS;
-    r[2] *= BOHR_TO_ANGS;
-
-    /* lengths of the respective unit cell vector */
-    length = sqrt(r[0]*r[0] + r[1]*r[1] + r[2]*r[2]);
-    switch (i) {
-      case 0: ts->A = length; break;
-      case 1: ts->B = length; break;
-      case 2: ts->C = length; break;
-    }
-  }
-  abinit_buildrotmat(data);
-
-  /* determine angles between the vectors of the unit cell */
-  a = data->rprimd[0];
-  b = data->rprimd[1];
-  c = data->rprimd[2];
-
-  /* alpha: angle (in degrees) between b and c */
-  ts->alpha = (180.0/M_PI) * acos( (b[0]*c[0] + b[1]*c[1] + b[2]*c[2]) / (ts->B*ts->C) );
-
-  /* beta: angle (in degrees) between a and c */
-  ts->beta  = (180.0/M_PI) * acos( (a[0]*c[0] + a[1]*c[1] + a[2]*c[2]) / (ts->A*ts->C) );
-
-  /* gamma: angle (in degrees) between a and b */
-  ts->gamma = (180.0/M_PI) * acos( (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]) / (ts->A*ts->B) );
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  /* go to the line with 'XMOL data' */
-  do {
-    char *line = abinit_readline(lineptr, data->file);
-    status = line != NULL && !strstr(lineptr, "XMOL data");
-  } while (status);
-
-  /* skip line with atom numbers */
-  abinit_readline(lineptr, data->file);
-
-  /* read coordinates (in Angstrom) of each atom */
-  for (i = 0; i < data->natom; ++i) {
-    float x, y, z, *coords = &ts->coords[3*i];
-    fscanf(data->file, "%*s %f %f %f", &x, &y, &z);
-    coords[0] = data->rotmat[0][0]*x + data->rotmat[0][1]*y + data->rotmat[0][2]*z;
-    coords[1] = data->rotmat[1][0]*x + data->rotmat[1][1]*y + data->rotmat[1][2]*z;
-    coords[2] = data->rotmat[2][0]*x + data->rotmat[2][1]*y + data->rotmat[2][2]*z;
-  }
-
-  /* close the file and NULLify as preparation for the next timestep call */
-  fclose(data->file);
-  data->file = NULL;
-
-  DBGPRINT(stderr, "Exit GEO_read_next_timestep\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-/* Electron density (DEN), potential (POT), and wavefunction (WFK)
- * files have the structure information in the generic header,
- * followed by the volumetric data. For all three we can determine
- * the structure with the same reading routine.
- * The volumetric data is the similar for density and potential (DEN/POT)
- * files, but is different for wavefunction (WFK) files.
- */
-static void *DEN_POT_WFK_open_file_read(abinit_plugindata_t *data, int *natoms)
-{
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_POT_WFK_open_file_read\n");
-
-  data->natom = data->hdr->natom;
-
-  if (data->natom <= 0 || data->natom > NATOM_MAX) return NULL;
-
-  for (i = 0; i < data->natom; ++i) data->typat[i] = data->hdr->typat[i];
-
-  for (i = 0; i < data->natom; ++i) DBGPRINT(stderr, "   \"%s\": data->typat[%d] = %d\n", data->filetype, i, data->typat[i]);
-
-  *natoms = data->natom;
-
-  DBGPRINT(stderr, "Exit DEN_POT_WFK_open_file_read\n");
-  return data;
-}
-
-
-static int DEN_POT_WFK_read_structure(abinit_plugindata_t *data, int *optflags, molfile_atom_t *atomlist)
-{
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_POT_WFK_read_structure\n");
-
-  /* set the atom types, names, etc. */
-  for (i = 0; i < data->natom; ++i) {
-    molfile_atom_t *const atom = &(atomlist[i]);
-
-    /* optional fields (defined in *optflags) */
-    atom->atomicnumber = (int)floor(0.5 + data->hdr->znucltypat[data->hdr->typat[i] - 1]);
-    atom->mass = get_pte_mass(atom->atomicnumber);
-    atom->radius = get_pte_vdw_radius(atom->atomicnumber);
-
-    /* required fields */
-    strncpy(atom->name, get_pte_label(atom->atomicnumber), sizeof(atom->name));    
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->segid[0]='\0';
-    atom->chain[0]='\0';
-
-    DBGPRINT(stderr, "   atom %d : %d (%s)\n", i, atom->atomicnumber, atom->name);
-  }
-
-  /* tell which of the optional fields in the molfile_atom_t structure are provided */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS; 
-
-  DBGPRINT(stderr, "Exit DEN_POT_WFK_read_structure\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int DEN_POT_WFK_read_next_timestep(abinit_plugindata_t *data, int natoms, molfile_timestep_t *ts)
-{
-  float *a, *b, *c;
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_POT_WFK_read_next_timestep\n");
-
-  /* At the very first call the file pointer will be non-NULL.
-   * All consecutive calls will have a NULL file pointer (see at the end
-   * of this routine) and in that case "increment" the filename for the
-   * data of the next timestep; if this file does not exist, then there
-   * are no more timesteps.
-   */
-  if (!data->file) {
-    /* alas, volumetric data cannot (yet ?) be read as timesteps */
-    return MOLFILE_EOF;
-
-    if (increment_filename(data->filename) != 0) return MOLFILE_EOF;
-
-    data->file = fopen(data->filename, "r");
-    if (!data->file) return MOLFILE_EOF;
-
-    /* read the new header info from the new file */
-    abinit_header_free(data->hdr);
-    data->hdr = abinit_header(data->file);
-    if (!data->hdr) return MOLFILE_EOF;
-  }
-
-  /* get unit cell vectors and convert them to Angstrom */
-  for (i = 0; i < 3; ++i) {
-    float length;
-    int k;
-    for (k = 0; k < 3; ++k) data->rprimd[i][k] = data->hdr->rprimd[i][k] * BOHR_TO_ANGS;
-    length = sqrt(pow(data->rprimd[i][0], 2) + pow(data->rprimd[i][1], 2) + pow(data->rprimd[i][2], 2));
-    switch (i) {
-      case 0: ts->A = length; break;
-      case 1: ts->B = length; break;
-      case 2: ts->C = length; break;
-    }    
-  }
-  abinit_buildrotmat(data);
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  /* determine angles between the vectors of the unit cell */
-  a = data->rprimd[0];
-  b = data->rprimd[1];
-  c = data->rprimd[2];
-
-  /* alpha: angle (in degrees) between b and c */
-  ts->alpha = (180.0/M_PI) * acos( (b[0]*c[0] + b[1]*c[1] + b[2]*c[2]) / (ts->B*ts->C) );
-
-  /* beta: angle (in degrees) between a and c */
-  ts->beta  = (180.0/M_PI) * acos( (a[0]*c[0] + a[1]*c[1] + a[2]*c[2]) / (ts->A*ts->C) );
-
-  /* gamma: angle (in degrees) between a and b */
-  ts->gamma = (180.0/M_PI) * acos( (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]) / (ts->A*ts->B) );
-
-  /* get coordinates (in Angstrom) of each atom */
-  for (i = 0; i < data->natom; ++i) {
-    double **xred = data->hdr->xred;
-    float *coords = &ts->coords[3*i];
-    float const x = xred[0][i] * a[0] + xred[1][i] * b[0] + xred[2][i] * c[0],
-                y = xred[0][i] * a[1] + xred[1][i] * b[1] + xred[2][i] * c[1],
-		z = xred[0][i] * a[2] + xred[1][i] * b[2] + xred[2][i] * c[2];
-
-    coords[0] = data->rotmat[0][0]*x + data->rotmat[0][1]*y + data->rotmat[0][2]*z;
-    coords[1] = data->rotmat[1][0]*x + data->rotmat[1][1]*y + data->rotmat[1][2]*z;
-    coords[2] = data->rotmat[2][0]*x + data->rotmat[2][1]*y + data->rotmat[2][2]*z;
-  }
-
-  /* close the file and NULLify as preparation for the next timestep call */
-  fclose(data->file);
-  data->file = NULL;
-
-  DBGPRINT(stderr, "Exit DEN_POT_WFK_read_next_timestep\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int DEN_read_volumetric_metadata(abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  char const spintext[3][30] = { "Charge density spin up",
-                                 "Charge density spin down",
-                                 "Charge density spin up - down" };
-  char const magntext[3][40] = { "X-projection of local magnetization",
-                                 "Y-projection of local magnetization",
-                                 "Z-projection of local magnetization" };
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_read_volumetric_metadata\n");
-
-  /* Abinit provides the electron density, which is the negative of the
-   * charge density. For norm-conserving pseudopotentials (usepaw = 0)
-   * this is the pseudo-valence electron density; for a PAW calculation
-   * (usepaw = 1) this is the pseudo-valence electron density plus the
-   * compensation charge density.
-   * To visualize the electron density from a PAW calculation, create
-   * the density file with the pawprtden key word, not prtden (however,
-   * if you want to chain this density into later calculations, you have
-   * to use prtden.
-   */
-  if (data->hdr->usepaw) {
-    fprintf(stderr, "\n\nABINIT read) WARNING: be sure that you have used \"pawprtden 1\"\n");
-    fprintf(stderr,     "                      in order to visualize the electron density!\n\n");
-  }
-
-  /* Initialize the volume set list
-   * Total charge density (spin up+down) : always present
-   *    spin up / spin down / spin up-down \ only there for
-   *    X / Y / Z local magnetization      /  spin-polarized calculations
-   *                    (the latter two are absent for non-spin-polarized calculations)
-   */
-  data->nvolsets = (data->hdr->nspden == 1 ? 1 : 4);
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: cannot allocate space for volumetric data.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* get unit cell vectors and convert to Angstrom */
-  for (i = 0; i < 3; ++i) {
-    int k;
-    for (k = 0; k < 3; ++k) data->rprimd[i][k] = data->hdr->rprimd[i][k] * BOHR_TO_ANGS;
-  }
-  abinit_buildrotmat(data);
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  for (i = 0; i < data->nvolsets; ++i) {
-
-    int k;
-
-    /* handle to the current volume set meta data */
-    molfile_volumetric_t *const set = &(data->vol[i]);
-
-    /* set the volume data name */
-    if (i == 0) {
-        /* the first data set always is the total charge density */
-        sprintf(set->dataname, "Total charge density");
-    } else if (data->hdr->nspden <= 2) {
-        /* datasets contain spin polarized (up/down) densities */
-        sprintf(set->dataname, "%s", spintext[i-1]);
-    } else if (data->hdr->nspden == 4) {
-        /* subsequent datasets contain magnetization data */
-        sprintf(set->dataname, "%s", magntext[i-1]);
-    } else {
-        /* we should never get here.... */
-        sprintf(set->dataname, "%s", "ERROR: no datasets available");
-    }
-
-    /* rotate unit cell vectors */
-    for (k = 0 ; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->rprimd[0][0]
-		    + data->rotmat[k][1] * data->rprimd[0][1]
-		    + data->rotmat[k][2] * data->rprimd[0][2];
-
-      set->yaxis[k] = data->rotmat[k][0] * data->rprimd[1][0] 
-		    + data->rotmat[k][1] * data->rprimd[1][1]
-		    + data->rotmat[k][2] * data->rprimd[1][2];
-
-      set->zaxis[k] = data->rotmat[k][0] * data->rprimd[2][0] 
-		    + data->rotmat[k][1] * data->rprimd[2][1]
-		    + data->rotmat[k][2] * data->rprimd[2][2];
-    }
-    DBGPRINT(stderr, "   set->xaxis[%d] set->yaxis[%d] set->zaxis[%d]\n", k, k, k);
-    for (k = 0 ; k < 3; ++k) DBGPRINT(stderr, "   %f         %f        %f\n", set->xaxis[k], set->yaxis[k], set->zaxis[k]);
-
-    /* Add one more to the grid size and later fill the extra voxel
-     * with the same value from the beginning of the row to make
-     * the volumetric data smooth across the cell boundaries.
-     */
-    set->xsize = data->hdr->ngfft[0] + 1;
-    set->ysize = data->hdr->ngfft[1] + 1;
-    set->zsize = data->hdr->ngfft[2] + 1;
-
-    set->has_color = 0;
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  DBGPRINT(stderr, "Exit DEN_read_volumetric_metadata.\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int DEN_read_volumetric_data(abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
-{
-  double const density_conversion = 1.0/pow(BOHR_TO_ANGS, 3);
-  int iset;
-
-  DBGPRINT(stderr, "Enter DEN_read_volumetric_data\n");
-
-  /* this should never happen, nevertheless check it to prevent disasters */
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  /* The density output file contains the header plus:
-   * do ispden=1,nspden
-   * write(unit) (rhor(ir),ir=1,cplex*ngfft(1)*ngfft(2)*ngfft(3))
-   * enddo
-   */
-  for (iset = 0; iset <= set && iset < data->hdr->nspden; ++iset) {
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-
-    char recordmarker[10];
-    int n, ix, iy, iz;
-
-    /* Fill the datablock with the density or magnetization data.
-     * Note that for each 'iset'-loop the datablock is overwritten,
-     * so that only the last datablock readings remain.
-     */
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          double value;
-
-          /* The datablock grid is one voxel larger in each direction in order
-	   * to smoothen the density at the cell boundaries; hence fill the extra
-	   * voxel with the same value as the one at the beginning of that row.
-	   */
-          if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else if (data->hdr->cplex == 1) {
-            /* get the volumetric data and convert */
-            binread(&value, 8, data->file, data->hdr->bintype);
-	    value *= density_conversion;
-	  } else if (data->hdr->cplex == 2) {
-            /* get volumetric data as a complex number and convert */
-	    double a, b;
-            binread(&a, 8, data->file, data->hdr->bintype);
-            binread(&b, 8, data->file, data->hdr->bintype);
-	    value = sqrt(a*a + b*b) * density_conversion;
-	  } else {
-            /* we should never get here */
-            return MOLFILE_ERROR;
-          }
-
-          /* fill the datablock according to the data provided */
-          if (data->hdr->nspden <= 2) {
-            /* data is charge density as one or two sets: total and spin up */
-
-            if (set == 0 || set == 1) {
-              /* first two sets are always directly provided as total and spin up */
-              datablock[n] = value;
-            } else if (set == 2) {
-              /* third set we calculate from first two sets: down = total - up */
-              datablock[n] = (iset == 0 ? value : datablock[n] - value);
-            } else if (set == 3) {
-              /* fourth set we calculate from first two sets: up - down = 2*up - total */
-              datablock[n] = (iset == 0 ? -value : datablock[n] + 2*value);
-            } else {
-              /* we should never get here */
-              return MOLFILE_ERROR;
-            }
-
-          } else if (data->hdr->nspden == 4) {
-            /* data is magnetization as four sets: total charge density and X-Y-Z-magnetization */
-            datablock[n] = value;
-
-          } else {
-            /* we should never get here...*/
-            return MOLFILE_ERROR;
-          }
-
-	}
-      }
-    }
-
-    /* skip the recordmarker bytes twice */
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-  }
-
-  DBGPRINT(stderr, "Exit DEN_read_volumetric_data\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int POT_read_volumetric_metadata(abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  int i;
-
-  DBGPRINT(stderr, "Enter POT_read_volumetric_metadata\n");
-
-  data->nvolsets = data->hdr->nspden;
-
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: cannot allocate space for volumetric data.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* get unit cell vectors and convert to Angstrom */
-  for (i = 0; i < 3; ++i) {
-    int k;
-    for (k = 0; k < 3; ++k) data->rprimd[i][k] = data->hdr->rprimd[i][k] * BOHR_TO_ANGS;
-  }
-  abinit_buildrotmat(data);
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  for (i = 0; i < data->nvolsets; ++i) {
-
-    int k;
-
-    /* handle to the current volume set meta data */
-    molfile_volumetric_t *const set = &(data->vol[i]);
-
-    if (data->nvolsets == 1) strcpy(set->dataname, "Total potential");
-    else if (data->nvolsets == 2) {
-        if (i == 0) strcpy(set->dataname, "Spin up potential");
-        if (i == 1) strcpy(set->dataname, "Spin down potential");
-    } else if (data->nvolsets == 4) {
-        if (i == 0) strcpy(set->dataname, "Spin up-up potential");
-        if (i == 1) strcpy(set->dataname, "Spin down-down potential");
-        if (i == 2) strcpy(set->dataname, "Real part of spin up-down potential");
-        if (i == 3) strcpy(set->dataname, "Imaginary part of spin up-down potential");
-    }
-
-    /* rotate unit cell vectors */
-    for (k = 0 ; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->rprimd[0][0]
-		    + data->rotmat[k][1] * data->rprimd[0][1]
-		    + data->rotmat[k][2] * data->rprimd[0][2];
-
-      set->yaxis[k] = data->rotmat[k][0] * data->rprimd[1][0] 
-		    + data->rotmat[k][1] * data->rprimd[1][1]
-		    + data->rotmat[k][2] * data->rprimd[1][2];
-
-      set->zaxis[k] = data->rotmat[k][0] * data->rprimd[2][0] 
-		    + data->rotmat[k][1] * data->rprimd[2][1]
-		    + data->rotmat[k][2] * data->rprimd[2][2];
-    }
-    DBGPRINT(stderr, "   set->xaxis[%d] set->yaxis[%d] set->zaxis[%d]\n", k, k, k);
-    for (k = 0 ; k < 3; ++k) DBGPRINT(stderr, "   %f         %f        %f\n", set->xaxis[k], set->yaxis[k], set->zaxis[k]);
-
-    /* Add one more to the grid size and fill the extra voxel
-     * with the same value at the beginning of the row to make
-     * the volumetric data smooth across the cell boundaries.
-     */
-    set->xsize = data->hdr->ngfft[0] + 1;
-    set->ysize = data->hdr->ngfft[1] + 1;
-    set->zsize = data->hdr->ngfft[2] + 1;
-
-    set->has_color = 0;
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  DBGPRINT(stderr, "Exit POT_read_volumetric_metadata.\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int POT_read_volumetric_data(abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
-{
-  int n, iset;
-
-  DBGPRINT(stderr, "Enter POT_read_volumetric_data\n");
-
-  /* this should never happen, nevertheless check it to prevent disasters */
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  /* The potential files contain the header plus:
-   * do ispden=1,nspden
-   * write(unit) (potential(ir),ir=1,cplex*ngfft(1)*ngfft(2)*ngfft(3))
-   * enddo
-   */
-  for (n = iset = 0; iset <= set; ++iset) {
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-
-    char recordmarker[10];
-    int ix, iy, iz;
-
-    /* Fill the datablock with the density data.
-     * Note that for each 'iset'-loop the datablock is overwritten,
-     * so that only the last datablock readings remain.
-     */
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          double value;
-
-          /* The datablock grid is one voxel larger in each direction in order
-	   * to smoothen the density at the cell boundaries; hence fill the extra
-	   * voxel with the same value as the one at the beginning of that row.
-	   */
-          if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else if (data->hdr->cplex == 1) {
-            /* get the volumetric data and convert */
-            binread(&value, 8, data->file, data->hdr->bintype);
-	    value *= HARTREE_TO_EV;
-	  } else if (data->hdr->cplex == 2) {
-            /* get volumetric data as a complex number and convert */
-	    double a, b;
-            binread(&a, 8, data->file, data->hdr->bintype);
-            binread(&b, 8, data->file, data->hdr->bintype);
-	    value = sqrt(a*a + b*b) * HARTREE_TO_EV;
-	  } else return MOLFILE_ERROR;
-
-          datablock[n] = value;
-	}
-      }
-    }
-
-    /* THIS HAS NOT BEEN VERIFIED YET: skip the recordmarker bytes twice */
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-  }
-
-  DBGPRINT(stderr, "Exit POT_read_volumetric_data\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int WFK_read_volumetric_metadata(abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  /* net yet implemented */
-  DBGPRINT(stderr, "Enter/Exit WFK_read_volumetric_metadata\n");
-  fprintf(stderr, "\n\nABINIT read) WARNING: loading WFK is NOT YET IMPLEMENTED!\n");
-  return MOLFILE_ERROR;
-}
-
-
-static int WFK_read_volumetric_data(abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
-{
-  /* net yet implemented */
-  DBGPRINT(stderr, "Enter/Exit WFK_read_volumetric_data: NOT YET IMPLEMENTED!\n");
-  fprintf(stderr, "\n\nABINIT read) WARNING: loading WFK is NOT YET IMPLEMENTED!\n");
-  return MOLFILE_ERROR;
-}
-
-/* ===================================
- * Generic vmd routines
- * ===================================
- */
-
-
-/* VMD calls this one just once to verify access to the file. */
-static void *open_file_read(const char *filename, const char *filetype, int *natoms)
-{
-  void *result = NULL;
-  abinit_plugindata_t *data;
-
-  DBGPRINT(stderr, "Enter open_file_read\n");
-
-  /* verify that the input variables are OK */
-  if (!filename || !natoms) return NULL;
-
-  /* start with undefined value and set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  /* allocate memory for the abinit data structure */
-  data = abinit_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* allocate memory for filename (add an extra 10 bytes for some more flexibility) */
-  data->filename = (char *)malloc( sizeof(char) * (strlen(filename) + 10) );
-
-  /* open the file for reading */
-  data->file = fopen(filename, "rb");
-
-  if (!data->file || !data->filename) {
-    abinit_plugindata_free(data);
-    return NULL;
-  }
-  strcpy(data->filename, filename);
-
-  if (abinit_filetype(data, "GEO"))
-    result = GEO_open_file_read(data, natoms);
-  else if (abinit_filetype(data, "DEN") || abinit_filetype(data, "POT") || abinit_filetype(data, "WFK"))
-    result = DEN_POT_WFK_open_file_read(data, natoms);
-
-  if (result == NULL) abinit_plugindata_free(data);
-
-  DBGPRINT(stderr, "Exit open_file_read\n");
-  return result;
-}
-
-
-/* VMD calls this once to find out about the atom types in the structure */
-static int read_structure(void *mydata, int *optflags, molfile_atom_t *atomlist)
-{
-  int result = MOLFILE_ERROR;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_structure\n");
-
-  if (!data || !optflags || !atomlist) return MOLFILE_ERROR;
-
-  if (abinit_filetype(data, "GEO"))
-    result = GEO_read_structure(data, optflags, atomlist);
-  else if (abinit_filetype(data, "DEN") || abinit_filetype(data, "POT") || abinit_filetype(data, "WFK"))
-    result = DEN_POT_WFK_read_structure(data, optflags, atomlist);
-
-  DBGPRINT(stderr, "Exit read_structure\n");
-  return result;
-}
-
-
-/* VMD keeps calling for a next timestep, until it gets End-Of-File here */
-static int read_next_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  int result = MOLFILE_EOF;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_next_timestep\n");
-
-  /* Save coordinatess only if we are given a timestep pointer.
-   * Otherwise assume that VMD wants us to skip past it.
-   */
-  if (!ts || !data) return MOLFILE_EOF;
-
-  /* Double check that the number of atoms are correct */
-  if (natoms != data->natom) return MOLFILE_EOF;
-
-  if (abinit_filetype(data, "GEO"))
-    result = GEO_read_next_timestep(data, natoms, ts);
-  else if (abinit_filetype(data, "DEN") || abinit_filetype(data, "POT") || abinit_filetype(data, "WFK"))
-    result = DEN_POT_WFK_read_next_timestep(data, natoms, ts);
-
-  DBGPRINT(stderr, "Exit read_next_timestep\n");
-  return result;
-}
-
-
-static void close_file_read(void *mydata)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter close_read\n");
-
-  abinit_plugindata_free(data);
-
-  DBGPRINT(stderr, "Exit close_read\n");
-}
-
-
-
-/* This writes the basic structure data in the syntax of the abinit input format. */
-static void *open_file_write(const char *filename, const char *filetype, int natoms)
-{
-  abinit_plugindata_t *data = abinit_plugindata_malloc();
-
-  DBGPRINT(stderr, "Enter open_file_write\n");
-
-  if (!data) return NULL;
-
-  /* allocate memory for filename (add an extra 10 bytes for some more flexibility) */
-  data->filename = (char *)malloc( sizeof(char) * (strlen(filename) + 10) );
-
-  /* open the file for writing */
-  data->file = fopen(filename, "w");
-
-  if (!data->filename || !data->file) {
-    abinit_plugindata_free(data);
-    fprintf(stderr, "ABINIT write) ERROR: unable to open file '%s' for writing\n", filename);
-    return NULL;
-  }
-  strcpy(data->filename, filename);
-
-  data->natom = natoms;
-
-  DBGPRINT(stderr, "Exit open_file_write\n");
-  return data;
-}
-
-
-static int write_structure(void *mydata, int optflags, const molfile_atom_t *atoms)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-  int i, znucl[NATOM_MAX], ntypat;
-
-  DBGPRINT(stderr, "Enter write_structure\n");
-
-  if (!data || !atoms) return MOLFILE_ERROR;
-
-  for (i = 0; i < NATOM_MAX; ++i) znucl[i] = 0;
-
-
-  for (ntypat = i = 0; i < data->natom; ++i) {
-    int const idx = get_pte_idx(atoms[i].type);
-    int k;
-
-    /* check if we already have this atom's idx in the list */
-    for (k = 0; k < ntypat; ++k) if (idx == znucl[k]) break;
-
-    /* if it is not yet in the list, increment ntypat */
-    if (k == ntypat) ntypat++;
-
-    znucl[k] = idx;
-    data->typat[i] = k + 1;
-  }
-
-  /* write header with info */
-  fprintf(data->file, "# Format below is in a sloppy ABINIT style.\n");
-  fprintf(data->file, "# See http://www.abinit.org/ for the meaning of the keywords used here.\n\n");
-
-  /* write the atom data to file */
-  fprintf(data->file, "# Definition of the atom types\nntypat %d\nznucl ", ntypat);
-  for (i = 0; i < ntypat; ++i) fprintf(data->file, " %d", znucl[i]);
-  fprintf(data->file, "\n\n");
-
-  fprintf(data->file, "# Definition of the atoms\nnatom %d\ntypat ", data->natom);
-  for (i = 0; i < data->natom; ++i) fprintf(data->file, " %d", data->typat[i]);
-  fprintf(data->file, "\n\n");
-
-  DBGPRINT(stderr, "Exit write_structure\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_timestep(void *mydata, const molfile_timestep_t *ts)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata; 
-  int i;
-
-  DBGPRINT(stderr, "Enter write_timestep\n");
-
-  if (!data || !ts) return MOLFILE_ERROR;
-
-  fprintf(data->file, "# Definition of the unit cell in Bohr\n");
-  fprintf(data->file, "acell %f %f %f\n", ts->A * ANGS_TO_BOHR, ts->B * ANGS_TO_BOHR, ts->C * ANGS_TO_BOHR);
-  fprintf(data->file, "angdeg %f %f %f\n\n", ts->alpha, ts->beta, ts->gamma);
-
-  fprintf(data->file, "# location of the atoms in Bohr\nxcart ");
-  for (i = 0; i < data->natom; ++i) {
-    float const rx = ts->coords[3*i    ]  * ANGS_TO_BOHR,
-                ry = ts->coords[3*i + 1]  * ANGS_TO_BOHR,
-                rz = ts->coords[3*i + 2]  * ANGS_TO_BOHR;
-    fprintf(data->file, "%s%17.12f %17.12f %17.12f\n", (i != 0 ? "      " : ""), rx, ry, rz);
-  }
-  fprintf(data->file, "\n\n");
-
-  DBGPRINT(stderr, "Exit write_timestep\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_write(void *mydata)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-  DBGPRINT(stderr, "Enter close_file_write\n");
-
-  abinit_plugindata_free(data);
-
-  DBGPRINT(stderr, "Exit close_file_write\n");
-}
-
-
-static int read_volumetric_metadata(void *mydata, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  int result = MOLFILE_ERROR;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_volumetric_metadata\n");
-
-  if (!data || !nvolsets || !metadata) return MOLFILE_ERROR;
-
-  if (abinit_filetype(data, "DEN"))
-    result = DEN_read_volumetric_metadata(data, nvolsets, metadata);
-  else if (abinit_filetype(data, "POT"))
-    result = POT_read_volumetric_metadata(data, nvolsets, metadata);
-  else if (abinit_filetype(data, "WFK"))
-    result = WFK_read_volumetric_metadata(data, nvolsets, metadata);
-
-  DBGPRINT(stderr, "Exit read_volumetric_metadata\n");
-  return result;
-}
-
-static int read_volumetric_data(void *mydata, int set, float *datablock, float *colorblock)
-{
-  int result = MOLFILE_ERROR;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_volumetric_data\n");
-
-  if (!data || !datablock) return MOLFILE_ERROR;
-
-  if (abinit_filetype(data, "DEN"))
-    result = DEN_read_volumetric_data(data, set, datablock, colorblock);
-  else if (abinit_filetype(data, "POT"))
-    result = POT_read_volumetric_data(data, set, datablock, colorblock);
-  else if (abinit_filetype(data, "WFK"))
-    result = WFK_read_volumetric_data(data, set, datablock, colorblock);
-
-  DBGPRINT(stderr, "Exit read_volumetric_data\n");
-  return result;
-}
-
-
-/* ===================================
- * Registration stuff
- * ===================================
- */
-
-static molfile_plugin_t abinitplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  /* zero all bytes in the plugin prior to setting the fields */
-  memset(&abinitplugin, 0, sizeof(molfile_plugin_t));
-
-  /* see molfile_plugin.h for details on the fields */
-  /* header  */
-  abinitplugin.abiversion   = vmdplugin_ABIVERSION; /* the ABI for the base plugin type */
-  abinitplugin.type         = MOLFILE_PLUGIN_TYPE;  /* string descriptor of the plugin type */
-  abinitplugin.name         = "ABINIT";             /* name for the plugin */
-  abinitplugin.prettyname   = "ABINIT";             /* name in filetype list */
-  abinitplugin.author       = "Rob Lahaye";         /* string identifier */
-  abinitplugin.majorv       = 0;                    /* major version */
-  abinitplugin.minorv       = 4;                    /* minor version */
-  abinitplugin.is_reentrant = VMDPLUGIN_THREADSAFE; /* can this library be run concurrently with itself? */
-
-  /* the rest of the plugin */
-  abinitplugin.filename_extension       = "*|*_GEO|*_DEN|*_WFK|*_POT|*_VHA|*_VHXC|*_VXC"; /* filename extension for this file type */
-  abinitplugin.open_file_read           = open_file_read;           /* try to open the file for reading */
-  abinitplugin.read_structure           = read_structure;           /* read molecular structure from the given file handle */
-  abinitplugin.read_bonds               = 0;                        /* read bond information for the molecule */
-  abinitplugin.read_next_timestep       = read_next_timestep;       /* read the next timestep from the file */
-  abinitplugin.close_file_read          = close_file_read;          /* close the file and release all data */
-  abinitplugin.open_file_write          = open_file_write;          /* open a coordinate file for writing */
-  abinitplugin.write_structure          = write_structure;          /* write a timestep to the coordinate file */
-  abinitplugin.write_timestep           = write_timestep;           /* write a timestep to the coordinate file */
-  abinitplugin.close_file_write         = close_file_write;         /* close the file and release all data */
-  abinitplugin.read_volumetric_metadata = read_volumetric_metadata; /* retrieve metadata pertaining to volumetric datasets in this file */
-  abinitplugin.read_volumetric_data     = read_volumetric_data;     /* read the specified volumetric data set into the space pointed to by datablock */
-  abinitplugin.read_rawgraphics         = 0;                        /* read raw graphics data stored in this file */
-  abinitplugin.read_molecule_metadata   = 0;                        /* read molecule metadata */
-  abinitplugin.write_bonds              = 0;                        /* write bond information for the molecule */
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-
-  (*cb)(v, (vmdplugin_t *)&abinitplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-/* ===================================
- * Procedures to read the binary data
- * ===================================
- */
-
-
-/* Do a binary read of 'size' bytes from stream.
- * Store the bytes into the pointer according to the match
- * between the endianness of the file and the system reading it.
- * Return the number of bytes succesfully read.
- */
-static int binread(void *ptr, size_t size, FILE *stream, binary_t bintype)
-{
-  char *data = (char *)ptr;
-  char *storage = malloc(size * sizeof(char));
-  int const result = fread(storage, 1, size, stream);
-  unsigned int i = 1;
-  enum Endianness myEndian = ( *(char *)&i == 1 ? little_endian : big_endian );
-
-  for (i = 0; i < size; ++i) {
-    int const index = (myEndian == bintype.endian ? i : size - i - 1);
-    data[i] = storage[index];
-  }
-
-  free(storage);
-  return result;
-}
-
-
-/* Read the full header of a binary ABINIT file until the point
- * where the data starts.
- * Return a pointer to the header struct, or NULL if the reading fails.
- */ 
-static abinit_binary_header_t *abinit_header(FILE *fp)
-{
-  int const debug = 0;
-
-  /* the pattern of the first 4 or 8 bytes of a binary abinit file determines the
-   * endianness and recordmarker length of the file.
-   */
-  char const Big_Endian_4_pattern[]    = {'\x00','\x00','\x00','\x0e'},
-             Big_Endian_8_pattern[]    = {'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x0e'}, 
-             Little_Endian_4_pattern[] = {'\x0e','\x00','\x00','\x00'},
-             Little_Endian_8_pattern[] = {'\x0e','\x00','\x00','\x00','\x00','\x00','\x00','\x00'};
-
-  char skip[1024];
-  int i, bc = 0;
-
-  abinit_binary_header_t *hdr = abinit_header_malloc();
-  if (!hdr) return NULL;
-
-  /* be sure to start from the beginning of the file */
-  rewind(fp);
-
-  if (debug) fprintf(stderr, "START OF BINARY FILE DEBUG INFO\n");
-
-  /* Determine endianness and record length of the binary file.
-   * Note that this pattern is followed by a version string, which has no null termination.
-   * Therefore the pattern is always followed by a non-null byte.
-   */
-  fread(skip, 1, 8, fp);
-  if      (memcmp(skip, Big_Endian_4_pattern, 4) == 0)    {hdr->bintype.endian = big_endian;    hdr->bintype.recordmarker = 4;}
-  else if (memcmp(skip, Big_Endian_8_pattern, 8) == 0)    {hdr->bintype.endian = big_endian;    hdr->bintype.recordmarker = 8;}
-  else if (memcmp(skip, Little_Endian_8_pattern, 8) == 0) {hdr->bintype.endian = little_endian; hdr->bintype.recordmarker = 8;}
-  else if (memcmp(skip, Little_Endian_4_pattern, 4) == 0) {hdr->bintype.endian = little_endian; hdr->bintype.recordmarker = 4;}
-  else {abinit_header_free(hdr); return NULL;}
-
-  if (debug) fprintf(stderr, "Binary file is in %s with a record-marker of %d bytes\n",
-	                       (hdr->bintype.endian == big_endian ? "Big Endian" : "Little Endian"), hdr->bintype.recordmarker);
-
-  /* start reading again from the beginning of the file */
-  rewind(fp);
-
-  /*The header
-   * The wavefunction files, density files, and potential files all begin with the same records,
-   * called the "header".
-   *
-   *character*6 :: codvsn
-   *integer :: headform,fform
-   *integer :: bantot,date,intxc,ixc,natom,ngfft(3),nkpt,npsp,
-   *nspden,nspinor,nsppol,nsym,ntypat,occopt,pertcase,usepaw
-   *integer :: usewvl, cplex, nspden
-   *double precision :: acell(3),ecut,ecutdg,ecutsm,ecut_eff,qptn(3),rprimd(3,3),stmbias,tphysel,tsmear
-   *integer :: istwfk(nkpt),nband(nkpt*nsppol),npwarr(nkpt),so_psp(npsp),&
-   *& symafm(nsym),symrel(3,3,nsym),typat(natom),nrhoijsel(nspden),rhoijselect(*,nspden)
-   *double precision :: kpt(3,nkpt),occ(bantot),tnons(3,nsym),znucltypat(ntypat),wtk(nkpt)
-   *character*132 :: title
-   *double precision :: znuclpsp,zionpsp
-   *integer :: pspso,pspdat,pspcod,pspxc,lmax,lloc,mmax=integers
-   *double precision :: residm,xred(3,natom),etotal,fermie,rhoij(*,nspden)
-   *
-   * write(unit=header) codvsn,headform,fform
-   * write(unit=header) bantot,date,intxc,ixc,natom,ngfft(1:3),&
-   *& nkpt,nspden,nspinor,nsppol,nsym,npsp,ntypat,occopt,pertcase,usepaw,&
-   *& ecut,ecutdg,ecutsm,ecut_eff,qptn(1:3),rprimd(1:3,1:3),stmbias,tphysel,tsmear,usewvl
-
-   * write(unit=header) istwfk(1:nkpt),nband(1:nkpt*nsppol),&
-   *& npwarr(1:nkpt),so_psp(1:npsp),symafm(1:nsym),symrel(1:3,1:3,1:nsym),typat(1:natom),&
-   *& kpt(1:3,1:nkpt),occ(1:bantot),tnons(1:3,1:nsym),znucltypat(1:ntypat),wtk(1:nkpt)
-   * do ipsp=1,npsp
-   *! (npsp lines, 1 for each pseudopotential ; npsp=ntypat, except if alchemical pseudo-atoms)
-   *  write(unit=unit) title,znuclpsp,zionpsp,pspso,pspdat,pspcod,pspxc,lmn_size
-   * enddo
-   *!(in case of usepaw==0, final record: residm, coordinates, total energy, Fermi energy)
-   * write(unit=unit) residm,xred(1:3,1:natom),etotal,fermie
-   *!(in case of usepaw==1, there are some additional records)
-   * if (usepaw==1)then
-   *  write(unit=unit)( pawrhoij(iatom)%nrhoijsel(1:nspden),iatom=1,natom), cplex, nspden
-   *  write(unit=unit)((pawrhoij(iatom)%rhoijselect(1:      nrhoijsel(ispden),ispden),ispden=1,nspden),iatom=1,natom),&
-   *&                 ((pawrhoij(iatom)%rhoijp     (1:cplex*nrhoijsel(ispden),ispden),ispden=1,nspden),iatom=1,natom)
-   * endif
-   */
-
-  /* skip first the recordmarker bytes */
-  bc += fread(skip, 1, hdr->bintype.recordmarker, fp);
-
-  /* code version */
-  bc += fread(hdr->codvsn, sizeof(char), 6, fp); hdr->codvsn[6] = '\0';
-  if (debug) fprintf(stderr, "codvsn = '%s' (code version)\n", hdr->codvsn); 
-
-  /* format of the header */
-  bc += binread(&hdr->headform, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "headform = '%d' (format of the header)\n", hdr->headform);
-
-  /* specification for data type: 2 for wf; 52 for density; 102 for potential */
-  bc += binread(&hdr->fform, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "fform = '%d' (2 for wf; 52 for density; 102 for potential)\n", hdr->fform);
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  /* total number of bands (sum of nband on all kpts and spins) */
-  bc += binread(&hdr->bantot, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "bantot = '%d' (sum of nband on all kpts and spins)\n", hdr->bantot);
-
-  /* starting date */
-  bc += binread(&hdr->date, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "date = '%d' (starting date)\n", hdr->date);
-
-  bc += binread(&hdr->intxc, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "intxc = '%d'\n", hdr->intxc);
-
-  bc += binread(&hdr->ixc, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ixc = '%d'\n", hdr->ixc);
-
-  bc += binread(&hdr->natom, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "natom = '%d'\n", hdr->natom);
-
-  /* failsafe */
-  if (hdr->natom <= 0) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: natom = %d is wrong!",  hdr->natom);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  bc += binread(&hdr->ngfft[0], 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ngfft[0] = '%d'\n", hdr->ngfft[0]);
-  bc += binread(&hdr->ngfft[1], 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ngfft[1] = '%d'\n", hdr->ngfft[1]);
-  bc += binread(&hdr->ngfft[2], 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ngfft[2] = '%d'\n", hdr->ngfft[2]);
-
-  bc += binread(&hdr->nkpt, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nkpt = '%d'\n", hdr->nkpt);
-
-  bc += binread(&hdr->nspden, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nspden = '%d'\n", hdr->nspden);
-
-  /* failsafe */
-  if (hdr->nspden != 1 && hdr->nspden != 2 && hdr->nspden != 4) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: nspden = %d is wrong!",  hdr->nspden);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  bc += binread(&hdr->nspinor, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nspinor = '%d'\n", hdr->nspinor);
-
-  bc += binread(&hdr->nsppol, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nsppol = '%d'\n", hdr->nsppol);
-
-  bc += binread(&hdr->nsym, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nsym = '%d'\n", hdr->nsym);
-
-  bc += binread(&hdr->npsp, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "npsp = '%d'\n", hdr->npsp);
-
-  bc += binread(&hdr->ntypat, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ntypat = '%d'\n", hdr->ntypat);
-
-  bc += binread(&hdr->occopt, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "occopt = '%d'\n", hdr->occopt);
-
-  /* the index of the perturbation, 0 if GS calculation */
-  bc += binread(&hdr->pertcase, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "pertcase = '%d' (the index of the perturbation, 0 if GS calculation)\n", hdr->pertcase);
-
-  bc += binread(&hdr->usepaw, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "usepaw = '%d' (0=norm-conserving psps, 1=paw)\n", hdr->usepaw);
-
-  /* failsafe */
-  if (hdr->usepaw != 0 && hdr->usepaw != 1) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: usepaw = %d is wrong!", hdr->usepaw);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  bc += binread(&hdr->ecut, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecut = '%g'\n", hdr->ecut);
-
-  /* input variable (ecut for NC psps, pawecutdg for paw) */
-  bc += binread(&hdr->ecutdg, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecutdg = '%g' (ecut for NC psps, pawecutdg for paw)\n", hdr->ecutdg);
-
-  bc += binread(&hdr->ecutsm, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecutsm = '%g'\n", hdr->ecutsm);
-
-  /* ecut*dilatmx**2 (dilatmx is an input variable) */
-  bc += binread(&hdr->ecut_eff, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecut_eff = '%g' (ecut*dilatmx**2 [dilatmx is an input variable])\n", hdr->ecut_eff);
-
-  bc += binread(&hdr->qptn[0], 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "qptn[0] = '%g'\n", hdr->qptn[0]);
-  bc += binread(&hdr->qptn[1], 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "qptn[1] = '%g'\n", hdr->qptn[1]);
-  bc += binread(&hdr->qptn[2], 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "qptn[2] = '%g'\n", hdr->qptn[2]);
-
-  for (i = 0; i < 3; ++i) {
-    bc += binread(&hdr->rprimd[i][0], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "rprimd[%d][0] = '%g'\n", i, hdr->rprimd[i][0]);
-    bc += binread(&hdr->rprimd[i][1], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "rprimd[%d][1] = '%g'\n", i, hdr->rprimd[i][1]);
-    bc += binread(&hdr->rprimd[i][2], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "rprimd[%d][2] = '%g'\n", i, hdr->rprimd[i][2]);
-  }
-
-  bc += binread(&hdr->stmbias, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "stmbias = '%g'\n", hdr->stmbias);
-
-  bc += binread(&hdr->tphysel, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "tphysel = '%g'\n", hdr->tphysel);
-
-  bc += binread(&hdr->tsmear, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "tsmear = '%g'\n", hdr->tsmear);
-
-  bc += binread(&hdr->usewvl, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "usewvl = '%d'\n", hdr->usewvl);
-
-  /* failsafe */
-  if (hdr->usewvl != 0 && hdr->usewvl != 1) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: usewvl = %d is wrong!",  hdr->usewvl);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  hdr->istwfk = (int *)malloc(sizeof(int) * hdr->nkpt);
-  hdr->nband  = (int *)malloc(sizeof(int) * hdr->nkpt * hdr->nsppol);
-  hdr->npwarr = (int *)malloc(sizeof(int) * hdr->nkpt);
-  hdr->so_psp = (int *)malloc(sizeof(int) * hdr->npsp);
-  hdr->symafm = (int *)malloc(sizeof(int) * hdr->nsym);
-  hdr->typat  = (int *)malloc(sizeof(int) * hdr->natom);
-
-  if (!hdr->istwfk || !hdr->nband || !hdr->npwarr || !hdr->so_psp || !hdr->symafm || !hdr->typat) {
-    abinit_header_free(hdr);
-    return NULL;
-  }
-  for (i = 0; i < 3; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      hdr->symrel[i][j] = (int *)malloc(sizeof(int) * hdr->nsym);
-      if (!hdr->symrel[i][j]) {abinit_header_free(hdr); return NULL;}
-    }
-  }
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    bc += binread(&hdr->istwfk[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "istwfk[%d] = '%d'\n", i, hdr->istwfk[i]);
-  }
-
-  for (i = 0; i < hdr->nkpt * hdr->nsppol; ++i) {
-    bc += binread(&hdr->nband[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "nband[%d] = '%d'\n", i, hdr->nband[i]);
-  }
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    bc += binread(&hdr->npwarr[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "npwarr[%d] = '%d'\n", i, hdr->npwarr[i]);
-  }
-
-  for (i = 0; i < hdr->npsp; ++i) {
-    bc += binread(&hdr->so_psp[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "so_psp[%d] = '%d'\n", i, hdr->so_psp[i]);
-  }
-
-  for (i = 0; i < hdr->nsym; ++i) {
-    bc += binread(&hdr->symafm[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "symafm[%d] = '%d'\n", i, hdr->symafm[i]);
-  }
-
-  for (i = 0; i < hdr->nsym; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      int k;     
-      for (k = 0; k < 3; ++k) {
-        bc += binread(&hdr->symrel[k][j][i], 4, fp, hdr->bintype);
-        if (debug) fprintf(stderr, "symrel[%d][%d][%2d]= '%2d'", k, j, i, hdr->symrel[k][j][i]);
-      }
-      if (debug) fprintf(stderr, "\n");
-    }
-    if (debug) fprintf(stderr, "\n");
-  }
-
-  for (i = 0; i < hdr->natom; ++i) {
-    bc += binread(&hdr->typat[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "typat[%d] = '%d'\n", i, hdr->typat[i]);
-  }
-
-  for (i = 0; i < 3; ++i) {
-    hdr->kpt[i] = (double *)malloc(sizeof(double) * hdr->nkpt);
-    hdr->tnons[i] = (double *)malloc(sizeof(double) * hdr->nsym);
-    if (!hdr->kpt[i] || !hdr->tnons[i]) {abinit_header_free(hdr); return NULL;}
-  }
-
-  hdr->occ = (double *)malloc(sizeof(double) * hdr->bantot);
-  hdr->znucltypat = (double *)malloc(sizeof(double) * hdr->ntypat);
-  hdr->wtk = (double *)malloc(sizeof(double) * hdr->nkpt);
-  if (!hdr->occ || !hdr->znucltypat || !hdr->wtk) {abinit_header_free(hdr); return NULL;}
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      bc += binread(&hdr->kpt[j][i], 8, fp, hdr->bintype);
-      if (debug) fprintf(stderr, "kpt[%d][%2d] = '%g'\n", j, i, hdr->kpt[j][i]);
-    }
-  }
-
-  for (i = 0; i < hdr->bantot; ++i) {
-    bc += binread(&hdr->occ[i], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "occ[%d] = '%g'\n", i, hdr->occ[i]);
-  }
-
-  for (i = 0; i < hdr->nsym; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      bc += binread(&hdr->tnons[j][i], 8, fp, hdr->bintype);
-      if (debug) fprintf(stderr, "tnons[%d][%2d] = '%g' ", j, i, hdr->tnons[j][i]);
-    }
-    if (debug) fprintf(stderr, "\n");
-  }
-
-  for (i = 0; i < hdr->ntypat; ++i) {
-    bc += binread(&hdr->znucltypat[i], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "znucltypat[%d] = '%g'\n", i, hdr->znucltypat[i]);
-  }
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    bc += binread(&hdr->wtk[i], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "wtk[%d] = '%g'\n", i, hdr->wtk[i]);
-  }
-
-  for (i = 0; i < hdr->npsp; ++i) {
-
-    /* skip the recordmarker bytes two times */
-    bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-    bc += fread(hdr->title, sizeof(char), 132, fp); hdr->title[132] = '\0';
-    if (debug) fprintf(stderr, "title = '%s'\n", hdr->title);
-
-    bc += binread(&hdr->znuclpsp, 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "znuclpsp = '%g'\n", hdr->znuclpsp);
-
-    bc += binread(&hdr->zionpsp, 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "zionpsp = '%g'\n", hdr->zionpsp);
-
-    bc += binread(&hdr->pspso, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspso = '%d'\n", hdr->pspso);
-
-    bc += binread(&hdr->pspdat, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspdat = '%d'\n", hdr->pspdat);
-
-    bc += binread(&hdr->pspcod, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspcod = '%d'\n", hdr->pspcod);
-
-    bc += binread(&hdr->pspxc, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspxc = '%d'\n", hdr->pspxc);
-
-    bc += binread(&hdr->lmn_size, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "lmn_size = '%d'\n", hdr->lmn_size);
-  }
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  for (i = 0; i < 3; ++i) {
-    hdr->xred[i] = (double *)malloc(sizeof(double) * hdr->natom);
-    if (!hdr->xred[i]) {abinit_header_free(hdr); return NULL;}
-  }
-
-  bc += binread(&hdr->residm, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "residm = '%g'\n", hdr->residm);
-
-  for (i = 0; i < hdr->natom; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      bc += binread(&hdr->xred[j][i], 8, fp, hdr->bintype);
-      if (debug) fprintf(stderr, "xred[%d][%d] = '%g'\n", j, i, hdr->xred[j][i]);
-
-      /* failsafe */
-      if (hdr->xred[j][i] < -1 || hdr->xred[j][i] > 1) {
-        fprintf(stderr, "Binary Header Error: hdr->xred[%d][%d] = %g; something must be wrong!", j, i, hdr->xred[j][i]);
-        {abinit_header_free(hdr); return NULL;}
-      }
-    }
-  }
-
-  bc += binread(&hdr->etotal, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "etotal = '%g'\n", hdr->etotal);
-
-  bc += binread(&hdr->fermie, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "fermie = '%g'\n", hdr->fermie);
-
-  if (hdr->usepaw == 1) {
-    struct pawrhoij_t {
-      int *nrhoijsel;
-      int **rhoijselect;
-      double **rhoij;
-    };
-    struct pawrhoij_t *pawrhoij = malloc(hdr->natom * sizeof(struct pawrhoij_t));
-
-    for (i = 0; i < hdr->natom; ++i) {
-      int j;
-      pawrhoij[i].nrhoijsel = (int *)malloc(sizeof(int) * hdr->nspden);
-      if (!pawrhoij[i].nrhoijsel) {abinit_header_free(hdr); return NULL;}
-      for (j = 0; j < hdr->nspden; ++j){
-        bc += binread(&pawrhoij[i].nrhoijsel[j], 4, fp, hdr->bintype);
-        if (debug) fprintf(stderr, "pawrhoij[%d].nrhoijsel[%d] = '%d'\n", i, j, pawrhoij[i].nrhoijsel[j]);
-      }
-      pawrhoij[i].rhoijselect = (int **)malloc(sizeof(int) * hdr->nspden);
-      pawrhoij[i].rhoij = (double **)malloc(sizeof(double) * hdr->nspden);
-      if (!pawrhoij[i].rhoijselect || !pawrhoij[i].rhoij) {abinit_header_free(hdr); return NULL;}
-      for (j = 0; j < hdr->nspden; ++j) {
-        int k;
-        pawrhoij[i].rhoijselect[j] = (int *)malloc(sizeof(int) * pawrhoij[i].nrhoijsel[j]);
-        pawrhoij[i].rhoij[j] = (double *)malloc(sizeof(double) * pawrhoij[i].nrhoijsel[j]);
-        if (!pawrhoij[i].rhoijselect[j]) {abinit_header_free(hdr); return NULL;}
-        for (k = 0; k < pawrhoij[i].nrhoijsel[j]; ++k) {
-          bc += binread(&pawrhoij[i].rhoijselect[j][k], 4, fp, hdr->bintype);
-	 if (debug) fprintf(stderr, "pawrhoij[%d].rhoijselect[%d][%d] = '%d'\n", i, j, k, pawrhoij[i].rhoijselect[j][k]);
-        }
-        for (k = 0; k < pawrhoij[i].nrhoijsel[j]; ++k) {
-          bc += binread(&pawrhoij[i].rhoij[j][k], 8, fp, hdr->bintype);
-	 if (debug) fprintf(stderr, "pawrhoij[%d].rhoij[%d][%d] = '%g'\n", i, j, k, pawrhoij[i].rhoij[j][k]);
-        }
-      }
-      for (j = 0; j < hdr->nspden; ++j) {
-        free(pawrhoij[i].rhoijselect[j]);
-        free(pawrhoij[i].rhoij[j]);
-      }
-      free(pawrhoij[i].rhoijselect);
-      free(pawrhoij[i].rhoij);
-      free(pawrhoij[i].nrhoijsel);
-    }
-    free(pawrhoij);
-  } /* end of "if (usepaw == 1)" */
-
-  /* cplex depends on other variables:
-   * In GS calculations, cplex = 1.
-   * In response function calculations (non-zero pertcase), cplex = 1 at the gamma point (qpt=(0,0,0))
-   * and cplex = 2 if qpt/=(0,0,0).
-   */
-  hdr->cplex = 1;
-  if (hdr->pertcase != 0 && fabs(hdr->qptn[0]) > 10e-6 && fabs(hdr->qptn[1]) > 10e-6 && fabs(hdr->qptn[2]) > 10e-6) hdr->cplex = 2;
-
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  if (debug) fprintf(stderr, "END OF BINARY FILE DEBUG INFO\n");
-
-  return hdr;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/avsplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/avsplugin.C
deleted file mode 100644
index d721b77b7ff69f0ee72b6f3721b533d72023a17e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/avsplugin.C
+++ /dev/null
@@ -1,579 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: avsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * AVS field files
- *
- * XXX - This plugin currently only supports the specific subset of AVS field
- * files that are produced by autodock. 'field' type must be 'uniform',
- * 'data' must be of type 'float', 'ndim' and 'nspace' must be 3, and
- * 'filetype' of all files referenced must be 'ascii'. 
- *
- * XXX - The plugin also expects the values to appear in a certain order,
- * this should definitely be fixed.
- *
- * More info for this format can be found at
- * <http://astronomy.swin.edu.au/~pbourke/geomformats/field/>
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 256
-
-typedef struct {
-  char filename[256]; /* XXX - LAME */
-  int filetype, skip, offset, stride;
-} datasource_t;
-
-typedef struct {
-  int nsets;
-  molfile_volumetric_t *vol;
-  datasource_t *data;
-} avsfield_t;
-
-enum {NONE, ASCII, BINARY, UNFORMATTED};  /* File types */
-enum {UNIFORM, IRREGULAR, RECTILINEAR};   /* Field types */
-enum {AVSFLOAT};                          /* Data types */
-
-/* Reads lines from the stream into the array pointed to by s.
- * Returns a pointer to s when the first non-comment line is read or NULL on
- * error.
- */
-static char *get_string(char *s, int n, FILE *stream) {
-  do {
-    if (fgets(s, n, stream) == NULL) {
-      fprintf(stderr, "avsplugin) Error reading string.\n");
-      return NULL;
-    }
-  } while (s[0] == '#');
-  return s;
-}
-
-/* Read information from a string and store it into a datasource structure.
- * Returns 0 on success, 1 on error.
- */
-static int read_datasource(char *s, datasource_t *data) {
-  char *src, *tok, *value;
-  src = strdup(s);
-  tok = strtok(src, " \t\n");
-
-  /* Load default values -- used if these attributes aren't set */
-  data->skip = 0;
-  data->offset = 0;
-  data->stride = 1;
-
-  /* Load default values -- must be changed */
-  data->filename[0] = '\0';
-  data->filetype = NONE;
-
-  /* The first word should be "coord" or "variable" */
-  if ( (strcasecmp(tok, "coord") != 0) && (strcasecmp(tok, "variable") != 0) ) {
-    fprintf(stderr, "avsplugin) Improperly formatted header: expected coord or variable.\n");
-    free(src);
-    return 1;
-  }
-
-  /* Next should be the integer ID of the data source */
-  tok = strtok(NULL, " \t\n");
-  if (!isdigit(*tok)) {
-    fprintf(stderr, "avsplugin) Improperly formatted header: expected ID.\n");
-    free(src);
-    return 1;
-  }
-
-  /* Now read the additional arguments */
-  tok = strtok(NULL, " \t\n");
-  while(tok) {
-    value = strchr(tok, '=');
-    if (!value) {
-      fprintf(stderr, "avsplugin) Error reading value.\n");
-      free(src);
-      return 1;
-    }
-    value++; /* Point to the first character after '=' */
-
-    if (strncasecmp(tok, "file=", value - tok) == 0) {
-      /* XXX - This should be changed to something safer */
-      strcpy(data->filename, value);
-    }
-    else if (strncasecmp(tok, "filetype=", value - tok) == 0) {
-      /* XXX - For now, only ascii files are recognized. Other possible
-       * values are "unformatted" for unformatted Fortran data, and "binary"
-       * for raw binary data.
-       */
-      if (strcasecmp(value, "ascii") == 0) {
-        data->filetype = ASCII;
-      }
-      else {
-        fprintf(stderr, "avsplugin) Non-ASCII files are not supported.\n");
-        free(src);
-        return 1;
-      }
-    }
-    else if (strncasecmp(tok, "skip=", value - tok) == 0) {
-      /* XXX - This should probably be more rigorous */
-      data->skip = atoi(value);
-    }
-    else if (strncasecmp(tok, "offset=", value - tok) == 0) {
-      /* XXX - This should probably be more rigorous */
-      data->offset = atoi(value);
-    }
-    else if (strncasecmp(tok, "stride=", value - tok) == 0) {
-      /* XXX - This should definitely be more rigorous -- we don't want
-       * stride set to 0 of the value isn't an integer. */
-      data->stride = atoi(value);
-    }
-    else {
-      /* XXX - For now, return with an error if there's an unrecognized
-       * argument. This should probably be changed.
-       */
-      fprintf(stderr, "avsplugin) Unrecognized argument.\n");
-      free(src);
-      return 1;
-    }
-
-    tok = strtok(NULL, " \t\n");
-  }
-
-  free(src);
-
-  /* Make sure the filename and filetype have been set */
-  if ((data->filename[0] == '\0') || (data->filetype == NONE)) {
-    fprintf(stderr, "avsplugin) Filename not set in options.\n");
-    return 1;
-  }
-  
-  return 0;
-}
-
-static void *open_avsfield_read(const char *filepath, const char *filetype, int *natoms) {
-  avsfield_t *avsfield;
-  FILE *fd;
-  char inbuf[LINESIZE], current_file[256];
-  int ndim, nspace, veclen, xsize, ysize, zsize, 
-      index, i, coord_count, var_count;
-  float value, origin[3], gridlength[3];
-  datasource_t *coord = NULL, *variable = NULL;
-
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "avsplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Check for an AVS file */
-  if (fgets(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    fprintf(stderr, "avsplugin) Error reading line.\n");
-    return NULL;
-  }
-  if (strncmp(inbuf, "# AVS", 5) != 0) {
-    fclose(fd);
-    fprintf(stderr, "avsplugin) Improperly formatted header.\n");
-    return NULL;
-  }
-
-  /* Check the number of dimensions */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "ndim=%d", &ndim) != 1) {
-    fprintf(stderr, "avsplugin) Error reading ndim.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (ndim != 3) {
-    fprintf(stderr, "avsplugin) Error: ndim must be 3.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Find the size of the grid in grid units */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "dim1=%d", &xsize) != 1) {
-    fprintf(stderr, "avsplugin) Error reading dim1.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "dim2=%d", &ysize) != 1) {
-    fprintf(stderr, "avsplugin) Error reading dim2.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "dim3=%d", &zsize) != 1) {
-    fprintf(stderr, "avsplugin) Error reading dim3.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Check the number of coordinates per point */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "nspace=%d", &nspace) != 1) {
-    fprintf(stderr, "avsplugin) Error reading nspace.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (nspace != 3) {
-    fprintf(stderr, "avsplugin) Error: nspace must be 3.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Find out how many values are stored for each point (the length of the
-   * vector for the vector field) */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "veclen=%d", &veclen) != 1) {
-    fprintf(stderr, "avsplugin) Error reading veclen.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Check that the data type is "float" */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (strncmp(inbuf, "data=float", 10) != 0) {
-    fprintf(stderr, "avsplugin) Error reading data type.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Check that the field type is "uniform" */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (strncmp(inbuf, "field=uniform", 13) != 0) {
-    fprintf(stderr, "avsplugin) Error reading field type.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Allocate space for the coordinate and variable information 
-   * coord is deleted in this fuction, variable is deleted when the plugin
-   * is closed.
-   */
-  coord = new datasource_t[ndim];
-  variable = new datasource_t[veclen];
-
-  /* Find the coordinate information */
-  for (i = 0; i < ndim; i++) {
-    if (get_string(inbuf, LINESIZE, fd) == NULL) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if ( (sscanf(inbuf, "coord %d", &coord_count) != 1) || (coord_count != i+1) ) {
-    fprintf(stderr, "avsplugin) Error reading coord count.\n");
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if (read_datasource(inbuf, &coord[i])) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-  }
-
-  /* XXX - Ignore the labels (should be used for vol dataname) */
-  for (i = 0; i < veclen; i++) {
-    if (get_string(inbuf, LINESIZE, fd) == NULL) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-  }
-  
-  /* Find the variable information */
-  for (i = 0; i < veclen; i++) {
-    if (get_string(inbuf, LINESIZE, fd) == NULL) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if ( (sscanf(inbuf, "variable %d", &var_count) != 1) || (var_count != i+1) ) {
-      fprintf(stderr, "avsplugin) Error reading variable count.\n");
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if (read_datasource(inbuf, &variable[i])) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-  }
-
-  /* Close the AVS file */
-  fclose(fd);
-  fd = NULL;
-
-  /* Read the coordinate file(s) to find the origin and grid size 
-   * XXX - this only works for "uniform" fields
-   */
-  for (i = 0; i < ndim; i++) {
-    if (strcmp(current_file, coord[i].filename) != 0) {
-      /* Close the old file if one was open, and open a new one */
-      if (fd) {
-        fclose(fd);
-        fd = NULL;
-      }
-      strcpy(current_file, coord[i].filename); /* XXX - unsafe */
-      fd = fopen(current_file, "rb");
-      if (!fd) {
-        fprintf(stderr, "avsplugin) Error opening file.\n");
-        delete[] coord;
-        return NULL;
-      }
-    }
-    else {
-      /* Return to the beginning of the file */
-      rewind(fd);
-    }
-
-    /* Skip the "skip" lines */
-    for (index = 0; index < coord[i].skip; index++) {
-      if (fgets(inbuf, LINESIZE, fd) == NULL) {
-        fprintf(stderr, "avsplugin) Error reading line.\n");
-        fclose(fd);
-        delete[] coord;
-        return NULL;
-      }
-    }
-
-    /* Skip the "offset" values */
-    for (index = 0; index < coord[i].offset; index++) {
-      if (fscanf(fd, " %f", &value) != 1) {
-        fprintf(stderr, "avsplugin) Error skipping offset.\n");
-        fclose(fd);
-        delete[] coord;
-        return NULL;
-      }
-    }
-
-    /* Read the origin, skip "stride" values, and read the end */
-    if (fscanf(fd, " %f", &value) != 1) {
-      fprintf(stderr, "avsplugin) Error reading origin.\n");
-      fclose(fd);
-      delete[] coord;
-      return NULL;
-    }
-    origin[i] = value;
-    for (index = 0; index < coord[i].stride; index++) {
-      if (fscanf(fd, " %f", &value) != 1) {
-        fprintf(stderr, "avsplugin) Error skipping stride.\n");
-        fclose(fd);
-        delete[] coord;
-        return NULL;
-      }
-    }
-    gridlength[i] = value - origin[i];
-  }
-
-  /* Free the coordinates */
-  delete[] coord;
-  coord = NULL;
-  fclose(fd);
-
-  /* Allocate and initialize the avsfield structure */
-  avsfield = new avsfield_t;
-  avsfield->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-
-  /* AVS field files can have an arbitrary number of sets */
-  avsfield->nsets = veclen;
-  avsfield->vol = new molfile_volumetric_t[veclen];
-  avsfield->data = variable;
-
-  for (i = 0; i < veclen; i++) {
-    /* strcpy(avsfield->vol[i].dataname, "AVS Field: "); */
-    sprintf(avsfield->vol[i].dataname, "AVS Field: %d", i);
-
-    avsfield->vol[i].origin[0] = origin[0];
-    avsfield->vol[i].origin[1] = origin[1];
-    avsfield->vol[i].origin[2] = origin[2];
-
-    avsfield->vol[i].xaxis[0] = gridlength[0];
-    avsfield->vol[i].xaxis[1] = 0;
-    avsfield->vol[i].xaxis[2] = 0;
-
-    avsfield->vol[i].yaxis[0] = 0;
-    avsfield->vol[i].yaxis[1] = gridlength[1];
-    avsfield->vol[i].yaxis[2] = 0;
-
-    avsfield->vol[i].zaxis[0] = 0;
-    avsfield->vol[i].zaxis[1] = 0;
-    avsfield->vol[i].zaxis[2] = gridlength[2];
-
-    avsfield->vol[i].xsize = xsize;
-    avsfield->vol[i].ysize = ysize;
-    avsfield->vol[i].zsize = zsize;
-
-    avsfield->vol[i].has_color = 0;
-  }
-
-  return avsfield;
-}
-
-static int read_avsfield_metadata(void *v, int *nsets,
-  molfile_volumetric_t **metadata) {
-  avsfield_t *avsfield = (avsfield_t *)v;
-  *nsets = avsfield->nsets;
-  *metadata = avsfield->vol;
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_avsfield_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  avsfield_t *avsfield = (avsfield_t *)v;
-  int skip, offset, stride, count, ndata, index;
-  float value, *cellIndex = datablock;
-  char inbuf[LINESIZE];
-  FILE *fd;
-  
-  fd = fopen(avsfield->data[set].filename, "rb");
-  if (!fd) {
-    fprintf(stderr, "avsplugin) Error opening file.\n");
-    return MOLFILE_ERROR; 
-  }
-
-  skip = avsfield->data[set].skip;
-  offset = avsfield->data[set].offset;
-  stride = avsfield->data[set].stride;
-
-  count = 0;
-  ndata = avsfield->vol[0].xsize * avsfield->vol[0].ysize * avsfield->vol[0].zsize;
-
-  /* Skip the "skip" lines */
-  for (index = 0; index < skip; index++) {
-    if (fgets(inbuf, LINESIZE, fd) == NULL) {
-      fprintf(stderr, "avsplugin) Error skipping lines.\n");
-      fclose(fd);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* Skip the "offset" values */
-  for (index = 0; index < offset; index++) {
-    if (fscanf(fd, " %f", &value) != 1) {
-      fprintf(stderr, "avsplugin) Error skipping offset.\n");
-      fclose(fd);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  while (count < ndata) {
-    /* Read a value into the datablock and skip "stride" values */
-    if (fscanf(fd, " %f", &value) != 1) {
-      fprintf(stderr, "avsplugin) Error reading data.\n");
-      fclose(fd);
-      return MOLFILE_ERROR;
-    }
-    *cellIndex = value;
-    cellIndex++;
-    count++;
-
-    for (index = 0; index < stride-1; index++) {
-      if (fscanf(fd, " %f", &value) != 1) {
-        fprintf(stderr, "avsplugin) Error skipping stride.\n");
-        fclose(fd);
-        return MOLFILE_ERROR;
-      }
-    }
-  }
-
-  fclose(fd);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_avsfield_read(void *v) {
-  avsfield_t *avsfield = (avsfield_t *)v;
-
-  if (avsfield->vol != NULL)
-    delete [] avsfield->vol;
-  if (avsfield->data != NULL)
-    delete [] avsfield->data;
-  delete avsfield;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(plugin));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "fld";
-  plugin.prettyname = "AVS Field";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "fld";
-  plugin.open_file_read = open_avsfield_read;
-  plugin.read_volumetric_metadata = read_avsfield_metadata;
-  plugin.read_volumetric_data = read_avsfield_data;
-  plugin.close_file_read = close_avsfield_read;
-
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/babelplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/babelplugin.c
deleted file mode 100644
index 9b85529e9194f5e87a3ee4fa9fa26f94fb69a737..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/babelplugin.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: babelplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.49 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * Convert files using Babel 1.6
- *   http://www.eyesopen.com/products/applications/babel.html
- *
- * Convert files using Open Babel 1.100.2
- *   http://openbabel.sourceforge.net/babel.shtml
- */
-
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#if !defined(_MSC_VER) 
-#include <unistd.h>  /* for getuid */
-#endif
-
-#include "molfile_plugin.h"
-#include "readpdb.h"
-#include "vmddir.h"
-#include "periodic_table.h"
-
-typedef struct {
-  FILE *fd;
-  int natoms;
-  char *original_file;
-  char *current_file;
-  int babel_num;
-  int babel_i;
-} pdbdata;
-
-/* 
- * I guess this is to try to keep tmp files from clobbering each other
- */
-static int vmd_getuid(void) {
-#if defined(_MSC_VER)
-  return 0;
-#else
-  return getuid();
-#endif
-}
-
-static int vmd_delete_file(const char * path) {
-#if defined(_MSC_VER)
-  if (DeleteFile(path) == 0)
-    return -1;
-  else
-    return 0;
-#else
-  return unlink(path);
-#endif
-}
-
-#define BABEL_TMPDIR "/tmp/"
-
-/*
- * Dude, don't even think for a minute that I came up with this code.  It's
- * copied from BabelConvert.C, ok?
- * This gets called three times, with has_multi = 1, -2, and -1.  Don't ask
- * me why.
- */
-static char *file(const char *filename, int idx, int has_multi) {
-   /* temp space to save the filename or glob */
-   int i=0;
-   char *ptr;
-   char *tempspace = (char *)malloc(513);
-   const char *s;
-   for (s = filename; *s != 0; s++) { 
-      if ((*s == '/') || (*s == '\\'))
-        i = s-filename+1;
-   }
-   /*
-   // so filename+i points to the actual name
-   // if there are multiple files in the conversion, then the output
-   // looks like "test0041.extensions".  If there was a single file,
-   // the output looks like "test.extensions"
-   */
-   if (has_multi == -1) {
-      sprintf(tempspace, "%svmdbabel*.u%d.%s", BABEL_TMPDIR,
-              vmd_getuid(), filename + i);
-   } else if (has_multi == -2) {
-      char *reallytemp = (char *)malloc(strlen(filename+i)+1);
-      strcpy(reallytemp, filename+i);
-      *(reallytemp + strlen(reallytemp) - 1) = 0;
-      sprintf(tempspace, "vmdbabel%%[0-9.]u%d.%s%%c",
-              vmd_getuid(), reallytemp);
-      free(reallytemp);
-   } else if (has_multi == 0) {
-      sprintf(tempspace, "%svmdbabel.u%d.%s", BABEL_TMPDIR,
-              vmd_getuid(), filename + i);
-   } else {
-      sprintf(tempspace, "%svmdbabel%04d.u%d.%s", BABEL_TMPDIR, idx+1,
-              vmd_getuid(), filename + i);
-   }
-   for (ptr = tempspace; *ptr; ptr++) {  /* babel makes them lowercase! */
-      *ptr = tolower(*ptr);              /* grrrrrrr                    */
-   }
-   return tempspace;
-}
-
-static void delete_all(const char *filename) {
-  const char *s;
-  char *t;
-
-  s = file(filename, 0, -1); /* puts a '*' in number field */
-  t = (char *)malloc(strlen(s) + 35);
-#if defined(_MSC_VER)
-   sprintf(t, "del %s", s);
-#else
-   sprintf(t, "/bin/rm -f \"%s\"", s);
-#endif
-  system(t);
-  free(t);
-}
- 
-static void *open_pdb_read(const char *filepath, int *natoms) {
-  FILE *fd;
-  pdbdata *pdb;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx;
-  fd = fopen(filepath, "r");
-  if (!fd) return NULL;
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->fd = fd;
-  *natoms = 0;
-  do {
-    if((indx = read_pdb_record(pdb->fd, pdbstr)) == PDB_ATOM)
-      *natoms += 1;
-  } while (indx != PDB_END && indx != PDB_EOF);
-  rewind(pdb->fd);
-  pdb->natoms = *natoms;
-  return pdb;
-}
-
-/*
- * Babel 1.6 internal file type names
- */
-static const char *babel16filetypes[] = {
-"alc",
-"prep",
-"bs",
-"bgf",
-"car",
-"boog",
-"caccrt",
-"cadpac",
-"charmm",
-"c3d1",
-"c3d2",
-"cssr",
-"fdat",
-"gstat",
-"dock",
-"dpdb",
-"feat",
-"fract",
-"gamout",
-"gzmat",
-"gauout",
-"g94",
-"gr96A",
-"gr96N",
-"hin",
-"sdf",
-"m3d",
-"macmol",
-"macmod",
-"micro",
-"mm2in",
-"mm2out",
-"mm3",
-"mmads",
-"mdl",
-"molen",
-"mopcrt",
-"mopint",
-"mopout",
-"pcmod",
-"psin",
-"psout",
-"msf",
-"schakal",
-"shelx",
-"smiles",
-"spar",
-"semi",
-"spmm",
-"mol",
-"mol2",
-"wiz",
-"unixyz",
-"xyz",  
-"xed",
-0
-};
-
-/*
- * Plugin names registered in VMD for each Babel 1.6 file type
- */
-static const char *babel16filetypenames[] = {
-  "Alchemy",          "AMBERPREP",       "BallStick",      
-  "MSIBGF",           "BiosymCAR",       "Boogie",
-  "Cacao",            "CADPAC",          "CHARMm",
-  "Chem3d-1",         "Chem3d-2",        "CSSR",
-  "FDAT",             "GSTAT",           "Dock",
-  "DockPDB",          "Feature",         "Fractional",    
-  "GAMESSoutput",     "GaussianZmatrix", "Gaussian92output", 
-  "Gaussian94output", "Gromos96A",       "Gromos96N",
-  "HyperchemHIN",     "IsisSDF",         "M3D",
-  "MacMolecule",      "Macromodel",      "MicroWorld",
-  "MM2Input",         "MM2Output",       "MM3",
-  "MMADS",            "MDLMOL",          "MOLIN",
-  "MopacCartesian",   "MopacInternal",   "MopacOutput",
-  "PCModel",          "PSGVBin",         "PSGVBout",
-  "QuantaMSF",        "Schakal",         "ShelX",
-  "SMILES",
-  "Spartan",          "SpartanSE",       "SpartanMM",
-  "SybylMol",         "SybylMol2",       "Conjure",
-  "UniChemXYZ",       "XYZ",             "XED", 
-  0
-};
-
-
-/*
- * Open Babel 1.100.2 internal file type names
- */
-static const char *openbabel11filetypes[] = {
-"alc",
-"prep",
-"bs",
-"caccrt",
-"ccc",
-"c3d1",
-"c3d2",
-"cml",
-"crk2d",
-"crk3d",
-"box",
-"dmol",
-"feat",
-"gam",
-"gpr",
-"mm1gp",
-"qm1gp",
-"hin",
-"jout",
-"bin",
-"mmd",
-"car",
-"sdf",
-"mol",
-"mopcrt",
-"mopout",
-"mmads",
-"mpqc",
-"bgf",
-"nwo",
-"pqs",
-"qcout",
-"res",
-"smi",
-"mol2",
-"unixyz",
-"vmol",
-"xyz",
-0
-};
-
-/*
- * Plugin names registered in VMD for each Open Babel 1.100.2 file type
- */
-static const char *openbabel11filetypenames[] = {
-  "Alchemy",          "AMBERPREP",       "BallStick",      
-  "Cacao",            "CCC",           
-  "Chem3d-1",         "Chem3d-2",        "ChemicalMarkup"
-  "CRK2D",            "CRK3D",           "Dock35Box",
-  "Dmol3Coord",       "Feature",         "GAMESSoutput",     
-  "GhemicalProj",     "GhemicalMM",      "GhemicalQM",
-  "HyperchemHIN",     "JaguarOutput",    "OpenEyeBinary",
-  "Macromodel",       "BiosymCAR",       "IsisSDF",
-  "MDLMOL",           "MopacCartesian",  "MopacOutput",     
-  "MMADS",            "MPQC",            "MSIBGF",  
-  "NWChemOutput",     "PQS",             "QChemOutput",
-  "ShelX",            "SMILES",          "SybylMol2",   
-  "UniChemXYZ",       "ViewMol",         "XYZ",
-  0
-};
-
-
-static const char *babel16type_from_name(const char *name) {
-  const char **ptr = babel16filetypenames;
-  int i=0; 
-  while (*ptr) {
-    if (!strcmp(*ptr, name))
-      return babel16filetypes[i];
-    ptr++;
-    i++;
-  }
-  return NULL;
-}
-
-static const char *openbabel11type_from_name(const char *name) {
-  const char **ptr = openbabel11filetypenames;
-  int i=0; 
-  while (*ptr) {
-    if (!strcmp(*ptr, name))
-      return openbabel11filetypes[i];
-    ptr++;
-    i++;
-  }
-  return NULL;
-}
-
-
-/* 
- * Figure out the file type, call babel, and return a handle if successful.
- * From this point we're just reading in a pdb file.
- */
-static void *open_babel_read(const char *filename, const char *filetypename,
-    int *natoms) {
-
-  const char *babelbin;
-  char *current_file;
-  pdbdata *pdb;
-  char *s;
-  const char *fmt;
-  int count = 0;
-  VMDDIR *dirp;
-  char *dp;
-  char temps[100];
-  char tempc;
-  char lastc;
-  int may_have_multi = 0;
-  char *tmp_multi = NULL;
-  const char *filetype;
-
-  babelbin = getenv("VMDBABELBIN");
-  if (!babelbin) {
-    fprintf(stderr, "Babel plugin needs VMDBABELBIN environment variable\n"
-                    "to point to location of Babel executable\n");
-    return NULL;
-  }
-
-#if 0
-  /* Try Open Babel file type names first... */ 
-  filetype = openbabel11type_from_name(filetypename);
-  if (!filetype) {
-    fprintf(stderr, "No Open Babel 1.100.2 file type for '%s'\n", filetypename);
-  }
-#endif
-
-  /* Try Babel 1.6 file type names if Open Babel didn't match */ 
-  filetype = babel16type_from_name(filetypename);
-  if (!filetype) {
-    fprintf(stderr, "No Babel 1.6 file type for '%s'\n", filetypename);
-    return NULL;
-  }
-  s = (char *)malloc(strlen(babelbin) +               
-              strlen(" -i       -opdb ") +
-              strlen(filename) +
-              strlen(file(filename, 0, 1)) +
-              20);
- 
-  /*
-  // On windows its necessary to quote command names due to
-  // the high tendency for paths to have spaces in them.
-  */
-  sprintf(s, "\"%s\" -i%s \"%s\" all -opdb \"%s\"",
-     babelbin, filetype, filename, (const char *)file(filename, 0, 0));
-
-  delete_all(filename);       /* delete any conflicting existing files  */
-  system(s);                  /* run the babel command                  */
-  free(s);
-
-  /* now find how many frames were printed */
-  fmt = file(filename, 0, -2);
-  dirp = vmd_opendir(BABEL_TMPDIR);
-  if (dirp == NULL) {
-    return NULL; /* failure */
-  }
- 
-   lastc = *(filename + strlen(filename) -1);
-
-   while ((dp = vmd_readdir(dirp)) != NULL) {
-      if (sscanf(dp, fmt, temps, &tempc) > 1 && lastc == tempc) {
-     count++;
-     /* check if there is 1 element but Babel thinks there are several */
-     if (count == 1) {
-        if (strstr(dp, "0001.")) {
-           may_have_multi = 1;
-           tmp_multi = strdup(dp);
-        }
-     }
-      }
-   }
-   vmd_closedir(dirp);
-
-   if (may_have_multi && count == 1) {
-      /* then move the test0001.extension file to test.extension */
-      char *s2, *t2;
-      s2 = (char *)malloc(2*(strlen(tmp_multi)+strlen(BABEL_TMPDIR))+40);
-
-#if defined(_MSC_VER)
-      sprintf(s2, "move \"%s\\%s\" \"%s\\\"", BABEL_TMPDIR, tmp_multi, BABEL_TMPDIR);
-#else
-      sprintf(s2, "mv \"%s/%s\" \"%s/\"", BABEL_TMPDIR, tmp_multi, BABEL_TMPDIR);
-#endif
-
-      t2 = strstr(tmp_multi, "0001.");
-      *t2 = 0;
-      strcat(s2, tmp_multi);
-      strcat(s2, t2 + 4);
-      fprintf(stderr, "%s\n", s2);
-      system(s2);
-      free(s2);
-   }
-
-   if (tmp_multi) {
-      free(tmp_multi);
-   }
-
-  /*
-   * Ok, now that we're done with all that crap, we should have a bunch
-   * of temp files.  Now we need to open the first one to get the
-   * number of atoms.
-   */
-  if (count == 0) {
-    fprintf(stderr, "Babel molecule file translation failed!\n");
-    return NULL;
-  }
-  current_file = file(filename, 0, count > 1);
-  pdb = open_pdb_read(current_file, natoms);
-  if (!pdb) {
-    fprintf(stderr, "Couldn't read structure from Babel pdb output\n");
-    free(current_file);
-    return NULL;
-  }
-  pdb->original_file = strdup(filename); 
-  pdb->current_file = current_file;
-  pdb->babel_num = count;
-  pdb->babel_i = 1;
-  return pdb;
-}
-
-static int read_pdb_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) {
-  pdbdata *pdb = (pdbdata *)mydata;
-  molfile_atom_t *atom;
-  char pdbrec[PDB_BUFFER_LENGTH];
-  int i, rectype, atomserial, pteidx;
-  char ridstr[8];
-  char elementsymbol[3];
-  int badptecount = 0;
-  long fpos = ftell(pdb->fd);
- 
-  *optflags = MOLFILE_INSERTION | MOLFILE_OCCUPANCY | MOLFILE_BFACTOR | 
-              MOLFILE_ALTLOC | MOLFILE_ATOMICNUMBER;
-
-  i = 0;
-  do {
-    rectype = read_pdb_record(pdb->fd, pdbrec);
-    switch (rectype) {
-    case PDB_ATOM:
-      atom = atoms+i;
-      get_pdb_fields(pdbrec, strlen(pdbrec), &atomserial,
-          atom->name, atom->resname, atom->chain, atom->segid, 
-          ridstr, atom->insertion, atom->altloc, elementsymbol,
-          NULL, NULL, NULL, &atom->occupancy, &atom->bfactor);
-      atom->resid = atoi(ridstr);
-
-      /* determine atomic number from the element symbol */
-      pteidx = get_pte_idx_from_string(elementsymbol);
-      atom->atomicnumber = pteidx;
-      if (pteidx != 0) {
-        atom->mass = get_pte_mass(pteidx);
-        atom->radius = get_pte_vdw_radius(pteidx);
-      } else {
-        badptecount++; /* unrecognized element */
-      }
-      strcpy(atom->type, atom->name);
-      i++;
-      break;
-    default:
-      break;
-    }
-  } while (rectype != PDB_END && rectype != PDB_EOF);
-
-  fseek(pdb->fd, fpos, SEEK_SET);
-
-  /* if all atoms are recognized, set the mass and radius flags too,  */
-  /* otherwise let VMD guess these for itself using it's own methods  */
-  if (badptecount == 0) {
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx, i;
-  float *x, *y, *z;
-  float occup[1], beta[1];
-  if (ts) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = 0;
-  }
-  i = 0;
-  if (!pdb->fd) 
-    return MOLFILE_ERROR;
-
-  /* Read the rest of the frames in the current fd.  If there aren't any
-   * more close it and go on to the next one.  If there aren't any more frames,
-   * return MOLFILE_ERROR (-1);
-   */
-  
-  while (i < pdb->natoms) {
-    indx = read_pdb_record(pdb->fd, pdbstr);
-    if(indx == PDB_ATOM) {
-      /* just get the coordinates, and store them */
-      if (ts) {
-        get_pdb_coordinates(pdbstr, x, y, z, occup, beta);
-        x += 3;
-        y += 3;
-        z += 3;
-        i++;
-      }
-    } else if (indx == PDB_CRYST1) {
-      if (ts) {
-        get_pdb_cryst1(pdbstr, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    } else if (indx == PDB_EOF) {
-      if (i == 0) {
-        /* Need to start a new frame, if possible */
-        fclose(pdb->fd);
-        pdb->fd = 0;
-        vmd_delete_file(pdb->current_file);
-        free(pdb->current_file);
-        pdb->current_file = 0;
-        pdb->babel_i++;
-        if (pdb->babel_i >= pdb->babel_num) 
-          return MOLFILE_ERROR; 
-        pdb->current_file = file(pdb->original_file, pdb->babel_i, pdb->babel_num > 1); 
-        pdb->fd = fopen(pdb->current_file, "r");
-        if (!pdb->fd) {
-          fprintf(stderr, 
-            "Couldn't read babel output file %s\n", pdb->current_file); 
-          free(pdb->current_file);
-          pdb->current_file = 0;
-          return MOLFILE_ERROR; 
-        } 
-      } else {
-        /* premature end */
-        fprintf(stderr, "PDB file %s contained too few atoms\n", pdb->current_file);
-        return MOLFILE_ERROR;
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS; 
-}
-
-/* 
- * Free the pdb handle, and delete all the babel temp files.
- */
-static void close_pdb_read(void *v) {
-  pdbdata *pdb = (pdbdata *)v;
-  if (!pdb) return;
-  if (pdb->fd) {
-    fclose(pdb->fd);
-    pdb->fd = 0;
-    vmd_delete_file(pdb->current_file);
-    free(pdb->current_file);
-  }
-  free(pdb);
-}
-
-
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t *plugins;
-static int nplugins;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-#if defined(_MSC_VER)
-  return VMDPLUGIN_SUCCESS;
-#else
-  /* register all Babel 1.6 conversion options */
-  const char **s = babel16filetypenames;
-  int i;
-  nplugins = 0;
-  while (*s) { nplugins++; s++; }
-  plugins = (molfile_plugin_t*)calloc(nplugins, sizeof(molfile_plugin_t));
-  for (i=0; i<nplugins; i++) {
-    plugins[i].abiversion = vmdplugin_ABIVERSION;         /* ABI version */
-    plugins[i].type = MOLFILE_CONVERTER_PLUGIN_TYPE;      /* type of plugin */
-    plugins[i].name = babel16filetypenames[i];            /* name of plugin */
-    plugins[i].prettyname = babel16filetypenames[i];      /* name of plugin */
-    plugins[i].author = "Justin Gullingsrud, John Stone"; /* author */
-    plugins[i].majorv = 1;                                /* major version */
-    plugins[i].minorv = 13;                               /* minor version */
-    plugins[i].is_reentrant = VMDPLUGIN_THREADUNSAFE;     /* is not reentrant */
-    plugins[i].filename_extension = babel16filetypes[i];  /* file extension */
-    plugins[i].open_file_read = open_babel_read;
-    plugins[i].read_structure = read_pdb_structure;
-    plugins[i].read_next_timestep = read_next_timestep;
-    plugins[i].close_file_read = close_pdb_read;
-  }
-
-#if 0
-  /* register all Open Babel 1.100.2 conversion options */
-  const char **s = openbabel11filetypenames;
-  int i;
-  nplugins = 0;
-  while (*s) { nplugins++; s++; }
-  plugins = (molfile_plugin_t*)calloc(nplugins, sizeof(molfile_plugin_t));
-  for (i=0; i<nplugins; i++) {
-    plugins[i].abiversion = vmdplugin_ABIVERSION;         /* ABI version */
-    plugins[i].type = MOLFILE_CONVERTER_PLUGIN_TYPE;      /* type of plugin */
-    plugins[i].shortname = openbabel11filetypenames[i];   /* name of plugin */
-    plugins[i].prettyname = openbabel11filetypenames[i];  /* name of plugin */
-    plugins[i].author = "Justin Gullingsrud, John Stone"; /* author */
-    plugins[i].majorv = 2;                                /* major version */
-    plugins[i].minorv = 12;                               /* minor version */
-    plugins[i].is_reentrant = VMDPLUGIN_THREADUNSAFE;     /* is not reentrant */
-    plugins[i].filename_extension = openbabel11filetypes[i];  /* file extension */
-    plugins[i].open_file_read = open_babel_read;
-    plugins[i].read_structure = read_pdb_structure;
-    plugins[i].read_next_timestep = read_next_timestep;
-    plugins[i].close_file_read = close_pdb_read;
-  }
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-#endif
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-#if defined(_MSC_VER)
-  return VMDPLUGIN_SUCCESS;
-#else
-  int i;
-  for (i=0; i<nplugins; i++) {
-    (*cb)(v, (vmdplugin_t *)(plugins+i));
-  }
-  return VMDPLUGIN_SUCCESS;
-#endif
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-#if defined(_MSC_VER)
-  return VMDPLUGIN_SUCCESS;
-#else
-  free(plugins);
-  nplugins = 0;
-  plugins = 0;
-  return VMDPLUGIN_SUCCESS;
-#endif
-}
-
-
-#ifdef TEST_BABEL_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_header_t header;
-  molfile_timestep_t timestep;
-  void *v;
-
-  while (--argc) {
-    ++argv;
-    v = open_babel_read(*argv, "xyz", &header);
-    if (!v) {
-      fprintf(stderr, "open_babel_read failed for file %s\n", *argv);
-      return 1;
-    }
-    timestep.coords = (float *)malloc(3*sizeof(float)*header.numatoms);
-    while (!read_next_timestep(v, &timestep));
-    close_pdb_read(v);
-  }
-  return 0;
-}
-
-
-#endif
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/basissetplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/basissetplugin.c
deleted file mode 100644
index 9b803a7613acc7f3cccbf38b917903f647c9a377..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/basissetplugin.c
+++ /dev/null
@@ -1,739 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: basissetplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* *******************************************************
- *
- *          B A S I S    S E T    P L U G I N 
- *
- * This plugin reads basis sets for quantum chemical
- * calculations. The basis set must be in the GAMESS format.
- * Such files can be downloaded for virtually any basis set
- * from the EMSL basis set exchange website:
- * https://bse.pnl.gov/bse/portal
- *
- * ********************************************************/
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-#include <math.h>
-
-#include "qmplugin.h"
-#include "unit_conversion.h"
- 
-#define ANGSTROM 0
-#define BOHR     1
-#define SPIN_ALPHA 0
-#define SPIN_BETA  1
-
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifdef GAMESS_DEBUG
-#define PRINTERR fprintf(stderr, "\n In file %s, line %d: \n %s \n \n", \
-                            __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-
-#define UNK_SHELL -666
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL -2
-#define SP_P_SHELL -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-
-#define FOUND   1
-#define STOPPED 2
-
-#define NUM_ELEMENTS 109
-
-/* Translation table for element to atomic numbers for element
- * names used Gamess format files from EMSL */
-static const char *elements[] = { 
-  "(unknown)", "HYDROGEN", "HELIUM", "LITHIUM", "BERYLLIUM", "BORON",
-  "CARBON", "NITROGEN", "OXYGEN", "FLUORINE", "NEON",
-  "SODIUM", "MAGNESIUM", "ALUMINUM", "SILICON", "PHOSPHOROUS",
-  "SULFUR", "CHLORINE", "ARGON", "POTASSIUM", "CALCIUM", "SCANDIUM",
-  "TITANIUM", "VANADIUM", "CHROMIUM", "MANGANESE", "IRON", "COBALT",
-  "NICKEL", "COPPER", "ZINC", "GALLIUM", "GERMANIUM", "ARSENIC",
-  "SELENIUM", "BROMINE", "KRYPTON",
-  "RUBIDIUM", "STRONTIUM", "YTTRIUM", "ZIRCONIUM", "NIOBIUM",
-  "MOLYBDENUM", "TECHNETIUM", "RUTHENIUM", "RHODIUM", "PALLADIUM",
-  "SILVER", "CADMIUM", "INDIUM", "TIN", "ANTIMONY", "TELLURIUM",
-  "IODINE", "XENON",
-  "CESIUM", "BARIUM", "LANTHANUM", "CER", "PRASEODYMIUM", "NEODYMIUM",
-  "PROMETIUM", "SAMARIUM", "EUROPIUM", "GADOLIUM", "TERBIUM",
-  "DYSPROSIUM", "HOLMIUM", "ERBIUM", "THULIUM", "YTTERBIUM", 
-  "LUTETIUM", "HAFNIUM", "TANTALUM", "TUNGSTEN", "RHENIUM", "OSMIUM",
-  "IRIDIUM", "PLATINUM", "GOLD", "MERCURY", "THALLIUM", "LEAD",
-  "BISMUTH", "POLONIUM", "ASTATINE", "RADON",
-  "FRANCIUM", "RADIUM", "ACTINIUM", "THORIUM", "PROTACTINIUM", 
-  "URANIUM", "NEPTUNIUM", "PLUTONIUM", "AMERICIUM", "CURIUM", 
-  "BERKELIUM", "CALIFORNIUM", "EINSTEINIUM", "FERMIUM", "MENDELEVIUM",
-  "NOBELIUM", "LAWRENCIUM", "RUTHERFORDIUM", "DUBNIUM", "SEABORGIUM",
-  "BOHRIUM", "HASSIUM", "MEITNERIUM"};
-
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-static void print_input_data(qmdata_t *);
-
-
-/* the function get_basis we also parse the basis function section to
- * determine the number of basis functions, contraction
- * coefficients. For Pople/Huzinga style basis sets
- * this numbers are in principle fixed, and could hence
- * be provided by the the plugin itself; however, the user might
- * define his own basis/contraction coeffients and hence reading
- * them from the input file seem to be somewhat more general. */
-static int get_basis (qmdata_t *);
-
-
-/* read all primitives for the current shell */
-static int read_shell_primitives(qmdata_t *, prim_t **prim,
-                                 char *shellsymm, int icoeff);
-
-/* convert shell type from char to int */
-static int shelltype_int(char type);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(qmdata_t *);
-
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the file and get the number
- * of atoms.
- *
- * *************************************************************/
-static void *open_basis_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  qmdata_t *data;
-
-  
-  /* open the input file */
-  fd = fopen(filename, "rb");
- 
-  if (!fd) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* allocate memory for main data structure */
-  data = (qmdata_t *)calloc(1,sizeof(qmdata_t));
-
-  /* make sure memory was allocated properly */
-  if (data == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  data->num_shells = 0;
-  data->num_basis_funcs = 0;
-  data->num_basis_atoms = 0;
-
-  /* initialize some of the character arrays */
-  memset(data->basis_string,0,sizeof(data->basis_string));
-
-  /* store file pointer in qmdata_t struct */
-  data->file = fd;
-
-  /* Read the basis set */
-  if (!get_basis(data)) return NULL; 
-
-
-  /* provide VMD with the proper number of atoms */
-  *natoms = 0;
-
-  /* Test print the parsed data in same format as logfile */
-  print_input_data(data);
-
-  return data;
-}
-
-
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_basis_metadata(void *mydata, 
-    molfile_qm_metadata_t *metadata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  metadata->ncart = 0;
-  metadata->nimag = 0;
-  metadata->nintcoords = 0;
-
-  metadata->have_sysinfo = 0;
-  metadata->have_carthessian = 0;
-  metadata->have_inthessian = 0;
-  metadata->have_normalmodes = 0;
-
-  /* orbital + basis set data */
-  metadata->num_basis_funcs = data->num_basis_funcs;
-  metadata->num_basis_atoms = data->num_basis_atoms;
-  metadata->num_shells      = data->num_shells;
-  metadata->wavef_size      = 0;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_basis_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i;
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-
-/*   strncpy(sys_data->basis_string, data->basis_string, */
-/*           sizeof(sys_data->basis_string)); */
-
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->num_basis_atoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-      basis_data->atomic_number[i] = data->atomicnum_per_basisatom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_types[i] = data->shell_types[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-
-/**********************************************************
- *
- * clean up when done and free all the memory do avoid
- * memory leaks
- *
- **********************************************************/
-static void close_basis_read(void *mydata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->basis);
-  free(data->shell_types);
-  free(data->atomicnum_per_basisatom);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->angular_momentum);
-  free(data->filepos_array);
-
-  if (data->basis_set) {
-    for(i=0; i<data->num_basis_atoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-#define TORF(x) (x ? "T" : "F")
-
-static void print_input_data(qmdata_t *data) {
-  int i, j, k;
-  int primcount=0;
-  int shellcount=0;
-
-/*   printf("\n"); */
-/*   printf("     BASIS OPTIONS\n"); */
-/*   printf("     -------------\n"); */
-/*   printf("%s\n", data->basis_string); */
-/*   printf("\n\n\n"); */
-  printf("\n");
-  printf("     ATOMIC BASIS SET\n");
-  printf("     ----------------\n");
-  printf(" THE CONTRACTED PRIMITIVE FUNCTIONS HAVE BEEN UNNORMALIZED\n");
-  printf(" THE CONTRACTED BASIS FUNCTIONS ARE NOW NORMALIZED TO UNITY\n");
-  printf("\n");
-  printf("  SHELL TYPE  PRIMITIVE        EXPONENT          CONTRACTION COEFFICIENT(S)\n");
-  printf("\n");
-
-  printf(" =================================================================\n");
-  for (i=0; i<data->num_basis_atoms; i++) {
-    printf("%-8d (%10s)\n\n", data->basis_set[i].atomicnum, data->basis_set[i].name);
-    printf("\n");
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j,
-               data->basis_set[i].shell[j].type,
-               primcount+1,
-               data->basis_set[i].shell[j].prim[k].exponent,
-               data->basis_set[i].shell[j].prim[k].contraction_coeff);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-  printf("\n");
-  printf(" TOTAL NUMBER OF BASIS SET SHELLS             =%5d\n", data->num_shells);
-  printf(" TOTAL NUMBER OF ATOMS                        =%5i\n", data->numatoms);
-  printf("\n");
-}
-
-
-
-
-/*******************************************************
- *
- * this function reads in the basis set data 
- *
- * ******************************************************/
-int get_basis(qmdata_t *data) {
-
-  char buffer[BUFSIZ];
-  char word[4][BUFSIZ];
-  int i = 0; 
-  int success = 0;
-  int numread, numshells;
-  shell_t *shell;
-  long filepos;
-
-  /* initialize buffers */
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-  
-  if (!pass_keyline(data->file, "$DATA", NULL))
-    printf("basissetplugin) No basis set found!\n");
-
-
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  data->basis_set = (basis_atom_t*)calloc(1, sizeof(basis_atom_t));
-
-
-  i = 0; /* basis atom counter */
-
-  do {
-    prim_t *prim = NULL;
-    char shelltype;
-    int numprim = 0;
-    int icoeff = 0;
-    filepos = ftell(data->file);
-    GET_LINE(buffer, data->file);
-      
-    /* Count the number of relevant words in the line. */
-    numread = sscanf(buffer,"%s %s %s %s",&word[0][0], &word[1][0],
-           &word[2][0], &word[3][0]);
-
-    if (!strcmp(&word[0][0], "$END")) break;
-
-    switch (numread) {
-      case 1:
-        /* Next atom */
-        if (i>0) {
-          data->basis_set = (basis_atom_t*)realloc(data->basis_set, (i+1)*sizeof(basis_atom_t));
-        }
-
-        strcpy(data->basis_set[i].name, &word[0][0]);
-
-
-        /* read the basis set for the current atom */
-        shell = (shell_t*)calloc(1, sizeof(shell_t)); 
-        numshells = 0;
-
-        do {
-          filepos = ftell(data->file);
-          numprim = read_shell_primitives(data, &prim, &shelltype, icoeff);
-
-          if (numprim>0) {
-            /* make sure we have eiter S, L, P, D, F or G shells */
-            if ( (shelltype!='S' && shelltype!='L' && shelltype!='P' && 
-                  shelltype!='D' && shelltype!='F' && shelltype!='G') ) {
-              printf("basissetplugin) WARNING ... %c shells are not supported \n", shelltype);
-            }
-            
-            /* create new shell */
-            if (numshells) {
-              shell = (shell_t*)realloc(shell, (numshells+1)*sizeof(shell_t));
-            }
-            shell[numshells].numprims = numprim;
-            shell[numshells].type = shelltype_int(shelltype);
-            shell[numshells].prim = prim;
-            data->num_basis_funcs += numprim;
-
-            /* We split L-shells into one S and one P-shell.
-             * I.e. for L-shells we have to go back read the shell again
-             * this time using the second contraction coefficients. */
-            if (shelltype=='L' && !icoeff) {
-              fseek(data->file, filepos, SEEK_SET);
-              icoeff++;
-            } else if (shelltype=='L' && icoeff) {
-              shell[numshells].type = SP_P_SHELL;
-              icoeff = 0;
-            }
-
-            numshells++;
-          }
-        } while (numprim);
-
-        /* store shells in atom */
-        data->basis_set[i].numshells = numshells;
-        data->basis_set[i].shell = shell;
-
-        /* store the total number of basis functions */
-        data->num_shells += numshells;
-        i++;
-
-        /* go back one line so that we can read the name of the
-         * next atom */
-        fseek(data->file, filepos, SEEK_SET);
-
-        break;
-
-    }
-
-  } while (!success);
-
-
-  printf("basissetplugin) Parsed %d uncontracted basis functions for %d atoms.\n",
-         data->num_basis_funcs, i);
-
-  data->num_basis_atoms = i;
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- *
- * Convert shell type from char to int.
- *
- ************************************************ */
-static int shelltype_int(char type) {
-  int shelltype;
-
-  switch (type) {
-    case 'L':
-      shelltype = SP_S_SHELL;
-      break;
-    case 'M':
-      shelltype = SP_P_SHELL;
-      break;
-    case 'S':
-      shelltype = S_SHELL;
-      break;
-    case 'P':
-      shelltype = P_SHELL;
-      break;
-    case 'D':
-      shelltype = D_SHELL;
-      break;
-    case 'F':
-      shelltype = F_SHELL;
-      break;
-    case 'G':
-      shelltype = G_SHELL;
-      break;
-    default:
-      shelltype = UNK_SHELL;
-      break;
-  }
-
-  return shelltype;
-}
-
-
-
-/******************************************************
- *
- * Populate the flat arrays containing the basis
- * set data.
- *
- ******************************************************/
-static int fill_basis_arrays(qmdata_t *data) {
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0;
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_types;
-  int *atomicnum_per_basisatom;
-
-  /* Count the total number of primitives which
-   * determines the size of the basis array. */
-  for(i=0; i<data->num_basis_atoms; i++) {
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      primcount += data->basis_set[i].shell[j].numprims;
-    }
-  }
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per basis function, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  basis = (float *)calloc(2*primcount,sizeof(float));
-
-  /* make sure memory was allocated properly */
-  if (basis == NULL) {
-    PRINTERR;
-    return MOLFILE_ERROR;
-  }
-
-  shell_types = (int *)calloc(data->num_shells, sizeof(int));
-  
-  /* make sure memory was allocated properly */
-  if (shell_types == NULL) {
-    PRINTERR; 
-    return MOLFILE_ERROR;
-  }
-
-  num_shells_per_atom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_shells_per_atom == NULL) {
-    PRINTERR; 
-    return MOLFILE_ERROR;
-  }
-
-  num_prim_per_shell = (int *)calloc(data->num_shells, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_prim_per_shell == NULL) {
-    PRINTERR;
-    return MOLFILE_ERROR;
-  }
-
-  atomicnum_per_basisatom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (atomicnum_per_basisatom == NULL) {
-    PRINTERR;
-    return MOLFILE_ERROR;
-  }
-
-
-  /* store pointers in struct qmdata_t */
-  data->basis = basis;
-  data->shell_types = shell_types;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell = num_prim_per_shell;
-  data->atomicnum_per_basisatom = atomicnum_per_basisatom;
-
-  primcount = 0;
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int j;
-    /* assign atomic number from element name */
-    data->basis_set[i].atomicnum = 0;
-    for (j=0; j<NUM_ELEMENTS; j++) {
-      if (!strcmp(elements[j], data->basis_set[i].name)) {
-        data->basis_set[i].atomicnum = j;
-        break;
-      }
-    }
-    atomicnum_per_basisatom[i] = data->basis_set[i].atomicnum;
-
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_types[shellcount] = data->basis_set[i].shell[j].type;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * read all primitives for the current shell
- *
- ******************************************************/
-static int read_shell_primitives(qmdata_t *data, prim_t **prim, char *shelltype,
-                                 int icoeff) {
-  char buffer[BUFSIZ];
-  float exponent = 0.0; 
-  float contract[2] = {0.0, 0.0};
-  int i, success;
-  int primcounter = 0, nprim = 0;;
-
-  GET_LINE(buffer, data->file);
-  success = sscanf(buffer,"%c %d", shelltype, &nprim);
-
-  (*prim) = (prim_t*)calloc(nprim, sizeof(prim_t));
-
-  for (i=0; i<nprim; i++) {
-    GET_LINE(buffer, data->file);
-    success = sscanf(buffer,"%*d %f %f %f",
-                       &exponent, &contract[0], &contract[1]); 
-
-    /* store in basis array and increase the counter */ 
-    switch (success) {
-      case 2:
-        /* store exponent */
-        (*prim)[i].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[i].contraction_coeff = contract[0];
-
-        primcounter++;
-        break;
-
-      case 3:
-        /* store exponent */
-        (*prim)[i].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[i].contraction_coeff = contract[icoeff];
-        
-        primcounter++;
-        break;
-
-      case -1:
-        /* otherwise it's an empty line which represents the end of the shell */
-        break;
-
-      case 1:
-        /* the user had given the next atom a numeric name */
-        break;
-    }
-
-  }
-
-  if (!primcounter) free(*prim);
-
-  return primcounter;
-}
-
-
-
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "basisset";
-  plugin.prettyname = "Basis Set";
-  plugin.author = "Jan Saam";
-  plugin.majorv = 0;
-  plugin.minorv = 1;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "basis";
-  plugin.open_file_read  = open_basis_read;
-  plugin.close_file_read = close_basis_read;
-  plugin.read_structure = NULL;
-
-  plugin.read_qm_metadata = read_basis_metadata;
-  plugin.read_qm_rundata  = read_basis_rundata;
-
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_timestep_metadata    = NULL;
-  plugin.read_qm_timestep_metadata = NULL;
-  plugin.read_timestep = NULL;
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/bgfplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/bgfplugin.C
deleted file mode 100644
index c4b2a730fe8bdadd78a015952256765ee514ed66..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/bgfplugin.C
+++ /dev/null
@@ -1,668 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: bgfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.29 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include "molfile_plugin.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-
-typedef struct {
-  FILE *file;
-  molfile_atom_t *atomlist;
-  int natoms, nbonds, optflags, coords_read;
-  int *from, *to;
-  float *bondorder;
-} bgfdata;
-
-// Open the file and create the bgf struct used to pass data to the other
-// functions.
-static void *open_bgf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  bgfdata *bgf;
-  char line[LINESIZE]; 
-  int nbonds, optflags;
-  int numat=0;
-  nbonds=0;
-  int nbline; //Number of bonds in current line
-
-  if ((fd = fopen(path, "r")) == NULL)
-    return NULL;
-
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      printf("bgfplugin) Improperly terminated bgf file\n");
-      return NULL;
-    }
-
-    if ((strncmp(line, "ATOM", 4) == 0) || (strncmp(line, "HETATM", 6)==0)) 
-      numat++;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      nbline=(strlen(line)-1)/6; 
-      nbline -= 2;
-      nbonds += nbline;
-    }
-
-  } while ( strncmp(line, "END", 3) );
-    
-  optflags = MOLFILE_INSERTION | MOLFILE_CHARGE; 
-  *natoms = numat;
-  rewind(fd);
-
-  // Allocate and initialize the bgf structure
-  bgf = (bgfdata *) malloc(sizeof(bgfdata));
-  memset(bgf, 0, sizeof(bgfdata));
-
-  bgf->file = fd;
-  bgf->natoms = *natoms;
-  bgf->nbonds = nbonds;
-
-  bgf->optflags = optflags;
-  bgf->coords_read = 0;
-  bgf->from = NULL;
-  bgf->to = NULL;
-  bgf->bondorder = NULL;
-
-  return bgf;
-}
-
-
-static void adjust_bgf_field_string(char *field) {
-  int i, len;
-
-  len = strlen(field);
-  while (len > 0 && field[len-1] == ' ') {
-    field[len-1] = '\0';
-    len--;
-  }
-
-  while (len > 0 && field[0] == ' ') {
-    for (i=0; i < len; i++)
-      field[i] = field[i+1];
-    len--;
-  }
-}
-
-
-static void get_bgf_coordinates(const char *record, 
-                                float *x, float *y, float *z) {
-  char numstr[50]; /* store all fields in one array to save memset calls */
-  memset(numstr, 0, sizeof(numstr));
-  if (x != NULL) {
-    strncpy(numstr, record + 31, 10);
-    *x = (float) atof(numstr);
-  }
-
-  if (y != NULL) {
-    strncpy(numstr+10, record + 41, 10);
-    *y = (float) atof(numstr+10);
-  }
-
-  if (z != NULL) {
-    strncpy(numstr+20, record + 51, 10);
-    *z = (float) atof(numstr+20);
-  }
-}
-
-
-static void get_bgf_fields(const char *record, char *name, char *resname, 
-                           char *chain, char* segname,
-                           int *resid, char *type, float *charge,
-                           float *x, float *y, float *z) {
-  char tempresid[6];
-  char tempcharge[9];
-
-  /* get atom name */
-  strncpy(name, record + 13, 5);
-  name[5] = '\0';
-  adjust_bgf_field_string(name); /* remove spaces from the name */
-
-  /* get residue name */
-  strncpy(resname, record + 19, 4);
-  resname[4] = '\0';
-  adjust_bgf_field_string(resname); /* remove spaces from the resname */
-
-  /* set segname */
-  segname[0]='\0';
-
-  /* get chain name */
-  chain[0] = record[23];
-  chain[1] = '\0';
-
-  /* get residue id number */
-  strncpy(tempresid, record + 26, 5);
-  tempresid[5] = '\0';
-  adjust_bgf_field_string(tempresid); /* remove spaces from the resid */
-  *resid=atoi(tempresid);
-
-  /* get force field type */
-  strncpy(type, record+61, 5);
-  type[5]='\0';
-  adjust_bgf_field_string(type);
-
-  /* get charge*/
-  strncpy(tempcharge, record + 72, 8);
-  tempcharge[8] = '\0';
-  adjust_bgf_field_string(tempcharge); /* remove spaces from the charge */
-  *charge=atof(tempcharge);
-
-  /* get x, y, and z coordinates */
-  get_bgf_coordinates(record, x, y, z);
-}  
-
-
-// Read atom information, but not coordinates.
-static int read_bgf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  bgfdata *bgf = (bgfdata *)v;
-  char line[LINESIZE]; 
-  molfile_atom_t *atom;
-  int natoms=0;
-
-  *optflags = bgf->optflags;
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) FORMAT ATOM record not found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) Error occurred reading atom record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(line, "ATOM", 4) && strncmp(line, "HETATM", 6)) 
-      continue;
-
-    atom=atoms+natoms;
-    natoms++;
-
-    get_bgf_fields(line, atom->name, atom->resname, atom->chain, 
-                   atom->segid, &atom->resid, atom->type, &atom->charge, 
-                   NULL, NULL, NULL);
-  } while (strncmp(line, "END", 3));
-
-  bgf->natoms = natoms;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-// Read atom coordinates
-static int read_bgf_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  bgfdata *bgf = (bgfdata *)v;
-  char line[LINESIZE];
-  int i;
-  float x, y, z;
-
-  // Since the file is rewound when coordinates are read, EOF shouldn't
-  // happen. Instead, use a flag to indicate that the single timestep has
-  // been read
-  if (bgf->coords_read) {
-    return MOLFILE_EOF;
-  }
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) No FORMAT ATOM record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  for (i = 0; i < bgf->natoms; i++) {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) Error occurred reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-    // skip comments and blank lines
-    if (strncmp(line,"ATOM",4)!=0 && strncmp(line,"HETATM",6)!=0) continue;
-
-    get_bgf_coordinates(line, &x, &y, &z);
-
-    if (ts) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-  bgf->coords_read = 1;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void *open_bgf_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  bgfdata *data;
-
-  if ((fd = fopen(filename, "w")) == NULL) {
-    printf("bgfplugin) Error: unable to open bgf file %s for writing\n", filename);
-    return NULL;
-  }
-  
-  data = (bgfdata *) malloc(sizeof(bgfdata));
-  memset(data, 0, sizeof(bgfdata));
-  data->natoms = natoms;
-  data->file = fd;
-  data->nbonds = 0;
-  return data;
-}
-
-
-static int write_bgf_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  bgfdata *data = (bgfdata *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->natoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->natoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-static void getatomfield(char* atomfield, const char* resname) {
-  if ((strncmp(resname,"ALA",3) == 0) || (strncmp(resname,"ASP",3) == 0) || (strncmp(resname,"ARG",3) == 0) || (strncmp(resname,"ASN",3) == 0) || (strncmp(resname,"CYS",3) == 0) || (strncmp(resname,"GLN",3) == 0) || (strncmp(resname,"GLU",3) == 0) || (strncmp(resname,"GLY",3) == 0) || (strncmp(resname,"HIS",3) == 0) || (strncmp(resname,"ILE",3) == 0) || (strncmp(resname,"LEU",3) == 0) || (strncmp(resname,"LYS",3) == 0) || (strncmp(resname,"MET",3) == 0) || (strncmp(resname,"PHE",3) == 0) || (strncmp(resname,"PRO",3) == 0) || (strncmp(resname,"SER",3) == 0) || (strncmp(resname,"THR",3) == 0) || (strncmp(resname,"TRP",3) == 0) || (strncmp(resname,"TYR",3) == 0) || (strncmp(resname,"VAL",3) == 0) || (strncmp(resname,"ADE",3) == 0) || (strncmp(resname,"THY",3) == 0) || (strncmp(resname,"GUA",3) == 0) || (strncmp(resname,"CYT",3) == 0) || (strncmp(resname,"URA",3) == 0) || (strncmp(resname,"HSD",3) == 0) || (strncmp(resname,"HSE",3) == 0) || (strncmp(resname,"HSP",3) == 0)) {
-    strncpy(atomfield, "ATOM  \0", 7);
-  } else {
-    strncpy(atomfield, "HETATM\0", 7);
-  }
-}
-      
-static int read_bgf_bonds_aux(void *v, int *nbonds, int **fromptr, int **toptr, float **bondorderptr) {
-  bgfdata *bgf = (bgfdata *)v;
-  char line[LINESIZE]; 
-  char nextline[LINESIZE]; 
-  if (bgf->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    return MOLFILE_SUCCESS;
-  }
-
-  // Find and read the BOND record
-  rewind(bgf->file);
-  do {
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) No bond record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-    fgets(line, LINESIZE, bgf->file);
-  } while ( strncmp(line, "FORMAT CONECT", 13) != 0 );
-
-  // Read the bonds
-  int j; //From atom
-  int k; //To atom
-  bool conline=false; //true if line after the conect line is an order line
-  char currbond[7]="xxxxxx"; //Stores current bond field
-  char currcon[7]="xxxxxx"; //Stores current ORDER field
-  char* bondptr; //pointer to current position in bond line
-  char* conptr; //pointer to current position in order line
-  int bonds[8]; //Stores bonds of current atom
-  float orders[8]; //Stores bond orders of current atom
-  int numbonds; //Stores number of bonds of current atom
-  int numords; //Stores number of bond order records of current atom
-  float bo; //current bond order
-  int i=0; //Number of the current bond
-  int numfields=0; //number of fields in the current line
-  fgets(line, LINESIZE, bgf->file);
-  while (1) {
-    // bondptr=NULL;
-    //conptr=NULL;
-    conline=false;
-
-    if (strncmp(line,"END", 3)==0) 
-      break;
-
-    fgets(nextline, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) Error occurred reading bond record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(nextline,"ORDER",5)==0) 
-      conline=true;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      numfields=(strlen(line)-1)/6;
-      bondptr=&line[0];
-      numfields--;
-      bondptr += 6;
-      numbonds=0;
-      numords=0;
-      strncpy(currbond,bondptr,6);
-      j=atoi(currbond);
-      printf("bond: %i\n", j);
-      numfields--;
-      bondptr += 6;
-
-      while ((numfields > 0) && (numbonds < 8)) {
-        strncpy(currbond,bondptr,6);
-        numfields--;
-        bondptr += 6;
-        bonds[numbonds]=atoi(currbond);
-        printf("bond: %i\n", bonds[numbonds]);
-        numbonds++;
-      }
-
-      if (conline) {
-        numfields=(strlen(line)-1)/6;
-        conptr=&nextline[0];
-        numfields -= 2;
-        conptr += 12;
-        numords=0;
-        while ((numfields > 0) && (numords < numbonds)) {
-          strncpy(currcon,conptr,6);
-          numfields--;
-          conptr+=6;
-          bo=atof(currcon);
-          orders[numords]=bo;
-          numords++;
-        }
-      }
-
-      for (int l=0;l<numbonds;l++) {
-        k=bonds[l];
-        if (j<k) {
-          bgf->from[i]=j;
-          bgf->to[i]=k;
-
-          if (conline) {
-            bgf->bondorder[i]=orders[l];
-          } else {
-            bgf->bondorder[i]=1.0;
-          }
-
-          i++;
-        }
-      }
-        
-      if (conline) {
-        fgets(line, LINESIZE, bgf->file);
-      } else {
-        strncpy(line,nextline,LINESIZE);
-      }
-    } else {
-      strncpy(line,nextline,LINESIZE);
-    }
-  }
-
-  *nbonds = i;
-  *fromptr = bgf->from;
-  *toptr = bgf->to;
-  *bondorderptr = bgf->bondorder; 
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_bgf_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                          float **bondorderptr, int **bondtype, 
-                          int *nbondtypes, char ***bondtypename) {
-  bgfdata *bgf = (bgfdata *)v;
-
-  *nbonds=bgf->nbonds;
-  if (bgf->nbonds > 0) {
-    bgf->from = (int *) malloc(*nbonds*sizeof(int));
-    bgf->to = (int *) malloc(*nbonds*sizeof(int));
-    bgf->bondorder = (float *) malloc(*nbonds*sizeof(float));
-
-    if ((read_bgf_bonds_aux(bgf, nbonds, &(bgf->from), &(bgf->to), &(bgf->bondorder))) != MOLFILE_SUCCESS) {
-      fclose(bgf->file);
-      bgf->file = NULL;
-      return MOLFILE_ERROR;
-    }
-
-    *fromptr = bgf->from;
-    *toptr = bgf->to;
-    *bondorderptr = bgf->bondorder; 
-  } else {
-    printf("bgfplugin) WARNING: no bonds defined in bgf file.\n");
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL;
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_bgf_timestep(void *mydata, const molfile_timestep_t *ts) {
-  bgfdata *data = (bgfdata *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-
-  //print header block
-  fprintf(data->file, "BIOGRF  332\n");
-  fprintf(data->file, "REMARK NATOM %4i\n", data->natoms);
-  fprintf(data->file, "FORCEFIELD DREIDING\n");
-  fprintf(data->file, "FORMAT ATOM   (a6,1x,i5,1x,a5,1x,a3,1x,a1,1x,a5,3f10.5,1x,a5,i3,i2,1x,f8.5,i2,i4,f10.5)\n");
-
-  atom = data->atomlist;
-  pos = ts->coords;
-  int numbonds=0;
-  int lp=0;
-  char atomfield[7];
-  for (i = 0; i < data->natoms; i++) {
-    getatomfield(&atomfield[0], atom->resname);
-    fprintf(data->file, "%-6s %5i %5s %3.3s %1s %5i%10.5f%10.5f%10.5f %-5s%3i%2i %8.5f%2i%4i\n", atomfield, i+1, atom->name, atom->resname, atom->chain, atom->resid, pos[0], pos[1], pos[2], atom->type, numbonds, lp, atom->charge, 0, 0);
-    ++atom; 
-    pos += 3;
-  }
-
-  //write the connectivity data
-  fprintf(data->file,"FORMAT CONECT (a6,14i6) \nFORMAT ORDER (a6,i6,13f6.3)\n");
-
-  //iterate through the bond arrays and write them all
-  int *bonds    =(int *)  malloc((data->natoms+1) * sizeof(int) * 6);
-  float *orders =(float *)malloc((data->natoms+1) * sizeof(float) * 6);
-  int *numcons  =(int *)  malloc((data->natoms+1) * sizeof(int));
-
-  for (i=0;i<data->natoms+1;i++) {
-    numcons[i]=0;
-  }
-
-  int j, k;         //indices for atoms being bonded
-  float o;          //bond order
-  bool printorder;  //flag to print bond orders
-  int l;            //dummy iterator in bond order loop
-  for (i=0;i<data->nbonds;i++) {
-    j=data->from[i];
-    k=data->to[i];
-
-    if (data->bondorder != NULL)
-      o=data->bondorder[i];
-    else
-      o=1.0f;
-
-    numcons[j]++;
-    numcons[k]++;
-    if (numcons[j]>6) {
-      printf("bgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[j]--;
-      numcons[k]--;
-      continue;
-    }
-       
-    if (numcons[k]>6) {
-      printf("bgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[k]--;
-      numcons[j]--;
-      continue;
-    }
-    bonds[6*j+numcons[j]-1]=k;
-    bonds[6*k+numcons[k]-1]=j;
-    orders[6*j+numcons[j]-1]=o;
-    orders[6*k+numcons[k]-1]=o;
-  }
-
-  for (i=1;i<=data->natoms;i++) {
-    fprintf(data->file,"CONECT%6i",i);
-    for (j=0;j<numcons[i];j++) {
-      fprintf(data->file,"%6i",bonds[6*i+j]);
-    }
-    fprintf(data->file,"\n");
-    printorder = false;
-    for (l=0;l<numcons[i];l++) {
-      if (orders[6*i+l] != 1.0) {
-        printorder = true;
-      }
-    }
-    if (printorder) {
-      fprintf(data->file,"ORDER %6i",i);
-      for (j=0;j<numcons[i];j++) {
-        fprintf(data->file,"%6i",int(orders[6*i+j]));
-      }
-      fprintf(data->file,"\n");
-    }
-  }
-
-  if (bonds != NULL) {
-    free(bonds);
-    bonds = NULL;
-  }
-  if (orders != NULL) {
-    free(orders);
-    orders = NULL;
-  }
-  if (numcons != NULL) {
-    free(numcons);
-    numcons = NULL;
-  }
-
-  fprintf(data->file,"END\n");
-  return MOLFILE_SUCCESS;
-}
-
-static int write_bgf_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                           float *bondorderptr,  int *bondtype, 
-                           int nbondtypes, char **bondtypename) {
-  bgfdata *data = (bgfdata *)v;
-  data->from = (int*) malloc(nbonds * sizeof(int));
-  data->to = (int*) malloc(nbonds * sizeof(int));
-
-  //set the pointers for use later
-  for (int i=0;i<nbonds;i++) {
-    data->from[i]=fromptr[i];
-    data->to[i]=toptr[i];
-  }
-
-  if (bondorderptr != NULL) {  
-    data->bondorder = (float*) malloc(nbonds * sizeof(float));
-    for (int i=0;i<nbonds;i++) {
-      data->bondorder[i]=bondorderptr[i];
-    }
-  }
-
-  data->nbonds = nbonds;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_bgf_write(void *mydata) {
-  bgfdata *data = (bgfdata *)mydata;
-  if (data) {
-    if (data->file != NULL) fclose(data->file);
-    data->file = NULL;
-    if (data->atomlist != NULL) free(data->atomlist);
-    data->atomlist = NULL;
-    if (data->from != NULL) free(data->from);
-    data->from = NULL;
-    if (data->to != NULL) free(data->to);
-    data->to = NULL;
-    if (data->bondorder != NULL) free(data->bondorder);
-    data->bondorder = NULL;
-    free(data);
-  }
-}
-
-//
-// Free the memory used by the bgf structure
-static void close_bgf_read(void *v) {
-  bgfdata *bgf = (bgfdata *)v;
-  if (bgf) {
-    if (bgf->file != NULL) fclose(bgf->file);
-    bgf->file = NULL;
-    if (bgf->from != NULL) free(bgf->from);
-    bgf->from = NULL;
-    if (bgf->to != NULL)   free(bgf->to);
-    bgf->to = NULL;
-    if (bgf->bondorder != NULL)   free(bgf->bondorder);
-    bgf->bondorder = NULL;
-    free(bgf);
-  }
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "bgf";
-  plugin.prettyname = "MSI Biograf Format";
-  plugin.author = "Peter Freddolino ";
-  plugin.majorv = 0;
-  plugin.minorv = 16;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "bgf";
-  plugin.open_file_read = open_bgf_read;
-  plugin.read_structure = read_bgf_structure;
-  plugin.read_bonds = read_bgf_bonds;
-  plugin.read_next_timestep = read_bgf_timestep;
-  plugin.close_file_read = close_bgf_read;
-  plugin.open_file_write = open_bgf_write;
-  plugin.write_structure = write_bgf_structure;
-  plugin.write_timestep = write_bgf_timestep;
-  plugin.close_file_write = close_bgf_write;
-  plugin.write_bonds = write_bgf_bonds;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *) &plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/binposplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/binposplugin.c
deleted file mode 100644
index 0aea70d2533cae9415894df8ea4c56984ab8d5a5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/binposplugin.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: binposplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.12 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-
-#include "molfile_plugin.h"
-
-#if INT_MAX == 2147483647
-  typedef int binpos_int32;
-#elif SHRT_MAX == 2147483647
-  typedef short binpos_int32;
-#elif LONG_MAX == 2147483647
-  typedef long binpos_int32;
-#endif
-
-typedef struct {
-  FILE *fd;
-  int numatoms;
-  int wrongendian;
-  float *xyz;
-} binposhandle;
-
-static void *open_binpos_read(const char *path, const char *filetype, 
-    int *natoms) {
-  binposhandle *binpos;
-  FILE *fd;
-  int er=0,point,igarb;
-  char lenbuf[4];
-  char tmpc;
-  char magicchar[5];
-
-  fd = fopen(path, "rb");
-  if (!fd) 
-   {
-    fprintf(stderr, "Could not open file '%s' for reading.\n", path);
-    return NULL;
-   }
-  binpos = (binposhandle *)malloc(sizeof(binposhandle));
-  memset(binpos, 0, sizeof(binposhandle));
-  fread(magicchar,sizeof(char),4,fd);
-  magicchar[4]= '\0' ;
-  if(strcmp(magicchar,"fxyz")!=0)
-   {
-    fprintf(stderr,"not a binpos amber coordinate file\n");
-    return NULL;
-   }
-  fprintf(stderr,"Proceeding to open amber7 binpos coordinate file\n");
-  fread(&igarb,sizeof(int),1,fd);
-  point=ftell(fd);
-
-/* Check for endianism here*/
-  if(igarb>1000000000)
-   {
-    fprintf(stderr, "File '%s' appears to be other-endian.\n", path);
-    binpos->wrongendian = 1;
-    memcpy(lenbuf, (const char *)&igarb, 4);
-    tmpc = lenbuf[0]; lenbuf[0] = lenbuf[3]; lenbuf[3] = tmpc;
-    tmpc = lenbuf[1]; lenbuf[1] = lenbuf[2]; lenbuf[2] = tmpc;
-    memcpy((char *)&igarb, lenbuf, 4);
-
-	if((fseek(fd, point, SEEK_SET))!=0)
-      {
-	  fprintf(stderr,"Endian correction failed. er=%d\n",er);
-      return NULL;	
-     }
-	fseek(fd, point, SEEK_SET);
-   }
-  binpos->fd = fd;
-  binpos->numatoms = igarb;
-  binpos->xyz = (float *)malloc(3 * binpos->numatoms * sizeof(float));
-
-  if (!binpos->xyz) {
-    fprintf(stderr, "Unable to allocate space for %d atoms.\n", binpos->numatoms);
-    fclose(fd);
-    free(binpos);
-    return NULL;
-  }
-  *natoms = binpos->numatoms;
-  return binpos;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) 
- {
-  binposhandle *binpos;
-  int i, numatoms,igarb;
-  char *cdata;
-  char tmpc;
-
-  binpos = (binposhandle *)v;
-  if (!binpos->fd) 
-    return MOLFILE_ERROR;  /* Done reading frames */
-
-  numatoms = binpos->numatoms;
-
-  if (fread(binpos->xyz, sizeof(float), 3 * numatoms, binpos->fd)
-	                         != (size_t)(3 * numatoms)) {
-    fprintf(stderr, "Failure reading data from amber7 binary file.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (binpos->wrongendian) {
-
-/*For float or single precision endian conversion*/
-/*amber7 binpos files are always float not doubles*/
-    cdata = (char *) binpos->xyz;
-    for ( i=0; i<3*numatoms; ++i, cdata+=4 ) {
-    tmpc = cdata[0]; cdata[0] = cdata[3]; cdata[3] = tmpc;
-    tmpc = cdata[1]; cdata[1] = cdata[2]; cdata[2] = tmpc;
-    }
-  }
-
-  if (ts) {
-    for ( i=0; i<numatoms; ++i) {
-      ts->coords[3*i] = binpos->xyz[3*i];
-      ts->coords[3*i+1] = binpos->xyz[3*i+1];
-      ts->coords[3*i+2] = binpos->xyz[3*i+2];
-    }
-  }
-  /*
-   * Close the file handle and set to NULL so we know we're done reading 
-   * 
-   */
-
-  if((fread(&igarb,sizeof(int),1,binpos->fd))!=1)
-   {
-    fclose(binpos->fd);
-    binpos->fd = NULL;
-   }
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_file_read(void *v) {
-  binposhandle *binpos = (binposhandle *)v;
-  if (binpos->fd)
-    fclose(binpos->fd);
-  free(binpos->xyz);
-  free(binpos);
-}
-
-static void *open_binpos_write(const char *path, const char *filetype, 
-    int natoms) {
-  binposhandle *binpos;
-  FILE *fd;
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file %s for writing\n", path);
-    return NULL;
-  }
-  fprintf(stderr,"Writing file in current machine endian-ism\n");
-  binpos = (binposhandle *)malloc(sizeof(binposhandle));
-  binpos->fd = fd;
-  binpos->numatoms = natoms;
-  fwrite( "fxyz", 4, 1, binpos->fd);
-  return binpos;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  
-  int i,numatoms;
-
-  binposhandle *binpos = (binposhandle *)v;
-  
-  if (!binpos->fd)
-    return MOLFILE_ERROR;
-
-/*add the number of atoms in between frames*/
-  /*myint = (binpos_int32)binpos->numatoms;*/
-  numatoms = binpos->numatoms;
-
-  fwrite(&numatoms, 4, 1, binpos->fd);
-
-  for (i=0; i<3*numatoms; i++) 
-   {
-    float tmp = ts->coords[i];
-    if (fwrite(&tmp, sizeof(float), 1, binpos->fd) != 1) {
-      fprintf(stderr, "Error writing amber7 binary file\n");
-      return MOLFILE_ERROR;
-     }
-   }
-
-  /*
-   * Close and NULLify the file handle so we don't write any more frames.
-   */
-/*  fclose(binpos->fd);
-  binpos->fd = NULL;*/
-
-  return MOLFILE_SUCCESS;
-}
-       
-static void close_file_write(void *v) {
-  binposhandle *binpos = (binposhandle *)v;
-  if (binpos->fd)
-    fclose(binpos->fd);
-  free(binpos);
-}
-
-/*
- * Initialization stuff here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "binpos";
-  plugin.prettyname = "Scripps Binpos";
-  plugin.author = "Brian Bennion";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "binpos";
-  plugin.open_file_read = open_binpos_read;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_file_read;
-  plugin.open_file_write = open_binpos_write;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/biomoccaplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/biomoccaplugin.C
deleted file mode 100644
index 2f3e2e612014ba2bf435ffd11c1ca2e7c6296167..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/biomoccaplugin.C
+++ /dev/null
@@ -1,193 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: biomoccaplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.6 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * Biomocca volumetric map file reader
- *   Biomocca is written by the CEG at UIUC:
- *     http://www.ceg.uiuc.edu/
- *
- * File format (simple ASCII text): 
- * Xcenter Ycenter Zcenter (in Angstroms)
- * Nx(number of cells on the x axis)  Ny  Nz
- * d (cell spacing, in Angstroms)
- * Voxel values (-1, 0, 1, ...) stored in Z/Y/X fortran style order
- *
- * Meaning of voxel values: 
- * -1 for lipid
- *  0 for channel or solvent baths
- *  1 stands for the protein
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} biomocca_t;
-
-
-static void *open_biomocca_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  biomocca_t *biomocca;
-  float scale;
-  int xsize, ysize, zsize;
-  float orig[3];
-  
-  fd = fopen(filepath, "r");
-  if (!fd) {
-    printf("biomoccaplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  if (fscanf(fd, "%f %f %f", orig, orig+1, orig+2) != 3) {
-    printf("biomoccaplugin) Error reading grid origin.\n");
-    return NULL;
-  }
-
-  /* get the number of grid points */
-  if (fscanf(fd, "%d %d %d", &xsize, &ysize, &zsize) != 3) {
-    printf("biomoccaplugin) Error reading grid dimensions.\n");
-    return NULL;
-  }
-
-  /* get the voxel scale */
-  if (fscanf(fd, "%f", &scale) != 1) {;
-    printf("biomoccaplugin) Error reading voxel scale.\n");
-    return NULL;
-  }
-
-  /* allocate and initialize the biomocca structure */
-  biomocca = new biomocca_t;
-  biomocca->fd = fd;
-  biomocca->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  biomocca->nsets = 1; /* this file contains only one data set */
-
-  biomocca->vol = new molfile_volumetric_t[1];
-  strcpy(biomocca->vol[0].dataname, "BioMocca map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    biomocca->vol[0].origin[i] = orig[i];
-    biomocca->vol[0].xaxis[i] = 0.0;
-    biomocca->vol[0].yaxis[i] = 0.0;
-    biomocca->vol[0].zaxis[i] = 0.0;
-  }
-
-  biomocca->vol[0].xaxis[0] = scale * (xsize-1);
-  biomocca->vol[0].yaxis[1] = scale * (ysize-1);
-  biomocca->vol[0].zaxis[2] = scale * (zsize-1);
-
-  biomocca->vol[0].origin[0] -= 0.5 * biomocca->vol[0].xaxis[0];
-  biomocca->vol[0].origin[1] -= 0.5 * biomocca->vol[0].yaxis[1];
-  biomocca->vol[0].origin[2] -= 0.5 * biomocca->vol[0].zaxis[2];
-
-  biomocca->vol[0].xsize = xsize;
-  biomocca->vol[0].ysize = ysize;
-  biomocca->vol[0].zsize = zsize;
-
-  biomocca->vol[0].has_color = 0; /* BioMocca maps contain no color info */
-
-  return biomocca;
-}
-
-static int read_biomocca_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  biomocca_t *biomocca = (biomocca_t *)v;
-  *nsets = biomocca->nsets; 
-  *metadata = biomocca->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_biomocca_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  biomocca_t *biomocca = (biomocca_t *)v;
-  FILE *fd = biomocca->fd;
-  int x, y, z, xsize, ysize, zsize, xysize;
-
-  xsize = biomocca->vol[0].xsize;
-  ysize = biomocca->vol[0].ysize;
-  zsize = biomocca->vol[0].zsize;
-  xysize = xsize * ysize;
-
-  for (x=0; x<xsize; x++) {
-    for (y=0; y<ysize; y++) {
-      for (z=0; z<zsize; z++) {
-        if (fscanf(fd, "%f", datablock + z*xysize + y*xsize + x) != 1) {
-          printf("biomoccaplugin) Failed reading biomocca map data\n");
-          return MOLFILE_ERROR;
-        }
-  
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_biomocca_read(void *v) {
-  biomocca_t *biomocca = (biomocca_t *)v;
-  
-  fclose(biomocca->fd);
-  if (biomocca->vol != NULL)
-    delete [] biomocca->vol; 
-  delete biomocca;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t)); 
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "biomocca";
-  plugin.prettyname = "Biomocca Volumetric Map";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "bmcg";
-  plugin.open_file_read = open_biomocca_read;
-  plugin.read_volumetric_metadata = read_biomocca_metadata;
-  plugin.read_volumetric_data = read_biomocca_data;
-  plugin.close_file_read = close_biomocca_read;
- 
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/brixplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/brixplugin.C
deleted file mode 100644
index d48ca27e849abe96349f5b9d51510743ee4e960b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/brixplugin.C
+++ /dev/null
@@ -1,314 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: brixplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.20 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * BRIX format electron density maps.
- *
- * More info for format can be found at 
- * <http://zombie.imsb.au.dk/~mok/brix/brix-1.html#ss1.2>
- * 
- * TODO: Speed up inner loop of read_data, perhaps reading one full brick
- *       from the file at a time.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  float prod, plus;
-  molfile_volumetric_t *vol;
-} brix_t;
-
-
-static void *open_brix_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  brix_t *brix;
-  char keyWord[81];
-  // File header data:
-  int org_x, org_y, org_z, ext_x, ext_y, ext_z;
-  float grid_x, grid_y, grid_z, cell_x, cell_y, cell_z, 
-        cell_alpha, cell_beta, cell_gamma, prod, plus, sigma, 
-        xaxis[3], yaxis[3], zaxis[3], z1, z2, z3;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "brixplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // read in BRIX file header information -- stored as a 512-element char array
-  fscanf(fd, "%3s", keyWord);
-  if (strcmp(keyWord, ":-)") != 0) {
-    fprintf(stderr, "brixplugin) Error improperly formatted header.\n");
-    return NULL;
-  }
-
-  // "Origin: the origin of the map in grid units, along X, Y, Z."
-  fscanf(fd, " %s %d %d %d", keyWord, &org_x, &org_y, &org_z);
-  if (strcasecmp(keyWord, "origin") != 0) {
-    fprintf(stderr, "brixplugin) Error reading origin.\n");
-    return NULL;
-  }
-
-  // "Extent: the extent (size) of the map, along X, Y, Z, in grid units"
-  fscanf(fd, " %s %d %d %d", keyWord, &ext_x, &ext_y, &ext_z);
-  if (strcasecmp(keyWord, "extent") != 0) {
-    fprintf(stderr, "brixplugin) Error reading extent.\n");
-    return NULL;
-  }
-
-  // "Grid: number of grid points along the whole unit cell, along X, Y, Z."
-  fscanf(fd, " %s %f %f %f", keyWord, &grid_x, &grid_y, &grid_z);
-  if (strcasecmp(keyWord, "grid") != 0) {
-    fprintf(stderr, "brixplugin) Error reading grid.\n");
-    return NULL;
-  }
-
-  // "Cell: Unit cell parameters"
-  // cell x, y, and z are the length of the unit cell along each axis,
-  // cell alpha, beta, and cell_gamma are the angles between axes.
-  fscanf(fd, " %s %f %f %f %f %f %f", keyWord,
-         &cell_x, &cell_y, &cell_z, &cell_alpha, &cell_beta, &cell_gamma);
-  if (strcasecmp(keyWord, "cell") != 0) {
-    fprintf(stderr, "brixplugin) Error reading cell.\n");
-    return NULL;
-  }
-
-  // Convert angles to radians
-  cell_alpha *= M_PI / 180.0;
-  cell_beta *= M_PI / 180.0;
-  cell_gamma *= M_PI / 180.0;
-
-  // "Prod, plus: Constants that bring the electron density from byte to 
-  // normal scale."
-  fscanf(fd, " %s %f", keyWord, &prod);
-  if (strcasecmp(keyWord, "prod") != 0) {
-    fprintf(stderr, "brixplugin) Error reading prod.\n");
-    return NULL;
-  }
-  fscanf(fd, " %s %f", keyWord, &plus);
-  if (strcasecmp(keyWord, "plus") != 0) {
-    fprintf(stderr, "brixplugin) Error reading plus.\n");
-    return NULL;
-  }
-
-  // "Sigma: Rms deviation of electron density map."
-  fscanf(fd, " %s %f", keyWord, &sigma);
-  if (strcasecmp(keyWord, "sigma") != 0) {
-    fprintf(stderr, "brixplugin) Error reading sigma.\n");
-    return NULL;
-  }
-
-  // Allocate and initialize the brix structure
-  brix = new brix_t;
-  brix->fd = fd;
-  brix->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  brix->nsets = 1; // this file contains only one data set
-
-  brix->prod = prod;
-  brix->plus = plus;
-
-  brix->vol = new molfile_volumetric_t[1];
-  strcpy(brix->vol[0].dataname, "BRIX Electron Density Map");
-
-  // Calculate non-orthogonal unit cell coordinates
-  xaxis[0] = cell_x / grid_x;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(cell_gamma) * cell_y / grid_y;
-  yaxis[1] = sin(cell_gamma) * cell_y / grid_y;
-  yaxis[2] = 0;
-
-  z1 = cos(cell_beta);
-  z2 = (cos(cell_alpha) - cos(cell_beta)*cos(cell_gamma)) / sin(cell_gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * cell_z / grid_z;
-  zaxis[1] = z2 * cell_z / grid_z;
-  zaxis[2] = z3 * cell_z / grid_z;
-
-  brix->vol[0].origin[0] = xaxis[0] * org_x + yaxis[0] * org_y + 
-                           zaxis[0] * org_z;
-  brix->vol[0].origin[1] = yaxis[1] * org_y + zaxis[1] * org_z;
-  brix->vol[0].origin[2] = zaxis[2] * org_z;
-
-  brix->vol[0].xaxis[0] = xaxis[0] * (ext_x - 1);
-  brix->vol[0].xaxis[1] = 0;
-  brix->vol[0].xaxis[2] = 0;
-
-  brix->vol[0].yaxis[0] = yaxis[0] * (ext_y - 1);
-  brix->vol[0].yaxis[1] = yaxis[1] * (ext_y - 1);
-  brix->vol[0].yaxis[2] = 0;
-
-  brix->vol[0].zaxis[0] = zaxis[0] * (ext_z - 1);
-  brix->vol[0].zaxis[1] = zaxis[1] * (ext_z - 1);
-  brix->vol[0].zaxis[2] = zaxis[2] * (ext_z - 1);
-
-  brix->vol[0].xsize = ext_x;
-  brix->vol[0].ysize = ext_y;
-  brix->vol[0].zsize = ext_z;
-
-  brix->vol[0].has_color = 0;
-
-  return brix;
-}
-
-static int read_brix_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  brix_t *brix = (brix_t *)v;
-  *nsets = brix->nsets; 
-  *metadata = brix->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_brix_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  brix_t *brix = (brix_t *)v;
-  float * cell = datablock;
-  int xsize, ysize, zsize, xysize, xbrix, ybrix, zbrix, cellIndex;
-  int x, y, z, xbrik, ybrik, zbrik;
-  unsigned char brick[512];
-  FILE * fd = brix->fd;
-  float div, plus;
-
-  // Read 512-byte "bricks" of data. Each brick contains data for 8*8*8 
-  // gridpoints.
-  fseek(fd, 512, SEEK_SET);
-
-  div = 1.0 / brix->prod;
-  plus = brix->plus;
-
-  xsize = brix->vol[0].xsize;
-  ysize = brix->vol[0].ysize;
-  zsize = brix->vol[0].zsize;
-  xysize = xsize * ysize;
-
-  xbrix = (int) ceil((float) xsize / 8.0);
-  ybrix = (int) ceil((float) ysize / 8.0);
-  zbrix = (int) ceil((float) zsize / 8.0);
-
-  // For every density value, 
-  // cellIndex = (x + xbrik*8) + (y + ybrik*8)*xsize + (z + zbrik*8) * xysize
-  cellIndex = 0;
-  for (zbrik = 0; zbrik < zbrix; zbrik++) {
-    for (ybrik = 0; ybrik < ybrix; ybrik++) {
-      for (xbrik = 0; xbrik < xbrix; xbrik++) {
-        if (feof(fd)) {
-          fprintf(stderr, "brixplugin) Unexpected end-of-file.\n");
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          fprintf(stderr, "brixplugin) Error reading file.\n");
-          return MOLFILE_ERROR;
-        }
-
-        // Read a data brick into the buffer.
-        fread(brick, sizeof(char), 512, fd);
-
-        // Copy the brick values into the cell
-        for (z = 0; z < 8; z++) {
-          for (y = 0; y < 8; y++) {
-            for (x = 0; x < 8; x++) {
-
-              if ( ((x + xbrik*8) < xsize) && ((y + ybrik*8) < ysize) &&
-                   ((z + zbrik*8) < zsize) )
-                cell[cellIndex] = 
-                  div * ((float) brick[x+y*8+z*64] - plus);
-
-              cellIndex++;
-            } // end for(x)
- 
-            cellIndex += xsize - 8;
-          } // end for(y)
-
-          cellIndex += xysize - 8*xsize;
-        } // end for(z)
- 
-        cellIndex += 8 - 8*xysize; 
-      } // end for(xbrik)
-
-      cellIndex += 8 * (xsize - xbrix);
-    } // end for(ybrik)
-
-    cellIndex += 8 * (xysize - xsize*ybrik);
-  } // end for(zbrik)
- 
-  return MOLFILE_SUCCESS;
-}
-
-static void close_brix_read(void *v) {
-  brix_t *brix = (brix_t *)v;
-
-  fclose(brix->fd);
-  if (brix->vol != NULL)
-    delete [] brix->vol; 
-  delete brix;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "brix";
-  plugin.prettyname = "BRIX Density Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 8;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "brix,brx";
-  plugin.open_file_read = open_brix_read;
-  plugin.read_volumetric_metadata = read_brix_metadata;
-  plugin.read_volumetric_data = read_brix_data;
-  plugin.close_file_read = close_brix_read;
-
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/carplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/carplugin.c
deleted file mode 100644
index b4e3983b5a466d6f0d6fd58049e4a28c18d3cce5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/carplugin.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: carplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.18 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * Plugin for Insight II/Discover car (cartesian coordinate file) file format.
- * 
- * TODO: 
- * + 2D PBC info (probably just as a simplified 3D PBC)
- * + HELIX info (not sure how this will be handled)
- *
- * File Header:
- *   !BIOSYM archive 3
- *   HELIX 
- *     (if HELIX information is present)
- *   PBC=ON, PBC=OFF, PBC=2D 
- *     (one of these three choices must be present. PBC cannot be "ON" if
- *     HELIX information is present.)
- * Coordinate Header:
- *   Title (this line may be blank, but must be present)
- *     1-64 title for the system
- *     65-80 energy
- *   ! DATE day month date time year
- *     (day, month, date, time, year are optional)
- *   PBC information if PBC=ON:
- *     1-3 PBC
- *     4-13 a cell vector a in angstroms
- *     14-23 b cell vector b in angstroms
- *     24-33 c cell vector c in angstroms
- *     34-43 alpha cell angle alpha in degrees
- *     44-53 beta cell angle beta in degrees
- *     54-63 gamma cell angle gamma in degrees
- *     64-80 space group name
- *   PBC information if PBC=2D:
- *     1-3 PBC
- *     4-13 k plane vector k in angstroms
- *     14-23 l plane vector l in angstroms
- *     24-33 gamma plane angle gamma in degrees
- *     34-50 plane group name
- * Molecule Data:
- *   If helix info is present:
- *     1-5 HELIX
- *     6-15 sigma in degrees
- *     16-25 d in angstroms
- *     26-35 kappa angle between l axis and helix axis in degrees
- *     36-45 lambda angle between k axis and helix axis in degrees
- *     46-55 Tk fractional position of helix axis along k axis
- *     56-65 Tl fractional position of helix axis along l axis
- *   Atom data:
- *     1-5 atom name
- *     7-20 x Cartesian coordinate of atom in angstroms
- *     22-35 y Cartesian coordinate of atom in angstroms
- *     37-50 z Cartesian coordinate of atom in angstroms
- *     52-55 type of residue containing atom
- *     57-63 residue sequence name relative to beginning of current
- *     molecule, left justified
- *     64-70 potential type of atom left justified
- *     72-73 element symbol
- *     75-80 partial charge on atom
- *   Final line for a given molecule:
- *     1-3 end
- * Final line for the entire molecular system input:
- *     1-3 end
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#define LINESIZE 1024
-
-/* possible values for pbc */
-enum {PBC_ON, PBC_OFF, PBC_2D};
-
-typedef struct {
-  FILE *file;
-  int numatoms, pbc, helix, eof;
-  long coord_location;
-  molfile_atom_t *atomlist;
-} cardata;
-
-/* Parse a line contianing atom data from a car file and store it in the
- * atom structure. Returns 1 on success, 0 on failure.
- */
-static int read_car_structure_line(molfile_atom_t *atom, char *line) {
-  char name[LINESIZE], type[LINESIZE];
-  int resid;
-  float charge;
-
-  if (sscanf(line, "%s %*f %*f %*f %*s %d %*s %s %f", name, &resid, type, &charge) 
-      != 4)
-    return 0;
-
-  /* check the length of the name and type strings before copying. */
-  if ( (strlen(name) >= 8) || (strlen(type) >= 8) )
-    return 0;
-  strcpy(atom->name, name);
-  strcpy(atom->type, type);
-
-  /* Check that the resid won't overflow the resname string, then copy it
-   * over
-   */
-  if (resid > 9999999)
-    atom->resname[0] = '\0';
-  else
-    sprintf(atom->resname, "%d", resid);
-
-  atom->resid = resid;
-
-  atom->chain[0] = '\0';
-  atom->segid[0] = '\0';
-
-  atom->charge = charge;
-
-  return 1;
-}
-
-/* Parse a line contianing atom coordinates from a car file and store them
- * in the array 'coords' in XYZ order. Returns 1 on success, 0 on failure.
- */
-static int read_car_coordinates(float *coords, char *line) {
-  float x, y, z;
-
-  if (sscanf(line, "%*s %f %f %f %*s %*d %*s %*s %*f", &x, &y, &z) 
-      != 3)
-    return 0;
-
-  coords[0] = x;
-  coords[1] = y;
-  coords[2] = z;
-
-  return 1;
-}
-
-static void *open_car_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  cardata *data;
-  char line[LINESIZE];
-
-  fd = fopen(filename, "rb"); if (!fd) return NULL;
-  
-  data = (cardata *)malloc(sizeof(cardata));
-  data->eof = 0;
-  data->file = fd;
-
-  /* First line: "!BIOSYM archive n", where n indicates the file format */
-  fgets(line, LINESIZE, fd);
-  if (strncmp(line, "!BIOSYM archive", 15)) {
-    fprintf(stderr, "ERROR) badly formatted/missing header.\n");
-    return NULL;
-  }
-
-  /* Second line: "HELIX" if helix information is present. Followed by PBC
-   * info on the next line: "PBC=ON|OFF|2D". 
-   * If HELIX is present, PBC cannot be "ON": return an error if this happens. 
-   */
-  fgets(line, LINESIZE, fd);
-  if (!strncmp(line, "HELIX", 5)) {
-    data->helix = 1;
-    fgets(line, LINESIZE, fd);
-    fprintf(stdout, "WARNING) ignoring helix information.\n");
-  }
-  else {
-    data->helix = 0;
-  }
-
-  if (!strncmp(line, "PBC=ON", 6)) {
-    data->pbc = PBC_ON;
-  }
-  else if (!strncmp(line, "PBC=OFF", 7)) {
-    data->pbc = PBC_OFF;
-  }
-  else if (!strncmp(line, "PBC=2D", 6)) {
-    data->pbc = PBC_2D;
-    fprintf(stdout, "WARNING) ignoring 2D PBC information.\n");
-  }
-  else {
-    fprintf(stderr, "ERROR) badly formatted/missing PBC info.\n");
-    return NULL;
-  }
-
-  if (data->helix && (data->pbc == PBC_ON)) {
-    fprintf(stderr, "ERROR) car file contains helix and 3D PBC information.");
-    return NULL;
-  }
-
-  /* Next line: title/energy for the system. Skipped. */
-  fgets(line, LINESIZE, fd);
-
-  /* Next line: "!DATE [day month date time year]". */
-  fgets(line, LINESIZE, fd);
-  if (strncmp(line, "!DATE", 5)) {
-    fprintf(stderr, "ERROR) badly formatted/missing date.\n");
-    return NULL;
-  }
-    
-  /* Store the location of the beginning of the PBC/coordinate data. */
-  data->coord_location = ftell(fd);
-
-  /* Skip the PBC and HELIX entries, if present */
-  if (data->pbc != PBC_OFF) 
-    fgets(line, LINESIZE, fd);
-  if (data->helix)
-    fgets(line, LINESIZE, fd);
-
-  /* Count the atoms in all molecules*/
-  data->numatoms = 0;
-  fgets(line, LINESIZE, fd);
-  while(strncmp(line, "end", 3)) {
-    while(strncmp(line, "end", 3)) {
-      data->numatoms++;
-      fgets(line, LINESIZE, fd);
-
-      if (feof(fd)) {
-        fprintf(stderr, "ERROR) unexpected end-of-file.\n");
-        return NULL;
-      }
-      if (ferror(fd)) {
-        fprintf(stderr, "ERROR) error reading car file.\n");
-        return NULL;
-      }
-    }
-    fgets(line, LINESIZE, fd);
-  }
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-static int read_car_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  int mol_num;
-  char line[LINESIZE];
-  molfile_atom_t *atom;
-  cardata *data = (cardata *)mydata;
-
-  *optflags = MOLFILE_CHARGE; /* car files contain partial charges */
-
-  /* move to the beginning of the atom data in the file, skipping any PBC or
-   * HELIX information that may be present
-   */
-  fseek(data->file, data->coord_location, SEEK_SET);
-  if (data->pbc != PBC_OFF) 
-    fgets(line, LINESIZE, data->file);
-  if (data->helix)
-    fgets(line, LINESIZE, data->file);
-
-  mol_num = 0;
-  atom = atoms;
-  fgets(line, LINESIZE, data->file);
-  /* Loop through all molecules */
-  while(strncmp(line, "end", 3)) {
-    /* Read the structure for each molecule */
-    while(strncmp(line, "end", 3)) {
-      if (!read_car_structure_line(atom, line)) {
-        fprintf(stderr, "ERROR) badly formatted structure line:\n%s\n", line);
-        return MOLFILE_ERROR;
-      }
-
-      /* XXX - this code can easily create buffer overflows
-               and cause data corruption or segfaults:
-
-         XXX - use the chain name to identify different molecules
-         sprintf(atom->chain, "%d", mol_num);
-
-         we avoid the buffer overflow and use typical capital 
-         letters for the chain identifiers instead.
-      */
-      sprintf(atom->chain, "%c", (char) (((int) 'A') + (mol_num % 26))); 
-
-      atom++;
-      
-      fgets(line, LINESIZE, data->file);
-      if (feof(data->file)) {
-        fprintf(stderr, "ERROR) unexpected end-of-file while reading structure.\n");
-        return MOLFILE_ERROR;
-      }
-      if (ferror(data->file)) {
-        fprintf(stderr, "ERROR) error reading car file while reading structure.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-    fgets(line, LINESIZE, data->file);
-    mol_num++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_car_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char line[LINESIZE];
-  cardata *data = (cardata *)mydata;
-  float *coords = NULL;
-
-  /* return if coordinates have been read */
-  if (data->eof)
-    return MOLFILE_EOF;
-
-  /* move to the beginning of the atom data in the file */
-  fseek(data->file, data->coord_location, SEEK_SET);
-
-  /* read the PBC record if present */
-  if (data->pbc == PBC_ON) {
-    fgets(line, LINESIZE, data->file);
-
-    if (ts) {
-      if ( sscanf(line, "PBC %f %f %f %f %f %f %*s", 
-                  &ts->A, &ts->B, &ts->C, 
-                  &ts->alpha, &ts->beta, &ts->gamma) != 6 ) {
-        fprintf(stderr, "ERROR) badly formatted PBC line:\n%s\n", line);
-        return MOLFILE_ERROR;
-      }
-    }
-  }
-  else if (data->pbc == PBC_2D) {
-    /* XXX - Ignore 2D PBC information */
-    fgets(line, LINESIZE, data->file);
-  }
-
-  /* skip the helix record if present */
-  if (data->helix)
-    fgets(line, LINESIZE, data->file);
-
-  if (ts)
-    coords = ts->coords;
-
-  fgets(line, LINESIZE, data->file);
-  /* Loop through all molecules */
-  while(strncmp(line, "end", 3)) {
-    /* Read the coordinates for each molecule */
-    while(strncmp(line, "end", 3)) {
-      /* only save coords if we're given a timestep pointer. */
-      if (ts) {
-        if (!read_car_coordinates(coords, line)) {
-          fprintf(stderr, "ERROR) badly formatted coordinate line:\n%s\n", line);
-          return MOLFILE_ERROR;
-        }
-        coords += 3;
-      }
-
-      fgets(line, LINESIZE, data->file);
-      if (feof(data->file)) {
-        fprintf(stderr, "ERROR) unexpected end-of-file while reading coordinates.\n");
-        return MOLFILE_ERROR;
-      }
-      if (ferror(data->file)) {
-        fprintf(stderr, "ERROR) file error while reading coordinates.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-    fgets(line, LINESIZE, data->file);
-  }
-
-  /* set eof since this file contians only one "timestep" */
-  data->eof = 1;
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_car_read(void *mydata) {
-  if (mydata) {
-    cardata *data = (cardata *)mydata;
-    fclose(data->file);
-    free(data);
-  }
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "car";
-  plugin.prettyname = "InsightII car";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "car";
-  plugin.open_file_read = open_car_read;
-  plugin.read_structure = read_car_structure;
-  plugin.read_next_timestep = read_car_timestep;
-  plugin.close_file_read = close_car_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ccp4plugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ccp4plugin.C
deleted file mode 100644
index dd56cd8ce494c2a97883cbe5dc451a19695abb30..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ccp4plugin.C
+++ /dev/null
@@ -1,706 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: ccp4plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.38 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-//
-// CCP4 electron density map file format description:
-//   http://www2.mrc-lmb.cam.ac.uk/image2000.html
-//   http://www.ccp4.ac.uk/html/maplib.html
-//   http://iims.ebi.ac.uk/3dem-mrc-maps/distribution/mrc_maps.txt
-//
-// TODO: Fix translation/scaling problems found when using 
-//       non-orthogonal unit cells.
-//
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-#define CCP4HDSIZE 1024
-
-// CCP4 and IMOD MRC image types
-// based on notes in:
-//   http://bio3d.colorado.edu/imod/doc/mrc_format.txt
-#define MRC_TYPE_BYTE   0
-#define MRC_TYPE_SHORT  1
-#define MRC_TYPE_FLOAT  2
-#define MRC_TYPE_SHORT2 3
-#define MRC_TYPE_FLOAT2 4
-#define MRC_TYPE_USHORT 6  /* non-standard */
-#define MRC_TYPE_UCHAR3 16 /* non-standard */
-
-#define IMOD_FILE_ID            0x494d4f44
-#define IMOD_MAGIC_STAMP        1146047817
-#define IMOD_FLAG_SIGNED               0x1
-#define IMOD_FLAG_HEADER_SPACING       0x2
-#define IMOD_FLAG_ORIGIN_INVERTED_SIGN 0x4
-
-typedef struct {
-  FILE *fd;
-  int voxtype; 
-  int imodstamp;
-  int imodflags;
-  int nsets;
-  int swap;
-  int xyz2crs[3];
-  long dataOffset;
-  molfile_volumetric_t *vol;
-} ccp4_t;
-
-typedef struct {
-  unsigned char red;
-  unsigned char blue;
-  unsigned char green;
-} uchar3;
-
-static void *open_ccp4_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  ccp4_t *ccp4;
-  char mapString[4], symData[81];
-  int nxyzstart[3], extent[3], grid[3], crs2xyz[3], voxtype, symBytes;
-  float origin2k[3];
-  int swap, i, xIndex, yIndex, zIndex;
-  long dataOffset, filesize;
-  float cellDimensions[3], cellAngles[3], xaxis[3], yaxis[3], zaxis[3];
-  float alpha, beta, gamma, xScale, yScale, zScale, z1, z2, z3;
-  int imodstamp=0,imodflags=0;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    printf("ccp4plugin) Error opening file %s\n", filepath);
-    return NULL;
-  }
-
-  if ((fread(extent, sizeof(int), 3, fd) != 3) ||
-      (fread(&voxtype, sizeof(int), 1, fd) != 1) ||
-      (fread(nxyzstart, sizeof(int), 3, fd) != 3) ||
-      (fread(grid, sizeof(int), 3, fd) != 3) ||
-      (fread(cellDimensions, sizeof(float), 3, fd) != 3) ||
-      (fread(cellAngles, sizeof(float), 3, fd) != 3) ||
-      (fread(crs2xyz, sizeof(int), 3, fd) != 3)) {
-    printf("ccp4plugin) Error: Improperly formatted line.\n");
-    return NULL;
-  }
-
-  // Check the number of bytes used for storing symmetry operators
-  // (word 23, byte 92)
-  fseek(fd, 23 * 4, SEEK_SET);
-  if ((fread(&symBytes, sizeof(int), 1, fd) != 1) ) {
-    printf("ccp4plugin) Error: Failed reading symmetry bytes record.\n");
-    return NULL;
-  }
-
-  // read MRC2000 Origin record at word 49, byte 196, and use it if necessary
-  // http://www2.mrc-lmb.cam.ac.uk/image2000.html
-  fseek(fd, 49 * 4, SEEK_SET);
-  if (fread(origin2k, sizeof(float), 3, fd) != 3) {
-    printf("ccp4plugin) Error: unable to read ORIGIN records at offset 196.\n");
-  }
-
-  // Check for IMOD stamp at offset 152, indicating an IMOD file 
-  fseek(fd, 152, SEEK_SET);
-  if (fread(&imodstamp, sizeof(int), 1, fd) != 1) {
-    printf("ccp4plugin) Error: failed to read IMOD stamp from MRC file.\n");
-    return NULL;
-  }
-  if (fread(&imodflags, sizeof(int), 1, fd) != 1) {
-    printf("ccp4plugin) Error: failed to read IMOD flags from MRC file.\n");
-    return NULL;
-  }
-
-  // Check file endianism using some heuristics
-  swap = 0;
-  int tmp[3];
-  memcpy(tmp, extent, 3*sizeof(int));
-  if (tmp[0] > 65536 || tmp[1] > 65536 || tmp[2] > 65536) {
-    swap4_aligned(tmp, 3);
-    if (tmp[0] > 65536 || tmp[1] > 65536 || tmp[2] > 65536) {
-      swap = 0;
-      printf("ccp4plugin) Guessing file endianism: native\n");
-    } else {
-      swap = 1;
-      printf("ccp4plugin) Guessing file endianism: swapped\n");
-    }
-  }
-  if (voxtype > 16 && swap == 0) {
-    tmp[0] = voxtype;
-    swap4_aligned(tmp, 1);
-    if (tmp[0] <= 16) {
-      swap = 1;
-      printf("ccp4plugin) Guessing file endianism: swapped\n");
-    }
-  }
-
-  // Byte-swap header information if needed
-  if (swap == 1) {
-    swap4_aligned(extent, 3);
-    swap4_aligned(&voxtype, 1);
-    swap4_aligned(nxyzstart, 3);
-    swap4_aligned(origin2k, 3);
-    swap4_aligned(grid, 3);
-    swap4_aligned(cellDimensions, 3);
-    swap4_aligned(cellAngles, 3);
-    swap4_aligned(crs2xyz, 3);
-    swap4_aligned(&symBytes, 1);
-    swap4_aligned(&imodstamp, 1);
-    swap4_aligned(&imodflags, 1);
-  }
-
-  // Check for the string "MAP" at word 52 byte 208, indicating a CCP4 file.
-  fseek(fd, 52 * 4, SEEK_SET);
-  if (fgets(mapString, 4, fd) == NULL) {
-    printf("ccp4plugin) Error: unable to read 'MAP' string, not a valid CCP4/IMOD MRC file.\n");
-    return NULL;
-  }
-  if ((strcmp(mapString, "MAP") != 0) && (imodstamp != IMOD_MAGIC_STAMP)) {
-    //Older versions of IMOD (2.6.19 or below) do not have the "MAP " string.
-    //If the IMOD stamp is there its probably a valid mrc file
-    printf("ccp4plugin) Warning: 'MAP' string missing which usually indicates that this is\n\
-not a valid IMOD file. Some older versions of IMOD did not include the 'MAP'\n\
-string so file loading will continue but may fail.\n");
-  }
-
-  // Check if we found an IMOD file or not
-  if (imodstamp == IMOD_MAGIC_STAMP) {
-    printf("ccp4plugin) MRC file generated by IMOD-compatible program.\n");
-    if (imodflags & IMOD_FLAG_SIGNED)
-      printf("ccp4plugin) IMOD flag: data uses signed-bytes\n");
-    else 
-      printf("ccp4plugin) IMOD flag: data uses unsigned-bytes\n");
-
-    if (imodflags & IMOD_FLAG_HEADER_SPACING)
-      printf("ccp4plugin) IMOD flag: pixel spacing set in extended header\n");
-
-    if (imodflags & IMOD_FLAG_ORIGIN_INVERTED_SIGN)
-      printf("ccp4plugin) IMOD flag: origin sign is inverted.\n");
-  } else {
-    printf("ccp4plugin) No IMOD stamp found.\n");
-    imodflags = 0;
-  }
-
-  // Check the data type of the file.
-  switch (voxtype) {
-    case MRC_TYPE_BYTE:
-      printf("ccp4plugin) voxel type: byte\n");
-      break;
-
-    case MRC_TYPE_SHORT:
-      printf("ccp4plugin) voxel type: short (16-bit signed int)\n");
-      break;
-
-    case MRC_TYPE_FLOAT:
-      printf("ccp4plugin) voxel type: float (32-bit real)\n");
-      break;
-
-    case MRC_TYPE_SHORT2:
-      printf("ccp4plugin) voxel type: short2 (2x 16-bit signed int)\n");
-      printf("ccp4plugin) Error: unimplemented voxel format\n");
-      return NULL;
-
-    case MRC_TYPE_FLOAT2:
-      printf("ccp4plugin) voxel type: float2 (2x 32-bit real)\n");
-      printf("ccp4plugin) Error: unimplemented voxel format\n");
-      return NULL;
-
-    case MRC_TYPE_USHORT:
-      printf("ccp4plugin) voxel type: ushort (16-bit unsigned int)\n");
-      break;
-
-    case MRC_TYPE_UCHAR3:
-      printf("ccp4plugin) voxel type: uchar3 (3x unsigned char)\n");
-      break;
-
-    default:
-      printf("ccp4plugin) Error: Only byte, short (16-bit integer) or float (32-bit real) data types are supported.\n");
-      return NULL;
-  }
-
-#if 1
-  printf("ccp4plugin)    extent: %d x %d x %d\n",
-         extent[0], extent[1], extent[2]);
-  printf("ccp4plugin) nxyzstart: %d x %d x %d\n", 
-         nxyzstart[0], nxyzstart[1], nxyzstart[2]);
-  printf("ccp4plugin)  origin2k: %f x %f x %f\n", 
-         origin2k[0], origin2k[1], origin2k[2]);
-  printf("ccp4plugin)      grid: %d x %d x %d\n", grid[0], grid[1], grid[2]);
-  printf("ccp4plugin)   celldim: %f x %f x %f\n", 
-         cellDimensions[0], cellDimensions[1], cellDimensions[2]);
-  printf("cpp4plugin)cellangles: %f, %f, %f\n", 
-         cellAngles[0], cellAngles[1], cellAngles[2]);
-  printf("ccp4plugin)   crs2xyz: %d %d %d\n", 
-         crs2xyz[0], crs2xyz[1], crs2xyz[2]);
-  printf("ccp4plugin)  symBytes: %d\n", symBytes);
-#endif
-
-  // Check the dataOffset: this fixes the problem caused by files claiming
-  // to have symmetry records when they do not.
-  fseek(fd, 0, SEEK_END);
-  filesize = ftell(fd);
-
-  // compute data offset using file size and voxel type info
-  if (voxtype == MRC_TYPE_BYTE) {
-    dataOffset = filesize - sizeof(char)*(extent[0]*extent[1]*extent[2]);
-  } else if (voxtype == MRC_TYPE_FLOAT) {
-    dataOffset = filesize - sizeof(float)*(extent[0]*extent[1]*extent[2]);
-  } else if (voxtype == MRC_TYPE_SHORT || voxtype == MRC_TYPE_USHORT) {
-    dataOffset = filesize - sizeof(short)*(extent[0]*extent[1]*extent[2]);
-  } else if (voxtype == MRC_TYPE_UCHAR3) {
-    dataOffset = filesize - sizeof(uchar3)*(extent[0]*extent[1]*extent[2]);
-  } else {
-    printf("ccp4plugin) unimplemented voxel type!\n");
-  }
-
-  if (dataOffset != (CCP4HDSIZE + symBytes)) {
-    if (dataOffset == CCP4HDSIZE) {
-      // Bogus symmetry record information
-      printf("ccp4plugin) Warning: file contains bogus symmetry record.\n");
-      symBytes = 0;
-    } else if (dataOffset < CCP4HDSIZE) {
-      printf("ccp4plugin) Error: File appears truncated and doesn't match header.\n");
-      return NULL;
-    } else if ((dataOffset > CCP4HDSIZE) && (dataOffset < (1024*1024))) {
-      // Fix for loading SPIDER files which are larger than usual
-      // In this specific case, we must absolutely trust the symBytes record
-      dataOffset = CCP4HDSIZE + symBytes; 
-      printf("ccp4plugin) Warning: File is larger than expected and doesn't match header.\n");
-      printf("ccp4plugin) Warning: Continuing file load, good luck!\n");
-    } else {
-      printf("ccp4plugin) Error: File is MUCH larger than expected and doesn't match header.\n");
-      return NULL;
-    }
-  }
-
-  // Read symmetry records -- organized as 80-byte lines of text.
-  if (symBytes != 0) {
-    printf("ccp4plugin) Symmetry records found:\n");
-    fseek(fd, CCP4HDSIZE, SEEK_SET);
-    for (i = 0; i < symBytes/80; i++) {
-      fgets(symData, 81, fd);
-      printf("ccp4plugin) %s\n", symData);
-    }
-  }
-
-  // check extent and grid interval counts
-  if (grid[0] == 0 && extent[0] > 0) {
-    grid[0] = extent[0] - 1;
-    printf("ccp4plugin) Warning: Fixed X interval count\n");
-  }
-  if (grid[1] == 0 && extent[1] > 0) {
-    grid[1] = extent[1] - 1;
-    printf("ccp4plugin) Warning: Fixed Y interval count\n");
-  }
-  if (grid[2] == 0 && extent[2] > 0) {
-    grid[2] = extent[2] - 1;
-    printf("ccp4plugin) Warning: Fixed Z interval count\n");
-  }
-
-  // Allocate and initialize the ccp4 structure
-  ccp4 = new ccp4_t;
-  ccp4->fd = fd;
-  ccp4->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  ccp4->nsets = 1; // this EDM file contains only one data set
-  ccp4->voxtype = voxtype;
-  ccp4->imodstamp = imodstamp;
-  ccp4->imodflags = imodflags;
-  ccp4->swap = swap;
-  ccp4->dataOffset = dataOffset;
-
-  ccp4->vol = new molfile_volumetric_t[1];
-  strcpy(ccp4->vol[0].dataname, "CCP4 Electron Density Map");
-
-  // Mapping between CCP4 column, row, section and VMD x, y, z.
-  if (crs2xyz[0] == 0 && crs2xyz[1] == 0 && crs2xyz[2] == 0) {
-    printf("ccp4plugin) Warning: All crs2xyz records are zero.\n");
-    printf("ccp4plugin) Warning: Setting crs2xyz to 1, 2, 3\n");
-    crs2xyz[0] = 1;
-    crs2xyz[0] = 2;
-    crs2xyz[0] = 3;
-  }
-
-  ccp4->xyz2crs[crs2xyz[0]-1] = 0;
-  ccp4->xyz2crs[crs2xyz[1]-1] = 1;
-  ccp4->xyz2crs[crs2xyz[2]-1] = 2;
-  xIndex = ccp4->xyz2crs[0];
-  yIndex = ccp4->xyz2crs[1];
-  zIndex = ccp4->xyz2crs[2];
-
-  // calculate non-orthogonal unit cell coordinates
-  alpha = (M_PI / 180.0) * cellAngles[0];
-  beta = (M_PI / 180.0) * cellAngles[1];
-  gamma = (M_PI / 180.0) * cellAngles[2];
-
-  if (cellDimensions[0] == 0.0 && 
-      cellDimensions[1] == 0.0 &&
-      cellDimensions[2] == 0.0) {
-    printf("ccp4plugin) Warning: Cell dimensions are all zero.\n");
-    printf("ccp4plugin) Warning: Setting to 1.0, 1.0, 1.0 for viewing.\n");
-    printf("ccp4plugin) Warning: Map file will not align with other structures.\n");
-    cellDimensions[0] = 1.0;
-    cellDimensions[1] = 1.0;
-    cellDimensions[2] = 1.0;
-  } 
-
-
-  xScale = cellDimensions[0] / grid[0];
-  yScale = cellDimensions[1] / grid[1];
-  zScale = cellDimensions[2] / grid[2];
-
-  // calculate non-orthogonal unit cell coordinates
-  xaxis[0] = xScale;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(gamma) * yScale;
-  yaxis[1] = sin(gamma) * yScale;
-  yaxis[2] = 0;
-
-  z1 = cos(beta);
-  z2 = (cos(alpha) - cos(beta)*cos(gamma)) / sin(gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * zScale;
-  zaxis[1] = z2 * zScale;
-  zaxis[2] = z3 * zScale;
-
-#if 1
-  // Handle both MRC-2000 and older format maps
-  if (origin2k[0] == 0.0f && origin2k[1] == 0.0f && origin2k[2] == 0.0f) {
-    printf("ccp4plugin) using CCP4 n[xyz]start origin\n");
-    ccp4->vol[0].origin[0] = xaxis[0] * nxyzstart[xIndex] + 
-                             yaxis[0] * nxyzstart[yIndex] +
-                             zaxis[0] * nxyzstart[zIndex];
-    ccp4->vol[0].origin[1] = yaxis[1] * nxyzstart[yIndex] +
-                             zaxis[1] * nxyzstart[zIndex];
-    ccp4->vol[0].origin[2] = zaxis[2] * nxyzstart[zIndex];
-  } else {
-    // Use ORIGIN records rather than old n[xyz]start records
-    //   http://www2.mrc-lmb.cam.ac.uk/image2000.html
-    // XXX the ORIGIN field is only used by the EM community, and
-    //     has undefined meaning for non-orthogonal maps and/or
-    //     non-cubic voxels, etc.
-    printf("ccp4plugin) using MRC2000 origin\n");
-    ccp4->vol[0].origin[0] = origin2k[xIndex];
-    ccp4->vol[0].origin[1] = origin2k[yIndex];
-    ccp4->vol[0].origin[2] = origin2k[zIndex];
-  }
-#else
-  // old code that only pays attention to old MRC nxstart/nystart/nzstart
-  ccp4->vol[0].origin[0] = xaxis[0] * nxyzstart[xIndex] + 
-                           yaxis[0] * nxyzstart[yIndex] +
-                           zaxis[0] * nxyzstart[zIndex];
-  ccp4->vol[0].origin[1] = yaxis[1] * nxyzstart[yIndex] +
-                           zaxis[1] * nxyzstart[zIndex];
-  ccp4->vol[0].origin[2] = zaxis[2] * nxyzstart[zIndex];
-#endif
-
-#if 0
-  printf("ccp4plugin) origin: %.3f %.3f %.3f\n",
-         ccp4->vol[0].origin[0],
-         ccp4->vol[0].origin[1],
-         ccp4->vol[0].origin[2]);
-#endif
-
-  ccp4->vol[0].xaxis[0] = xaxis[0] * (extent[xIndex]-1);
-  ccp4->vol[0].xaxis[1] = 0;
-  ccp4->vol[0].xaxis[2] = 0;
-
-  ccp4->vol[0].yaxis[0] = yaxis[0] * (extent[yIndex]-1);
-  ccp4->vol[0].yaxis[1] = yaxis[1] * (extent[yIndex]-1);
-  ccp4->vol[0].yaxis[2] = 0;
-
-  ccp4->vol[0].zaxis[0] = zaxis[0] * (extent[zIndex]-1);
-  ccp4->vol[0].zaxis[1] = zaxis[1] * (extent[zIndex]-1);
-  ccp4->vol[0].zaxis[2] = zaxis[2] * (extent[zIndex]-1);
-
-  ccp4->vol[0].xsize = extent[xIndex];
-  ccp4->vol[0].ysize = extent[yIndex];
-  ccp4->vol[0].zsize = extent[zIndex];
-
-  ccp4->vol[0].has_color = 0;
-
-  return ccp4;
-}
-
-static int read_ccp4_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  ccp4_t *ccp4 = (ccp4_t *)v;
-  *nsets = ccp4->nsets; 
-  *metadata = ccp4->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_ccp4_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  ccp4_t *ccp4 = (ccp4_t *)v;
-  int x, y, z, xSize, ySize, zSize, xySize, extent[3], coord[3];
-  FILE *fd = ccp4->fd;
-
-  xSize = ccp4->vol[0].xsize;
-  ySize = ccp4->vol[0].ysize;
-  zSize = ccp4->vol[0].zsize;
-  xySize = xSize * ySize;
-
-  // coord = <col, row, sec>
-  // extent = <colSize, rowSize, secSize>
-  extent[ccp4->xyz2crs[0]] = xSize;
-  extent[ccp4->xyz2crs[1]] = ySize;
-  extent[ccp4->xyz2crs[2]] = zSize;
-
-  fseek(fd, ccp4->dataOffset, SEEK_SET);
-
-  // Read entire rows of data from the file, then write into the
-  // datablock with the correct slice ordering.
-  if ((ccp4->voxtype == MRC_TYPE_BYTE) && (ccp4->imodflags & IMOD_FLAG_SIGNED)) {
-    printf("ccp4plugin) reading signed-byte voxel data\n");
-    char *rowdata = new char[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if ( fread(rowdata, sizeof(char), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if ((ccp4->voxtype == MRC_TYPE_BYTE) && !(ccp4->imodflags & IMOD_FLAG_SIGNED)) {
-    printf("ccp4plugin) reading unsigned-byte voxel data\n");
-    unsigned char *rowdata = new unsigned char[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if ( fread(rowdata, sizeof(unsigned char), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if (ccp4->voxtype == MRC_TYPE_FLOAT) {
-    printf("ccp4plugin) reading float (32-bit real) voxel data\n");
-    float *rowdata = new float[extent[0]];
-    int x, y, z;
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (fread(rowdata, sizeof(float), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-    if (ccp4->swap == 1)
-      swap4_aligned(datablock, xySize * zSize);
-  } else if (ccp4->voxtype == MRC_TYPE_SHORT) {
-    printf("ccp4plugin) reading short (16-bit int) voxel data\n");
-    short *rowdata = new short[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (fread(rowdata, sizeof(short), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ccp4->swap == 1)
-          swap2_aligned(rowdata, extent[0]);
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if (ccp4->voxtype == MRC_TYPE_SHORT2) {
-    /* IMOD developers said that this is not used anymore and not worth our time to implement */
-    printf("TYPE_SHORT2 not implemented yet...\n");
-    return MOLFILE_ERROR;
-  } else if (ccp4->voxtype == MRC_TYPE_USHORT) {
-    printf("ccp4plugin) reading unsigned short (16-bit int) voxel data\n");
-    unsigned short *rowdata = new unsigned short[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (fread(rowdata, sizeof(unsigned short), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ccp4->swap == 1)
-          swap2_aligned(rowdata, extent[0]);
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if (ccp4->voxtype == MRC_TYPE_UCHAR3) {
-    printf("ccp4plugin) reading unsigned char * 3 (8-bit uchar * 3) voxel data\n");
-    uchar3 *rowdata = new uchar3[extent[0]];
-    float grayscale;
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if ( fread(rowdata, sizeof(uchar3), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          grayscale = rowdata[coord[0]].red + rowdata[coord[0]].blue + rowdata[coord[0]].green;
-          datablock[x + y*xSize + z*xySize] = grayscale/3.0;
-        }
-      }
-    }
-    delete [] rowdata;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-static void close_ccp4_read(void *v) {
-  ccp4_t *ccp4 = (ccp4_t *)v;
-
-  fclose(ccp4->fd);
-  delete [] ccp4->vol; 
-  delete ccp4;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "ccp4";
-  plugin.prettyname = "CCP4, MRC Density Map";
-  plugin.author = "Eamon Caddigan, Brendan McMorrow, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "ccp4,mrc,map";
-  plugin.open_file_read = open_ccp4_read;
-  plugin.read_volumetric_metadata = read_ccp4_metadata;
-  plugin.read_volumetric_data = read_ccp4_data;
-  plugin.close_file_read = close_ccp4_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/corplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/corplugin.c
deleted file mode 100644
index 0a2b3ef0595fb1bfe35f1af5e17b4df2a864c1db..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/corplugin.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: corplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.33 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * This plugin reads molecular coordinate data stored in 
- * CHARMM CARD Cartesian Coordinate format (ascii text format, not binary).
- *    http://www.charmm.org/
- *    http://www.charmm.org/documentation/c32b2/io.html       
- *
- * Normal format for less than 100000 atoms and PSF IDs with less than
- * five characters
- * TITLE (lines starting with "*")
- * NATOM (I5)
- * ATOMNO RESNO   RES  TYPE  X     Y     Z   SEGID RESID Weighting
- *   I5    I5  1X A4 1X A4 F10.5 F10.5 F10.5 1X A4 1X A4 F10.5
- *
- * Expanded format for more than 100000 atoms (upto 10**10) and with
- * upto 8 character PSF IDs. (versions c31a1 and later)
- * TITLE (lines starting with "*")
- * NATOM (I10)
- * ATOMNO RESNO   RES  TYPE  X     Y     Z   SEGID RESID Weighting
- *   I10   I10 2X A8 2X A8       3F20.10     2X A8 2X A8 F20.10
- *
- */
-
-#include "molfile_plugin.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define COR_RECORD_LENGTH   141 /* 80 */
-
-/* Remove leading and trailing whitespace from the string str of size n */
-static void strip_whitespace(char *str, int n) {
-  char *beg, *end;
-
-  beg = str;
-  end = str + (n-2); /* Point to the last non-null character in the string */
-
-  /* Remove leading whitespace */
-  while(beg <= end && *beg == ' ') {
-    beg++;
-  }
-
-  /* Remove trailing whitespace */
-  while(end >= str && *end == ' ') {
-    end--;
-  }
-
-  if (beg < end) {
-    /* Shift the string */
-    *(end+1) = '\0';
-    memmove(str, beg, (end - beg + 2));
-  } else {
-    str[0] = '\0';
-  }
-
-  return;
-}
-
-/* Get a string from a stream, printing any errors that occur */
-static char *corgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    printf("corplugin) Unexpected end-of-file.\n");
-    returnVal = NULL;
-  } else if (ferror(stream)) {
-    printf("corplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      printf("corplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-/* Open the .cor file and skip past the remarks to the first data section.
- * Returns the file pointer, or NULL if error.  Also puts the number of
- * atoms in the molecule into the given integer.  
- */
-static FILE *open_cor_file(const char *fname, int *natom, int *iofoext) {
-  char inbuf[COR_RECORD_LENGTH+2], header[11];
-  FILE *f;
-
-  *natom = MOLFILE_NUMATOMS_NONE;
-
-  if (!fname) {
-    printf("corplugin) Error opening file: no filename given.\n");
-    return NULL;
-  }
-
-  if ((f = fopen(fname, "r")) == NULL) {
-    printf("corplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Read and discard the header */
-  do {
-    if (fgets(inbuf, COR_RECORD_LENGTH+1, f) == NULL) {
-      fclose(f);
-      printf("corplugin) Error opening file: cannot read line.\n");
-      return NULL;
-    }
-
-    if (sscanf(inbuf, "%10c", header) != 1) {
-      fclose(f);
-      printf("corplugin) Error opening file: improperly formatted line.\n");
-      return NULL;
-    }
-
-  } while (header[0]=='*');
-
-  /* check for EXT keyword */
-  *iofoext = 0 ;
-  if (strstr(inbuf,"EXT") != NULL) 
-    *iofoext = 1;
-
-  /* check atom count */
-  header[10] = '\0';
-  *natom = atoi(header);
-  if (*natom > 99999) 
-    *iofoext = 1;
-
-  if (*iofoext == 1)
-    printf("corplugin) Using EXTended CHARMM coordinates file\n");
-
-  return f;
-}
-
-/* Read in the next atom info into the given storage areas; this assumes
-   that file has already been moved to the beginning of the atom records.
-   Returns the serial number of the atom. If there is an error, returns -1.*/
-static int get_cor_atom(FILE *f, char *atomName, char *atomType, char
-    *resName, char *segName, int *resId, int ioext) {
-  char inbuf[COR_RECORD_LENGTH+2], numAtomStr[11], resNStr[11], resIdStr[11];
-  char atomNameStr[11], segNameStr[11], resNameStr[11];
-  int numAtom;
-
-  memset(inbuf, 0, sizeof(inbuf));
-
-  if (corgets(inbuf, COR_RECORD_LENGTH+1, f) == NULL) {
-    return -1;
-  }
-
-  if (strlen(inbuf) < 60) {
-    printf("corplugin) Line too short: \n%s\n", inbuf);
-    return -1;
-  }
-
-  memset(numAtomStr, 0, sizeof(numAtomStr));
-  memset(resNStr, 0, sizeof(resNStr));
-  memset(resIdStr, 0, sizeof(resIdStr));
-  memset(resNameStr, 0, sizeof(resNameStr));
-  memset(segNameStr, 0, sizeof(segNameStr));
-  memset(atomNameStr, 0, sizeof(atomNameStr));
-
-  /*
-
-    CHARMM has a variety of input formats for the
-       read coor card
-    command. In order to support all of them the simplest would be to replace 
-
-    if (sscanf(inbuf, "%5c%5c%5c%5c%*10c%*10c%*10c%5c", 
-
-    with
-
-    if (sscanf(inbuf, "%s %s %s %s %*s %*s %*s %s", 
-
-    However this solution has 2 problems:
-     1. buffer overruns
-     2. it doesn't handle the cases where X,Y,Z values have no spaces in-between
-
-    In this fix we handle only two most important cases, depending on
-     the value of IOFOrmat command (either EXTEnded or NOEXtended):
-     EXT:    2I10,2X,A8,2X,A8,3F20.10,2X,A8,2X,A8,F20.10
-     NOEXT:  2I5,1X,A4,1X,A4,3F10.5,1X,A4,1X,A4,F10.5
-
-    This implementation introduces new flag iofoext in cordata
-    structure, which can choose between the 2 formats. Note that
-    CHARMM adds EXT keyword in the coordinate and psf files in the
-    case of IOFO EXTE command in the input script, or automatically
-    when there are 100,000 or more atoms in the system!
-
-  */
-
-  if (ioext == 1) {
-    if (sscanf(inbuf, "%10c%10c%10c%10c%*20c%*20c%*20c%10c%10c",
-               numAtomStr, resNStr, resNameStr, atomNameStr, segNameStr, resIdStr) != 6) {
-      printf("corplugin) Improperly formatted line: \n%s\n", inbuf);
-      return -1;
-    }
-    strip_whitespace(resName, sizeof(resName));  /* strip from long original */
-    strip_whitespace(atomName, sizeof(atomName));
-    strip_whitespace(segName, sizeof(segName));
-    memcpy(resName, resNameStr, 7);              /* XXX truncate extra chars */
-    memcpy(atomName, atomNameStr, 7);
-    memcpy(segName, segNameStr, 7);
-    resName[7] = '\0';                           /* NUL terminate strings.. */
-    atomName[7] = '\0';
-    segName[7] = '\0';
-  } else {
-    if (sscanf(inbuf, "%5c%5c%5c%5c%*10c%*10c%*10c%5c%5c",
-               numAtomStr, resNStr, resName, atomName, segName, resIdStr) != 6) {
-      printf("corplugin) Improperly formatted line: \n%s\n", inbuf);
-      return -1;
-    }
-    strip_whitespace(resName, 8);
-    strip_whitespace(atomName, 8);
-    strip_whitespace(segName, 8);
-  }
-
-  numAtom = atoi(numAtomStr);
-  *resId = atoi(resIdStr);
-  strcpy(atomType, atomName);
-
-  return numAtom;
-}
-
-
-/*
- * API functions
- */
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  int iofoext;      /* flag for extended CHARMM c31 version support */
-} cordata;
-
-static void *open_cor_read(const char *path, const char *filetype, 
-    int *natoms) {
-  int ioext ;
-  FILE *fd;
-  cordata *cor;
-
-  if (!(fd = open_cor_file(path, natoms, &ioext))) {
-    return NULL;
-  } 
-  cor = (cordata *) malloc(sizeof(cordata));
-  memset(cor, 0, sizeof(cordata));
-  cor->numatoms = *natoms;
-  cor->file = fd;
-  cor->iofoext = ioext ;
-  return cor;
-}
-
-static int read_cor_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  cordata *data = (cordata *)v;
-  int i;
-  
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (get_cor_atom(data->file, atom->name, atom->type, 
-                     atom->resname, atom->segid, 
-                     &atom->resid, data->iofoext) < 0) {
-      printf("corplugin) couldn't read atom %d\n", i);
-      return MOLFILE_ERROR;
-    }
-    atom->chain[0] = atom->segid[0];
-    atom->chain[1] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cor_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  cordata *cor = (cordata *)v;
-  char inbuf[COR_RECORD_LENGTH+2], header[6];
-  char xStr[21], yStr[21], zStr[21];
-  int i;
-
-  memset(inbuf, 0, sizeof(inbuf));
-  memset(header, 0, sizeof(header));
-  memset(xStr, 0, sizeof(xStr));
-  memset(yStr, 0, sizeof(yStr));
-  memset(zStr, 0, sizeof(zStr));
-
-  /* Skip the header */
-  do {
-    /* Return -1 on EOF */
-    if (feof(cor->file) || ferror(cor->file) || 
-        (fgets(inbuf, COR_RECORD_LENGTH+1, cor->file) == NULL)) {
-      return MOLFILE_ERROR;
-    }
-
-    if (sscanf(inbuf, " %5c", header) != 1) {
-      printf("corplugin) Improperly formatted line.\n");
-      return MOLFILE_ERROR;
-    }
-
-  } while (header[0]=='*');
-
-
-  /* read the coordinates */
-  for (i = 0; i < natoms; i++) {
-    if (corgets(inbuf, COR_RECORD_LENGTH+1, cor->file) == NULL) {
-      return MOLFILE_ERROR;
-    }
-    
-    if (cor->iofoext == 1 ) {
-      if (sscanf(inbuf, "%*10c%*10c%*10c%*10c%20c%20c%20c%*10c", 
-                 xStr, yStr, zStr) != 3) {
-        printf("corplugin) Error reading coordinates on line %d.\n%s\n", i, inbuf);
-        return MOLFILE_ERROR;
-      } else if (ts != NULL) {
-        /* We have a timestep -- save the coordinates */
-        ts->coords[3*i  ] = atof(xStr);
-        ts->coords[3*i+1] = atof(yStr);
-        ts->coords[3*i+2] = atof(zStr);
-      }
-    } else {
-      if (sscanf(inbuf, "%*5c%*5c%*5c%*5c%10c%10c%10c%*5c", 
-                 xStr, yStr, zStr) != 3) {
-        printf("corplugin) Error reading coordinates on line %d.\n%s\n", i, inbuf);
-        return MOLFILE_ERROR;
-      } else if (ts != NULL) {
-        /* We have a timestep -- save the coordinates */
-        ts->coords[3*i  ] = atof(xStr);
-        ts->coords[3*i+1] = atof(yStr);
-        ts->coords[3*i+2] = atof(zStr);
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_cor_read(void *mydata) {
-  cordata *data = (cordata *)mydata;
-  if (data) {
-    if (data->file) fclose(data->file);
-    free(data);
-  }
-}  
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cor";
-  plugin.prettyname = "CHARMM Coordinates";
-  plugin.author = "Eamon Caddigan, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cor";
-  plugin.open_file_read = open_cor_read;
-  plugin.read_structure = read_cor_structure;
-  plugin.read_next_timestep = read_cor_timestep;
-  plugin.close_file_read = close_cor_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cpmdlogplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cpmdlogplugin.c
deleted file mode 100644
index fa3bbb9f369e63bbecfd04439cddb71ee1c0fce1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cpmdlogplugin.c
+++ /dev/null
@@ -1,1666 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-
-/* *******************************************************
- *
- *          CPMD Output File Reader Plugin
- *
- * This plugin allows VMD to read some CPMD output files.
- * So far only PROPERTIES and specially modified 
- * MOLECULAR DYNAMICS BO runs.
- *
- * ********************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-#include <math.h>
-
-#include "gaussianplugin.h"
-#include "periodic_table.h"
-#include "unit_conversion.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
- 
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifndef CPMDLOG_DEBUG
-#define CPMDLOG_DEBUG 0
-#endif
-#define CPMDLOG_BASIS_DEBUG 1
-
-#if CPMDLOG_DEBUG
-#define PRINTERR vmdcon_printf(VMDCON_ERROR,                            \
-                               "\n In file %s, line %d: \n %s \n \n",   \
-                               __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#if CPMDLOG_DEBUG
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE ;   \
-    else fprintf(stderr,"%s:%d %s",__FILE__, __LINE__, x)
-#else
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-#endif
-
-/* make sure pointers are NULLed after free(3)ing them. */
-#define SAFE_FREE(ptr) free(ptr); ptr=NULL
-/* calloc with test of success */
-#define SAFE_CALLOC(ptr,type,count)                                 \
-  ptr = (type *)calloc(count,sizeof(type));                         \
-  if (ptr == NULL) {                                                \
-    PRINTERR;                                                       \
-    return MOLFILE_ERROR;                                           \
-  }
-
-#define UNK_SHELL -666
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL  -2
-#define SP_P_SHELL  -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-#define I_SHELL 6
-
-#define SPIN_ALPHA 0
-#define SPIN_BETA  1
-
-#define STATUS_UNKNOWN       -1
-#define STATUS_CONVERGED      0
-#define STATUS_SCF_NOT_CONV   1
-#define STATUS_TOO_MANY_STEPS 2
-#define STATUS_BROKEN_OFF     3
-
-static const char *runtypes[] = { 
-  "(unknown)", "ENERGY", "OPTIMIZE", "SADPOINT", "HESSIAN", 
-  "SURFACE", "DYNAMICS", "PROPERTIES", NULL};
-
-static const char *scftypes[] = { 
-  "(unknown)", "RHF", "UHF", "ROHF", "GVB", "MCSCF", "FF", NULL };
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-/** Top level CPMD log file parser. Responsible 
- *  for static, i.e. non-trajectory information. */
-static int parse_static_data(gaussiandata *, int *);
-
-/** Check if the current run is an actual CPMD run; 
- *  returns true/false */
-static int have_cpmd(gaussiandata *);
-
-/* this function replaces the basis set data from the log file with
- * with the equivalent data read from an internal basis set data base.
- * for simplicity we use the same format as gaussian. the basis set
- * data is expected to be in $VMDDIR/basis/<basis-set-name>.gbs. */
-static int get_internal_basis(gaussiandata *);
-
-/* convert shell symmetry type from char to int */
-static int shellsymm_int(char *symm);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(gaussiandata *);
-
-static int read_first_frame(gaussiandata *);
-
-/* this subroutine scans the output file for
- * the trajectory information */
-static int get_traj_frame(gaussiandata *);
-
-/* count the number of readable QM timesteps 
- * and collect other information about the
- * total trajectory. */
-static int find_traj_end(gaussiandata *);
-
-/* this function parses the input file for the final
- * wavefunction and stores it in the appropriate arrays; */
-static int get_wavefunction(gaussiandata *, qm_timestep_t *, qm_wavefunction_t *);
-
-/** read in mulliken charges */
-static int get_population(gaussiandata *, qm_timestep_t *);
-
-/* turn fortran double precision 'D' exponents into c parsable 'E's */
-static void fix_fortran_exp(char *string) {
-  while (*string) {
-    if ( (*string == 'D') || (*string == 'd')) *string='e';
-    ++string;
-  }
-}
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the CPMD logfile and get the number
- * of atoms.
- * We are also reading all the static (i.e. non-trajectory)
- * data here since we have to parse a bit to get the atom count
- * anyway. These data will then be provided to VMD by
- * read_cpmdlog_metadata() and read_cpmdlog_rundata().
- *
- * *************************************************************/
-static void *open_cpmdlog_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  gaussiandata *data;
-  
-  /* open the input file */
-  fd = fopen(filename, "rb");
-  if (fd == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* set up main data structure */
-  data = (gaussiandata *) calloc(1,sizeof(gaussiandata));
-  if (data == NULL) return NULL;
-  
-  data->runtyp = RUNTYP_UNKNOWN;
-  data->scftyp = SCFTYP_UNKNOWN;
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* check if the file is CPMD format; 
-   * if yes parse it, if not exit */
-  if (have_cpmd(data)==TRUE) {
-    /* if we're dealing with an unsupported CPMD
-     * version, we better quit. so far we can test 3.9.x-3.13.x */
-    if ((data->version < 30900) || (data->version > 40000)) {
-      vmdcon_printf(VMDCON_ERROR,
-                    "cpmdlogplugin) CPMD version %s is not "
-                    "(yet) supported. Bailing out.\n",
-                    data->version_string);
-      free(data);
-      return NULL;
-    }
-
-    /* get the non-trajectory information from the log file */    
-    if (parse_static_data(data, natoms) == FALSE) {
-      free(data);
-      return NULL;
-    }
-  }
-  else {
-    free(data);
-    return NULL;
-  }
-
-  return data;
-}
-
-
-/************************************************************
- * 
- * Provide VMD with the structure of the molecule, i.e the
- * atoms coordinates names, etc.
- *
- *************************************************************/
-static int read_cpmdlog_structure(void *mydata, int *optflags, 
-                      molfile_atom_t *atoms) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  molfile_atom_t *atom;
-  int i = 0;
- 
-  /* optional data from PTE */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS;
-
-  if (data->have_mulliken) 
-    *optflags |= MOLFILE_CHARGE;
-
-  /* all the information I need has already been read in
-   * via the initial scan and I simply need to copy 
-   * everything from the temporary arrays into the 
-   * proper VMD arrays. */
-
-  /* get initial pointer for atom array */
-  cur_atom = data->initatoms;
-
-  for(i=0; i<data->numatoms; i++) {
-    atom = atoms+i;
-    strncpy(atom->name, cur_atom->type, sizeof(atom->name)); 
-    strncpy(atom->type, get_pte_label(cur_atom->atomicnum), sizeof(atom->type));
-    strncpy(atom->resname,"QM", sizeof(atom->resname)); 
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->atomicnumber = cur_atom->atomicnum;
-    atom->radius = get_pte_vdw_radius(cur_atom->atomicnum);
-    /* XXX; check on isotopes. should be possible to read. */
-    atom->mass   = get_pte_mass(cur_atom->atomicnum);  
-    if (data->have_mulliken)
-      atom->charge = data->qm_timestep->mulliken_charges[i];
-
-    cur_atom++;
-  }
- 
-  return MOLFILE_SUCCESS; 
-}
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_cpmdlog_metadata(void *mydata, 
-    molfile_qm_metadata_t *gaussian_metadata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-
-  gaussian_metadata->ncart = 0;
-  gaussian_metadata->nimag = 0;
-  gaussian_metadata->nintcoords = 0;
-
-  /* orbital data */
-  gaussian_metadata->num_basis_funcs = data->num_basis_funcs;
-  gaussian_metadata->num_shells      = data->num_shells;
-  gaussian_metadata->wavef_size      = data->wavef_size;  
-
-#if vmdplugin_ABIVERSION > 11
-  /* charges */
-  gaussian_metadata->have_esp = 0;
-  gaussian_metadata->have_carthessian = 0;
-  gaussian_metadata->have_internals   = 0;
-  gaussian_metadata->have_normalmodes = FALSE;
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_cpmdlog_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-  int i;
-
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-  molfile_qm_sysinfo_t *sys_data     = &qm_data->run;
-
-  /* fill in molfile_qm_sysinfo_t */
-  sys_data->nproc = data->nproc;
-  sys_data->memory = data->memory; 
-  sys_data->runtype = data->runtyp;
-  sys_data->scftype = data->scftyp;
-  sys_data->totalcharge = data->totalcharge;
-/*  sys_data->multiplicity = data->multiplicity; */
-  sys_data->num_electrons = data->num_electrons;
-  sys_data->num_occupied_A = data->occ_orbitals_A;
-  sys_data->num_occupied_B = data->occ_orbitals_B;
-
-  strncpy(sys_data->basis_string, data->basis_string,
-          sizeof(sys_data->basis_string));
-  
-  strncpy(sys_data->runtitle, data->runtitle, sizeof(sys_data->runtitle));
-  strncpy(sys_data->geometry, data->geometry, sizeof(sys_data->geometry));
-  strncpy(sys_data->version_string, data->version_string,
-          sizeof(sys_data->version_string));
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->numatoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_symmetry[i] = data->shell_symmetry[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-
-    for (i=0; i<3*data->wavef_size; i++) {
-      basis_data->angular_momentum[i] = data->angular_momentum[i];
-    }
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-#if vmdplugin_ABIVERSION > 11
-
-/***********************************************************
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***********************************************************
- * Provide QM metadata for next timestep. 
- * This actually triggers reading the entire next timestep
- * since we have to parse the whole timestep anyway in order
- * to get the metadata. So we store the read data locally
- * and hand them to VMD when requested by read_timestep().
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  int i, have = 0;
-  gaussiandata *data = (gaussiandata *)mydata;
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) read_qm_timestep_metadata(): %d/%d/%d\n",
-                data->num_frames, 
-                data->num_frames_read,
-                data->num_frames_sent);
-#endif
-
-  meta->count = -1; /* Don't know the number of frames yet */
-  meta->has_gradient = 0;
-
-  if (data->num_frames_read > data->num_frames_sent) {
-    have = 1;
-  } else if (data->num_frames_read < data->num_frames) {
-#if CPMDLOG_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "cpmdlogplugin) Probing timestep %d\n", 
-                  data->num_frames_read);
-#endif
-    have = get_traj_frame(data);
-  }
-
-  if (have) {
-    /* get a pointer to the current qm timestep */
-    qm_timestep_t *cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-#if CPMDLOG_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "cpmdlogplugin) Approved timestep %d\n", 
-                  data->num_frames_sent);
-#endif
-    meta->num_scfiter  = 0;
-
-    for (i=0; (i<MAX_NUM_WAVE && i<cur_qm_ts->numwave); i++) { 
-#if CPMDLOG_DEBUG
-      vmdcon_printf(VMDCON_INFO,
-                    "cpmdlogplugin) num_orbitals_per_wavef[%d/%d]=%d\n",
-                    i+1, cur_qm_ts->numwave, cur_qm_ts->wave[i].num_orbitals);
-#endif
-      meta->num_orbitals_per_wavef[i] = cur_qm_ts->wave[i].num_orbitals;
-    }
-    meta->wavef_size = data->wavef_size;
-
-  } else {
-    meta->num_scfiter = 0;
-    meta->num_orbitals_per_wavef[0] = 0;
-    meta->num_wavef = 0;
-    meta->wavef_size = 0;
-
-    data->end_of_trajectory = TRUE;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * This function provides the data of the next timestep.
- * Here we actually don't read the data from file, that had
- * to be done already upon calling read_timestep_metadata().
- * Instead we copy the stuff from the local data structure
- * into the one's provided by VMD.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-			 molfile_qm_timestep_t *qm_ts) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  int i = 0;
-  qm_timestep_t *cur_qm_ts;
-
-  if (data->end_of_trajectory == TRUE) return MOLFILE_ERROR;
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO,
-                "cpmdlogplugin) Sending timestep %d\n", 
-                data->num_frames_sent);
-#endif
-
-  /* initialize pointer for temporary arrays */
-  cur_atom = data->initatoms; 
-  
-  /* copy the coordinates */
-  for(i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = cur_atom->x;
-    ts->coords[3*i+1] = cur_atom->y;
-    ts->coords[3*i+2] = cur_atom->z; 
-    cur_atom++;
-  }    
-  
-  /* get a convenient pointer to the current qm timestep */
-  cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-
-  /* store the SCF energies */
-  for (i=0; i<cur_qm_ts->num_scfiter; i++) {
-    qm_ts->scfenergies[i] = cur_qm_ts->scfenergies[i];
-  }
-
-  /* store the wave function and orbital energies */
-  if (cur_qm_ts->wave) {
-    for (i=0; i<cur_qm_ts->numwave; i++) {
-      qm_wavefunction_t *wave = &cur_qm_ts->wave[i];
-      if (wave->wave_coeffs && wave->orb_energies) {
-        memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-               wave->num_orbitals*data->wavef_size*sizeof(float));
-        memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-               wave->num_orbitals*sizeof(float));
-      }
-    }
-  }
-
-  if (data->runtyp == RUNTYP_ENERGY || data->runtyp == RUNTYP_HESSIAN) {
-    /* We have only a single point */
-    data->end_of_trajectory = TRUE;
-  }
-
-  data->num_frames_sent++;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-/** Clean up when done and free all memory 
- *  to avoid memory leaks.
- *
- **********************************************************/
-static void close_cpmdlog_read(void *mydata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->file_name);
-  free(data->initatoms);
-  free(data->basis);
-  free(data->shell_symmetry);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->mulliken_charges);
-  free(data->internal_coordinates);
-  free(data->wavenumbers);
-  free(data->intensities);
-  free(data->normal_modes);
-  free(data->angular_momentum);
-
-  if (data->basis_set) {
-    for(i=0; i<data->numatoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  for (i=0; i<data->num_frames_read; i++) {
-    free(data->qm_timestep[i].scfenergies);
-    free(data->qm_timestep[i].gradient);
-    free(data->qm_timestep[i].mulliken_charges);
-    for (j=0; j<data->qm_timestep[i].numwave; j++) {
-      free(data->qm_timestep[i].wave[j].wave_coeffs);
-      free(data->qm_timestep[i].wave[j].orb_energies);
-/*       free(data->qm_timestep[i].wave[j].occupancies); */
-    }
-    free(data->qm_timestep[i].wave);
-  }
-  free(data->qm_timestep);
-  
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-/*! count number of QM dataset frames. */
-static int find_traj_end(gaussiandata *data) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(data->file);
-
-  while (1) {
-    if (!fgets(buffer, sizeof(buffer), data->file)) break;
-
-    if (strstr(buffer, "PROJECTION COORDINATES")) {
-      data->num_frames++;
-    } 
-  }
-  data->opt_status = STATUS_UNKNOWN;
-
-  fseek(data->file, filepos, SEEK_SET);
-  return FALSE;  
-}
-
-
-static int get_final_info(gaussiandata *data) {
-  long filepos;
-  filepos = ftell(data->file);
-
-  if (data->runtyp == RUNTYP_OPTIMIZE || 
-      data->runtyp == RUNTYP_DYNAMICS) {
-    /* Try to advance to the end of the geometry
-     * optimization or MD. If no regular end is found we
-     * won't find any propertiies to read and return. */
-    if (!find_traj_end(data)) return FALSE;
-  }
-
-#if 0
-  if (get_esp_charges(data)) {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) ESP charges found!\n");
-  }
-#endif
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE; 
-}
-
-
-
-/********************************************************
- *
- * Main gaussian log file parser responsible for static,  
- * i.e. non-trajectory information.
- *
- ********************************************************/
-static int parse_static_data(gaussiandata *data, int *natoms) 
-{
-  char buffer[BUFSIZ];
-  char word[4][MOLFILE_BUFSIZ];
-  char *vmdbasis;
-  int  i,n;
-  int  numatoms, numstates, numelectrons, totalcharge;
-
-  buffer[0] = '\0';
-  
-  /* set some defaults */
-  data->scftyp = SCFTYP_RHF;
-  data->runtyp = RUNTYP_UNKNOWN;
-  numelectrons = 0;
-  data->totalcharge = 0;
-  data->multiplicity = 1;
-  data->have_basis=FALSE;       
-  /* CPMD never outputs basis set info, so we use 
-   * VSTO-6G unless overridden by environment */
-  vmdbasis = getenv("VMDDEFBASISSET");
-  if (vmdbasis == NULL) 
-    vmdbasis = "VSTO-6G";
-
-  strncpy(data->gbasis, vmdbasis, sizeof(data->gbasis));
-  strncpy(data->basis_string, "Internal ", sizeof(data->basis_string));
-  strncat(data->basis_string, vmdbasis, sizeof(data->basis_string) - 10);
-
-
-  /* try to find job type parameters within the next 100 lines.*/
-  for (i=0; i<100; ++i) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    if ( (strcmp(word[0],"CALCULATE" ) == 0 &&
-          strcmp(word[1],"SOME"      ) == 0 && 
-          strcmp(word[2],"PROPERTIES") == 0 ) ) {
-      data->runtyp = RUNTYP_PROPERTIES;
-      break;
-    } else if ( (strcmp(word[0],"GEOMETRY"    ) == 0 &&
-                 strcmp(word[1],"OPTIMIZATION") == 0 ) ) {
-      data->runtyp = RUNTYP_OPTIMIZE;
-      break;
-    } else if ( (strcmp(word[1],"MOLECULAR"    ) == 0 &&
-                 strcmp(word[2],"DYNAMICS") == 0 ) ) {
-      data->runtyp = RUNTYP_DYNAMICS;
-      break;
-      
-    }
-  }
-
-  /* XXX: add support for other types later? */
-  if ((data->runtyp != RUNTYP_PROPERTIES) &&
-      (data->runtyp != RUNTYP_DYNAMICS) ) {
-    vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Run-type: %s is currently "
-                  "not supported by this plugin.\n", runtypes[data->runtyp]);
-    return FALSE;
-  }
-  
-  if ((data->runtyp != RUNTYP_PROPERTIES) && (data->version < 31303)) {
-    vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Run-type: %s is currently "
-                  "not supported for outputs of this CPMD version.\n", 
-                  runtypes[data->runtyp]);
-    return FALSE;
-  }
-  
-  /* scavange for more setup information */
-  do {
-
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%s%s%s%s",word[0],word[1],word[2],word[3]);
-
-    /* empty line */
-    if (n < 0) continue;
-
-    /* atom types and initial coordinates */
-    if ( (strstr(word[0],"************") != 0 &&
-          strcmp(word[1],"ATOMS"       ) == 0 && 
-          strstr(word[2],"************") != 0 ) ) {
-      /* NR TYPE X(bohr) Y(bohr) Z(bohr) MBL */
-      GET_LINE(buffer, data->file);
-
-      numatoms=0;
-      data->initatoms=NULL;
-      while (1) {
-        qm_atom_t *atm;
-      
-        GET_LINE(buffer, data->file);
-        /* end of ATOMS block */
-        if (strstr(buffer, "*************************") != NULL)
-          break;
-        
-        data->initatoms=realloc(data->initatoms,(numatoms+1)*sizeof(qm_atom_t));
-        atm = data->initatoms + numatoms;
-        
-        n=sscanf(buffer,"%*d%s%g%g%g", atm->type, &atm->x, &atm->y, &atm->z);
-        if (n != 4) {
-          free(data->initatoms);
-          data->initatoms=NULL;
-          vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Failed to parse initial" 
-                        " coordinates. Stopping.\n");
-          return FALSE;
-        }
-        atm->atomicnum=get_pte_idx(atm->type);
-        atm->x *= BOHR_TO_ANGS;
-        atm->y *= BOHR_TO_ANGS;
-        atm->z *= BOHR_TO_ANGS;
-        ++numatoms;
-      };
-      data->numatoms = numatoms;
-      *natoms = numatoms;
-      
-    } else if ( (strcmp(word[0],"NUMBER" ) == 0 &&
-                 strcmp(word[2],"STATES:") == 0 ) ) {
-      numstates=atoi(word[3]);
-
-    } else if ( (strcmp(word[0],"NUMBER" ) == 0 &&
-                 strcmp(word[2],"ELECTRONS:") == 0 ) ) {
-      numelectrons=(int) (atof(word[3]) + 0.5); /* XXX */
-      data->num_electrons = numelectrons;
-      
-    } else if (strcmp(word[0],"CHARGE:" ) == 0 ) {
-      totalcharge =(int) (atof(word[1]) + 0.5); /* XXX */
-      data->totalcharge = totalcharge;
-      
-    } else if (strcmp(word[0],"OCCUPATION" ) == 0 ) {
-      ; /* XXX. */
-      
-    } else if ( (strcmp(word[0],"CELL" ) == 0 &&
-                 strcmp(word[1],"DIMENSION:") == 0 ) ) {
-      n=sscanf(buffer,"%*s%*s%g%g%g%g%g%g",data->initcell,data->initcell+1, 
-               data->initcell+2,data->initcell+3,data->initcell+4,data->initcell+5);
-      
-    /*  
-        PROJECT WAVEFUNCTION ON ATOMIC ORBITALS EVERY           10 STEPS
-    */
-    } else if ( (strcmp(word[0],"PROJECT" ) == 0 &&
-                 strcmp(word[1],"WAVEFUNCTION") == 0 ) ) {
-        data->have_wavefunction=1;
-    /*
-      DIPOLE MOMENT CALCULATION 
-      STORE DIPOLE MOMENTS EVERY                          10 STEPS
-      WANNIER FUNCTION DYNAMICS 
-    */
-    } else if ( (strcmp(word[0],"WANNIER" ) == 0 &&
-                 strcmp(word[1],"FUNCTION") == 0 ) ) {
-        if (data->have_wavefunction) {
-            data->have_wavefunction=2;
-        }
-    }
-  } while( strcmp(word[0],"INITIALIZATION") || 
-           strcmp(word[1],"TIME:") );
-
-  if (numstates >= numelectrons) 
-    data->scftyp = SCFTYP_UHF;
-
-  switch (data->scftyp) {
-    case SCFTYP_RHF:
-      data->occ_orbitals_A = numstates;
-      data->occ_orbitals_B = 0;
-      break;
-    case SCFTYP_UHF:            /* XXX: this is most likely wrong. check! */
-      data->occ_orbitals_A = numstates/2;
-      data->occ_orbitals_B = numstates/2;
-      break;
-    default:
-      break;
-  }
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Atoms: %d   Charge: %d   Multiplicity: %d\n", 
-                data->numatoms, data->totalcharge, data->multiplicity);
-
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Run-type: %s, SCF-type: %s\n",
-                runtypes[data->runtyp], scftypes[data->scftyp]);
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) using %s basis set.\n", data->basis_string);
-
-  read_first_frame(data);
-
-  get_final_info(data);
-  
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) found %d QM data frames.\n", data->num_frames);
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) num_frames_read = %d\n", 
-                data->num_frames_read);
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) num_frames_sent = %d\n", 
-                data->num_frames_sent);
-#endif
-  return TRUE;
-}
-
-/**********************************************************
- *
- * this subroutine checks if the provided files is
- * actually a CPMD file and gathers its version code.
- *
- **********************************************************/
-static int have_cpmd(gaussiandata *data) 
-{
-  char word[4][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ];
-  char *ptr;
-  int i = 0;
- 
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  /* check if the file is CPMD format 
-   * CPMD output typically begins with:
-   *  'PROGRAM CPMD STARTED'
-   */
-  i=0; /* check only the first 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    ++i;
-  } while( (strcmp(word[0],"PROGRAM") || 
-            strcmp(word[1],"CPMD") || 
-            strcmp(word[2],"STARTED")) && (i<100) );
-  if (i>=100) return FALSE;
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Analyzing CPMD log file: %s\n",data->file_name);
-  
-  /* now read on until we find the block of text with encoded version
-   * number and compile date. */
-  i=0; /* check only the next 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s",word[0],word[1]);
-  } while ( (i<100) &&  (strcmp(word[0],"VERSION")) );
-  if (i>=100) return FALSE;
-
-  strcpy(data->version_string,word[1]);
-
-  /* now split version number strings */
-  ptr=strtok(word[1],"._");
-  data->version = 10000*atoi(ptr);
-  ptr=strtok(NULL,"._");
-  data->version += 100*atoi(ptr);
-  ptr=strtok(NULL,"._");
-  data->version += atoi(ptr);
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) CPMD version = %s  (Version code: %d)\n",
-                data->version_string, data->version);
-  return TRUE;
-}
-
-/*! read coordinates for old-style population analysis */
-static int read_first_frame(gaussiandata *data) {
-  
-  data->qm_timestep = NULL;
-
-  /* Read the basis set. */
-  get_internal_basis(data);
-
-  /* the angular momentum is populated in get_wavefunction 
-   * which is called by get_traj_frame(). We have obtained
-   * the array size wavef_size already from the basis set
-   * statistics */
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Reserving storage for %d cartesian atomic basis functions\n",
-                data->wavef_size);
-  SAFE_CALLOC(data->angular_momentum,int,3*data->wavef_size);
-
-  if (data->version < 31303) {
-
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) ##################################"
-                  "####################################\n");
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) This version of CPMD does not print "
-                  "the actual coordinates on properties runs.\n");
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) Using initial coordinates from the "
-                  "input file instead.\n");
-    vmdcon_printf(VMDCON_WARN,
-                  "cpmdlogplugin) These coodinates are most likely "
-                  "inconsistent with the projection.\n Try the following:\n\n"
-                  "set cur [atomselect top all]\n"
-                  "set new [atomselect [mol new GEOMETRY.xyz] all]\n"
-                  "$cur set {x y z} [$new get {x y z}]\n"
-                  "$cur delete; mol delete [$new molid]; $new delete\n\n");
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) ##################################"
-                  "####################################\n");
-    /* Try to read wavefunction and orbital energies */
-    SAFE_CALLOC(data->qm_timestep,qm_timestep_t,1);
-    if (get_wavefunction(data, data->qm_timestep, NULL) == FALSE) {
-      vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) No wavefunction present for timestep %d\n", data->num_frames_read);
-      free(data->qm_timestep);
-      data->qm_timestep=NULL;
-    } else {
-      vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Wavefunction found.\n");
-      data->num_frames_read=1;
-      data->num_frames=1;
-    }
-  } else {
-    /* don't copy coordinates yet. we have the newer version of CPMD
-     * that prints them right before each projection. */
-    data->num_frames = 0;
-  }
-  
-  return TRUE;
-}
-
-
-/*******************************************************
- *
- * this function reads in the basis set data from 
- * <basis>.gbs or $VMDDIR/basis/<basis>.gbs
- *
- * XXX: this is the same function as in gaussianplugin
- * ******************************************************/
-int get_internal_basis(gaussiandata *data) {
-
-  char *vmddir=NULL;
-  FILE *fp;
-  char buffer[BUFSIZ];
-  char word[3][MOLFILE_BUFSIZ];
-  char filepath[256];
-  int  i,n, wavef_size; 
-
-  /* no point in adding a basis set if we already have this information */
-  if (data->have_basis) return TRUE;
-
-  /* try to open basis set database file. a file in the current
-   * directory takes priority over what is shipped with VMD. */
-  sprintf(filepath,"%s.gbs",data->gbasis);
-  fp=fopen(filepath,"rb");
-  if (fp == NULL) {
-      vmddir=getenv("VMDDIR");
-      if (vmddir == NULL) {
-          vmddir="/usr/local/lib/vmd";
-      }
-      sprintf(filepath,"%s/basis/%s.gbs",vmddir,data->gbasis);
-      fp=fopen(filepath,"rb");
-  }
-
-  if (fp == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) failed to read basis set "
-                  "from data base file %s\n", filepath);
-    data->num_shells_per_atom=NULL;
-    data->have_basis=FALSE;
-    return FALSE;
-  } else {
-    vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) reading basis set "
-                  "from data base file %s\n", filepath);
-  }
-  data->wavef_size=0;
-  
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  SAFE_CALLOC(data->basis_set,basis_atom_t,data->numatoms);
-
-  for (i=0; i < data->numatoms; ++i) {
-    int numshells, numprim;
-    int numread, ishell;
-    float scalef;
-    shell_t *shell;
-    
-    /* search for the characteristic first line starting with '****'. */
-    rewind(fp);
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-    } while(strcmp(word[0],"****"));
-  
-    /* search for an entry for the current atom in the format '<name> 0'. */
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      if (feof(fp)) {
-        free(data->basis_set);
-        data->basis_set=NULL;
-        data->num_shells_per_atom=NULL;
-        data->have_basis=FALSE;
-        vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) EOF in data base "
-                      "file %s while looking for element %s.\n", filepath, 
-                      get_pte_label(data->initatoms[i].atomicnum), buffer);
-        fclose(fp);
-        return FALSE;
-      }
-      n=sscanf(buffer,"%s%s",word[0],word[1]);
-    } while ( (n != 2) || strcmp(word[1],"0") ||
-              (strcmp(word[0],get_pte_label(data->initatoms[i].atomicnum))) );
-    
-    strncpy(data->basis_set[i].name,data->gbasis,sizeof(data->gbasis));
-    
-    numshells=0;
-    shell=NULL;
-
-    /* read basis set until end of element */
-    do {
-
-      fgets(buffer, sizeof(buffer), fp);
-      if (strstr(buffer,"****")) break;
-      if (ferror(fp)) {
-        vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) read error in data "
-                      "base file %s while reading basis of element %s.\n", 
-                      filepath, get_pte_label(data->initatoms[i].atomicnum));
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      numread=sscanf(buffer,"%s%d%f",word[0],&numprim,&scalef);
-      if (numread == 3) {
-#if CPMDLOG_DEBUG && CPMDLOG_BASIS_DEBUG
-        vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) atom: %d, element: %s, shell: %d "
-                      "%s-type shell, %d primitives, scalefactor %f\n", i,
-                      get_pte_label(data->initatoms[i].atomicnum), numshells+1, 
-                      word[0], numprim, scalef);
-#endif
-        ;
-      } else {
-        vmdcon_printf(VMDCON_ERROR, 
-                      "cpmdlogplugin) basis set parse error: %s",buffer);
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      ishell=numshells;
-      ++numshells;
-      shell=realloc(shell,numshells*sizeof(shell_t));
-      shell[ishell].numprims=numprim;
-      shell[ishell].symmetry=shellsymm_int(word[0]);
-      shell[ishell].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      data->num_basis_funcs += numprim;
-
-      switch(shell[ishell].symmetry) {
-        case S_SHELL:
-          data->wavef_size += 1;
-          break;
-        case P_SHELL:
-          data->wavef_size += 3;
-          break;
-        case SP_S_SHELL:
-          data->wavef_size += 4;
-          break;
-        case D_SHELL:
-          data->wavef_size += 6;  /* cartesian representation! */
-          break;
-        case SPD_S_SHELL:
-          data->wavef_size += 10;  /* cartesian representation! */
-          break;
-        case F_SHELL:
-          data->wavef_size += 10;  /* cartesian representation! */
-          break;
-        default:
-          break;
-      }
-      
-      if (shell[ishell].symmetry == SP_S_SHELL) {
-        ++numshells;
-        shell=realloc(shell,numshells*sizeof(shell_t));
-        shell[ishell+1].numprims=numprim;
-        shell[ishell+1].symmetry=SP_P_SHELL;
-        shell[ishell+1].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-        data->num_basis_funcs += numprim;
-      }
-
-      for (n=0; n<numprim; ++n) {
-        fgets(buffer, sizeof(buffer), fp);
-        if (ferror(fp)) {
-          vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) read error in data "
-                        "base file %s while reading basis of element %s.\n", 
-                        filepath, get_pte_label(data->initatoms[i].atomicnum));
-          free(data->basis_set);
-          data->basis_set=NULL;
-          return FALSE;
-        }
-        sscanf(buffer,"%s%s%s", word[0],word[1],word[2]);
-        fix_fortran_exp(word[0]);
-        shell[ishell].prim[n].exponent=atof(word[0])*scalef*scalef;
-        fix_fortran_exp(word[1]);
-        shell[ishell].prim[n].contraction_coeff=atof(word[1]);
-        if (shell[ishell].symmetry == SP_S_SHELL) {
-          shell[ishell+1].prim[n].exponent=shell[ishell].prim[n].exponent;
-          fix_fortran_exp(word[2]);
-          shell[ishell+1].prim[n].contraction_coeff=atof(word[2]);
-        }
-      }
-    } while(1);
-
-  
-    /* store shells in atom */
-    data->basis_set[i].numshells = numshells;
-    data->basis_set[i].shell = shell;
-    
-    /* store the total number of basis functions */
-    data->num_shells += numshells;
-  }
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Parsed %d uncontracted basis functions. \n", 
-                data->num_basis_funcs);
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  data->have_basis = TRUE;
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- * Convert shell symmetry type from char to int.
- * XXX: same function exists in gaussianplugin.
- ************************************************ */
-static int shellsymm_int(char *symm) {
-  int shell_symmetry;
-
-  switch (toupper(symm[0])) {
-    case 'S':
-      if (symm[1] == '\0') {
-        shell_symmetry = S_SHELL;
-      } else if (toupper(symm[1]) == 'P') {
-        if (symm[2] == '\0') {
-          shell_symmetry = SP_S_SHELL;
-        } else if (toupper(symm[1]) == 'D') {
-          shell_symmetry = SPD_S_SHELL;
-        } else {
-          shell_symmetry = UNK_SHELL;
-        } 
-      } else {
-        shell_symmetry = UNK_SHELL;
-      }
-      break;
-    case 'L':
-      shell_symmetry = SP_S_SHELL;
-      break;
-    case 'M': 
-      shell_symmetry = SP_P_SHELL;
-      break;
-    case 'P':
-      shell_symmetry = P_SHELL;
-      break;
-    case 'D':
-      shell_symmetry = D_SHELL;
-      break;
-    case 'F':
-      shell_symmetry = F_SHELL;
-      break;
-    case 'G':
-      shell_symmetry = G_SHELL;
-      break;
-    default:
-      shell_symmetry = UNK_SHELL;
-      break;
-  }
-
-  return shell_symmetry;
-}
-
-
-/** Populate the flat arrays containing the basis set data. */
-static int fill_basis_arrays(gaussiandata *data) {
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0 ;
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_symmetry;
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per primitive gaussian, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  SAFE_CALLOC(basis,float,2*data->num_basis_funcs);
-  SAFE_CALLOC(shell_symmetry,int,data->num_shells);
-  SAFE_CALLOC(num_shells_per_atom,int,data->numatoms);
-  SAFE_CALLOC(num_prim_per_shell,int,data->num_shells);
-  
-  /* place pointers into struct gaussiandata */
-  data->basis = basis;
-  data->shell_symmetry = shell_symmetry;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell = num_prim_per_shell;
-
-  for(i=0; i<data->numatoms; i++) {
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_symmetry[shellcount] = data->basis_set[i].shell[j].symmetry;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-  return TRUE;
-}
-
-/** this function extracts the trajectory information
- *  from the output file */
-static int get_traj_frame(gaussiandata *data) {
-  qm_timestep_t *cur_qm_ts;
-  char buffer[BUFSIZ];
-  char word[4][MOLFILE_BUFSIZ];
-  int n,i;
-  
-
-  buffer[0] = '\0';
-  word[0][0] = '\0';
-  word[1][0] = '\0';
-  word[2][0] = '\0';
-  word[3][0] = '\0';
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Timestep %d: ====\n", 
-                data->num_frames_read);
-#endif
-
-  /* allocate more memory for the timestep array */
-  data->qm_timestep = 
-    (qm_timestep_t *)realloc(data->qm_timestep, 
-                             (data->num_frames_read+1)*sizeof(qm_timestep_t));
-
-  /* get a convenient pointer to the current qm timestep */
-  cur_qm_ts = data->qm_timestep+data->num_frames_read;
-  memset(cur_qm_ts, 0, sizeof(qm_timestep_t));
-
-  /* search for data */
-  while (1) {
-
-    GET_LINE(buffer,data->file);
-    n = sscanf(buffer,"%s%s%s%s",word[0],word[1],word[2],word[3]);
-    
-    /* empty or uninteresting line */
-    if (n < 3) continue;
-
-    /* coordinates relevant for projection.
-     * this needs a CPMD version > 3.13.2
- ********************* PROJECTION COORDINATES ********************
-   NR   TYPE        X(bohr)        Y(bohr)        Z(bohr)    
-    1      B       8.536664      10.525423      10.202766
-    2      B      10.195353       8.831898      12.528872
-    3      H      10.467571       8.964546       9.816927
-    4      H       8.327684      10.371750      12.680045
-    5      H      12.222474       9.664531      13.239192
-    6      H       9.579094       6.722748      12.777072
-    7      H       6.516216       9.875605       9.562778
-    8      H       9.404536      12.649641       9.952504
- ****************************************************************
- */
-    if ( (strstr(word[0],"************") != 0 &&
-          strcmp(word[1],"PROJECTION"  ) == 0 && 
-          strcmp(word[2],"COORDINATES" ) == 0 && 
-          strstr(word[3],"************") != 0 ) ) {
-
-      /* NR TYPE X(bohr) Y(bohr) Z(bohr) */
-      GET_LINE(buffer, data->file);
-
-      if (data->initatoms==NULL) {
-        vmdcon_printf(VMDCON_ERROR,"why is initatoms NULL?\n");
-        return FALSE;
-      }
-
-      for (i=0; i < data->numatoms; ++i) {
-        qm_atom_t *atm;
-      
-        GET_LINE(buffer, data->file);
-        atm = data->initatoms + i;
-        
-        n=sscanf(buffer,"%*d%*s%g%g%g", &atm->x, &atm->y, &atm->z);
-        
-        if (n != 3) {
-          vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Failed to parse "
-                        "projection coordinates. Stopping.\n");
-          return FALSE;
-        }
-        atm->atomicnum=get_pte_idx(atm->type);
-        atm->x *= BOHR_TO_ANGS;
-        atm->y *= BOHR_TO_ANGS;
-        atm->z *= BOHR_TO_ANGS;
-      }
-      buffer[0] = '\0';
-#if CPMDLOG_DEBUG
-      vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Coordinates found for timestep %d\n", data->num_frames_read);
-#endif
-    } else if ( (strcmp(word[0],"WAVEFUNCTIONS") == 0) &&
-         (strcmp(word[2],"ATOMIC"       ) == 0) &&
-         (strcmp(word[3],"ORBITAL"      ) == 0) ) {
-
-      /* Try to read wavefunction and orbital energies */
-      if (get_wavefunction(data, cur_qm_ts, NULL) == FALSE) {
-          vmdcon_printf(VMDCON_WARN, "cpmdlogplugin) No wavefunction present for timestep %d\n", data->num_frames_read);
-          /* XXX: add flag to ignore wfn */
-      }
-      if (data->have_wavefunction == 2) {
-#if 0          
-          /* Try to read localized wavefunctions  */
-          /* XXX: used offset or something. */
-          if (get_wavefunction(data, cur_qm_ts+XXX) == FALSE) {
-              vmdcon_printf(VMDCON_WARN, "cpmdlogplugin) No localized wavefunction present for timestep %d\n", data->num_frames_read);
-          }
-#endif
-      }
-      buffer[0] = '\0';
-      break; /* XXX */
-    } else if ( (strcmp(word[0],"POPULATION") == 0) &&
-                (strcmp(word[1],"ANALYSIS"  ) == 0) &&
-                (strcmp(word[3],"PROJECTED" ) == 0) ) {
-#if 0
-      if (get_population(data, cur_qm_ts)) {
-        vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Mulliken charges found\n");
-      }
-#endif
-      buffer[0] = '\0';
-      
-    } else if ( strcmp(word[0],"*"     ) == 0 &&
-                strcmp(word[1],"TIMING") == 0 && 
-                strcmp(word[2],"*"     ) == 0 ) {
-      data->end_of_trajectory=FALSE;
-      break;
-    } else if (feof(data->file)) {
-      data->end_of_trajectory=TRUE;
-      break;
-    }
-  }
-
-  /* next timestep or end of file */
-  data->num_frames_read++;
-
-  return TRUE;
-}
-
-
-
-/*********************************************************
- *
- * this function reads the actual wavefunction, which is
- * punched at the end of the log file
- *
- **********************************************************/
-static int get_wavefunction(gaussiandata *data, qm_timestep_t *ts, 
-                            qm_wavefunction_t *wf)
-{
-  float *orbital_energies;
-  float *wave_function;
-  char buffer[BUFSIZ];
-#define ORBSPERBLOCK 8
-  char word[ORBSPERBLOCK+1][MOLFILE_BUFSIZ];
-  int orbital_counter = 0;
-  int i = 0, j = 0, num_values = 0;
-  int total_orbs = data->occ_orbitals_A + data->occ_orbitals_B;
-  int num_orbs;
-
-  if (wf == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  wf->type = MOLFILE_WAVE_CANON;
-  wf->spin = SPIN_ALPHA;
-  
-  buffer[0] = '\0';
-  for (i=0; i <= ORBSPERBLOCK ; i++) word[i][0] = '\0';
-  /*
-   * Scan for something like this:
-      ORBITAL      1       2       3       4       5       6       7       8
-  COMPLETNESS    0.972   0.951   0.972   0.972   0.951   0.972   0.951   0.972
-  OCCUPATION     2.000   2.000   2.000   2.000   2.000   2.000   2.000   2.000
-  1   B  S      -0.064  -0.163   0.064   0.365   0.163  -0.365   0.163  -0.365
-         Px      0.000  -0.170   0.000   0.000  -0.170   0.000  -0.170   0.000
-         Pz      0.086   0.227  -0.086   0.181  -0.227  -0.181  -0.227  -0.181
-         Py      0.043   0.000   0.043   0.411   0.000   0.411   0.000   0.411
-  2   B  S       0.365  -0.163  -0.365  -0.064   0.163   0.064   0.163   0.064
-         Px      0.000  -0.170   0.000   0.000  -0.170   0.000  -0.170   0.000
-         Pz     -0.181  -0.227   0.181  -0.086   0.227   0.086   0.227   0.086
-         Py     -0.411   0.000  -0.411  -0.043   0.000  -0.043   0.000  -0.043
-  3   H  S      -0.049   0.200   0.049  -0.049   0.540   0.049   0.540   0.049
-  4   H  S      -0.049  -0.540   0.049  -0.049  -0.200   0.049  -0.200   0.049
-  5   H  S       0.520   0.078   0.041   0.056  -0.078   0.031  -0.078   0.031
-    ...
-   */
-
-
-  /* Reserve space for arrays storing wavefunction and orbital
-   * energies. For the wavefunction we reserve the number
-   * of alpha orbitals squared, for unrestricted twice as much.
-   * Accordingly, for the energies I use the number of A orbitals 
-   * In gaussian the number of alpha and beta orbitals is always 
-   * the same. */
-
-#if 0
-  SAFE_CALLOC(wave_function,float,data->wavef_size*num_orbs);
-  SAFE_CALLOC(orbital_energies,float,num_orbs);
-  ts->wave_function    = wave_function;
-  ts->orbital_energies = orbital_energies;
-
-
-  while (orbital_counter < num_orbs) {
-    /* read up to line of orbital indices */
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s",word[0]);
-    } while (strcmp(word[0],"ORBITAL"));
-
-    GET_LINE(buffer, data->file);           /* completeness */
-    num_orbs = sscanf(buffer,"%*s%s%s%s%s%s%s%s%s",word[0],word[1],
-                      word[2],word[3],word[4],word[5],word[6],word[7]);
-
-    /* we don't have orbital energies here, but we
-     * can use it for the completenes parameter. */
-    for(i=0; i<num_orbs; i++) 
-      *(orbital_energies+i) = atof(word[i]);
-
-    GET_LINE(buffer, data->file);           /* occupation */
-             
-    /* step orbital energy pointer */
-    orbital_energies = orbital_energies+num_orbs;
-    orbital_counter += num_orbs;
-
-    /* read in the wavefunction */
-    for (i=0; i<data->wavef_size; i++) {
-      int xexp=0, yexp=0, zexp=0;
-
-      /* read in the wavefunction coefficients for up 
-       * to 8 orbitals at a time line by line */
-      GET_LINE(buffer, data->file);
-      num_values = sscanf(buffer+7,"%4s%s%s%s%s%s%s%s%s", word[0], 
-                          word[1], word[2],word[3], word[4], 
-                          word[5], word[6], word[7], word[8]);
-
-      /* handle magenetic quantum number. in cartesian basis the
-       * labels are: S, PX, PY, PZ, DXX, DXY, DXZ, DYY, DYZ, DZZ, ...*/
-      for (j=1; j<strlen(word[0]); j++) {
-        switch (toupper(word[0][j])) {
-          case 'X':
-            xexp++;
-            break;
-          case 'Y':
-            yexp++;
-            break;
-          case 'Z':
-            zexp++;
-            break;
-            /* if we have pure d/f-functions the nomenclature changes to 
-             * 'D 0', 'D-1', 'D+1', 'D-2', 'D+2' */
-          case '+': /* fallthrough */
-          case '-': /* fallthrough */
-          case '0': /* fallthrough */
-          case '1': /* fallthrough */
-          case '2': /* fallthrough */
-            vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) pure basis function "
-                          "detected: '%s'. bailing out...\n", word[0]);
-            free(ts->wave_function);
-            wave_function=NULL;
-            free(ts->orbital_energies);
-            ts->orbital_energies=NULL;
-            return FALSE;
-            break;
-          default:
-            /* do nothing */
-            break;
-        }
-      }
-      data->angular_momentum[3*i  ] = xexp;
-      data->angular_momentum[3*i+1] = yexp;
-      data->angular_momentum[3*i+2] = zexp;
-#if CPMDLOG_DEBUG && CPMDLOG_BASIS_DEBUG
-      fprintf(stderr,"%s:%d orbital %d/%d  function %d/%s: %d %d %d\n", 
-              __FILE__, __LINE__, num_orbs, orbital_counter, 
-              i, word[0], xexp, yexp, zexp);
-#endif
-
-      /* each orbital has data->wavef_size entries, 
-       * hence we have to use this number as offset when storing 
-       * them in groups of five */
-      for (j=0 ; j<num_values-1; j++) {
-        wave_function[j*data->wavef_size+i] = atof(word[j+1]);
-      }
-    }
-    /* move wavefunction pointer to start of next block of orbitals */
-    wave_function = wave_function + num_orbs*data->wavef_size;
-    /* XXX: FIXME test with open shell run */
-    if ((data->scftyp == SCFTYP_UHF) && (orbital_counter==data->wavef_size)) {
-      GET_LINE(buffer, data->file);
-    }
-  }
-
-  /* store the number of orbitals read in */
-  ts->wavef_size = orbital_counter;
-#endif
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Number of orbitals scanned: %d \n",
-                orbital_counter);
-#endif
-  return TRUE;
-}
-
-
-/* Read the population analysis section.
- * Currently we parse only the Mulliken charges
- * but we might want to add support for populations
- * and for Lowdin analysis. */
-static int get_population(gaussiandata *data, qm_timestep_t *ts) {
-  int i;
-  char buffer[BUFSIZ];
-  data->have_mulliken = FALSE;
-
-
-  /* Read Mulliken charges if present */
-  ts->mulliken_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (!ts->mulliken_charges) {
-    PRINTERR; 
-    return FALSE;
-  }
-  
-  for (i=0; i<data->numatoms; i++) {
-    int n;
-    float mullpop, mullcharge, lowpop, lowcharge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*i%*s%f%f%f%f",
-               &mullpop, &mullcharge, &lowpop, &lowcharge);
-    if (n!=4) return FALSE;
-    ts->mulliken_charges[i] = mullcharge;
-  }
-
-  if (i!=data->numatoms) return FALSE;
-
-  data->have_mulliken = TRUE;
-  return TRUE;
-}
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cpmdlog";
-  plugin.prettyname = "CPMD 3.x output ";
-  plugin.author = "Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 0;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "out";
-  plugin.open_file_read = open_cpmdlog_read;
-  plugin.read_structure = read_cpmdlog_structure;
-  plugin.close_file_read = close_cpmdlog_read;
-
-  plugin.read_qm_metadata = read_cpmdlog_metadata;
-  plugin.read_qm_rundata  = read_cpmdlog_rundata;
-
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-#endif
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-  plugin.read_timestep = read_timestep;
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int numatoms, i, j, optflags;
-  molfile_atom_t *atoms;
-  molfile_timestep_t timestep;
-  molfile_metadata_t metadata;
-  molfile_timestep_metadata_t ts_metadata;
-  molfile_qm_timestep_metadata_t qm_ts_metadata;
-  molfile_qm_metadata_t qm_metadata;
-  molfile_qm_timestep_t qm_ts;
- 
-  void *v;
-
-  while (--argc) {
-    ++argv;
-    v = open_cpmdlog_read(*argv, "log", &numatoms);
-    if (!v) {
-      fprintf(stderr, "open_cpmdlog_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_cpmdlog_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", numatoms);
-    atoms = (molfile_atom_t *)malloc(sizeof(molfile_atom_t)*numatoms);
-    read_cpmdlog_structure(v,&optflags, atoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*numatoms);
-
-    
-    while (1) {
-      memset(&ts_metadata, 0, sizeof(molfile_timestep_metadata_t));
-      read_timestep_metadata(v, &ts_metadata);
-      memset(&qm_metadata, 0, sizeof(molfile_qm_metadata_t));
-      read_qm_timestep_metadata(v, &qm_ts_metadata);
-      qm_ts.scfenergies = (double *)malloc(qm_ts_metadata.num_scfiter*sizeof(double));
-      qm_ts.wave        = (molfile_qm_wavefunction_t *)malloc(qm_ts_metadata.num_wavef
-                                                              *sizeof(molfile_qm_wavefunction_t));
-      memset(qm_ts.wave, 0, qm_ts_metadata.num_wavef*sizeof(molfile_qm_wavefunction_t));
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        qm_ts.wave[j].wave_coeffs = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]
-                                                     * qm_ts_metadata.wavef_size * sizeof(float));
-        qm_ts.wave[j].orbital_energies = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]*sizeof(float));
-      }
-      qm_ts.gradient = (float *) malloc(3*numatoms*sizeof(float));
-      if (read_timestep(v, numatoms, &timestep, &qm_metadata, &qm_ts)) break;
-      /* do something with data */
-      /* XXX */
-
-      free(qm_ts.gradient);
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        free(qm_ts.wave[j].wave_coeffs);
-        free(qm_ts.wave[j].orbital_energies);
-      }
-      free(qm_ts.wave);
-      free(qm_ts.scfenergies);
-      i++;
-    }
-    fprintf(stderr, "ended read_timestep on frame %d\n", i);
-    close_cpmdlog_read(v);
-  }
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cpmdplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cpmdplugin.c
deleted file mode 100644
index d31eddc526339d06b5b2033cb1b10fe8b3535d56..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cpmdplugin.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: cpmdplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.15 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "unit_conversion.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  const char *file_name;
-} cpmddata;
- 
-static void *open_cpmd_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  cpmddata *data;
-  char linebuf[255];
-  int i, nfi_first, nfi_current, atomcount;
- 
-  printf("cpmd) trying to open file '%s'\n",filename);
-	  
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  data = (cpmddata *)malloc(sizeof(cpmddata));
-  data->file = fd;
-  data->file_name = filename;
-
-  nfi_first = 0;
-  nfi_current = 0;
-
-  /* first column is the current timestep number  */
-  fgets(linebuf, 255, fd);
-  i = sscanf(linebuf, "%d", &nfi_first);
-  if (i < 1) {
-    fprintf(stderr, "read) cpmd trajectory file '%s' should have the timestep number "
-            "in the first column\n", filename);
-    return NULL;
-  }
-  atomcount   = 0;
-  nfi_current = nfi_first;
-
-  /* loop through file until the contents of the first column
-     changes, indicating the end of a configuration */
-  while ((nfi_first == nfi_current) && !ferror(fd) && !feof(fd)) {
-    ++atomcount;
-    fgets(linebuf, 255, fd);
-    i = sscanf(linebuf, "%d", &nfi_current);
-    if (i < 1) {
-      fprintf(stderr, "read) cpmd trajectory file '%s' should have the "
-              "timestep number in the first column\n", filename);
-      return NULL;
-    }
-  }
-  printf("cpmd) found %d atoms in first timestep\n",atomcount);
-  *natoms = atomcount;
-  data->numatoms=*natoms;
-
-  /* rewind to the beginning for reading the coordinates elsewhere.*/
-  rewind(fd);
-
-  return data;
-}
-
-static int read_cpmd_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  int i, j;
-  char *k;
-  float coord;
-  molfile_atom_t *atom;
-  cpmddata *data = (cpmddata *)mydata;
-  
-  printf("cpmd) trying to read structure\n");
-  *optflags = MOLFILE_NOOPTIONS; /* no optional data */
-
-  for(i=0;i<data->numatoms;i++) {
-    char buffer[1024];
-    char fbuffer[1024];
-    k = fgets(fbuffer, 1024, data->file);
-    atom = atoms + i;
-    j=sscanf(fbuffer, "%s %f %f %f", buffer, &coord, &coord, &coord);
-    if (k == NULL) {
-      fprintf(stderr, "cpmd structure) missing atom(s) in file '%s'\n",data->file_name);
-      fprintf(stderr, "cpmd structure) expecting '%d' atoms, found only '%d'\n",data->numatoms,i+1);
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "cpmd structure) missing type or coordinate(s) in file '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    }
-
-    /* I don't know what to do with these */
-    strncpy(atom->name, buffer, sizeof(atom->name));
-    strncpy(atom->type, buffer, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    /* skip to the end of line */
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cpmd_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j, nfi_first, nfi_current;
-  char fbuffer[1024];
-  float x, y, z;
-  const float bohr=BOHR_TO_ANGS;
-  char *k;
-  
-  cpmddata *data = (cpmddata *)mydata;
-  nfi_first = nfi_current = -1;
-  
-  /* read the coordinates */
-  for (i=0; i<natoms; i++) {
-
-    k = fgets(fbuffer, 1024, data->file);
-
-    /* read next line if this is a continuation indicator */
-    if (strstr(fbuffer, "NEW DATA")) {
-      k = fgets(fbuffer, 1024, data->file);
-    }
-    j = sscanf(fbuffer, "%d %f %f %f", &nfi_current, &x, &y, &z);
-    if (nfi_first < 0) nfi_first = nfi_current;
-    
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "cpmd timestep) missing or illegal data in file"
-              " '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (nfi_first != nfi_current) {
-      fprintf(stderr, "cpmd timestep) short record in timestep %d of file"
-              " '%s' for atom '%d'\n",nfi_first, data->file_name,i+1);
-    }
-    
-    ts->coords[3*i  ] = x*bohr;
-    ts->coords[3*i+1] = y*bohr;
-    ts->coords[3*i+2] = z*bohr;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_cpmd_read(void *mydata) {
-  cpmddata *data = (cpmddata *)mydata;
-  
-  fclose(data->file);
-  free(data);
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cpmd";
-  plugin.prettyname = "CPMD";
-  plugin.author = "Axel Kohlmeyer, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cpmd";
-  plugin.open_file_read = open_cpmd_read;
-/*  plugin.read_structure = read_cpmd_structure; */
-  plugin.read_next_timestep = read_cpmd_timestep;
-  plugin.close_file_read = close_cpmd_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/crdplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/crdplugin.c
deleted file mode 100644
index 170f721a575fb05dd517ad338ceb3af89830585b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/crdplugin.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: crdplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.40 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * TODO: This plugin should probably be merged with the 'rst7' plugin, since
- *       the differences between them are minor, and there's no logical reason
- *       for them to be implemented completely independently as they are now.
- *       The major differences in formatting are in regard to the 6F12.7 (rst7)
- *       versus 10F8.3 (crd) ascii floating point conversion modes. 
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *file;
-  int has_box;
-  int numatoms;
-} crddata;
- 
-static void *open_crd_read(const char *filename, const char *filetype, 
-    int *natoms) {
- 
-  FILE *fd;
-  crddata *data;
- 
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  /* first line is title, so skip past it */
-  while (getc(fd) != '\n');
-
-  /* 
-   * CRD's don't store the number of atoms in the timestep, so we assume that
-   * the application will determine this for us.  
-   */
-  data = (crddata *)malloc(sizeof(crddata));
-  data->file = fd;
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-  /* filetype "crd" has no box; filetype "crdbox" does. */
-  data->has_box = strcmp(filetype, "crd"); 
-  return data;
-}
-
-/*
- * CRD files with box info are indistinguishable from regular CRD's.  
- * We regard CRD's with box info as a different file format.
- * CRD's don't tell how many atoms there are in each frame.  We therefore
- * rely on the numatoms field in the molfile_timestep_t parameter.
- */
-static int read_crd_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  crddata *crd = (crddata *)mydata;
-  int i, j;
-  float x, y, z;
-  float a, b, c;
-
-  /* Read in the atom coordinates */
-  for (i=0; i<natoms; i++) {
-    j = fscanf(crd->file, "%f %f %f", &x, &y, &z);
-    if (j == EOF) {
-      return MOLFILE_ERROR;
-    } else if (j <= 0) {
-      fprintf(stderr, "Problem reading CRD file\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* only save coords if we're given a valid ts pointer */ 
-    /* otherwise assume that VMD wants us to skip it.     */
-    if (ts != NULL) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-
-  /* Read the PBC box info. */
-  if (crd->has_box) {
-    j = fscanf(crd->file, "%f %f %f", &a, &b, &c);
-    if (j == EOF) {
-      printf("EOF in box\n");
-      return MOLFILE_ERROR;
-    } else if (j <= 0) {
-      printf("Problem reading box part of CRD file, scanf returned %d\n",j);
-      return MOLFILE_ERROR;
-    }
-
-    /* only save coords if we're given a valid ts pointer */ 
-    /* otherwise assume that VMD wants us to skip it.     */
-    if (ts != NULL) {
-      ts->A = a;
-      ts->B = b;
-      ts->C = c;
-
-      /* XXX periodic cell angles are only stored in the PARM file */
-      /* we should probably retrieve these from the already-loaded */
-      /* molecule when possible.                                   */
-      ts->alpha = 90.0;
-      ts->beta  = 90.0;
-      ts->gamma = 90.0;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_crd_read(void *mydata) {
-  crddata *crd = (crddata *)mydata;
-  fclose(crd->file);
-  free(crd);
-}
-
-static void *open_crd_write(const char *path, const char *filetype,
-    int natoms) {
-  crddata *crd;
-  FILE *fd;
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file %s for writing\n", path);
-    return NULL;
-  }
-  fprintf(fd, "TITLE : Created by VMD with %d atoms\n", natoms);
-  
-  crd = (crddata *)malloc(sizeof(crddata));
-  crd->file = fd;
-  crd->numatoms = natoms;
-  crd->has_box = strcmp(filetype, "crd"); 
-  return crd;
-}    
-  
-static int write_crd_timestep(void *v, const molfile_timestep_t *ts) {
-  crddata *crd = (crddata *)v;
-  int i;
-  int lfdone=0;
-  const int ndata = crd->numatoms * 3;
-
-  for (i=0; i<ndata; i++) {
-    lfdone = 0;
-    fprintf(crd->file, "%8.3f", ts->coords[i]);
-    if ((i+1) % 10 == 0) {
-      fprintf(crd->file, "\n"); 
-      lfdone = 1;
-    }
-  }
-  if (!lfdone)
-    fprintf(crd->file, "\n"); 
-    
-  if (crd->has_box) {
-    fprintf (crd->file, "%8.3f%8.3f%8.3f\n", ts->A, ts->B, ts->C);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_crd_write(void *v) {
-  crddata *crd = (crddata *)v;
-  fclose(crd->file);
-  free(crd);
-}
-
-/* registration stuff */
-    
-static molfile_plugin_t plugin;
-static molfile_plugin_t crdboxplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "crd";
-  plugin.prettyname = "AMBER Coordinates";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mdcrd,crd";
-  plugin.open_file_read = open_crd_read;
-  plugin.read_next_timestep = read_crd_timestep;
-  plugin.close_file_read = close_crd_read;
-  plugin.open_file_write = open_crd_write;
-  plugin.write_timestep = write_crd_timestep;
-  plugin.close_file_write = close_crd_write;
-
-  memcpy(&crdboxplugin, &plugin, sizeof(molfile_plugin_t));
-  crdboxplugin.name = "crdbox";
-  crdboxplugin.prettyname = "AMBER Coordinates with Periodic Box";
-
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  (*cb)(v, (vmdplugin_t *)&crdboxplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cubeplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cubeplugin.C
deleted file mode 100644
index aee24cf70990b61f2b3ca9a36d90ce5b1a62fbf8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/cubeplugin.C
+++ /dev/null
@@ -1,665 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: cubeplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.32 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-//
-// Plugin reader for Gaussian "cube" files
-//
-// Gaussian "cube" file format described here (as of 2013-09-24):
-// http://www.gaussian.com/g_tech/g_ur/u_cubegen.htm
-//
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "unit_conversion.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#include "periodic_table.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-static const float bohr = BOHR_TO_ANGS;
-
-// A format-independent structure to hold unit cell data
-typedef struct {
-  float A, B, C, alpha, beta, gamma;
-} cube_box;
-
-typedef struct {
-  FILE *fd;              // file descriptor
-  int nsets;             // number of volume datasets
-  int numatoms;          // number of atoms
-  bool coord;            // has coordinate data
-  long crdpos, datapos;  // seek offsets for coords and data
-  char *file_name;       // original filename 
-  float *datacache;      // temporary cache of orbital data prior to conversion
-  molfile_volumetric_t *vol; // volume data
-  float origin[3];       // origin, stored for periodic display hack 
-  float rotmat[3][3];    // rotation matrix, stored for periodic display hack
-  cube_box box;          // unit cell dimensions
-} cube_t;
-
-// Converts box basis vectors to A, B, C, alpha, beta, and gamma.  
-// Stores values in cube_box struct, which should be allocated before calling
-// this function.
-static int cube_readbox(cube_box *box, float *x, float *y, float *z) {
-  float A, B, C;
-
-  if (!box) {
-    return 1;
-  }
-
-  // provide defaults
-  box->A = 10.0;
-  box->B = 10.0;
-  box->C = 10.0;
-  box->alpha = 90.0;
-  box->beta  = 90.0;
-  box->gamma = 90.0;
-
-  // A, B, C are the lengths of the x, y, z vectors, respectively
-  A = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] );
-  B = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] );
-  C = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] );
-  if ((A<=0) || (B<=0) || (C<=0)) {
-    return 1;
-  }
-  box->A = A;
-  box->B = B;
-  box->C = C;
-
-  // gamma, beta, alpha are the angles between the x & y, x & z, y & z
-  // vectors, respectively
-  box->gamma = acos( (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])/(A*B) ) * 90.0/M_PI_2;
-  box->beta = acos( (x[0]*z[0]+x[1]*z[1]+x[2]*z[2])/(A*C) ) * 90.0/M_PI_2;
-  box->alpha = acos( (y[0]*z[0]+y[1]*z[1]+y[2]*z[2])/(B*C) ) * 90.0/M_PI_2; 
-
-  return 0;
-}
-
-// calculate and store origin and rotation matrix to realign everything later.
-static void cube_buildrotmat(cube_t *cube, float *o, float *a, float *b)
-{
-  // we rotate first around y and z to align a along the x-axis...
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  // ...then we rotate around x to put b into the xy-plane.
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  const double r[3][3] = { 
-    {               cph*cth,                    cph*sth,      sph},
-    {-sth*cps - sph*cth*sps,      cth*cps - sph*sth*sps,  cph*sps},
-    { sth*sps - sph*cth*cps,     -cth*sps - sph*sth*cps,  cph*cps}
-  };
-
-  for (int i=0; i<3; ++i) {
-    cube->origin[i] = o[i];
-    for (int j=0; j<3; ++j) {
-      cube->rotmat[i][j] = r[i][j];
-    }
-  }
-}
-
-// prototype.
-static void close_cube_read(void *v);
-
-static void *open_cube_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  cube_t *cube;
-  int xsize, ysize, zsize;
-  float a[3], b[3], c[3];
-  int i;
-  char readbuf[1024];
- 
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-
-  cube = new cube_t;
-  cube->fd = fd;
-  cube->vol = NULL;
-  cube->coord = false;
-  cube->file_name = strdup(filepath);
-  cube->datacache = NULL;
-
-  // initialize origin and rotmat to sensible defaults.
-  for (i=0; i<3; ++i) {
-      for (int j=0; j<3; ++j) {
-          cube->rotmat[i][j] = 0.0;
-      }
-  }
-  for (i=0; i<3; ++i) {
-      cube->origin[i] = 0.0;
-      cube->rotmat[i][i] = 1.0;
-  }
-
-  molfile_volumetric_t voltmpl; // base information for all data sets.
-
-  // read in cube file header information
-  fgets(readbuf, 1023, cube->fd);    // go on to next line
-
-  // identify this file, and read title string into dataset info
-  strcpy(voltmpl.dataname, "Gaussian Cube: ");
-  strncat(voltmpl.dataname, readbuf, 240);      // 240 is max space left after
-                                                //   "Gaussian Cube: "
-  fgets(readbuf, 1023, cube->fd); // skip second header line 
-
-  // read number of atoms and cube origin
-  // XXX: As of Gaussian09 revD01 this line contains an
-  // additional, yet undocumented (integer) number
-  // we read the entire and parse only the known numbers
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",
-              &cube->numatoms,
-              &voltmpl.origin[0],
-              &voltmpl.origin[1],
-              &voltmpl.origin[2]) != 4 )) {
-    close_cube_read(cube);
-    return NULL;
-  }
-
-  if (cube->numatoms > 0) {   // density cube file
-    cube->nsets = 1;          // this cube file contains only one data set
-  } else {
-    // cube file with orbitals => multiple densities.
-    cube->numatoms = - cube->numatoms;
-    cube->nsets = 0;          // we don't know yet how many data sets.
-  }
-  *natoms = cube->numatoms;
-
-
-  // read in cube axes and sizes
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",&xsize, &a[0], &a[1], &a[2]) != 4)) {
-    close_cube_read(cube);
-    return NULL;
-  }
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",&ysize, &b[0], &b[1], &b[2]) != 4)) {
-    close_cube_read(cube);
-    return NULL;
-  }
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",&zsize, &c[0], &c[1], &c[2]) != 4)) {
-    close_cube_read(cube);
-    return NULL;
-  }
-
-  // calculate number of samples in each dimension
-  voltmpl.xsize = xsize;
-  voltmpl.ysize = ysize;
-  voltmpl.zsize = zsize;
-  voltmpl.has_color = 0;
-
-  // to make the periodic display work, we need to rotate
-  // the cellvectors (and the coordinates) in such a way,
-  // that the a-vector is collinear with the x-axis and
-  // the b-vector is in the xy-plane. 
-  cube_buildrotmat(cube, voltmpl.origin, a, b);
-  // print warning, if the rotation will be significant:
-  if ((fabs((double) a[1]) + fabs((double) a[2]) + fabs((double) b[2]))
-      > 0.001) {
-    vmdcon_printf(VMDCON_WARN, 
-            "cubeplugin) Coordinates will be rotated to comply \n");
-    vmdcon_printf(VMDCON_WARN, 
-            "cubeplugin) with VMD's conventions for periodic display.\n");
-  }
-
-  // all dimensional units are always in Bohr
-  // so scale axes and origin correctly.
-  // NOTE: the angstroms are only allowed in input.
-  voltmpl.origin[0] *= bohr; 
-  voltmpl.origin[1] *= bohr;
-  voltmpl.origin[2] *= bohr;
-
-  // store aligned axes.
-  for (i=0; i<3; ++i) {
-    voltmpl.xaxis[i] = cube->rotmat[i][0] * a[0] 
-      + cube->rotmat[i][1] * a[1] + cube->rotmat[i][2] * a[2];
-
-    voltmpl.yaxis[i] = cube->rotmat[i][0] * b[0] 
-      + cube->rotmat[i][1] * b[1] + cube->rotmat[i][2] * b[2];
-    
-    voltmpl.zaxis[i] = cube->rotmat[i][0] * c[0] 
-      + cube->rotmat[i][1] * c[1] + cube->rotmat[i][2] * c[2];
-  }
-
-  voltmpl.xaxis[0] *= bohr * xsize;
-  voltmpl.xaxis[1] *= bohr * xsize; 
-  voltmpl.xaxis[2] *= bohr * xsize; 
-
-  voltmpl.yaxis[0] *= bohr * ysize; 
-  voltmpl.yaxis[1] *= bohr * ysize; 
-  voltmpl.yaxis[2] *= bohr * ysize; 
-
-  voltmpl.zaxis[0] *= bohr * zsize; 
-  voltmpl.zaxis[1] *= bohr * zsize; 
-  voltmpl.zaxis[2] *= bohr * zsize; 
-
-  /*   As of VMD version 1.8.3, volumetric data points are 
-   *   expected to represent the center of a grid box. cube format 
-   *   volumetric data represents the value at the edges of the 
-   *   grid boxes, so we need to shift the internal origin by half
-   *   a grid box diagonal to have the data at the correct position.
-   *   This will need to be changed again when the plugin interface 
-   *   is updated to explicitly allow point/face-centered data sets.
-   */
-  voltmpl.origin[0] -= 0.5 * ( voltmpl.xaxis[0] / (double) xsize
-                    + voltmpl.yaxis[0] / (double) ysize
-                    + voltmpl.zaxis[0] / (double) zsize);
-  voltmpl.origin[1] -= 0.5 * ( voltmpl.xaxis[1] / (double) xsize
-                    + voltmpl.yaxis[1] / (double) ysize
-                    + voltmpl.zaxis[1] / (double) zsize);
-  voltmpl.origin[2] -= 0.5 * ( voltmpl.xaxis[2] / (double) xsize
-                    + voltmpl.yaxis[2] / (double) ysize
-                    + voltmpl.zaxis[2] / (double) zsize);
-
-#if defined(TEST_PLUGIN)
-  printf("cell before rotation:\n");
-  printf("a: %12.8f %12.8f %12.8f\n", a[0]*xsize*bohr, a[1]*ysize*bohr, a[2]*zsize*bohr);
-  printf("b: %12.8f %12.8f %12.8f\n", b[0]*xsize*bohr, b[1]*ysize*bohr, b[2]*zsize*bohr);
-  printf("c: %12.8f %12.8f %12.8f\n", c[0]*xsize*bohr, c[1]*ysize*bohr, c[2]*zsize*bohr);
-
-  printf("cell after rotation:\n");
-  printf("x: %12.8f %12.8f %12.8f\n", voltmpl.xaxis[0], voltmpl.xaxis[1], voltmpl.xaxis[2]);
-  printf("y: %12.8f %12.8f %12.8f\n", voltmpl.yaxis[0], voltmpl.yaxis[1], voltmpl.yaxis[2]);
-  printf("z: %12.8f %12.8f %12.8f\n", voltmpl.zaxis[0], voltmpl.zaxis[1], voltmpl.zaxis[2]);
-#endif
-
-  // store the unit cell information for later perusal.
-  if (cube_readbox(&(cube->box), voltmpl.xaxis, voltmpl.yaxis, voltmpl.zaxis)) {
-    vmdcon_printf(VMDCON_WARN, "cubeplugin) Calculation of unit cell "
-                  "size failed. Continuing anyways...\n");
-  }
-
-  cube->crdpos = ftell(cube->fd); // and record beginning of coordinates
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
-
-  if (cube->nsets >0) { 
-    int i;
-
-    // density cube file, copy voltmpl into the cube struct.
-    cube->vol = new molfile_volumetric_t[1];
-    memcpy(cube->vol, &voltmpl, sizeof(voltmpl));
-
-    // skip over coordinates to find the start of volumetric data
-    for (i=0; i < cube->numatoms; i++)
-      fgets(readbuf, 1023, cube->fd);
-
-    cube->datapos = ftell(cube->fd); // and record beginning of data
-    // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O, 
-    // hope we don't read any files >= 2GB...
-  } else {              
-    int i;
-
-    // orbital cube file. we now have to read the orbitals section
-    // skip over coordinates
-    for (i=0; i < cube->numatoms; i++)
-      fgets(readbuf, 1023, cube->fd);
-      
-    fscanf(cube->fd, "%d", &cube->nsets);
-    vmdcon_printf(VMDCON_INFO, "cubeplugin) found %d orbitals\n", cube->nsets);
-    cube->vol = new molfile_volumetric_t[cube->nsets];
-    for (i=0; i < cube->nsets; ++i) {
-      int orb;
-      fscanf(cube->fd, "%d", &orb);
-      memcpy(&cube->vol[i], &voltmpl, sizeof(voltmpl));
-      sprintf(cube->vol[i].dataname, "Gaussian Cube: Orbital %d", orb);
-    }
-      
-    fgets(readbuf, 1023, cube->fd);  // gobble up rest of line
-    cube->datapos = ftell(cube->fd); // and record beginning of data
-    // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O, 
-    // hope we don't read any files >= 2GB...
-  }
-
-  return cube;
-}
-
-  
-static int read_cube_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  int i, j;
-  char *k;
-  molfile_atom_t *atom;
-
-  cube_t *cube = (cube_t *)v;
-
-  // go to coordinates
-  fseek(cube->fd, cube->crdpos, SEEK_SET);
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
-
-  /* set mass and radius from PTE, charge from atoms section of cube file. */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS | MOLFILE_CHARGE; 
-
-  for(i=0;i<cube->numatoms;i++) {
-    int idx;
-    float chrg;
-    char fbuffer[1024];
-
-    atom = atoms + i;
-
-    k = fgets(fbuffer, 1024, cube->fd);
-    j=sscanf(fbuffer, "%d %f %*f %*f %*f", &idx, &chrg);
-    if (k == NULL) {
-      vmdcon_printf(VMDCON_ERROR, "cube structure) missing atom(s) in "
-                                  "file '%s'\n",cube->file_name);
-      vmdcon_printf(VMDCON_ERROR, "cube structure) expecting '%d' atoms,"
-                                  " found only '%d'\n",cube->numatoms,i+1);
-      return MOLFILE_ERROR;
-    } else if (j < 2) {
-      vmdcon_printf(VMDCON_INFO, "cube structure) missing atom data in file"
-                                 " '%s' for atom '%d'\n",cube->file_name,i+1);
-      return MOLFILE_ERROR;
-    }
-
-    // assign atom symbol to number. flag unknown or dummy atoms with X.
-    atom->atomicnumber = idx;
-    strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->mass = get_pte_mass(idx);
-    atom->radius = get_pte_vdw_radius(idx);
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->charge = chrg;
-    /* skip to the end of line */
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_cube_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  int i, j, n;
-  char fbuffer[1024];
-  float x, y, z;
-  char *k;
-  
-  cube_t *cube = (cube_t *)v;
-
-  // there is only one set of coordinates
-  if (cube->coord) return MOLFILE_EOF;
-  cube->coord = true;
-
-  // jump to coordinate position
-  fseek(cube->fd, cube->crdpos, SEEK_SET);
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
- 
-  /* read the coordinates */
-  for (i=0; i<cube->numatoms; i++) {
-    k = fgets(fbuffer, 1024, cube->fd);
-    j = sscanf(fbuffer, "%*d %*f %f %f %f", &x, &y, &z);
-    
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 3) {
-      vmdcon_printf(VMDCON_ERROR, "cube timestep) missing type or coordinate(s)"
-                    " in file '%s' for atom '%d'\n",cube->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (j>=3) {
-      if (ts != NULL) { 
-        // Only save coords if we're given a timestep pointer, 
-        // otherwise assume that VMD wants us to skip past it.
-        
-        // In order to make the periodic display work, we need to
-        // rotate the coordinates around the origin by the stored
-        // rotation matrix. All coordinates are in Bohr, so they
-        // must be converted to Angstrom, too.
-        x -= cube->origin[0];
-        y -= cube->origin[1];
-        z -= cube->origin[2];
-        
-        for (n=0; n<3; ++n) {
-          ts->coords[3*i + n] = bohr*(cube->origin[n] 
-                                      + cube->rotmat[n][0] * x
-                                      + cube->rotmat[n][1] * y
-                                      + cube->rotmat[n][2] * z);
-        }
-      }
-    } else {
-      break;
-    }
-  }
-  // set unitcell dimensions from cached data.
-  if (ts != NULL) { 
-      ts->A = cube->box.A;
-      ts->B = cube->box.B;
-      ts->C = cube->box.C;
-      ts->alpha = cube->box.alpha;
-      ts->beta  = cube->box.beta;
-      ts->gamma = cube->box.gamma;
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cube_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  cube_t *cube = (cube_t *)v;
-  *nsets = cube->nsets; 
-  *metadata = cube->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cube_data(void *v, int set, float *datablock, float *colorblock) {
-  cube_t *cube = (cube_t *)v;
-
-  vmdcon_printf(VMDCON_INFO, "cubeplugin) trying to read cube data set %d\n", set);
-
-  int xsize = cube->vol[set].xsize; 
-  int ysize = cube->vol[set].ysize;
-  int zsize = cube->vol[set].zsize;
-  int xysize = xsize*ysize;
-  int nsize = cube->nsets;
-  int nzsize = nsize*zsize;
-  int nyzsize = nsize*zsize*ysize;
-  int x, y, z;
-
-  // go to data
-  fseek(cube->fd, cube->datapos, SEEK_SET);
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
-
-  // read the data values in 
-  if (cube->nsets == 1) { // density cube file
-    for (x=0; x<xsize; x++) {
-      for (y=0; y<ysize; y++) {
-        for (z=0; z<zsize; z++) {
-          if (fscanf(cube->fd, "%f", &datablock[z*xysize + y*xsize + x]) != 1) {
-              return MOLFILE_ERROR;
-          }
-        }
-      } 
-    }
-  } else {
-    // XXX we may wish to examine this strategy for alternatives that provide
-    // the same performance but without the extra copy, but it makes sense 
-    // for now.  
-
-    // Since the orbital cube file stores the data orb1(a1,b1,c1), orb2(a1,b1,c1), 
-    // ... orbn(a1,b1,c1), orb1(a1,b1,c2), orb2(a1,a1,c2), ..., orbn(ai,bj,ck)
-    // we have to cache the whole data set of have any kind of reasonable performance.
-    // otherwise we would have to read (and parse!) the whole file over and over again.
-    // this way we have to do it only once at the temporary expense of some memory.
-    if (cube->datacache == NULL) {
-      int points = xsize*ysize*zsize * nsize; // number of grid cells * nsets
-      int i;
-
-      // let people know what is going on.
-      vmdcon_printf(VMDCON_INFO, "cubeplugin) creating %d MByte cube orbital"
-                    " cache.\n", (int) (points*sizeof(float)) / 1048576);
-      cube->datacache = new float[points];
-            
-      for (i=0; i < points; ++i) {
-        if (fscanf(cube->fd, "%f", &cube->datacache[i]) != 1) {
-          return MOLFILE_ERROR;
-        }
-
-        // print an ascii progress bar so impatient people do not get scared.
-        // this does not translate well with vmdcon, so we keep it.
-        // we'd need some way to flag replacing a line instead of writing it.
-        if ((i % (1048576/sizeof(float))) == 0) {  // one dot per MB.
-          fprintf(stderr, "."); 
-        }
-      }
-    }
-      
-    for (x=0; x<xsize; x++) {
-      for (y=0; y<ysize; y++) {
-        for (z=0; z<zsize; z++) {
-          datablock[z*xysize + y*xsize + x] = cube->datacache[x*nyzsize + y*nzsize + z*nsize + set];
-        }
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_cube_read(void *v) {
-  cube_t *cube = (cube_t *)v;
-
-  fclose(cube->fd);
-  if (cube->vol) {
-    delete[] cube->vol; 
-  }
-  free(cube->file_name);
-  if (cube->datacache) { 
-    vmdcon_printf(VMDCON_INFO, "cubeplugin) freeing cube orbital cache.\n");
-    delete[] cube->datacache; 
-  }  
-
-  delete cube;
-}
-
-/*
- * Initialization stuff here
- */
-
-int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cube";
-  plugin.prettyname = "Gaussian Cube";
-  plugin.author = "Axel Kohlmeyer, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cub,cube";
-  plugin.open_file_read = open_cube_read;
-  plugin.read_structure = read_cube_structure;
-  plugin.read_next_timestep = read_cube_timestep;
-  plugin.close_file_read = close_cube_read;
-  plugin.read_volumetric_metadata = read_cube_metadata;
-  plugin.read_volumetric_data = read_cube_data;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-  void *v;
-  int i, nsets, set;
-  molfile_volumetric_t * meta;
-
-  while (--argc) {
-    ++argv;
-    v = open_cube_read(*argv, "cube", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_cube_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_cube_read succeeded for file %s\n", *argv);
-
-    // try loading the EDM metadata now
-    if (read_cube_metadata(v, &nsets, &meta)) {
-      return 1; // failed to load cube file
-    }
-    fprintf(stderr, "read_cube_metadata succeeded for file %s\n", *argv);
-
-    for (set=0; set<nsets; set++) {
-      printf("Loading volume set: %d\n", set);   
-      
-      int elements = meta[set].xsize * meta[set].ysize * meta[set].zsize;
-      printf("   Grid Elements: %d\n", elements);
-      printf(" Grid dimensions: X: %d Y: %d Z: %d\n", 
-             meta[set].xsize, meta[set].ysize, meta[set].zsize);
-
-      float * voldata = (float *) malloc(sizeof(float) * elements);
-      float * coldata = NULL;
-
-      if (meta[set].has_color) {
-        coldata = (float *) malloc(sizeof(float) * elements * 3);
-      }
-
-      // try loading the data sets now
-      if (read_cube_data(v, set, voldata, coldata)) {
-        return 1; // failed to load cube file
-      }
-
-      printf("First 6 elements:\n   ");
-      for (i=0; i<6; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-
-      printf("Last 6 elements:\n   ");
-      for (i=elements - 6; i<elements; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-    }
-
-    close_cube_read(v);
-  }
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dcdplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dcdplugin.c
deleted file mode 100644
index a8c71fd8db94780cd80e6e7e0ffd1813f70a2726..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dcdplugin.c
+++ /dev/null
@@ -1,1244 +0,0 @@
-/***************************************************************************
- *cr                                                                       
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the           
- *cr                        University of Illinois                       
- *cr                         All Rights Reserved                        
- *cr                                                                   
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dcdplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.79 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Code for reading and writing CHARMM, NAMD, and X-PLOR format 
- *   molecular dynamic trajectory files.
- *
- * TODO:
- *   Integrate improvements from the NAMD source tree
- *    - NAMD's writer code has better type-correctness for the sizes
- *      of "int".  NAMD uses "int32" explicitly, which is required on
- *      machines like the T3E.  VMD's version of the code doesn't do that
- *      presently.
- *
- *  Try various alternative I/O API options:
- *   - use mmap(), with read-once flags
- *   - use O_DIRECT open mode on new revs of Linux kernel 
- *   - use directio() call on a file descriptor to enable on Solaris
- *   - use aio_open()/read()/write()
- *   - use readv/writev() etc.
- *
- *  Standalone test binary compilation flags:
- *  cc -fast -xarch=v9a -I../../include -DTEST_DCDPLUGIN dcdplugin.c \
- *    -o ~/bin/readdcd -lm
- *
- *  Profiling flags:
- *  cc -xpg -fast -xarch=v9a -g -I../../include -DTEST_DCDPLUGIN dcdplugin.c \
- *    -o ~/bin/readdcd -lm
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-#include "fastio.h"       /* must come before others, for O_DIRECT...   */
-
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <time.h>
-#include "endianswap.h"
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#define RECSCALE32BIT 1
-#define RECSCALE64BIT 2
-#define RECSCALEMAX   2
-
-typedef struct {
-  fio_fd fd;
-  int natoms;
-  int nsets;
-  int setsread;
-  int istart;
-  int nsavc;
-  double delta;
-  int nfixed;
-  float *x, *y, *z;
-  int *freeind;
-  float *fixedcoords;
-  int reverse;
-  int charmm;  
-  int first;
-  int with_unitcell;
-} dcdhandle;
-
-/* Define error codes that may be returned by the DCD routines */
-#define DCD_SUCCESS      0  /* No problems                     */
-#define DCD_EOF         -1  /* Normal EOF                      */
-#define DCD_DNE         -2  /* DCD file does not exist         */
-#define DCD_OPENFAILED  -3  /* Open of DCD file failed         */
-#define DCD_BADREAD     -4  /* read call on DCD file failed    */
-#define DCD_BADEOF      -5  /* premature EOF found in DCD file */
-#define DCD_BADFORMAT   -6  /* format of DCD file is wrong     */
-#define DCD_FILEEXISTS  -7  /* output file already exists      */
-#define DCD_BADMALLOC   -8  /* malloc failed                   */
-#define DCD_BADWRITE    -9  /* write call on DCD file failed   */
-
-/* Define feature flags for this DCD file */
-#define DCD_IS_XPLOR        0x00
-#define DCD_IS_CHARMM       0x01
-#define DCD_HAS_4DIMS       0x02
-#define DCD_HAS_EXTRA_BLOCK 0x04
-#define DCD_HAS_64BIT_REC   0x08
-
-/* defines used by write_dcdstep */
-#define NFILE_POS 8L
-#define NSTEP_POS 20L
-
-/* READ Macro to make porting easier */
-#define READ(fd, buf, size)  fio_fread(((void *) buf), (size), 1, (fd))
-
-/* WRITE Macro to make porting easier */
-#define WRITE(fd, buf, size) fio_fwrite(((void *) buf), (size), 1, (fd))
-
-/* XXX This is broken - fread never returns -1 */
-#define CHECK_FREAD(X, msg) if (X==-1) { return(DCD_BADREAD); }
-#define CHECK_FEOF(X, msg)  if (X==0)  { return(DCD_BADEOF); }
-
-
-/* print DCD error in a human readable way */
-static void print_dcderror(const char *func, int errcode) {
-  const char *errstr;
-
-  switch (errcode) {
-    case DCD_EOF:         errstr = "end of file"; break;
-    case DCD_DNE:         errstr = "file not found"; break;
-    case DCD_OPENFAILED:  errstr = "file open failed"; break;
-    case DCD_BADREAD:     errstr = "error during read"; break;
-    case DCD_BADEOF:      errstr = "premature end of file"; break;
-    case DCD_BADFORMAT:   errstr = "corruption or unrecognized file structure"; break;
-    case DCD_FILEEXISTS:  errstr = "output file already exists"; break;
-    case DCD_BADMALLOC:   errstr = "memory allocation failed"; break;
-    case DCD_BADWRITE:    errstr = "error during write"; break;
-    case DCD_SUCCESS:     
-    default:
-      errstr = "no error";
-      break;
-  } 
-  printf("dcdplugin) %s: %s\n", func, errstr); 
-}
-
-
-/*
- * Read the header information from a dcd file.
- * Input: fd - a file struct opened for binary reading.
- * Output: 0 on success, negative error code on failure.
- * Side effects: *natoms set to number of atoms per frame
- *               *nsets set to number of frames in dcd file
- *               *istart set to starting timestep of dcd file
- *               *nsavc set to timesteps between dcd saves
- *               *delta set to value of trajectory timestep
- *               *nfixed set to number of fixed atoms 
- *               *freeind may be set to heap-allocated space
- *               *reverse set to one if reverse-endian, zero if not.
- *               *charmm set to internal code for handling charmm data.
- */
-static int read_dcdheader(fio_fd fd, int *N, int *NSET, int *ISTART, 
-                   int *NSAVC, double *DELTA, int *NAMNF, 
-                   int **FREEINDEXES, float **fixedcoords, int *reverseEndian, 
-                   int *charmm)
-{
-  unsigned int input_integer[2];  /* buffer space */
-  int i, ret_val, rec_scale;
-  char hdrbuf[84];    /* char buffer used to store header */
-  int NTITLE;
-  int dcdcordmagic;
-  char *corp = (char *) &dcdcordmagic;
-
-  /* coordinate dcd file magic string 'CORD' */
-  corp[0] = 'C';
-  corp[1] = 'O';
-  corp[2] = 'R';
-  corp[3] = 'D';
-
-  /* First thing in the file should be an 84.
-   * some 64-bit compiles have a 64-bit record length indicator,
-   * so we have to read two ints and check in a more complicated 
-   * way. :-( */
-  ret_val = READ(fd, input_integer, 2*sizeof(unsigned int));
-  CHECK_FREAD(ret_val, "reading first int from dcd file");
-  CHECK_FEOF(ret_val, "reading first int from dcd file");
-
-  /* Check magic number in file header and determine byte order*/
-  if ((input_integer[0]+input_integer[1]) == 84) {
-    *reverseEndian=0;
-    rec_scale=RECSCALE64BIT;
-    printf("dcdplugin) detected CHARMM -i8 64-bit DCD file of native endianness\n");
-  } else if (input_integer[0] == 84 && input_integer[1] == dcdcordmagic) {
-    *reverseEndian=0;
-    rec_scale=RECSCALE32BIT;
-    printf("dcdplugin) detected standard 32-bit DCD file of native endianness\n");
-  } else {
-    /* now try reverse endian */
-    swap4_aligned(input_integer, 2); /* will have to unswap magic if 32-bit */
-    if ((input_integer[0]+input_integer[1]) == 84) {
-      *reverseEndian=1;
-      rec_scale=RECSCALE64BIT;
-      printf("dcdplugin) detected CHARMM -i8 64-bit DCD file of opposite endianness\n");
-    } else {
-      swap4_aligned(&input_integer[1], 1); /* unswap magic (see above) */
-      if (input_integer[0] == 84 && input_integer[1] == dcdcordmagic) {
-        *reverseEndian=1;
-        rec_scale=RECSCALE32BIT;
-        printf("dcdplugin) detected standard 32-bit DCD file of opposite endianness\n");
-      } else {
-        /* not simply reversed endianism or -i8, something rather more evil */
-        printf("dcdplugin) unrecognized DCD header:\n");
-        printf("dcdplugin)   [0]: %10d  [1]: %10d\n", input_integer[0], input_integer[1]);
-        printf("dcdplugin)   [0]: 0x%08x  [1]: 0x%08x\n", input_integer[0], input_integer[1]);
-        return DCD_BADFORMAT;
-
-      }
-    }
-  }
-
-  /* check for magic string, in case of long record markers */
-  if (rec_scale == RECSCALE64BIT) { 
-    ret_val = READ(fd, input_integer, sizeof(unsigned int));
-    if (input_integer[0] != dcdcordmagic) {
-      printf("dcdplugin) failed to find CORD magic in CHARMM -i8 64-bit DCD file\n");
-      return DCD_BADFORMAT;
-    }
-  }
-
-  /* Buffer the entire header for random access */
-  ret_val = READ(fd, hdrbuf, 80);
-  CHECK_FREAD(ret_val, "buffering header");
-  CHECK_FEOF(ret_val, "buffering header");
-
-  /* CHARMm-genereate DCD files set the last integer in the     */
-  /* header, which is unused by X-PLOR, to its version number.  */
-  /* Checking if this is nonzero tells us this is a CHARMm file */
-  /* and to look for other CHARMm flags.                        */
-  if (*((int *) (hdrbuf + 76)) != 0) {
-    (*charmm) = DCD_IS_CHARMM;
-    if (*((int *) (hdrbuf + 40)) != 0)
-      (*charmm) |= DCD_HAS_EXTRA_BLOCK;
-
-    if (*((int *) (hdrbuf + 44)) == 1)
-      (*charmm) |= DCD_HAS_4DIMS;
-
-    if (rec_scale == RECSCALE64BIT)
-      (*charmm) |= DCD_HAS_64BIT_REC;
-  
-  } else {
-    (*charmm) = DCD_IS_XPLOR; /* must be an X-PLOR format DCD file */
-  }
-
-  if (*charmm & DCD_IS_CHARMM) {
-    /* CHARMM and NAMD versions 2.1b1 and later */
-    printf("dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)\n");
-  } else {
-    /* CHARMM and NAMD versions prior to 2.1b1  */
-    printf("dcdplugin) X-PLOR format DCD file (also NAMD 2.0 and earlier)\n");
-  }
-
-  /* Store the number of sets of coordinates (NSET) */
-  (*NSET) = *((int *) (hdrbuf));
-  if (*reverseEndian) swap4_unaligned(NSET, 1);
-
-  /* Store ISTART, the starting timestep */
-  (*ISTART) = *((int *) (hdrbuf + 4));
-  if (*reverseEndian) swap4_unaligned(ISTART, 1);
-
-  /* Store NSAVC, the number of timesteps between dcd saves */
-  (*NSAVC) = *((int *) (hdrbuf + 8));
-  if (*reverseEndian) swap4_unaligned(NSAVC, 1);
-
-  /* Store NAMNF, the number of fixed atoms */
-  (*NAMNF) = *((int *) (hdrbuf + 32));
-  if (*reverseEndian) swap4_unaligned(NAMNF, 1);
-
-  /* Read in the timestep, DELTA */
-  /* Note: DELTA is stored as a double with X-PLOR but as a float with CHARMm */
-  if ((*charmm) & DCD_IS_CHARMM) {
-    float ftmp;
-    ftmp = *((float *)(hdrbuf+36)); /* is this safe on Alpha? */
-    if (*reverseEndian)
-      swap4_aligned(&ftmp, 1);
-
-    *DELTA = (double)ftmp;
-  } else {
-    (*DELTA) = *((double *)(hdrbuf + 36));
-    if (*reverseEndian) swap8_unaligned(DELTA, 1);
-  }
-
-  /* Get the end size of the first block */
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  CHECK_FREAD(ret_val, "reading second 84 from dcd file");
-  CHECK_FEOF(ret_val, "reading second 84 from dcd file");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if (rec_scale == RECSCALE64BIT) {
-    if ((input_integer[0]+input_integer[1]) != 84) {
-      return DCD_BADFORMAT;
-    }
-  } else {
-    if (input_integer[0] != 84) {
-      return DCD_BADFORMAT;
-    }
-  }
-  
-  /* Read in the size of the next block */
-  input_integer[1] = 0;
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  CHECK_FREAD(ret_val, "reading size of title block");
-  CHECK_FEOF(ret_val, "reading size of title block");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if ((((input_integer[0]+input_integer[1])-4) % 80) == 0) {
-    /* Read NTITLE, the number of 80 character title strings there are */
-    ret_val = READ(fd, &NTITLE, sizeof(int));
-    CHECK_FREAD(ret_val, "reading NTITLE");
-    CHECK_FEOF(ret_val, "reading NTITLE");
-    if (*reverseEndian) swap4_aligned(&NTITLE, 1);
-
-    if (NTITLE < 0) {
-      printf("dcdplugin) WARNING: Bogus NTITLE value: %d (hex: %08x)\n", 
-             NTITLE, NTITLE);
-      return DCD_BADFORMAT;
-    }
-
-    if (NTITLE > 1000) {
-      printf("dcdplugin) WARNING: Bogus NTITLE value: %d (hex: %08x)\n", 
-             NTITLE, NTITLE);
-      if (NTITLE == 1095062083) {
-        printf("dcdplugin) WARNING: Broken Vega ZZ 2.4.0 DCD file detected\n");
-        printf("dcdplugin) Assuming 2 title lines, good luck...\n");
-        NTITLE = 2;
-      } else {
-        printf("dcdplugin) Assuming zero title lines, good luck...\n");
-        NTITLE = 0;
-      }
-    }
-
-    for (i=0; i<NTITLE; i++) {
-      fio_fseek(fd, 80, FIO_SEEK_CUR);
-      CHECK_FEOF(ret_val, "reading TITLE");
-    }
-
-    /* Get the ending size for this block */
-    ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of title block");
-    CHECK_FEOF(ret_val, "reading size of title block");
-  } else {
-    return DCD_BADFORMAT;
-  }
-
-  /* Read in an integer '4' */
-  input_integer[1] = 0;
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  
-  CHECK_FREAD(ret_val, "reading a '4'");
-  CHECK_FEOF(ret_val, "reading a '4'");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if ((input_integer[0]+input_integer[1]) != 4) {
-    return DCD_BADFORMAT;
-  }
-
-  /* Read in the number of atoms */
-  ret_val = READ(fd, N, sizeof(int));
-  CHECK_FREAD(ret_val, "reading number of atoms");
-  CHECK_FEOF(ret_val, "reading number of atoms");
-  if (*reverseEndian) swap4_aligned(N, 1);
-
-  /* Read in an integer '4' */
-  input_integer[1] = 0;
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  CHECK_FREAD(ret_val, "reading a '4'");
-  CHECK_FEOF(ret_val, "reading a '4'");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if ((input_integer[0]+input_integer[1]) != 4) {
-    return DCD_BADFORMAT;
-  }
-
-  *FREEINDEXES = NULL;
-  *fixedcoords = NULL;
-  if (*NAMNF != 0) {
-    (*FREEINDEXES) = (int *) calloc(((*N)-(*NAMNF)), sizeof(int));
-    if (*FREEINDEXES == NULL)
-      return DCD_BADMALLOC;
-
-    *fixedcoords = (float *) calloc((*N)*4 - (*NAMNF), sizeof(float));
-    if (*fixedcoords == NULL)
-      return DCD_BADMALLOC;
-
-    /* Read in index array size */
-    input_integer[1]=0;
-    ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of index array");
-    CHECK_FEOF(ret_val, "reading size of index array");
-    if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-    if ((input_integer[0]+input_integer[1]) != ((*N)-(*NAMNF))*4) {
-      return DCD_BADFORMAT;
-    }
-
-    ret_val = READ(fd, (*FREEINDEXES), ((*N)-(*NAMNF))*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of index array");
-    CHECK_FEOF(ret_val, "reading size of index array");
-
-    if (*reverseEndian)
-      swap4_aligned((*FREEINDEXES), ((*N)-(*NAMNF)));
-
-    input_integer[1]=0;
-    ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of index array");
-    CHECK_FEOF(ret_val, "reading size of index array");
-    if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-    if ((input_integer[0]+input_integer[1]) != ((*N)-(*NAMNF))*4) {
-      return DCD_BADFORMAT;
-    }
-  }
-
-  return DCD_SUCCESS;
-}
-
-static int read_charmm_extrablock(fio_fd fd, int charmm, int reverseEndian,
-                                  float *unitcell) {
-  int i, input_integer[2], rec_scale;
-
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale = RECSCALE64BIT;
-  } else {
-    rec_scale = RECSCALE32BIT;
-  }
-
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_EXTRA_BLOCK)) {
-    /* Leading integer must be 48 */
-    input_integer[1] = 0;
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale)
-      return DCD_BADREAD; 
-    if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-    if ((input_integer[0]+input_integer[1]) == 48) {
-      double tmp[6];
-      if (fio_fread(tmp, 48, 1, fd) != 1) return DCD_BADREAD;
-      if (reverseEndian) 
-        swap8_aligned(tmp, 6);
-      for (i=0; i<6; i++) unitcell[i] = (float)tmp[i];
-    } else {
-      /* unrecognized block, just skip it */
-      if (fio_fseek(fd, (input_integer[0]+input_integer[1]), FIO_SEEK_CUR)) return DCD_BADREAD;
-    }
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD; 
-  } 
-
-  return DCD_SUCCESS;
-}
-
-static int read_fixed_atoms(fio_fd fd, int N, int num_free, const int *indexes,
-                            int reverseEndian, const float *fixedcoords, 
-                            float *freeatoms, float *pos, int charmm) {
-  int i, input_integer[2], rec_scale;
-  
-  if(charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-  
-  /* Read leading integer */
-  input_integer[1]=0;
-  if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;
-  if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-  if ((input_integer[0]+input_integer[1]) != 4*num_free) return DCD_BADFORMAT;
-  
-  /* Read free atom coordinates */
-  if (fio_fread(freeatoms, 4*num_free, 1, fd) != 1) return DCD_BADREAD;
-  if (reverseEndian)
-    swap4_aligned(freeatoms, num_free);
-
-  /* Copy fixed and free atom coordinates into position buffer */
-  memcpy(pos, fixedcoords, 4*N);
-  for (i=0; i<num_free; i++)
-    pos[indexes[i]-1] = freeatoms[i];
-
-  /* Read trailing integer */ 
-  input_integer[1]=0;
-  if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;
-  if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-  if ((input_integer[0]+input_integer[1]) != 4*num_free) return DCD_BADFORMAT;
-
-  return DCD_SUCCESS;
-}
-  
-static int read_charmm_4dim(fio_fd fd, int charmm, int reverseEndian) {
-  int input_integer[2],rec_scale;
-
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-    
-  /* If this is a CHARMm file and contains a 4th dimension block, */
-  /* we must skip past it to avoid problems                       */
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_4DIMS)) {
-    input_integer[1]=0;
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;  
-    if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-    if (fio_fseek(fd, (input_integer[0]+input_integer[1]), FIO_SEEK_CUR)) return DCD_BADREAD;
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;  
-  }
-
-  return DCD_SUCCESS;
-}
-
-/* 
- * Read a dcd timestep from a dcd file
- * Input: fd - a file struct opened for binary reading, from which the 
- *             header information has already been read.
- *        natoms, nfixed, first, *freeind, reverse, charmm - the corresponding 
- *             items as set by read_dcdheader
- *        first - true if this is the first frame we are reading.
- *        x, y, z: space for natoms each of floats.
- *        unitcell - space for six floats to hold the unit cell data.  
- *                   Not set if no unit cell data is present.
- * Output: 0 on success, negative error code on failure.
- * Side effects: x, y, z contain the coordinates for the timestep read.
- *               unitcell holds unit cell data if present.
- */
-static int read_dcdstep(fio_fd fd, int N, float *X, float *Y, float *Z, 
-                        float *unitcell, int num_fixed,
-                        int first, int *indexes, float *fixedcoords, 
-                        int reverseEndian, int charmm) {
-  int ret_val, rec_scale;   /* Return value from read */
-  
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-  
-  if ((num_fixed==0) || first) {
-    /* temp storage for reading formatting info */
-    /* note: has to be max size we'll ever use  */
-    int tmpbuf[6*RECSCALEMAX]; 
-
-    fio_iovec iov[7];   /* I/O vector for fio_readv() call          */
-    fio_size_t readlen; /* number of bytes actually read            */
-    int i;
-
-    /* if there are no fixed atoms or this is the first timestep read */
-    /* then we read all coordinates normally.                         */
-
-    /* read the charmm periodic cell information */
-    /* XXX this too should be read together with the other items in a */
-    /*     single fio_readv() call in order to prevent lots of extra  */
-    /*     kernel/user context switches.                              */
-    ret_val = read_charmm_extrablock(fd, charmm, reverseEndian, unitcell);
-    if (ret_val) return ret_val;
-
-    /* setup the I/O vector for the call to fio_readv() */
-    iov[0].iov_base = (fio_caddr_t) &tmpbuf[0]; /* read format integer    */
-    iov[0].iov_len  = rec_scale*sizeof(int);
-
-    iov[1].iov_base = (fio_caddr_t) X;          /* read X coordinates     */
-    iov[1].iov_len  = sizeof(float)*N;
-
-    iov[2].iov_base = (fio_caddr_t) &tmpbuf[1*rec_scale]; /* read 2 format integers */
-    iov[2].iov_len  = rec_scale*sizeof(int) * 2;
-
-    iov[3].iov_base = (fio_caddr_t) Y;          /* read Y coordinates     */
-    iov[3].iov_len  = sizeof(float)*N;
-
-    iov[4].iov_base = (fio_caddr_t) &tmpbuf[3*rec_scale]; /* read 2 format integers */
-    iov[4].iov_len  = rec_scale*sizeof(int) * 2;
-
-    iov[5].iov_base = (fio_caddr_t) Z;          /* read Y coordinates     */
-    iov[5].iov_len  = sizeof(float)*N;
-
-    iov[6].iov_base = (fio_caddr_t) &tmpbuf[5*rec_scale]; /* read format integer    */
-    iov[6].iov_len  = rec_scale*sizeof(int);
-
-#if 1
-    /* Use fall-back code instead of readv():                            */
-    /*  Some platforms implement readv() as user level code in libc,     */
-    /*  and due to POSIX atomicity requirements for readv()/writev(),    */
-    /*  they may copy data to internal temp buffers, which can kill      */
-    /*  performance, and in cases when doing single I/O ops on large,    */
-    /*  buffers, e.g. > 2GB, can fail with shorts reads or writes...     */
-    /*  On such platforms it is best to avoid using readv()/writev()...  */
-    {
-      int readcnt = 0;
-      readlen = 0;
-      readcnt =  fio_fread(iov[0].iov_base, iov[0].iov_len, 1, fd);
-      readcnt += fio_fread(iov[1].iov_base, iov[1].iov_len, 1, fd);
-      readcnt += fio_fread(iov[2].iov_base, iov[2].iov_len, 1, fd);
-      readcnt += fio_fread(iov[3].iov_base, iov[3].iov_len, 1, fd);
-      readcnt += fio_fread(iov[4].iov_base, iov[4].iov_len, 1, fd);
-      readcnt += fio_fread(iov[5].iov_base, iov[5].iov_len, 1, fd);
-      readcnt += fio_fread(iov[6].iov_base, iov[6].iov_len, 1, fd);
-
-      /* if both records read correctly, then the reads are okay */
-      if (readcnt != 7)
-        return DCD_BADREAD;
-    }
-#else
-    readlen = fio_readv(fd, &iov[0], 7);
-    if (readlen != (rec_scale*6*sizeof(int) + 3*N*sizeof(float)))
-      return DCD_BADREAD;
-#endif
-
-    /* convert endianism if necessary */
-    if (reverseEndian) {
-      swap4_aligned(&tmpbuf[0], rec_scale*6);
-      swap4_aligned(X, N);
-      swap4_aligned(Y, N);
-      swap4_aligned(Z, N);
-    }
-
-    /* double-check the fortran format size values for safety */
-    if(rec_scale == 1) {
-      for (i=0; i<6; i++) {
-        if (tmpbuf[i] != sizeof(float)*N) return DCD_BADFORMAT;
-      }
-    } else {
-      for (i=0; i<6; i++) {
-          if ((tmpbuf[2*i]+tmpbuf[2*i+1]) != sizeof(float)*N) return DCD_BADFORMAT;
-      }
-    }
-
-    /* copy fixed atom coordinates into fixedcoords array if this was the */
-    /* first timestep, to be used from now on.  We just copy all atoms.   */
-    if (num_fixed && first) {
-      memcpy(fixedcoords, X, N*sizeof(float));
-      memcpy(fixedcoords+N, Y, N*sizeof(float));
-      memcpy(fixedcoords+2*N, Z, N*sizeof(float));
-    }
-
-    /* read in the optional charmm 4th array */
-    /* XXX this too should be read together with the other items in a */
-    /*     single fio_readv() call in order to prevent lots of extra  */
-    /*     kernel/user context switches.                              */
-    ret_val = read_charmm_4dim(fd, charmm, reverseEndian);
-    if (ret_val) return ret_val;
-  } else {
-    /* if there are fixed atoms, and this isn't the first frame, then we */
-    /* only read in the non-fixed atoms for all subsequent timesteps.    */
-    ret_val = read_charmm_extrablock(fd, charmm, reverseEndian, unitcell);
-    if (ret_val) return ret_val;
-    ret_val = read_fixed_atoms(fd, N, N-num_fixed, indexes, reverseEndian,
-                               fixedcoords, fixedcoords+3*N, X, charmm);
-    if (ret_val) return ret_val;
-    ret_val = read_fixed_atoms(fd, N, N-num_fixed, indexes, reverseEndian,
-                               fixedcoords+N, fixedcoords+3*N, Y, charmm);
-    if (ret_val) return ret_val;
-    ret_val = read_fixed_atoms(fd, N, N-num_fixed, indexes, reverseEndian,
-                               fixedcoords+2*N, fixedcoords+3*N, Z, charmm);
-    if (ret_val) return ret_val;
-    ret_val = read_charmm_4dim(fd, charmm, reverseEndian);
-    if (ret_val) return ret_val;
-  }
-
-  return DCD_SUCCESS;
-}
-
-
-/* 
- * Skip past a timestep.  If there are fixed atoms, this cannot be used with
- * the first timestep.  
- * Input: fd - a file struct from which the header has already been read
- *        natoms - number of atoms per timestep
- *        nfixed - number of fixed atoms
- *        charmm - charmm flags as returned by read_dcdheader
- * Output: 0 on success, negative error code on failure.
- * Side effects: One timestep will be skipped; fd will be positioned at the
- *               next timestep.
- */
-static int skip_dcdstep(fio_fd fd, int natoms, int nfixed, int charmm) {
-  
-  int seekoffset = 0;
-  int rec_scale;
-
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-
-  /* Skip charmm extra block */
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_EXTRA_BLOCK)) {
-    seekoffset += 4*rec_scale + 48 + 4*rec_scale;
-  }
-
-  /* For each atom set, seek past an int, the free atoms, and another int. */
-  seekoffset += 3 * (2*rec_scale + natoms - nfixed) * 4;
-
-  /* Assume that charmm 4th dim is the same size as the other three. */
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_4DIMS)) {
-    seekoffset += (2*rec_scale + natoms - nfixed) * 4;
-  }
- 
-  if (fio_fseek(fd, seekoffset, FIO_SEEK_CUR)) return DCD_BADEOF;
-
-  return DCD_SUCCESS;
-}
-
-
-/* 
- * Write a timestep to a dcd file
- * Input: fd - a file struct for which a dcd header has already been written
- *       curframe: Count of frames written to this file, starting with 1.
- *       curstep: Count of timesteps elapsed = istart + curframe * nsavc.
- *        natoms - number of elements in x, y, z arrays
- *        x, y, z: pointers to atom coordinates
- * Output: 0 on success, negative error code on failure.
- * Side effects: coordinates are written to the dcd file.
- */
-static int write_dcdstep(fio_fd fd, int curframe, int curstep, int N, 
-                  const float *X, const float *Y, const float *Z, 
-                  const double *unitcell, int charmm) {
-  int out_integer;
-
-  if (charmm) {
-    /* write out optional unit cell */
-    if (unitcell != NULL) {
-      out_integer = 48; /* 48 bytes (6 floats) */
-      fio_write_int32(fd, out_integer);
-      WRITE(fd, unitcell, out_integer);
-      fio_write_int32(fd, out_integer);
-    }
-  }
-
-  /* write out coordinates */
-  out_integer = N*4; /* N*4 bytes per X/Y/Z array (N floats per array) */
-  fio_write_int32(fd, out_integer);
-  if (fio_fwrite((void *) X, out_integer, 1, fd) != 1) return DCD_BADWRITE;
-  fio_write_int32(fd, out_integer);
-  fio_write_int32(fd, out_integer);
-  if (fio_fwrite((void *) Y, out_integer, 1, fd) != 1) return DCD_BADWRITE;
-  fio_write_int32(fd, out_integer);
-  fio_write_int32(fd, out_integer);
-  if (fio_fwrite((void *) Z, out_integer, 1, fd) != 1) return DCD_BADWRITE;
-  fio_write_int32(fd, out_integer);
-
-  /* update the DCD header information */
-  fio_fseek(fd, NFILE_POS, FIO_SEEK_SET);
-  fio_write_int32(fd, curframe);
-  fio_fseek(fd, NSTEP_POS, FIO_SEEK_SET);
-  fio_write_int32(fd, curstep);
-  fio_fseek(fd, 0, FIO_SEEK_END);
-
-  return DCD_SUCCESS;
-}
-
-/*
- * Write a header for a new dcd file
- * Input: fd - file struct opened for binary writing
- *        remarks - string to be put in the remarks section of the header.  
- *                  The string will be truncated to 70 characters.
- *        natoms, istart, nsavc, delta - see comments in read_dcdheader
- * Output: 0 on success, negative error code on failure.
- * Side effects: Header information is written to the dcd file.
- */
-static int write_dcdheader(fio_fd fd, const char *remarks, int N, 
-                    int ISTART, int NSAVC, double DELTA, int with_unitcell,
-                    int charmm) {
-  int out_integer;
-  float out_float;
-  char title_string[200];
-  time_t cur_time;
-  struct tm *tmbuf;
-  char time_str[81];
-
-  out_integer = 84;
-  WRITE(fd, (char *) & out_integer, sizeof(int));
-  strcpy(title_string, "CORD");
-  WRITE(fd, title_string, 4);
-  fio_write_int32(fd, 0);      /* Number of frames in file, none written yet   */
-  fio_write_int32(fd, ISTART); /* Starting timestep                            */
-  fio_write_int32(fd, NSAVC);  /* Timesteps between frames written to the file */
-  fio_write_int32(fd, 0);      /* Number of timesteps in simulation            */
-  fio_write_int32(fd, 0);      /* NAMD writes NSTEP or ISTART - NSAVC here?    */
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  if (charmm) {
-    out_float = DELTA;
-    WRITE(fd, (char *) &out_float, sizeof(float));
-    if (with_unitcell) {
-      fio_write_int32(fd, 1);
-    } else {
-      fio_write_int32(fd, 0);
-    }
-  } else {
-    WRITE(fd, (char *) &DELTA, sizeof(double));
-  }
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  if (charmm) {
-    fio_write_int32(fd, 24); /* Pretend to be CHARMM version 24 */
-  } else {
-    fio_write_int32(fd, 0);
-  }
-  fio_write_int32(fd, 84);
-  fio_write_int32(fd, 164);
-  fio_write_int32(fd, 2);
-
-  strncpy(title_string, remarks, 80);
-  title_string[79] = '\0';
-  WRITE(fd, title_string, 80);
-
-  cur_time=time(NULL);
-  tmbuf=localtime(&cur_time);
-  strftime(time_str, 80, "REMARKS Created %d %B, %Y at %R", tmbuf);
-  WRITE(fd, time_str, 80);
-
-  fio_write_int32(fd, 164);
-  fio_write_int32(fd, 4);
-  fio_write_int32(fd, N);
-  fio_write_int32(fd, 4);
-
-  return DCD_SUCCESS;
-}
-
-
-/*
- * clean up dcd data
- * Input: nfixed, freeind - elements as returned by read_dcdheader
- * Output: None
- * Side effects: Space pointed to by freeind is freed if necessary.
- */
-static void close_dcd_read(int *indexes, float *fixedcoords) {
-  free(indexes);
-  free(fixedcoords);
-}
-
-
-
-
-
-static void *open_dcd_read(const char *path, const char *filetype, 
-    int *natoms) {
-  dcdhandle *dcd;
-  fio_fd fd;
-  int rc;
-  struct stat stbuf;
-
-  if (!path) return NULL;
-
-  /* See if the file exists, and get its size */
-  memset(&stbuf, 0, sizeof(struct stat));
-  if (stat(path, &stbuf)) {
-    printf("dcdplugin) Could not access file '%s'.\n", path);
-    return NULL;
-  }
-
-  if (fio_open(path, FIO_READ, &fd) < 0) {
-    printf("dcdplugin) Could not open file '%s' for reading.\n", path);
-    return NULL;
-  }
-
-  dcd = (dcdhandle *)malloc(sizeof(dcdhandle));
-  memset(dcd, 0, sizeof(dcdhandle));
-  dcd->fd = fd;
-
-  if ((rc = read_dcdheader(dcd->fd, &dcd->natoms, &dcd->nsets, &dcd->istart, 
-         &dcd->nsavc, &dcd->delta, &dcd->nfixed, &dcd->freeind, 
-         &dcd->fixedcoords, &dcd->reverse, &dcd->charmm))) {
-    print_dcderror("read_dcdheader", rc);
-    fio_fclose(dcd->fd);
-    free(dcd);
-    return NULL;
-  }
-
-  /*
-   * Check that the file is big enough to really hold the number of sets
-   * it claims to have.  Then we'll use nsets to keep track of where EOF
-   * should be.
-   */
-  {
-    fio_size_t ndims, firstframesize, framesize, extrablocksize;
-    fio_size_t trjsize, filesize, curpos;
-    int newnsets;
-
-    extrablocksize = dcd->charmm & DCD_HAS_EXTRA_BLOCK ? 48 + 8 : 0;
-    ndims = dcd->charmm & DCD_HAS_4DIMS ? 4 : 3;
-    firstframesize = (dcd->natoms+2) * ndims * sizeof(float) + extrablocksize;
-    framesize = (dcd->natoms-dcd->nfixed+2) * ndims * sizeof(float) 
-      + extrablocksize;
-
-    /* 
-     * It's safe to use ftell, even though ftell returns a long, because the 
-     * header size is < 4GB.
-     */
-
-    curpos = fio_ftell(dcd->fd); /* save current offset (end of header) */
-
-#if defined(_MSC_VER) && defined(FASTIO_NATIVEWIN32)
-    /* the stat() call is not 64-bit savvy on Windows             */
-    /* so we have to use the fastio fseek/ftell routines for this */
-    /* until we add a portable filesize routine for this purpose  */
-    fio_fseek(dcd->fd, 0, FIO_SEEK_END);       /* seek to end of file */
-    filesize = fio_ftell(dcd->fd);
-    fio_fseek(dcd->fd, curpos, FIO_SEEK_SET);  /* return to end of header */
-#else
-    filesize = stbuf.st_size; /* this works ok on Unix machines */
-#endif
-    trjsize = filesize - curpos - firstframesize;
-    if (trjsize < 0) {
-      printf("dcdplugin) file '%s' appears to contain no timesteps.\n", path);
-      fio_fclose(dcd->fd);
-      free(dcd);
-      return NULL;
-    }
-
-    newnsets = trjsize / framesize + 1;
-
-    if (dcd->nsets > 0 && newnsets != dcd->nsets) {
-      printf("dcdplugin) Warning: DCD header claims %d frames, file size indicates there are actually %d frames\n", dcd->nsets, newnsets);
-    }
-
-    dcd->nsets = newnsets; 
-    dcd->setsread = 0;
-  }
-
-  dcd->first = 1;
-  dcd->x = (float *)malloc(dcd->natoms * sizeof(float));
-  dcd->y = (float *)malloc(dcd->natoms * sizeof(float));
-  dcd->z = (float *)malloc(dcd->natoms * sizeof(float));
-  if (!dcd->x || !dcd->y || !dcd->z) {
-    printf("dcdplugin) Unable to allocate space for %d atoms.\n", dcd->natoms);
-    if (dcd->x)
-      free(dcd->x);
-    if (dcd->y)
-      free(dcd->y);
-    if (dcd->z)
-      free(dcd->z);
-    fio_fclose(dcd->fd);
-    free(dcd);
-    return NULL;
-  }
-  *natoms = dcd->natoms;
-  return dcd;
-}
-
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  dcdhandle *dcd;
-  int i, j, rc;
-  float unitcell[6];
-  unitcell[0] = unitcell[2] = unitcell[5] = 1.0f;
-  unitcell[1] = unitcell[3] = unitcell[4] = 90.0f;
-  dcd = (dcdhandle *)v;
-
-  /* Check for EOF here; that way all EOF's encountered later must be errors */
-  if (dcd->setsread == dcd->nsets) return MOLFILE_EOF;
-  dcd->setsread++;
-  if (!ts) {
-    if (dcd->first && dcd->nfixed) {
-      /* We can't just skip it because we need the fixed atom coordinates */
-      rc = read_dcdstep(dcd->fd, dcd->natoms, dcd->x, dcd->y, dcd->z, 
-          unitcell, dcd->nfixed, dcd->first, dcd->freeind, dcd->fixedcoords, 
-             dcd->reverse, dcd->charmm);
-      dcd->first = 0;
-      return rc; /* XXX this needs to be updated */
-    }
-    dcd->first = 0;
-    /* XXX this needs to be changed */
-    return skip_dcdstep(dcd->fd, dcd->natoms, dcd->nfixed, dcd->charmm);
-  }
-  rc = read_dcdstep(dcd->fd, dcd->natoms, dcd->x, dcd->y, dcd->z, unitcell,
-             dcd->nfixed, dcd->first, dcd->freeind, dcd->fixedcoords, 
-             dcd->reverse, dcd->charmm);
-  dcd->first = 0;
-  if (rc < 0) {  
-    print_dcderror("read_dcdstep", rc);
-    return MOLFILE_ERROR;
-  }
-
-  /* copy timestep data from plugin-local buffers to VMD's buffer */
-  /* XXX 
-   *   This code is still the root of all evil.  Just doing this extra copy
-   *   cuts the I/O rate of the DCD reader from 728 MB/sec down to
-   *   394 MB/sec when reading from a ram filesystem.  
-   *   For a physical disk filesystem, the I/O rate goes from 
-   *   187 MB/sec down to 122 MB/sec.  Clearly this extra copy has to go.
-   */
-  {
-    int natoms = dcd->natoms;
-    float *nts = ts->coords;
-    const float *bufx = dcd->x;
-    const float *bufy = dcd->y;
-    const float *bufz = dcd->z;
-
-    for (i=0, j=0; i<natoms; i++, j+=3) {
-      nts[j    ] = bufx[i];
-      nts[j + 1] = bufy[i];
-      nts[j + 2] = bufz[i];
-    }
-  }
-
-  ts->A = unitcell[0];
-  ts->B = unitcell[2];
-  ts->C = unitcell[5];
-
-  if (unitcell[1] >= -1.0 && unitcell[1] <= 1.0 &&
-      unitcell[3] >= -1.0 && unitcell[3] <= 1.0 &&
-      unitcell[4] >= -1.0 && unitcell[4] <= 1.0) {
-    /* This file was generated by CHARMM, or by NAMD > 2.5, with the angle */
-    /* cosines of the periodic cell angles written to the DCD file.        */ 
-    /* This formulation improves rounding behavior for orthogonal cells    */
-    /* so that the angles end up at precisely 90 degrees, unlike acos().   */
-    ts->alpha = 90.0 - asin(unitcell[4]) * 90.0 / M_PI_2; /* cosBC */
-    ts->beta  = 90.0 - asin(unitcell[3]) * 90.0 / M_PI_2; /* cosAC */
-    ts->gamma = 90.0 - asin(unitcell[1]) * 90.0 / M_PI_2; /* cosAB */
-  } else {
-    /* This file was likely generated by NAMD 2.5 and the periodic cell    */
-    /* angles are specified in degrees rather than angle cosines.          */
-    ts->alpha = unitcell[4]; /* angle between B and C */
-    ts->beta  = unitcell[3]; /* angle between A and C */
-    ts->gamma = unitcell[1]; /* angle between A and B */
-  }
- 
-  return MOLFILE_SUCCESS;
-}
- 
-
-static void close_file_read(void *v) {
-  dcdhandle *dcd = (dcdhandle *)v;
-  close_dcd_read(dcd->freeind, dcd->fixedcoords);
-  fio_fclose(dcd->fd);
-  free(dcd->x);
-  free(dcd->y);
-  free(dcd->z);
-  free(dcd); 
-}
-
-
-static void *open_dcd_write(const char *path, const char *filetype, 
-    int natoms) {
-  dcdhandle *dcd;
-  fio_fd fd;
-  int rc;
-  int istart, nsavc;
-  double delta;
-  int with_unitcell;
-  int charmm;
-
-  if (fio_open(path, FIO_WRITE, &fd) < 0) {
-    printf("dcdplugin) Could not open file '%s' for writing\n", path);
-    return NULL;
-  }
-
-  dcd = (dcdhandle *)malloc(sizeof(dcdhandle));
-  memset(dcd, 0, sizeof(dcdhandle));
-  dcd->fd = fd;
-
-  istart = 0;             /* starting timestep of DCD file                  */
-  nsavc = 1;              /* number of timesteps between written DCD frames */
-  delta = 1.0;            /* length of a timestep                           */
-
-  if (getenv("VMDDCDWRITEXPLORFORMAT") != NULL) {
-    with_unitcell = 0;      /* no unit cell info */
-    charmm = DCD_IS_XPLOR;  /* X-PLOR format */
-    printf("dcdplugin) WARNING: Writing DCD file in X-PLOR format, \n");
-    printf("dcdplugin) WARNING: unit cell information will be lost!\n");
-  } else {
-    with_unitcell = 1;      /* contains unit cell infor (Charmm format) */
-    charmm = DCD_IS_CHARMM; /* charmm-formatted DCD file                */ 
-    if (with_unitcell) 
-      charmm |= DCD_HAS_EXTRA_BLOCK;
-  }
- 
-  rc = write_dcdheader(dcd->fd, "Created by DCD plugin", natoms, 
-                       istart, nsavc, delta, with_unitcell, charmm);
-
-  if (rc < 0) {
-    print_dcderror("write_dcdheader", rc);
-    fio_fclose(dcd->fd);
-    free(dcd);
-    return NULL;
-  }
-
-  dcd->natoms = natoms;
-  dcd->nsets = 0;
-  dcd->istart = istart;
-  dcd->nsavc = nsavc;
-  dcd->with_unitcell = with_unitcell;
-  dcd->charmm = charmm;
-  dcd->x = (float *)malloc(natoms * sizeof(float));
-  dcd->y = (float *)malloc(natoms * sizeof(float));
-  dcd->z = (float *)malloc(natoms * sizeof(float));
-  return dcd;
-}
-
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) { 
-  dcdhandle *dcd = (dcdhandle *)v;
-  int i, rc, curstep;
-  float *pos = ts->coords;
-  double unitcell[6];
-  unitcell[0] = unitcell[2] = unitcell[5] = 1.0f;
-  unitcell[1] = unitcell[3] = unitcell[4] = 90.0f;
-
-  /* copy atom coords into separate X/Y/Z arrays for writing */
-  for (i=0; i<dcd->natoms; i++) {
-    dcd->x[i] = *(pos++); 
-    dcd->y[i] = *(pos++); 
-    dcd->z[i] = *(pos++); 
-  }
-  dcd->nsets++;
-  curstep = dcd->istart + dcd->nsets * dcd->nsavc;
-
-  unitcell[0] = ts->A;
-  unitcell[2] = ts->B;
-  unitcell[5] = ts->C;
-  unitcell[1] = sin((M_PI_2 / 90.0) * (90.0 - ts->gamma)); /* cosAB */
-  unitcell[3] = sin((M_PI_2 / 90.0) * (90.0 - ts->beta));  /* cosAC */
-  unitcell[4] = sin((M_PI_2 / 90.0) * (90.0 - ts->alpha)); /* cosBC */
-
-  rc = write_dcdstep(dcd->fd, dcd->nsets, curstep, dcd->natoms, 
-                     dcd->x, dcd->y, dcd->z,
-                     dcd->with_unitcell ? unitcell : NULL,
-                     dcd->charmm);
-  if (rc < 0) {
-    print_dcderror("write_dcdstep", rc);
-    return MOLFILE_ERROR;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_file_write(void *v) {
-  dcdhandle *dcd = (dcdhandle *)v;
-  fio_fclose(dcd->fd);
-  free(dcd->x);
-  free(dcd->y);
-  free(dcd->z);
-  free(dcd);
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "dcd";
-  plugin.prettyname = "CHARMM,NAMD,XPLOR DCD Trajectory";
-  plugin.author = "Axel Kohlmeyer, Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 12;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "dcd";
-  plugin.open_file_read = open_dcd_read;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_file_read;
-  plugin.open_file_write = open_dcd_write;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-  
-#ifdef TEST_DCDPLUGIN
-
-#include <sys/time.h>
-
-/* get the time of day from the system clock, and store it (in seconds) */
-double time_of_day(void) {
-#if defined(_MSC_VER)
-  double t;
-
-  t = GetTickCount();
-  t = t / 1000.0;
-
-  return t;
-#else
-  struct timeval tm;
-  struct timezone tz;
-
-  gettimeofday(&tm, &tz);
-  return((double)(tm.tv_sec) + (double)(tm.tv_usec)/1000000.0);
-#endif
-}
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  dcdhandle *dcd;
-  int i, natoms;
-  float sizeMB =0.0, totalMB = 0.0;
-  double starttime, endtime, totaltime = 0.0;
-
-  while (--argc) {
-    ++argv; 
-    natoms = 0;
-    v = open_dcd_read(*argv, "dcd", &natoms);
-    if (!v) {
-      fprintf(stderr, "main) open_dcd_read failed for file %s\n", *argv);
-      return 1;
-    }
-    dcd = (dcdhandle *)v;
-    sizeMB = ((natoms * 3.0) * dcd->nsets * 4.0) / (1024.0 * 1024.0);
-    totalMB += sizeMB; 
-    printf("main) file: %s\n", *argv);
-    printf("  %d atoms, %d frames, size: %6.1fMB\n", natoms, dcd->nsets, sizeMB);
-
-    starttime = time_of_day();
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    for (i=0; i<dcd->nsets; i++) {
-      int rc = read_next_timestep(v, natoms, &timestep);
-      if (rc) {
-        fprintf(stderr, "error in read_next_timestep on frame %d\n", i);
-        return 1;
-      }
-    }
-    endtime = time_of_day();
-    close_file_read(v);
-    totaltime += endtime - starttime;
-    printf("  Time: %5.1f seconds\n", endtime - starttime);
-    printf("  Speed: %5.1f MB/sec, %5.1f timesteps/sec\n", sizeMB / (endtime - starttime), (dcd->nsets / (endtime - starttime)));
-  }
-  printf("Overall Size: %6.1f MB\n", totalMB);
-  printf("Overall Time: %6.1f seconds\n", totaltime);
-  printf("Overall Speed: %5.1f MB/sec\n", totalMB / totaltime);
-  return 0;
-}
-      
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dlpolyplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dlpolyplugin.c
deleted file mode 100644
index 99a2a36c237edc2094815c7b289cec0a0c6b5b2b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dlpolyplugin.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dlpolyplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.24 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * DLPOLY formatted history file format:
- *   http://www.ccp5.ac.uk/DL_POLY/MANUALS/USRMAN4.pdf
- *   http://www.ccp5.ac.uk/DL_POLY_CLASSIC/MANUALS/USRMAN.pdf
- *
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-typedef struct {
-  FILE *file;
-  int dlpolyversion;
-  int numatoms;
-  int cellwarnflag;
-} dlpolydata;
- 
-
-static void *open_dlpoly_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  dlpolydata *data;
-  char fbuffer[4096], buf[4096];
-  int dlpolyversion, scancount, nstep, keytrj, atomcount;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-
-  if (NULL == fgets(fbuffer, 1024, fd))  
-    return NULL;
-
-  if (!strcmp(filetype, "dlpolyhist")) {
-    dlpolyversion=2;
-  } else if (!strcmp(filetype, "dlpoly3hist")) {
-    dlpolyversion=3;
-  } else {
-    dlpolyversion=2;
-  }
- 
-  /* check to see if the first line is a "timestep" record */ 
-  scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, natoms);
-  if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, natoms);
-    if (scancount != 3) {
-      printf("open_dlpoly_read) unrecognized header record\n");
-      return NULL;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, &atomcount);
-    if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-      printf("open_dlpoly_read) unrecognized timestep record\n");
-      return NULL;
-    }
-
-    if (atomcount != *natoms) {
-      printf("open_dlpoly_read) mismatched atom count\n");
-      return NULL;
-    }
-  }
- 
-  data = (dlpolydata *) malloc(sizeof(dlpolydata));
-  memset(data, 0, sizeof(dlpolydata));
-  data->file = fd;
-  data->numatoms= *natoms;
-  data->cellwarnflag = 0;
-  data->dlpolyversion = dlpolyversion;
-
-  rewind(data->file); /* prepare for first read_timestep call */
-  return data;
-}
-
-
-static void *open_dlpoly_config_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  dlpolydata *data;
-  char fbuffer[4096], buf[4096];
-  int dlpolyversion, scancount, keytrj, imcon;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-
-  if (NULL == fgets(fbuffer, 1024, fd))  
-    return NULL;
-
-  if (!strcmp(filetype, "dlpolyconfig")) {
-    dlpolyversion=2;
-  }
- 
-  
-  scancount = sscanf(fbuffer, "%s %d %d", buf, &imcon, natoms);
-  if (scancount != 3 ) {
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &imcon, natoms);
-    if (scancount != 3) {
-      printf("open_dlpoly_read) unrecognized header record\n");
-      return NULL;
-    } 
-  }
-    
-  data = (dlpolydata *) malloc(sizeof(dlpolydata));
-  memset(data, 0, sizeof(dlpolydata));
-  data->file = fd;
-  data->numatoms= *natoms;
-  data->cellwarnflag = 0;
-  data->dlpolyversion = dlpolyversion;
-
-  rewind(data->file); /* prepare for first read_timestep call */
-  return data;
-}
-
-static int read_dlpoly_structure(void *mydata, int *optflags,
-                              molfile_atom_t *atoms) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge;
-  dlpolydata *data = (dlpolydata *)mydata;
- 
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  /* check to see if the first line is a "timestep" record */
-  scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                     &nstep, &atomcount, &keytrj, &imcon, &tstep);
-  if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-    if (scancount != 3) {
-      printf("dlpoly structure) unrecognized header record\n");
-      return MOLFILE_ERROR;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                       &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-    if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-      printf("dlpoly structure) unrecognized timestep record\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check atom count */
-    if (atomcount != atomcount2) {
-      printf("dlpoly structure) header/timestep mismatched atom count\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* check atom count */
-  if (atomcount != data->numatoms) {
-    printf("dlpoly structure) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon >= 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    /* eat the data but don't use it for anything */
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms + i;
-
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly structure v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly structure v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly structure) failed reading atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly structure) failed reading atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    strncpy(atom->name, buf, sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_dlpoly_config_structure(void *mydata, int *optflags,
-                              molfile_atom_t *atoms) {
-  char fbuffer[4096], buf[4096];
-  float x, y, z;
-  int i, atomcount, keytrj, imcon, scancount, atomid;
-  dlpolydata *data = (dlpolydata *)mydata;
- 
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &imcon, &atomcount);
-    if (scancount != 3) {
-      printf("dlpoly structure) unrecognized header record\n");
-      return MOLFILE_ERROR;
-    } 
-
-  /* check atom count */
-  if (atomcount != data->numatoms) {
-    printf("dlpoly structure) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    /* eat the data but don't use it for anything */
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms + i;
-
-    /* read the coordinates */
-    if (2 != fscanf(data->file, "%s %d", buf, &atomid)) {
-      printf("dlpoly structure v3) failed parsing atom labels\n");
-      return MOLFILE_ERROR;
-    }
-    /* read the coordinates */
-    if (3 != fscanf(data->file, "%f %f %f", &x, &y, &z)) {
-      printf("dlpoly structure) failed reading atom coordinates\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly structure) failed reading atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly structure) failed reading atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    strncpy(atom->name, buf, sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_dlpoly_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge, elapsedps;
-  dlpolydata *data = (dlpolydata *)mydata;
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  switch (data->dlpolyversion) {
-    case 3:
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount, &keytrj, &imcon, &tstep, &elapsedps);
-      if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v3) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount2, &keytrj, &imcon, &tstep, &elapsedps);
-        if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v3) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v3) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-
-    case 2:
-    default: 
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                         &nstep, &atomcount, &keytrj, &imcon, &tstep);
-      if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v2) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                           &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-        if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v2) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v2) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-  }
-
-  /* check atom count */
-  if (atomcount != natoms) {
-    printf("dlpoly timestep) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon >= 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check and copy in periodic cell info */
-    if (ts != NULL) {
-      if (xaxis[1] != 0.0 || xaxis[2] != 0.0 || 
-          yaxis[0] != 0.0 || yaxis[2] != 0.0 || 
-          zaxis[0] != 0.0 || zaxis[1] != 0.0) {
-        if (data->cellwarnflag != 1)
-          printf("dlpoly timestep) non-orthogonal DLPOLY periodic cell data unsupported\n");
-        data->cellwarnflag = 1;
-      } else {
-        ts->A = xaxis[0];
-        ts->B = yaxis[1];
-        ts->C = zaxis[2];
-        if (data->cellwarnflag != 2)
-          printf("dlpoly timestep) converting DLPOLY periodic cell data\n");
-        data->cellwarnflag = 2;
-      }
-    }
-  }
-
-  /* read all per-atom data */
-  for (i=0; i<natoms; i++) {
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly timestep v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly timestep v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly timestep) failed parsing atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly timestep) failed parsing atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    if (ts != NULL) { 
-      if (atomid > 0 && atomid <= natoms) {
-        int addr = 3 * (atomid - 1);
-        ts->coords[addr    ] = x;
-        ts->coords[addr + 1] = y;
-        ts->coords[addr + 2] = z;
-      } else {
-        fprintf(stderr, "dlpoly timestep) ignoring illegal atom index %d\n", atomid);
-      }
-    } 
-  }
-
-  /* eat remaining spaces and LF character */
-  fgets(fbuffer, 1024, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-    
-
-static int read_dlpoly_config_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char fbuffer[4096], buf[4096];
-  float x, y, z;
-  int i, atomcount, keytrj, imcon, scancount, atomid;
-  dlpolydata *data = (dlpolydata *)mydata;
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  if (NULL == fgets(fbuffer, 1024, data->file))
-    return MOLFILE_EOF;
-  scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &imcon, &atomcount);
-  if (scancount != 3) {
-    printf("dlpoly timestep v3) unrecognized header record\n");
-    return MOLFILE_ERROR;
-  } 
-
-  /* check atom count */
-  if (atomcount != natoms) {
-    printf("dlpoly timestep) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check and copy in periodic cell info */
-    if (ts != NULL) {
-      if (xaxis[1] != 0.0 || xaxis[2] != 0.0 || 
-          yaxis[0] != 0.0 || yaxis[2] != 0.0 || 
-          zaxis[0] != 0.0 || xaxis[1] != 0.0) {
-        if (data->cellwarnflag != 1)
-          printf("dlpoly timestep) non-orthogonal DLPOLY periodic cell data unsupported\n");
-        data->cellwarnflag = 1;
-      } else {
-        ts->A = xaxis[0];
-        ts->B = yaxis[1];
-        ts->C = zaxis[2];
-        if (data->cellwarnflag != 2)
-          printf("dlpoly timestep) converting DLPOLY periodic cell data\n");
-        data->cellwarnflag = 2;
-      }
-    }
-  }
-
-  /* read all per-atom data */
-  for (i=0; i<natoms; i++) {
-    /* read the coordinates */
-    if (2 != fscanf(data->file, "%s %d", buf, &atomid)) {
-      printf("dlpoly timestep v3) failed parsing atom labels\n");
-      return MOLFILE_ERROR;
-    }
-    /* read the coordinates */
-    if (3 != fscanf(data->file, "%f %f %f", &x, &y, &z)) {
-      printf("dlpoly timestep) failed parsing atom coordinates\n");
-      return MOLFILE_ERROR;
-    }
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly timestep) failed parsing atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly timestep) failed parsing atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    if (ts != NULL) { 
-      if (atomid > 0 && atomid <= natoms) {
-        int addr = 3 * (atomid - 1);
-        ts->coords[addr    ] = x;
-        ts->coords[addr + 1] = y;
-        ts->coords[addr + 2] = z;
-      } else {
-        fprintf(stderr, "dlpoly timestep) ignoring illegal atom index %d\n", atomid);
-      }
-    } 
-  }
-
-  /* eat remaining spaces and LF character */
-  fgets(fbuffer, 1024, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-    
-    
-    
-static void close_dlpoly_read(void *mydata) {
-  dlpolydata *data = (dlpolydata *)mydata;
-  fclose(data->file);
-  free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t dlpoly2plugin;
-static molfile_plugin_t dlpoly3plugin;
-
-static molfile_plugin_t dlpolypluginconfig;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&dlpoly2plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly2plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly2plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly2plugin.name = "dlpolyhist";
-  dlpoly2plugin.prettyname = "DL_POLY_C HISTORY";
-  dlpoly2plugin.author = "John Stone";
-  dlpoly2plugin.majorv = 0;
-  dlpoly2plugin.minorv = 8;
-  dlpoly2plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly2plugin.filename_extension = "dlpolyhist";
-  dlpoly2plugin.open_file_read = open_dlpoly_read;
-  dlpoly2plugin.read_structure = read_dlpoly_structure;
-  dlpoly2plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly2plugin.close_file_read = close_dlpoly_read;
-
-  memset(&dlpoly3plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly3plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly3plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly3plugin.name = "dlpoly3hist";
-  dlpoly3plugin.prettyname = "DL_POLY_4 HISTORY";
-  dlpoly3plugin.author = "John Stone";
-  dlpoly3plugin.majorv = 0;
-  dlpoly3plugin.minorv = 8;
-  dlpoly3plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly3plugin.filename_extension = "dlpolyhist";
-  dlpoly3plugin.open_file_read = open_dlpoly_read;
-  dlpoly3plugin.read_structure = read_dlpoly_structure;
-  dlpoly3plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly3plugin.close_file_read = close_dlpoly_read;
-
-  memset(&dlpolypluginconfig, 0, sizeof(molfile_plugin_t));
-  dlpolypluginconfig.abiversion = vmdplugin_ABIVERSION;
-  dlpolypluginconfig.type = MOLFILE_PLUGIN_TYPE;
-  dlpolypluginconfig.name = "dlpolyconfig";
-  dlpolypluginconfig.prettyname = "DL_POLY CONFIG";
-  dlpolypluginconfig.author = "Alin M Elena";
-  dlpolypluginconfig.majorv = 0;
-  dlpolypluginconfig.minorv = 1;
-  dlpolypluginconfig.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpolypluginconfig.filename_extension = "dlpolyconfig";
-  dlpolypluginconfig.open_file_read = open_dlpoly_config_read;
-  dlpolypluginconfig.read_structure = read_dlpoly_config_structure;
-  dlpolypluginconfig.read_next_timestep = read_dlpoly_config_timestep;
-  dlpolypluginconfig.close_file_read = close_dlpoly_read;
-  
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&dlpoly2plugin);
-  (*cb)(v, (vmdplugin_t *)&dlpoly3plugin);
-  (*cb)(v, (vmdplugin_t *)&dlpolypluginconfig);
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_dlpoly_read(*argv, "dlpoly", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_dlpoly_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_dlpoly_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_dlpoly_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_dlpoly_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dmsplugin.cxx b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dmsplugin.cxx
deleted file mode 100644
index edc1b83340ff01c853b80db74ee0aee9d3b0645e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dmsplugin.cxx
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#include "molfile_plugin.h"
-#include <sqlite3.h>
-
-#include <ctype.h> /* for isspace() */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <vector>
-#include <map>
-
-
-#ifdef _MSC_VER
-#include <windows.h>
-static int fs_remove_file( const char * path ) {
-  DeleteFileA( path );
-  return 1; /* FIXME: check for failure */
-}
-#else
-#include <unistd.h>
-#include <errno.h>
-static int fs_remove_file( const char * path ) {
-    if (unlink(path)!=0 && errno!=ENOENT) {
-        fprintf(stderr, "Removing %s failed: %s\n", path, strerror(errno));
-        return 0;
-    }
-    return 1;
-}
-#endif
-
-#ifndef M_PI
-#define M_PI (3.1415926535897932385)
-#endif
-
-#ifndef M_PI_2
-#define M_PI_2 (1.5707963267948966192)
-#endif
-
-struct element {
-  double daltons;
-  const char* abbreviation;
-  const char* name;
-};
-
-/* url = "http://physics.nist.gov/cgi-bin/Elements/elInfo.pl?element=%d&context=noframes"%element */
-static struct element amu[] = {
-  {1.00794,"H","Hydrogen"},
-  {4.002602,"He","Helium"},
-  {6.941,"Li","Lithium"},
-  {9.012182,"Be","Beryllium"},
-  {10.811,"B","Boron"},
-  {12.0107,"C","Carbon"},
-  {14.0067,"N","Nitrogen"},
-  {15.9994,"O","Oxygen"},
-  {18.9984032,"F","Fluorine"},
-  {20.1797,"Ne","Neon"},
-  {22.989770,"Na","Sodium"},
-  {24.3050,"Mg","Magnesium"},
-  {26.981538,"Al","Aluminum"},
-  {28.0855,"Si","Silicon"},
-  {30.973761,"P","Phosphorus"},
-  {32.065,"S","Sulfur"},
-  {35.453,"Cl","Chlorine"},
-  {39.0983,"K","Potassium"},
-  {39.948,"Ar","Argon"},
-  {40.078,"Ca","Calcium"},
-  {44.955910,"Sc","Scandium"},
-  {47.867,"Ti","Titanium"},
-  {50.9415,"V","Vanadium"},
-  {51.9961,"Cr","Chromium"},
-  {54.938049,"Mn","Manganese"},
-  {55.845,"Fe","Iron"},
-  {58.6934,"Ni","Nickel"},
-  {58.933200,"Co","Cobalt"},
-  {63.546,"Cu","Copper"},
-  {65.409,"Zn","Zinc"},
-  {69.723,"Ga","Gallium"},
-  {72.64,"Ge","Germanium"},
-  {74.92160,"As","Arsenic"},
-  {78.96,"Se","Selenium"},
-  {79.904,"Br","Bromine"},
-  {83.798,"Kr","Krypton"},
-  {85.4678,"Rb","Rubidium"},
-  {87.62,"Sr","Strontium"},
-  {88.90585,"Y","Yttrium"},
-  {91.224,"Zr","Zirconium"},
-  {92.90638,"Nb","Niobium"},
-  {95.94,"Mo","Molybdenum"},
-  {101.07,"Ru","Ruthenium"},
-  {102.90550,"Rh","Rhodium"},
-  {106.42,"Pd","Palladium"},
-  {107.8682,"Ag","Silver"},
-  {112.411,"Cd","Cadmium"},
-  {114.818,"In","Indium"},
-  {118.710,"Sn","Tin"},
-  {121.760,"Sb","Antimony"},
-  {126.90447,"I","Iodine"},
-  {127.60,"Te","Tellurium"},
-  {131.293,"Xe","Xenon"},
-  {132.90545,"Cs","Cesium"},
-  {137.327,"Ba","Barium"},
-  {138.9055,"La","Lanthanum"},
-  {140.116,"Ce","Cerium"},
-  {140.90765,"Pr","Praseodymium"},
-  {144.24,"Nd","Neodymium"},
-  {150.36,"Sm","Samarium"},
-  {151.964,"Eu","Europium"},
-  {157.25,"Gd","Gadolinium"},
-  {158.92534,"Tb","Terbium"},
-  {162.500,"Dy","Dysprosium"},
-  {164.93032,"Ho","Holmium"},
-  {167.259,"Er","Erbium"},
-  {168.93421,"Tm","Thulium"},
-  {173.04,"Yb","Ytterbium"},
-  {174.967,"Lu","Lutetium"},
-  {178.49,"Hf","Hafnium"},
-  {180.9479,"Ta","Tantalum"},
-  {183.84,"W","Tungsten"},
-  {186.207,"Re","Rhenium"},
-  {190.23,"Os","Osmium"},
-  {192.217,"Ir","Iridium"},
-  {195.078,"Pt","Platinum"},
-  {196.96655,"Au","Gold"},
-  {200.59,"Hg","Mercury"},
-  {204.3833,"Tl","Thallium"},
-  {207.2,"Pb","Lead"},
-  {208.98038,"Bi","Bismuth"},
-  {231.03588,"Pa","Protactinium"},
-  {232.0381,"Th","Thorium"},
-  {238.02891,"U","Uranium"}
-};
-
-static const int nelements = sizeof(amu)/sizeof(amu[0]);
-
-static const char * 
-find_element_by_atomic_number(int target) {
-  if (target < 1) target=1;
-  if (target >= nelements) target = nelements;
-  return amu[target-1].abbreviation;
-}
-
-static int 
-find_element_by_amu(double target) {
-  int left = 0;
-  int right = nelements-1;
-  int swap;
-
-  /* -----------------------------------------------
-  // Knuth's binary search
-  // ----------------------------------------------- */
-  while(left <= right) {
-    int mid = (left+right)/2;
-    if (target> amu[mid].daltons) {
-      left = mid + 1;
-    } else if (target< amu[mid].daltons) {
-      right = mid - 1;
-    } else {
-      /* Exact match (unlikely) */
-      left = right = mid;
-      return left+1;
-    }
-  }
-
-  /* -----------------------------------------------
-  // CAUTION: at this point, the meanings of 
-  // left and right are switched (i.e. left >= right,
-  // see the while() loop above if you don't believe me!
-  // ----------------------------------------------- */
-  swap = left;
-  left = right;
-  right = swap;
-
-  if (left < 0) left = right;
-  if (right > nelements-1) right = left;
-
-  if (target - amu[left].daltons < amu[right].daltons - target) {
-    return left+1;
-  }
-
-  return right+1;
-}
-
-static int table_size( sqlite3 * db, const char * tname, 
-                       sqlite_int64 * count ) {
-    sqlite3_stmt *stmt;
-    char * buf;
-
-    if (!tname) return 0;
-    buf = (char *)malloc(strlen(tname) + 100);
-    sprintf(buf, "select count() from '%s'", tname);
-    if (sqlite3_prepare_v2(db, buf, -1, &stmt, NULL)) {
-        free(buf);
-        return 0;
-    }
-    if (SQLITE_ROW != sqlite3_step(stmt)) {
-        sqlite3_finalize(stmt);
-        free(buf);
-        return 0;
-    }
-    if (count) *count = sqlite3_column_int64(stmt, 0);
-    sqlite3_finalize(stmt);
-    return 1; /* success */
-}
-
-static molfile_plugin_t plugin;
-//static molfile_plugin_t append_plugin;
-
-namespace {
-    struct Handle {
-        sqlite3 * db;
-        int natoms;
-        int frames_read;
-        std::vector<int> from, to, gids;
-        std::vector<int> glue_from, glue_to;
-        std::vector<float> order;
-        Handle(sqlite3 * _db, int n) 
-        : db(_db), natoms(n), frames_read(0) {}
-            
-        ~Handle() {
-            if (db && sqlite3_close(db)) 
-                fprintf(stderr, "Error closing db: %s\n", sqlite3_errmsg(db));
-        }
-    };
-}
-
-
-  static void *open_file_read( const char *filename, const char *filetype,
-                        int *natoms ) {
-
-      sqlite3 * db;
-      sqlite_int64 count;
-      Handle * h;
-      if (sqlite3_open_v2( filename, &db, SQLITE_OPEN_READONLY, NULL)) {
-          fprintf(stderr, "Error opening dms at %s: %s", 
-                  filename, sqlite3_errmsg(db));
-          return NULL;
-      }
-      if (!table_size( db, "particle", &count )) return NULL;
-      h = new Handle(db, count);
-      *natoms = count;
-      return h;
-  }
-
-static void close_file_read(void *v) { delete (Handle *)v; }
-
-static int has_nonwhitespace( const char * p ) {
-    for (; *p; ++p) {
-        if (!isspace(*p)) return 1;
-    }
-    return 0;
-}
-
-#define GET_STRING( col, field ) do { \
-    if ( col >= 0 ) { \
-        const char * val = (const char *)sqlite3_column_text(stmt, col); \
-        if (val) { \
-            strncpy( atom->field, val, sizeof(atom->field) ); \
-            atom->field[sizeof(atom->field)-1] = '\0'; \
-        } \
-    } \
-} while(0)
-
-#define GET_INT( col, field ) do { \
-    if ( col >= 0 ) { \
-        atom->field = sqlite3_column_int(stmt, col); \
-    } \
-} while (0)
-
-#define GET_DOUBLE( col, field ) do { \
-    if ( col >= 0 ) { \
-        atom->field = sqlite3_column_double(stmt, col); \
-    } \
-} while (0)
-
-  static
-  int read_structure( void *v, int *optflags, molfile_atom_t *atoms ) {
-      Handle *h = (Handle *)v;
-      sqlite3 * db = h->db;
-      sqlite3_stmt * stmt;
-      static const char infosql[] = "pragma table_info(particle)";
-      static const char loadsql[] = "select * from particle";
-      molfile_atom_t * atom = NULL;
-
-      int gid_col = -1;
-      int name_col = -1;
-      int anum_col = -1;
-      int resid_col = -1;
-      int resname_col = -1;
-      int chain_col = -1;
-      int segid_col = -1;
-      int mass_col = -1;
-      int charge_col = -1;
-      int x_col = -1;
-      int y_col = -1;
-      int z_col = -1;
-      int vx_col = -1;
-      int vy_col = -1;
-      int vz_col = -1;
-      int occ_col = -1;
-  
-      int ncols=0;
-      *optflags = 0;
-  
-      if (sqlite3_prepare_v2(db, infosql, -1, &stmt, NULL)) {
-          fprintf(stderr, "Error getting particle info: %s", 
-                  sqlite3_errmsg(db));
-          return MOLFILE_ERROR;
-      }
-      atom = atoms;
-      while (SQLITE_ROW==sqlite3_step(stmt)) {
-          const char * name = (const char *)sqlite3_column_text(stmt,1);
-
-          if      (!strcmp(name, "anum")) anum_col = ncols;
-          else if (!strcmp(name, "id")) gid_col = ncols;
-          else if (!strcmp(name, "name")) name_col = ncols;
-          else if (!strcmp(name, "resid")) resid_col = ncols;
-          else if (!strcmp(name, "resname")) resname_col = ncols;
-          else if (!strcmp(name, "chain")) chain_col = ncols;
-          else if (!strcmp(name, "segid")) segid_col = ncols;
-          else if (!strcmp(name, "mass")) mass_col = ncols;
-          else if (!strcmp(name, "charge")) charge_col = ncols;
-          else if (!strcmp(name, "x")) x_col = ncols;
-          else if (!strcmp(name, "y")) y_col = ncols;
-          else if (!strcmp(name, "z")) z_col = ncols;
-          else if (!strcmp(name, "vx")) vx_col = ncols;
-          else if (!strcmp(name, "vy")) vy_col = ncols;
-          else if (!strcmp(name, "vz")) vz_col = ncols;
-          else if (!strcmp(name, "occupancy")) occ_col = ncols;
-          ++ncols;
-      }  
-      sqlite3_finalize(stmt);
-
-      if (anum_col >= 0)   *optflags |= MOLFILE_ATOMICNUMBER;
-      if (charge_col >= 0) *optflags |= MOLFILE_CHARGE;
-      if (mass_col >= 0)   *optflags |= MOLFILE_MASS;
-      if (occ_col >= 0)    *optflags |= MOLFILE_OCCUPANCY;
-
-      if (gid_col<0) {
-          fprintf(stderr, "Missing id column in particle table\n");
-          return MOLFILE_ERROR;
-      }
-
-      if (sqlite3_prepare_v2(db, loadsql, -1, &stmt, NULL)) {
-          fprintf(stderr, "Error loading particle structure: %s",
-                  sqlite3_errmsg(db));
-          return MOLFILE_ERROR;
-      }
-      while (SQLITE_ROW==sqlite3_step(stmt)) {
-          memset(atom, 0, sizeof(*atom));
-          GET_STRING(    name_col, name );
-          GET_INT(       anum_col, atomicnumber );
-          GET_INT(      resid_col, resid );
-          GET_STRING( resname_col, resname );
-          GET_DOUBLE(    mass_col, mass );
-          GET_DOUBLE(  charge_col, charge );
-          GET_DOUBLE(     occ_col, occupancy );
-          GET_STRING(   chain_col, chain );
-          GET_STRING(   segid_col, segid );
-
-          h->gids.push_back(sqlite3_column_int(stmt, gid_col));
-
-          /* if the name is all space, and we have an atomic number, use the
-          element name instead. */
-          if (atom->atomicnumber) {
-            if (!has_nonwhitespace(atom->name)) {
-              const char *nm = 
-                find_element_by_atomic_number(atom->atomicnumber);
-              strncpy( atom->name, nm, sizeof(atom->name));
-            }
-          }
-          ++atom;
-      }
-      sqlite3_finalize(stmt);
-      return MOLFILE_SUCCESS;
-  }
-
-static
-#if vmdplugin_ABIVERSION > 14
-int read_bonds(void *v, int *nbonds, int **from, int **to, float** order,
-               int **bondtype, int *nbondtypes, char ***bondtypename) {
-#else
-int read_bonds(void *v, int *nbonds, int **from, int **to, float** order) {
-#endif
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite_int64 count = 0;
-    if (table_size(h->db, "bond", &count) && count>0) {
-        sqlite3_stmt * stmt;
-        int with_order = 1;
-        /* Try including order first */
-        static const char * sql = "select p0,p1,\"order\" from bond";
-        if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-            /* Fall back to just p0, p1 */
-            static const char * sql = "select p0,p1 from bond";
-            with_order = 0;
-            if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-                fprintf(stderr, "Error reading bonds: %s", sqlite3_errmsg(db));
-                return MOLFILE_ERROR;
-            }
-        }
-        h->from.resize(count);
-        h->to.resize(count);
-        h->order.resize(count);
-
-        *from = &h->from[0];
-        *to   = &h->to[0];
-        *order = &h->order[0];
-#if vmdplugin_ABIVERSION > 14
-        *bondtype = NULL;
-        *nbondtypes = 0;
-        *bondtypename = NULL;
-  #endif
-
-        std::map<int,int> gidmap;
-        for (unsigned i=0; i<h->gids.size(); i++) gidmap[h->gids[i]]=i+1;
-
-        for (int i=0; sqlite3_step(stmt)==SQLITE_ROW; i++) {
-            std::map<int,int>::const_iterator iter;
-
-            int from = sqlite3_column_int(stmt,0);
-            int to   = sqlite3_column_int(stmt,1);
-            h->order[i] = with_order ? sqlite3_column_int(stmt,2) : 1;
-            if ((iter=gidmap.find(from))==gidmap.end()) {
-                fprintf(stderr, "Illegal bond in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->from[i] = iter->second;
-            if ((iter=gidmap.find(to))==gidmap.end()) {
-                fprintf(stderr, "Illegal bond in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->to[i] = iter->second;
-        }
-        sqlite3_finalize(stmt);
-    }
-    *nbonds = count;
-    return MOLFILE_SUCCESS;
-}
-
-static
-int read_fictitious_bonds(void *v, int *nbonds, int **from, int **to) {
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite_int64 count = 0;
-    if (table_size(h->db, "glue", &count) && count>0) {
-        sqlite3_stmt * stmt;
-        static const char * sql = "select p0,p1 from glue";
-        if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-            fprintf(stderr, "Error reading bonds: %s", sqlite3_errmsg(db));
-            return MOLFILE_ERROR;
-        }
-        h->glue_from.resize(count);
-        h->glue_to.resize(count);
-
-        *from = &h->glue_from[0];
-        *to   = &h->glue_to[0];
-
-        std::map<int,int> gidmap;
-        for (unsigned i=0; i<h->gids.size(); i++) gidmap[h->gids[i]]=i+1;
-
-        for (int i=0; sqlite3_step(stmt)==SQLITE_ROW; i++) {
-            std::map<int,int>::const_iterator iter;
-
-            int from = sqlite3_column_int(stmt,0);
-            int to   = sqlite3_column_int(stmt,1);
-            if ((iter=gidmap.find(from))==gidmap.end()) {
-                fprintf(stderr, "Illegal glue in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->glue_from[i] = iter->second;
-            if ((iter=gidmap.find(to))==gidmap.end()) {
-                fprintf(stderr, "Illegal glue in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->glue_to[i] = iter->second;
-        }
-        sqlite3_finalize(stmt);
-    }
-    *nbonds = count;
-    return MOLFILE_SUCCESS;
-}
-
-  static
-  double dotprod(const double *x, const double *y) {
-    return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
-  }
-
-  static
-  int read_global_cell(Handle * h, molfile_timestep_t * ts) {
-      sqlite3_stmt * stmt;
-      sqlite_int64 count;
-      int i,j;
-      double cell[3][3];
-      double cosAB, cosAC, cosBC;
-      const double * A, * B, * C;
-      if (!table_size(h->db, "global_cell", &count)) return MOLFILE_SUCCESS;
-      if (count != 3) {
-          fprintf(stderr, "Error: expected global_cell size of 3, got %d",
-                  (int)count);
-          return MOLFILE_ERROR;
-      }
-      if (sqlite3_prepare_v2(h->db,"select x,y,z from global_cell", -1, &stmt, NULL))  {
-          fprintf(stderr, "Error compiling global_cell reader: %s",
-                  sqlite3_errmsg(h->db));
-          return MOLFILE_ERROR;
-      }
-      for (i=0; i<3; i++) {
-          sqlite3_step(stmt);
-          for (j=0; j<3; j++) {
-              cell[i][j] = sqlite3_column_double(stmt,j);
-          }
-      }
-      sqlite3_finalize(stmt);
-
-      A = cell[0];
-      B = cell[1];
-      C = cell[2];
-
-      /* store lengths */
-      ts->A = sqrt(dotprod(A,A));
-      ts->B = sqrt(dotprod(B,B));
-      ts->C = sqrt(dotprod(C,C));
-
-      if (ts->A==0 || ts->B==0 || ts->C==0) {
-          ts->alpha = ts->beta = ts->gamma = 90.0;
-
-      } else {
-        /* compute angles */
-        cosAB = dotprod(A,B)/(ts->A * ts->B);
-        cosAC = dotprod(A,C)/(ts->A * ts->C);
-        cosBC = dotprod(B,C)/(ts->B * ts->C);
-
-        /* clamp */
-        if (cosAB > 1.0) cosAB = 1.0; else if (cosAB < -1.0) cosAB = -1.0;
-        if (cosAC > 1.0) cosAC = 1.0; else if (cosAC < -1.0) cosAC = -1.0;
-        if (cosBC > 1.0) cosBC = 1.0; else if (cosBC < -1.0) cosBC = -1.0;
-
-        /* convert to angles using asin to avoid nasty rounding when we are
-        close to 90 degree angles. */
-        ts->alpha = 90.0 - asin(cosBC) * 90.0 / M_PI_2; /* cosBC */
-        ts->beta  = 90.0 - asin(cosAC) * 90.0 / M_PI_2; /* cosAC */
-        ts->gamma = 90.0 - asin(cosAB) * 90.0 / M_PI_2; /* cosAB */
-      }
-      return MOLFILE_SUCCESS;
-  }
-
-  static
-  int read_timestep(Handle * h, molfile_timestep_t *ts) {
-
-      sqlite3_stmt * stmt;
-      float * pos = ts->coords;
-      float * vel = ts->velocities;
-      const char * sql = vel ? "select x,y,z,vx,vy,vz from particle"
-                             : "select x,y,z          from particle";
-      if (sqlite3_prepare_v2( h->db, sql, -1, &stmt, NULL)) {
-          fprintf(stderr, "Error reading timestep: %s\n", 
-                  sqlite3_errmsg(h->db));
-          return MOLFILE_ERROR;
-      }
-      while (SQLITE_ROW==sqlite3_step(stmt)) {
-          int i;
-          for (i=0; i<3; i++) *pos++ = sqlite3_column_double(stmt,i);
-          if (vel) {
-            for (i=0; i<3; i++) *vel++ = sqlite3_column_double(stmt,i+3);
-          }
-      }
-      sqlite3_finalize(stmt);
-      return read_global_cell(h,ts);
-  }
-
-
-  static
-  int read_next_timestep( void *v, int atoms, molfile_timestep_t *ts) {
-    Handle *h = (Handle *)v;
-    if (h->frames_read++) return MOLFILE_EOF;
-    return read_timestep(h, ts);
-  }
-
-  static
-  int read_timestep2(void *v, ssize_t n, molfile_timestep_t *ts) {
-    Handle *h = (Handle *)v;
-    if (n!=0) return MOLFILE_EOF;
-    return read_timestep(h, ts);
-  }
-
-  static
-  int read_timestep_metadata( void *v, molfile_timestep_metadata_t *m) {
-    /* FIXME: assume velocities */
-    m->has_velocities = 1;
-    m->count = 1; /* number of timesteps */
-    m->avg_bytes_per_timestep = 10000; /* FIXME */
-    return MOLFILE_SUCCESS;
-  }
-
-  static
-  void *open_file_write(const char *path, const char *type, int natoms) {
-
-      sqlite3 * db;
-      Handle *h=NULL;
-      /* delete existing file so we don't just append */
-      if (!fs_remove_file(path)) return NULL;
-      if (sqlite3_open(path, &db)) {
-          fprintf(stderr, "Failed opening %s: %s\n", 
-                  path, sqlite3_errmsg(db));
-          return NULL;
-      }
-      h = new Handle(db, natoms);
-      return h;
-  }
-
-  static
-#if vmdplugin_ABIVERSION > 14
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order,
-                  int *bondtype, int nbondtypes, char **bondtypename) {
-#else
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order) {
-#endif
-      Handle *h = (Handle *)v;
-      h->from.resize(nbonds);
-      h->to.resize(nbonds);
-      
-      std::copy(from, from+nbonds, h->from.begin());
-      std::copy(to,   to+nbonds,   h->to.begin());
-      if (order) {
-          h->order.resize(nbonds);
-          std::copy(order, order+nbonds, h->order.begin());
-      } else {
-          h->order.clear();
-          h->order.insert(h->order.begin(), nbonds, 1);
-      }
-      return MOLFILE_SUCCESS;
-  }
-
-  static
-  int write_structure(void *v, int optflags, const molfile_atom_t *atoms) {
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite3_stmt * stmt;
-    int i;
-
-    sqlite3_exec(db, "begin", NULL, NULL, NULL);
-    if (sqlite3_exec(db, 
-        " create table if not exists particle (\n"
-        "id integer primary key, \n"
-        "anum integer,\n"
-        "x float, y float, z float,\n"
-        "vx float, vy float, vz float,\n"
-        "mass float, charge float,\n"
-        "name text, resname text, resid integer, chain text, segid text)", 
-        NULL, NULL, NULL)) {
-        fprintf(stderr, "Error creating particle table %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    if (sqlite3_prepare_v2(db, "insert into particle values ("
-                "?," /* id */
-                "?," /* anum */
-                "?,?,?,?,?,?," /* x,y,z, vx,vy,vz */
-                "?,?,"  /* mass, charge */
-                "?,?,?,?,?)", /* name, resname, resid, chain, segid */
-                -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling insert particle statement %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    for (i=0; i<h->natoms; i++) {
-        const molfile_atom_t * a = atoms+i;
-        int anum=0;
-        if (optflags & MOLFILE_ATOMICNUMBER) {
-            anum=a->atomicnumber;
-        } else if (optflags & MOLFILE_MASS) {
-            anum=find_element_by_amu(a->mass);
-        }
-
-        sqlite3_bind_int(stmt, 1, i );
-        sqlite3_bind_int(stmt, 2, anum );
-        sqlite3_bind_double( stmt, 9, 
-                optflags & MOLFILE_MASS ?  a->mass : 0.0 );
-        sqlite3_bind_double( stmt, 10, 
-                optflags & MOLFILE_CHARGE ? a->charge : 0.0 );
-        sqlite3_bind_text( stmt, 11, a->name, -1, SQLITE_STATIC );
-        sqlite3_bind_text( stmt, 12, a->resname, -1, SQLITE_STATIC );
-        sqlite3_bind_int(  stmt, 13, a->resid );
-        sqlite3_bind_text( stmt, 14, a->chain, -1, SQLITE_STATIC );
-        sqlite3_bind_text( stmt, 15, a->segid, -1, SQLITE_STATIC );
-        
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error adding particle: %s\n",
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-    
-    /* bonds */
-    if (sqlite3_exec(db,
-        "  create table if not exists bond (\n"
-        "    p0 integer, p1 integer, 'order' integer)", NULL, NULL, NULL )) {
-        fprintf(stderr, "Error creating bond table: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    if (sqlite3_prepare_v2(db, "insert into bond values (?,?,?)", -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling bond insert statement: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    for (unsigned i=0; i<h->from.size(); i++) {
-        sqlite3_bind_int( stmt, 1, h->from[i]-1);
-        sqlite3_bind_int( stmt, 2, h->to[i]-1);
-        sqlite3_bind_int( stmt, 3, h->order[i]);
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error adding bond: %s\n", 
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-    sqlite3_exec(db, "commit", NULL, NULL, NULL);
-    return MOLFILE_SUCCESS;
-  }
-
-  static
-  void convert_to_homebox( const molfile_timestep_t * ts, double box[9]) {
-
-    double A[3], B[3], C[3];
-
-    /* Convert VMD's unit cell information */
-    double cosBC = sin( ((90 - ts->alpha ) / 180) * M_PI );
-    double cosAC = sin( ((90 - ts->beta  ) / 180) * M_PI );
-    double cosAB = sin( ((90 - ts->gamma ) / 180) * M_PI );
-    double sinAB = cos( ((90 - ts->gamma ) / 180) * M_PI );
-
-    double Ax = ts->A;
-    double Ay = 0;
-    double Az = 0;
-    double Bx = ts->B * cosAB;
-    double By = ts->B * sinAB;
-    double Bz = 0;
-    double Cx,Cy,Cz;
-    if (sinAB != 0) {
-      Cx = cosAC;
-      Cy = (cosBC - cosAC*cosAB) / sinAB;
-      Cz = sqrt(1-Cx*Cx-Cy*Cy);
-      Cx *= ts->C;
-      Cy *= ts->C;
-      Cz *= ts->C;
-    } else {
-      Cx=Cy=Cz=0;
-    }
-    A[0] = Ax; A[1] = Ay; A[2] = Az;
-    B[0] = Bx; B[1] = By; B[2] = Bz;
-    C[0] = Cx; C[1] = Cy; C[2] = Cz;
-
-    /* put vectors in rows of box */
-    box[0] = A[0]; box[1] = A[1]; box[2] = A[2];
-    box[3] = B[0]; box[4] = B[1]; box[5] = B[2];
-    box[6] = C[0]; box[7] = C[1]; box[8] = C[2];
-  }
-
-  static
-  int write_timestep(void *v, const molfile_timestep_t *ts) {
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite3_stmt * stmt;
-    double box[9];
-    int i;
-    if (h->frames_read) return MOLFILE_EOF;
-    static const char sql[]=
-        "update particle set x=?,y=?,z=?,vx=?,vy=?,vz=? where id=?";
-    if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling update positions statement: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    sqlite3_exec(db, "begin", NULL, NULL, NULL);
-    for (i=0; i<h->natoms; i++) {
-        sqlite3_bind_double( stmt, 1, ts->coords[3*i  ] );
-        sqlite3_bind_double( stmt, 2, ts->coords[3*i+1] );
-        sqlite3_bind_double( stmt, 3, ts->coords[3*i+2] );
-        double vx=0, vy=0, vz=0;
-        if (ts->velocities) {
-            vx=ts->velocities[3*i];
-            vy=ts->velocities[3*i+1];
-            vz=ts->velocities[3*i+2];
-        }
-        sqlite3_bind_double( stmt, 4, vx );
-        sqlite3_bind_double( stmt, 5, vy );
-        sqlite3_bind_double( stmt, 6, vz );
-        sqlite3_bind_int( stmt, 7, i );
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error updating position: %s\n",
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-
-    if (sqlite3_exec(db,
-        "  create table if not exists global_cell (\n"
-        "  id integer primary key, x float, y float, z float)",
-        NULL, NULL, NULL)) {
-        fprintf(stderr, "Error creating global cell table %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    sqlite3_exec(db, "delete from global_cell", NULL, NULL, NULL);
-    if (sqlite3_prepare_v2(db, "insert into global_cell (x,y,z) values (?,?,?)",
-                -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling global_cell statement: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    convert_to_homebox( ts, box );
-    for (i=0; i<3; i++) {
-        sqlite3_bind_double(stmt, 1, box[3*i  ]);
-        sqlite3_bind_double(stmt, 2, box[3*i+1]);
-        sqlite3_bind_double(stmt, 3, box[3*i+2]);
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error updating global cell: %s\n", 
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-    sqlite3_exec(db, "commit", NULL, NULL, NULL);
-    return MOLFILE_SUCCESS;
-  }
-
-  static void close_file_write(void *v) { delete (Handle *)v; }
-
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(plugin));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "dms";
-  plugin.prettyname = "DESRES Molecular Structure";
-  plugin.author = "D.E. Shaw Research, LLC: Justin Gullingsrud";
-  plugin.majorv = 1;
-  plugin.minorv = 0;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-
-  plugin.filename_extension = "dms";
-  plugin.open_file_read = open_file_read;
-  plugin.read_structure = read_structure;
-  plugin.read_bonds = read_bonds;
-  plugin.read_next_timestep = read_next_timestep;
-#if defined(DESRES_READ_TIMESTEP2)
-  plugin.read_timestep2 = read_timestep2;
-  plugin.read_fictitious_bonds = read_fictitious_bonds;
-#endif
-  plugin.close_file_read = close_file_read;
-
-  plugin.read_timestep_metadata = read_timestep_metadata;
-
-  plugin.open_file_write = open_file_write;
-  plugin.write_structure = write_structure;
-  plugin.write_bonds = write_bonds;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register( void *v, vmdplugin_register_cb cb) {
-  cb( v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dsn6plugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dsn6plugin.C
deleted file mode 100644
index 00829915aef73d18a7cc671a08ac32d9ef5773de..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dsn6plugin.C
+++ /dev/null
@@ -1,316 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dsn6plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.25 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * DSN6 format electron density maps.
- *
- * More info for format can be found at 
- * <http://www.uoxray.uoregon.edu/tnt/manual/node104.html>
- * TODO: Check byte-swapping and alignment issues in read_data()
- *
- * apparently there are some gotchas there, and mapman does some things to 
- * fix up some variants of DSN6:
- * Gerard "DVD" Kleywegt  gerard@xray.bmc.uu.se: 
- *   "dale's description is largely correct, but in elements 13 to 15
- *    the actual cell angles are stored (multiplied by a scale factor)
- *    rather than their cosines. also, turbo-frodo-style dsn6 maps
- *    differ slightly from o-style dsn6 maps. shown below is a chunk
- *    of code (yes, fortran) from mapman that fills the header record"
- * See original email for mapman code snippet:
- *      http://o-info.bioxray.dk/pipermail/o-info/2002-June/005993.html
- * 
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  float prod, plus;
-  molfile_volumetric_t *vol;
-} dsn6_t;
-
-
-static void *open_dsn6_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  dsn6_t *dsn6;
-  short fileHeader[19];
-  int start_x, start_y, start_z, extent_x, extent_y, extent_z;
-  float scale, A, B, C, alpha, beta, gamma, 
-        xaxis[3], yaxis[3], zaxis[3], z1, z2, z3;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "Error opening file.\n");
-    return NULL;
-  }
-
-  // Read the header into a 19-element int array. The integers are stored
-  // according to the endianness of the machine used to write the file, so
-  // swapping may be necessary.
-  fread(fileHeader, sizeof(short), 19, fd);
-
-  // Check byte-order, swapping if necessary
-  if (fileHeader[18] == 25600)
-    swap2_aligned(fileHeader, 19);
-  else if (fileHeader[18] != 100) {
-    fprintf(stderr, "Error reading file header.\n");
-    return NULL;
-  }
-  // else fileHeader[18] is 100, byte-order is fine 
-  // (this value is hard-coded into the file format)
-
-  // Unit cell origin, in grid coordinates
-  start_x = fileHeader[0];
-  start_y = fileHeader[1];
-  start_z = fileHeader[2];
-
-  // Unit cell size
-  extent_x = fileHeader[3];
-  extent_y = fileHeader[4];
-  extent_z = fileHeader[5];
-
-  // Constant cell scaling factor
-  scale = 1.0 / fileHeader[17];
-
-  // Unit cell edge, in angstroms / sample
-  A = scale * fileHeader[9] / fileHeader[6];
-  B = scale * fileHeader[10] / fileHeader[7];
-  C = scale * fileHeader[11] / fileHeader[8];
-
-  // Cell angles, in radians
-  alpha = scale * fileHeader[12] * M_PI / 180.0;
-  beta = scale * fileHeader[13] * M_PI / 180.0;
-  gamma = scale * fileHeader[14] * M_PI / 180.0;
-
-  // Allocate and initialize the dsn6 structure
-  dsn6 = new dsn6_t;
-  dsn6->fd = fd;
-  dsn6->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  dsn6->nsets = 1; // this file contains only one data set
-
-  // Grid data scaling constants
-  dsn6->prod = (float) fileHeader[15] / fileHeader[18];
-  dsn6->plus = fileHeader[16];
-
-  dsn6->vol = new molfile_volumetric_t[1];
-  strcpy(dsn6->vol[0].dataname, "DSN6 Electron Density Map");
-
-  // Calculate non-orthogonal unit cell coordinates
-  xaxis[0] = A;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(gamma) * B;
-  yaxis[1] = sin(gamma) * B;
-  yaxis[2] = 0;
-
-  z1 = cos(beta);
-  z2 = (cos(alpha) - cos(beta)*cos(gamma)) / sin(gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * C;
-  zaxis[1] = z2 * C;
-  zaxis[2] = z3 * C;
-
-  // Convert the origin from grid space to cartesian coordinates
-  dsn6->vol[0].origin[0] = xaxis[0] * start_x + yaxis[0] * start_y + 
-                           zaxis[0] * start_z;
-  dsn6->vol[0].origin[1] = yaxis[1] * start_y + zaxis[1] * start_z;
-  dsn6->vol[0].origin[2] = zaxis[2] * start_z;
-
-  dsn6->vol[0].xaxis[0] = xaxis[0] * (extent_x-1);
-  dsn6->vol[0].xaxis[1] = 0;
-  dsn6->vol[0].xaxis[2] = 0;
-
-  dsn6->vol[0].yaxis[0] = yaxis[0] * (extent_y-1);
-  dsn6->vol[0].yaxis[1] = yaxis[1] * (extent_y-1);
-  dsn6->vol[0].yaxis[2] = 0;
-
-  dsn6->vol[0].zaxis[0] = zaxis[0] * (extent_z-1);
-  dsn6->vol[0].zaxis[1] = zaxis[1] * (extent_z-1);
-  dsn6->vol[0].zaxis[2] = zaxis[2] * (extent_z-1);
-
-  dsn6->vol[0].xsize = extent_x;
-  dsn6->vol[0].ysize = extent_y;
-  dsn6->vol[0].zsize = extent_z;
-
-  dsn6->vol[0].has_color = 0;
-
-  return dsn6;
-}
-
-static int read_dsn6_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  dsn6_t *dsn6 = (dsn6_t *)v;
-  *nsets = dsn6->nsets; 
-  *metadata = dsn6->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_dsn6_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  dsn6_t *dsn6 = (dsn6_t *)v;
-  float * cell = datablock;
-  unsigned char brick[512];
-  unsigned char* brickPtr = NULL;
-  int xsize, ysize, zsize, xysize, xbrix, ybrix, zbrix, cellIndex;
-  int x, y, z, xbrik, ybrik, zbrik;
-  FILE * fd = dsn6->fd;
-  float div, plus;
-
-  // Read 512-byte "bricks" of data. Each brick contains data for 8*8*8 
-  // gridpoints.
-  fseek(fd, 512, SEEK_SET);
-
-  div = 1.0 / dsn6->prod;
-  plus = dsn6->plus;
-
-  xsize = dsn6->vol[0].xsize;
-  ysize = dsn6->vol[0].ysize;
-  zsize = dsn6->vol[0].zsize;
-  xysize = xsize * ysize;
-
-  xbrix = (int) ceil((float) xsize / 8.0);
-  ybrix = (int) ceil((float) ysize / 8.0);
-  zbrix = (int) ceil((float) zsize / 8.0);
-
-  cellIndex = 0;
-  for (zbrik = 0; zbrik < zbrix; zbrik++) {
-    for (ybrik = 0; ybrik < ybrix; ybrik++) {
-      for (xbrik = 0; xbrik < xbrix; xbrik++) {
-        // Read the next brick into the buffer and swap its bytes.
-        if (feof(fd)) {
-          fprintf(stderr, "Unexpected end-of-file.\n");
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          fprintf(stderr, "Error reading file.\n");
-          return MOLFILE_ERROR;
-        }
-
-        fread(brick, sizeof(char), 512, fd);
-        swap2_unaligned(brick, 512*sizeof(char));
-        brickPtr = brick;
-
-        for (z = 0; z < 8; z++) {
-          if ((z + zbrik*8) >= zsize) {
-            cellIndex += (8 - z) * xysize;
-            break;
-          }
-
-          for (y = 0; y < 8; y++) {
-            if ((y + ybrik*8) >= ysize) {
-              cellIndex += (8 - y) * xsize;
-              brickPtr += (8 - y) * 8;
-              break;
-            }
-
-            for (x = 0; x < 8; x++) {
-              if ((x + xbrik*8) >= xsize) {
-                cellIndex += 8 - x;
-                brickPtr += 8 - x;
-                break;
-              }
-
-              // cell[(x+xbrik*8) + (y+ybrik*8)*xsize + (z+zbrik*8)*xysize] =
-              // div * ((float) brick[x + 8*y + 64*z] - plus)
-              cell[cellIndex] = div * ((float) *brickPtr - plus);
-
-              brickPtr++;
-              cellIndex++;
-            } // end for(x)
-           
-            cellIndex += xsize - 8;
-          } // end for(y)
-         
-          cellIndex += xysize - 8*xsize;
-        } // end for(z)
-      
-        cellIndex += 8 - 8*xysize; 
-      } // end for(xbrik)
-
-      cellIndex += 8 * (xsize - xbrix);
-    } // end for(ybrik)
-
-    cellIndex += 8 * (xysize - xsize*ybrik);
-  } // end for(zbrik)
- 
-  return MOLFILE_SUCCESS;
-}
-
-static void close_dsn6_read(void *v) {
-  dsn6_t *dsn6 = (dsn6_t *)v;
-
-  fclose(dsn6->fd);
-  if (dsn6->vol != NULL)
-    delete [] dsn6->vol; 
-  delete dsn6;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "DSN6";
-  plugin.prettyname = "DSN6";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "ds6,dsn6,omap";
-  plugin.open_file_read = open_dsn6_read;
-  plugin.read_volumetric_metadata = read_dsn6_metadata;
-  plugin.read_volumetric_data = read_dsn6_data;
-  plugin.close_file_read = close_dsn6_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dtrplugin.cxx b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dtrplugin.cxx
deleted file mode 100644
index 674ed5561de62ff4c365eb3537b074e829fcb1fb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dtrplugin.cxx
+++ /dev/null
@@ -1,2380 +0,0 @@
-//
-// Version info for VMD plugin tree:
-//   $Id: dtrplugin.cxx,v 1.26 2016/11/06 19:25:35 johns Exp $
-//
-// Version info for last sync with D. E. Shaw Research:
-//  //depot/desrad/main/sw/libs/molfile/plugins/dtrplugin.cxx#30
-//
-
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#include "dtrplugin.hxx"
-
-using namespace desres::molfile;
-
-#include <sstream>
-#include <ios>
-#include <iomanip>
-#include <math.h>
-#include <errno.h>
-#include <stdexcept>
-#include <string>
-#include <map>
-#include <vector>
-#include <ios>
-#include <set>
-#include <iostream>
-#include <fstream>
-#include <algorithm>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "vmddir.h"
-#include "endianswap.h"
-
-static const char SERIALIZED_VERSION[] = "0006";
-const char * desres::molfile::dtr_serialized_version() {
-  return SERIALIZED_VERSION;
-}
-
-static bool badversion(const std::string& version) {
-    return version != SERIALIZED_VERSION;
-}
-
-#ifndef DESRES_WIN32
-static const char s_sep = '/';
-#include <sys/mman.h>
-
-#include <netinet/in.h> /* for htonl */
-#if defined(_AIX) || defined(ANDROID)
-#include <fcntl.h>
-#else
-#include <sys/fcntl.h>
-#endif
-
-#if defined(__sun)
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
-#else
-/// windows version
-
-#define M_PI (3.1415926535897932385)
-#define M_PI_2 (1.5707963267948966192)
-
-#ifndef S_ISREG
-#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
-#endif
-
-#ifndef S_ISDIR
-#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
-#endif
-
-#ifndef PRIu64
-#if _MSC_VER < 1400
-#define PRIu64 "ld"
-#else 
-#define PRIu64 "I64u"
-#endif
-#endif
-
-static const char s_sep = '\\';
-
-#endif
-
-static const uint32_t magic_timekey = 0x4445534b;
-static const uint32_t magic_frame   = 0x4445534d;
-static const uint32_t s_version     = 0x00000100;
-static const uint32_t s_irosetta    = 0x12345678;
-static const float    s_frosetta    = 1234.5;
-static const double   s_drosetta    = 1234.5e6;
-static const uint32_t s_lrosetta_lo = 0x89abcdef;
-static const uint32_t s_lrosetta_hi = 0x01234567;
-static const uint32_t s_blocksize   = 4096;
-static const uint32_t s_alignsize   = 8;
-
-namespace {
-
-  const double PEAKmassInAmu = 418.4;
-
-  double sfxp_ulp32flt(int32_t x) {
-    return ldexp(((double) x),-31);
-  }
-
-
-  uint64_t assemble64( uint32_t lo, uint32_t hi) {
-    uint64_t hi64 = hi; 
-    return (hi64 << 32) | lo; 
-  }
-  
-  double assembleDouble(uint32_t lo, uint32_t hi) {
-    union {
-      uint64_t ival;
-      double   dval;
-    } u;
-    u.ival = assemble64(lo,hi);
-    return u.dval;
-  }
-
-  /// definitions of binary representation of frameset files
-
-  typedef struct {
-    uint32_t magic;           //!< Magic number
-    uint32_t version;         //!< Version of creator
-    uint32_t framesize_lo;    //!< bytes in frame (low)
-    uint32_t framesize_hi;    //!< bytes in frame (high)
-  } required_header_t;
-
-  //! Header structure within file.
-  typedef struct {
-    required_header_t required; //!< 4 word mini-header
-
-    uint32_t size_header_block; //!< Size of this header
-    uint32_t unused0;         //!< not used in current implementation
-    uint32_t irosetta;        //!< 32-bit integer rosetta value.
-    float    frosetta;        //!< 32-bit float rosetta
-
-    uint32_t drosetta_lo;     //!< 64-bit float rosetta (low)
-    uint32_t drosetta_hi;     //!< 64-bit float rosetta (high)
-    uint32_t lrosetta_lo;     //!< 64-bit integer rosetta (low)
-    uint32_t lrosetta_hi;     //!< 64-bit integer rosetta (high)
-
-    uint32_t endianism;       //!< Endianism of writer machine.
-    uint32_t nlabels;         //!< Number of labeled fields.
-    uint32_t size_meta_block; //!< Number of bytes of meta information (padded)
-    uint32_t size_typename_block; //!< Number of bytes of typenames (padded)
-
-    uint32_t size_label_block; //!< Number of bytes to store label strings (padded)
-    uint32_t size_scalar_block; //!< Number of bytes of scalar storage (padded)
-    uint32_t size_field_block_lo; //!< Number of bytes of field storage (padded)
-    uint32_t size_field_block_hi; //!< Number of bytes of field storage (padded)
-
-    uint32_t size_crc_block;  //!< Size of the trailing CRC field (unused!)
-    uint32_t size_padding_block; //!< Number of ignored bytes to pad to pagesize boundary.
-    uint32_t unused1;         //!< Not used in current implementation.
-    uint32_t unused2;         //!< Not used in current implementation.
-
-  } header_t;
-
-  typedef struct {
-    uint32_t type;            //!< \brief Typecode for this type.
-    uint32_t elementsize;     //!< \brief Number of bytes in an element
-    uint32_t count_lo;        //!< \brief Number of elements (low)
-    uint32_t count_hi;        //!< \brief Number of elements (high)
-  } metadisk_t;
-
-  typedef struct key_prologue {
-    uint32_t magic;           /* Magic number for frames */
-    uint32_t frames_per_file; /* Number of frames in each file */
-    uint32_t key_record_size; /* The size of each key record */
-  } key_prologue_t;
-
-
-  //// utility routines
-
-  /*!
-   * Extracts the low 32 bits of a 64 bit integer by masking.
-   */
-  uint32_t lobytes(const uint64_t& x) {
-    uint32_t mask = 0xffffffff;
-    return x & mask;
-  }
-
-  /*!
-   * Extract the high 32 bits of a 64 bit integer by shifting.
-   */
-  uint32_t hibytes(const uint64_t& x) {
-    return x >> 32;
-  }
-
-  /*!
-   * Extract the low 32 bits of a 64 bit float as an integer.
-   */
-  uint32_t lobytes(const double& x) {
-    union {
-      uint64_t ival;
-      double   dval;
-    } u;
-    u.dval = x;
-    return lobytes(u.ival);
-  }
-
-  /*!
-   * Extract the high 32 bits of a 64 bit float as an integer.
-   */
-  uint32_t hibytes(const double& x) {
-    union {
-      uint64_t ival;
-      double   dval;
-    } u;
-    u.dval = x;
-    return hibytes(u.ival);
-  }
-
-  /*!
-   * The byte order associated with this machine.  We use
-   * 1234 for little endian, 4321 for big endian, and
-   * 3412 for the unlikely PDB endianism.
-   */
-  uint32_t machineEndianism() {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    uint32_t byteorder = 1234;
-#else
-#if __BYTE_ORDER == __BIG_ENDIAN
-    uint32_t byteorder = 4321;
-#else
-#ifdef PDB_ENDIAN
-#if __BYTE_ORDER == __PDB_ENDIAN
-    uint32_t byteorder = 3412;
-#endif
-#endif
-#endif
-#endif
-    // If we get a compile error here, then __BYTE_ORDER
-    // has an unexpected value.
-    return byteorder;
-  }
-
-  uint64_t alignInteger( const uint64_t &x, unsigned border) {
-    return x + (border - x%border)%border;
-  }
-
-
-  /*!
-   * See RFC 1146 for Fletcher's Checksum (http://tools.ietf.org/html/rfc1146)
-   */
-  uint32_t fletcher( const uint16_t *data, size_t len ) {
-    uint32_t sum1 = 0xffff, sum2 = 0xffff;
- 
-    while (len) {
-      unsigned tlen = len > 360 ? 360 : len;
-      len -= tlen;
-      do {
-        sum1 += *data++;
-        sum2 += sum1;
-      } while (--tlen);
-      sum1 = (sum1 & 0xffff) + (sum1 >> 16);
-      sum2 = (sum2 & 0xffff) + (sum2 >> 16);
-    }
-    /* Second reduction step to reduce sums to 16 bits */
-    sum1 = (sum1 & 0xffff) + (sum1 >> 16);
-    sum2 = (sum2 & 0xffff) + (sum2 >> 16);
-    return sum2 << 16 | sum1;
-  }
-
-  bool isfile(const std::string &name) {
-    struct stat statbuf;
-    return (stat(name.c_str(),&statbuf) == 0 && S_ISREG(statbuf.st_mode));
-  }
-
-  /*!
-   * Remove a file or directory.  For directories,
-   * we recurse through subfiles and remove those
-   * before attempting the ::rmdir();
-   */
-  void recursivelyRemove(std::string path) {
-    struct stat statbuf;
-
-    // -----------------------------------------------
-    // Only try to unlink if the file exists
-    // We recurse through directories and unlink
-    // other files.
-    // -----------------------------------------------
-
-#ifdef DESRES_WIN32
-    // Use ::stat instead of ::lstat on windows since there are no symlinks
-    if (stat(path.c_str(),&statbuf) == 0) {
-#else
-    if (::lstat(path.c_str(),&statbuf) == 0) {
-#endif
-      if (!S_ISDIR(statbuf.st_mode)) {
-        if (::unlink(path.c_str()) != 0) {
-            throw std::runtime_error(strerror(errno));
-        }
-      } else {
-        VMDDIR* directory = NULL;
-        try {
-          directory = vmd_opendir(path.c_str());
-          if (directory) {
-            // Remove subfiles
-            char * entry;
-            while( (entry=vmd_readdir(directory)) != NULL ) {
-              // Don't unlink . or ..
-              if (entry[0] == '.') {
-                if (entry[1] == 0) continue;
-                if (entry[1] == '.' && entry[2] == 0) continue;
-              }
-              recursivelyRemove(path + s_sep + entry);
-            }
-            vmd_closedir(directory);
-            directory = NULL;
-
-            // Remove the actual directory
-            if (::rmdir(path.c_str()) != 0) {
-              throw std::runtime_error(strerror(errno));
-            }
-          }
-        } catch(...) {
-          if (directory) vmd_closedir(directory);
-          throw;
-        }
-      }
-    }
-  }
-
-
-  ////////
-  // CRC
-  ////////
-  
-  typedef uint32_t crc;
-  
-  #define POLYNOMIAL 0x04C11DB7
-  #define WIDTH  (8 * sizeof(crc))
-  #define TOPBIT (1 << (WIDTH - 1))
-  #define FINAL_XOR_VALUE 0xFFFFFFFF
-
-  crc processByte( crc remainder, char msg ) {
-        remainder ^= (msg << (WIDTH - 8));
-        for (uint8_t bit = 8; bit > 0; --bit)
-        {
-            if (remainder & TOPBIT) {
-                remainder = (remainder << 1) ^ POLYNOMIAL;
-            } else {
-                remainder = (remainder << 1);
-            }
-        }
-        return remainder;
-  }
-
-  crc processBytes(const char *message, int nBytes) {
-    crc  remainder = 0;	
-    for (int byte = 0; byte < nBytes; ++byte) {
-        remainder = processByte( remainder, message[byte] );
-    }
-    return remainder;
-  } 
-
-  int32_t cksum(const std::string &s) {
-    ssize_t len = s.size();
-    int32_t result = processBytes( s.c_str(), len );
-  
-    for ( ; len; len >>= 8) {
-      result = processByte( result, len & 0xff );
-    }
-    return result ^ FINAL_XOR_VALUE;
-  }
-
-}
-
-bool Timekeys::init(const std::string& path ) {
-    std::string timekeys_path = path;
-    timekeys_path += s_sep;
-    timekeys_path += "timekeys";
-    FILE * fd = fopen( timekeys_path.c_str(), "rb" );
-    if (!fd) {
-      fprintf(stderr, "Could not find timekeys file at %s\n", 
-          timekeys_path.c_str());
-      return false;
-    }
-  
-    /* check the magic number */
-    key_prologue_t prologue[1];
-    if (fread( prologue, sizeof(key_prologue_t), 1, fd )!=1) {
-      fprintf(stderr, "Failed to read key prologue from %s\n",
-          timekeys_path.c_str());
-      fclose(fd);
-      return false;
-    }
-    prologue->magic = htonl(prologue->magic);
-    if (prologue->magic != magic_timekey) {
-      fprintf(stderr, "timekeys magic number %x doesn't match %x\n",
-          prologue->magic, magic_timekey);
-      fclose(fd);
-      return false;
-    }
-  
-    /* get frames per file and key record size */
-    prologue->frames_per_file = ntohl( prologue->frames_per_file );
-    prologue->key_record_size = ntohl( prologue->key_record_size );
-    m_fpf = prologue->frames_per_file;
-  
-    /* read all key records */
-    fseek(fd, 0, SEEK_END);
-    off_t keyfile_size = ftello(fd);
-    size_t nframes = (keyfile_size-sizeof(key_prologue_t))/sizeof(key_record_t);
-  
-    keys.resize(nframes);
-    fseek(fd, sizeof(key_prologue_t), SEEK_SET);
-    if (fread(&keys[0], sizeof(key_record_t), nframes, fd)!=nframes) {
-      fprintf(stderr, "Failed to read all timekeys records: %s\n",
-          strerror(errno));
-      fclose(fd);
-      return false;
-    }
-    fclose(fd);
-  
-    /* Check that we didn't get zero-length frames; this would be a strong
-     * indicator of file corruption! */
-    int warning_count=0;
-    size_t i;
-    for (i=0; i<nframes; i++) {
-        if (keys[i].size()==0) {
-            if (++warning_count<10) {
-              fprintf(stderr, "dtrplugin -- WARNING: timekey %d of dtr %s reports 0-length frame; file corruption likely.\n", (int)i, path.c_str());
-            }
-            if (warning_count==10) {
-                fprintf(stderr, "dtrplugin -- WARNING: skipping remaining warnings in dtr %s\n", path.c_str());
-            }
-        }
-    }
-    if (warning_count) {
-        fprintf(stderr, "dtrplugin -- WARNING: found %d likely corrupt timekeys in %s\n",
-                warning_count, path.c_str());
-    }
-
-    m_size = m_fullsize = keys.size();
-    if (!keys.size()) return true;
-
-    m_first = keys[0].time();
-    m_framesize = keys[0].size();
-    if (keys.size()==1) {
-        m_interval=0;
-        keys.clear();
-        return true;
-    }
-    m_interval=keys[1].time()-keys[0].time();
-    for (i=1; i<keys.size(); i++) {
-        if (keys[i].size() == 0) {
-            /* ignore obviously corrupt frames */
-            continue;
-        }
-        /* constant frame size */
-        if (keys[i].size() != m_framesize) {
-            fprintf(stderr, "non-constant framesize at frame %zd\n", i);
-            printf("size %" PRIu64 " framesize %" PRIu64 "\n\n",
-                    keys[i].size(), m_framesize);
-            return true;
-        }
-        /* constant time interval */
-        if (fabs((keys[i].time()-keys[i-1].time())-m_interval) > 1e-3) {
-            if (getenv("DTRPLUGIN_VERBOSE")) fprintf(stderr, 
-                    "non-constant time interval at frame %zd\n", i);
-            return true;
-        }
-        /* constant offset */
-        if (keys[i].offset() != m_framesize*( i % m_fpf)) {
-            fprintf(stderr, "unexpected offset for frame %zd\n", i);
-            return true;
-        }
-    }
-    /* looks good!  Don't need the explicit key records anymore */
-    keys.clear();
-    return true;
-}
-
-key_record_t Timekeys::operator[](uint64_t i) const {
-    if (i>m_fullsize) throw std::runtime_error("frame index out of range");
-    if (keys.size()) return keys.at(i);
-
-    key_record_t timekey;
-#if defined(_MSC_VER)
-    double time = m_first + ((__int64) i)*m_interval;
-#else
-    double time = m_first + i*m_interval;
-#endif
-    uint64_t offset = (i % m_fpf) * m_framesize;
-
-    timekey.time_lo = htonl(lobytes(time));
-    timekey.time_hi = htonl(hibytes(time));
-    timekey.offset_lo = htonl(lobytes(offset));
-    timekey.offset_hi = htonl(hibytes(offset));
-    timekey.framesize_lo = htonl(lobytes(m_framesize));
-    timekey.framesize_hi = htonl(hibytes(m_framesize));
-    return timekey;
-}
-
-namespace {
-    template <typename T> 
-    void rawdump(std::ostream& out, const T& v) {
-        out.write((char *)&v, sizeof(v));
-    }
-
-    template <typename T> 
-    void rawload(std::istream& in, T& v) {
-        in.read((char *)&v, sizeof(v));
-    }
-}
-
-void Timekeys::dump(std::ostream& out) const {
-    rawdump(out, m_first);
-    rawdump(out, m_interval);
-    rawdump(out, m_framesize);
-    rawdump(out, m_size);
-    rawdump(out, m_fullsize);
-    rawdump(out, m_fpf);
-    rawdump(out, keys.size());
-    if (keys.size()) {
-        out.write((const char *)&keys[0], keys.size()*sizeof(keys[0]));
-    }
-}
-
-void Timekeys::load(std::istream& in) {
-    size_t sz;
-    rawload(in, m_first);
-    rawload(in, m_interval);
-    rawload(in, m_framesize);
-    rawload(in, m_size);
-    rawload(in, m_fullsize);
-    rawload(in, m_fpf);
-    rawload(in, sz);
-    if (sz) {
-        keys.resize(sz);
-        in.read((char *)&keys[0], keys.size()*sizeof(keys[0]));
-    }
-}
-
-namespace {
-  struct Blob {
-    std::string type;
-    uint64_t count;
-    const void *data;
-    bool byteswap;
-
-    Blob() : count(0), data(0) {}
-    Blob( const std::string &type_, uint64_t count_, const void *data_,
-          uint32_t frame_endianism )
-    : type(type_), count(count_), data(data_), byteswap(false) {
-      uint32_t my_endianism = machineEndianism();
-      if (frame_endianism != my_endianism) {
-        if ( (frame_endianism==1234 && my_endianism==4321) || 
-             (frame_endianism==4321 && my_endianism==1234) ) {
-          byteswap=true;
-        } else {
-          throw std::runtime_error("Unable to handle frame endianness");
-        }
-      }
-    }
-
-    std::string str() const {
-      if (type=="char" && count>0) {
-        const char *s=(const char *)data;
-        return std::string(s, s+count);
-      }
-      return "";
-    }
-    void get_float(float *buf) const {
-      if (type=="float") {
-        memcpy(buf, data, count*sizeof(float));
-      } else if (type=="double") {
-        const double *p = reinterpret_cast<const double *>(data);
-        for (uint64_t i=0; i<count; i++) buf[i] = p[i];
-      } else {
-        memset(buf, 0, count*sizeof(float));
-      }
-      if (byteswap) swap4_unaligned(buf, count);
-    }
-    void get_double(double *buf) const {
-      if (type=="double") {
-        memcpy(buf, data, count*sizeof(double));
-      } else if (type=="float") {
-        const float *p = reinterpret_cast<const float *>(data);
-        for (uint64_t i=0; i<count; i++) buf[i] = p[i];
-      } else {
-        memset(buf, 0, count*sizeof(double));
-      }
-      if (byteswap) swap8_unaligned(buf, count);
-    }
-    void get_int32(int32_t *buf) const {
-      if (type=="int32_t") {
-        memcpy(buf, data, count*sizeof(int32_t));
-      } else {
-        memset(buf, 0, count*sizeof(int32_t));
-      }
-      if (byteswap) swap4_unaligned(buf, count);
-    }
-    void get_uint32(uint32_t *buf) const {
-      if (type=="uint32_t") {
-        memcpy(buf, data, count*sizeof(uint32_t));
-      } else {
-        memset(buf, 0, count*sizeof(uint32_t));
-      }
-      if (byteswap) swap4_unaligned(buf, count);
-    }
-  };
-
-  typedef std::map<std::string, Blob> BlobMap;
-}
-
-static inline std::string addslash(const std::string& s){
-    return (s.rbegin()[0] == '/') ? s : s + "/";
-}
-
-#define DD_RELPATH_MAXLEN (9) 
-static std::string 
-DDreldir(const std::string& fname, int ndir1, int ndir2){
-
-    if( fname.find('/', 0) != std::string::npos ) {
-      fprintf(stderr, "DDreldir: filename '%s' must not contain '/'\n",
-          fname.c_str());
-      return "";
-    }
-
-    uint32_t hash = cksum(fname);
-
-    // uint32_t u1 = ndir1;
-    // uint32_t u2 = ndir2;
-    uint32_t d1, d2;
-    char answer[DD_RELPATH_MAXLEN];
-    if(ndir1 > 0){
-	d1 = hash%ndir1;
-	if(ndir2 > 0){
-	    d2 = (hash/ndir1)%ndir2;
-	    sprintf(answer, "%03x/%03x/", d1, d2);
-	}else{
-	    sprintf(answer, "%03x/", d1);
-	}
-    }else{
-	sprintf(answer, "./");
-    }
-    return std::string(answer);
-}
-
-namespace {
-  class DDException : public std::runtime_error{
-  public:
-      int eno;
-      DDException(const std::string &text, int _eno=0) 
-      : std::runtime_error(text + strerror(_eno)), eno(_eno){}
-  };
-}
-
-void DDmkdir(const std::string &dirpath, mode_t mode, int ndir1, int ndir2){
-    std::string dpslash(addslash(dirpath));
-
-    mode_t openmode = mode | 0300; // make sure we can write into the directory
-    if( mkdir(dpslash.c_str(), openmode) < 0 )
-	throw DDException("mkdir", errno);
-	
-    if( mkdir((dpslash + "not_hashed").c_str(), openmode) < 0 )
-        throw DDException("mkdir not_hashed subdirectory", errno);
-
-    FILE *fp = fopen((dpslash + "not_hashed/.ddparams").c_str(), "w");
-    if(fp == NULL)
-	throw DDException("fopen( .ddparams, \"w\" )", errno);
-    if( fprintf(fp, "%d %d\n", ndir1, ndir2) < 0 ){
-        fclose(fp);
-	throw DDException("fprintf(.ddparams ...)", errno);
-    }
-    if( fclose(fp) )
-	throw DDException("fclose(.ddparams)", errno);
-
-    for(int i=0; i<ndir1; ++i){
-	char sub[6];
-	sprintf(sub, "%03x/", i);
-	std::string dirsub = dpslash + sub;
-        {
-	    if( mkdir(dirsub.c_str(), openmode) < 0 )
-		throw DDException("mkdir " + dirsub, errno);
-	}
-	for(int j=0; j<ndir2; ++j){
-	    char subsub[6];
-	    sprintf(subsub, "%03x", j);
-	    std::string dirsubsub = dirsub + subsub;
-	    if( mkdir(dirsubsub.c_str(), mode) < 0 ) // NOT openmode!
-		throw DDException("mkdir " + dirsubsub, errno);
-	}
-        if( mode != openmode ){
-            // change the mode back to what the user requested now
-            // that we're done creating stuff...
-            if( chmod(dirsub.c_str(), mode) < 0 )
-                throw DDException("chmod " + dirsub, errno);
-        }
-    }
-    if( mode != openmode ){
-        // change the mode back to what the user requested now
-        // that we're done creating stuff...
-        if( chmod(dpslash.c_str(), mode) < 0 )
-            throw DDException("chmod " + dpslash, errno);
-        if( chmod((dpslash + "not_hashed").c_str(), mode) < 0 )
-          throw DDException("chmod " + dpslash + "not_hashed", errno);
-    }
-}
-
-
-static void 
-DDgetparams(const std::string& dirpath, int *ndir1, int *ndir2) {
-  // get ddparams, or assume (0,0) and let the frame file opens fail.
-  *ndir1 = *ndir2 = 0;
-  std::string dirslash(addslash(dirpath));
-  // New convention - .ddparams is in not_hashed/.
-  FILE *fp = fopen((dirslash + "not_hashed/.ddparams").c_str(), "r");
-  // Allow the old convention of placing .ddparams in the top-level.
-  if( fp == NULL && errno == ENOENT ) {
-      fp = fopen((dirslash + ".ddparams").c_str(), "r");
-  }
-  if(fp != NULL) {
-    if( fscanf(fp, "%d%d", ndir1, ndir2) != 2 ) 
-      fprintf(stderr, "Failed to parse .ddparams; assuming flat structure\n");
-    if( fclose(fp) ) {
-      fprintf(stderr, "Warning: Failed to close .ddparams file: %s\n",
-          strerror(errno));
-    }
-  }
-}
-
-static std::string framefile( const std::string &dtr,
-                              size_t frameno, 
-                              size_t frames_per_file,
-                              int ndir1,
-                              int ndir2) {
-  unsigned frame_file = frameno / frames_per_file;
-  std::ostringstream filename;
-  filename << "frame" << std::setfill('0') << std::setw(9)
-           << frame_file;
-  std::string fname = filename.str();
-
-  std::string fullpath(dtr);
-  fullpath += "/";
-  fullpath += DDreldir(fname, ndir1, ndir2);
-  fullpath += fname;
-  return fullpath;
-}
-
-static BlobMap read_frame( const void *mapping, uint64_t len ) {
-
-    const char *base = reinterpret_cast<const char *>(mapping);
-    const header_t *header = reinterpret_cast<const header_t*>(base);
-    if (len<sizeof(header_t)) 
-        throw std::runtime_error("Frame size is smaller than header_t");
-    if (ntohl(header->required.magic) != magic_frame) {
-        char buf[256];
-        sprintf(buf, "invalid magic number: expected %d, got %d\n",
-                magic_frame, ntohl(header->required.magic));
-        throw std::runtime_error(buf);
-    }
-
-    uint32_t size_header_block = ntohl(header->size_header_block);
-    uint32_t frames_endianism = ntohl(header->endianism);
-    uint32_t frames_nlabels = ntohl(header->nlabels);
-    uint32_t size_meta_block = ntohl(header->size_meta_block);
-    uint32_t size_typename_block = ntohl(header->size_typename_block);
-    uint32_t size_label_block = ntohl(header->size_label_block);
-    uint32_t size_scalar_block = ntohl(header->size_scalar_block);
-    uint32_t size_field_block_lo = ntohl(header->size_field_block_lo);
-    uint32_t size_field_block_hi = ntohl(header->size_field_block_hi);
-    uint64_t size_field_block = assemble64(size_field_block_lo,
-                                           size_field_block_hi);
-
-    uint64_t offset_header_block = 0;
-    uint64_t offset_meta_block = offset_header_block + size_header_block;
-    uint64_t offset_typename_block = offset_meta_block + size_meta_block;
-    uint64_t offset_label_block = offset_typename_block + size_typename_block;
-    uint64_t offset_scalar_block = offset_label_block + size_label_block;
-    uint64_t offset_field_block = offset_scalar_block + size_scalar_block;
-    uint64_t offset_crc_block = offset_field_block + size_field_block;
-
-    const metadisk_t* diskmeta  = reinterpret_cast<const metadisk_t*>(base+offset_meta_block);
-    const char* typenames = reinterpret_cast<const char*>(base+offset_typename_block);
-    const char* labels    = reinterpret_cast<const char*>(base+offset_label_block); 
-    const char* scalars   = reinterpret_cast<const char*>(base+offset_scalar_block);
-    const char* fields    = reinterpret_cast<const char*>(base+offset_field_block);
-    const uint32_t  * crc = reinterpret_cast<const uint32_t*>(base+offset_crc_block);
-    if (*crc != 0) {
-        uint32_t frame_crc = fletcher(reinterpret_cast<const uint16_t*>(base),offset_crc_block/2);
-        if (frame_crc != *crc) {
-            throw std::runtime_error("Checksum did not match");
-        }
-    }
-    /* More sanity checks */
-    if (len<offset_meta_block+size_meta_block)
-        throw std::runtime_error("Frame size cannot contain meta block");
-    if (len<offset_typename_block+size_typename_block)
-        throw std::runtime_error("F size cannot contain meta block");
-    if (len<offset_label_block+size_label_block)
-        throw std::runtime_error("F size cannot contain meta block");
-    if (len<offset_scalar_block+size_scalar_block)
-        throw std::runtime_error("F size cannot contain meta block");
-    if (len<offset_field_block+size_field_block)
-        throw std::runtime_error("Frame size cannot contain meta block");
-
-    std::vector<std::string> types;
-    while(*typenames) {
-      if (typenames >= labels) {
-        fprintf(stderr, "More typenames than labels!\n");
-        break;
-      }
-      std::string type(typenames);
-      types.push_back(type);
-      typenames += type.size()+1;
-    }
-
-    BlobMap blobs;
-
-    for (size_t ii=0; ii<frames_nlabels; ++ii) {
-      std::string label(labels);
-      labels += label.size()+1;
-      // Pull out the typecode, elementsize, and count
-      uint32_t code = ntohl(diskmeta[ii].type);
-      uint32_t elementsize = ntohl(diskmeta[ii].elementsize);
-      uint32_t count_lo = ntohl(diskmeta[ii].count_lo);
-      uint32_t count_hi = ntohl(diskmeta[ii].count_hi);
-      uint64_t count = assemble64(count_lo,count_hi);
-      uint64_t nbytes = elementsize*count;
-
-      const char *addr=0;
-      if (count <= 1) {
-        addr=scalars;
-        scalars += alignInteger(nbytes, s_alignsize);
-      } else {
-        addr=fields;
-        fields += alignInteger(nbytes, s_alignsize);
-      }
-      try {
-        blobs[label] = Blob( types.at(code), count, addr, frames_endianism );
-      }
-      catch (std::exception &e) {
-        fprintf(stderr, "Failed fetching '%s' data from frame\n", 
-            label.c_str());
-      }
-    }
-    return blobs;
-}
-
-static void *read_file( int fd, off_t offset, ssize_t &framesize ) {
-  if (fd<=0) {
-    fprintf(stderr, "read_file: bad file descriptor\n");
-    return NULL;
-  }
-  if (framesize==0) {
-    struct stat statbuf;
-    if (fstat(fd,&statbuf)!=0) {
-      fprintf(stderr, "Could not stat file: %s\n", strerror(errno));
-      return NULL;
-    }
-    framesize=statbuf.st_size-offset;
-  }
-
-  void *mapping = malloc(framesize);
-  if (lseek(fd, offset, SEEK_SET)!=offset) {
-      fprintf(stderr, "seek to specified offset failed: %s\n", strerror(errno));
-      free(mapping);
-      return NULL;
-  }
-
-  ssize_t rc = read(fd, mapping, framesize);
-  if (rc==0) {
-      free(mapping);
-      return NULL;
-  }
-  if (rc==-1) {
-      fprintf(stderr, "reading bytes from frame failed: %s\n", strerror(errno));
-      free(mapping);
-      return NULL;
-  }
-  if (rc != framesize) {
-      fprintf(stderr, "unexpected short read\n");
-      free(mapping);
-      return NULL;
-  }
-  return mapping;
-}
-
-uint64_t key_record_t::size() const {
-  return assemble64(ntohl(framesize_lo), ntohl(framesize_hi));
-}
-uint64_t key_record_t::offset() const {
-  return assemble64(ntohl(offset_lo), ntohl(offset_hi));
-}
-double key_record_t::time() const {
-  return assembleDouble(ntohl(time_lo), ntohl(time_hi));
-}
-
-static metadata_t * read_meta( const std::string& metafile, unsigned natoms,
-                               bool with_invmass ) {
-
-  metadata_t * meta = NULL;
-  int meta_fd = open(metafile.c_str(), O_RDONLY|O_BINARY);
-  ssize_t framesize=0;
-  void *meta_mapping = read_file( meta_fd, 0, framesize );
-  if (meta_mapping==NULL) {
-    close(meta_fd);
-    return meta;
-  }
-  BlobMap meta_blobs;
-  try {
-      meta_blobs = read_frame( meta_mapping, framesize );
-  }
-  catch (std::exception &e) {
-      fprintf(stderr, "Reading metadata failed: %s\n", e.what());
-      free(meta_mapping);
-      close(meta_fd);
-      return meta;
-  }
-  meta = new metadata_t;
-
-  if (with_invmass && meta_blobs.find("INVMASS")!=meta_blobs.end()) {
-    Blob blob=meta_blobs["INVMASS"];
-    if (blob.count != natoms) {
-      fprintf(stderr, "bad rmass count %d != %d\n", (int)blob.count, (int)natoms);
-    } else {
-      meta->invmass.resize(natoms);
-      blob.get_float(&meta->invmass[0]);
-    }
-  }
-  free(meta_mapping);
-  close(meta_fd);
-  return meta;
-}
-
-bool StkReader::recognizes(const std::string &path) {
-      return path.size()>4 && 
-             path.substr(path.size()-4)==".stk" &&
-             isfile(path);
-}
-
-StkReader::StkReader(DtrReader *reader) {
-  dtr=reader->path();
-  framesets.push_back(reader);
-  curframeset=0;
-}
-
-bool StkReader::init(const std::string &path, int * changed) {
-  curframeset=0;
-  dtr=path;
-
-  if (changed) *changed = 0;
-  /* process all the lines in the stk file */
-  std::vector<std::string> fnames;
-  std::ifstream input(path.c_str());
-  if (!input) {
-      fprintf(stderr, "Cannot open '%s' for reading\n", path.c_str());
-      return false;
-  }
-  std::string fname;
-  /* instantiate all the dtr readers */
-  while (std::getline(input, fname)) {
-      fnames.push_back(fname);
-  }
-  if (!fnames.size()) {
-      fprintf(stderr, "Empty stk file\n");
-      return false;
-  }
-  if (framesets.size()) {
-      /* reloading an stk.  Find the dtrs that match the ones we already have,
-       * and discard the rest */
-      unsigned i=0; /* i will become the index of the last dtr that we've
-                       already loaded */
-      for (; i<fnames.size(); i++) {
-          if (i==framesets.size() || fnames[i]!=framesets[i]->path()) break;
-          if (getenv("DTRPLUGIN_VERBOSE")) 
-              fprintf(stderr, "StkReader: Reusing dtr at %s\n", 
-                      fnames[i].c_str());
-      }
-      /* delete any remaining framesets */
-      for (unsigned j=i; j<framesets.size(); j++) delete framesets[j];
-      framesets.erase(framesets.begin()+i, framesets.end());
-
-      /* delete the filenames we've already loaded */
-      fnames.erase(fnames.begin(), fnames.begin()+i);
-
-      /* The set of overlapping frames may have changed!  Restore the keys
-       * to their full, non-overlapping glory.  */
-      for (i=0; i<framesets.size(); i++) {
-          DtrReader * r = framesets[i];
-          r->keys.restore_full_size();
-      }
-  }
-  
-  /* instantiate dtr readers */
-  for (unsigned i=0; i<fnames.size(); i++) {
-      DtrReader *reader = new DtrReader;
-      if (getenv("DTRPLUGIN_VERBOSE"))
-        fprintf(stderr, "StkReader: Loading timekeys from dtr at %s\n", 
-                fnames[i].c_str());
-      if (i>0) {
-        const DtrReader * first = framesets[0];
-        /* reuse information from earlier readers */
-        reader->natoms = first->natoms;
-        reader->with_velocity = first->with_velocity;
-        reader->set_meta(first->get_meta());
-      }
-      if (!reader->init(fnames[i], NULL)) {
-          delete reader;
-          fprintf(stderr, "Failed opening frameset at %s\n", fnames[i].c_str());
-          return false;
-      }
-      if (changed) *changed += 1;
-      framesets.push_back(reader);
-      if (i==0) this->with_velocity = reader->with_velocity;
-  }
-
-  natoms=framesets[0]->natoms;
-
-  // now remove overlaps
-  while (!framesets.back()->size()) {
-      delete framesets.back();
-      framesets.pop_back();
-  }
-  if (framesets.size()) {
-    double first=framesets.back()->keys[0].time();
-    size_t i=framesets.size()-1;
-    while (i--) {
-        /* find out how many frames to keep in frameset[i] */
-        Timekeys& cur = framesets[i]->keys;
-        size_t n = cur.size();
-        while (n && cur[n-1].time() >= first) --n;
-        cur.truncate( n );
-        if (cur.size()) {
-          double c0t = cur[0].time();
-          first = (first < c0t) ? first : c0t;
-        }
-    }
-  }
-  return true;
-}
-
-ssize_t StkReader::size() const {
-  ssize_t result=0;
-  for (size_t i=0; i<framesets.size(); i++) 
-    result += framesets[i]->keys.size();
-  return result;
-}
-
-int StkReader::next(molfile_timestep_t *ts) {
-  int rc=MOLFILE_EOF;
-  while (curframeset < framesets.size() && 
-         (rc=framesets[curframeset]->next(ts))==MOLFILE_EOF) {
-    ++curframeset;
-  }
-  return rc;
-}
-
-const DtrReader * StkReader::component(ssize_t &n) const {
-  for (size_t i=0; i<framesets.size(); i++) {
-    ssize_t size = framesets[i]->size();
-    if (n < size) return framesets[i];
-    n -= size;
-  }
-  return NULL;
-}
-
-int StkReader::frame(ssize_t n, molfile_timestep_t *ts) const {
-  const DtrReader *comp = component(n);
-  if (!comp) return MOLFILE_EOF;
-  return comp->frame(n, ts);
-}
-
-StkReader::~StkReader() {
-  for (size_t i=0; i<framesets.size(); i++) 
-    delete framesets[i];
-}
-
-std::string DtrReader::framefile(ssize_t n) const {
-  return ::framefile( dtr, n, framesperfile(), ndir1(), ndir2() );
-}
-
-bool DtrReader::init(const std::string &path, int * changed) {
-  dtr = path;
-  /* Read the timekeys file */
-  if (!keys.init(path)) return false;
-
-  bool with_momentum = false;
-  // read the first frame to see how many atoms there are, and whether 
-  // there are any velocities.
-  // Do this only if n_atoms isn't already set
-  if (keys.size()>0 && natoms==0) {
-    if (getenv("DTRPLUGIN_VERBOSE")) {
-      fprintf(stderr, "reading first frame to get atom count\n");
-    }
-    std::string fname=::framefile(dtr, 0, keys.framesperfile(), 
-            ndir1(), ndir2());
-    int fd = open(fname.c_str(), O_RDONLY|O_BINARY);
-    ssize_t framesize=0;
-    unsigned i;
-    void *mapping = read_file( fd, 0, framesize );
-    if (mapping==NULL)  {
-      fprintf(stderr, "Failed to find frame at %s\n", fname.c_str());
-      close(fd);
-      return false;
-    }
-    BlobMap blobs;
-    try {
-        blobs = read_frame(mapping, framesize);
-    }
-    catch (std::exception &e) {
-        fprintf(stderr, "Warning: reading first frame failed, %s", e.what());
-    }
-    with_momentum = blobs.find("MOMENTUM")!=blobs.end();
-
-    // I'm aware of three possible sources of positions: 
-    //  "POSN" (the original frameset format)
-    //  "POSITION" (the wrapped frameset formats)
-    //  "POS" (anton trajectories)
-    const char *posnames[] = { "POSN", "POSITION", "POS" };
-    for (i=0; i<3; i++) {
-      if (blobs.find(posnames[i])!=blobs.end()) {
-        natoms = blobs[posnames[i]].count / 3;
-        break;
-      }
-    }
-    // similar for velocities
-    const char *velnames[] = { "MOMENTUM", "VELOCITY" };
-    for (i=0; i<2; i++) {
-      if (blobs.find(velnames[i])!=blobs.end()) {
-        with_velocity=true;
-        break;
-      }
-    }
-    free(mapping);
-    close(fd);
-  }
-
-  if (natoms>0 && meta==NULL && owns_meta==false) {
-    meta=read_meta( dtr + s_sep + "metadata",natoms, with_momentum );
-    owns_meta = true;
-  }
-
-  /* we always reread the timekeys */
-  if (changed) *changed = 1;
-  return true;
-
-}
-
-ssize_t DtrReader::times(ssize_t start, ssize_t count, double *t) const {
-    ssize_t remaining = keys.size()-start;
-    count = (count < remaining) ? count : remaining;
-    for (ssize_t j=0; j<count; j++) {
-        t[j]=keys[start++].time();
-    }
-    return count;
-}
-
-ssize_t StkReader::times(ssize_t start, ssize_t count, double *t) const {
-    ssize_t nread=0;
-    size_t i=0,n=framesets.size();
-    if (start<0) return 0;
-    if (count<=0) return 0;
-    /* Find the first frameset containing frames in the desired range */
-    /* FIXME: could do this using a binary search... */
-    for (; i<n; i++) {
-        ssize_t sz = framesets[i]->size();
-        if (start<sz) break;
-        start -= sz;
-    }
-    /* Read times from framesets until count times are read. */
-    for (; i<n; i++) {
-        ssize_t sz = framesets[i]->times(start, count, t+nread);
-        nread += sz;
-        count -= sz;
-        start=0;
-        if (!count) break;
-    }
-    return nread;
-}
-
-static double dotprod(const double *x, const double *y) {
-  return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
-}
-
-static void read_homebox( const double *box,
-                          molfile_timestep_t *ts ) {
-
-  ts->A = ts->B = ts->C = 0;
-
-  double A[3] = { box[0], box[3], box[6] };
-  double B[3] = { box[1], box[4], box[7] };
-  double C[3] = { box[2], box[5], box[8] };
-
-  // store lengths
-  ts->A = sqrt(dotprod(A,A));
-  ts->B = sqrt(dotprod(B,B));
-  ts->C = sqrt(dotprod(C,C));
-
-  if (ts->A == 0 || ts->B == 0 || ts->C == 0) {
-
-    ts->alpha = ts->beta = ts->gamma = 90;
-
-  } else {
-
-    // compute angles
-    double cosAB = dotprod(A,B)/(ts->A * ts->B);
-    double cosAC = dotprod(A,C)/(ts->A * ts->C);
-    double cosBC = dotprod(B,C)/(ts->B * ts->C);
-
-    // clamp
-    if (cosAB > 1.0) cosAB = 1.0; else if (cosAB < -1.0) cosAB = -1.0;
-    if (cosAC > 1.0) cosAC = 1.0; else if (cosAC < -1.0) cosAC = -1.0;
-    if (cosBC > 1.0) cosBC = 1.0; else if (cosBC < -1.0) cosBC = -1.0;
-
-    // convert to angles using asin to avoid nasty rounding when we are
-    // close to 90 degree angles.
-    ts->alpha = 90.0 - asin(cosBC) * 90.0 / M_PI_2; /* cosBC */
-    ts->beta  = 90.0 - asin(cosAC) * 90.0 / M_PI_2; /* cosAC */
-    ts->gamma = 90.0 - asin(cosAB) * 90.0 / M_PI_2; /* cosAB */
-  }
-}
-
-void write_homebox( const molfile_timestep_t * ts,
-                    float * box ) {
-
-  double A[3], B[3], C[3];
-
-  // Convert VMD's unit cell information
-  double cosBC = sin( ((90 - ts->alpha ) / 180) * M_PI );
-  double cosAC = sin( ((90 - ts->beta  ) / 180) * M_PI );
-  double cosAB = sin( ((90 - ts->gamma ) / 180) * M_PI );
-  double sinAB = cos( ((90 - ts->gamma ) / 180) * M_PI );
-
-  double Ax = ts->A;
-  double Ay = 0;
-  double Az = 0;
-  double Bx = ts->B * cosAB;
-  double By = ts->B * sinAB;
-  double Bz = 0;
-  double Cx,Cy,Cz;
-  if (sinAB != 0) {
-    Cx = cosAC;
-    Cy = (cosBC - cosAC*cosAB) / sinAB;
-    Cz = sqrt(1-Cx*Cx-Cy*Cy);
-    Cx *= ts->C;
-    Cy *= ts->C;
-    Cz *= ts->C;
-  } else {
-    Cx=Cy=Cz=0;
-  }
-  A[0] = Ax; A[1] = Ay; A[2] = Az;
-  B[0] = Bx; B[1] = By; B[2] = Bz;
-  C[0] = Cx; C[1] = Cy; C[2] = Cz;
-
-  // put vectors in column of homebox
-  box[0] = A[0]; box[3] = A[1]; box[6] = A[2];
-  box[1] = B[0]; box[4] = B[1]; box[7] = B[2];
-  box[2] = C[0]; box[5] = C[1]; box[8] = C[2];
-}
-
-static int handle_wrapped_v2(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    molfile_timestep_t *ts ) {
-
-  // just read POSITION in either single or double precision
-  if (blobs.find("POSITION")==blobs.end()) {
-    fprintf(stderr, "ERROR, Missing POSITION field in frame\n");
-    return MOLFILE_ERROR;
-  }
-  Blob pos=blobs["POSITION"];
-  if (pos.count != 3*natoms) {
-    fprintf(stderr, "ERROR, Expected %d elements in POSITION; got %" PRIu64 "\n",
-        3*natoms, pos.count);
-    return MOLFILE_ERROR;
-  }
-  pos.get_float(ts->coords);
-
-  if (with_velocity && ts->velocities && blobs.find("VELOCITY")!=blobs.end()) {
-    Blob vel=blobs["VELOCITY"];
-    if (vel.count != 3*natoms) {
-      fprintf(stderr, "ERROR, Expected %d elements in VELOCITY; got %" PRIu64 "\n",
-          3*natoms, vel.count);
-      return MOLFILE_ERROR;
-    }
-    vel.get_float(ts->velocities);
-  }
-
-  if (blobs.find("UNITCELL")!=blobs.end()) {
-    double box[9];
-    blobs["UNITCELL"].get_double(box);
-    read_homebox( box, ts );
-  }
-
-#if defined(DESRES_READ_TIMESTEP2)
-  if (blobs.find("ENERGY")!=blobs.end()) {
-      blobs["ENERGY"].get_double(&ts->total_energy);
-  }
-
-  if (blobs.find("POT_ENERGY")!=blobs.end()) {
-      blobs["POT_ENERGY"].get_double(&ts->potential_energy);
-  }
-
-  if (blobs.find("KIN_ENERGY")!=blobs.end()) {
-      blobs["KIN_ENERGY"].get_double(&ts->kinetic_energy);
-  }
-
-  if (blobs.find("EX_ENERGY")!=blobs.end()) {
-      blobs["EX_ENERGY"].get_double(&ts->extended_energy);
-  }
-
-  if (blobs.find("PRESSURE")!=blobs.end()) {
-      blobs["PRESSURE"].get_double(&ts->pressure);
-  }
-
-  if (blobs.find("TEMPERATURE")!=blobs.end()) {
-      blobs["TEMPERATURE"].get_double(&ts->temperature);
-  }
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-namespace {
-
-  inline void
-  compute_center(int partition,
-                 int nx, int ny, int nz,
-                 float b0, float b1, float b2,
-                 float b3, float b4, float b5,
-                 float b6, float b7, float b8,
-                 float* cx, float* cy, float* cz) {
-    double nu, nv, nw, mu, mv, mw;
-    double xc, yc, zc;
-
-    // -----------------------------------------------
-    // Map the partition number to its "mesh" position
-    // (see define_mesh_collective in topology.c)
-    // -----------------------------------------------
-    int hmx = partition;
-    int hmy  = hmx / nx;     /* y = y + ny*( z + nz*r ) */
-    int hmz  = hmy / ny;     /* z = z + nz*r */
-    hmx -= hmy * nx;         /* x = x */
-    hmy -= hmz * ny;         /* y = y */
-
-    nu = (double)nx;
-    nv = (double)ny;
-    nw = (double)nz;
-
-    // -----------------------------------------------
-    // Code adapted from configure_global_cell in
-    // topology.c
-    // -----------------------------------------------
-    mu = -0.5*(nu-1) + (double)hmx;
-    mv = -0.5*(nv-1) + (double)hmy;
-    mw = -0.5*(nw-1) + (double)hmz;
-
-    // We used to do FORCE_PRECISION(xc,float) here, but that
-    // seems unnecessary in the context of trajectory writing.
-    xc = b0*mu + b1*mv + b2*mw; 
-    yc = b3*mu + b4*mv + b5*mw; 
-    zc = b6*mu + b7*mv + b8*mw; 
-
-    *cx = xc;
-    *cy = yc;
-    *cz = zc;
-  }
-
-  inline int 
-  posn_momentum_v_1(int32_t nx, int32_t ny, int32_t nz,
-                    uint64_t nparticles,
-                    const double  * home_box,
-                    const uint32_t* gid,
-                    const uint32_t* npp,
-                    const float   * rm, // reciprocal mass
-                    const float* posn, const float* momentum,
-                    /* returns */
-                    float *position, float *velocity, double *box) {
-
-    // bounding box is a straight multiple of the home box
-    if (box) {
-      box[0] = home_box[0]*nx;
-      box[1] = home_box[1]*ny;
-      box[2] = home_box[2]*nz;
-        
-      box[3] = home_box[3]*nx;
-      box[4] = home_box[4]*ny;
-      box[5] = home_box[5]*nz;
-
-      box[6] = home_box[6]*nx;
-      box[7] = home_box[7]*ny;
-      box[8] = home_box[8]*nz;
-    }
-
-
-    int partition = 0;
-    int remaining = 0;
-    float cx = 0;
-    float cy = 0;
-    float cz = 0;
-    float ux = home_box[0];
-    float vx = home_box[1];
-    float wx = home_box[2];
-    float uy = home_box[3];
-    float vy = home_box[4];
-    float wy = home_box[5];
-    float uz = home_box[6];
-    float vz = home_box[7];
-    float wz = home_box[8];
-
-    for(uint64_t i=0; i<nparticles; ++i) {
-      if (remaining == 0) {
-        do {
-          remaining = npp[partition];
-          ++partition;
-        } while (!remaining); // skip empty partitions
-          compute_center(partition-1, nx,ny,nz, ux,vx,wx, uy,vy,wy, uz,vz,wz,
-                        &cx,&cy,&cz);
-      }
-      uint32_t id = gid[i];
-      if (id >= nparticles) {
-        fprintf(stderr, "non-contiguous particles\n");
-        return MOLFILE_ERROR;
-      }
-
-      if (posn) {
-        float x = posn[3*i+0];
-        float y = posn[3*i+1];
-        float z = posn[3*i+2];
-
-        position[3*id+0] = ux*x + vx*y + wx*z + cx;
-        position[3*id+1] = uy*x + vy*y + wy*z + cy;
-        position[3*id+2] = uz*x + vz*y + wz*z + cz;
-      }
-
-      if (velocity && momentum && rm) {
-        velocity[3*id+0] = momentum[3*i+0]*rm[id];
-        velocity[3*id+1] = momentum[3*i+1]*rm[id];
-        velocity[3*id+2] = momentum[3*i+2]*rm[id];
-      } else if (velocity) {
-        velocity[3*id+0] = 0.0;
-        velocity[3*id+1] = 0.0;
-        velocity[3*id+2] = 0.0;
-      }
-      --remaining;
-    }
-    return MOLFILE_SUCCESS;
-  }
-}
-
-static int handle_posn_momentum_v1(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    const float * rmass,
-    molfile_timestep_t *ts ) {
-
-  int32_t nx, ny, nz;
-  double home_box[9], box[9];
-  blobs["HOME_BOX"].get_double(home_box);
-  blobs["NX"].get_int32(&nx);
-  blobs["NY"].get_int32(&ny);
-  blobs["NZ"].get_int32(&nz);
-  
-  std::vector<uint32_t> gid, npp;
-  std::vector<float> pos, mtm;
-  Blob gidblob=blobs["GID"];
-  Blob nppblob=blobs["NPP"];
-  Blob posblob=blobs["POSN"];
-  Blob mtmblob=blobs["MOMENTUM"];
-
-  if (gidblob.count != natoms) {
-    fprintf(stderr, "Missing GID field\n");
-    return MOLFILE_ERROR;
-  }
-  if (posblob.count != 3*natoms) {
-    fprintf(stderr, "Missing POSN field\n");
-    return MOLFILE_ERROR;
-  }
-  gid.resize(gidblob.count);
-  npp.resize(nppblob.count);
-  pos.resize(posblob.count);
-  mtm.resize(mtmblob.count);
-
-  gidblob.get_uint32(&gid[0]);
-  nppblob.get_uint32(&npp[0]);
-  posblob.get_float(&pos[0]);
-
-  if (rmass && with_velocity) mtmblob.get_float(&mtm[0]);
-
-  posn_momentum_v_1( nx, ny, nz, natoms, home_box, 
-                     &gid[0], &npp[0], rmass,
-                     &pos[0],
-                     &mtm[0],
-                     ts->coords,
-                     ts->velocities,
-                     box );
-
-  read_homebox( box, ts );
-  return MOLFILE_SUCCESS;
-}
-
-static int handle_wrapped_v1(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    molfile_timestep_t *ts ) {
-
-  {
-    // homebox
-    double home_box[9], box[9];
-    int32_t nx, ny, nz;
-    blobs["HOME_BOX"].get_double(home_box);
-    blobs["NX"].get_int32(&nx);
-    blobs["NY"].get_int32(&ny);
-    blobs["NZ"].get_int32(&nz);
-    box[0] = home_box[0]*nx;
-    box[1] = home_box[1]*ny;
-    box[2] = home_box[2]*nz;
-      
-    box[3] = home_box[3]*nx;
-    box[4] = home_box[4]*ny;
-    box[5] = home_box[5]*nz;
- 
-    box[6] = home_box[6]*nx;
-    box[7] = home_box[7]*ny;
-    box[8] = home_box[8]*nz;
-    read_homebox( box, ts );
-  }
-
-  Blob posblob=blobs["POSN"];
-  Blob velblob=blobs["VELOCITY"];
-
-  // get positions
-  if (posblob.count != 3*natoms) {
-    fprintf(stderr, "Missing POSN field\n");
-    return MOLFILE_ERROR;
-  }
-  posblob.get_float(ts->coords);
-  
-  // if required, get velocities
-  if (ts->velocities && velblob.count > 0) {
-    if (velblob.count != 3*natoms) {
-      fprintf(stderr, "VELOCITY field has %" PRIu64 " values; expected %d\n",
-          velblob.count, 3*natoms);
-      return MOLFILE_ERROR;
-    }
-    velblob.get_float(ts->velocities);
-  }
-  return MOLFILE_SUCCESS;
-}
-
-static int handle_anton_sfxp_v3(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    const float * rmass,
-    molfile_timestep_t *ts ) {
-
-  if (!rmass) {
-    fprintf(stderr, "Cannot read anton_sfxp_v3 frame without rmass\n");
-    return MOLFILE_ERROR;
-  }
-
-  double positionScale=0, momentumScale=0;
-  // position scale...
-  {
-    Blob blob = blobs["POSITIONSCALE"];
-    if (blob.count != 1) {
-      fprintf(stderr, "Missing POSITIONSCALE field\n");
-      return MOLFILE_ERROR;
-    }
-    blob.get_double(&positionScale);
-  }
-  // momentum scale
-  if (ts->velocities) {
-    Blob blob = blobs["MOMENTUMSCALE"];
-    if (blob.count != 1) {
-      fprintf(stderr, "Missing MOMENTUMSCALE field\n");
-      return MOLFILE_ERROR;
-    }
-    blob.get_double(&momentumScale);
-    momentumScale *= PEAKmassInAmu;
-  }
-
-  // box
-  {
-    double box[9] = { 0,0,0, 0,0,0, 0,0,0 };
-    uint32_t anton_box[3];
-    Blob boxblob = blobs["BOX"];
-    if (boxblob.count != 3) {
-      fprintf(stderr, "Missing BOX field\n");
-      return MOLFILE_ERROR;
-    }
-    boxblob.get_uint32(anton_box);
-    box[0] = sfxp_ulp32flt(anton_box[0])*positionScale;
-    box[4] = sfxp_ulp32flt(anton_box[1])*positionScale;
-    box[8] = sfxp_ulp32flt(anton_box[2])*positionScale;
-    read_homebox( box, ts );
-  }
-
-  // velocities
-  std::vector<int32_t> vel;
-  if (ts->velocities) {
-    Blob velblob = blobs["MOMENTUM"];
-    if (velblob.count != 3*natoms) {
-      fprintf(stderr, "Missing MOMENTUM field\n");
-      return MOLFILE_ERROR;
-    }
-    vel.resize(3*natoms);
-    velblob.get_int32(&vel[0]);
-  }
-
-  // positions
-  std::vector<int32_t> pos(3*natoms);
-  {
-    Blob posblob = blobs["POS"];
-    if (posblob.count != 3*natoms) {
-      fprintf(stderr, "Missing POS field\n");
-      return MOLFILE_ERROR;
-    }
-    posblob.get_int32(&pos[0]);
-  }
-  // convert and read into supplied storage
-  for (unsigned i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = sfxp_ulp32flt(pos[3*i+0])*positionScale;
-    ts->coords[3*i+1] = sfxp_ulp32flt(pos[3*i+1])*positionScale;
-    ts->coords[3*i+2] = sfxp_ulp32flt(pos[3*i+2])*positionScale;
-    if (ts->velocities) {
-      const double rm = rmass[i] * momentumScale; // includes PEAKmassInAmu
-      ts->velocities[3*i  ] = (float)(rm * sfxp_ulp32flt(vel[3*i  ]));
-      ts->velocities[3*i+1] = (float)(rm * sfxp_ulp32flt(vel[3*i+1]));
-      ts->velocities[3*i+2] = (float)(rm * sfxp_ulp32flt(vel[3*i+2]));
-    }
-  }
-  return MOLFILE_SUCCESS;
-}
-
-int DtrReader::next(molfile_timestep_t *ts) {
-
-  if (eof()) return MOLFILE_EOF;
-  if (!ts) {
-    ++m_curframe;
-    return MOLFILE_SUCCESS;
-  }
-  ssize_t iframe = m_curframe;
-  ++m_curframe;
-  return frame(iframe, ts);
-}
-
-int DtrReader::ndir1() const {
-  if (m_ndir1<0) DDgetparams(dtr, &m_ndir1, &m_ndir2);
-  return m_ndir1;
-}
-
-int DtrReader::ndir2() const {
-  if (m_ndir2<0) DDgetparams(dtr, &m_ndir1, &m_ndir2);
-  return m_ndir2;
-}
-
-int DtrReader::frame(ssize_t iframe, molfile_timestep_t *ts) const {
-  int rc = MOLFILE_SUCCESS;
-  {
-    off_t offset=0;
-    ssize_t framesize=0;
-    if (framesperfile() != 1) {
-      offset = assemble64( ntohl(keys[iframe].offset_lo), 
-                           ntohl(keys[iframe].offset_hi) );
-      framesize = assemble64( ntohl(keys[iframe].framesize_lo), 
-                              ntohl(keys[iframe].framesize_hi) );
-
-    }
-    ts->physical_time = keys[iframe].time();
-    std::string fname=::framefile(dtr, iframe, framesperfile(), ndir1(), ndir2());
-    int fd = open(fname.c_str(), O_RDONLY|O_BINARY);
-    if (fd<0) return MOLFILE_EOF;
-    void *mapping = read_file( fd, offset, framesize );
-    if (mapping==NULL) {
-      close(fd);
-      return MOLFILE_EOF;
-    }
-
-    rc = frame_from_bytes( mapping, framesize, ts );
-
-    free(mapping);
-    close(fd);
-  }
-  return rc;
-}
-
-int DtrReader::frame_from_bytes(const void *buf, uint64_t len, 
-                                molfile_timestep_t *ts) const {
-
-  BlobMap blobs;
-  try {
-      blobs = read_frame(buf, len);
-  }
-  catch (std::exception &e) {
-      fprintf(stderr, "Reading frame failed: %s\n", e.what());
-      return MOLFILE_ERROR;
-  }
-
-  const float * rmass = meta && meta->invmass.size() ? 
-      &meta->invmass[0] : NULL;
-
-  // Now, dispatch to routines based on format
-  std::string format = blobs["FORMAT"].str();
-  if (format=="WRAPPED_V_2" || format == "DBL_WRAPPED_V_2") {
-    return handle_wrapped_v2(blobs, natoms, with_velocity, ts);
-
-  } else if (format=="POSN_MOMENTUM_V_1" || format=="DBL_POSN_MOMENTUM_V_1") {
-    return handle_posn_momentum_v1(blobs, natoms, with_velocity, rmass, ts);
-
-  } else if (format=="WRAPPED_V_1" || format == "DBL_WRAPPED_V_1") {
-    return handle_wrapped_v1(blobs, natoms, with_velocity, ts);
-
-  } else if (format=="ANTON_SFXP_V3") {
-    return handle_anton_sfxp_v3(blobs, natoms, with_velocity, rmass, ts);
-  }
-  fprintf(stderr, "ERROR, can't handle format %s\n", format.c_str());
-  return MOLFILE_ERROR;
-}
-
-
-namespace {
-  struct meta_t {
-    std::string label;
-    std::string typecode;
-    uint32_t elementsize;
-    uint64_t count;
-    const char *bytes;
-    meta_t() {}
-    meta_t(const std::string &l, const std::string &t, uint32_t e, uint32_t c,
-           const void *b)
-    : label(l), typecode(t), elementsize(e), count(c), 
-    bytes(reinterpret_cast<const char *>(b)) {}
-  };
-  typedef std::vector<meta_t> MetaList;
-
-  uint64_t typename_size(const MetaList &meta) {
-    // just the set of distinct types
-    uint64_t sz=0;
-    typedef std::set<std::string> Typemap;
-    Typemap types;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      types.insert(m->typecode);
-    for (Typemap::const_iterator s=types.begin(); s!=types.end();++s)
-      sz += s->size() + 1;
-    sz += 1;
-    return alignInteger(sz, s_alignsize);
-  }
-
-  uint64_t label_size(const MetaList &meta) {
-    uint64_t sz=0;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      sz += m->label.size() + 1;
-    sz += 1;
-    return alignInteger(sz, s_alignsize);
-  }
-
-  uint64_t scalar_size(const MetaList &meta) {
-    uint64_t sz=0;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      if (m->count <= 1) 
-        sz += alignInteger( m->elementsize * m->count, s_alignsize );
-    return sz;
-  }
-  uint64_t field_size(const MetaList &meta) {
-    uint64_t sz=0;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      if (m->count > 1) 
-        sz += alignInteger( m->elementsize * m->count, s_alignsize );
-    return sz;
-  }
-
-  void construct_frame( const std::vector<meta_t>& meta, 
-                        std::vector<char>& bytes ) {
-    uint64_t offset_header_block = 0;
-    uint64_t size_header_block =
-      alignInteger( sizeof(header_t), s_alignsize );
-
-    uint64_t offset_meta_block = offset_header_block + size_header_block;
-    uint64_t size_meta_block = 
-      alignInteger( meta.size()*sizeof(metadisk_t), s_alignsize );
-
-    uint64_t offset_typename_block = offset_meta_block + size_meta_block;
-    uint64_t size_typename_block = typename_size(meta);
-
-    uint64_t offset_label_block = offset_typename_block + size_typename_block;
-    uint64_t size_label_block = label_size(meta);
-
-    uint64_t offset_scalar_block = offset_label_block + size_label_block;
-    uint64_t size_scalar_block = scalar_size(meta);
-
-    uint64_t offset_field_block = offset_scalar_block + size_scalar_block;
-    uint64_t size_field_block = field_size(meta);
-
-    uint64_t offset_crc_block = offset_field_block + size_field_block;
-    uint64_t size_crc_block = sizeof(uint32_t);
-
-    uint64_t offset_padding_block = offset_crc_block + size_crc_block;
-    uint64_t size_padding_block = 
-      alignInteger(offset_padding_block,s_blocksize) - offset_padding_block;
-
-    uint64_t framesize = offset_padding_block + size_padding_block;
-
-    // construct the frame
-    bytes.resize(framesize);
-    char * base = &bytes[0];
-    memset( base, 0, framesize );
-
-    header_t *header = reinterpret_cast<header_t*>(base+offset_header_block);
-    metadisk_t* diskmeta  = reinterpret_cast<metadisk_t*>(base+offset_meta_block);
-    char*       typenames = reinterpret_cast<char*>(base+offset_typename_block);
-    char*       labels    = reinterpret_cast<char*>(base+offset_label_block);
-    char*       scalars   = reinterpret_cast<char*>(base+offset_scalar_block);
-    char*       fields    = reinterpret_cast<char*>(base+offset_field_block);
-    uint32_t*   crc       = reinterpret_cast<uint32_t*>(base+offset_crc_block);
-    //char*       padding   = reinterpret_cast<char*>(base+offset_padding_block);
-
-    /*** header ***/
-    memset(header,0,sizeof(header_t));
-    header->required.magic = htonl(magic_frame);
-    header->required.version = htonl(s_version);
-
-    header->required.framesize_lo = htonl(lobytes(framesize));
-    header->required.framesize_hi = htonl(hibytes(framesize));
-
-    header->size_header_block = htonl(size_header_block);
-    header->unused0 = 0;
-    uint64_t lrosetta = assemble64(s_lrosetta_lo,s_lrosetta_hi);
-    header->irosetta = s_irosetta;
-    header->frosetta = s_frosetta;
-
-    header->drosetta_lo = lobytes(s_drosetta);
-    header->drosetta_hi = hibytes(s_drosetta);
-    header->lrosetta_lo = lobytes(lrosetta);
-    header->lrosetta_hi = hibytes(lrosetta);
-
-    header->endianism = htonl(machineEndianism());
-    header->nlabels = htonl(meta.size());
-    header->size_meta_block = htonl(size_meta_block);
-    header->size_typename_block = htonl(size_typename_block);
-
-    header->size_label_block = htonl(size_label_block);
-    header->size_scalar_block = htonl(size_scalar_block);
-    header->size_field_block_lo = htonl(lobytes(size_field_block));
-    header->size_field_block_hi = htonl(hibytes(size_field_block));
-
-    header->size_crc_block = htonl(size_crc_block);
-    header->size_padding_block = htonl(size_padding_block);
-    header->unused1 = 0;
-    header->unused2 = 0;
-
-    std::map<std::string,unsigned> typemap;
-
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m) {
-
-      if (typemap.find(m->typecode)==typemap.end()) {
-        unsigned code=typemap.size();
-        typemap[m->typecode]=code;
-        typenames=std::copy(m->typecode.begin(), m->typecode.end(), typenames);
-        *typenames++ = 0;
-      }
-
-      diskmeta->type = htonl( typemap[m->typecode] );
-      diskmeta->elementsize = htonl( m->elementsize );
-      diskmeta->count_lo = htonl( lobytes( m->count ));
-      diskmeta->count_hi = htonl( hibytes( m->count ));
-      diskmeta++;
-
-      labels=std::copy(m->label.begin(), m->label.end(), labels);
-      *labels++ = 0;
-
-      uint64_t nbytes = m->count*m->elementsize;
-      if (m->count <= 1) {
-        memcpy( scalars, m->bytes, nbytes );
-        scalars += alignInteger( nbytes, s_alignsize );
-      } else {
-        memcpy( fields, m->bytes, nbytes );
-        fields += alignInteger( nbytes, s_alignsize );
-      }
-    }
-    *crc = fletcher(reinterpret_cast<uint16_t*>(base),offset_crc_block/2);
-  }
-}
-
-void write_all( int fd, const char * buf, ssize_t count ) {
-    while (count) {
-        ssize_t n = ::write(fd, buf, count);
-        if (n<0) {
-            if (errno==EINTR) continue;
-            throw std::runtime_error(strerror(errno));
-        }
-        buf += n;
-        count -= n;
-    }
-}
-
-bool DtrWriter::init(const std::string &path) {
-
-  dtr=path;
-  try {
-    m_directory=path;
-    char cwd[4096];
-
-    while(m_directory.size() > 0 && m_directory[m_directory.size()-1] == s_sep) {
-      m_directory.erase(m_directory.size()-1);
-    }
-
-    if ( m_directory[0] != s_sep) {
-      if (! ::getcwd(cwd,sizeof(cwd))) {
-        throw std::runtime_error(strerror(errno));
-      }
-      m_directory = std::string(cwd) + s_sep + m_directory;
-    }
-
-    recursivelyRemove(m_directory);
-    ::DDmkdir(m_directory,0777,0, 0);
-
-    // craft an empty metadata frame
-    std::vector<meta_t> meta;
-    std::vector<char> bytes;
-    construct_frame( meta, bytes );
-
-    {
-      std::string metadata_file = m_directory + s_sep + "metadata";
-      FILE *fd = fopen(metadata_file.c_str(), "wb");
-      fwrite( &bytes[0], bytes.size(), 1, fd );
-      fclose(fd);
-    }
-
-    // start writing timekeys file */
-    std::string timekeys_path = dtr + s_sep + "timekeys";
-    timekeys_file = fopen( timekeys_path.c_str(), "wb" );
-    if (!timekeys_file) {
-      fprintf(stderr, "Opening timekeys failed: %s\n", strerror(errno));
-      return false;
-    } else {
-      key_prologue_t prologue[1];
-      prologue->magic = htonl(magic_timekey);
-      prologue->frames_per_file = htonl(frames_per_file);
-      prologue->key_record_size = htonl(sizeof(key_record_t));
-      fwrite( prologue, sizeof(key_prologue_t), 1, timekeys_file );
-    }
-  }
-  catch (std::exception &e) {
-    fprintf(stderr, "%s\n", e.what());
-    return false;
-  }
-  return true;
-}
-
-int DtrWriter::next(const molfile_timestep_t *ts) {
-
-  try {
-    static const char *format = "WRAPPED_V_2";
-    static const char *title = "written by VMD";
-    float box[9];
-    write_homebox( ts, box );
-
-    double time = ts->physical_time;
-
-    /* require increasing times (DESRESCode#1053) */
-    if (last_time != HUGE_VAL && time <= last_time) {
-      fprintf(stderr, 
-          "dtrplugin: framesets require increasing times. previous %e, current %e\n", 
-          last_time, time);
-      return MOLFILE_ERROR;
-    }
-
-    std::vector<meta_t> meta;
-    meta.push_back( 
-        meta_t( "FORMAT", "char", sizeof(char), strlen(format), format ));
-    meta.push_back( 
-        meta_t( "TITLE", "char", sizeof(char), strlen(title), title ));
-    meta.push_back( 
-        meta_t( "CHEMICAL_TIME", "double", sizeof(double), 1, &time));
-    meta.push_back( 
-        meta_t( "UNITCELL", "float", sizeof(float), 9, box ));
-    meta.push_back( 
-        meta_t( "POSITION", "float", sizeof(float), 3*natoms, ts->coords ));
-    if (ts->velocities) meta.push_back(
-        meta_t( "VELOCITY", "float", sizeof(float), 3*natoms, ts->velocities ));
-#if defined(DESRES_READ_TIMESTEP2)
-    meta.push_back(
-        meta_t( "ENERGY", "double", sizeof(double), 1, &ts->total_energy ));
-    meta.push_back(
-        meta_t( "POT_ENERGY", "double", sizeof(double), 1, &ts->potential_energy ));
-    meta.push_back(
-        meta_t( "KIN_ENERGY", "double", sizeof(double), 1, &ts->kinetic_energy ));
-    meta.push_back(
-        meta_t( "EX_ENERGY", "double", sizeof(double), 1, &ts->extended_energy ));
-    meta.push_back(
-        meta_t( "TEMPERATURE", "double", sizeof(double), 1, &ts->temperature));
-    meta.push_back(
-        meta_t( "PRESSURE", "double", sizeof(double), 1, &ts->pressure));
-#endif
-
-    std::vector<char> base;
-    construct_frame(meta, base);
-    uint64_t framesize = base.size();
-    uint64_t keys_in_file = nwritten % frames_per_file;
-
-    if (!keys_in_file) {
-      if (frame_fd>0) ::close(frame_fd);
-
-      framefile_offset = 0;
-      std::string filepath=framefile(dtr, nwritten, frames_per_file, 0, 0);
-      frame_fd = open(filepath.c_str(),O_WRONLY|O_CREAT|O_BINARY,0666);
-      if (frame_fd<0) throw std::runtime_error(strerror(errno));
-    }
-
-    // write the data to disk
-    write_all( frame_fd, &base[0], framesize );
-
-    // add an entry to the keyfile list
-    key_record_t timekey;
-    timekey.time_lo = htonl(lobytes(time));
-    timekey.time_hi = htonl(hibytes(time));
-    timekey.offset_lo = htonl(lobytes(framefile_offset));
-    timekey.offset_hi = htonl(hibytes(framefile_offset));
-    timekey.framesize_lo = htonl(lobytes(framesize));
-    timekey.framesize_hi = htonl(hibytes(framesize));
-
-    if (fwrite(&timekey, sizeof(timekey), 1, timekeys_file)!=1) {
-      fprintf(stderr, "Writing timekey failed\n");
-      return MOLFILE_ERROR;
-    }
-
-#if defined(_MSC_VER) || defined(__MINGW32__)
-    _commit(frame_fd);
-#else
-    fsync(frame_fd);
-#endif
-    fflush(timekeys_file);
-#if defined(_MSC_VER) || defined(__MINGW32__)
-    _commit(fileno(timekeys_file));
-#else
-    fsync(fileno(timekeys_file));
-#endif
-
-    ++nwritten;
-    framefile_offset += framesize;
-  } 
-  catch (std::exception &e) {
-    fprintf(stderr, "Write failed: %s\n",e.what());
-    return MOLFILE_ERROR;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-DtrWriter::~DtrWriter() {
-  if (frame_fd>0) ::close(frame_fd);
-  if (timekeys_file) fclose(timekeys_file);
-}
-
-/* compressed form: first write a -1 to indicate the new format.  Then
- * write number of ranges n, followed by (start, count) pairs. */
-std::ostream& operator<<(std::ostream& out, const metadata_t& meta) {
-    out << meta.invmass.size() << ' ';
-    if (meta.invmass.size()) {
-        out.write( (const char *)&meta.invmass[0], meta.invmass.size()*sizeof(meta.invmass[0]));
-    }
-    return out;
-}
-
-std::istream& operator>>(std::istream& in, metadata_t& meta) {
-    uint32_t sz;
-    char c;
-    in >> sz;
-    in.get(c);
-    meta.invmass.resize(sz);
-    if (sz) {
-        in.read((char *)&meta.invmass[0], sz*sizeof(meta.invmass[0]));
-    }
-    return in;
-}
-
-std::ostream& DtrReader::dump(std::ostream &out) const {
-  bool has_meta = meta!=NULL;
-  out << SERIALIZED_VERSION << ' '
-      << dtr << ' '
-      << natoms << ' '
-      << with_velocity << ' '
-      << owns_meta << ' '
-      << has_meta << ' ';
-  if (owns_meta && has_meta) {
-      out << *meta;
-  }
-  /* write raw m_ndir values so that we don't read them from .ddparams
-   * if they haven't been read yet */
-  out << m_ndir1 << ' '
-      << m_ndir2 << ' ';
-  keys.dump(out);
-  return out;
-}
-std::istream& DtrReader::load(std::istream &in) {
-  char c;
-  bool has_meta;
-  std::string version;
-  in >> version;
-  if (badversion(version)) {
-    fprintf(stderr, "Bad version string\n");
-    in.setstate( std::ios::failbit );
-    return in;
-  }
-  in >> dtr
-     >> natoms
-     >> with_velocity
-     >> owns_meta
-     >> has_meta;
-  if (owns_meta && has_meta) {
-    delete meta;
-    meta = new metadata_t;
-    in.get(c);
-    in >> *meta;
-  }
-  in >> m_ndir1
-     >> m_ndir2;
-  in.get(c);
-  keys.load(in);
-  return in;
-}
-
-std::ostream& StkReader::dump(std::ostream &out) const {
-  out << dtr << ' '
-      << framesets.size() << ' ';
-  for (size_t i=0; i<framesets.size(); i++) framesets[i]->dump(out);
-  return out;
-}
-
-std::istream& StkReader::load(std::istream &in) {
-  in >> dtr;
-  size_t size; in >> size; framesets.resize(size);
-  char c; in.get(c);
-  with_velocity=false;
-  for (size_t i=0; i<framesets.size(); i++) {
-    delete framesets[i];
-    framesets[i] = new DtrReader;
-    framesets[i]->load(in);
-    if (i>0) framesets[i]->set_meta(framesets[0]->get_meta());
-    if (i==0) with_velocity=framesets[i]->with_velocity;
-  }
-  if (framesets.size()) natoms=framesets[0]->natoms;
-  return in;
-}
-
-///////////////////////////////////////////////////////////////////
-//
-// Plugin Interface
-//
-// ////////////////////////////////////////////////////////////////
-
-static void *
-open_file_read( const char *filename, const char *filetype, int *natoms ) {
-
-  FrameSetReader *h = NULL;
-  std::string fname;
-
-  // check for .stk file
-  if (StkReader::recognizes(filename)) {
-    h = new StkReader;
-
-  } else {
-    h = new DtrReader;
-    // check for "clickme.dtr"
-    fname=filename;
-    std::string::size_type pos = fname.rfind( "clickme.dtr" );
-    if (pos != std::string::npos) {
-      fname.resize(pos);
-      filename = fname.c_str();
-    }
-  }
-
-  if (!h->init(filename)) {
-    delete h;
-    return NULL;
-  }
-  *natoms = h->natoms;
-  return h;
-}
-
-static int 
-read_timestep_metadata(void *v, molfile_timestep_metadata *m) {
-  FrameSetReader* handle = reinterpret_cast<FrameSetReader*>(v);
-  m->has_velocities = handle->has_velocities();
-  m->count = handle->size();
-  return MOLFILE_SUCCESS;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  return h->next(ts);
-}
-
-#if defined(DESRES_READ_TIMESTEP2)
-static int read_timestep2(void *v, ssize_t n, molfile_timestep_t *ts) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  return h->frame(n, ts);
-}
-
-static molfile_ssize_t read_times(void *v, 
-                                  molfile_ssize_t start, 
-                                  molfile_ssize_t count,
-                                  double * times) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  return h->times(start, count, times);
-}
-#endif
-
-static void close_file_read( void *v ) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  delete h;
-}
-
-static void *open_file_write(const char *path, const char *type, int natoms) {
-  DtrWriter *h = new DtrWriter(natoms);
-  if (!h->init(path)) {
-    delete h;
-    h=NULL;
-  }
-  return h;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  DtrWriter *h = reinterpret_cast<DtrWriter *>(v);
-  return h->next(ts);
-}
-
-static void close_file_write( void * v ) {
-  DtrWriter *h = reinterpret_cast<DtrWriter *>(v);
-  delete h;
-}
-
-
-static molfile_plugin_t desmond;
-
-VMDPLUGIN_API int VMDPLUGIN_init (void) {
-  /* Plugin for desmond trajectory files */
-  ::memset(&desmond,0,sizeof(desmond));
-  desmond.abiversion = vmdplugin_ABIVERSION;
-  desmond.type = MOLFILE_PLUGIN_TYPE;
-  desmond.name = "dtr";
-  desmond.prettyname = "DESRES Trajectory";
-  desmond.author = "D.E. Shaw Research";
-  desmond.majorv = 4;
-  desmond.minorv = 1;
-  desmond.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-
-  desmond.filename_extension = "dtr,dtr/,stk,atr,atr/";
-  desmond.open_file_read = open_file_read;
-  desmond.read_timestep_metadata = read_timestep_metadata;
-  desmond.read_next_timestep = read_next_timestep;
-#if defined(DESRES_READ_TIMESTEP2)
-  desmond.read_timestep2 = read_timestep2;
-  desmond.read_times = read_times;
-#endif
-  desmond.close_file_read = close_file_read;
-
-  desmond.open_file_write = open_file_write;
-  desmond.write_timestep = write_timestep;
-  desmond.close_file_write = close_file_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  cb(v,reinterpret_cast<vmdplugin_t*>(&desmond));
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#if defined(TEST_DTRPLUGIN)
-
-int main(int argc, char *argv[]) {
-
-  /* check input arguments */
-  if (argc != 3) {
-    fprintf(stderr, "Usage: %s input.dtr output.dtr\n", argv[0]);
-    return 1;
-  }
-  int natoms;
-  
-  /* read in all frames */
-  void *handle = open_file_read( argv[1], "dtr", &natoms);
-  printf("got %d atoms\n", natoms);
-  molfile_timestep_t ts[1];
-  std::vector<float> timesteps;
-  do {
-    timesteps.resize( timesteps.size()+3*natoms );
-    ts->coords = &timesteps[ timesteps.size() - 3*natoms ];
-    ts->velocities = NULL;
-  } while (read_next_timestep(handle, natoms, ts)==MOLFILE_SUCCESS);
-  int nframes = timesteps.size()/(3*natoms) - 1;
-
-  printf("read %d steps\n", nframes );
-  close_file_read(handle);
-
-  /* write out all frames */
-  handle = open_file_write( argv[2], "dtr", natoms);
-  if (!handle) return 1;
-  ts->coords = &timesteps[0];
-  for (int i=0; i<nframes; i++) {
-    if (write_timestep( handle, ts )!=MOLFILE_SUCCESS) {
-      fprintf(stderr, "failed to write timestep %d/%d\n", i+1, nframes);
-      return 1;
-    }
-    ts->coords += 3*natoms;
-  }
-  printf("wrote %d steps\n", nframes);
-  close_file_write(handle);
-
-  /* now try to read it back in */
-  int new_natoms;
-  handle = open_file_read( argv[2], "dtr", &new_natoms);
-  if (handle) return 1;
-  if (new_natoms != natoms) {
-    fprintf(stderr, "number of atoms changed: %d -> %d\n", natoms, new_natoms);
-    return 1;
-  }
-  close_file_read(handle);
-  return 0;
-}
-
-#endif
-
-#if defined(TEST_DTR_DUMP)
-int main(int argc, char *argv[]) {
-
-  StkReader src, dst;
-  src.init(argv[1]);
-
-  std::ostringstream out;
-  src.dump(out);
-  assert(out);
-
-  std::istringstream in(out.str());
-  dst.load(in);
-  assert(in);
-
-  return 0;
-}
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dtrplugin.hxx b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dtrplugin.hxx
deleted file mode 100644
index 87820cc199a23ae8a3fb21e6f90968e636d391ba..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dtrplugin.hxx
+++ /dev/null
@@ -1,342 +0,0 @@
-//
-// Version info for VMD plugin tree:
-//   $Id: dtrplugin.hxx,v 1.5 2016/11/06 19:16:52 johns Exp $
-//
-// Version info for last sync with D. E. Shaw Research:
-//  //depot/desrad/main/sw/libs/molfile/plugins/dtrplugin.hxx#13
-//
-
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#ifndef MOLFILE_DTRPLUGIN_HXX
-#define MOLFILE_DTRPLUGIN_HXX
-
-#if defined(_MSC_VER)
-#ifndef DESRES_WIN32
-#define DESRES_WIN32
-#endif
-#endif
-
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#ifdef DESRES_WIN32
-#include <io.h>
-#include <direct.h>
-#include <fcntl.h>
-#include <windows.h>
-
-typedef int int32_t;
-typedef unsigned char uint8_t;
-typedef unsigned int uint32_t;
-#if 1
-typedef unsigned __int64 uint64_t;    // This also works with MVSC6
-#else
-typedef unsigned long long uint64_t;
-#endif
-typedef unsigned short uint16_t;
-#if !defined(__MINGW32__)
-typedef unsigned int ssize_t;
-typedef int mode_t;
-#endif
-#define mkdir(a,b) _mkdir(a)
-#define rmdir(a)   _rmdir(a)
-#define ftello(a)  ftell(a)
-#else
-#define O_BINARY 0
-#include <inttypes.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
-
-#include <molfile_plugin.h>
-
-#include <vector>
-#include <string>
-#include <stdexcept>
-
-
-namespace desres { namespace molfile {
-  
-  const char * dtr_serialized_version();
-
-  struct key_record_t {
-    uint32_t time_lo;       /* Time associated with this file (low bytes). */
-    uint32_t time_hi;       /* Time associated with this file (high bytes). */
-    uint32_t offset_lo;     /* Zero in the 1 frame/file case (low bytes) */
-    uint32_t offset_hi;     /* Zero in the 1 frame/file case (high bytes) */
-    uint32_t framesize_lo;  /* Number of bytes in frame (low bytes) */
-    uint32_t framesize_hi;  /* Number of bytes in frame (high bytes) */
-
-    double time() const;
-    uint64_t offset() const;
-    uint64_t size() const;
-
-  };
-
-  class Timekeys {
-
-      double    m_first;        /* last time in the key list */
-      double    m_interval;     /* representative time interval between keys */
-      uint64_t  m_framesize;    /* size of all frames */
-      size_t    m_size;         /* number of non-overlapping frames */
-      size_t    m_fullsize;     /* total number of frames */
-      uint32_t  m_fpf;          /* frames per file */
-
-      /* storage for keys until compressed, or if not compressible */
-      std::vector<key_record_t> keys;
-
-    public:
-      Timekeys() 
-      : m_first(0), m_interval(0), m_framesize(0), 
-        m_size(0), m_fullsize(0), m_fpf(0) {}
-
-      bool init( const std::string& path );
-
-      uint32_t framesperfile() const { return m_fpf; }
-
-      bool is_compact() const { return keys.size()==0; }
-
-      size_t size() const { return m_size; }
-      size_t full_size() const { return m_fullsize; }
-
-      void truncate( size_t nframes ) { m_size = nframes; }
-
-      void restore_full_size() { m_size = m_fullsize; }
-
-      key_record_t operator[](uint64_t i) const;
-
-      void dump( std::ostream& out ) const;
-      void load( std::istream& in  );
-  };
-
-  class DtrReader;
-
-  class FrameSetReader {
-  protected:
-    std::string dtr;
-
-  public:
-    uint32_t natoms;
-    bool with_velocity;
-
-    FrameSetReader()
-    : natoms(0), with_velocity(false)
-    {}
-
-    virtual ~FrameSetReader() {}
-
-    bool has_velocities() const { return with_velocity; }
-
-    const std::string &path() const { return dtr; }
-
-    // initialize all members from frameset at given path.  Return success.
-    // If changed is provided, set to true/false if timekeys were/were not
-    // reloaded.
-    virtual bool init(const std::string &path, int * changed = NULL) = 0;
-
-    // number of frames
-    virtual ssize_t size() const = 0;
-
-    // read the next frame.  If ts is NULL, skip it.  If there are no more
-    // frames to read, return MOLFILE_EOF.  Otherwise, fill in coordinates
-    // in ts->coords, velocities in ts->velocities if ts->velocities is 
-    // non-NULL, and return MOLFILE_SUCCESS if all goes well.
-    virtual int next(molfile_timestep_t *ts) = 0;
-
-    // Get the DtrReader component corresponding to frame n.  Change
-    // n to the local index within the returned dtr.
-    virtual const DtrReader * component(ssize_t &n) const = 0;
-
-    // number of framesets
-    virtual ssize_t nframesets() const = 0;
-
-    // nth frameset 
-    virtual const DtrReader * frameset(ssize_t n) const = 0;
-
-    // read a specified frame.
-    virtual int frame(ssize_t n, molfile_timestep_t *ts) const = 0;
-
-    // read up to count times beginning at index start into the provided space;
-    // return the number of times actually read.
-    virtual ssize_t times(ssize_t start, ssize_t count, double * times) const = 0;
-
-    virtual std::ostream& dump(std::ostream &out) const = 0;
-    virtual std::istream& load(std::istream &in) = 0;
-  };
-
-  struct metadata_t {
-      std::vector<float>    invmass;
-  };
-
-  class DtrReader : public FrameSetReader {
-    mutable int m_ndir1;
-    mutable int m_ndir2;
-    ssize_t m_curframe;
-
-    metadata_t * meta;
-    bool owns_meta;
-
-    bool eof() const { return m_curframe >= (ssize_t)keys.size(); }
-
-  public:
-    DtrReader() 
-    : m_ndir1(-1), m_ndir2(-1), m_curframe(0),
-      meta(NULL), owns_meta(false) {}
-
-    virtual ~DtrReader() {
-      set_meta(NULL);
-    }
-
-    Timekeys keys;
-
-    // lazy-loaded DDparams
-    int ndir1() const;
-    int ndir2() const;
-
-    /* meta and owns_meta are initially set to NULL and false.  In init(), 
-     * if meta is NULL and owns_meta is false, we try to read the meta 
-     * from the metadata frame (an expensive operation), in which case 
-     * owns_meta becomes true, whether or not meta was actually read.
-     * Otherwise, we leave those values alone.  In the destructor, we delete 
-     * meta if we own it.  The StkReader class can share the meta between 
-     * DtrReader instances in the following way: if the meta it has to share
-     * is NULL, it should set owns_meta to true in the DtrReader instances,
-     * so that the DtrReaders don't keep searching for their own meta.  If
-     * the meta it has to share is non-NULL, it should set owns_meta to 
-     * false so that the meta pointer doesn't get double-freed.
-     */
-    metadata_t * get_meta() const { return meta; }
-    void set_meta(metadata_t * ptr) {
-      if (meta && owns_meta) delete meta;
-      if (ptr) {
-        meta = ptr;
-        owns_meta = false;
-      } else {
-        meta = NULL;
-        owns_meta = true;
-      }
-    }
-
-    ssize_t curframe() const { return m_curframe; }
-
-    uint32_t framesperfile() const { return keys.framesperfile(); }
-
-    virtual bool init(const std::string &path, int * changed=NULL);
-    virtual ssize_t size() const { return keys.size(); }
-    virtual ssize_t times(ssize_t start, ssize_t count, double * times) const;
-
-    virtual int next(molfile_timestep_t *ts);
-
-    virtual const DtrReader * component(ssize_t &n) const {
-      return this;
-    }
-
-    virtual ssize_t nframesets() const { return 1; }
-    virtual const DtrReader * frameset(ssize_t n) const {
-        if (n!=0) throw std::runtime_error("bad index");
-        return this;
-    }
-
-    virtual int frame(ssize_t n, molfile_timestep_t *ts) const;
-
-
-    // path for frame at index.  Empty string on not found.
-    std::string framefile(ssize_t n) const;
-
-    // read a frame from supplied bytes
-    int frame_from_bytes( const void *buf, uint64_t len,
-                          molfile_timestep_t *ts ) const;
-
-    std::ostream& dump(std::ostream &out) const;
-    std::istream& load(std::istream &in);
-  };
-
-  struct DtrWriter {
-    std::string dtr;
-    std::string m_directory;
-    const uint32_t natoms;
-    int frame_fd;        // for writing
-    uint32_t frames_per_file;
-    uint64_t framefile_offset;
-    uint64_t nwritten;
-    double last_time;
-    FILE * timekeys_file;
-
-    explicit DtrWriter(uint32_t natoms_) 
-    : natoms(natoms_), frame_fd(0), frames_per_file(256), framefile_offset(0),
-      nwritten(0), last_time(HUGE_VAL), timekeys_file(NULL)
-    {}
-
-    ~DtrWriter();
-
-    // initialize for writing at path
-    bool init(const std::string &path);
-
-    // write another frame.  Return MOLFILE_SUCCESS or MOLFILE_ERROR.
-    int next(const molfile_timestep_t *ts);
-  };
-
-  class StkReader : public FrameSetReader {
-    std::vector<DtrReader*> framesets;
-    size_t curframeset;
-
-  public:
-    StkReader() : curframeset(0) {}
-    StkReader(DtrReader *reader);
-    ~StkReader();
-    virtual bool init(const std::string &path, int * changed=NULL);
-    virtual ssize_t size() const;
-    virtual ssize_t times(ssize_t start, ssize_t count, double * times) const;
-    virtual int next(molfile_timestep_t *ts);
-    virtual int frame(ssize_t n, molfile_timestep_t *ts) const;
-    virtual const DtrReader * component(ssize_t &n) const;
-
-    virtual ssize_t nframesets() const { return framesets.size(); }
-    virtual const DtrReader * frameset(ssize_t n) const {
-        return framesets.at(n);
-    }
-
-    static bool recognizes(const std::string &path);
-
-    std::ostream& dump(std::ostream &out) const;
-    std::istream& load(std::istream &in);
-  };
-} }
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dxplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dxplugin.C
deleted file mode 100644
index 0eb9bfc1e598e86adb809d345420a88730b498fd..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/dxplugin.C
+++ /dev/null
@@ -1,486 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dxplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.43 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * DX potential maps
- *
- * Format of the file is:
- * # Comments
- * .
- * .
- * .
- * object 1 class gridpositions counts xn yn zn
- * origin xorg yorg zorg
- * delta xdel 0 0
- * delta 0 ydel 0
- * delta 0 0 zdel
- * object 2 class gridconnections counts xn yn zn
- * object 3 class array type double rank 0 items { xn*yn*zn } [binary] data follows
- * f1 f2 f3
- * f4 f5 f6 f7 f8 f9
- * .
- * .
- * .
- * object "Dataset name" class field
- 
- * Where xn, yn, and zn are the number of data points along each axis;
- * xorg, yorg, and zorg is the origin of the grid, assumed to be in angstroms;
- * xdel, ydel, and zdel are the scaling factors to convert grid units to
- * angstroms.
- *
- * Grid data follows, with a single or multiple values per line (maximum 
- * allowed linelength is hardcoded into the plugin with ~2000 chars), 
- * ordered z fast, y medium, and x slow.
- *
- * Note that the ordering of grid data in VMD's VolumetricData class
- * is transposed, i.e. x changes fastest and z slowest! 
- * The file reading and writing routines perform the transpose.
- *
- * If the optional keyword 'binary' is present, the data is expected to
- * be in binary, native endian, single precision IEEE-754 floating point format.
- *
- * Note: this plugin was written to read the OpenDX files created by the
- * APBS program, and thus supports only files that are writting in this style.
- * the full OpenDX data format is extremely powerful, complex, and flexible.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-#include "largefiles.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define LINESIZE 2040
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-  int isBinary; 
-} dx_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *dxgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Unexpected end-of-file.\n");
-    return NULL;
-  } else if (ferror(stream)) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static void *open_dx_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  dx_t *dx;
-  char inbuf[LINESIZE];
-  int xsize, ysize, zsize;
-  float orig[3], xdelta[3], ydelta[3], zdelta[3];
-  int isBinary = 0;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* skip comments */
-  do {
-    if (dxgets(inbuf, LINESIZE, fd) == NULL) 
-      return NULL;
-  } while (inbuf[0] == '#');
-
-  /* get the number of grid points */
-  if (sscanf(inbuf, "object 1 class gridpositions counts %d %d %d", &xsize, &ysize, &zsize) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading grid dimensions.\n");
-    return NULL;
-  }
-
-  /* get the cell origin */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "origin %e %e %e", orig, orig+1, orig+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading grid origin.\n");
-    return NULL;
-  }
-
-  /* get the cell dimensions */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "delta %e %e %e", xdelta, xdelta+1, xdelta+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading cell x-dimension.\n");
-    return NULL;
-  }
-
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "delta %e %e %e", ydelta, ydelta+1, ydelta+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading cell y-dimension.\n");
-    return NULL;
-  }
-
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "delta %e %e %e", zdelta, zdelta+1, zdelta+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading cell z-dimension.\n");
-    return NULL;
-  }
-
-  /* skip the next line of the header (described at the beginning of
-   * the code), which aren't utilized by APBS-produced DX files.  */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  /* The next line tells us whether to expect ascii or binary format.
-   * We scan for the word 'binary' somewhere in the line, and if it's found
-   * we assume binary.
-   */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL)
-    return NULL;
-  if (strstr(inbuf, "binary")) {
-      isBinary = 1;
-  }
- 
-  /* allocate and initialize the dx structure */
-  dx = new dx_t;
-  dx->fd = fd;
-  dx->vol = NULL;
-  dx->isBinary = isBinary;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  dx->nsets = 1; /* this file contains only one data set */
-
-  dx->vol = new molfile_volumetric_t[1];
-  memset(dx->vol, 0, sizeof(molfile_volumetric_t));
-  strcpy(dx->vol[0].dataname, "DX map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    dx->vol[0].origin[i] = orig[i];
-    dx->vol[0].xaxis[i] = xdelta[i] * ((xsize-1 > 0) ? (xsize-1) : 1);
-    dx->vol[0].yaxis[i] = ydelta[i] * ((ysize-1 > 0) ? (ysize-1) : 1);
-    dx->vol[0].zaxis[i] = zdelta[i] * ((zsize-1 > 0) ? (zsize-1) : 1);
-  }
-
-  dx->vol[0].xsize = xsize;
-  dx->vol[0].ysize = ysize;
-  dx->vol[0].zsize = zsize;
-
-  /* DX files contain no color information. Taken from edmplugin.C */
-  dx->vol[0].has_color = 0;
-
-  return dx;
-}
-
-static int read_dx_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  dx_t *dx = (dx_t *)v;
-  *nsets = dx->nsets; 
-  *metadata = dx->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_binary_dx_data(dx_t *dx, int set, float *datablock) {
-    
-  int i, j, k;
-  int xsize = dx->vol[0].xsize;
-  int ysize = dx->vol[0].ysize;
-  int zsize = dx->vol[0].zsize;
-  int xysize = xsize * ysize;
-  size_t total = xysize * zsize;
-  float *tmp = (float *)malloc(total*sizeof(float));
-  if (fread(tmp, sizeof(float), total, dx->fd) != total) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Failed to read %d binary floats\n", total);
-    free(tmp);
-    return MOLFILE_ERROR;
-  }
-  // take the transpose - nasty
-  int ind = 0;
-  for (i=0; i<xsize; i++) {
-      for (j=0; j<ysize; j++) {
-          for (k=0; k<zsize; k++) {
-              datablock[k * xysize + j*xsize + i] = tmp[ind++];
-          }
-      }
-  }
-  free( tmp );
-  return MOLFILE_SUCCESS;
-}
-
-static int read_dx_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  dx_t *dx = (dx_t *)v;
-  FILE *fd = dx->fd;
-  char inbuf[LINESIZE];
-  char *p;
-  float grid;
-  int x, y, z, xsize, ysize, zsize, xysize, count, total, i, line;
-
-  if (dx->isBinary)
-    return read_binary_dx_data(dx, set, datablock);
-
-  xsize = dx->vol[0].xsize;
-  ysize = dx->vol[0].ysize;
-  zsize = dx->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  /* Read the values from the file */
-  x = y = z = line = 0;
-  for (count = 0; count < total;) {
-    ++line;
-    p=dxgets(inbuf, LINESIZE, fd);
-    if (p == NULL) {
-      vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading grid data.\n");
-      vmdcon_printf(VMDCON_ERROR, "dxplugin) line: %d. item: %d/%d. last data: %s\n", 
-              line, count, total, inbuf);
-      return MOLFILE_ERROR;
-    }
-
-    // chop line into whitespace separated tokens and parse them one by one.
-    while (*p != '\n' && *p != '\0') {
-
-      // skip over whitespace and try to parse non-blank as number
-      while (*p != '\0' && (*p == ' ' || *p == '\t' || *p == '\n')) ++p;
-      i = sscanf(p, "%e", &grid);
-      if (i < 0) break; // end of line/string. get a new one.
-      
-      // a 0 return value means non-parsable as number.
-      if (i == 0) {
-        vmdcon_printf(VMDCON_ERROR, "dxplugin) Error parsing grid data.\n");
-        vmdcon_printf(VMDCON_ERROR, "dxplugin) line: %d. item: %d/%d. data %s\n", 
-                line, count, total, p);
-        return MOLFILE_ERROR;
-      }
-
-      // success! add to dataset.
-      if (i == 1) {
-        ++count;
-        datablock[x + y*xsize + z*xysize] = grid;
-        z++;
-        if (z >= zsize) {
-          z = 0; y++;
-          if (y >= ysize) {
-            y = 0; x++;
-          }
-        }
-      }
-
-      // skip over the parsed text and search for next blank.
-      while (*p != '\0' && *p != ' ' && *p != '\t' && *p != '\n') ++p;
-    }
-  }
-  
-  char dxname[256];
-  while (dxgets(inbuf, LINESIZE, dx->fd)) {
-    if (sscanf(inbuf, "object \"%[^\"]\" class field", dxname) == 1) {
-      // a dataset name has been found; override the default
-      strcpy(dx->vol[0].dataname, dxname);
-      break;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_dx_read(void *v) {
-  dx_t *dx = (dx_t *)v;
-  
-  fclose(dx->fd);
-  if (dx->vol != NULL)
-    delete [] dx->vol; 
-  delete dx;
-}
-
-static void *open_dx_write(const char *filepath, const char *filetype,
-        int natoms) {
-
-    FILE *fd = fopen(filepath, "wb");
-    if (!fd) {
-        vmdcon_printf(VMDCON_ERROR, 
-                      "dxplugin) Could not open path '%s' for writing.\n",
-                      filepath);
-    }
-    return fd;
-}
-
-static void close_dx_write(void *v) {
-    if (v) {
-        fclose((FILE *)v);
-    }
-}
-
-/*
- *
-# Data from APBS
-# 
-# POTENTIAL (kT/e)
-# 
-object 1 class gridpositions counts 129 129 129
-origin -3.075250e+01 -3.848600e+01 -2.908250e+01
-delta 4.687500e-01 0.000000e+00 0.000000e+00
-delta 0.000000e+00 6.250000e-01 0.000000e+00
-delta 0.000000e+00 0.000000e+00 4.687500e-01
-object 2 class gridconnections counts 129 129 129
-object 3 class array type double rank 0 items 2146689 data follows
-
-*/
-static int write_dx_data(void *v, molfile_volumetric_t *metadata,
-        float *datablock, float *colorblock) {
-
-    int i, j, k, count;
-    FILE *fd = (FILE *)v;
-    const int xsize = metadata->xsize;
-    const int ysize = metadata->ysize;
-    const int zsize = metadata->zsize;
-    const int xysize = xsize * ysize;
-    const int total = xysize * zsize;
-
-    double xdelta[3], ydelta[3], zdelta[3];
-    for (i=0; i<3; i++) {
-      xdelta[i] = metadata->xaxis[i]/(xsize - 1);
-      ydelta[i] = metadata->yaxis[i]/(ysize - 1);
-      zdelta[i] = metadata->zaxis[i]/(zsize - 1);
-    }
-
-    fprintf(fd, "# Data from VMD\n");
-    fprintf(fd, "# %s\n", metadata->dataname);
-    fprintf(fd, "object 1 class gridpositions counts %d %d %d\n",
-            xsize, ysize, zsize);
-    fprintf(fd, "origin %g %g %g\n", 
-            metadata->origin[0], metadata->origin[1], metadata->origin[2]);
-    fprintf(fd, "delta %g %g %g\n", 
-            xdelta[0], xdelta[1], xdelta[2]);
-    fprintf(fd, "delta %g %g %g\n", 
-            ydelta[0], ydelta[1], ydelta[2]);
-    fprintf(fd, "delta %g %g %g\n", 
-            zdelta[0], zdelta[1], zdelta[2]);
-    fprintf(fd, "object 2 class gridconnections counts %d %d %d\n",
-            xsize, ysize, zsize);
-
-    int useBinary = (getenv("VMDBINARYDX") != NULL);
-    fprintf(fd, "object 3 class array type double rank 0 items %d %sdata follows\n", total, useBinary ? "binary " : "");
-    count = 0;
-    for (i=0; i<xsize; i++) {
-        for (j=0; j<ysize; j++) {
-            for (k=0; k<zsize; k++) {
-                if (useBinary) {
-                    fwrite(datablock + k*xysize + j*xsize + i, sizeof(float),
-                            1, fd);
-                } else {
-                    fprintf(fd, "%g ", datablock[k*xysize + j*xsize + i]);
-                    if (++count == 3) {
-                        fprintf(fd, "\n");
-                        count = 0;
-                    }
-                }
-            }
-        }
-    }
-    if (!useBinary && count) 
-      fprintf(fd, "\n");
-
-    // Replace any double quotes (") by single quotes (') in the 
-    // dataname string to make sure that we don't prematurely
-    // terminate the string in the dx file.
-    char *squotes = new char[strlen(metadata->dataname)+1];
-    strcpy(squotes, metadata->dataname);
-    char *s = squotes;
-    // while(s=strchr(s, '"')) *s = '\'';
-    while(1) { 
-      s=strchr(s, '"'); 
-      if (s) { 
-        *s = '\'';
-      } else { 
-        break;
-      }
-    }
-
-    // Print last line
-    fprintf(fd, "object \"%s\" class field\n", squotes);
-    delete [] squotes;
-
-    fflush(fd);
-    return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t dxplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&dxplugin, 0, sizeof(molfile_plugin_t));
-  dxplugin.abiversion = vmdplugin_ABIVERSION;
-  dxplugin.type = MOLFILE_PLUGIN_TYPE;
-  dxplugin.name = "dx";
-  dxplugin.prettyname = "DX";
-  dxplugin.author = "Eamon Caddigan, Justin Gullingsrud, John Stone, Leonardo Trabuco";
-  dxplugin.majorv = 2;
-  dxplugin.minorv = 0;
-  dxplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  dxplugin.filename_extension = "dx";
-  dxplugin.open_file_read = open_dx_read;
-  dxplugin.read_volumetric_metadata = read_dx_metadata;
-  dxplugin.read_volumetric_data = read_dx_data;
-  dxplugin.close_file_read = close_dx_read;
-#if vmdplugin_ABIVERSION > 9
-  dxplugin.open_file_write = open_dx_write;
-  dxplugin.write_volumetric_data = write_dx_data;
-  dxplugin.close_file_write = close_dx_write;
-#endif
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&dxplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/edmplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/edmplugin.C
deleted file mode 100644
index b1d70b1b8cde7eb9f97821f5d9df8503c84e4139..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/edmplugin.C
+++ /dev/null
@@ -1,571 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: edmplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-
-#ifndef NAN //not a number
-  const float NAN = sqrtf(-1.f); //need some kind of portable NAN definition
-#endif
-
-#define TOLERANCE 1e-4
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} edm_t;
-
-static void eatline(FILE * fd) {
-  char readbuf[1025];
-  fgets(readbuf, 1024, fd);    // go on to next line
-}  
-
-static void *open_edm_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  edm_t *edm;
-  int ntitle, na, nb, nc, xsize, ysize, zsize;
-  int amin, amax, bmin, bmax, cmin, cmax;
-  float a, b, c, alpha, beta, gamma;
-  float xdelta, ydelta, zdelta;
-  float alpha1, beta1, gamma1;
-  float xaxis[3], yaxis[3], zaxis[3], z1, z2, z3;
-  int i, convcnt;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-
-  edm = new edm_t;
-  edm->fd = fd;
-  edm->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-
-  edm->vol = new molfile_volumetric_t[1];
- 
-  edm->nsets = 1; // this EDM file contains only one data set
-
-  // read in EDM file header information
-  eatline(edm->fd);               // skip first header line 
-
-  convcnt = fscanf(edm->fd, "%d", &ntitle); // read number of title lines
-  if (convcnt != 1) {
-    printf("edmplugin) failed to read in title line count\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-    
-  eatline(edm->fd);               // go on to next line
-
-  // skip past title and comment lines in header
-  for (i=0; i<ntitle; i++) {
-    eatline(edm->fd);             // skip a line
-  }
-
-  // read in the box dimensions and grid spacing deltas
-  convcnt = fscanf(edm->fd, "%d %d %d %d %d %d %d %d %d",
-         &na, &amin, &amax, &nb, &bmin, &bmax, &nc, &cmin, &cmax);
-  if (convcnt != 9) {
-    printf("edmplugin) failed to read in box dimensions\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-
-  eatline(edm->fd);               // go on to next line
-  
-  // calculate number of samples in each dimension
-  xsize = amax - amin + 1;    
-  ysize = bmax - bmin + 1;    
-  zsize = cmax - cmin + 1;    
-  edm->vol[0].xsize = xsize;
-  edm->vol[0].ysize = ysize;
-  edm->vol[0].zsize = zsize;
-  edm->vol[0].has_color = 0;
-
-  // read in 6 values for unit cell box orientation 
-  convcnt = fscanf(edm->fd, "%f %f %f %f %f %f", 
-                   &a, &b, &c, &alpha, &beta, &gamma);
-  if (convcnt != 6) {
-    printf("edmplugin) failed to read in box lengths and angles\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-  eatline(edm->fd);            // go on to next line
-
-  // find box coordinates 
-  xdelta = a / (float) na;
-  ydelta = b / (float) nb;
-  zdelta = c / (float) nc;
-
-  strcpy(edm->vol[0].dataname, "X-PLOR Electron Density Map");
-
-  // convert degrees to radians
-  alpha1 = 3.14159265358979323846 * alpha / 180.0;
-  beta1  = 3.14159265358979323846 *  beta / 180.0;
-  gamma1 = 3.14159265358979323846 * gamma / 180.0;
-
-  // calculate non-orthogonal unit cell coordinates
-  xaxis[0] = xdelta;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(gamma1) * ydelta;
-  yaxis[1] = sin(gamma1) * ydelta;
-  yaxis[2] = 0;
-
-  z1 = cos(beta1);
-  z2 = (cos(alpha1) - cos(beta1)*cos(gamma1)) / sin(gamma1);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * zdelta;
-  zaxis[1] = z2 * zdelta;
-  zaxis[2] = z3 * zdelta;
-
-  edm->vol[0].origin[0] = xaxis[0] * amin + yaxis[0] * bmin + zaxis[0] * cmin;
-  edm->vol[0].origin[1] = yaxis[1] * bmin + zaxis[1] * cmin;
-  edm->vol[0].origin[2] = zaxis[2] * cmin;
-
-  edm->vol[0].xaxis[0] = xaxis[0] * (xsize-1);
-  edm->vol[0].xaxis[1] = 0;
-  edm->vol[0].xaxis[2] = 0;
-
-  edm->vol[0].yaxis[0] = yaxis[0] * (ysize-1);
-  edm->vol[0].yaxis[1] = yaxis[1] * (ysize-1);
-  edm->vol[0].yaxis[2] = 0;
-
-  edm->vol[0].zaxis[0] = zaxis[0] * (zsize-1);
-  edm->vol[0].zaxis[1] = zaxis[1] * (zsize-1);
-  edm->vol[0].zaxis[2] = zaxis[2] * (zsize-1);
-
-  // Check that the EDM file is stored in the "ZYX" format we expect,
-  // and return NULL if it is not a supported file type.
-  char planeorder[4];
-  memset(planeorder, 0, sizeof(planeorder));
-  convcnt = fscanf(edm->fd, "%3s", planeorder);
-  if (convcnt != 1) {
-    printf("edmplugin) failed to read in plane order\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-
-  if (strcmp(planeorder, "ZYX")) { 
-    printf("edmplugin) unsupported plane ordering %s\n", planeorder);
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-  eatline(edm->fd);               // go on to next line
-
-  return edm;
-}
-
-static int read_edm_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  edm_t *edm = (edm_t *)v;
-  *nsets = edm->nsets; 
-  *metadata = edm->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_edm_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  edm_t *edm = (edm_t *)v;
-  float * cell = datablock;
-  int z, sentinel, convcnt;
-  char readbuf[16];
- 
-  int xsize = edm->vol[0].xsize;
-  int ysize = edm->vol[0].ysize;
-  int zsize = edm->vol[0].zsize;
-
-  // number of lines of text per slice
-  int nperslice = xsize * ysize;
-  int nlines = (int)(nperslice / 6.0);
-  if ((nlines * 6) < nperslice) {
-    nlines++;
-  }
-
-  for (z=0; z<zsize; z++) {
-    int c;
-    eatline(edm->fd);                // Eat the Z-plane index and throw away
-
-    // read one plane of data, one cell at a time
-    for (c=0; c<nperslice; c++) {
-      convcnt = fscanf(edm->fd, "%f", cell);
-      if (convcnt != 1) {
-        printf("edmplugin) failed reading cell data\n");
-        printf("edmplugin) cell %d of %d, slice %d\n", c, nperslice, z);
-        return MOLFILE_ERROR; // bad file format encountered
-      }
-      cell++;
-    }
-    eatline(edm->fd);                // go on to next line
-  }
-
-  // read the -9999 end-of-file sentinel record
-  sentinel = 0;
-  fgets(readbuf, 13, edm->fd);
-  sscanf(readbuf, "%d", &sentinel);  
-  if (sentinel != -9999) {
-    printf("edmplugin) EOF sentinel != -9999\n");
-    // return MOLFILE_ERROR; // bad file format encountered, no sentinel record
-  }
- 
-  return MOLFILE_SUCCESS;
-}
-
-static void close_edm_read(void *v) {
-  edm_t *edm = (edm_t *)v;
-
-  fclose(edm->fd);
-  delete [] edm->vol; 
-  delete edm;
-}
-
-static void *open_edm_write(const char *filepath, const char *filetype, int natoms) {
-
-  FILE *fd = fopen(filepath, "w");
-  if (!fd) {
-    fprintf(stderr, "edmplugin) Could not open path '%s' for writing.\n",
-      filepath);
-  }
-  return fd;
-}
-
-static void close_edm_write(void *v) {
-  if (v) {
-    fclose((FILE *)v);
-  }
-}
-
-// XXX - The following interpolation code is duplicated from situsplugin.C
-//       (which is in turn duplicated from VMD). The only difference is that
-//       we are returning zeroes instead of NANs for out-of-range queries
-//       in the code below. These routines should be made available from 
-//       a centralized place to all molfile plugins, eliminating code 
-//       duplication.
-
-/// return voxel, after safely clamping index to valid range
-float edm_voxel_value_safe(int x, int y, int z, const int xsize, const int ysize, const int zsize, const float *data) {
-  int xx, yy, zz; 
-  xx = (x > 0) ? ((x < xsize) ? x : xsize-1) : 0;
-  yy = (y > 0) ? ((y < ysize) ? y : ysize-1) : 0;
-  zz = (z > 0) ? ((z < zsize) ? z : zsize-1) : 0;
-  int index = zz*xsize*ysize + yy*xsize + xx;
-  return data[index];
-}
-
-/// return interpolated value from 8 nearest neighbor voxels
-float edm_voxel_value_interpolate(float xv, float yv, float zv, const int xsize, const int ysize, const int zsize, const float *data) {
-  int x = (int) xv;
-  int y = (int) yv;
-  int z = (int) zv;
-  // fractional offset
-  float xf = xv - x;
-  float yf = yv - y;
-  float zf = zv - z;
-  float xlerps[4];
-  float ylerps[2];
-  float tmp;
-
-  tmp = edm_voxel_value_safe(x, y, z, xsize, ysize, zsize, data);
-  xlerps[0] = tmp + xf*(edm_voxel_value_safe(x+1, y, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = edm_voxel_value_safe(x, y+1, z, xsize, ysize, zsize, data);
-  xlerps[1] = tmp + xf*(edm_voxel_value_safe(x+1, y+1, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = edm_voxel_value_safe(x, y, z+1, xsize, ysize, zsize, data);
-  xlerps[2] = tmp + xf*(edm_voxel_value_safe(x+1, y, z+1, xsize, ysize, zsize, data) - tmp);
-
-  tmp = edm_voxel_value_safe(x, y+1, z+1, xsize, ysize, zsize, data);
-  xlerps[3] = tmp + xf*(edm_voxel_value_safe(x+1, y+1, z+1, xsize, ysize, zsize, data) - tmp);
-
-  ylerps[0] = xlerps[0] + yf*(xlerps[1] - xlerps[0]);
-  ylerps[1] = xlerps[2] + yf*(xlerps[3] - xlerps[2]);
-
-  return ylerps[0] + zf*(ylerps[1] - ylerps[0]);
-}
-
-/// return interpolated value of voxel, based on atomic coords.
-/// XXX need to account for non-orthog. cells
-float edm_voxel_value_interpolate_from_coord(float xpos, float ypos, float zpos, const float *origin, const float *xdelta, const float *ydelta, const float *zdelta, const int xsize, const int ysize, const int zsize, float *data) {
-  xpos = (xpos-origin[0])/xdelta[0];
-  ypos = (ypos-origin[1])/ydelta[1];
-  zpos = (zpos-origin[2])/zdelta[2];
-  int gx = (int) xpos; // XXX this is wrong for non-orthog cells.
-  int gy = (int) ypos;
-  int gz = (int) zpos;
-
-//  if (gx < 0 || gx >= xsize) return NAN;
-//  if (gy < 0 || gy >= ysize) return NAN;
-//  if (gz < 0 || gz >= zsize) return NAN;
-
-  // Pad with zeroes
-  if (gx < 0 || gx >= xsize) return 0;
-  if (gy < 0 || gy >= ysize) return 0;
-  if (gz < 0 || gz >= zsize) return 0;
-    
-  return edm_voxel_value_interpolate(xpos, ypos, zpos, xsize, ysize, zsize, data);
-
-}
-
-static int write_edm_data(void *v, molfile_volumetric_t *metadata, float *datablock, float *colorblock) {
-
-  FILE *fd = (FILE *)v;
-  const int xsize = metadata->xsize;
-  const int ysize = metadata->ysize;
-  const int zsize = metadata->zsize;
-
-  float xaxis[3], yaxis[3], zaxis[3];
-  float xdelta[3], ydelta[3], zdelta[3];
-  float origin[3], porigin[3];
-
-  int i, j, k;
-
-  int na, amin, amax, nb, bmin, bmax, nc, cmin, cmax;
-  float a, b, c, alpha, beta, gamma;
-
-  for (i=0; i<3; i++) {
-    origin[i] = metadata->origin[i];
-    xaxis[i] = metadata->xaxis[i];
-    yaxis[i] = metadata->yaxis[i];
-    zaxis[i] = metadata->zaxis[i];
-    xdelta[i] = xaxis[i]/(xsize - 1);
-    ydelta[i] = yaxis[i]/(ysize - 1);
-    zdelta[i] = zaxis[i]/(zsize - 1);
-  }
-
-  // The origin and the box length must be multiples of the grid spacing,
-  // so we pad the box accordingly, keeping the same grid spacing and 
-  // resampling the map.
-
-  // For now, we will only write orthonogal cells
-  if (fabs(xaxis[1]) > TOLERANCE || fabs(xaxis[2]) > TOLERANCE ||
-      fabs(yaxis[0]) > TOLERANCE || fabs(yaxis[2]) > TOLERANCE ||
-      fabs(zaxis[0]) > TOLERANCE || fabs(zaxis[1]) > TOLERANCE) {
-    fprintf(stderr, "edmplugin) Could not write X-PLOR file: only orthogonal cells are currently supported.\n");
-    return MOLFILE_ERROR;
-  }
-
-  amin = (int) floorf(origin[0]/xdelta[0]);
-  bmin = (int) floorf(origin[1]/ydelta[1]);
-  cmin = (int) floorf(origin[2]/zdelta[2]);
-
-  porigin[0] = amin * xdelta[0];
-  porigin[1] = bmin * ydelta[1];
-  porigin[2] = cmin * zdelta[2];
-
-  amax = (int) ceilf((xaxis[0]+origin[0])/xdelta[0]);
-  bmax = (int) ceilf((yaxis[1]+origin[1])/ydelta[1]);
-  cmax = (int) ceilf((zaxis[2]+origin[2])/zdelta[2]);
-
-  na = amax - amin + 1;
-  nb = bmax - bmin + 1;
-  nc = cmax - cmin + 1;
-
-  // The new cell axes may be slightly larger than the original ones
-  a = na*xdelta[0];
-  b = nb*ydelta[1];
-  c = nc*zdelta[2];
-
-  // Assuming the cell is orthognal
-  alpha = beta = gamma = 90;
-
-  // Write header
-  fprintf(fd,"\n 2 !NTITLE\n"); // number of title lines
-  fprintf(fd,"REMARKS FILENAME=\"\"\n");
-  fprintf(fd,"REMARKS created by VMD\n");
-
-  // Write the box dimensions and grid spacing deltas
-  fprintf(fd,"%d %d %d %d %d %d %d %d %d\n", na, amin, amax, nb, bmin, bmax,
-                                             nc, cmin, cmax);
-  fprintf(fd,"%g %g %g %g %g %g\n", a, b, c, alpha, beta, gamma);
-
-  // Write plane order
-  fprintf(fd,"ZYX\n");
-
-  // Copy voldata to a padded array
-  int psize = na*nb*nc;
-  int pxysize = na*nb;
-
-  // Resample map
-  float *pdata = (float*) malloc(psize*sizeof(float));
-  for (i=0; i<na; i++) {
-    float xpos = porigin[0] + i*xdelta[0];
-    for (j=0; j<nb; j++) {
-      float ypos = porigin[1] + j*ydelta[1];
-      for (k=0; k<nc; k++) {
-        float zpos = porigin[2] + k*zdelta[2];
-        pdata[i + j*na + k*pxysize] = edm_voxel_value_interpolate_from_coord(xpos, ypos, zpos, origin, xdelta, ydelta, zdelta, xsize, ysize, zsize, datablock);
-      }
-    }
-  }
-
-  // Write each xy slice separately
-  int count = 0;
-  for (k=0; k<nc; k++) {
-    if (count % 6) fprintf(fd, "\n");
-    fprintf(fd, "%8d\n", k);
-    count=0;
-    for (j=0; j<nb; j++) {
-      for (i=0; i<na; i++) {
-        fprintf(fd, "%12.5e", pdata[k*pxysize + j*na + i]);
-        if (++count % 6 == 0)
-          fprintf(fd, "\n");
-      }
-    }
-  }
-  if (count % 6) fprintf(fd, "\n");
-
-  // Write footer
-  int sentinel = -9999;
-  fprintf(fd, "%8d\n", sentinel);
-
-  // Calculate average and standard deviation
-  double avg = 0;
-  double stddev = 0;
-  double sum = 0;
-  double sum2 = 0;
-  for (i=0; i<psize; i++) {
-    sum += pdata[i];
-    sum2 += pdata[i]*pdata[i];
-  }
-  avg = sum/(double)psize;
-  stddev = psize/(psize-1) * sqrt(sum2/psize - avg*avg);
-  fprintf(fd, "%g %g\n", avg, stddev);
-
-  free(pdata);
-
-  fflush(fd);
-  return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "edm";
-  plugin.prettyname = "XPLOR Electron Density Map";
-  plugin.author = "John Stone, Leonardo Trabuco";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cns,edm,xplor";
-  plugin.open_file_read = open_edm_read;
-  plugin.read_volumetric_metadata = read_edm_metadata;
-  plugin.read_volumetric_data = read_edm_data;
-  plugin.close_file_read = close_edm_read;
-#if vmdplugin_ABIVERSION > 9
-  plugin.open_file_write = open_edm_write;
-  plugin.write_volumetric_data = write_edm_data;
-  plugin.close_file_write = close_edm_write;
-#endif
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
-#ifdef TEST_EDMPLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-  void *v;
-  int i, nsets, set;
-  molfile_volumetric_t * meta;
-
-  while (--argc) {
-    ++argv;
-    v = open_edm_read(*argv, "edm", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_edm_read failed for file %s\n", *argv);
-      return 1;
-    }
-
-    // try loading the EDM metadata now
-    if (read_edm_metadata(v, &nsets, &meta)) {
-      return 1; // failed to load edm file
-    }
-
-    for (set=0; set<nsets; set++) {
-      printf("Loading volume set: %d\n", set);   
-      
-      int elements = meta[set].xsize * meta[set].ysize * meta[set].zsize;
-      printf("   Grid Elements: %d\n", elements);
-      printf(" Grid dimensions: X: %d Y: %d Z: %d\n", 
-             meta[set].xsize, meta[set].ysize, meta[set].zsize);
-
-      float * voldata = (float *) malloc(sizeof(float) * elements);
-      float * coldata = NULL;
-
-      if (meta[set].has_color) {
-        coldata = (float *) malloc(sizeof(float) * elements * 3);
-      }
-
-      // try loading the EDM data sets now
-      if (read_edm_data(v, set, voldata, coldata)) {
-        return 1; // failed to load edm file
-      }
-
-      printf("First 6 elements:\n   ");
-      for (i=0; i<6; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-
-      printf("Last 6 elements:\n   ");
-      for (i=elements - 6; i<elements; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-    }
-
-    close_edm_read(v);
-  }
-  return 0;
-}
-
-#endif
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/endianswap.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/endianswap.h
deleted file mode 100644
index 06af6c2040b867ba957afdd7cf9433c3df6be89d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/endianswap.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: endianswap.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Byte swapping routines used in various plugins
- *   There are two versions of each routine, one that's safe to use in
- *   all cases (but is slow) and one that is only safe to use on memory 
- *   addresses that are aligned to the word size that's being byte-swapped
- *   but are much much much faster.  Use the aligned versions of these
- *   routines whenever possible.  The 'ndata' length count parameters and
- *   internal loops should be safe to use on huge memory arrays on 64-bit
- *   machines.
- *
- ***************************************************************************/
-
-#ifndef ENDIAN_SWAP_H
-#define ENDIAN_SWAP_H
-
-/* works on unaligned 2-byte quantities */
-static void swap2_unaligned(void *v, long ndata) {
-  long i;
-  char * dataptr = (char *) v;
-  char tmp;
-
-  for (i = 0; i < ndata-1; i += 2) {
-    tmp = dataptr[i];
-    dataptr[i] = dataptr[i+1];
-    dataptr[i+1] = tmp;
-  }
-}
-
-
-/* works on unaligned 4-byte quantities */
-static void swap4_unaligned(void *v, long ndata) {
-  long i;
-  char *dataptr;
-  char tmp;
-
-  dataptr = (char *) v; 
-  for (i=0; i<ndata; i++) {
-    tmp = dataptr[0];
-    dataptr[0] = dataptr[3];
-    dataptr[3] = tmp;
-    tmp = dataptr[1];
-    dataptr[1] = dataptr[2];
-    dataptr[2] = tmp;
-    dataptr += 4;
-  }
-}
-
-
-/* works on unaligned 8-byte quantities */
-static void swap8_unaligned(void *v, long ndata) {
-  char *data = (char *) v;
-  long i;
-  char byteArray[8];
-  char *bytePointer;
-
-  for (i=0; i<ndata; i++) {
-    bytePointer = data + (i<<3);
-    byteArray[0]  =  *bytePointer;
-    byteArray[1]  =  *(bytePointer+1);
-    byteArray[2]  =  *(bytePointer+2);
-    byteArray[3]  =  *(bytePointer+3);
-    byteArray[4]  =  *(bytePointer+4);
-    byteArray[5]  =  *(bytePointer+5);
-    byteArray[6]  =  *(bytePointer+6);
-    byteArray[7]  =  *(bytePointer+7);
-
-    *bytePointer     = byteArray[7];
-    *(bytePointer+1) = byteArray[6];
-    *(bytePointer+2) = byteArray[5];
-    *(bytePointer+3) = byteArray[4];
-    *(bytePointer+4) = byteArray[3];
-    *(bytePointer+5) = byteArray[2];
-    *(bytePointer+6) = byteArray[1];
-    *(bytePointer+7) = byteArray[0];
-  }
-}
-
-
-/* Only works with aligned 2-byte quantities, will cause a bus error */
-/* on some platforms if used on unaligned data.                      */
-static void swap2_aligned(void *v, long ndata) {
-  short *data = (short *) v;
-  long i;
-  short *N; 
-
-  for (i=0; i<ndata; i++) {
-    N = data + i;
-    *N=(((*N>>8)&0xff) | ((*N&0xff)<<8));  
-  }
-}
-
-
-/* Only works with aligned 4-byte quantities, will cause a bus error */
-/* on some platforms if used on unaligned data.                      */
-static void swap4_aligned(void *v, long ndata) {
-  int *data = (int *) v;
-  long i;
-  int *N;
-  for (i=0; i<ndata; i++) {
-    N = data + i;
-    *N=(((*N>>24)&0xff) | ((*N&0xff)<<24) | 
-        ((*N>>8)&0xff00) | ((*N&0xff00)<<8));
-  }
-}
-
-
-/* Only works with aligned 8-byte quantities, will cause a bus error */
-/* on some platforms if used on unaligned data.                      */
-static void swap8_aligned(void *v, long ndata) {
-  /* Use int* internally to prevent bugs caused by some compilers */
-  /* and hardware that would potentially load data into an FP reg */
-  /* and hose everything, such as the old "jmemcpy()" bug in NAMD */
-  int *data = (int *) v;  
-  long i;
-  int *N; 
-  int t0, t1;
-
-  for (i=0; i<ndata; i++) {
-    N = data + (i<<1);
-    t0 = N[0];
-    t0=(((t0>>24)&0xff) | ((t0&0xff)<<24) | 
-        ((t0>>8)&0xff00) | ((t0&0xff00)<<8));
-
-    t1 = N[1];
-    t1=(((t1>>24)&0xff) | ((t1&0xff)<<24) | 
-        ((t1>>8)&0xff00) | ((t1&0xff00)<<8));
-
-    N[0] = t1; 
-    N[1] = t0; 
-  }
-}
-
-#if 0
-/* Other implementations that might be faster in some cases */
-
-/* swaps the endianism of an eight byte word. */
-void mdio_swap8(double *i) {
-        char c;
-        char *n;
-        n = (char *) i;
-        c = n[0];
-        n[0] = n[7];
-        n[7] = c;
-        c = n[1];
-        n[1] = n[6];
-        n[6] = c;
-        c = n[2];
-        n[2] = n[5];
-        n[5] = c;
-        c = n[3];
-        n[3] = n[4];
-        n[4] = c;
-}
-
-#endif
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fastio.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fastio.h
deleted file mode 100644
index 3be0b4f4da2921249b52286b9e430496c616461d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fastio.h
+++ /dev/null
@@ -1,613 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: fastio.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   This is a simple abstraction layer for system-dependent I/O calls
- * that allow plugins to do binary I/O using the fastest possible method.
- *
- * This code is intended for use by binary trajectory reader plugins that
- * work with multi-gigabyte data sets, reading only binary data.
- *
- ***************************************************************************/
-
-#define FIO_READ    0x01
-#define FIO_WRITE   0x02
-#define FIO_DIRECT  0x04 /* emulate Unix O_DIRECT flag */
- 
-/* Compiling on windows */
-#if defined(_MSC_VER) || defined(__MINGW32__)
-
-#if 1 
-/* use native Windows I/O calls */
-#define FASTIO_NATIVEWIN32 1
-
-#include <stdio.h>
-#include <string.h>
-#include <windows.h>
-
-typedef HANDLE fio_fd;
-typedef LONGLONG fio_size_t;
-typedef void * fio_caddr_t;
-
-typedef struct {
-  fio_caddr_t iov_base;
-  int iov_len;
-} fio_iovec;
-
-
-#define FIO_SEEK_CUR  FILE_CURRENT
-#define FIO_SEEK_SET  FILE_BEGIN
-#define FIO_SEEK_END  FILE_END
-
-static int fio_win32convertfilename(const char *filename, char *newfilename, int maxlen) {
-  int i;
-  int len=strlen(filename);
- 
-  if ((len + 1) >= maxlen)
-    return -1;
-   
-  for (i=0; i<len; i++) {
-    if (filename[i] == '/')
-      newfilename[i] = '\\';
-    else
-      newfilename[i] = filename[i];
-  }
-  newfilename[len] = '\0'; /* NUL terminate the string */
-
-  return 0;
-}
-
-static int fio_open(const char *filename, int mode, fio_fd *fd) {
-  HANDLE fp;
-  char winfilename[8192];
-  DWORD access;
-  DWORD sharing;
-  LPSECURITY_ATTRIBUTES security;
-  DWORD createmode;
-  DWORD flags;
-
-  if (fio_win32convertfilename(filename, winfilename, sizeof(winfilename)))
-    return -1;  
-
-  access = 0;
-  if (mode & FIO_READ)
-    access |= GENERIC_READ;
-  if (mode & FIO_WRITE)
-    access |= GENERIC_WRITE;
-#if 0
-  access = FILE_ALL_ACCESS; /* XXX hack if above modes fail */
-#endif
-#if 1
-  if (mode & FIO_DIRECT)
-    flags = FILE_FLAG_NO_BUFFERING;
-  else
-    flags = FILE_ATTRIBUTE_NORMAL;
-#else
-  if (mode & FIO_DIRECT)
-    return -1; /* not supported yet */
-#endif
-
-  sharing = 0;       /* disallow sharing with other processes  */
-  security = NULL;   /* child processes don't inherit anything */
-
-  /* since we never append, blow away anything that's already there */
-  if (mode & FIO_WRITE)
-    createmode = CREATE_ALWAYS;
-  else 
-    createmode = OPEN_EXISTING;
-
-  fp = CreateFile(winfilename, access, sharing, security, 
-                  createmode, flags, NULL);
-
-  if (fp == NULL) {
-    return -1;
-  } else {
-    *fd = fp;
-    return 0;
-  }
-}
-
-
-static int fio_fclose(fio_fd fd) {
-  BOOL rc;
-  rc = CloseHandle(fd);
-  if (rc) 
-    return 0;
-  else 
-    return -1;
-}
-
-static fio_size_t fio_fread(void *ptr, fio_size_t size, 
-                            fio_size_t nitems, fio_fd fd) {
-  BOOL rc;
-  DWORD len;
-  DWORD readlen;
-
-  len = size * nitems;
-
-  rc = ReadFile(fd, ptr, len, &readlen, NULL);
-  if (rc) {
-    if (readlen == len)
-      return nitems;
-    else 
-      return 0;
-  } else {
-    return 0;
-  }
-}
-
-static fio_size_t fio_readv(fio_fd fd, const fio_iovec * iov, int iovcnt) {
-  int i;
-  fio_size_t len = 0; 
-
-  for (i=0; i<iovcnt; i++) {
-    fio_size_t rc = fio_fread(iov[i].iov_base, iov[i].iov_len, 1, fd);
-    if (rc != 1)
-      break;
-    len += iov[i].iov_len;
-  }
-
-  return len;
-}
-
-static fio_size_t fio_fwrite(void *ptr, fio_size_t size, 
-                             fio_size_t nitems, fio_fd fd) {
-  BOOL rc;
-  DWORD len;
-  DWORD writelen;
-
-  len = size * nitems; 
- 
-  rc = WriteFile(fd, ptr, len, &writelen, NULL);
-  if (rc) {
-    if (writelen == len)
-      return nitems;
-    else
-      return 0;
-  } else {
-    return 0;
-  }
-}
-
-static fio_size_t fio_fseek(fio_fd fd, fio_size_t offset, int whence) {
-#if 1
-  /* code that works with older MSVC6 compilers */
-  LONGLONG finaloffset;
-  LARGE_INTEGER bigint;
-  LARGE_INTEGER finalint;
-
-  bigint.QuadPart = offset;
-  finalint = bigint;      /* set the high part, which will be overwritten */
-  finalint.LowPart = SetFilePointer(fd, bigint.LowPart, &finalint.HighPart, whence);
-  if (finalint.LowPart == -1) {
-    /* if (finalint.LowPart == INVALID_SET_FILE_POINTER) { */
-    /* INVALID_SET_FILE_POINTER is a possible "ok" low order result when */
-    /* working with 64-bit offsets, so we have to also check the system  */
-    /* error value for this thread to be sure */
-    if (GetLastError() != ERROR_SUCCESS) {
-      return -1;
-    }
-  } 
-
-  finaloffset = finalint.QuadPart;
-  return 0;
-#else
-  BOOL rc;
-  LONGLONG finaloffset;
-
-  /* SetFilePointerEx() only exists with new .NET compilers */
-  rc = SetFilePointerEx(fd, offset, &finaloffset, whence);
-
-  if (rc) 
-    return 0;
-  else
-    return -1;
-#endif
-}
-
-static fio_size_t fio_ftell(fio_fd fd) {
-  /* code that works with older MSVC6 compilers */
-  LONGLONG finaloffset;
-  LARGE_INTEGER bigint;
-  LARGE_INTEGER finalint;
-
-  bigint.QuadPart = 0;
-  finalint = bigint;      /* set the high part, which will be overwritten */
-
-  finalint.LowPart = SetFilePointer(fd, bigint.LowPart, &finalint.HighPart, FILE_CURRENT);
-  if (finalint.LowPart == -1) {
-    /* if (finalint.LowPart == INVALID_SET_FILE_POINTER) { */
-    /* INVALID_SET_FILE_POINTER is a possible "ok" low order result when */
-    /* working with 64-bit offsets, so we have to also check the system  */
-    /* error value for this thread to be sure */
-    if (GetLastError() != ERROR_SUCCESS) {
-      return -1;
-    }
-  }
-
-  finaloffset = finalint.QuadPart;
-
-  return finaloffset;
-}
-
-
-#else
-
-/* Version for machines with plain old ANSI C  */
-
-#include <stdio.h>
-#include <string.h>
-
-typedef FILE * fio_fd;
-typedef size_t fio_size_t;  /* MSVC doesn't uinversally support ssize_t */
-typedef void * fio_caddr_t; /* MSVC doesn't universally support caddr_t */
-
-typedef struct {
-  fio_caddr_t iov_base;
-  int iov_len;
-} fio_iovec;
-
-#define FIO_SEEK_CUR SEEK_CUR
-#define FIO_SEEK_SET SEEK_SET
-#define FIO_SEEK_END SEEK_END
-
-static int fio_open(const char *filename, int mode, fio_fd *fd) {
-  char * modestr;
-  FILE *fp;
-
-  if (mode & FIO_READ) 
-    modestr = "rb";
-
-  if (mode & FIO_WRITE) 
-    modestr = "wb";
-
-  if (mode & FIO_DIRECT)
-    return -1; /* not supported yet */
- 
-  fp = fopen(filename, modestr);
-  if (fp == NULL) {
-    return -1;
-  } else {
-    *fd = fp;
-    return 0;
-  }
-}
-
-static int fio_fclose(fio_fd fd) {
-  return fclose(fd);
-}
-
-static fio_size_t fio_fread(void *ptr, fio_size_t size, 
-                            fio_size_t nitems, fio_fd fd) {
-  return fread(ptr, size, nitems, fd);
-}
-
-static fio_size_t fio_readv(fio_fd fd, const fio_iovec * iov, int iovcnt) {
-  int i;
-  fio_size_t len = 0; 
-
-  for (i=0; i<iovcnt; i++) {
-    fio_size_t rc = fread(iov[i].iov_base, iov[i].iov_len, 1, fd);
-    if (rc != 1)
-      break;
-    len += iov[i].iov_len;
-  }
-
-  return len;
-}
-
-static fio_size_t fio_fwrite(void *ptr, fio_size_t size, 
-                             fio_size_t nitems, fio_fd fd) {
-  return fwrite(ptr, size, nitems, fd);
-}
-
-static fio_size_t fio_fseek(fio_fd fd, fio_size_t offset, int whence) {
-  return fseek(fd, offset, whence);
-}
-
-static fio_size_t fio_ftell(fio_fd fd) {
-  return ftell(fd);
-}
-#endif /* plain ANSI C */
-
-#else 
-
-/* Version for UNIX machines */
-#if defined(__linux)
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE            /* required for O_DIRECT */
-#endif
-#endif
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-typedef int fio_fd;
-typedef off_t fio_size_t;      /* off_t is 64-bits with LFS builds */
-
-/*
- * Enable use of kernel readv() if available and reliable
- *
- * Note: Some Linux implementations incorporate readv() code in libc 
- * that does userspace copying of I/O vectors to internal temporary
- * buffers in order to meet the atomicity requirements of the POSIX standard.
- * Such copies make the use of vectorized I/O APIs much less useful for
- * large trajectory files because the internal buffer allocations can fail
- * badly when performing large aggregate I/O operations.  It may be that
- * other implementations of vector I/O have similar problems, and in these
- * cases it is probably best not to use it at all, and to fall back to 
- * non-vectorized I/O APIs to avoid such extra copies.
- */
-#if defined(__sun) || defined(__APPLE_CC__) || defined(__linux)
-#define USE_KERNEL_READV 1
-#endif
-
-typedef void * fio_caddr_t;
-
-#if defined(USE_KERNEL_READV)
-#include <errno.h>
-#include <sys/uio.h>
-typedef struct iovec fio_iovec;
-#else
-
-typedef struct {
-  fio_caddr_t iov_base;
-  int iov_len;
-} fio_iovec;
-#endif
-
-#define FIO_SEEK_CUR SEEK_CUR
-#define FIO_SEEK_SET SEEK_SET
-#define FIO_SEEK_END SEEK_END
-
-static int fio_open(const char *filename, int mode, fio_fd *fd) {
-  int nfd;
-  int oflag = 0;
-  
-  if (mode & FIO_READ) 
-    oflag = O_RDONLY;
-
-  if (mode & FIO_WRITE) 
-    oflag = O_WRONLY | O_CREAT | O_TRUNC;
-
-#if defined(__linux)
-  /* enable direct I/O, requires block-aligned buffers and I/O sizes */
-  if (mode & FIO_DIRECT)
-    oflag |= O_DIRECT;
-#else
-  if (mode & FIO_DIRECT)
-    return -1; /* not supported yet */
-#endif
-
-  nfd = open(filename, oflag, 0666);
-  if (nfd < 0) {
-    return -1;
-  } else {
-    *fd = nfd;
-    return 0;
-  }
-}
-
-static int fio_fclose(fio_fd fd) {
-  return close(fd);
-}
-
-static fio_size_t fio_fread(void *ptr, fio_size_t size, 
-                            fio_size_t nitems, fio_fd fd) {
-  fio_size_t i;
-  fio_size_t len = 0; 
-  fio_size_t cnt = 0;
-
-#if 1
-  /*
-   * On Linux individual calls to read() can end up doing short reads when
-   * reading more than 2GB in a single read call, even on 64-bit machines.  
-   * For large structures, e.g. 240M-atoms or larger, we have to use a loop
-   * to continue reading into the memory buffer until completion.
-   */ 
-  for (i=0; i<nitems; i++) {
-    fio_size_t szleft = size;
-    fio_size_t rc = 0;
-    for (szleft=size; szleft > 0; szleft -= rc) {
-      rc = read(fd, ((char*) ptr) + (cnt*size) + (size-szleft), szleft);
-       if (rc == 0) {
-          return cnt;  /* end of file scenario */
-       }
-//      if (rc != szleft) {
-//        printf("fio_fread(): rc %ld  sz: %ld\n", rc, szleft);
-//      }
-      if (rc < 0) {
-        printf("fio_fread(): rc %ld  sz: %ld\n", rc, size);
-        perror("  perror fio_fread(): ");
-        break;
-      }
-    }
-    len += rc;
-    cnt++;
-  }
-#else
-  for (i=0; i<nitems; i++) {
-    fio_size_t rc = read(fd, (void*) (((char *) ptr) + (cnt * size)), size);
-    if (rc != size) {
-//      printf("fio_fread(): rc %ld  sz: %ld\n", rc, size);
-//      perror("  perror fio_fread(): ");
-      break;
-    }
-    len += rc;
-    cnt++;
-  }
-#endif
-
-  return cnt;
-}
-
-static fio_size_t fio_readv(fio_fd fd, const fio_iovec * iov, int iovcnt) {
-  fio_size_t len;
-  int i;
-
-#if 0
-  fio_size_t tlen;
-  for (tlen=0,i=0; i<iovcnt; i++) {
-    tlen += iov[i].iov_len;
-  }
-
-#if defined(USE_KERNEL_READV)
-  len = readv(fd, iov, iovcnt);
-  if (len != tlen) {
-    printf("fio_readv(): readv() rc: %ld  sz: %ld\n", len, tlen);
-    printf("fio_readv(): readv() errno %d\n", errno);
-  }
-
-  if ((len < 0 && errno == ENOSYS) ||
-      (len != tlen && errno == EINVAL)) 
-#endif
-  {
-    /* XXX this loop doesn't meet the atomicity requirements of
-     *     real POSIX readv(), since we don't need that feature 
-     */
-    len = 0; 
-    for (i=0; i<iovcnt; i++) {
-      void *ptr = iov[i].iov_base;
-      fio_size_t sz = iov[i].iov_len;
-      fio_size_t szleft = sz;
-      fio_size_t rc=0;
-
-      for (szleft=sz; szleft > 0; szleft -= rc) {
-        rc = read(fd, ((char*) ptr)+(sz-szleft), szleft);
-        if (rc == 0) {
-          return len;  /* end of file scenario */
-        }
-        if (rc != szleft) {
-          printf("fio_readv(): read() rc %ld  sz: %ld\n", rc, szleft);
-        }
-        if (rc < 0) {
-          printf("fio_readv(): read() rc %ld  sz: %ld\n", rc, szleft);
-          perror("  perror fio_readv(): ");
-          break;
-        }
-      }
-      len += iov[i].iov_len;
-    }
-  }
-#else
-#if defined(USE_KERNEL_READV)
-  len = readv(fd, iov, iovcnt);
-  if (len < 0 && errno == ENOSYS)
-#endif
-  {
-    /* XXX this loop doesn't meet the atomicity requirements of
-     *     real POSIX readv(), since we don't need that feature 
-     */
-    len = 0; 
-    for (i=0; i<iovcnt; i++) {
-      fio_size_t rc = read(fd, iov[i].iov_base, iov[i].iov_len);
-      if (rc != iov[i].iov_len)
-        break;
-      len += iov[i].iov_len;
-    }
-  }
-#endif
-
-  return len;
-}
-
-static fio_size_t fio_fwrite(void *ptr, fio_size_t size, 
-                             fio_size_t nitems, fio_fd fd) {
-  fio_size_t i;
-  fio_size_t len = 0; 
-  fio_size_t cnt = 0;
-
-#if 1
-  /*
-   * On Linux individual calls to write() can end up doing short writes when
-   * writing more than 2GB in a single write call, even on 64-bit machines.  
-   * For large structures, e.g. 240M-atoms or larger, we have to use a loop
-   * to continue writing the memory buffer until completion.
-   */ 
-  int writecalls=0;
-  for (i=0; i<nitems; i++) {
-    fio_size_t szleft = size;
-    fio_size_t rc = 0;
-    for (szleft=size; szleft > 0; szleft -= rc) {
-      fio_size_t writesz = szleft;
-
-#if 0
-      /* On some kernel versions write calls beyond 2GB may not do */
-      /* a partial write and may just return an error immediately. */
-      /* Clamp maximum write size to 1GB per write call.           */
-      if (writesz > (1024L * 1024L * 1024L))
-        writesz = (1024L * 1024L * 1024L);
-#endif
-
-      writecalls++;
-      rc = write(fd, ((char*) ptr)+(size-szleft), writesz);
-      if (rc < 0) {
-        printf("fio_fwrite(): rc %ld  sz: %ld  szleft: %ld  calls: %d\n", 
-               rc, size, szleft, writecalls);
-        perror("  perror fio_fwrite(): ");
-        return cnt;
-      }
-    }
-    len += rc;
-    cnt++;
-  }
-#else
-  for (i=0; i<nitems; i++) {
-    fio_size_t rc = write(fd, ptr, size);
-    if (rc != size) {
-      printf("fio_fwrite(): rc %ld  sz: %ld\n", rc, size);
-      perror("  perror fio_fwrite(): ");
-      break;
-    }
-    len += rc;
-    cnt++;
-  }
-#endif
-
-  return cnt;
-}
-
-static fio_size_t fio_fseek(fio_fd fd, fio_size_t offset, int whence) {
- if (lseek(fd, offset, whence) >= 0)
-   return 0;  /* success (emulate behavior of fseek) */
- else 
-   return -1; /* failure (emulate behavior of fseek) */
-}
-
-static fio_size_t fio_ftell(fio_fd fd) {
-  return lseek(fd, 0, SEEK_CUR);
-}
-
-#endif
-
-
-/* higher level routines that are OS independent */
-
-static int fio_write_int32(fio_fd fd, int i) {
-  return (fio_fwrite(&i, 4, 1, fd) != 1);
-}
-
-static int fio_read_int32(fio_fd fd, int *i) {
-  return (fio_fread(i, 4, 1, fd) != 1);
-}
-
-static int fio_write_str(fio_fd fd, const char *str) {
-  int len = strlen(str);
-  return (fio_fwrite((void *) str, len, 1, fd) != 1);
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fortread.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fortread.h
deleted file mode 100644
index 6fad94d80f7eb2ac7b53086509d13965f9d72699..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fortread.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: fortread.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.10 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Unformatted and formatted fortran file reading routines for
- *   use in various plugins to simplify dealing with fortran i/o quirks.
- ***************************************************************************/
-
-#ifndef FORTREAD_H
-#define FORTREAD_H
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "endianswap.h"
-
-#define FORT_RECLEN_32BIT 4
-#define FORT_RECLEN_64BIT 8
-
-/*
- * consume a record length marker
- */
-static int fort_eat_recmark(FILE *ifp, int recmarklen) {
-  int tmp;
-  if (recmarklen == FORT_RECLEN_64BIT) {
-    if (fread(&tmp, 4, 1, ifp) != 1) 
-      return -1;
-    if (fread(&tmp, 4, 1, ifp) != 1) 
-      return -1;
-  } else {
-    if (fread(&tmp, 4, 1, ifp) != 1) 
-      return -1;
-  }
-
-  return 0;
-}
-
-/*
- * Determine endianness and length of Fortran 
- * record length markers within unformatted binary files.
- */
-static int fort_get_endian_reclen(int reclen, int word0, int word1, 
-                                  int *swap, int *recmarklen) {
-  /* check for 32-bit record length markers */
-  if (reclen == word0) {
-    *swap=0;
-    *recmarklen=FORT_RECLEN_32BIT;
-    return 0;
-  } else {
-    int tmp = word0;
-    swap4_aligned(&tmp, 1);   
-    if (tmp == reclen) {
-      *swap=0;
-      *recmarklen=FORT_RECLEN_32BIT;
-      return 0;
-    }
-  }
-  
-  /* check for 64-bit record length markers */ 
-  if (reclen == (word0+word1)) {
-    *swap=0;
-    *recmarklen=FORT_RECLEN_64BIT;
-  } else {
-    int tmp0=word0;
-    int tmp1=word1;
-    swap4_aligned(&tmp0, 1);   
-    swap4_aligned(&tmp1, 1);   
-    *swap=1;
-    *recmarklen=FORT_RECLEN_64BIT;
-  }
-    
-  return -1; /* completely unrecognized record length marker */
-}
-
-
-
-/*  Unformatted reads.
- *
- *   Each function reads the next record from the file (provided it contains
- *   no more than n elements), optionally swapping its contents before
- *   writing it into dest. 
- *   Returns the number of elements on success, 0 on failure.
- *
- *   TODO: These should perhaps rewind the file to the beginning of the
- *   record on failure.
- */
-
-/* Only works with aligned four-byte quantities, swap4_aligned() will */
-/* cause a bus error on sume platforms if used on unaligned data      */
-static int fortread_4(void *dest, int n, int swap, FILE *fd) {
-  int dataBegin, dataEnd, count;
-
-  if (fread(&dataBegin, sizeof(int), 1, fd) != 1) return 0;
-  if (swap) swap4_aligned(&dataBegin, 1);
-  if ((dataBegin <= 0) || (n < dataBegin/4)) return 0;
-
-  count = fread(dest, 4, dataBegin/4, fd);
-  if (count != dataBegin/4) return 0;
-  if (swap) swap4_aligned(dest, dataBegin/4);
-
-  if (fread(&dataEnd, sizeof(int), 1, fd) != 1) return 0;
-  if (swap) swap4_aligned(&dataBegin, 1);
-  if (dataEnd != dataBegin) return 0;
-
-  return count;
-}
-
-/* Formatted reads:
- *
- * copy at most 'len' characters from source to target. 
- *
- * leading white space is skipped over but counts towards 'len'.
- * the copy stops at first whitspace or a '\0'.
- * unlike strncpy(3) the result will always be \0 terminated.
- *
- * intended for copying (short) strings from formatted fortran  
- * i/o files that must not contain whitespace (e.g. residue names, 
- * atom name/types etc. in .pdb, .psf and alike.). 
- */
-static void strnwscpy(char *target, const char *source, const int len) {
-  int i, c;
-
-  for (i=0, c=0; i<len; ++i) {
-    if (*source == '\0' || (c > 0 && *source == ' ')) {
-      break;
-    }
-
-    if (*source == ' ') { 
-      source++;
-    } else {
-      *target++ = *source++;
-      c++;
-    }
-  }
-  *target = '\0';
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fs4plugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fs4plugin.C
deleted file mode 100644
index bb6e79bd42909722659f8a0339c701fde5c9487b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/fs4plugin.C
+++ /dev/null
@@ -1,374 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: fs4plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * fsfour format density maps
- *
- * More info for this format can be found at 
- * <http://www.csb.yale.edu/userguides/datamanip/phases/FSFOUR.html>
- *
- * Old versions of the cns2fsfour and ccp2fsfour utilities produced a
- * slightly broken variant of this format, omitting the data that isn't used
- * by XTalView. This plugin currently reads these files, but the cell
- * dimensions will be incorrect.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-#include "fortread.h"
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int swap;
-  int f, m, s, x, y, z; // indecies mapping fast-medium-slow to x-y-z
-  float scale;
-  molfile_volumetric_t *vol;
-} fs4_t;
-
-
-static void *open_fs4_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  fs4_t *fs4;
-  FILE *fd;
-  float header[32], scale, fmsCellSize[3], alpha, beta, gamma, z1, z2, z3;
-  int dataBegin, blocksize, geom[16], fmsGridSize[3], norn, swap=0;
-
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "fs4plugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // Use the first four-byte integer in the file to determine the file's
-  // byte-order
-  fread(&dataBegin, sizeof(int), 1, fd);
-  if (dataBegin > 255) {
-    // check if the bytes need to be swapped
-    swap4_aligned(&dataBegin, 1);
-    if (dataBegin <= 255) {
-      swap = 1;
-    } else {
-      fprintf(stderr, "fs4plugin) Cannot read file: header block is too large.\n");
-      return NULL;
-    }
-  }
-
-  // Read the header
-  rewind(fd);
-  blocksize = fortread_4(header, 32, swap, fd);
-
-  // Handle files produced by old versions of (cns|ccp)2fsfour
-  if (blocksize == 28) {
-    printf("fs4plugin) Recognized %s cns2fsfour map.\n", 
-        swap ? "opposite-endian" : "same-endian");
-
-    // Read the geometry block
-    blocksize = fortread_4(geom, 16, swap, fd);
-    if (blocksize != 7) {
-      fprintf(stderr, "fs4plugin) Incorrect size for geometry block.\n");
-      return NULL;
-    }
-
-    fmsGridSize[0] = geom[0];
-    fmsGridSize[1] = geom[1];
-    fmsGridSize[2] = geom[2];
-    norn = geom[4];
-
-    // Warn about assumptions
-    printf("fs4plugin) Warning: file does not contain unit cell lengths or angles.\n");
-
-    scale = 50.0;
-    fmsCellSize[0] = 1.0;
-    fmsCellSize[1] = 1.0;
-    fmsCellSize[2] = 1.0;
-    alpha = 90.0;
-    beta = 90.0;
-    gamma = 90.0;
-  }
-
-  // Handle standard fsfour files
-  else if (blocksize == 31) {
-    printf("fs4plugin) Recognize standard fsfour map.\n");
-
-    fmsCellSize[0] = header[21];
-    fmsCellSize[1] = header[22];
-    fmsCellSize[2] = header[23];
-    alpha = header[24];
-    beta = header[25];
-    gamma = header[26];
-    
-    // Skip the symmetry block if one present
-    blocksize = fortread_4(geom, 16, swap, fd);
-    if (blocksize == 9) {
-      printf("fs4plugin) Skipping symmetry block.\n");
-      blocksize = fortread_4(geom, 16, swap, fd);
-    }
-
-    // Read the geometry block
-    if (blocksize != 13) {
-      fprintf(stderr, "fs4plugin) Incorrect size for geometry block.\n");
-      return NULL;
-    }
-
-    fmsGridSize[0] = geom[0];
-    fmsGridSize[1] = geom[1];
-    fmsGridSize[2] = geom[2];
-
-    scale = *((float *) geom + 3);
-    if (scale == 0) {
-      scale = 50;
-    }
-
-    norn = geom[4];
-    if ((norn < 0) || (norn > 2)) {
-      fprintf(stderr, "fs4plugin) norn out of range.\n");
-      return NULL;
-    }
-  }
-
-  // Unrecognized format
-  else {
-    fprintf(stderr, "fs4plugin) Unrecognized map format.\n");
-    return NULL;
-  }
-
-  // Convert degrees to radians
-  alpha *= M_PI / 180.0;
-  beta  *= M_PI / 180.0;
-  gamma *= M_PI / 180.0;
-
-  // Warn about assumptions
-  printf("fs4plugin) Warning: file does not contain molecule center.\nCentering at <0, 0, 0>\n");
-
-  // Allocate and initialize the fs4 structure
-  fs4 = new fs4_t;
-  fs4->fd = fd;
-  fs4->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  fs4->nsets = 1; // this file contains only one data set
-  fs4->swap = swap;
-  fs4->scale = scale;
-  if (norn == 0) {
-    // x fast, z medium, y slow
-    fs4->x = 0;
-    fs4->y = 2;
-    fs4->z = 1;
-    fs4->f = 0;
-    fs4->m = 2;
-    fs4->s = 1;
-  }
-  else if (norn == 1) {
-    // y fast, z medium, x slow
-    fs4->x = 2;
-    fs4->y = 0;
-    fs4->z = 1;
-    fs4->f = 1;
-    fs4->m = 2;
-    fs4->s = 0;
-  }
-  else { // norn ==2
-    // x fast, y medium, z slow
-    fs4->x = 0;
-    fs4->y = 1;
-    fs4->z = 2;
-    fs4->f = 0;
-    fs4->m = 1;
-    fs4->s = 2;
-  }
-
-  fs4->vol = new molfile_volumetric_t[1];
-  strcpy(fs4->vol[0].dataname, "Fsfour Electron Density Map");
-
-  // Place the origin at {0 0 0}
-  fs4->vol[0].origin[0] = 0.0;
-  fs4->vol[0].origin[1] = 0.0;
-  fs4->vol[0].origin[2] = 0.0;
-
-  fs4->vol[0].xaxis[0] = fmsCellSize[0];
-  fs4->vol[0].xaxis[1] = 0.0;
-  fs4->vol[0].xaxis[2] = 0.0;
-
-  fs4->vol[0].yaxis[0] = cos(gamma) * fmsCellSize[1];
-  fs4->vol[0].yaxis[1] = sin(gamma) * fmsCellSize[1];
-  fs4->vol[0].yaxis[2] = 0.0;
- 
-  z1 = cos(beta);
-  z2 = (cos(alpha) - cos(beta)*cos(gamma)) / sin(gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  fs4->vol[0].zaxis[0] = z1 * fmsCellSize[2];
-  fs4->vol[0].zaxis[1] = z2 * fmsCellSize[2];
-  fs4->vol[0].zaxis[2] = z3 * fmsCellSize[2];
-
-  fs4->vol[0].xsize = fmsGridSize[fs4->x];
-  fs4->vol[0].ysize = fmsGridSize[fs4->y];
-  fs4->vol[0].zsize = fmsGridSize[fs4->z];
-
-  fs4->vol[0].has_color = 0;
-
-  return fs4;
-}
-
-
-static int read_fs4_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  fs4_t *fs4 = (fs4_t *)v;
-  *nsets = fs4->nsets; 
-  *metadata = fs4->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_fs4_data(void *v, int set, float *dstBlock, 
-                         float *colorblock) {
-  fs4_t *fs4 = (fs4_t *) v;
-  int *srcBlock, index;
-  int col, row, plane, colSize, rowSize, planeSize;
-  int xyzGridSize[3], xyzIndexIncrement[3];
-
-  xyzGridSize[0] = fs4->vol[0].xsize;
-  xyzGridSize[1] = fs4->vol[0].ysize;
-  xyzGridSize[2] = fs4->vol[0].zsize;
-  xyzIndexIncrement[0] = 1;
-  xyzIndexIncrement[1] = xyzGridSize[0];
-  xyzIndexIncrement[2] = xyzGridSize[0] * xyzGridSize[1];
-
-  colSize = xyzGridSize[fs4->f];
-  rowSize = xyzGridSize[fs4->m];
-  planeSize = xyzGridSize[fs4->s];
-
-  srcBlock = new int[colSize];
-
-  index = 0;
-  for (plane = 0; plane < planeSize; plane++) {
-    for (row = 0; row < rowSize; row++) {
-
-      // Read one row of data
-      if (fortread_4(srcBlock, colSize, fs4->swap, fs4->fd) != colSize) {
-        fprintf(stderr, "fs4plugin) Error reading data: incorrect record size.\n");
-        delete [] srcBlock;
-        return MOLFILE_ERROR;
-      }
-
-      for (col = 0; col < colSize; col++) {
-        dstBlock[index] = (float) srcBlock[col] / fs4->scale;
-        index += xyzIndexIncrement[fs4->f];
-      }
-
-      index += xyzIndexIncrement[fs4->m] - colSize*xyzIndexIncrement[fs4->f];
-    } // end for (row)
-
-    index += xyzIndexIncrement[fs4->s] - rowSize*xyzIndexIncrement[fs4->m];
-  } // end for (plane)
-
-  delete [] srcBlock;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_fs4_read(void *v) {
-  fs4_t *fs4 = (fs4_t *)v;
-
-  fclose(fs4->fd);
-  if (fs4->vol != NULL)
-    delete [] fs4->vol; 
-  delete fs4;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "fs";
-  plugin.prettyname = "FS4 Density Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "fs,fs4";
-  plugin.open_file_read = open_fs4_read;
-  plugin.read_volumetric_metadata = read_fs4_metadata;
-  plugin.read_volumetric_data = read_fs4_data;
-  plugin.close_file_read = close_fs4_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-#ifdef TEST_FS4_PLUGIN
-
-int main(int argc, char **argv) {
-  fs4_t *fs4;
-  int natoms;
-  char *filetype;
-  float *datablock;
-  
-  while (--argc) {
-    ++argv;
-
-    fs4 = (fs4_t*) open_fs4_read(*argv, "fs", &natoms);
-    if (!fs4) {
-      fprintf(stderr, "open_fs4_read failed for file %s\n", *argv);
-      return 1;
-    }
-
-    printf("a:\t%f\nb:\t%f\nc:\t%f\n",
-           fs4->vol[0].xaxis[0], fs4->vol[0].yaxis[1], fs4->vol[0].zaxis[2]);
-    printf("ncol:\t%d\nnrow:\t%d\nnplane:\t%d\n", 
-           fs4->vol[0].xsize, fs4->vol[0].ysize, fs4->vol[0].zsize);
-
-    datablock = new float[fs4->vol[0].xsize * fs4->vol[0].ysize * 
-                          fs4->vol[0].zsize];
-
-    if (read_fs4_data(fs4, 0, datablock, NULL) != 0) {
-      fprintf(stderr, "read_fs4_data failed for file %s\n", *argv);
-      return 1;
-    }
-
-    delete [] datablock;
-  }
-
-  return 0;
-}
-
-# endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gamessplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gamessplugin.c
deleted file mode 100644
index 77ae2ada8d77e12a13456e68a058a4c83a4b926b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gamessplugin.c
+++ /dev/null
@@ -1,4885 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gamessplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.211 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* *******************************************************
- *
- *          G A M E S S     P L U G I N 
- *
- * Read GAMESS-US log files.
- * This file reader is fairly robust and should be able to 
- * parse GAMESS logfiles from a wide range of versions
- * (2000-2009 tested). 
- * From the variety of data that can be found in GAMESS
- * logfiles we read coordinates, basis set, wavefunctions, 
- * gradients, hessian, charges, frequencies and a number 
- * of data describing the type of calculation.
- *
- * ********************************************************/
-
-
-/**********************************************************
-
- 
-FUNCTION CALL CHAIN
-===================
-
-Below is an overview about the hierarchy of function calls.
-Not all functions or possible branches are listed but the
-general picture is covered.
-
-The top level consists of functions defined by the 
-molfile_plugin interface: First VMD calls open_gamess_read()
-then it requests information about atoms and topology using 
-read_gamess_structure(). Note that no coordinates are provided
-at this step. Timestep independent data such as info about the
-calculation method or the basis set are provided through 
-read_gamess_rundata(). Since the allocation of these
-arrays populated for this purpose is done by VMD rather than
-the plugin, VMD needs to know the sizes beforehand. This is 
-achieved by calling read_qm_metadata() before read_qm_rundata().
-
-Next, in order to obtain the info for all timesteps VMD will call
-read_timestep_metadata(), read_qm_timestep_metadata(), and
-read_timestep() repeatedly until read_timestep() returns
-MOLFILE_ERROR indicating the end of the trajectory.
-Here too, the metadata are transferred before the main chunk
-of data.
-
-Finally, VMD calls close_gamess_read() which frees the temporary
-memory used by the plugin and closes the file.
-
-
-VMD
- |__ open_gamess_read()
- |    |__ parse_static_data()
- |        |__ get_proc_mem()
- |        |__ get_basis_options()
- |        |__ get_runtitle()
- |        |__ get_contrl()
- |        |__ get_input_structure()
- |        |    |__ get_coordinates()
- |        |
- |        |__ get_basis()
- |        |    |__ read_shell_primitives()
- |        |    |__ fill_basis_arrays()
- |        |
- |        |__ get_basis_stats()
- |        |__ get_properties_input()
- |        |__ get_int_coords()
- |        |__ get_symmetry()
- |        |__ get_guess_options()
- |        |__ get_mcscf()
- |        |__ analyze_traj()
- |        |__ read_first_frame()
- |        |    |__get_traj_frame()
- |        |        |__get_coordinates()
- |        |        |__get_scfdata()
- |        |        |__check_add_wavefunctions()
- |        |        |   |__add_wavefunction()
- |        |        |   |__get_wavefunction()
- |        |        |   |   |__read_coeff_block()
- |        |        |   |       |__angular_momentum_expon()
- |        |        |   |
- |        |        |   |__del_wavefunction()
- |        |        |
- |        |        |__get_population()
- |        |        |__get_gradient()
- |        |
- |        |__ get_final_properties()
- |             |__ get_population()
- |             |__ get_esp_charges()
- |             |__ get_final_gradient()
- |             |__ get_int_hessian()
- |             |__ get_cart_hessian()
- |             |__ get_normal_modes()
- |             |__ read_localized_orbitals()
- |        
- |
- |__ read_gamess_structure()
- |
- |__ read_gamess_metadata()
- |
- |__ read_gamess_rundata()
- |
- |
- |  DO:                         <----.
- |__ read_timestep_metadata()        |
- |__ read_qm_timestep_metadata()     |
- |__ read_timestep()                 |
- |                                   |
- |  WHILE(FRAMES)               -----' 
- |
- |
- |__ close_gamess_read()
-
- 
-
-PARSING STRATEGY
-================
-
-Because we potentially have to read quite a bit into the
-logfile in order to obtain the number of atoms required by 
-open_gamess_read(), we just parse the whole file and store 
-all timestep independent data. This process is managed by 
-parse_static_data(). Some of the static data are at the end
-of the file. Function analyze_traj() find the end of the
-trajectory and records the file pointer for the beginning
-of each frame. Thus, reading the frames when they are requested 
-later by read_timestep() is much faster without having to  
-keep large amountss of data in memory.
-
-
-**********************************************************/
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-
-#include "qmplugin.h"
-#include "unit_conversion.h"
-#include "periodic_table.h"
-
-#define ANGSTROM 0
-#define BOHR     1
-
-
-/* #define DEBUGGING 1 */
-
-/*
- * Error reporting macro for use in DEBUG mode
- */
-
-#ifdef DEBUGGING
-#define PRINTERR fprintf(stderr, "\n In file %s, line %d: \n %s \n \n", \
-                            __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-
-
-#define NOTFOUND 0
-#define FOUND    1
-#define STOPPED  2
-
-
-#define GAMESSUNKNOWN      0
-#define GAMESSPRE20050627  1
-#define GAMESSPOST20050627 2
-#define FIREFLY8PRE6695    3
-#define FIREFLY8POST6695   4
-
-/* Data specific to parsing GAMESS files */
-typedef struct 
-{
-  int  version; /* here we track the GAMESS versions, since the
-                 * file format has changed with 
-                 * version 27 JUN 2005 (R2);
-                 * version = 1  : pre-27 JUN 2005 (R2)
-                 * version = 2  : 27 JUN 2005 (R2) or later
-                 * version = 0  : version unrecognized;
-                 *                file will not be read */
-
-  int have_pcgamess; /* this flag is set to 1 if the output
-                      * file is recognized as a PC Gamess output
-                      * file; we might need to introduce a few
-                      * switches in the code depending on if
-                      * the log file is plain Gamess or PC Gamess
-                      */
-
-  int have_fmo;      /* set to 1 if this is an FMO calculation */
-
-} gmsdata;
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-/* this routine is the main gamess log file
- * parser responsible for static, i.e. 
- * non-trajectory information */
-static int parse_static_data(qmdata_t *, int *);
-
-/* for debugging */
-static void print_input_data(qmdata_t *);
-
-/* this routine checks if the current run is an
- * actual GAMESS run; returns true/false */
-static int have_gamess(qmdata_t *, gmsdata *);
-
-/* this function reads the number of processors requested */
-static int get_proc_mem(qmdata_t *, gmsdata *);
-
-/* Parse the $BASIS options*/
-static int get_basis_options(qmdata_t *);
-
-/* Determine the run title line */
-static int get_runtitle(qmdata_t *);
-
-/* Read the input atom definitions and geometry */
-static int get_input_structure(qmdata_t *data, gmsdata *gms);
-
-/* Read basis set and orbital statistics such as
- * # of shells, # of A/B orbitals, # of electrons, 
- * multiplicity and total charge */
-static int get_basis_stats(qmdata_t *);
-
-/* Read the contrl group for firefly calc and check for
- * supported RUNTYPes. Terminate the plugin
- * if an unsupported one is encountered. */
-static int get_contrl_firefly(qmdata_t *);
-
-/* Read the contrl group and check for
- * supported RUNTYPes. Terminate the plugin
- * if an unsupported one is encountered. */
-static int get_contrl(qmdata_t *);
-
-/* Read input parameters regarding calculation of 
- * certain molecular properties such as electrostatic
- * moments and the MEP. */
-static int get_properties_input(qmdata_t *);
-
-/* Read symmetry point group and highest axis */
-static int get_symmetry(qmdata_t *);
-
-/* Read in the $GUESS options */
-static int get_guess_options(qmdata_t *);
-
-/* Read MCSCF data */
-static int get_mcscf(qmdata_t *data);
-
-/* the function get_initial_info provides the atom number,
- * coordinates, and atom types and stores them
- * temporarily. */ 
-static int get_final_properties (qmdata_t *);
-
-/* Read atom coordinate block */
-static int get_coordinates(FILE *file, qm_atom_t **atoms, int unit,
-                           int *numatoms);
-
-/* Read coordinates from $FMOXYZ section in the INPUT CARD
- * listing at the beginning of the file. */
-static int get_fmoxyz(FILE *file, qm_atom_t **atoms, int unit,
-                      int *numatoms);
-
-/* Read the basis set data */
-static int get_basis (qmdata_t *);
-
-/* Read all primitives for the current shell */
-static int read_shell_primitives(qmdata_t *, prim_t **prim,
-                                 char *shelltype, int icoeff, int pcgamess);
-
-/* convert shell type from char to int */
-static int shelltype_int(char type);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(qmdata_t *);
-
-/* Read the first trajectory frame. */
-static int read_first_frame(qmdata_t *);
-
-/* Read next trajectory frame. */
-static int get_traj_frame(qmdata_t *, qm_atom_t *, int);
-
-/* returns 1 if the optimization has converged */
-static int analyze_traj(qmdata_t *, gmsdata *);
-
-/* read the number of scf iterations and the scf energies
- * for the current timestep. */
-static int get_scfdata(qmdata_t *, qm_timestep_t *);
-
-/* Reads a set of wavefunctions for the current timestep.
- * (typically alpha and beta spin wavefunctions) */
-static int check_add_wavefunctions(qmdata_t *data,
-                                   qm_timestep_t *ts);
-
-/* Parse the wavefunction. */
-static int get_wavefunction(qmdata_t *, qm_timestep_t *, qm_wavefunction_t *);
-
-/* Read the wavefunction coefficients. */
-static int read_coeff_block(FILE *file, int wavef_size,
-                              float *wave_coeff, int *angular_momentum);
-
-/* Read localized orbitals (Boys/Ruedenberg/Pipek) */
-static int read_localized_orbitals(qmdata_t *data);
-
-/* Read population analysis (Mulliken and Lowdin charges) */
-static int get_population(qmdata_t *, qm_timestep_t *);
-
-/* Read the energy gradient for each atom. */
-static int get_gradient(qmdata_t *, qm_timestep_t *ts);
-
-/* Read energy gradient from final traj step. */
-static int get_final_gradient(qmdata_t *, qm_timestep_t *ts);
-
-/* Read ESP charges. */
-static int get_esp_charges(qmdata_t *data);
-
-/* For runtyp=HESSIAN, this subroutine scans the file for 
- * the hessian matrix in internal coordinates 
- * as well as the internal coordinate information */
-static int get_int_coords(qmdata_t *);
-
-/* get Hessian matrix in internal coordinates */
-static int get_int_hessian(qmdata_t *);
-
-/* For runtyp=HESSIAN, this subroutine scans the file for 
- * the cartesian hessian matrix */ 
-static int get_cart_hessian(qmdata_t *);
-
-/* For runtyp=HESSIAN, this subroutine reads the frequencies
- * and intensities of the normal modes */
-static int get_normal_modes(qmdata_t *);
-
-
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the GAMESS logfile and get the number
- * of atoms.
- * We are also reading all the static (i.e. non-trajectory)
- * data here since we have to parse a bit to get the atom count
- * anyway. These data will then be provided to VMD by
- * read_gamess_metadata() and read_gamess_rundata().
- *
- * *************************************************************/
-static void *open_gamess_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  qmdata_t *data = NULL;
-  gmsdata *gms;
-
-  /* open the input file */
-  fd = fopen(filename, "rb");
- 
-  if (!fd) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* allocate and initialize main data structure */
-  data = init_qmdata();
-
-  /* make sure memory was allocated properly */
-  if (data == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* allocate GAMESS specific data */
-  gms = (gmsdata *)calloc(1,sizeof(gmsdata));
-  data->format_specific_data = gms;
-
-  gms->version = 0;
-  gms->have_pcgamess = 0;
-  gms->have_fmo = 0;
-
-
-  /* store file pointer and filename in gamess struct */
-  data->file = fd;
-
-
-  /* check if the file is GAMESS format; if yes
-   * parse it, if no exit */
-  if (have_gamess(data, gms)==TRUE) {
-    if (gms->have_pcgamess) {
-      printf("gamessplugin) Warning: PC GAMESS/FIREFLY is not yet fully supported!\n");
-    //  return NULL;
-    }
-    /* if we're dealing with an unsupported GAMESS
-     * version, we better quit */
-    if (gms->version==GAMESSUNKNOWN) {
-      printf("gamessplugin) GAMESS version %s not supported. \n",
-             data->version_string);
-      return NULL;
-    }
-
-    /* get the non-trajectory information from the log file */    
-    if (parse_static_data(data, natoms) == FALSE) 
-      return NULL;
-  }
-  else {
-    printf("gamessplugin) This seems to not be a GAMESS logfile.\n");
-    return NULL;
-  }
-
-  return data;
-}
-
-
-/************************************************************
- * 
- * Provide VMD with the structure of the molecule, i.e the
- * atoms coordinates names, etc.
- *
- *************************************************************/
-static int read_gamess_structure(void *mydata, int *optflags, 
-                      molfile_atom_t *atoms) 
-{
-  qmdata_t *data = (qmdata_t *)mydata;
-  qm_atom_t *cur_atom;
-  molfile_atom_t *atom;
-  int i = 0;
- 
-  /* optional atomic number provided */
-  *optflags = MOLFILE_ATOMICNUMBER;
-  /*  if (data->have_mulliken) 
-   *optflags |= MOLFILE_CHARGE;*/
-
-  /* all the information I need has already been read in
-   * via the initial scan and I simply need to copy 
-   * everything from the temporary arrays into the 
-   * proper VMD arrays.
-   * Since there are no atom names in the GAMESS output
-   * I use the atom type here --- maybe there is a better
-   * way to do this !!?? */
-
-  /* get initial pointer for atom array */
-  cur_atom = data->atoms;
-
-  for(i=0; i<data->numatoms; i++) {
-    atom = atoms+i;
-    strncpy(atom->name, cur_atom->type, sizeof(atom->name)); 
-    strncpy(atom->type, cur_atom->type, sizeof(atom->type));
-    strncpy(atom->resname,"", sizeof(atom->resname)); 
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->atomicnumber = cur_atom->atomicnum;
-#ifdef DEBUGGING
-    printf("gamessplugin) atomicnum[%d] = %d\n", i, atom->atomicnumber);
-#endif
-
-    /* if (data->have_mulliken)
-      atom->charge = data->qm_timestep->mulliken_charges[i];
-    */
-    cur_atom++;
-  }
- 
-  return MOLFILE_SUCCESS; 
-}
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_gamess_metadata(void *mydata, 
-    molfile_qm_metadata_t *metadata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  if (data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    metadata->ncart = (3*data->numatoms);
-    metadata->nimag = data->nimag;             
-   
-    if (data->have_internals) {
-      metadata->nintcoords = data->nintcoords; 
-    } else {
-      metadata->nintcoords = 0;
-    }
-  }
-  else {
-    metadata->ncart = 0;
-    metadata->nimag = 0;
-    metadata->nintcoords = 0;
-  }
-
-  /* orbital data */
-  metadata->num_basis_funcs = data->num_basis_funcs;
-  metadata->num_basis_atoms = data->num_basis_atoms;
-  metadata->num_shells      = data->num_shells;
-  metadata->wavef_size      = data->wavef_size;  
-
-#if vmdplugin_ABIVERSION > 11
-  /* system and run info */
-  metadata->have_sysinfo = 1;
-
-  /* hessian info */
-  metadata->have_carthessian = data->have_cart_hessian;
-  metadata->have_inthessian  = data->have_int_hessian;
-
-  /* normal mode info */
-  metadata->have_normalmodes = data->have_normal_modes;
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_gamess_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i, j;
-  int ncart;
-  molfile_qm_hessian_t *hessian_data = &qm_data->hess;
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-  molfile_qm_sysinfo_t *sys_data     = &qm_data->run;
-
-  /* fill in molfile_qm_hessian_t */
-  if (data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    ncart = 3*data->numatoms;
-
-    /* Hessian matrix in cartesian coordinates */
-    if (data->have_cart_hessian) {
-      for (i=0; i<ncart; i++) {
-        for (j=0; j<=i; j++) {
-          hessian_data->carthessian[ncart*i+j] = data->carthessian[ncart*i+j];
-          hessian_data->carthessian[ncart*j+i] = data->carthessian[ncart*i+j];
-        }
-      }
-    }
-
-    /* Hessian matrix in internal coordinates */
-    if (data->have_int_hessian) {
-      for (i=0; i<(data->nintcoords)*(data->nintcoords); i++) {
-        hessian_data->inthessian[i] = data->inthessian[i];
-      }
-    }
-
-    /* wavenumbers, intensities, normal modes */
-    if (data->have_normal_modes) {
-      for (i=0; i<ncart*ncart; i++) {
-        hessian_data->normalmodes[i] = data->normal_modes[i];
-      }
-      for (i=0; i<ncart; i++) {
-        hessian_data->wavenumbers[i] = data->wavenumbers[i];
-        hessian_data->intensities[i] = data->intensities[i];
-      }
-    }
-
-    /* imaginary modes */
-    for (i=0; i<data->nimag; i++) {
-      /*printf("imag_modes[%d]=%d\n", i, data->imag_modes[i]);*/
-      hessian_data->imag_modes[i] = data->imag_modes[i];
-    }
-  }
-
-  /* fill in molfile_qm_sysinfo_t */
-  sys_data->runtype = data->runtype;
-  sys_data->scftype = data->scftype;
-  sys_data->nproc   = data->nproc;
-  sys_data->num_electrons  = data->num_electrons;
-  sys_data->totalcharge    = data->totalcharge;
-  sys_data->num_occupied_A = data->num_occupied_A;
-  sys_data->num_occupied_B = data->num_occupied_B;
-  sys_data->status         = data->status;
-
-
-  strncpy(sys_data->basis_string, data->basis_string,
-          sizeof(sys_data->basis_string));
-
-  sys_data->memory = 0; /* XXX fixme */
-
-  strncpy(sys_data->runtitle, data->runtitle, sizeof(sys_data->runtitle));
-  strncpy(sys_data->geometry, data->geometry, sizeof(sys_data->geometry));
-  strncpy(sys_data->version_string, data->version_string,
-          sizeof(sys_data->version_string));
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->num_basis_atoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-      basis_data->atomic_number[i] = data->atomicnum_per_basisatom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_types[i] = data->shell_types[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-
-    for (i=0; i<3*data->wavef_size; i++) {
-      basis_data->angular_momentum[i] = data->angular_momentum[i];
-    }
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-
-
-#if vmdplugin_ABIVERSION > 11
-
-/***********************************************************
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***********************************************************
- * Provide QM metadata for next timestep. 
- * This actually triggers reading the entire next timestep
- * since we have to parse the whole timestep anyway in order
- * to get the metadata. So we store the read data locally
- * and hand them to VMD when requested by read_timestep().
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  int have = 0;
-
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  meta->count = -1; /* Don't know the number of frames yet */
-
-  if (data->num_frames_read > data->num_frames_sent) {
-    have = 1;
-  }
-  else if (data->num_frames_read < data->num_frames) {
-    /*printf("gamessplugin) Probing timestep %d\n", data->num_frames_read);*/
-
-    have = get_traj_frame(data, data->atoms, data->numatoms);
-  }
-
-  if (have) {
-    int i;
-    qm_timestep_t *cur_ts;
-
-    /* get a pointer to the current qm timestep */
-    cur_ts = data->qm_timestep+data->num_frames_sent;
-    
-    for (i=0; (i<MOLFILE_MAXWAVEPERTS && i<cur_ts->numwave); i++) {
-      meta->num_orbitals_per_wavef[i] = cur_ts->wave[i].num_orbitals;
-      meta->has_occup_per_wavef[i]    = cur_ts->wave[i].has_occup;
-      meta->has_orben_per_wavef[i]    = cur_ts->wave[i].has_orben;
-    }
-    meta->wavef_size      = data->wavef_size;
-    meta->num_wavef       = cur_ts->numwave;
-    meta->num_scfiter     = cur_ts->num_scfiter;
-    meta->num_charge_sets = cur_ts->have_mulliken +
-      cur_ts->have_lowdin + cur_ts->have_esp;
-    if (cur_ts->gradient) meta->has_gradient = TRUE;
-
-  } else {
-    meta->has_gradient = FALSE;
-    meta->num_scfiter  = 0;
-    meta->num_orbitals_per_wavef[0] = 0;
-    meta->has_occup_per_wavef[0] = FALSE;
-    meta->num_wavef = 0;
-    meta->wavef_size = 0;
-    meta->num_charge_sets = 0;
-    data->trajectory_done = TRUE;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * This function provides the data of the next timestep.
- * Here we actually don't read the data from file, that had
- * to be done already upon calling read_timestep_metadata().
- * Instead we copy the stuff from the local data structure
- * into the one's provided by VMD.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-			 molfile_qm_timestep_t *qm_ts) 
-{
-  qmdata_t *data = (qmdata_t *)mydata;
-  qm_timestep_t *cur_ts;
-  int offset;
-  int i = 0;
-  int num_charge_sets = 0;
-
-  if (data->trajectory_done == TRUE) return MOLFILE_ERROR;
-
-
-  /* copy the coordinates */
-  for (i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = data->atoms[i].x;
-    ts->coords[3*i+1] = data->atoms[i].y;
-    ts->coords[3*i+2] = data->atoms[i].z; 
-  }    
-  
-  /* get a convenient pointer to the current qm timestep */
-  cur_ts = data->qm_timestep+data->num_frames_sent;
-
-  /* store the SCF energies */
-  for (i=0; i<cur_ts->num_scfiter; i++) {
-    qm_ts->scfenergies[i] = cur_ts->scfenergies[i];
-  }
-
-  /* store gradients */
-  if (cur_ts->gradient) {
-    for (i=0; i<3*natoms; i++) {
-      qm_ts->gradient[i] = cur_ts->gradient[i];
-    }
-  }
-
-  /* store charge sets*/
-  if (cur_ts->have_mulliken) {
-    offset = num_charge_sets*data->numatoms;
-    for (i=0; i<data->numatoms; i++) {
-      qm_ts->charges[offset+i] = cur_ts->mulliken_charges[i];
-    }
-    qm_ts->charge_types[num_charge_sets] = MOLFILE_QMCHARGE_MULLIKEN;
-    num_charge_sets++;
-  }
-
-  if (cur_ts->have_lowdin) {
-    offset = num_charge_sets*data->numatoms;
-    for (i=0; i<data->numatoms; i++) {
-      qm_ts->charges[offset+i] = cur_ts->lowdin_charges[i];
-    }
-    qm_ts->charge_types[num_charge_sets] = MOLFILE_QMCHARGE_LOWDIN;
-    num_charge_sets++;
-  }
-  if (cur_ts->have_esp) {
-    offset = num_charge_sets*data->numatoms;
-    for (i=0; i<data->numatoms; i++) {
-      qm_ts->charges[offset+i] = cur_ts->esp_charges[i];
-    }
-    qm_ts->charge_types[num_charge_sets] = MOLFILE_QMCHARGE_ESP;
-    num_charge_sets++;
-  }
-
-
-  /* store the wave function and orbital energies */
-  if (cur_ts->wave) {
-    for (i=0; i<cur_ts->numwave; i++) {
-      qm_wavefunction_t *wave = &cur_ts->wave[i];
-      qm_ts->wave[i].type         = wave->type;
-      qm_ts->wave[i].spin         = wave->spin;
-      qm_ts->wave[i].excitation   = wave->exci;
-      qm_ts->wave[i].multiplicity = wave->mult;
-      qm_ts->wave[i].energy       = wave->energy;
-      strncpy(qm_ts->wave[i].info, wave->info, MOLFILE_BUFSIZ);
-
-      if (wave->wave_coeffs) {
-        memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-               wave->num_orbitals*data->wavef_size*sizeof(float));
-      }
-      if (wave->orb_energies) {
-        memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-               wave->num_orbitals*sizeof(float));
-      }
-      if (wave->has_occup) {
-        memcpy(qm_ts->wave[i].occupancies, wave->orb_occupancies,
-               wave->num_orbitals*sizeof(float));
-      }
-    }
-  }
-
-  if (data->runtype == MOLFILE_RUNTYPE_ENERGY || 
-      data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    /* We have only a single point */
-    data->trajectory_done = TRUE;
-  }
-
-  data->num_frames_sent++;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-/**********************************************************
- *
- * close file and free memory
- *
- **********************************************************/
-static void close_gamess_read(void *mydata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->atoms);
-  free(data->basis);
-  free(data->shell_types);
-  free(data->atomicnum_per_basisatom);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->bonds);
-  free(data->angles);
-  free(data->dihedrals);
-  free(data->impropers);
-  free(data->internal_coordinates);
-  free(data->bond_force_const);
-  free(data->angle_force_const);
-  free(data->dihedral_force_const);
-  free(data->improper_force_const);
-  free(data->inthessian);
-  free(data->carthessian);
-  free(data->wavenumbers);
-  free(data->intensities);
-  free(data->normal_modes);
-  free(data->imag_modes);
-  free(data->angular_momentum);
-  free(data->filepos_array);
-
-  if (data->basis_set) {
-    for(i=0; i<data->num_basis_atoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  for (i=0; i<data->num_frames; i++) {
-    free(data->qm_timestep[i].scfenergies);
-    free(data->qm_timestep[i].gradient);
-    free(data->qm_timestep[i].mulliken_charges);
-    free(data->qm_timestep[i].lowdin_charges);
-    free(data->qm_timestep[i].esp_charges);
-    for (j=0; j<data->qm_timestep[i].numwave; j++) {
-      free(data->qm_timestep[i].wave[j].wave_coeffs);
-      free(data->qm_timestep[i].wave[j].orb_energies);
-      free(data->qm_timestep[i].wave[j].orb_occupancies);
-    }
-    free(data->qm_timestep[i].wave);
-  }
-  free(data->qm_timestep);
-  free(data->format_specific_data);
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-
-/********************************************************
- *
- * Main gamess log file parser responsible for static,  
- * i.e. non-trajectory information.
- *
- ********************************************************/
-static int parse_static_data(qmdata_t *data, int *natoms) 
-{
-  /* Cast GAMESS specific data */
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-
-
-  /* Read # of procs and amount of requested memory */
-  get_proc_mem(data, gms);
-
-  /* Read the $BASIS options */
-  if (!get_basis_options(data))   return FALSE;
-
-  /* Read the run title */
-  if (!get_runtitle(data))        return FALSE;
-
-  /* Read the $CONTRL group;
-   * It actually appears after the basis stats in the
-   * output file but we jump ahead and read it here
-   * because we need the units (ANGS/BOHR) before
-   * reading the input structure. */
-  if (gms->have_pcgamess){
-    if (!get_contrl_firefly(data))          return FALSE;
-  }
-  else {
-    if (!get_contrl(data))          return FALSE;
-  }
-
-  /* Read the input atom definitions and geometry */
-  if (!get_input_structure(data, gms)) return FALSE;
-
-  /* Read the basis set */
-  if (!get_basis(data))           return FALSE; 
-
-  /* Read the number of orbitals, electrons, 
-   * charge, multiplicity, ... */
-  if (!get_basis_stats(data))     return FALSE;
-
-  /* Read input parameters regarding calculation of 
-   * certain molecular properties such as electrostatic
-   * moments and the MEP. */
-  if (!get_properties_input(data)) return FALSE;
-
-  /* Read internal coordinates */
-  get_int_coords(data);
-
-  /* Read symmetry point group and highest axis */
-  if (!get_symmetry(data))         return FALSE;
-
-  /* Read the $GUESS options */
-  get_guess_options(data);
-
-  if (data->scftype==MOLFILE_SCFTYPE_MCSCF) {
-    if (!get_mcscf(data))          return FALSE;
-  }
-
-  /* Find the end of the trajectory and count the
-   * frames on the way.
-   * If no regular end is found we won't find any
-   * properties to read and return. */
-  if (!analyze_traj(data, gms)) {
-    printf("gamessplugin) WARNING: Truncated or abnormally terminated file!\n\n");
-  }
-
-
-  /* provide VMD with the proper number of atoms */
-  *natoms = data->numatoms;
-
-  /* Read the first frame*/
-  read_first_frame(data);
-
-  /* Read the properties at the end of a calculation */
-  get_final_properties(data);
-
-#ifdef DEBUGGING 
-  printf("gamessplugin) num_frames_read = %d\n", data->num_frames_read);
-  printf("gamessplugin) num_frames_sent = %d\n", data->num_frames_sent);
-
-  /* Test print the parsed data in same format as logfile */
-  print_input_data(data);
-#endif
-
-  return TRUE;
-}
-
-
-#define TORF(x) (x ? "T" : "F")
-
-static void print_input_data(qmdata_t *data) {
-  int i, j, k;
-  int primcount=0;
-  int shellcount=0;
-
-  printf("\nDATA READ FROM FILE:\n\n");
-  printf(" %10s WORDS OF MEMORY AVAILABLE\n", data->memory);
-  printf("\n");
-  printf("     BASIS OPTIONS\n");
-  printf("     -------------\n");
-  printf("%s\n", data->basis_string);
-  printf("\n\n\n");
-  printf("     RUN TITLE\n");
-  printf("     ---------\n");
-  printf(" %s\n", data->runtitle);
-  printf("\n");
-  printf(" THE POINT GROUP OF THE MOLECULE IS %s\n", "XXX");
-  printf(" THE ORDER OF THE PRINCIPAL AXIS IS %5i\n", 0);
-  printf("\n");
-  printf(" YOUR FULLY SUBSTITUTED Z-MATRIX IS\n");
-  printf("\n");
-  printf(" THE MOMENTS OF INERTIA ARE (AMU-ANGSTROM**2)\n");
-  printf(" IXX=%10.3f   IYY=%10.3f   IZZ=%10.3f\n", 0.0, 0.0, 0.0);
-  printf("\n");
-  printf(" ATOM      ATOMIC                      COORDINATES (BOHR)\n");
-  printf("           CHARGE         X                   Y                   Z\n");
-  for (i=0; i<data->numatoms; i++) {
-    printf(" %-8s %6d", data->atoms[i].type, data->atoms[i].atomicnum);
-    
-    printf("%17.10f",   ANGS_TO_BOHR*data->atoms[i].x);
-    printf("%20.10f",   ANGS_TO_BOHR*data->atoms[i].y);
-    printf("%20.10f\n", ANGS_TO_BOHR*data->atoms[i].z);
-  }
-  printf("\n");
-  printf("     ATOMIC BASIS SET\n");
-  printf("     ----------------\n");
-  printf(" THE CONTRACTED PRIMITIVE FUNCTIONS HAVE BEEN UNNORMALIZED\n");
-  printf(" THE CONTRACTED BASIS FUNCTIONS ARE NOW NORMALIZED TO UNITY\n");
-  printf("\n");
-  printf("  SHELL TYPE  PRIMITIVE        EXPONENT          CONTRACTION COEFFICIENT(S)\n");
-  printf("\n");
-
-#if 0
-  for (i=0; i<data->numatoms; i++) {
-    printf("%-8s\n\n", data->atoms[i].type);
-    printf("\n");
-    printf("nshells=%d\n", data->num_shells_per_atom[i]);
-
-    for (j=0; j<data->num_shells_per_atom[i]; j++) {
-      printf("nprim=%d\n", data->num_prim_per_shell[shellcount]);
-
-      for (k=0; k<data->num_prim_per_shell[shellcount]; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j, data->shell_types[shellcount],
-               primcount+1, data->basis[2*primcount], data->basis[2*primcount+1]);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-#endif
-  printf("gamessplugin) =================================================================\n");
-  for (i=0; i<data->num_basis_atoms; i++) {
-    printf("%-8s (%10s)\n\n", data->atoms[i].type, data->basis_set[i].name);
-    printf("\n");
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j,
-               data->basis_set[i].shell[j].type,
-               primcount+1,
-               data->basis_set[i].shell[j].prim[k].exponent,
-               data->basis_set[i].shell[j].prim[k].contraction_coeff);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-  printf("\n");
-  printf(" TOTAL NUMBER OF BASIS SET SHELLS             =%5d\n", data->num_shells);
-  printf(" NUMBER OF CARTESIAN GAUSSIAN BASIS FUNCTIONS =%5d\n", data->wavef_size);
-  printf(" NUMBER OF ELECTRONS                          =%5d\n", data->num_electrons);
-  printf(" CHARGE OF MOLECULE                           =%5d\n", data->totalcharge);
-  printf(" SPIN MULTIPLICITY                            =%5d\n", data->multiplicity);
-  printf(" NUMBER OF OCCUPIED ORBITALS (ALPHA)          =%5d\n", data->num_occupied_A);
-  printf(" NUMBER OF OCCUPIED ORBITALS (BETA )          =%5d\n", data->num_occupied_B);
-  printf(" TOTAL NUMBER OF ATOMS                        =%5i\n", data->numatoms);
-  printf("\n");
-}
-
-
-
-/**********************************************************
- *
- * this subroutine checks if the provided files is
- * actually a GAMESS file;
- *
- **********************************************************/
-static int have_gamess(qmdata_t *data, gmsdata *gms) 
-{
-  char word[3][BUFSIZ];
-  char buffer[BUFSIZ];
-  char versionstr[BUFSIZ];
-  int day, year;
-  char month[BUFSIZ], rev[BUFSIZ];
-  int i = 0;
-  int program;
-  int ver,build;
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-
-  /* check if the file is GAMESS format */
-  program = goto_keyline(data->file,
-                          "PC GAMESS version",
-                          "GAMESS VERSION =", 
-                          "Firefly version",NULL);
-  if (program==1) {
-    gms->have_pcgamess = 1;
-    gms->version = 1;
-    strcpy(data->version_string, "PC GAMESS ");
-  } else if (program==2) {
-    gms->have_pcgamess = 0;
-    strcpy(data->version_string, "GAMESS ");
-  } else if (program==3) {
-    gms->have_pcgamess = 1;
-    gms->version = FIREFLY8PRE6695;
-    strcpy(data->version_string, "Firefly ");
-  } else {
-    printf("gamessplugin) This is no GAMESS/PCGAMESS/Firefly logfile!\n");
-    return FALSE;
-  }
-
-  GET_LINE(buffer, data->file);
-
-  if (gms->have_pcgamess) {
-    if (strstr(buffer,"version") != NULL) {
-      strncpy(versionstr, strstr(buffer,"version")+8, 16);
-      *strchr(versionstr, ' ') = '\0';
-      sscanf(buffer, "%*s %*s %*s %*s %*s %*s %d", &build);
-      sscanf(versionstr, "%1d%*s", &ver);
-      printf("gamessplugin) Firefly build = %d %d\n", 
-         ver,build);
-      if (ver >= 8 && build >= 6695)
-        gms->version = FIREFLY8POST6695;
-      else
-        gms->version = FIREFLY8PRE6695;
-    }
-  } else {
-    /* extract the version number if possible; otherwise
-     * return empty string */
-    if (strstr(buffer,"=") != NULL) {
-      strncpy(versionstr, strstr(buffer,"=")+2, 16);
-      versionstr[16] = '\0';
-    }
-    
-    /* determine if we're dealing with pre-"27 JUN 2005"
-     * version */
-    sscanf(versionstr, "%d %s %d %s", &day, month, &year, rev);
-    
-    if ( ( year >= 2006 ) ||
-         ( year == 2005 && !strcmp(month,"JUN") ) ||
-         ( year == 2005 && !strcmp(month,"NOV") ) ||
-         ( year == 2005 && !strcmp(month,"DEC") ) )
-      {
-        gms->version = GAMESSPOST20050627;
-      } else { 
-        gms->version = GAMESSPRE20050627;
-      }
-  }
-
-  strcat(data->version_string, versionstr);
-
-  printf("gamessplugin) Version = %s\n", 
-         data->version_string);
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * this subroutine reads the number of procs and the amount
- * of memory requested
- *
- **********************************************************/
-static int get_proc_mem(qmdata_t *data, gmsdata *gms) {
-
-  char word[4][BUFSIZ];
-  char buffer[BUFSIZ];
-  char *temp;
-  int nproc;
-  int i;
-
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  rewind(data->file);
-
-  
-  /* scan for the number of processors; here we need
-   * distinguish between vanilla Gamess and PC Gamess */
-  if (gms->have_pcgamess == 1) {
-    /* XXX for now we fake ncpu = 1 until we know exactly
-     *     how the output format looks like */
-    nproc = 1;
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s %d %s",&word[0][0],&nproc,&word[1][0]);
-        if (!strcmp(&word[0][0],"PARALLEL") &&
-               !strcmp(&word[0][1],"RUNNING")) {
-            sscanf(buffer,"%*s %*s %*s %*s %*s %d %*s %*s",&nproc);
-            break;
-        }
-      } while (strcmp(&word[0][0],"ECHO") || 
-               strcmp(&word[1][0],"THE") );
-
-  }
-  else {
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s %d %s",&word[0][0],&nproc,&word[1][0]);
-
-      if (!strcmp(&word[0][0],"Initiating") &&
-          !strcmp(&word[1][0],"compute")) {
-        break;
-      }
-
-      else if (!strcmp(&word[0][0],"Initiating") &&
-               !strcmp(&word[1][0],"processes")) {
-        break;
-      }
-
-      /* Some versions */
-      else if (!strcmp(&word[0][0],"PARALLEL") &&
-               !strcmp(&word[0][1],"RUNNING")) {
-        sscanf(buffer,"%*s %*s %*s %*s %d %*s",&nproc);
-        break;
-      }
-
-    } while (strcmp(&word[0][0],"ECHO") || 
-             strcmp(&word[1][0],"THE") );
-  }
-  
-  /* store the number of processors */
-  data->nproc = nproc;
-
-  
-  /* scan for the amount of memory requested */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-
-  } while( strcmp(&word[0][0],"$SYSTEM") || 
-           strcmp(&word[1][0],"OPTIONS") );
-
-  eatline(data->file, 1);
-
-
-  /* next line contains the amount of memory requested,
-   * vanilla Gamess and PC Gamess need separate treatment */
-  if (gms->have_pcgamess == 1) {
-    GET_LINE(buffer, data->file);
-
-    /* store it */
-    if ((temp = strstr(buffer,"MEMORY=")+8)==NULL) return FALSE;
-    strncpy(data->memory,trimright(temp),sizeof(data->memory));
-  }
-  else {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s %s %s",&word[0][0],&word[1][0],&word[2][0]);
-
-    /* store it */
-    strncpy(data->memory,&word[2][0],sizeof(data->memory));
-  }
-
-  printf("gamessplugin) GAMESS used %d compute processes \n", nproc);
-  printf("gamessplugin) GAMESS used %s words of memory \n", data->memory);
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Extract the $BASIS options
- *
- **********************************************************/
-static int get_basis_options(qmdata_t *data) {
-
-  char buffer[BUFSIZ];
-  char diffuse[BUFSIZ];
-  char polarization[BUFSIZ];
-  int ngauss;
-
-  buffer[0] = '\0';
-  diffuse[0] = '\0';
-  polarization[0] = '\0';
-
-  /* The $BASIS section is somewhere at the beginning of
-   * the file. Rewind to be sure not to miss it. */
-  rewind(data->file);
-
-  /* start scanning */
-  if (pass_keyline(data->file, "BASIS OPTIONS",
-                    "RUN TITLE") != FOUND) {
-    /* No Basis options section found
-     * (basis was entered explicitly) */
-    return TRUE;
-  }
-
-  eatline(data->file, 1);
-
-
-  /* the first string in the current line contains the
-   * GBASIS used; copy it over into the gbasis variable
-   * of qmdata_t */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer," GBASIS=%s IGAUSS= %d", data->gbasis, &ngauss);
- 
-
-  /* in case we're using a pople style basis set, i.e. 
-   * GBASIS=N311,N31,N21 or STO we also scan for the number 
-   * of gaussians, as well as p,d,f and diffuse functions
-   * and use this info to assemble a "basis set string" */
-  if ( !strncmp(data->gbasis,"N311",sizeof(data->gbasis)) ||
-       !strncmp(data->gbasis,"N31",sizeof(data->gbasis)) ||
-       !strncmp(data->gbasis,"N21",sizeof(data->gbasis)) ||
-       !strncmp(data->gbasis,"STO",sizeof(data->gbasis)) ) 
-  {
-    int npfunc, ndfunc, nffunc;
-    int diffs=FALSE, diffsp=FALSE;
-    char torf;
-
-    /* the next line gives us the d,f and diffuse sp
-     * functions */
-    GET_LINE(buffer, data->file);
-    if (sscanf(buffer," NDFUNC= %d NFFUNC= %d DIFFSP= %c",
-               &ndfunc, &nffunc, &torf) != 3) {
-      sscanf(buffer," NDFUNC= %d DIFFSP= %c", &ndfunc, &torf);
-    }
-
-    /* convert GAMESS' .TRUE./.FALSE. for DIFFSP into 1/0 */
-    if (torf=='T') diffsp = TRUE;
-
-
-    /* the next line gives us the p and diffuse s
-     * functions */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer," NPFUNC= %d DIFFS= %c", &npfunc, &torf);
-
-    /* convert GAMESS' .TRUE./.FALSE. for DIFFSP into 1/0 */
-    if (torf=='T') diffs = TRUE;
-
-
-    /* now we need some logic to assemble this info into
-     * some nice looking string a la "6-31G*" */
-
-    /* create the diffuse function string */
-    if (diffs && diffsp) {
-    	strncpy(diffuse,"++",sizeof(diffuse));
-    }
-    else if (diffsp) {
-    	strncpy(diffuse,"+",sizeof(diffuse));
-    }
-    else {
-    	strncpy(diffuse,"",sizeof(diffuse));
-    }
-
-
-    /* create the polarization function string */
-    if (npfunc>0 && ndfunc>0 && nffunc>0) {
-      sprintf(polarization, "(%dp,%dd,%df)", npfunc, ndfunc, nffunc);
-    } else if (npfunc>0 && ndfunc>0) {
-      sprintf(polarization, "(%dp,%dd)", npfunc, ndfunc);
-    }
-    else if (npfunc>0) {
-      sprintf(polarization, "(%dp)", npfunc);
-    }
-    else if (ndfunc>0) {
-      sprintf(polarization, "(%dd)", ndfunc);
-    } 
-    else {
-      strncpy(polarization, "", sizeof(polarization));
-    } 
-
-    /* assemble the bits */ 
-    if (!strcmp(data->gbasis, "STO")) {
-      sprintf(data->basis_string, "STO-%dG%s%s",
-              ngauss, diffuse, polarization);
-    }
-    else {
-      sprintf(data->basis_string, "%d-%s%sG%s",
-              ngauss, (data->gbasis+1), diffuse, 
-              polarization);
-    }      
-  }
-
-  /* cc-pVnZ and cc-pCVnZ */
-  else if (!strncmp(data->gbasis, "CC",  2)) {
-    strcpy(data->basis_string, "cc-p");
-    if (strlen(data->gbasis)==4 && data->gbasis[3]=='C') {
-      strcat(data->basis_string, "C");
-    }
-    strcat(data->basis_string, "V");
-    strncat(data->basis_string, &data->gbasis[2], 1);
-    strcat(data->basis_string, "Z");
-  }
-
-  /* aug-cc-pVnZ and aug-cc-pCVnZ */
-  else if (!strncmp(data->gbasis, "ACC", 3)) {
-    strcpy(data->basis_string, "aug-cc-p");
-    if (strlen(data->gbasis)==5 && data->gbasis[4]=='C') {
-      strcat(data->basis_string, "C");
-    }
-    strcat(data->basis_string, "V");
-    strncat(data->basis_string, &data->gbasis[3], 1);
-    strcat(data->basis_string, "Z");
-  }
-
-  /* for non Pople style basis sets we just use the GBASIS
-   * for the basis string;
-   * TODO: make the basis_string more comprehensive for non
-   *       pople-style basis sets */
-  else {
-    strncpy(data->basis_string,data->gbasis,
-            sizeof(data->basis_string));
-  }
-
-  return TRUE;
-}
-
-
-
-/**********************************************************
- *
- * Extract the run title line
- *
- **********************************************************/
-static int get_runtitle(qmdata_t *data) {
-
-  char buffer[BUFSIZ];
-
-  if (pass_keyline(data->file, "RUN TITLE",
-                   "THE POINT GROUP") != FOUND) {
-    /* This is most likely a broken file, but who knows. 
-     * Since we don't really care about the title string
-     * we go on here without error. */
-    data->runtitle[0] = '\0';
-    return TRUE;
-  }
-
-  GET_LINE(buffer, data->file);
-  strncpy(data->runtitle,trimright(buffer),sizeof(data->runtitle));
-
-  return TRUE;
-} 
-
-
-/**********************************************************
- *
- * Read the input atom definitions and geometry
- *
- **********************************************************/
-static int get_input_structure(qmdata_t *data, gmsdata *gms) {
-  char buffer[BUFSIZ];
-  char units[BUFSIZ];
-  int numatoms = -1;
-  int bohr;
-  long filepos;
-  filepos = ftell(data->file);
-
-  /* See if we find the "ATOM      ATOMIC ..." line before 
-   * any of the three stopstrings mrking the beginning of
-   * possible following sections. */
-  if (goto_keyline(data->file,
-         "ATOM      ATOMIC                      COORDINATES (",
-         "INTERNUCLEAR DISTANCES",
-         "ATOMIC BASIS SET",
-         "$CONTRL OPTIONS", NULL) == FOUND) {
-
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, " ATOM      ATOMIC  %*s  %s", units);
-    eatline(data->file, 1);
-
-  } else {
-    /* This is probably an FMO calc.; if so, set flag. */
-    fseek(data->file, filepos, SEEK_SET);
-    if (pass_keyline(data->file,
-                     "The Fragment Molecular Orbital (FMO) method.", 
-                     NULL)) {
-      gms->have_fmo = 1;
-      printf("gamessplugin) Fragment Molecular Orbital (FMO) method.\n");
-    }
-
-    /* We didn't find the normal input section.
-     * Let's see i we can find coordinates for the first
-     * frame of a trajectory. */
-    fseek(data->file, filepos, SEEK_SET);
-    if (pass_keyline(data->file,
-                      "BEGINNING GEOMETRY SEARCH POINT NSERCH=   0",
-                      NULL) &&
-        goto_keyline(data->file, "COORDINATES OF ALL ATOMS", NULL)) {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer, " COORDINATES OF ALL ATOMS ARE %s", units);
-      eatline(data->file, 2);
-
-    } else {
-      /* As last resort look for FMO coordinates in the
-       * INPUT CARD section: */
-
-      /* But first we have to get the units from the $CONTRL section */
-      rewind(data->file);
-      if (!pass_keyline(data->file, "$CONTRL OPTIONS", NULL)) {
-        printf("gamessplugin) Missing $CONTRL OPTIONS section!\n");
-        return FALSE;
-      }
-      goto_keyline(data->file, "UNITS =", NULL);
-      GET_LINE(buffer, data->file);
-      sscanf(strstr(buffer, "UNITS ="), "%s", units);
-      bohr = !strcmp(units, "BOHR");
-      
-      /* Find beginning of $FMOXYZ input card */
-      rewind(data->file);
-      if (!pass_keyline(data->file, "INPUT CARD> $fmoxyz", 
-                        "INPUT CARD> $FMOXYZ")) {
-        printf("gamessplugin) No atom coordinates found!\n");
-        return FALSE;
-      }
-            
-      /* Read the $FMOXYZ coordinates */     
-      if (!get_fmoxyz(data->file, &data->atoms, bohr, &numatoms)) {
-        printf("gamessplugin) Could not read coordinates from $FMOXYZ input!\n");
-        return FALSE;
-      } else {
-        printf("gamessplugin) Fragment Molecular Orbital (FMO) method.\n");
-        gms->have_fmo = 1;
-        data->numatoms = numatoms;
-        return TRUE;
-      }
-    }
-  }
-
-  /* If we reached this point we have found either a regular
-   * input coordinate block or the coordinate block of the
-   * first trajectory frame. */
-
-  /* test if coordinate units are Bohr */
-  bohr = !strcmp(units, "(BOHR)");
-
-  /* Read the coordinate block */
-  if (get_coordinates(data->file, &data->atoms, bohr, &numatoms))
-    data->num_frames_read = 0;
-  else {
-    printf("gamessplugin) Bad atom coordinate block!\n");
-    return FALSE;
-  }
-
-  fseek(data->file, filepos, SEEK_SET);
-
-  /* store number of atoms in data structure */
-  data->numatoms = numatoms;
-
-  return TRUE; 
-}
-
-
-/**********************************************************
- *
- * Read an atom coordinate block.
- *
- * Example:
- *  F         9.0    3.04259     -0.07605       0.00000
- *  N         7.0    0.03017      0.38347       0.00000
- * ...
- *
- **********************************************************/
-static int get_coordinates(FILE *file, qm_atom_t **atoms, int unit,
-                           int *numatoms) {
-  int i = 0;
-  int growarray = 0;
-
-  if (*numatoms<0) {
-    *atoms = (qm_atom_t*)calloc(1, sizeof(qm_atom_t));
-    growarray = 1;
-  }
-
-  /* Read in the coordinates until an empty line is reached.
-   * We expect 5 entries per line */
-  while (1) {
-    char buffer[BUFSIZ];
-    char atname[BUFSIZ];
-    float atomicnum;
-    float x,y,z, dum;
-    int n;
-    qm_atom_t *atm;
-
-    GET_LINE(buffer, file);
-
-    /* For FMO there is an additional atom index in the
-     * second column. Try both variants: */
-    n = sscanf(buffer,"%s %f %f %f %f %f",atname,&dum,&atomicnum,&x,&y,&z);
-    if (n!=6) {
-      n = sscanf(buffer,"%s %f %f %f %f",atname,&atomicnum,&x,&y,&z);
-    }
-    if (n!=5 && n!=6) break;
-
-    if (growarray && i>0) {
-      *atoms = (qm_atom_t*)realloc(*atoms, (i+1)*sizeof(qm_atom_t));
-    }
-    atm = (*atoms)+i;
-
-    strncpy(atm->type, atname, sizeof(atm->type));
-    atm->atomicnum = floor(atomicnum+0.5); /* nuclear charge */
-    /*printf("coor: %s %d %f %f %f\n", atm->type, atm->atomicnum, x, y, z);*/
-   
-    /* if coordinates are in Bohr convert them to Angstrom */
-    if (unit==BOHR) {
-      x *= BOHR_TO_ANGS;
-      y *= BOHR_TO_ANGS;
-      z *= BOHR_TO_ANGS;
-    }
-    
-    atm->x = x;
-    atm->y = y;
-    atm->z = z; 
-    i++;
-  }
-
-  /* If file is broken off in the middle of the coordinate block 
-   * we cannot use this frame. */
-  if (*numatoms>=0 && *numatoms!=i) {
-    (*numatoms) = i;
-    return FALSE;
-  }
-
-  (*numatoms) = i;
-  return TRUE;
-}
-
-
-/* Read coordinates from $FMOXYZ section in the INPUT CARD
- * listing at the beginning of the file. This is a method
- * of last resort used only for FMO calculations where no
- * coordinates are printed. */
-static int get_fmoxyz(FILE *file, qm_atom_t **atoms, int unit,
-                           int *numatoms) {
-  int i = 0;
-  int growarray = 0;
-
-  if (*numatoms<0) {
-    *atoms = (qm_atom_t*)calloc(1, sizeof(qm_atom_t));
-    growarray = 1;
-  }
-
-  /* Read in the coordinates until an empty line is reached.
-   * We expect 5 entries per line */
-  while (1) {
-    char buffer[BUFSIZ];
-    char atname[BUFSIZ], element[BUFSIZ];
-    float x,y,z;
-    int n;
-    qm_atom_t *atm;
-
-    GET_LINE(buffer, file);
-
-    /* skip " INPUT CARD>" at the beginning of the line */
-    n = sscanf(buffer+12,"%s %s %f %f %f",atname,element,&x,&y,&z);
-
-    if (n!=5) break;
-
-    if (growarray && i>0) {
-      *atoms = (qm_atom_t*)realloc(*atoms, (i+1)*sizeof(qm_atom_t));
-    }
-    atm = (*atoms)+i;
-
-    strncpy(atm->type, atname, sizeof(atm->type));
-    if (isalpha(element[0]))
-      atm->atomicnum = get_pte_idx_from_string(element);
-    else if (isdigit(element[0])) 
-      atm->atomicnum = floor(element[0]+0.5); /* nuclear charge */
-    else break;
-
-    /* If coordinates are in Bohr convert them to Angstrom */
-    if (unit==BOHR) {
-      x *= BOHR_TO_ANGS;
-      y *= BOHR_TO_ANGS;
-      z *= BOHR_TO_ANGS;
-    }
-    
-    atm->x = x;
-    atm->y = y;
-    atm->z = z; 
-    i++;
-  }
-
-  /* If file is broken off in the middle of the coordinate block 
-   * we cannot use this frame. */
-  if (*numatoms>=0 && *numatoms!=i) return FALSE;
-
-  (*numatoms) = i;
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Read data from the $CONTRL card from FIREFLY
- *
- **********************************************************/
-static int get_contrl_firefly(qmdata_t *data) {
-
-  char word[3][BUFSIZ];
-  char buffer[BUFSIZ];
-  char *temp;
-  long filepos;
-  filepos = ftell(data->file);
-
-  word[0][0] = '\0';
-  word[1][0] = '\0';
-  word[2][0] = '\0';
-  buffer[0] = '\0';
-
-  //printf("gamessplugin) Getting CONTRL group data for Firefly \n");
-
-  /* start scanning; currently we support
-   * RUNTYP = ENERGY, OPTIMIZE, SADPOINT, HESSIAN, SURFACE */
-  if (!pass_keyline(data->file, "$CONTRL OPTIONS", NULL)) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  eatline(data->file, 1);
-
-  /* current line contains SCFTYP, RUNTYP, EXETYP info; scan it */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-
-  /* check for supported RUNTYPs */
-  if      (!strcmp(&word[1][0],"RUNTYP=ENERGY")) {
-    data->runtype = MOLFILE_RUNTYPE_ENERGY;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=OPTIMIZE")) {
-    data->runtype = MOLFILE_RUNTYPE_OPTIMIZE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SADPOINT")) {
-    data->runtype = MOLFILE_RUNTYPE_SADPOINT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=HESSIAN")) {
-    data->runtype = MOLFILE_RUNTYPE_HESSIAN;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SURFACE")) {
-    data->runtype = MOLFILE_RUNTYPE_SURFACE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=GRADIENT")) {
-    data->runtype = MOLFILE_RUNTYPE_GRADIENT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=MEX")) {
-    data->runtype = MOLFILE_RUNTYPE_MEX;
-  }
-  else {
-#ifdef DEBUGGING
-    printf("gamessplugin) The %s is currently not supported \n",
-           &word[1][0]);
-#endif
-    data->runtype = MOLFILE_RUNTYPE_UNKNOWN;
-  }
-  printf("gamessplugin) File generated via %s \n",&word[1][0]);
-
-
-  /* determine SCFTYP */
-  if (!strcmp(&word[0][0],"SCFTYP=RHF")) {
-    data->scftype = MOLFILE_SCFTYPE_RHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=UHF")) {
-    data->scftype = MOLFILE_SCFTYPE_UHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=ROHF")) {
-    data->scftype = MOLFILE_SCFTYPE_ROHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=GVB")) {
-    data->scftype = MOLFILE_SCFTYPE_GVB;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=MCSCF")) {
-    data->scftype = MOLFILE_SCFTYPE_MCSCF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=NONE")) {
-    data->scftype = MOLFILE_SCFTYPE_NONE;
-  }
-  else {
-    /* if we don't find a supported SCFTYP we bomb out; this
-     * might be a little drastic */
-    printf("gamessplugin) %s is currently not supported \n",
-           &word[0][0]);
-    return FALSE;
-  }
-  printf("gamessplugin) Type of wavefunction used %s \n",
-         &word[0][0]);
-
-  /* scan for MPLEVL, LOCAL and UNITS; */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s %*s %s",&word[0][0],&word[1][0],&word[2][0]);
-  data->mplevel = atoi(&word[1][0]);
-
-  /* scan for MULT, ICHARG and MAXIT; */
-  GET_LINE(buffer, data->file);
-  //sscanf(buffer,"%*s %*s %*s %*s %s %s",&word[0][0],&word[1][0]);
-
-  /* find the coordinate type in next line */
-  while ( (temp=strstr(buffer,"COORD =")) == NULL ) {
-    GET_LINE(buffer, data->file);;
-  }
-  strncpy(data->geometry, trimright(temp+7), sizeof(data->geometry)); 
-  printf("gamessplugin) Coordinate type used is %s \n", data->geometry);
-
-  while ( (temp=strstr(buffer,"CITYP =")) == NULL ) {
-    GET_LINE(buffer, data->file);;
-  }
-  strncpy(buffer, trimright(temp+7), 8); 
-
-  /* determine CITYP */
-  if      (!strcmp(buffer,"NONE"))  data->citype = CI_NONE;
-  else if (!strcmp(buffer,"CIS"))   data->citype = CI_CIS;
-  else if (!strcmp(buffer,"ALDET")) data->citype = CI_ALDET;
-  else if (!strcmp(buffer,"ORMAS")) data->citype = CI_ORMAS;
-  else if (!strcmp(buffer,"GUGA"))  data->citype = CI_GUGA;
-  else if (!strcmp(buffer,"FSOCI")) data->citype = CI_FSOCI;
-  else if (!strcmp(buffer,"GENCI")) data->citype = CI_GENCI;
-  else                                    data->citype = CI_UNKNOWN;
-  printf("gamessplugin) CI method %s \n",buffer);
-
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %*s",&word[0][0]);
-
-  /* scan for DFTTYP, TDDFT info; */
-  if (!strncmp(&word[0][0],"DFTTYP=", 7)) {
-    printf("gamessplugin) Density functional used is %s \n",&word[0][7]);
-    GET_LINE(buffer, data->file);
-  }
-
-
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Read data from the $CONTRL card from GAMESS
- *
- **********************************************************/
-static int get_contrl(qmdata_t *data) {
-
-  char word[3][BUFSIZ];
-  char buffer[BUFSIZ];
-  char *temp;
-  long filepos;
-  filepos = ftell(data->file);
-
-  word[0][0] = '\0';
-  word[1][0] = '\0';
-  word[2][0] = '\0';
-  buffer[0] = '\0';
-
-
-  /* start scanning; currently we support
-   * RUNTYP = ENERGY, OPTIMIZE, SADPOINT, HESSIAN, SURFACE */
-  if (!pass_keyline(data->file, "$CONTRL OPTIONS", NULL)) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  eatline(data->file, 1);
-
-  /* current line contains SCFTYP, RUNTYP, EXETYP info; scan it */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-
-  /* check for supported RUNTYPs */
-  if      (!strcmp(&word[1][0],"RUNTYP=ENERGY")) {
-    data->runtype = MOLFILE_RUNTYPE_ENERGY;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=OPTIMIZE")) {
-    data->runtype = MOLFILE_RUNTYPE_OPTIMIZE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SADPOINT")) {
-    data->runtype = MOLFILE_RUNTYPE_SADPOINT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=HESSIAN")) {
-    data->runtype = MOLFILE_RUNTYPE_HESSIAN;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SURFACE")) {
-    data->runtype = MOLFILE_RUNTYPE_SURFACE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=GRADIENT")) {
-    data->runtype = MOLFILE_RUNTYPE_GRADIENT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=MEX")) {
-    data->runtype = MOLFILE_RUNTYPE_MEX;
-  }
-  else {
-#ifdef DEBUGGING
-    printf("gamessplugin) The %s is currently not supported \n",
-           &word[1][0]);
-#endif
-    data->runtype = MOLFILE_RUNTYPE_UNKNOWN;
-  }
-  printf("gamessplugin) File generated via %s \n",&word[1][0]);
-
-
-  /* determine SCFTYP */
-  if (!strcmp(&word[0][0],"SCFTYP=RHF")) {
-    data->scftype = MOLFILE_SCFTYPE_RHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=UHF")) {
-    data->scftype = MOLFILE_SCFTYPE_UHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=ROHF")) {
-    data->scftype = MOLFILE_SCFTYPE_ROHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=GVB")) {
-    data->scftype = MOLFILE_SCFTYPE_GVB;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=MCSCF")) {
-    data->scftype = MOLFILE_SCFTYPE_MCSCF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=NONE")) {
-    data->scftype = MOLFILE_SCFTYPE_NONE;
-  }
-  else {
-    /* if we don't find a supported SCFTYP we bomb out; this
-     * might be a little drastic */
-    printf("gamessplugin) %s is currently not supported \n",
-           &word[0][0]);
-    return FALSE;
-  }
-  printf("gamessplugin) Type of wavefunction used %s \n",
-         &word[0][0]);
-
-  /* scan for MPLEVL, CITYP, CCTYP, VBTYP info; */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s %*s %s",&word[0][0],&word[1][0],&word[2][0]);
-
-  if (!strcmp(&word[0][0],"MPLEVL=")) {
-    /* Moller-Plesset perturbation level */
-    printf("gamessplugin) MP perturbation level %s \n",&word[1][0]);
-    data->mplevel = atoi(&word[1][0]);
-
-    /* determine CITYP */
-    if      (!strcmp(&word[2][0],"=NONE"))  data->citype = CI_NONE;
-    else if (!strcmp(&word[2][0],"=CIS"))   data->citype = CI_CIS;
-    else if (!strcmp(&word[2][0],"=ALDET")) data->citype = CI_ALDET;
-    else if (!strcmp(&word[2][0],"=ORMAS")) data->citype = CI_ORMAS;
-    else if (!strcmp(&word[2][0],"=GUGA"))  data->citype = CI_GUGA;
-    else if (!strcmp(&word[2][0],"=FSOCI")) data->citype = CI_FSOCI;
-    else if (!strcmp(&word[2][0],"=GENCI")) data->citype = CI_GENCI;
-    else                                    data->citype = CI_UNKNOWN;
-    printf("gamessplugin) CI method %s \n",&word[2][1]);
-
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-  }
-
-  /* scan for DFTTYP, TDDFT info; */
-  if (!strncmp(&word[0][0],"DFTTYP=", 7)) {
-    printf("gamessplugin) Density functional used is %s \n",&word[0][7]);
-    GET_LINE(buffer, data->file);
-  }
-
-
-  /* find the coordinate type in next line */
-  while ( (temp=strstr(buffer,"COORD =")) == NULL ) {
-    GET_LINE(buffer, data->file);;
-  }
-  strncpy(data->geometry, trimright(temp+7), sizeof(data->geometry)); 
-  printf("gamessplugin) Coordinate type used is %s \n", data->geometry);
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE;
-}
-
-
-/* Read input parameters regarding calculation of 
- * certain molecular properties such as electrostatic
- * moments and the MEP. */
-static int get_properties_input(qmdata_t *data) {
-  /* TODO!! */
-  return TRUE;
-}
-
-
-/* Read symmetry point group and highest axis.
- * Currently these values are not used yet, but if this
- * section was not found the file is corrupt. */
-static int get_symmetry(qmdata_t *data) {
-  char buffer[BUFSIZ];
-  char *sep, tmp[BUFSIZ];
-
-  //will need to go back somewhat in future to
-  //check for XMCQDPT calculation
-  long filepos = ftell(data->file);
-
-  if (goto_keyline(data->file, "THE POINT GROUP IS",
-		    "1 ELECTRON INTEGRALS", NULL) != FOUND) {
-    printf("gamessplugin) No symmetry info found!\n");
-    return FALSE;
-  }
-
-  GET_LINE(buffer, data->file);
-  sscanf(buffer," THE POINT GROUP IS %s", data->pointgroup);
-
-  sep = strchr(data->pointgroup, ',');
-  if (sep) *sep = '\0';
-  trimright(data->pointgroup);
-
-  sep = strstr(buffer, "NAXIS=") + 6;
-  strncpy(tmp, sep, 2); tmp[2] = '\0';
-  data->naxis = atoi(tmp);
-
-  sep = strstr(buffer, "ORDER=") + 6;
-  sscanf(sep, "%d", &data->order);
-
-  printf("gamessplugin) Point group = %s, naxis = %d, order = %d\n",
-         data->pointgroup, data->naxis, data->order);
-
-  fseek(data->file, filepos, SEEK_SET);
-
-  return TRUE;
-}
-
-
-/* Read MCSCF input data */
-static int get_mcscf(qmdata_t *data) {
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-  char buffer[BUFSIZ];
-  char *temp;
-  long filepos;
-  int tmp;
-
-  filepos = ftell(data->file);
-
-  if (gms->have_pcgamess){
-      if (pass_keyline(data->file,"XMCQDPT INPUT PARAMETERS",
-                        "DONE SETTING UP THE RUN") != FOUND) {
-         //STANDARD MCSCF in GAMESS
-         if(pass_keyline(data->file, "MCSCF CALCULATION",
-                       "ITER     TOTAL ENERGY") != FOUND)
-                return FALSE;
-
-          if (goto_keyline(data->file, "-CORE-    -INTERNAL-  -EXTERNAL-",
-                           "ITER     TOTAL ENERGY", NULL) != FOUND)
-            return FALSE;
-
-          while ( (temp=strstr(buffer,"NFZC=")) == NULL ) {
-            GET_LINE(buffer, data->file);
-          }
-          strncpy(buffer, trimright(temp+6), 5); 
-          sscanf(buffer, "%d", &data->mcscf_num_core);
-
-          while ( (temp=strstr(buffer,"NMCC=")) == NULL ) {
-            GET_LINE(buffer, data->file);
-          }
-          strncpy(buffer, trimright(temp+6), 5); 
-          sscanf(buffer, "%d", &tmp);
-          data-> mcscf_num_core += tmp;
-          printf("gamessplugin) Number of MCSCF core orbitals = %d\n",
-             data->mcscf_num_core);
-      }
-      else{
-          //XMCQDPT
-          while ( (temp=strstr(buffer,"# OF FROZEN CORE ORBITALS")) == NULL ) {
-            GET_LINE(buffer, data->file);
-          }
-          sscanf(buffer, "%*s %*s %*s %*s %*s %*s %d",&data->mcscf_num_core);
-
-          GET_LINE(buffer,data->file);
-          sscanf(buffer, "%*s %*s %*s %*s %*s %*s %d",&tmp);
-          data->mcscf_num_core += tmp;
-          printf("gamessplugin) Number of MCSCF core orbitals = %d\n",
-             data->mcscf_num_core);
-          printf("gamessplugin) XMCQDPT2 not supported.\n");
-          //set scftype to none since XMCQDPT2 not supported
-          data->scftype = MOLFILE_SCFTYPE_NONE;
-
-      } 
-  } 
-  else {
-      if (pass_keyline(data->file, "MCSCF CALCULATION",
-                       "ITER     TOTAL ENERGY") != FOUND)
-        return FALSE;
-
-      if (goto_keyline(data->file, "NUMBER OF CORE ORBITALS",
-                       "ITER     TOTAL ENERGY", NULL) != FOUND)
-        return FALSE;
-
-      GET_LINE(buffer, data->file);
-      sscanf(buffer," NUMBER OF CORE ORBITALS          = %d",
-             &data->mcscf_num_core);
-
-      printf("gamessplugin) Number of MCSCF core orbitals = %d\n",
-         data->mcscf_num_core);
-  }
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE;
-}
-
-
-/* Read the first trajectory frame. */
-static int read_first_frame(qmdata_t *data) {
-  /* The angular momentum is populated in get_wavefunction 
-   * which is called by get_traj_frame(). We have obtained
-   * the array size wavef_size already from the basis set
-   * statistics */
-  data->angular_momentum = (int*)calloc(3*data->wavef_size, sizeof(int));
-
-  /* Try reading the first frame. 
-   * If there is only one frame then also read the
-   * final wavefunction. */
-  if (!get_traj_frame(data, data->atoms, data->numatoms)) {
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-/******************************************************
- *
- * Reads the info printed after the geometry search
- * has finished or whatever analysis was done in a 
- * single point run, e.g. ESP charges, Hessian, etc.
- * Rewinds to the beginning of the search when done,
- * because we read this part at in the initial phase
- * and might have to look for additional timesteps
- * later.
- *
- ******************************************************/
-static int get_final_properties(qmdata_t *data) {
-  qm_timestep_t *ts;
-  long filepos;
-  filepos = ftell(data->file);
-  ts = data->qm_timestep + data->num_frames-1;
-
-  /* Go to end of trajectory */
-  fseek(data->file, data->end_of_traj, SEEK_SET);
-
-  printf("gamessplugin) Reading final properties section (timestep %d):\n",
-         data->num_frames-1);
-  printf("gamessplugin) ===============================================\n");
-
-  /* Read population analysis (Mulliken and Lowdin charges),
-   * but only if wasn't read already (while parsing the first
-   * timestep). */
-  if (!ts->have_mulliken && get_population(data, ts)) {
-    printf("gamessplugin) Mulliken charges found\n");
-  }
-
-  if (get_esp_charges(data)) {
-    printf("gamessplugin) ESP charges found\n");
-  } 
-
-  if (data->runtype == MOLFILE_RUNTYPE_GRADIENT ||
-      data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    if (get_final_gradient(data, ts)) {
-      printf("gamessplugin) Final gradient found\n");
-    }
-  }
-
-
-  if (data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    /* try reading the hessian matrix in internal and
-     * cartesian coordinates as well as the internal
-     * coordinates together with their associated
-     * force constants */
-    
-    if (!get_int_hessian(data)) {
-      printf("gamessplugin) No internal Hessian matrix found.\n");
-    }
-    if (!get_cart_hessian(data)) {
-      printf("gamessplugin) \n");
-      printf("gamessplugin) Could not determine the cartesian \n");
-      printf("gamessplugin) Hessian matrix!! \n");
-      printf("gamessplugin) \n");
-    }
-
-    /* read the wavenumbers, intensities of the normal modes 
-     * as well as the modes themselves */
-    if (!get_normal_modes(data)) {
-      printf("gamessplugin) \n");
-      printf("gamessplugin) No normal modes found.\n");
-      printf("gamessplugin) \n");
-    }
-  }
-
-  /* Read localized orbitals if there are any */
-  read_localized_orbitals(data);
-
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE; 
-}
-
-
-/* Read localized orbitals (Boys/Ruedenberg/Pipek) */
-static int read_localized_orbitals(qmdata_t *data) {
-  int i;
-  qm_timestep_t *ts;
-  qm_wavefunction_t *wavef;
-
-  /* Move past the listing of the canonical MOs */
-  pass_keyline(data->file, "ENERGY COMPONENTS", NULL);
-
-  ts = data->qm_timestep + data->num_frames-1;
-
-  for (i=0; i<2; i++) {
-    wavef = add_wavefunction(ts);
-
-    if (get_wavefunction(data, ts, wavef) == FALSE ||
-        (wavef->type!=MOLFILE_WAVE_BOYS &&
-         wavef->type!=MOLFILE_WAVE_PIPEK &&
-         wavef->type!=MOLFILE_WAVE_RUEDEN)) {
-      del_wavefunction(ts);
-      return FALSE;
-    }
-    else {
-      char typestr[64];
-      if (wavef->spin==SPIN_ALPHA) {
-        strcpy(typestr, "alpha");
-      }
-      else if (wavef->spin==SPIN_BETA) {
-        strcpy(typestr, "beta");
-      }
-      wavef->mult = data->multiplicity;
-      wavef->energy = ts->scfenergies[ts->num_scfiter-1];
-
-      printf("gamessplugin) Localized orbitals (%s) found for timestep %d\n",
-             typestr, data->num_frames-1);
-    }
-  }
-
-  return TRUE;
-}
-
-
-
-/********************************************************
- *
- * Read basis set and orbital statistics such as
- * # of shells, # of A/B orbitals, # of electrons, 
- * multiplicity and total charge
- *
- ********************************************************/
-static int get_basis_stats(qmdata_t *data) {
-
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-
-  char buffer[BUFSIZ];
-  char word[7][BUFSIZ];
-  int i;
-
-  buffer[0] = '\0';
-  for (i=0; i<7; i++) word[i][0] = '\0';
-
-  /* look for the orbital/charge/... info section */
-  if(gms->have_pcgamess){
-    if (!pass_keyline(data->file, "TOTAL NUMBER OF SHELLS", NULL)){
-        printf("ERROR!\n");
-        return FALSE;
-     }
-      /* # cartesian gaussian function = wavefunction size */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %d",
-             &(data->wavef_size));
-
-      /* number of electrons */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->num_electrons));
-
-      /* charge of the molecule */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->totalcharge));
-
-      /* Multiplicity of the molecule.
-       * Multiplicity is actually defined per wavefunction
-       * but in some cases where there's only one wavefunction
-       * in the output or they all have the same multiplicity
-       * it will not be printed with the wavefunction.
-       * Thus we use this one as default value. */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %d",
-             &(data->multiplicity));
-
-      /* number of A orbitals */
-      /* Note the different number of items per line for A/B orbitals
-       * due to "(ALPHA)" and "(BETA )" !! */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_A)); 
-        
-      /* number of B orbitals */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_B)); 
-
-  }
-  else {
-    if (!pass_keyline(data->file, "TOTAL NUMBER OF BASIS", NULL))
-        return FALSE;
-
-      /* # cartesian gaussian function = wavefunction size */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %*s %d",
-             &(data->wavef_size));
-
-      /* number of electrons */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->num_electrons));
-
-      /* charge of the molecule */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->totalcharge));
-
-      /* Multiplicity of the molecule.
-       * Multiplicity is actually defined per wavefunction
-       * but in some cases where there's only one wavefunction
-       * in the output or they all have the same multiplicity
-       * it will not be printed with the wavefunction.
-       * Thus we use this one as default value. */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %d",
-             &(data->multiplicity));
-
-      /* number of A orbitals */
-      /* Note the different number of items per line for A/B orbitals
-       * due to "(ALPHA)" and "(BETA )" !! */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_A)); 
-        
-      /* number of B orbitals */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_B)); 
-  }
-
-
-  printf("gamessplugin) Number of Electrons: %d \n",
-      data->num_electrons);
-
-  printf("gamessplugin) Charge of Molecule : %d \n",
-      data->totalcharge);
-
-  printf("gamessplugin) Multiplicity of Wavefunction: %d \n",
-      data->multiplicity);
-
-  printf("gamessplugin) Number of occupied A / B orbitals: %d / %d \n",\
-      data->num_occupied_A, data->num_occupied_B);
-
-  printf("gamessplugin) Number of gaussian basis functions: %d \n",\
-      data->wavef_size);
-
- 
-  return TRUE;
-}
-
-
-
-/*******************************************************
- *
- * Reads in the $GUESS options.
- *
- * ******************************************************/
-static int get_guess_options(qmdata_t *data)
-{
-  char word[BUFSIZ];
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(data->file);
-
-  /* initialize buffers */
-  buffer[0] = '\0';
-  word[0]   = '\0';
-
-  /* parse for GUESS field */
-  if (pass_keyline(data->file, "GUESS OPTIONS",
-                   "2 ELECTRON INTEGRALS") != FOUND) {
-    printf("gamessplugin) No GUESS OPTIONS found.\n");
-    fseek(data->file, filepos, SEEK_SET);
-
-    /* This section id not mandatory, there are a few
-       calculation types the don't print it, so we
-       always return TRUE*/
-    return TRUE;
-  }
-
-  /* next line contains all we need */
-  eatline(data->file, 1);
-  GET_LINE(buffer, data->file);
-  sscanf(buffer," GUESS %s NORB",&word[0]);
-
-  /* the first character is '=', we skip it */
-  strncpy(data->guess,&word[1], sizeof(data->guess));
-
-  printf("gamessplugin) Run was performed with GUESS = %s \n",
-	  data->guess);
-
- /* Since this block occurs in the middle of first frame
-  * we need to rewind. */
-  fseek(data->file, filepos, SEEK_SET);
-
-  return TRUE;
-}
-
-
-
-/*******************************************************
- *
- * Read the basis set data into hierarchical structures.
- * L-shells are expanded into an S-shell and a P-shell.
- *
- * ******************************************************/
-int get_basis(qmdata_t *data) {
-
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-
-  char buffer[BUFSIZ];
-  char word[4][BUFSIZ];
-  int i = 0; 
-  int success = 0;
-  int numread, numshells;
-  shell_t *shell;
-  long filepos;
-
-  if (!strcmp(data->gbasis, "MNDO") ||
-      !strcmp(data->gbasis, "AM1")  ||
-      !strcmp(data->gbasis, "PM3")) {
-    /* Semiempirical methods are based on STOs.
-     * The only parameter we need for orbital rendering
-     * are the exponents zeta for S, P, D,... shells for
-     * each atom. Since GAMESS doesn't print these values
-     * we skip reading the basis set and hardcode the
-     * parameters in tables in VMD. */
-    return TRUE;
-  }
-
-  /* Search for "ATOMIC BASIS SET" line */
-  if (pass_keyline(data->file, "ATOMIC BASIS SET", 
-                    "$CONTRL OPTIONS") !=FOUND ) {
-    printf("gamessplugin) No basis set found!\n");
-
-    return FALSE;
-  }
-
-  /* initialize buffers */
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-  
-
-  /* skip the next 5 lines */
-  eatline(data->file, 5);
-
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  data->basis_set = (basis_atom_t*)calloc(data->numatoms, sizeof(basis_atom_t));
-
-
-  i = 0; /* basis atom counter */
-
-  do {
-    prim_t *prim = NULL;
-    char shelltype;
-    int numprim = 0;
-    int icoeff = 0;
-    filepos = ftell(data->file);
-    GET_LINE(buffer, data->file);
-      
-    /* Count the number of relevant words in the line. */
-    numread = sscanf(buffer,"%s %s %s %s",&word[0][0], &word[1][0],
-           &word[2][0], &word[3][0]);
-
-    switch (numread) {
-      case 1:
-        /* Next atom */
-        strcpy(data->basis_set[i].name, &word[0][0]);
-
-        /* skip initial blank line */
-        eatline(data->file, 1);
-
-        /* read the basis set for the current atom */
-        shell = (shell_t*)calloc(1, sizeof(shell_t)); 
-        numshells = 0;
-
-        do {
-          filepos = ftell(data->file);
-          numprim = read_shell_primitives(data, &prim, &shelltype, icoeff, gms->have_pcgamess);
-
-          if (numprim>0) {
-            /* make sure we have eiter S, L, P, D, F or G shells */
-            if ( (shelltype!='S' && shelltype!='L' && shelltype!='P' && 
-                  shelltype!='D' && shelltype!='F' && shelltype!='G') ) {
-              printf("gamessplugin) WARNING ... %c shells are not supported \n", shelltype);
-            }
-            
-            /* create new shell */
-            if (numshells) {
-              shell = (shell_t*)realloc(shell, (numshells+1)*sizeof(shell_t));
-            }
-            shell[numshells].numprims = numprim;
-            /* assign a numeric shell type */
-            shell[numshells].type = shelltype_int(shelltype);
-            shell[numshells].prim = prim;
-            data->num_basis_funcs += numprim;
-
-            /* We split L-shells into one S and one P-shell.
-             * I.e. for L-shells we have to go back read the shell again
-             * this time using the second contraction coefficients. */
-            if (shelltype=='L' && !icoeff) {
-              fseek(data->file, filepos, SEEK_SET);
-              icoeff++;
-            } else if (shelltype=='L' && icoeff) {
-              shell[numshells].type = SP_P_SHELL;
-              icoeff = 0;  /* reset the counter */
-            }
-
-            numshells++;
-          }
-        } while (numprim);
-
-        /* store shells in atom */
-        data->basis_set[i].numshells = numshells;
-        data->basis_set[i].shell = shell;
-
-        /* Update total number of basis functions */
-        data->num_shells += numshells;
-        i++;
-
-        /* go back one line so that we can read the name of the
-         * next atom */
-        fseek(data->file, filepos, SEEK_SET);
-
-        break;
-
-      case 4:
-        /* this is the very end of the basis set */
-        if(gms->have_pcgamess){
-            if (!strcmp(&word[0][0],"TOTAL")  &&
-                !strcmp(&word[1][0],"NUMBER") && 
-                !strcmp(&word[2][0],"OF")     &&
-                !strcmp(&word[3][0],"SHELLS")) {
-              success = 1;
-              /* go back one line so that get_basis_stats()
-                 can use this line as a keystring. */
-              fseek(data->file, filepos, SEEK_SET);
-            }
-        }
-        else {
-            if (!strcmp(&word[0][0],"TOTAL")  &&
-                !strcmp(&word[1][0],"NUMBER") && 
-                !strcmp(&word[2][0],"OF")     &&
-                !strcmp(&word[3][0],"BASIS")) {
-              success = 1;
-              /* go back one line so that get_basis_stats()
-                 can use this line as a keystring. */
-              fseek(data->file, filepos, SEEK_SET);
-            }
-        }
-        break;
-    }
-
-  } while (!success);
-
-
-  printf("gamessplugin) Parsed %d uncontracted basis functions for %d atoms.\n",
-         data->num_basis_funcs, i);
-
-  data->num_basis_atoms = i;
-
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- *
- * Convert shell type from char to int.
- *
- ************************************************ */
-static int shelltype_int(char type) {
-  int shelltype;
-
-  switch (type) {
-    case 'L':
-      /* SP_P shells are assigned in get_basis() */
-      shelltype = SP_S_SHELL;
-      break;
-    case 'S':
-      shelltype = S_SHELL;
-      break;
-    case 'P':
-      shelltype = P_SHELL;
-      break;
-    case 'D':
-      shelltype = D_SHELL;
-      break;
-    case 'F':
-      shelltype = F_SHELL;
-      break;
-    case 'G':
-      shelltype = G_SHELL;
-      break;
-    default:
-      shelltype = UNK_SHELL;
-      break;
-  }
-
-  return shelltype;
-}
-
-
-
-/******************************************************
- *
- * Populate the flat arrays containing the basis
- * set data.
- *
- ******************************************************/
-static int fill_basis_arrays(qmdata_t *data) {
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0;
-
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_types;
-  int *atomicnum_per_basisatom;
-
-  /* Count the total number of primitives which
-   * determines the size of the basis array. */
-  for(i=0; i<data->num_basis_atoms; i++) {
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      primcount += data->basis_set[i].shell[j].numprims;
-    }
-  }
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per basis function, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  basis = (float *)calloc(2*primcount,sizeof(float));
-
-  /* make sure memory was allocated properly */
-  if (basis == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  shell_types = (int *)calloc(data->num_shells, sizeof(int));
-  
-  /* make sure memory was allocated properly */
-  if (shell_types == NULL) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  num_shells_per_atom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_shells_per_atom == NULL) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  num_prim_per_shell = (int *)calloc(data->num_shells, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_prim_per_shell == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  atomicnum_per_basisatom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (atomicnum_per_basisatom == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* store pointers in struct qmdata_t */
-  data->basis = basis;
-  data->shell_types = shell_types;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell = num_prim_per_shell;
-  data->atomicnum_per_basisatom = atomicnum_per_basisatom;
-
-  /* Go through all basis set atoms and try to assign the
-   * atomic numbers. The basis set atoms are specified by 
-   * name strings (the same as in the coordinate section,
-   * except for FMO calcs.) and we try to match the names
-   * from the two lists. The basis set atom list is symmetry
-   * unique while the coordinate atom list is complete.*/
-  primcount = 0;
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int found = 0;
-
-    /* For this basis atom find a matching atom from the
-     * coordinate atom list. */
-    for(j=0; j<data->numatoms; j++) {
-      char basisname[BUFSIZ];
-      strcpy(basisname, data->basis_set[i].name);
-
-      /* for FMO calculations we have to strip the "-n" tail
-       * of the basis atom name. */
-      if (gms->have_fmo) {
-        *strchr(basisname, '-') = '\0';
-      }
-
-      if (!strcmp(data->atoms[j].type, basisname)) {
-        found = 1;
-        break;
-      }
-    }
-    if (!found) {
-      printf("gamessplugin) WARNING: Couldn't find atomic number for basis set atom %s\n",
-             data->basis_set[i].name);
-      data->basis_set[i].atomicnum = 0;
-      atomicnum_per_basisatom[i] = 0;
-    } else {
-      /* assign atomic number */
-      data->basis_set[i].atomicnum = data->atoms[j].atomicnum;
-      atomicnum_per_basisatom[i]   = data->atoms[j].atomicnum;
-    }
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_types[shellcount] = data->basis_set[i].shell[j].type;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * read all primitives for the current shell
- *
- ******************************************************/
-static int read_shell_primitives(qmdata_t *data, prim_t **prim, char *shelltype,
-                                 int icoeff, int pcgamess) {
-  char buffer[BUFSIZ];
-  float exponent = 0.0; 
-  float contract[2] = {0.0, 0.0};
-  int shell, success;
-  int primcounter = 0;
-  (*prim) = (prim_t*)calloc(1, sizeof(prim_t));
-
-  do {
-    GET_LINE(buffer, data->file);
-      if (pcgamess)
-        success = sscanf(buffer,"%d %c %*s %f %f %*s %*s %f", &shell,
-                       shelltype,
-                       &exponent, &contract[0], &contract[1]); 
-
-      else
-        success = sscanf(buffer,"%d %c %*s %f %f %f", &shell,
-                       shelltype,
-                       &exponent, &contract[0], &contract[1]); 
-
-    /* store in basis array and increase the counter */ 
-    switch (success) {
-      case 4:
-        if (primcounter) {
-          *prim = (prim_t*)realloc(*prim, (primcounter+1)*sizeof(prim_t));
-        }
-
-        /* store exponent */
-        (*prim)[primcounter].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[primcounter].contraction_coeff = contract[0];
-        
-        primcounter++;
-        break;
-
-      case 5:
-        if (primcounter) {
-          *prim = (prim_t*)realloc(*prim, (primcounter+1)*sizeof(prim_t));
-        }
-
-        /* store exponent */
-        (*prim)[primcounter].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[primcounter].contraction_coeff = contract[icoeff];
-        
-        primcounter++;
-        break;
-
-      case -1:
-        /* otherwise it's an empty line which represents the end of the shell */
-        break;
-
-      case 1:
-        /* the user had given the next atom a numeric name */
-        success = -1;
-        break;
-    }
-
-  } while(success>0);
-
-  if (!primcounter) free(*prim);
-
-  return primcounter;
-}
-
-
-
-/******************************************************
- *
- * this function extracts the trajectory information
- * from the output file
- *
- * *****************************************************/
-static int get_traj_frame(qmdata_t *data, qm_atom_t *atoms,
-                          int natoms) {
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-  qm_timestep_t *cur_ts;
-  char buffer[BUFSIZ];
-  char word[BUFSIZ];
-  int units;
-  buffer[0] = '\0';
-  word[0]   = '\0';
-
-  printf("gamessplugin) Timestep %d:\n", data->num_frames_read);
-  printf("gamessplugin) ============\n");
-
-  fseek(data->file, data->filepos_array[data->num_frames_read], SEEK_SET);
-
-  /* Read the coordinate block */
-  if (data->runtype==MOLFILE_RUNTYPE_OPTIMIZE ||
-      data->runtype==MOLFILE_RUNTYPE_SADPOINT) {
-    goto_keyline(data->file, "COORDINATES OF ALL ATOMS", NULL);
-    /* get the units */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, " COORDINATES OF ALL ATOMS ARE %s", word);
-    units = !strcmp(word, "(BOHR)");
-    eatline(data->file, 2);
-
-    if (!get_coordinates(data->file, &data->atoms, units, &natoms)) {
-      printf("gamessplugin) Couldn't find coordinates for timestep %d\n", data->num_frames_read);
-    }
-  }
-  else if (data->runtype==MOLFILE_RUNTYPE_SURFACE) {
-    if (pass_keyline(data->file, "HAS ENERGY VALUE",
-                     "...... END OF ONE-ELECTRON INTEGRALS ......")
-        == FOUND) {
-      /* Read the coordinate block following 
-       * ---- SURFACE MAPPING GEOMETRY ---- */
-      int i, n;
-      for (i=0; i<natoms; i++) {
-        char atname[BUFSIZ];
-        float x,y,z;
-        GET_LINE(buffer, data->file);
-        n = sscanf(buffer,"%s %f %f %f", atname, &x,&y,&z);
-        if (n!=4 || strcmp(atname, data->atoms[i].type)) break;
-        data->atoms[i].x = x;
-        data->atoms[i].y = y;
-        data->atoms[i].z = z;
-      }
-      if (i!=natoms) {
-        printf("gamessplugin) Couldn't read surface mapping geometry for timestep %d\n", data->num_frames_read);
-      }
-    }
-    else {
-      /* Read the coordinate block following 
-       * ATOM      ATOMIC                      COORDINATES (BOHR) */
-      goto_keyline(data->file, "ATOM      ATOMIC", NULL);
-      /* get the units */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer, " ATOM      ATOMIC                      COORDINATES %s", word);
-      units = !strcmp(word, "(BOHR)");
-      eatline(data->file, 1);
-      
-      if (!get_coordinates(data->file, &data->atoms, units, &natoms)) {
-        printf("gamessplugin) Couldn't find coordinates for timestep %d\n", data->num_frames_read);
-      }
-    }
-  }
-  /* XXX could merge this with OPTIMIZE/SADPOINT */
-  else if (data->runtype==MOLFILE_RUNTYPE_MEX) {
-    int numuniqueatoms = natoms;
-    goto_keyline(data->file, "COORDINATES OF SYMMETRY UNIQUE ATOMS", NULL);
-    /* get the units */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, " COORDINATES OF SYMMETRY UNIQUE ATOMS ARE %s", word);
-    units = !strcmp(word, "(BOHR)");
-    eatline(data->file, 2);
-    if (!get_coordinates(data->file, &data->atoms, units, &numuniqueatoms)) {
-      printf("gamessplugin) Expanding symmetry unique coordinates for timestep %d\n", data->num_frames_read);
-
-      /* Create images of symmetry unique atoms so that we have
-       * the full coordinate set. */
-      symmetry_expand(&data->atoms, numuniqueatoms, natoms,
-                      data->pointgroup, data->naxis);
-    }
-  }
-
-  /* For FMO calculations we read the coordinates only
-   * because the wavefunctions are printed per fragment
-   * and VMD requires that there's a wavefunction present
-   * for each atom.
-   * A possible workaround would be to pad the wavefunctions
-   * accordingly and add a wavefunction for each fragment. */
-  if (gms->have_fmo) {
-    data->num_frames_read++;
-    return TRUE;
-  }
-
-  /* get a convenient pointer to the current qm timestep */
-  cur_ts = data->qm_timestep + data->num_frames_read;
-
-  /* read the SCF energies */
-  if (get_scfdata(data, cur_ts) == FALSE) {
-    printf("gamessplugin) Couldn't find SCF iterations for timestep %d\n",
-           data->num_frames_read);
-  }
-
-  /* Try reading canonical alpha/beta wavefunction */
-  check_add_wavefunctions(data, cur_ts);
-
-
-  /* Read population analysis (Mulliken and Lowdin charges)
-   * only if wasn't read already while parsing the final
-   * property section. Otherwise we would potentially 
-   * overwrite the data with empty fields. */
-  if (!cur_ts->have_mulliken &&
-      get_population(data, cur_ts)) {
-    printf("gamessplugin) Mulliken/Loewdin charges found\n");
-  }
-
-  if (data->citype==CI_GUGA) {
-    if (pass_keyline(data->file, "CI DENSITY MATRIX AND NATURAL ORBITALS",
-                       "GRADIENT (HARTREE/BOHR)")) {
-      int i, numstates=0, state;
-      qm_wavefunction_t *wave_ci;
-      goto_keyline(data->file, "NUMBER OF STATES", NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer, " NUMBER OF STATES = %d", &numstates);
-      printf("gamessplugin) Number of CI states = %d\n", numstates);
-
-      for (i=0; i<numstates; i++) {
-        float cienergy = 0.f;
-        goto_keyline(data->file, "CI EIGENSTATE", NULL);
-        GET_LINE(buffer, data->file);
-        sscanf(buffer," CI EIGENSTATE %d %*s %*s %*s %f", &state, &cienergy);
-        printf("gamessplugin) CI energy[%d] = %f\n", state-1, cienergy);
-
-        wave_ci = add_wavefunction(cur_ts);
-
-        if (get_wavefunction(data, cur_ts, wave_ci) == FALSE) {
-          del_wavefunction(cur_ts);
-          break;
-        }
-        else {
-          /* canon =-1;*/
-          wave_ci->exci = state-1;
-          wave_ci->energy = cienergy;
-          wave_ci->mult = data->multiplicity;
-
-          printf("gamessplugin) Found %d CI natural orbitals for excited state %d, mult=%d\n",
-                 wave_ci->num_orbitals, state-1, wave_ci->mult);
-        }
-      }
-    }
-  }
-  else if (data->citype==CI_CIS) {
-    if (pass_keyline(data->file,
-                     "USING DAVIDSON ALGORITHM TO FIND CIS EIGENVALUES",
-                     NULL)) {
-      int i, numstates=0, state;
-      qm_wavefunction_t *wave_ci;
-      float *state_energies, *state_spinquant;
-      goto_keyline(data->file, "NUMBER OF STATES REQUESTED", NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer, " NUMBER OF STATES REQUESTED = %d", &numstates);
-      printf("gamessplugin) Number of CIS states = %d\n", numstates);
-
-      /* For CIS only the wavefunction for the excited state 
-       * (specified by IROOT in $CIS group) will be printed.
-       * Here we read in the energies for all states, and store 
-       * the energy for the selected state in its wavefunction */
-      state_energies  = calloc(numstates+1, sizeof(float));
-      state_spinquant = calloc(numstates+1, sizeof(float));
-      goto_keyline(data->file, "RHF REFERENCE ENERGY  =", NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer, " RHF REFERENCE ENERGY  = %f", &state_energies[0]);
-      state_spinquant[0] = 1.f;
-
-      for (i=1; i<=numstates; i++) {
-        goto_keyline(data->file, "EXCITED STATE", NULL);
-        GET_LINE(buffer, data->file);
-        trimleft(buffer);
-        sscanf(buffer, " EXCITED STATE %*d  ENERGY= %f  S = %f",
-               &state_energies[i], &state_spinquant[i]);
-      }
-
-      goto_keyline(data->file,
-                   "CIS NATURAL ORBITAL OCCUPATION NUMBERS FOR EXCITED STATE",
-                   NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer,
-             " CIS NATURAL ORBITAL OCCUPATION NUMBERS FOR EXCITED STATE %d",
-             &state);
-      
-      wave_ci = add_wavefunction(cur_ts);
-
-      if (get_wavefunction(data, cur_ts, wave_ci) == FALSE) {
-        del_wavefunction(cur_ts);
-      }
-      else {
-        wave_ci->exci = state;
-        wave_ci->energy = state_energies[state];
-        wave_ci->mult = 2*(int)state_spinquant[state]+1;
-        printf("gamessplugin) Found %d CIS natural orbitals for excited state %d\n",
-               wave_ci->num_orbitals, state);
-      }
-
-      free(state_energies);
-      free(state_spinquant);
-    }
-  }
-
-
-  /* Read the energy gradients (=forces on atoms) */
-  if (get_gradient(data, cur_ts)) {
-    printf("gamessplugin) Energy gradient found.\n");
-  }
-
-
-  /* If this is the last frame of the trajectory and the file
-   * wasn't truncated and the program didn't terminate
-   * abnormally then read the final wavefunction. */
-  if ((data->runtype == MOLFILE_RUNTYPE_OPTIMIZE ||
-       data->runtype == MOLFILE_RUNTYPE_SADPOINT) &&
-      (data->num_frames_read+1 == data->num_frames &&
-       (data->status == MOLFILE_QMSTATUS_UNKNOWN || 
-        data->status == MOLFILE_QMSTATUS_OPT_CONV ||
-        data->status == MOLFILE_QMSTATUS_OPT_NOT_CONV))) {
-
-    /* We need to jump over the end of the trajectory because 
-     * this is also the keystring for get_wavefunction() to
-     * bail out. */
-    if (data->status == MOLFILE_QMSTATUS_OPT_CONV || 
-        data->status == MOLFILE_QMSTATUS_OPT_NOT_CONV) {
-      fseek(data->file, data->end_of_traj, SEEK_SET);
-    }
-
-    /* Try to read final wavefunction and orbital energies
-     * A preexisting canonical wavefunction for this timestep
-     * with the same characteristics (spin, exci, info) will
-     * be overwritten by the final wavefuntion if it has more
-     * orbitals. */
-    check_add_wavefunctions(data, cur_ts);
-  }
-
-
-  /* For MCSCF optimized orbitals no occupancies are given
-   * but since their occupancies are identical to the ones
-   * from natural orbitals we can use those. The natural 
-   * orbitals are always listed right before the optimized
-   * ones so we simply copy the data over. */
-  if (cur_ts->numwave>=2 &&
-      cur_ts->wave[cur_ts->numwave-1].type==MOLFILE_WAVE_MCSCFOPT &&
-      cur_ts->wave[cur_ts->numwave-2].type==MOLFILE_WAVE_MCSCFNAT) {
-    int i;
-    qm_wavefunction_t *waveopt = &cur_ts->wave[cur_ts->numwave-1];
-    qm_wavefunction_t *wavenat = &cur_ts->wave[cur_ts->numwave-2];
-    waveopt->orb_occupancies = (float *)calloc(waveopt->num_orbitals,
-                                               sizeof(float));
-    /* Only the core and active natural orbitals are listed. 
-     * We copy the occupancies for these orbitals and pad the
-     * rest with zeros. */
-    for (i=0; i<wavenat->num_orbitals; i++) {
-      waveopt->orb_occupancies[i] = wavenat->orb_occupancies[i];
-    }
-    for (i=wavenat->num_orbitals; i<waveopt->num_orbitals; i++) {
-      waveopt->orb_occupancies[i] = 0.f;
-    }
-    waveopt->has_occup = TRUE;
-  }
-
-
-  data->num_frames_read++;
-
-  return TRUE;
-}
-
-
-/* Analyze the trajectory.
- * Read the parameters controlling geometry search and
- * find the end of the trajectory, couinting the frames
- * on the way. Store the filepointer for the beginning of
- * each frame in *filepos_array. */
-static int analyze_traj(qmdata_t *data, gmsdata *gms) {
-  char buffer[BUFSIZ], nserch[BUFSIZ];
-  char *line;
-  long filepos;
-  filepos = ftell(data->file);
-
-  data->filepos_array = (long* )calloc(1, sizeof(long ));
-
-  if (data->runtype==MOLFILE_RUNTYPE_OPTIMIZE ||
-      data->runtype==MOLFILE_RUNTYPE_SADPOINT) {
-    pass_keyline(data->file,
-                   "PARAMETERS CONTROLLING GEOMETRY SEARCH", NULL);
-    eatline(data->file, 2);
-
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, "NSTEP  = %d", &data->max_opt_steps);
-    eatline(data->file, 3);
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, "OPTTOL = %f", &data->opt_tol);
-
-    /* The $STATP options are followed by the coordinates 
-     * but we can skip them here because we rewind after
-     * get_guess_options() and try to read them in
-     * get_traj_frame(). */
-  }
-  else if (data->runtype==MOLFILE_RUNTYPE_SURFACE) {
-    if (pass_keyline(data->file,
-                     "POTENTIAL SURFACE MAP INPUT", NULL)) {
-      
-      int coord1[2];
-      int mplevel1=-1, mplevel2=-1, nstep1;
-      float origin1, disp1;
-      char runtype1[BUFSIZ], runtype2[BUFSIZ];
-      char scftype1[BUFSIZ], scftype2[BUFSIZ];
-      char dfttype1[BUFSIZ], dfttype2[BUFSIZ];
-      char citype1[BUFSIZ],  citype2[BUFSIZ];
-      char cctype1[BUFSIZ],  cctype2[BUFSIZ];
-      char *tmp;
-      int n;
-        
-      eatline(data->file, 1);
-
-      GET_LINE(buffer, data->file);
-      n=sscanf(buffer, " JOB 1 IS RUNTYP=%s SCFTYP=%s CITYP=%s",
-               runtype1, scftype1, citype1);
-      if (n==3) {
-        GET_LINE(buffer, data->file);
-        sscanf(buffer, " MPLEVL= %d CCTYP=%s, DFTTYP=%s\n",
-               &mplevel1, dfttype1, cctype1);
-        GET_LINE(buffer, data->file);
-      }
-      n=sscanf(buffer, " JOB 2 IS RUNTYP=%s SCFTYP=%s CITYP=%s",
-               runtype2, scftype2, citype2);
-      if (n==3) {
-        GET_LINE(buffer, data->file);
-        sscanf(buffer, " MPLEVL= %d CCTYP=%s, DFTTYP=%s\n",
-               &mplevel2, dfttype2, cctype2);
-        GET_LINE(buffer, data->file);
-      }
-
-      sscanf(buffer, " COORD 1 LYING ALONG ATOM PAIR %d %d",
-             coord1, coord1+1);
-      GET_LINE(buffer, data->file);
-      tmp = strstr(buffer, "ORIGIN=") + 7;
-      sscanf(tmp, "%f", &origin1);
-      tmp = strstr(buffer, "DISPLACEMENT=") + 13;
-      sscanf(tmp, "%f", &disp1);
-      tmp = strstr(buffer, "AND") + 3;
-      sscanf(tmp, "%d STEPS.", &nstep1);
-      printf("gamessplugin) origin=%f, displacement=%f nstep=%d\n", origin1, disp1, nstep1);
-    }
-  }
-  else if (data->runtype==MOLFILE_RUNTYPE_MEX) {
-    char scftype1[BUFSIZ];
-    char scftype2[BUFSIZ];
-    rewind(data->file);
-    if (!pass_keyline(data->file, "$MEX OPTIONS", NULL)) {
-      printf("gamessplugin) No $MEX OPTIONS found!\n");
-      return FALSE;
-    }
-    eatline(data->file, 2);
-    GET_LINE(buffer, data->file);
-    sscanf(strstr(buffer, "SCF1    =")+7, "%s", scftype1);
-    sscanf(strstr(buffer, "SCF2   =")+7, "%s", scftype2);
-    printf("gamessplugin) MEX SCF1=%s SCF2=%s\n", scftype1, scftype2);
-
-  }
-  else {
-    /* We have just one frame */
-    data->num_frames = 1;
-    pass_keyline(data->file, "1 ELECTRON INTEGRALS",
-                 "ENERGY COMPONENTS");
-    data->filepos_array[0] = ftell(data->file);
-
-    /* Check wether SCF has converged */
-    if (pass_keyline(data->file,
-                     "SCF IS UNCONVERGED, TOO MANY ITERATIONS",
-                     "ENERGY COMPONENTS")==FOUND) {
-      printf("gamessplugin) SCF IS UNCONVERGED, TOO MANY ITERATIONS\n");
-      data->status = MOLFILE_QMSTATUS_SCF_NOT_CONV;
-    } else {
-      data->status = MOLFILE_QMSTATUS_OPT_CONV;
-      fseek(data->file, data->filepos_array[0], SEEK_SET);
-    }
-
-    pass_keyline(data->file, "ENERGY COMPONENTS", NULL);
-    data->end_of_traj = ftell(data->file);
-
-    /* Allocate memory for the frame */
-    data->qm_timestep = (qm_timestep_t *)calloc(1, sizeof(qm_timestep_t));
-    memset(data->qm_timestep, 0, sizeof(qm_timestep_t));
-    
-    return TRUE;
-  }
-
-  printf("gamessplugin) Analyzing trajectory...\n");
-  data->status = MOLFILE_QMSTATUS_UNKNOWN;
-
-  while (1) {
-    if (!fgets(buffer, sizeof(buffer), data->file)) break;
-    line = trimleft(buffer);
-
-    /* at this point we have to distinguish between
-     * pre="27 JUN 2005 (R2)" and "27 JUN 2005 (R2)"
-     * versions since the output format for geometry
-     * optimizations has changed */
-    if (gms->version==FIREFLY8POST6695){
-      strcpy(nserch, "NSERCH=");
-    }
-    else if (gms->version==FIREFLY8PRE6695) {
-      strcpy(nserch, "1NSERCH=");
-    }
-    else if (gms->version==GAMESSPRE20050627) {
-      strcpy(nserch, "1NSERCH=");
-    }
-    else if (gms->version==GAMESSPOST20050627) {
-      strcpy(nserch, "BEGINNING GEOMETRY SEARCH POINT NSERCH=");
-    }
-
-    if (strstr(line, nserch) ||
-        strstr(line, "---- SURFACE MAPPING GEOMETRY") ||
-        strstr(line, "MINIMUM ENERGY CROSSING POINT SEARCH") ||
-        (data->runtype==MOLFILE_RUNTYPE_MEX && strstr(line, "NSERCH=")==line)) {
-      printf("gamessplugin) %s", line);
-
-      if (data->num_frames > 0) {
-        data->filepos_array = (long*)realloc(data->filepos_array,
-                                (data->num_frames+1)*sizeof(long));
-      }
-      data->filepos_array[data->num_frames] = ftell(data->file);
-      if (data->runtype==MOLFILE_RUNTYPE_SURFACE) {
-        int ret = goto_keyline(data->file,
-                               "ATOM      ATOMIC", "HAS ENERGY VALUE",
-                               "---- SURFACE MAPPING GEOMETRY ----", NULL);
-        if (ret>0 && ret<3 &&
-            (have_keyline(data->file, "...... END OF ONE-ELECTRON INTEGRALS ......",
-                          "---- SURFACE MAPPING GEOMETRY ----") ||
-             have_keyline(data->file, "... DONE WITH POTENTIAL SURFACE SCAN",
-                          "---- SURFACE MAPPING GEOMETRY ----"))) {
-          data->num_frames++;          
-        }
-      }
-      else if (pass_keyline(data->file, "COORDINATES OF",
-                            "BEGINNING GEOMETRY SEARCH POINT NSERCH=")==FOUND)
-      {
-        /* Make sure that we have at least a complete coordinate
-           block in order to consider this a new frame. */
-        if (have_keyline(data->file, "INTERNUCLEAR DISTANCES",
-                         "1 ELECTRON INTEGRALS") ||
-            have_keyline(data->file, "1 ELECTRON INTEGRALS",
-                         "BEGINNING GEOMETRY SEARCH POINT NSERCH=")) {
-          data->num_frames++;
-        }
-      }
-    }
-    else if (strstr(line, "***** EQUILIBRIUM GEOMETRY LOCATED") ||
-             strstr(line, "... DONE WITH POTENTIAL SURFACE SCAN")) {
-      printf("gamessplugin) ==== End of trajectory (%d frames) ====\n",
-             data->num_frames);
-      data->status = MOLFILE_QMSTATUS_OPT_CONV;
-      break;
-    }
-    else if (strstr(line, "***** FAILURE TO LOCATE STATIONARY POINT,")) {
-      printf("gamessplugin) %s\n", line);
-      if (strstr(strchr(line, ','), "SCF HAS NOT CONVERGED")) {
-        data->status = MOLFILE_QMSTATUS_SCF_NOT_CONV;
-        break;
-      }
-      else if (strstr(strchr(line, ','), "TOO MANY STEPS TAKEN")) {
-        data->status = MOLFILE_QMSTATUS_OPT_NOT_CONV;
-        break;
-      }
-    }
-  }
-  
-  data->end_of_traj = ftell(data->file);
-  fseek(data->file, filepos, SEEK_SET);
-
-  if (data->status == MOLFILE_QMSTATUS_UNKNOWN) {
-    /* We didn't find any of the regular key strings,
-     * the run was most likely broken off and we have an
-     * incomplete file. */
-    data->status = MOLFILE_QMSTATUS_FILE_TRUNCATED;
-  }
-
-
-  /* Allocate memory for all frames */
-  data->qm_timestep = (qm_timestep_t *)calloc(data->num_frames,
-                                              sizeof(qm_timestep_t));
-  memset(data->qm_timestep, 0, data->num_frames*sizeof(qm_timestep_t));
-
-
-  if (data->status == MOLFILE_QMSTATUS_SCF_NOT_CONV ||
-      data->status == MOLFILE_QMSTATUS_FILE_TRUNCATED) {
-    return FALSE;  
-  }
-
-  return TRUE;
-}
-
-
-/***************************************************************
- *
- * Read the number of scf iterations and the scf energies
- * for the current timestep. 
- * Assumes that the file pointer is somewhere before this:
- * ITER EX DEM     TOTAL ENERGY        E CHANGE  DENSITY CHANGE    DIIS ERROR
- * 1  0  0      -39.7266993475   -39.7266993475   0.000000118   0.000000000
- * 2  1  0      -39.7266991566     0.0000001909   0.000000032   0.000000000
- * ...
- * then it reads the block up to the next blank line.
- * The second argument is a pointer to the qm timestep you want to
- * store the data in. Memory for the scfenergies will be
- * allocated.
- *
- ***************************************************************/
-static int get_scfdata(qmdata_t *data, qm_timestep_t *ts) {
-  char buffer[BUFSIZ];
-  char word[3][BUFSIZ];
-  long filepos;
-  int i, epos = -1;
-  int numread, numiter=0, dum, dum2;
-  char *line;
-  float dumf;
-  filepos = ftell(data->file);
-
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  if (!goto_keyline(data->file, "ITER EX", "ITER     TOTAL",
-                     "ITER    TOTAL", NULL)) {
-    fseek(data->file, filepos, SEEK_SET);
-    ts->num_scfiter = 0;
-    return FALSE;
-  }
-
-  /* determine in which column the energy is stored */
-  GET_LINE(buffer, data->file);
-  numread = sscanf(buffer, "%*s %s %s %s",
-                   &word[0][0], &word[1][0], &word[2][0]);
-  for (i=0; i<numread; i++) {
-    if (!strcmp(&word[i][0], "TOTAL")) epos = i+1;
-  }
-   
-  if (epos<0) {
-    fseek(data->file, filepos, SEEK_SET);
-    ts->num_scfiter = 0;
-    return FALSE;
-  }
-
-  /* store current file position since we first have to count
-   * the iterations */
-  filepos = ftell(data->file);
-
-  /* read until the next blank line and count the iterations */
-  do {
-    GET_LINE(buffer, data->file);
-    line = trimleft(buffer);
-    numread = sscanf(line,"%d %d %*d %*f", &dum, &dum2);
-    if (numread==2) numiter++;
-  } while (strlen(line)>2);
-
-  printf("gamessplugin) %d SCF iterations\n", numiter);
-
-  /* go back and read energies */
-  fseek(data->file, filepos, SEEK_SET);
-  
-
-  /* allocate memory for scfenergy array */
-  ts->scfenergies = (double *)calloc(numiter,sizeof(double));
-  
-  i=0;
-  do {
-    GET_LINE(buffer, data->file);
-    line = trimleft(buffer);
-    numread = sscanf(line,"%d %f %*i %*f", &dum, &dumf);
-    if (numread==2) {
-      switch (epos) {
-      case 1:
-        sscanf(buffer,"%*d %lf", ts->scfenergies+i);
-        break;
-      case 2:
-        sscanf(buffer,"%*d %*d %lf", ts->scfenergies+i);
-        break;
-      case 3:
-        sscanf(buffer,"%*d %*d %*d %lf", ts->scfenergies+i);
-        break;
-      }
-      i++;
-    }
-  } while (strlen(line)>2);
-
-#if 0
-  for (i=0; i<numiter; i++) {
-    printf("scfenergies[%d] = %f\n", i, ts->scfenergies[i]);
-  }
-#endif
-
-  ts->num_scfiter = numiter;
-  
-  return TRUE;
-}
-
-
-/*********************************************************
- *
- * Reads a set of wavefunctions for the current timestep.
- * These are typically the alpha and beta spin wavefunctions
- * or the MCSCF natural and optimized orbitals or the GVB
- * canonical orbitals and geminal pairs.
- *
- **********************************************************/
-static int check_add_wavefunctions(qmdata_t *data,
-                                   qm_timestep_t *ts) {
-  qm_wavefunction_t *wavef;
-  int i, n=1;
-
-  if (data->scftype==MOLFILE_SCFTYPE_UHF || 
-      data->scftype==MOLFILE_SCFTYPE_GVB ||
-      data->scftype==MOLFILE_SCFTYPE_MCSCF) {
-    /* Try to read second wavefunction
-     * (spin beta or GI orbitals or MCSCF optimized orbs) */
-    n = 2;
-  }
-
-  for (i=0; i<n; i++) {
-    /* Allocate memory for new wavefunction */
-    wavef = add_wavefunction(ts);
-
-    /* Try to read wavefunction and orbital energies */
-    if (get_wavefunction(data, ts, wavef) == FALSE) {
-      /* Free the last wavefunction again. */
-      del_wavefunction(ts);
-#ifdef DEBUGGING
-      printf("gamessplugin) No canonical wavefunction present for timestep %d\n", data->num_frames_read);
-#endif
-      break;
-
-    } else {
-      char action[32];
-      char spinstr[32];
-      strcpy(spinstr, "");
-      if (data->scftype==MOLFILE_SCFTYPE_UHF) {
-        if (wavef->spin==SPIN_BETA) {
-          strcat(spinstr, "spin  beta, ");
-        } else {
-          strcat(spinstr, "spin alpha, ");
-        }
-      }
-      
-      /* The last SCF energy is the energy of this electronic state */
-      if (ts->scfenergies) {
-        wavef->energy = ts->scfenergies[ts->num_scfiter-1];
-      } else {
-        wavef->energy = 0.f;
-      }
-      
-      /* Multiplicity */
-      wavef->mult = data->multiplicity;
-      
-
-      /* String telling wether wavefunction was added, updated
-       * or ignored. */
-      strcpy(action, "added");
-
-      /* If there exists a canonical wavefunction of the same spin
-       * we'll replace it */
-      if (ts->numwave>1 && wavef->type==MOLFILE_WAVE_CANON) {
-        int i, found =-1;
-        for (i=0; i<ts->numwave-1; i++) {
-          if (ts->wave[i].type==wavef->type &&
-              ts->wave[i].spin==wavef->spin &&
-              ts->wave[i].exci==wavef->exci &&
-              !strncmp(ts->wave[i].info, wavef->info, MOLFILE_BUFSIZ)) {
-            found = i;
-            break;
-          }
-        }
-        if (found>=0) {
-          /* If the new wavefunction has more orbitals we 
-           * replace the old one for this step. */
-          if (wavef->num_orbitals > 
-              ts->wave[found].num_orbitals) {
-            /* Replace existing wavefunction for this step */
-            replace_wavefunction(ts, found);
-            sprintf(action, "%d updated", found);
-          } else {
-            /* Delete last wavefunction again */
-            del_wavefunction(ts);
-            sprintf(action, "matching %d ignored", found);
-          }
-          wavef = &ts->wave[ts->numwave-1];
-        }
-      }
-
-      printf("gamessplugin) Wavefunction %s (%s):\n", action, wavef->info);
-      printf("gamessplugin)   %d orbitals, %sexcitation %d, multiplicity %d\n",
-             wavef->num_orbitals, spinstr, wavef->exci, wavef->mult);
-    }
-  }
-
-  return i;
-}
-
-
-/*********************************************************
- *
- * Finds the next wavefunction, determines its type by
- * analyzing the keystring and reads in the wavefunction
- * coefficients.
- *
- **********************************************************/
-static int get_wavefunction(qmdata_t *data, qm_timestep_t *ts,
-                            qm_wavefunction_t *wf)
-{
-  float *orb_enocc;
-  float *wave_coeff;
-  char buffer[BUFSIZ];
-  char word[6][BUFSIZ];
-  int num_orbitals = 0;
-  int i = 0, num_values = 0;
-  long filepos;
-  char *line;
-  int have_orbenocc = 0;
-  int n[5];
-
-  buffer[0] = '\0';
-  for (i=0; i<6; i++) word[i][0] = '\0';
-
-  if (wf == NULL) {
-    PRINTERR;	    
-    return FALSE;
-  }
-
-  wf->has_occup = FALSE;
-  wf->has_orben = FALSE;
-  wf->type = MOLFILE_WAVE_UNKNOWN;
-  wf->spin = SPIN_ALPHA;
-  wf->exci = 0;
-  strncpy(wf->info, "unknown", MOLFILE_BUFSIZ);
-
-  /*
-   * Scan for something like this:
-
-          ------------------
-          MOLECULAR ORBITALS     <<--- sometimes EIGENVECTORS
-          ------------------
-
-                      1          2          3          4          5
-                  -11.0297    -0.9121    -0.5205    -0.5205    -0.5205  <<-- orbital energies (or occupancies)                     A          A          A          A          A   
-    1  C  1  S    0.991925   0.221431   0.000006  -0.000001   0.000002
-    2  C  1  S    0.038356  -0.627585  -0.000021   0.000003  -0.000006
-    3  C  1  X    0.000000  -0.000004   0.338169  -0.030481  -0.460283
-     ...
-
-                     6          7          8          9
-                    0.7192     0.7192     0.7193     0.7611
-                     A          A          A          A   
-    1  C  1  S    0.000028   0.000012   0.000092   0.252320
-    2  C  1  S   -0.000183  -0.000077  -0.000594  -1.632834
-    3  C  1  X   -0.890147   0.062618   0.654017  -0.000154
-      ...
-
-
-     ----------------------------------------------------------------
-     PROPERTY VALUES FOR THE RHF   SELF-CONSISTENT FIELD WAVEFUNCTION
-     ----------------------------------------------------------------
-  * 
-  */
-
-  /* Remember position in order to go back if no wave function was found */
-  filepos = ftell(data->file);
-
-  do {
-    GET_LINE(buffer, data->file);
-
-    line = trimleft(trimright(buffer));
-
-    if      (!strcmp(line, "----- ALPHA SET -----")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-      pass_keyline(data->file, "EIGENVECTORS", NULL);
-    }
-    else if (!strcmp(line, "----- BETA SET -----")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      wf->spin = SPIN_BETA;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-      pass_keyline(data->file, "EIGENVECTORS", NULL);
-    }
-    else if (!strcmp(line, "****** BETA ORBITAL LOCALIZATION *****")) {
-      wf->spin = SPIN_BETA;
-    }
-    else if (!strcmp(line, "EIGENVECTORS")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "MOLECULAR ORBITALS")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "THE BOYS LOCALIZED ORBITALS ARE")) {
-      wf->type = MOLFILE_WAVE_BOYS;
-      strncpy(wf->info, "Boys localized", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "THE PIPEK-MEZEY POPULATION LOCALIZED ORBITALS ARE")) {
-      wf->type = MOLFILE_WAVE_PIPEK;
-      strncpy(wf->info, "Pipek-Mezey localized", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "EDMISTON-RUEDENBERG ENERGY LOCALIZED ORBITALS")) {
-      wf->type = MOLFILE_WAVE_RUEDEN;
-      strncpy(wf->info, "Ruedenberg localized", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "GI ORBITALS")) {
-      wf->type = MOLFILE_WAVE_GEMINAL;
-      strncpy(wf->info, "GVB geminal pairs", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "MCSCF NATURAL ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFNAT;
-      strncpy(wf->info, "MCSCF natural orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "MCSCF OPTIMIZED ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFOPT;
-      strncpy(wf->info, "MCSCF optimized orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "NATURAL ORBITALS IN ATOMIC ORBITAL BASIS")) {
-      wf->type = MOLFILE_WAVE_CINATUR;
-      strncpy(wf->info, "CI natural orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "CIS NATURAL ORBITALS")) {
-      wf->type = MOLFILE_WAVE_CINATUR;
-      strncpy(wf->info, "CIS natural orbitals", MOLFILE_BUFSIZ);
-    }
-    // FOR PCGAMESS/FIREFLY
-    else if (!strcmp(line, "-MCHF- NATURAL ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFNAT;
-      strncpy(wf->info, "MCSCF natural orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "-MCHF- OPTIMIZED ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFOPT;
-      strncpy(wf->info, "MCSCF optimized orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "ZERO-ORDER QDPT NATURAL ORBITALS")){
-      //Not yet implemented
-    }
-
-  } while(wf->type==MOLFILE_WAVE_UNKNOWN &&
-          strcmp(line, "ENERGY COMPONENTS") &&
-          strcmp(line, "***** EQUILIBRIUM GEOMETRY LOCATED *****") &&
-          strcmp(line, "**** THE GEOMETRY SEARCH IS NOT CONVERGED! ****"));
-
-  /* If we reach the last line of the rhf section without finding 
-   * one of the keywords marking the beginning of a wavefunction
-   * table then we return.*/
-  if (wf->type==MOLFILE_WAVE_UNKNOWN) {
-#ifdef DEBUGGING
-    printf("gamessplugin) get_wavefunction(): No wavefunction found!\n");
-#endif
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* Reserve space for arrays storing wavefunction and orbital
-   * energies. we reserve the max. space (num_orbitals==wavef_size)
-   * for now and realloc later if, we have less orbitals. */
-  wave_coeff = (float *)calloc(data->wavef_size*data->wavef_size,
-                                  sizeof(float)); 
-  //printf("gamessplugin) wave_coeff() allocated\n");
-
-  if (wave_coeff == NULL) {
-    PRINTERR;	    
-    return FALSE;
-  }
-
-  /* orbital energies/occupancies */  
-  orb_enocc = (float *)calloc(data->wavef_size, sizeof(float));
-  //printf("gamessplugin) orb_enocc() allocated\n");
-
-  if (orb_enocc == NULL) {
-    free(orb_enocc);
-    PRINTERR; 
-    return FALSE;
-  }
-
-
-  /* store the coeficient pointer */
-  wf->wave_coeffs  = wave_coeff;
-
-  /* depending on the wavefunction type the line after the
-     orbital index stores the orbital occupancies or energies */
-  if (wf->type == MOLFILE_WAVE_CINATUR  ||
-      wf->type == MOLFILE_WAVE_MCSCFNAT) {
-    wf->orb_occupancies = orb_enocc;
-    wf->has_occup = TRUE;
-  } else {
-    wf->orb_energies    = orb_enocc;
-    wf->has_orben = TRUE;
-  }
-
-  /* skip the next line which here is typically "-------" */
-  eatline(data->file, 1);
-
-
-  while (1) {
-    int nr, over=0;
-    float coeff[5], enocc[5];
-
-    if (wf->type == MOLFILE_WAVE_GEMINAL) {
-      /* Skip over "PAIR x" header line */
-      pass_keyline(data->file, "PAIR ", NULL);
-    }
-
-    eatwhitelines(data->file);
-    filepos = ftell(data->file);
-
-    /* Parse the orbital indexes */
-    GET_LINE(buffer, data->file);
-    num_values = sscanf(buffer, "%d %d %d %d %d",
-                          &n[0], &n[1], &n[2], &n[3], &n[4]);
-
-    /* If there are no orbital indexes then this must be the
-     * end of the wavefunction coefficient table. */
-    if (!num_values) {
-      fseek(data->file, filepos, SEEK_SET);
-      break;
-    }
-
-    eatwhitelines(data->file);
-
-    /* Read first line of orbital energies/occupancies */
-    filepos = ftell(data->file);
-    GET_LINE(buffer, data->file);
-    have_orbenocc = sscanf(buffer,"%f %f %f %f %f", &enocc[0],
-                        &enocc[1], &enocc[2], &enocc[3], &enocc[4]);
-
-    /* Make sure this is not the first line containing coeffs */
-    nr = sscanf(buffer, " 1 %*s 1 %*s %f %f %f %f %f",
-               &coeff[0], &coeff[1], &coeff[2], &coeff[3], &coeff[4]);
-    if (nr==num_values) have_orbenocc = 0;
-
-    if (have_orbenocc) {
-      /* store the orbital energies in the appropriate arrays 
-       * read them until we encounter an empty string */
-      for(i=0; i<num_values; i++) {
-        orb_enocc[i] = enocc[i];
-      }
-      
-
-      /* If we are in the first block we have to distinguish 
-         between energies and occupancies */
-      if (wf->type  == MOLFILE_WAVE_MCSCFNAT &&
-          orb_enocc == wf->orb_occupancies   &&
-          enocc[0] <= 0.f) {
-        wf->orb_occupancies = NULL;
-        wf->has_occup = FALSE;
-        wf->orb_energies    = orb_enocc;
-        wf->has_orben = TRUE;
-      }
-
-      /* increase orbital energy pointer */
-      orb_enocc = orb_enocc+5;
-    }      
-    else {
-      /* No orbital energies present, go back one line */
-      fseek(data->file, filepos, SEEK_SET);
-    }
-
-    num_orbitals += num_values;
-
-    /* Find first line containing coefficients */
-    filepos = ftell(data->file);
-    while (fgets(buffer, sizeof(buffer), data->file)) {
-      trimleft(buffer);
-      if (strstr(line, "ENERGY COMPONENTS") ||
-          strstr(line, "---") ||
-          strstr(line, "...")) {
-        over = 1; break;
-      }
-
-      nr = sscanf(buffer, " 1 %*s 1 %*s %f %f %f %f %f",
-             &coeff[0], &coeff[1], &coeff[2], &coeff[3], &coeff[4]);
-      if (nr==num_values) break;
-      filepos = ftell(data->file);
-    }
-    fseek(data->file, filepos, SEEK_SET);
-
-    if (over) break;
-
-
-    /* Read the wave function coefficient block for up to 5
-     * orbitals per line. */
-    if (!read_coeff_block(data->file, data->wavef_size,
-                          wave_coeff, data->angular_momentum)) {
-      printf("gamessplugin) Wavefunction coefficient block truncated or ill formatted!\n");
-      data->status = MOLFILE_QMSTATUS_FILE_TRUNCATED;
-      return FALSE;
-    }
-
-
-    /* move wavefunction pointer to start of next five orbitals */
-    if (wf->type == MOLFILE_WAVE_GEMINAL) {
-      wave_coeff = wave_coeff + 2*data->wavef_size;
-    } else {
-      wave_coeff = wave_coeff + 5*data->wavef_size;
-    }
-  }
-
-
-  if (!num_orbitals) {
-    printf("gamessplugin) No orbitals in wavefunction!\n");
-    return FALSE;
-  }
-
-  /* resize the array to the actual number of read orbitals */
-  if (data->wavef_size!=num_orbitals) {
-
-    if (wf->has_occup) {
-      wf->orb_occupancies = (float *)realloc(wf->orb_occupancies,
-               num_orbitals*sizeof(float));
-    }
-    if (wf->has_orben) {
-      wf->orb_energies = (float *)realloc(wf->orb_energies,
-               num_orbitals*sizeof(float));
-    }
-
-    wf->wave_coeffs  = (float *)realloc(wf->wave_coeffs, data->wavef_size*
-					num_orbitals*sizeof(float)); 
-  }
-
-  /* In case MCSCF natural orbitals are present, then GAMESS
-     prints the orbital energy for the core orbitals and the
-     occupancy for the other orbitals. We zero out the non-core
-     energies to prevent confusion. The orbital occupancies 
-     are read separately elsewhere. */
-  if (wf->type == MOLFILE_WAVE_MCSCFNAT &&
-      wf->has_orben == TRUE ) {
-    wf->orb_occupancies = (float *)calloc(num_orbitals, sizeof(float));
-
-    for (i=0; i<data->mcscf_num_core; i++) {
-      wf->orb_occupancies[i] = 2.f;
-    }
-
-    for (i=data->mcscf_num_core; i<num_orbitals; i++) {
-      wf->orb_occupancies[i] = wf->orb_energies[i];
-      wf->orb_energies[i] = 0.f;
-    }
-
-    wf->has_occup = TRUE;
-  }
-
-
-  /* store the number of orbitals read in */
-  wf->num_orbitals  = num_orbitals;
-
-  return TRUE;
-}
-
-
-/* Read the wave function coefficient block for up to 5
- * orbitals per line:
- *  1  C  1  S    0.989835   0.155361   0.000000  -0.214258   0.000000
- *  2  C  1  S    0.046228  -0.548915   0.000000   0.645267   0.000000
- *  3  C  1  X    0.000000   0.000000   1.030974   0.000000   0.000000
- */
-static int read_coeff_block(FILE *file, int wavef_size,
-                            float *wave_coeff, int *angular_momentum) {
-  int i, j;
-  int truncated = 0;
-  char buffer[BUFSIZ];
-
-  /* Read a line with coefficients for up to 5 orbitals
-   * for each cartesian basis function. */
-  for (i=0; i<wavef_size; i++) {
-    char type[BUFSIZ];
-    float coeff[5];
-    int num_values = 0;
-    
-    GET_LINE(buffer, file);
-    
-    /* read in the wavefunction coefficients for 5
-     * orbitals at a time line by line */
-    num_values = sscanf(buffer,"%*5i%*4s%*2i%4s %f %f %f %f %f", 
-                        type, &coeff[0], &coeff[1], &coeff[2],
-                        &coeff[3], &coeff[4]);
-    
-    if (num_values==0) {
-      /* The file must have been truncated! */
-      truncated = 1;
-      break;
-    }
-
-    angular_momentum_expon(&angular_momentum[3*i], type);
-   
-    /* Each orbital has data->wavef_size entries, 
-     * hence we have to use this number as offset when storing 
-     * them in groups of five. */
-    for (j=0 ; j<num_values-1; j++) {
-      wave_coeff[j*wavef_size+i] = coeff[j];
-    }
-  }
-  
-  if (truncated) return 0;
-  
-  return 1;
-}
-
-/* Read the population analysis section.
- * Currently we parse only the Mulliken and Lowdin charges
- * but we might want to add support for population analysis. */
-static int get_population(qmdata_t *data, qm_timestep_t *ts) {
-  int i;
-  char buffer[BUFSIZ];
-  long filepos;
-  ts->have_mulliken = FALSE;
-  ts->have_lowdin   = FALSE;
-  filepos = ftell(data->file);
-
-  if (pass_keyline(data->file,
-                     "TOTAL MULLIKEN AND LOWDIN ATOMIC POPULATIONS",
-                     "NSERCH=") != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* Read Mulliken charges if present */
-  ts->mulliken_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (!ts->mulliken_charges) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  ts->lowdin_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (!ts->lowdin_charges) {
-    free(ts->mulliken_charges);
-    ts->mulliken_charges = NULL;
-    PRINTERR; 
-    return FALSE;
-  }
-  
-  eatline(data->file, 1);
-  
-  for (i=0; i<data->numatoms; i++) {
-    int n;
-    float mullpop, mullcharge, lowpop, lowcharge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*i %*s %f %f %f %f",
-                   &mullpop, &mullcharge, &lowpop, &lowcharge);
-    if (n!=4) {
-      free(ts->mulliken_charges);
-      free(ts->lowdin_charges);
-      ts->mulliken_charges = NULL;
-      ts->lowdin_charges   = NULL;
-      return FALSE;
-    }
-    ts->mulliken_charges[i] = mullcharge;
-    ts->lowdin_charges[i]   = lowcharge;
-  }
-
-  if (i!=data->numatoms) {
-    free(ts->mulliken_charges);
-    free(ts->lowdin_charges);
-    ts->mulliken_charges = NULL;
-    ts->lowdin_charges   = NULL;
-    return FALSE;
-  }
-
-  ts->have_mulliken = TRUE;
-  ts->have_lowdin   = TRUE;
-  return TRUE;
-}
-
-
-/* Read ESP charges.
- * XXX Right now we don't distinguish between different type of
- * ESP-style charges (CHELPG, CONNOLLY, GEODESIC). 
- * This could be solved by reading in the PTSEL keyword in
- * the $PDC group. */
-static int get_esp_charges(qmdata_t *data) {
-  int i;
-  char buffer[BUFSIZ];
-  long filepos;
-  /* Store charges in last timestep */
-  qm_timestep_t *ts = &data->qm_timestep[data->num_frames-1];
-
-  ts->have_esp = FALSE;
-  filepos = ftell(data->file);
-
-  if (pass_keyline(data->file,
-           "ATOM                CHARGE    E.S.D.",
-           "...... END OF PROPERTY EVALUATION ") != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* Read ESP charges if present */
-  ts->esp_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (ts->esp_charges == NULL) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  eatline(data->file, 1);
-
-  for (i=0; i<data->numatoms; i++) {
-    int n;
-    double charge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*s %lf ", &charge);
-    if (n!=1) return FALSE;
-    ts->esp_charges[i] = charge;
-  }
-
-  if (i!=data->numatoms) {
-    
-    return FALSE;
-  }
-
-  ts->have_esp = TRUE;
-  return TRUE;
-}
-
-
-/* Read the energy gradient (=force) for each atom */
-static int get_gradient(qmdata_t *data, qm_timestep_t *ts) {
-  int numgrad=0;
-  int numread;
-  char buffer[BUFSIZ];
-  long filepos;
-
-  buffer[0] = '\0';
-
-  /* remember position in order to go back if no forces were found */
-  filepos = ftell(data->file);
-
-  /* look for GRADIENT section */
-  if (goto_keyline(data->file, "GRADIENT (HARTREE",
-                "***** EQUILIBRIUM GEOMETRY LOCATED", 
-                " BEGINNING GEOMETRY SEARCH", NULL) != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  eatline(data->file, 4);
-
-  ts->gradient = (float *)calloc(3*data->numatoms, sizeof(float));
-
-  if (ts->gradient == NULL) {
-    PRINTERR;	    
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* read the gradient table */
-  do {
-    int i;
-    float dx, dy, dz;
-    GET_LINE(buffer, data->file);
-    numread = sscanf(buffer, "%d %*s %*f %f %f %f", &i, &dx, &dy, &dz);
-    if (numread==4) {
-      ts->gradient[3*(i-1)  ] = dx;
-      ts->gradient[3*(i-1)+1] = dy;
-      ts->gradient[3*(i-1)+2] = dz;
-      numgrad++;
-    }
-  } while(numread==4);
-
-  if (numgrad!=data->numatoms) {
-    printf("gamessplugin) Found %d gradients for %d atoms!\n",
-           numgrad, data->numatoms);
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-
-/* Read energy gradients from final step
- * (different format in final step) */
-static int get_final_gradient(qmdata_t *data, qm_timestep_t *ts) {
-  int numgrad=0;
-  int numread;
-  char buffer[BUFSIZ];
-  long filepos;
-
-  /* remember position in order to go back at the end */
-  filepos = ftell(data->file);
-
-  if (pass_keyline(data->file,
-                   "ATOM                 E'X", NULL) != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  ts->gradient = (float *)calloc(3*data->numatoms, sizeof(float));
-
-  if (ts->gradient == NULL) {
-    PRINTERR;	    
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* read the gradient table */
-  do {
-    int i;
-    float dx, dy, dz;
-    GET_LINE(buffer, data->file);
-    numread = sscanf(buffer, "%d %*s %f %f %f", &i, &dx, &dy, &dz);
-    if (numread==4) {
-      ts->gradient[3*(i-1)  ] = dx;
-      ts->gradient[3*(i-1)+1] = dy;
-      ts->gradient[3*(i-1)+2] = dz;
-      numgrad++;
-    }
-  } while(numread==4);
-
-  /* go back to where search started */
-  fseek(data->file, filepos, SEEK_SET);
-
-  if (numgrad!=data->numatoms) {
-    printf("gamessplugin) Number of gradients != number of atoms!\n");
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-
-/***********************************************************
- *
- * Read in wavenumbers and intensities of the normal modes
- *
- **********************************************************/
-static int get_normal_modes(qmdata_t *data) {
-  char buffer[BUFSIZ];
-  int i = 0, k = 0, j = 0;
-  double entry[6]; 
-  char *token;
-
-  if (!pass_keyline(data->file, "NORMAL COORDINATE ANALYSIS", NULL)) {
-    return FALSE;
-  }
-
-  /* initialize array */
-  memset(entry, 0, sizeof(entry));
-
-    
-  /* allocate memory for arrays */
-  data->wavenumbers = 
-    (float *)calloc(data->numatoms*3,sizeof(float));
-  if (data->wavenumbers==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  data->intensities = 
-    (float *)calloc(data->numatoms*3,sizeof(float));
-  if (data->intensities==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  data->imag_modes = 
-    (int *)calloc(data->numatoms*3,sizeof(int));
-  if (data->imag_modes==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  data->normal_modes = 
-    (float *)calloc((data->numatoms*3)*(data->numatoms*3),
-		     sizeof(float));
-  if (data->normal_modes==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* Example:
-   *                       1           2           3           4           5
-   *    FREQUENCY:      4805.54 I   1793.00 I   1317.43 I      2.13        1.99
-   * REDUCED MASS:      1.09875     1.00796     1.18876     1.04129     1.03921
-   * IR INTENSITY:    105.04109     2.80788     3.07217     0.01689     0.01587
-   *
-   * 1   CARBON       X  0.00000000  0.00000000 -0.11767262 -0.05407389  0.00000000
-   *                  Y  0.00000000 -0.00345200  0.00000000  0.00000000 -0.05241437
-   *                  Z -0.08676597  0.00000000  0.00000000  0.00000000  0.00000000
-   */
-  for (i=0; i<ceil(data->numatoms*3/5.f); i++) {
-    int numread = 0;
-
-    if (!goto_keyline(data->file, "FREQUENCY:", NULL)) {
-      break;
-    }
-    GET_LINE(buffer, data->file);
-
-    /* Scan the frequencies; 
-     * If there are imaginary modes present then the
-     * frequency is followed by the 'I' which represents
-     * an additional char token in the line. */
-
-    /* Skip first token "FREQUENCY:" */
-    token = strtok(buffer, " \t\r\n");
-    
-    /* Walk through the remaining tokens */
-    while ((token = strtok(NULL, " \t\r\n")) != NULL) {
-      /* Check if token is 'I'.
-       * If yes, mark previous mode as imaginary. */
-      if (*token=='I') {
-        data->imag_modes[data->nimag] = numread-1;
-        data->nimag++;
-      } else {
-        /* save only the first 5 modes - there NEVER should
-         * be more in any case, but just to make sure
-         * we don't overrun the array */
-        if (numread<5) {
-          data->wavenumbers[i*5+numread] = atof(token);
-          numread++;
-        }
-      }
-    }
-
-    eatline(data->file, 1);
-
-    /* Read the IR INTENSITIES */
-    GET_LINE(buffer, data->file);
-    numread = sscanf(buffer,"%*s %*s %lf %lf %lf %lf %lf", &entry[0],
-                     &entry[1], &entry[2], &entry[3], &entry[4]);
- 
-    for (k=0; k<numread; k++) {
-      data->intensities[i*5+k] = entry[k]; 
-    }
-
-    eatline(data->file, 1);
-
-    /* Read the normal mode vectors */
-    for (k=0; k<data->numatoms; k++) {
-      /* x */
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*s %*s %*s %lf %lf %lf %lf %lf",
-             &entry[0], &entry[1], &entry[2], &entry[3], &entry[4]);
-
-      for (j=0; j<numread; j++) {
-        data->normal_modes[3*k + (i*5+j)*3*data->numatoms] = 
-          entry[j];
-      }
-
-      /* y */
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*s %lf %lf %lf %lf %lf", &entry[0],
-                       &entry[1],&entry[2], &entry[3],&entry[4]);
-
-      for (j=0; j<numread; j++) {
-        data->normal_modes[(3*k+1) + (i*5+j)*3*data->numatoms] =
-          entry[j];
-      }
-
-      /* z */
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*s %lf %lf %lf %lf %lf", &entry[0],
-                       &entry[1], &entry[2], &entry[3],&entry[4]);
-
-      for (j=0; j<numread; j++) {
-        data->normal_modes[(3*k+2) + (i*5+j)*3*data->numatoms] = 
-          entry[j];
-      }
-    }
-  }
-
-
-  /* Chop unused part of imag_modes array */
-  data->imag_modes = 
-    (int *)realloc(data->imag_modes, data->nimag*sizeof(int));
-
-/*   free(token); */
-
-  data->have_normal_modes = TRUE;
-  printf("gamessplugin) Successfully scanned normal modes (%d imag.)\n", data->nimag);
-
-  return TRUE;
-}
-
-
-
-/***********************************************************
- *
- * Read the cartesian hessian matrix 
- * XXX Does not read blocks with less than 6 entries correctly!
- *
- * *********************************************************/
-static int get_cart_hessian(qmdata_t *data)
-{
-  char buffer[BUFSIZ];
-  int i,j,k;
-  float entry[6]; 
-
-  buffer[0] = '\0';
-  memset(entry, 0, sizeof(entry));
-
-  /* at this point we need to rewind the file, since
-   * in case that there is no internal Hessian stuff the
-   * previous call to get_int_coords scanned the file
-   * until EOF */
-  rewind(data->file);
-
-  if (pass_keyline(data->file,
-                   "CARTESIAN FORCE CONSTANT MATRIX",
-                   NULL) != FOUND) {
-    return FALSE;
-  }
-
-  /* skip next 5 lines */
-  eatline(data->file, 5);
-
-
-  /* reserve memory for array; 
-   * NOTE: this is a lower triangular matrix, but for now
-   * we save it in an square matrix of dim(3Nx3N) to 
-   * facilitate element access */
-  data->carthessian = 
-    (double *)calloc((data->numatoms*3)*(data->numatoms*3),
-		     sizeof(double));
-
-  
-  /* make sure memory was allocated properly */
-  if (data->carthessian == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* start scanning; the cartesian hessian matrix is a lower
-   * triangular matrix, organized in rows of 6 */
-
-  /* read blocks with complete rows of 6 */
-  for (i=0; i<(int)ceil(data->numatoms/2.f); i++) {
-    for (j=0; j<(data->numatoms*3)-(i*6); j++) {
-      GET_LINE(buffer, data->file);
- 
-      if (j%3==0) {
-        sscanf(buffer,"%*s %*s %*c %f %f %f %f %f %f",
-               &entry[0],&entry[1],
-               &entry[2],&entry[3],&entry[4],&entry[5]);
-      }
-      else {
-        sscanf(buffer,"%*1s %f %f %f %f %f %f",
-               &entry[0],&entry[1],&entry[2],&entry[3],&entry[4],
-               &entry[5]);
-      }
-
-
-      /* save entries (lower triangular matrix) in a 
-       * square matrix */
-      for (k=0; k<=(j<5 ? j : 5); k++) {
-        data->carthessian[(j+i*6)*3*data->numatoms + (k+i*6)] =
-          entry[k];
-      }
-    }
-
-    /* skip the four lines separating the data blocks */
-    eatline(data->file, 4);
-  }
-
-  printf("gamessplugin) Scanned Hessian in CARTESIAN coordinates\n");
-
-  data->have_cart_hessian = TRUE;
-
-  return TRUE;
-}
-  
-  
-  
-/***********************************************************
- *
- * Read the internal coordinates and rewind to the file
- * position where we started the search.
- *
- **********************************************************/
-static int get_int_coords(qmdata_t *data) {
-
-  char word[BUFSIZ];
-  char buffer[BUFSIZ];
-  long filepos, beginning;
-  int first, second, third, fourth;
-  double value;
-  int n, i = 0, j = 0, k = 0, l = 0;
-
-  /* remember current filepos so we can jump back */
-  beginning = ftell(data->file);
-
-  if (pass_keyline(data->file, "INTERNAL COORDINATES",
-                   "1 ELECTRON INTEGRALS") != FOUND) {
-    printf("gamessplugin) No internal coordinates found.\n");
-    fseek(data->file, beginning, SEEK_SET);
-    return FALSE;
-  }
-
-  /* skip next 5 lines */
-  eatline(data->file, 5);
-
-  /* remember current filepos so we can jump back */
-  filepos = ftell(data->file);
-
-  /* scan the next line */
-  GET_LINE(buffer, data->file);
-  n = sscanf(buffer,"%*s %s", word); 
-
-  /* read line by line */
-  while (n!=-1) {
-    /* start counting the number of internal coordinates */
-    data->nintcoords++;
-
-    /* count the number of bonds, angles, dihedrals */
-    if (!strcmp(word,"STRETCH")) {
-      data->nbonds++;
-    }
-    else if (!strcmp(word,"BEND")) {
-      data->nangles++;
-    }
-    else if (!strcmp(word,"TORSION")) {
-      data->ndiheds++;
-    }
-    else if (!strcmp(word,"PLA.BEND")) {
-      data->nimprops++;
-    }
-
-    /* scan next line */
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*s %s", word); 
-  }
-
-  /* now that we know the number of bonds, angles, etc.
-   * we can read and store the internal coordinates */
-  fseek(data->file, filepos, SEEK_SET);
-
-
-  /* reserve memory for the arrays storing the internal
-   * coordinates and their values */
-  data->bonds = (int *)calloc(2*data->nbonds,sizeof(int));
-  data->angles = (int *)calloc(3*data->nangles,sizeof(int));
-  data->dihedrals = (int *)calloc(4*data->ndiheds,sizeof(int));
-  data->impropers = (int *)calloc(4*data->nimprops,sizeof(int));
-  data->internal_coordinates = (double *)calloc(data->nintcoords,
-	sizeof(double));
-
-
-  /* check if we have sufficient memory available */
-  if ( (data->bonds == NULL) || 
-       (data->angles == NULL) ||
-       (data->dihedrals == NULL) || 
-       (data->internal_coordinates == NULL)) 
-  {
-    PRINTERR; 
-    return FALSE;
-  }
-
-
-  /* now start going through the internal coordinates
-   * and save them in the appropriate arrays; here
-   * I drop all safety check since we went through
-   * this part of the file already once and should
-   * be good */
- 
-  /* scan the STRETCHES */
-  for (i=0; i<data->nbonds; i++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %lf", &first, &second, &value);
-
-    *(data->bonds+2*i)   = first;
-    *(data->bonds+2*i+1) = second;
-    *(data->internal_coordinates+i) = value;
-  }
-
-  /* scan the BENDS */
-  for (j=0; j<data->nangles; j++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %d %lf",
-           &first, &second, &third, &value);
-
-    *(data->angles+3*j)   = first;
-    *(data->angles+3*j+1) = second;
-    *(data->angles+3*j+2) = third;
-    *(data->internal_coordinates+i+j) = value;
-  }
-
-  /* scan the TORSIONS */
-  for (k=0; k<data->ndiheds; k++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %d %d %lf",
-           &first, &second, &third, &fourth, &value);
-
-    *(data->dihedrals+4*k)   = first;
-    *(data->dihedrals+4*k+1) = second;
-    *(data->dihedrals+4*k+2) = third;
-    *(data->dihedrals+4*k+3) = fourth;
-    *(data->internal_coordinates+i+j+k) = value;
-  }
-
-  /* scan the IMPROPERS */
-  for (l=0; l<data->nimprops; l++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %d %d %lf",
-           &first, &second, &third, &fourth, &value);
-
-    *(data->impropers+4*l)   = first;
-    *(data->impropers+4*l+1) = second;
-    *(data->impropers+4*l+2) = third;
-    *(data->impropers+4*l+3) = fourth;
-    *(data->internal_coordinates+i+j+k+l) = value;
-  }
-
-  /* Since the internal coordinate section can appear
-   * before or after the symmetry section we have to
-   * jump back to the beginning of the search. */
-  fseek(data->file, beginning, SEEK_SET);
-
-  printf("gamessplugin) Scanned %d INTERNAL coordinates \n",
-         data->nintcoords);
-  printf("gamessplugin)    %d BONDS \n",data->nbonds);
-  printf("gamessplugin)    %d ANGLES \n",data->nangles);
-  printf("gamessplugin)    %d DIHEDRALS \n",data->ndiheds);
-  printf("gamessplugin)    %d IMPROPERS \n",data->nimprops);
-
-  data->have_internals = TRUE;
-  return TRUE;
-}
-
-
-
-/***********************************************************
- *
- * Read the the Hessian in internal coordinates
- *
- **********************************************************/
-static int get_int_hessian(qmdata_t *data) {
-  char buffer[BUFSIZ];
-  double hess[5];
-  int i = 0, j = 0, k = 0, l = 0;
-
-  memset(hess, 0, sizeof(hess));
-
-  if (pass_keyline(data->file,
-                   "HESSIAN MATRIX IN INTERNAL COORDINATES",
-                   "ENERGY GRADIENT") != FOUND) {
-    return FALSE;
-  }
-  if (pass_keyline(data->file,
-                     "UNITS ARE HARTREE/",
-                     "ENERGY GRADIENT") != FOUND) {
-    return FALSE;
-  }
-
-  eatline(data->file, 3);
-  
-  /* reserve memory for inthessian array */
-  data->inthessian = 
-    (double *)calloc((data->nintcoords)*(data->nintcoords),
-		     sizeof(double));
-
-
-  /* make sure memory was allocated properly */
-  if (data->inthessian == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* start scanning; GAMESS organized the output of the
-   * internal HESSIAN in rows of 5 */
-
-  /* read blocks with complete rows of 5 */
-  for (i=0; i<(int)ceil(data->nintcoords/5.f); i++) {
-    for (j=0; j<data->nintcoords; j++) {
-      int numread = 0;
-
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*d %lf %lf %lf %lf %lf", &hess[0], 
-             &hess[1], &hess[2], &hess[3], &hess[4]);
-
-      /* save entries */
-      for (k=0; k<numread; k++) { 
-        data->inthessian[j*data->nintcoords + i*5+k] = hess[k];
-      }
-    }
-
-    /* skip the two lines separating the matrix entries 
-     * and scan next line */
-    eatline(data->file, 2);
-
-    GET_LINE(buffer, data->file);
-  }
-
-#if 0
-  /* read the remaining block with less then 5 rows
-   * if present */
-  remaining_blocks = data->nintcoords%5;
-  
-  if (remaining_blocks!=0) {
-    for (j=0; j<data->nintcoords; j++) {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*d %lf %lf %lf %lf %lf", &hess[0], 
-             &hess[1], &hess[2], &hess[3], &hess[4]);
-
-      for (k=0; k<remaining_blocks; k++) { 
-        *(data->inthessian+(j*data->nintcoords)+(i*5)+k) = hess[k];
-      }
-    }
-  }
-#endif
-
-  printf("gamessplugin) Scanned Hessian in INTERNAL coordinates\n");
-
-  /* finally, dump the diagonal elements of the hessian into the
-   * force constant arrays, after converting the units 
-   * appropriately;
-   * BONDS are in HARTREE/BOHR**2
-   * ANGLES,DIHEDRALS,IMPROPERS are in HARTREE/RADIAN**2 */
-  
-  /* allocate dynamic arrays */
-  data->bond_force_const = 
-    (double *)calloc(data->nbonds, sizeof(double));
-
-  if (data->bond_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  data->angle_force_const =
-    (double *)calloc(data->nangles, sizeof(double));
-
-  if (data->angle_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  data->dihedral_force_const =
-    (double *)calloc(data->ndiheds, sizeof(double));
-
-  if (data->dihedral_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  data->improper_force_const =
-    (double *)calloc(data->nimprops, sizeof(double));
-
-  if (data->improper_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  /* scan the bonds */
-  for (i=0; i<data->nbonds; i++) {
-    data->bond_force_const[i] = 
-      data->inthessian[(i*data->nintcoords)+i] * 
-      HARTREE_TO_KCAL / BOHR_TO_ANGS / BOHR_TO_ANGS;
-
-    printf("%3d (BOND) %2d - %2d : %f\n", i, 
-           data->bonds[2*i], data->bonds[2*i+1],
-           data->bond_force_const[i]);
-  }
-  
-  /* scan the angles */
-  for (j=i; j<i+(data->nangles); j++) {
-    data->angle_force_const[j-i] = 
-      data->inthessian[j*data->nintcoords + j] * HARTREE_TO_KCAL;
-    
-    printf("%3d (ANGLE) %2d - %2d - %2d : %f\n", j,
-           data->angles[3*(j-i)], data->angles[3*(j-i)+1], 
-           data->angles[3*(j-i)+2], 
-           data->angle_force_const[j-i]);
-  }
-
-  /* scan the dihedrals */
-  for (k=j; k<j+(data->ndiheds); k++) {
-    data->dihedral_force_const[k-j] = 
-      data->inthessian[k*data->nintcoords + k] * HARTREE_TO_KCAL;
-    
-    printf("%3d (DIHEDRAL) %2d - %2d - %2d - %2d : %f \n", k,
-           data->dihedrals[4*(k-j)  ], data->dihedrals[4*(k-j)+1],
-           data->dihedrals[4*(k-j)+2], data->dihedrals[4*(k-j)+3],
-           data->dihedral_force_const[k-j]);
-  }
-
-  /* scan the impropers */
-  for (l=k; l<k+(data->nimprops); l++) {
-    data->improper_force_const[l-k] = 
-      data->inthessian[l*data->nintcoords + l] * HARTREE_TO_KCAL;
-    
-    printf("%3d (IMPROPERS) %2d - %2d - %2d - %2d : %f \n", l,
-           data->impropers[4*(l-k)  ], data->impropers[4*(l-k)+1],
-           data->impropers[4*(l-k)+2], data->impropers[4*(l-k)+3],
-           data->improper_force_const[l-k]);
-  }
-
-  data->have_int_hessian = TRUE;
-  return TRUE;
-}
-
-
-#if 0
-
-/************************************************************
- *
- * this function animates a given normal mode by means of
- * generating mod_num_frames frames away from the equilibrium
- * structure in a direction given by the hessiane 
- *
- ************************************************************/
-static int animate_normal_mode(qmdata_t *data, int mode)
-{
-  mode_data *animated_mode = data->animated_mode;
-  float *normal_modes = data->normal_modes;
-  float scale = animated_mode->mode_scaling;
-  int i = 0, k = 0; 
-  int l = 0, m = 0;
-  int natoms = data->numatoms;
-  int num_frames = animated_mode->mode_num_frames;
-
-  /* first sweep to max of interval */
-  for ( k = 0; k < num_frames+1; ++k)
-  {
-    for ( i = 0; i < natoms; ++i)
-    {
-      *(animated_mode->mode_frames+(k*natoms*3)+(3*i)) = 
-	  (data->atoms+i)->x * (1+( k*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i)))));
-
-      *(animated_mode->mode_frames+(k*natoms*3)+(3*i+1)) = 
-	  (data->atoms+i)->y * (1+( k*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+1)))));
-
-      *(animated_mode->mode_frames+(k*natoms*3)+(3*i+2)) = 
-	  (data->atoms+i)->z * (1+( k*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+2)))));
-    }
-  }
-
-
-  /* second sweep all the way back to min of interval */
-  for ( l = 0; l < 2*num_frames+1; ++l)
-  {
-    for ( i = 0; i < natoms; ++i)
-    {
-      *(animated_mode->mode_frames+((l+k)*natoms*3)+(3*i)) = 
-	  (data->atoms+i)->x * (1+((int)(num_frames-l)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i)))));
-
-      *(animated_mode->mode_frames+((l+k)*natoms*3)+(3*i+1)) = 
-	  (data->atoms+i)->y * (1+((int)(num_frames-l)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+1)))));
-
-      *(animated_mode->mode_frames+((l+k)*natoms*3)+(3*i+2)) = 
-	  (data->atoms+i)->z * (1+((int)(num_frames-l)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+2)))));
-    }
-  }
-
-
-  /* third sweep back to the native starting structure */
-  for ( m = 0; m < num_frames+1; ++m)
-  {
-    for ( i = 0; i < natoms; ++i)
-    {
-      *(animated_mode->mode_frames+((l+k+m)*natoms*3)+(3*i)) = 
-	  (data->atoms+i)->x * (1+((int)(m-num_frames)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i)))));
-
-      *(animated_mode->mode_frames+((l+k+m)*natoms*3)+(3*i+1)) = 
-	  (data->atoms+i)->y * (1+((int)(m-num_frames)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+1)))));
-
-      *(animated_mode->mode_frames+((l+k+m)*natoms*3)+(3*i+2)) = 
-	  (data->atoms+i)->z * (1+((int)(m-num_frames)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+2)))));
-    }
-  }
-
-  printf("gamessplugin) Successfully animated mode %d \n", mode);
-
-  return TRUE;
-}
-#endif
-
-
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "gamess";
-  plugin.prettyname = "GAMESS";
-  plugin.author = "Jan Saam, Markus Dittrich, Johan Strumpfer";
-  plugin.majorv = 1;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "log";
-  plugin.open_file_read = open_gamess_read;
-  plugin.read_structure = read_gamess_structure;
-  plugin.close_file_read = close_gamess_read;
-
-  plugin.read_qm_metadata = read_gamess_metadata;
-  plugin.read_qm_rundata  = read_gamess_rundata;
-
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-  plugin.read_timestep = read_timestep;
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gaussianplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gaussianplugin.c
deleted file mode 100644
index 1e29af7b45408dc9fdba9606fd98ac8179a771cc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gaussianplugin.c
+++ /dev/null
@@ -1,2262 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-
-/* *******************************************************
- *
- *          Gaussian Logfile Reader Plugin
- *
- * This plugin allows VMD to read Gaussian log files.
- * The main purpose is to import Wavefunction data.
- * It is modeled after the corresponding GAMESS plugin.
- *
- * ********************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-#include <math.h>
-
-#include "gaussianplugin.h"
-#include "periodic_table.h"
-#include "unit_conversion.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
- 
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifndef GAUSSIAN_DEBUG
-#define GAUSSIAN_DEBUG 0
-#endif
-#define GAUSSIAN_BASIS_DEBUG 1
-
-#if GAUSSIAN_DEBUG
-#define PRINTERR vmdcon_printf(VMDCON_ERROR,                            \
-                               "\n In file %s, line %d: \n %s \n \n",   \
-                               __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#if GAUSSIAN_DEBUG
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE ;   \
-    else fprintf(stderr,"%s:%d %s",__FILE__, __LINE__, x)
-#else
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-#endif
-
-/* make sure pointers are NULLed after free(3)ing them. */
-#define SAFE_FREE(ptr) free(ptr); ptr=NULL
-/* calloc with test of success */
-#define SAFE_CALLOC(ptr,type,count)                                 \
-  ptr = (type *)calloc(count,sizeof(type));                         \
-  if (ptr == NULL) {                                                \
-    PRINTERR;                                                       \
-    return MOLFILE_ERROR;                                           \
-  }
-
-#define UNK_SHELL -666
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL  -2
-#define SP_P_SHELL  -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-#define I_SHELL 6
-
-#define SPIN_ALPHA 0
-#define SPIN_BETA  1
-
-#define STATUS_UNKNOWN       -1
-#define STATUS_CONVERGED      0
-#define STATUS_SCF_NOT_CONV   1
-#define STATUS_TOO_MANY_STEPS 2
-#define STATUS_BROKEN_OFF     3
-
-static const char *runtypes[] = { 
-  "(unknown)", "ENERGY", "OPTIMIZE", "SADPOINT", "HESSIAN", 
-  "SURFACE", "DYNAMICS", "PROPERTIES", NULL};
-
-static const char *scftypes[] = { 
-  "(unknown)", "RHF", "UHF", "ROHF", "GVB", "MCSCF", "FF", NULL };
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-/** Top level gaussian log file parser. Responsible 
- *  for static, i.e. non-trajectory information. */
-static int parse_static_data(gaussiandata *, int *);
-
-/** Check if the current run is an actual Gaussian run; 
- *  returns true/false */
-static int have_gaussian(gaussiandata *);
-
-/** Get number of processors requested and amount of memory used. */
-static int get_proc_mem(gaussiandata *);
-
-/** Get basis set statistics */
-static int get_basis_options(gaussiandata *);
-
-/** Determine the run's title text. */
-static int get_runtitle(gaussiandata *);
-
-/** Read the input atom definitions.  */
-static int get_input_structure(gaussiandata *);
-/** Read coordinates */
-static int get_coordinates(FILE *file, qm_atom_t *atoms, int numatoms);
-/** Read internal orientation coordinates */
-static int get_int_coordinates(FILE *file, qm_atom_t *atoms, int numatoms);
-
-/** Read and parse the Route section of the input. */
-static int get_contrl(gaussiandata *);
-
-/** the function get_initial_info provides the atom number,
- *  coordinates, and atom types and stores them temporarily. */ 
-static int get_final_info(gaussiandata *);
-
-/* in the function get_basis we parse the basis function section to
- * determine the number of basis functions and contraction
- * coefficients. For Pople/Huzinaga style basis sets these numbers are in
- * principle fixed, and could hence be provided by the the plugin
- * itself; however, the user might define his own basis/contraction
- * coeffients and hence reading them from the input file seem to be
- * more general. We can still override it with an "internal" basis
- * set */
-static int get_basis(gaussiandata *);
-
-/* this function replaces the basis set data from the log file with
- * with the equivalent data read from an internal basis set data base.
- * for simplicity we use the same format as gaussian. the basis set
- * data is expected to be in $VMDDIR/basis/<basis-set-name>.gbs. */
-static int get_internal_basis(gaussiandata *);
-
-/* convert shell symmetry type from char to int */
-static int shellsymm_int(char *symm);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(gaussiandata *);
-
-static int read_first_frame(gaussiandata *);
-
-/* this subroutine scans the output file for
- * the trajectory information */
-static int get_traj_frame(gaussiandata *);
-
-/* returns 1 if the optimization has converged */
-static int find_traj_end(gaussiandata *);
-
-/* this function parses the input file for the final
- * wavefunction and stores it in the appropriate arrays; */
-static int get_wavefunction(gaussiandata *, qm_timestep_t *);
-
-/** read in mulliken charges */
-static int get_population(gaussiandata *, qm_timestep_t *);
-
-/* turn fortran double precision 'D' exponents into c parsable 'E's */
-static void fix_fortran_exp(char *string) {
-  while (*string) {
-    if ( (*string == 'D') || (*string == 'd')) *string='e';
-    ++string;
-  }
-}
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the Gaussian logfile and get the number
- * of atoms.
- * We are also reading all the static (i.e. non-trajectory)
- * data here since we have to parse a bit to get the atom count
- * anyway. These data will then be provided to VMD by
- * read_gaussian_metadata() and read_gaussian_rundata().
- *
- * *************************************************************/
-static void *open_gaussian_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  gaussiandata *data;
-  
-  /* open the input file */
-  fd = fopen(filename, "rb");
-  if (fd == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* set up main data structure */
-  data = (gaussiandata *) calloc(1,sizeof(gaussiandata));
-  if (data == NULL) return NULL;
-  
-  data->runtyp = RUNTYP_UNKNOWN;
-  data->scftyp = SCFTYP_UNKNOWN;
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* check if the file is Gaussian format; 
-   * if yes parse it, if not exit */
-  if (have_gaussian(data)==TRUE) {
-    /* if we're dealing with an unsupported Gaussian
-     * version, we better quit. so far we tested g98(g94?),g03 */
-    if ((data->version < 19940000) || (data->version > 20040000)) {
-      vmdcon_printf(VMDCON_ERROR,
-                    "gaussianplugin) Gaussian version %s is not "
-                    "(yet) supported. Bailing out.\n",
-                    data->version_string);
-      free(data);
-      return NULL;
-    }
-
-    /* get the non-trajectory information from the log file */    
-    if (parse_static_data(data, natoms) == FALSE) {
-      free(data);
-      return NULL;
-    }
-  }
-  else {
-    free(data);
-    return NULL;
-  }
-
-  return data;
-}
-
-
-/************************************************************
- * 
- * Provide VMD with the structure of the molecule, i.e the
- * atoms coordinates names, etc.
- *
- *************************************************************/
-static int read_gaussian_structure(void *mydata, int *optflags, 
-                      molfile_atom_t *atoms) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  molfile_atom_t *atom;
-  int i = 0;
- 
-  /* optional data from PTE */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS;
-
-  if (data->have_mulliken) 
-    *optflags |= MOLFILE_CHARGE;
-
-  /* all the information I need has already been read in
-   * via the initial scan and I simply need to copy 
-   * everything from the temporary arrays into the 
-   * proper VMD arrays. */
-
-  /* get initial pointer for atom array */
-  cur_atom = data->initatoms;
-
-  for(i=0; i<data->numatoms; i++) {
-    atom = atoms+i;
-    strncpy(atom->name, cur_atom->type, sizeof(atom->name)); 
-    strncpy(atom->type, get_pte_label(cur_atom->atomicnum), sizeof(atom->type));
-    strncpy(atom->resname,"QM", sizeof(atom->resname)); 
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->atomicnumber = cur_atom->atomicnum;
-    atom->radius = get_pte_vdw_radius(cur_atom->atomicnum);
-    /* XXX; check for isotopes. should be possible to read. */
-    atom->mass   = get_pte_mass(cur_atom->atomicnum);  
-    if (data->have_mulliken)
-      atom->charge = data->qm_timestep->mulliken_charges[i];
-
-    cur_atom++;
-  }
- 
-  return MOLFILE_SUCCESS; 
-}
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_gaussian_metadata(void *mydata, 
-    molfile_qm_metadata_t *gaussian_metadata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-
-  gaussian_metadata->ncart = 0;
-  gaussian_metadata->nimag = 0;
-  gaussian_metadata->nintcoords = 0;
-
-  /* orbital data */
-  gaussian_metadata->num_basis_funcs = data->num_basis_funcs;
-  gaussian_metadata->num_basis_atoms = data->num_basis_atoms;
-  gaussian_metadata->num_shells      = data->num_shells;
-  gaussian_metadata->wavef_size      = data->wavef_size;  
-
-#if vmdplugin_ABIVERSION > 11
-  gaussian_metadata->have_sysinfo = 1;
-  
-  /* charges */
-  gaussian_metadata->have_esp = 0;
-  gaussian_metadata->have_carthessian = 0;
-  gaussian_metadata->have_internals   = 0;
-  gaussian_metadata->have_normalmodes = FALSE;
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_gaussian_rundata(void *mydata, molfile_qm_t *qm_data) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-  molfile_qm_sysinfo_t *sys_data     = &qm_data->run;
-
-  /* fill in molfile_qm_sysinfo_t */
-  sys_data->nproc = data->nproc;
-  sys_data->memory = data->memory; 
-  sys_data->runtype = data->runtyp;
-  sys_data->scftype = data->scftyp;
-  sys_data->totalcharge = data->totalcharge;
-/*  sys_data->multiplicity = data->multiplicity; */
-  sys_data->num_electrons = data->num_electrons;
-  sys_data->num_occupied_A = data->occ_orbitals_A;
-  sys_data->num_occupied_B = data->occ_orbitals_B;
-
-  strncpy(sys_data->basis_string, data->basis_string,
-          sizeof(sys_data->basis_string));
-  
-  strncpy(sys_data->runtitle, data->runtitle, sizeof(sys_data->runtitle));
-  strncpy(sys_data->geometry, data->geometry, sizeof(sys_data->geometry));
-  strncpy(sys_data->version_string, data->version_string,
-          sizeof(sys_data->version_string));
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    memcpy(basis_data->num_shells_per_atom, data->num_shells_per_atom, 
-           data->num_basis_atoms*sizeof(int));
-    memcpy(basis_data->num_prim_per_shell, data->num_prim_per_shell, 
-           data->num_shells*sizeof(int));
-    memcpy(basis_data->shell_symmetry, data->shell_symmetry, 
-           data->num_shells*sizeof(int));
-    memcpy(basis_data->basis, data->basis, 2*data->num_basis_funcs*sizeof(float));
-    memcpy(basis_data->angular_momentum, data->angular_momentum, 
-           3*data->wavef_size*sizeof(int));
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-#if vmdplugin_ABIVERSION > 11
-
-/***********************************************************
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***********************************************************
- * Provide QM metadata for next timestep. 
- * This actually triggers reading the entire next timestep
- * since we have to parse the whole timestep anyway in order
- * to get the metadata. So we store the read data locally
- * and hand them to VMD when requested by read_timestep().
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  int i, have = 0;
-  gaussiandata *data = (gaussiandata *)mydata;
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) read_qm_timestep_metadata(): %d/%d/%d\n",
-                data->num_frames, 
-                data->num_frames_read,
-                data->num_frames_sent);
-#endif
-
-  meta->count = -1; /* Don't know the number of frames yet */
-  meta->has_gradient = 0;
-
-  if (data->num_frames_read > data->num_frames_sent) {
-    have = 1;
-  } else if (data->num_frames_read < data->num_frames) {
-#if GAUSSIAN_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "gaussianplugin) Probing timestep %d\n",
-                  data->num_frames_read);
-#endif
-    have = get_traj_frame(data);
-  }
-
-  if (have) {
-    /* get a pointer to the current qm timestep */
-    qm_timestep_t *cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-#if GAUSSIAN_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "gaussianplugin) Approved timestep %d\n", 
-                  data->num_frames_sent);
-#endif
-    meta->num_scfiter  = cur_qm_ts->num_scfiter;
-    for (i=0; (i<MAX_NUM_WAVE && i<cur_qm_ts->numwave); i++) { 
-#if GAUSSIAN_DEBUG
-      vmdcon_printf(VMDCON_INFO,
-                    "gaussianplugin) num_orbitals_per_wavef[%d/%d]=%d\n",
-                    i+1, cur_qm_ts->numwave, cur_qm_ts->wave[i].num_orbitals);
-#endif
-      meta->num_orbitals_per_wavef[i] = cur_qm_ts->wave[i].num_orbitals;
-    }
-    meta->num_wavef  = cur_qm_ts->numwave;
-    meta->wavef_size = data->wavef_size;
-  } else {
-    meta->num_scfiter  = 0;
-    meta->num_orbitals_per_wavef[0] = 0;
-    meta->num_wavef = 0;
-    meta->wavef_size = 0;
-
-    data->end_of_trajectory = TRUE;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * This function provides the data of the next timestep.
- * Here we actually don't read the data from file, that had
- * to be done already upon calling read_timestep_metadata().
- * Instead we copy the stuff from the local data structure
- * into the one's provided by VMD.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-			 molfile_qm_timestep_t *qm_ts) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  int i = 0;
-  qm_timestep_t *cur_qm_ts;
-
-  if (data->end_of_trajectory == TRUE) return MOLFILE_ERROR;
-
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO,
-                "gaussianplugin) Sending timestep %d\n", 
-                data->num_frames_sent);
-#endif
-
-  /* initialize pointer for temporary arrays */
-  cur_atom = data->initatoms; 
-  
-  /* copy the coordinates */
-  for(i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = cur_atom->x;
-    ts->coords[3*i+1] = cur_atom->y;
-    ts->coords[3*i+2] = cur_atom->z; 
-    cur_atom++;
-  }    
-  
-  /* get a convenient pointer to the current qm timestep */
-  cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-
-  /* store the SCF energies */
-  for (i=0; i<cur_qm_ts->num_scfiter; i++) {
-    qm_ts->scfenergies[i] = cur_qm_ts->scfenergies[i];
-  }
-
-  /* store the wave function and orbital energies */
-  if (cur_qm_ts->wave) {
-    for (i=0; i<cur_qm_ts->numwave; i++) {
-      qm_wavefunction_t *wave = &cur_qm_ts->wave[i];
-      if (wave->wave_coeffs && wave->orb_energies) {
-        memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-               wave->num_orbitals*data->wavef_size*sizeof(float));
-        memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-               wave->num_orbitals*sizeof(float));
-      }
-    }
-  }
-
-  if (data->runtyp == RUNTYP_ENERGY || data->runtyp == RUNTYP_HESSIAN) {
-    /* We have only a single point */
-    data->end_of_trajectory = TRUE;
-  }
-
-  data->num_frames_sent++;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-/** Clean up when done and free all memory 
- *  to avoid memory leaks.
- *
- **********************************************************/
-static void close_gaussian_read(void *mydata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->file_name);
-  free(data->initatoms);
-  free(data->basis);
-  free(data->shell_symmetry);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->mulliken_charges);
-  free(data->internal_coordinates);
-  free(data->wavenumbers);
-  free(data->intensities);
-  free(data->normal_modes);
-  free(data->angular_momentum);
-
-  if (data->basis_set) {
-    for(i=0; i<data->numatoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  for (i=0; i<data->num_frames_read; i++) {
-    free(data->qm_timestep[i].scfenergies);
-    free(data->qm_timestep[i].gradient);
-    free(data->qm_timestep[i].mulliken_charges);
-    for (j=0; j<data->qm_timestep[i].numwave; j++) {
-      free(data->qm_timestep[i].wave[j].wave_coeffs);
-      free(data->qm_timestep[i].wave[j].orb_energies);
-/*       free(data->qm_timestep[i].wave[j].occupancies); */
-    }
-    free(data->qm_timestep[i].wave);
-  }
-  free(data->qm_timestep);
-  
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-
-/********************************************************
- *
- * Main gaussian log file parser responsible for static,  
- * i.e. non-trajectory information.
- *
- ********************************************************/
-static int parse_static_data(gaussiandata *data, int *natoms) 
-{
-  /* Read # of procs and amount of requested memory */
-  if (!get_proc_mem(data))        return FALSE;
-
-  /* Read the basis options */
-  if (!get_basis_options(data))   return FALSE;
-
-  /* Read the route section and try to determine
-   * the job type. exit if unsupported. */
-  if (!get_contrl(data))          return FALSE;
-
-  /* Read the run title */
-  if (!get_runtitle(data))        return FALSE;
-
-  /* Read the input atom definitions and geometry */
-  if (!get_input_structure(data)) return FALSE;
-  /* provide VMD with the proper number of atoms */
-  *natoms = data->numatoms;
-  /* read first set of coordinates and basis set data */
-  read_first_frame(data);
-  
-  /* */
-  get_final_info(data);
-
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) found %d QM data frames.\n", data->num_frames);
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) num_frames_read = %d\n", data->num_frames_read);
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) num_frames_sent = %d\n", data->num_frames_sent);
-#endif
-  return TRUE;
-}
-
-/**********************************************************
- *
- * this subroutine checks if the provided files is
- * actually a Gaussian file;
- *
- **********************************************************/
-static int have_gaussian(gaussiandata *data) 
-{
-  char word[4][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ];
-  char *ptr;
-  int i = 0;
- 
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  /* check if the file is Gaussian format 
-   * Gaussian output typically begins with:
-   * 'Entering Gaussian System' */
-  i=0; /* check only the first 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    ++i;
-  } while( (strcmp(word[0],"Entering") || 
-            strcmp(word[1],"Gaussian") || 
-            strcmp(word[2],"System,")) && (i<100) );
-  if (i>=100) return FALSE;
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) Analyzing Gaussian log file: %s\n",data->file_name);
-  
-  /* now read on until we find the block of text with encoded version
-   * number and compile date. */
-  i=0; /* check only the next 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    buffer[20] = '\0';          /* length of the version block varies. */
-  } while ( (i<100) && strcmp(buffer,
-      " *******************"));
-  if (i>=100) return FALSE;
-
-  /* one more line... */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s%s%s%s",word[0],word[1],
-         word[2],word[3]);
-
-  data->version = atoi(word[1]) * 10000;
-  if (data->version > 700000) {
-      data->version += 19000000;
-  } else {
-      data->version += 20000000;
-  }
-  strcpy(data->version_string,word[2]);
-
-  ptr=strrchr(word[2],'-');
-  if (ptr != NULL) { 
-      /* extract revision and patchlevel from G##Rev%.## word.*/
-      ptr += 7;
-      i =  (*ptr) - 'A' + 1;
-      data->version += i*100;
-      ++ptr; ++ptr;
-      data->version += atoi(ptr);
-  }
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Gaussian version = %s  (Version code: %d)\n",
-                data->version_string, data->version);
-  vmdcon_printf(VMDCON_INFO,
-                "gaussianplugin) Compiled on      = %s \n", word[3]);
-
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * this subroutine reads the number of procs and the amount
- * of memory requested
- *
- **********************************************************/
-static int get_proc_mem(gaussiandata *data) {
-
-  char word[5][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ];
-  int nproc,maxmem;
-  int i, link;
-
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  rewind(data->file);
-
-  /* set some defaults */
-  nproc = 1;
-  maxmem = -1;
-  
-  do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s%s%s%*s%s%*s%*s%*s%*s%*s%s",
-             word[0],word[1],word[2],word[3],word[4]);
-
-      /* max dynamical memory. */ 
-      if ((strcmp(word[0],"Leave") == 0) &&
-          (strcmp(word[1],"Link")  == 0)) {
-        link = atoi(word[2]);
-        /* gaussian uses real*8 words internally. convert to MByte. */
-        if (link > 1) maxmem=atoi(word[4])/128/1024;
-      }
-
-      /* number of SMP cpus */
-      if ( (strcmp(word[0],"Will") == 0) &&
-           (strcmp(word[1],"use")  == 0) &&
-           (strcmp(word[2],"up")  == 0) ) {
-        nproc = atoi(word[3]);
-      }
-
-      /* detect if have read too far */ 
-      if (((strcmp(word[0],"Standard") == 0) ||
-           (strcmp(word[0],"Z-Matrix") == 0) ||
-           (strcmp(word[0],"Input") == 0) ) &&
-          (strcmp(word[1],"orientation:")  == 0)) {
-        /* can not detect memory used */
-        maxmem=0;
-      }
-  } while (maxmem < 0);
-
-  /* store findings */
-  data->nproc = nproc;
-  data->memory = maxmem;
-  if (maxmem) 
-    vmdcon_printf(VMDCON_INFO, 
-                  "gaussianplugin) Gaussian used %2d SMP process(es), "
-                  "% 6d Mbytes of memory \n", nproc, maxmem);
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Extract basis set options
- *
- **********************************************************/
-static int get_basis_options(gaussiandata *data) {
-
-  char word[5][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ], *ptr;
-  int i = 0, nfunc, nprim, nume_a, nume_b;
-
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  /* to be safe let's rewind the file */
-  rewind(data->file);
-
-  /* scanning for basis set string */
-  nume_a=-1;
-  nfunc=-1;
-  nprim=-1;
-  do {
-    GET_LINE(buffer, data->file);
-    i=sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    if (i==3) {
-
-      if ( (strcmp(word[0],"Standard") == 0) &&
-           (strcmp(word[1],"basis:") == 0) ) {
-
-        ptr = &buffer[0] + strlen(buffer) - 1;
-        while(*ptr==' ') --ptr;
-        *ptr='\0';
-        strncpy(data->gbasis, word[2], 10);
-        strncpy(data->basis_string, buffer+17, MOLFILE_BUFSIZ);
-
-        /* make sure gbasis is uppercase. */
-        ptr=data->gbasis;
-        for (;*ptr;++ptr) *ptr=toupper(*ptr);
-
-      } else if ( (strcmp(word[0],"General") == 0) &&
-                  (strcmp(word[1],"basis") == 0) ) {
-
-        /* General basis read from cards */
-
-        ptr = &buffer[0] + strlen(buffer) - 1;
-        while(*ptr==' ') --ptr;
-        *ptr='\0';
-
-        strncpy(data->gbasis, "GEN", 4);
-        strncpy(data->basis_string, buffer, MOLFILE_BUFSIZ);
-      
-      } else if ( (strcmp(word[0],"AO") == 0) 
-                  && (strcmp(word[1],"basis") == 0) ) {
-        /* inline basis definition. count number of atomic basis 
-         * functions and primitive gaussians */
-        int numcenter, numgauss, numbasis, numshell;
-        numcenter=numgauss=numbasis=numshell=0;
-        GET_LINE(buffer, data->file);
-        do {
-          int numprim=0;
-          ++numcenter;
-          do {
-            /* angular momentum, number of primitive gaussians
-             * and first entry */
-            GET_LINE(buffer, data->file);
-            i=sscanf(buffer,"%s%d",word[0], &numprim);
-            if (i==2) {
-              ++numshell;
-              if (strcmp(word[0],"S") == 0) {
-                numbasis += 1;    /* simple s-shell*/
-                numgauss += numprim;
-              } else if (strcmp(word[0],"P") == 0) {
-                numbasis += 3;    /* simple p-shell */
-                numgauss += numprim;
-              } else if (strcmp(word[0],"SP") == 0) {
-                numbasis += 1+3;  /* combined sp-shell, stored individually */
-                numgauss += 2*numprim;
-                numshell += 1;
-              } else if (strcmp(word[0],"D") == 0) {
-                numbasis += 6;    /* cartesian d-shell. pure will be converted */
-                numgauss += numprim;
-              } else if (strcmp(word[0],"SPD") == 0) {
-                numbasis += 1+3+6; /* combined s,p,d shell */
-                numgauss += 3*numprim;
-                numshell += 2;
-              } else if (strcmp(word[0],"F") == 0) {
-                numbasis += 10;   /* cartesian f-shell. pure will be converted */
-                numgauss += numprim;
-              } else if (strcmp(word[0],"G") == 0) {
-                numbasis += 15;   /* cartesian g-shell. pure will be converted */
-                numgauss += numprim;
-              } else {
-                vmdcon_printf(VMDCON_ERROR, "gaussianplugin) support for %s-"
-                              "shells is not yet programmed.\n", word[0]);
-                return MOLFILE_ERROR;
-              }
-            } else if (i==1) {
-              if (strcmp(word[0],"****") == 0) {
-                break;
-              }
-            } else {
-              return MOLFILE_ERROR;
-            }
-            /* skip over lines with primitives */
-            for (i=0; i < numprim; ++i) 
-              GET_LINE(buffer, data->file);
-
-#if GAUSSIAN_DEBUG
-            vmdcon_printf(VMDCON_INFO, "numcenter:% 4d  numbasis:% 4d  numgauss:% 4d  "
-                    "numshell:% 4d\n", numcenter, numbasis, numgauss, numshell);
-#endif        
-          } while (strcmp(word[0],"****"));
-          GET_LINE(buffer, data->file);
-          i=sscanf(buffer,"%s%s",word[0], word[1]);
-        } while (i == 2);
-        data->wavef_size = numbasis;
-        data->num_shells = numshell;
-        data->num_basis_funcs = numgauss;
-        data->num_basis_atoms = numcenter;
-      } else {
-        i=sscanf(buffer,"%d%s%s%d%s",&nfunc,word[0],word[1],
-                 &nprim,word[2]);
-        if (i==5) {
-          if ((strncmp(word[0],"basis",5) == 0)     &&
-              (strncmp(word[1],"functions",9) == 0) &&
-              (strncmp(word[2],"primitive",9) == 0) ) {
-            GET_LINE(buffer, data->file);
-            sscanf(buffer,"%d%s%s%d%s",&nume_a,word[0],word[1],
-                   &nume_b,word[2]);
-          }
-        }
-      }
-    }
-  } while (nume_a < 0);
-
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) %d shells with %d/%d basis functions, "
-                "%d/%d primitive gaussians\n", data->num_shells,
-                nfunc, data->wavef_size, nprim, data->num_basis_funcs);
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) %d QM atoms with %d alpha electrons, "
-                "%d beta electron\n", data->num_basis_atoms, nume_a, nume_b);
-
-  data->num_orbitals   = nfunc;
-  data->occ_orbitals_A = nume_a;
-  data->occ_orbitals_B = nume_b;
-  data->num_electrons  = nume_a + nume_b;
-  data->multiplicity   = (nume_a+nume_b)/2-(nume_a>nume_b?nume_b:nume_a)+1;
-  
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Extract the run title line
- *
- **********************************************************/
-static int get_runtitle(gaussiandata *data) {
-
-  char buffer[BUFSIZ];
-  char *temp;
-  size_t offs;
-  
-  /* look for RUN TITLE section */
-  do {
-    GET_LINE(buffer, data->file);
-  } while (strncmp(buffer," -", 2) );
-  
-  GET_LINE(buffer, data->file);
-  do {
-    char s; 
-
-    offs=strlen(buffer);
-    temp=&buffer[offs];
-
-    while (*temp == '\n' || *temp == '\r' || *temp == '\0') --temp;
-    s = *temp;
-    fgets(temp,BUFSIZ-offs,data->file);
-    *temp = s;
-  } while ( strncmp(temp+1,"--",2) );
-
-  offs=strlen(buffer);
-  temp=&buffer[offs-1];
-  while (*temp == '-' || *temp == '\n' || *temp == '\r') --temp;
-  ++temp;  *temp='\0';
-  strncpy(data->runtitle,buffer,sizeof(data->runtitle));
-  
-  return TRUE;
-} 
-
-
-/* Read the input atom definitions and geometry */
-static int get_input_structure(gaussiandata *data) {
-  char buffer[BUFSIZ];
-  char word[4][MOLFILE_BUFSIZ];
-  int i, numatoms;
-
-  buffer[0] = '\0';
-  for (i=0; i<4; i++) word[i][0] = '\0';
-  
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s%s",word[0],word[1]);
-  
-  if ( ( (strcmp(word[0],"Symbolic") == 0) &&
-         (strcmp(word[1],"Z-matrix:") == 0) ) ||
-       ( (strcmp(word[0],"Redundant") == 0) &&
-         (strcmp(word[1],"internal") == 0)  ) || 
-       ( (strcmp(word[0],"Z-Matrix") == 0) &&
-         (strcmp(word[1],"taken") == 0) ) ) {
-
-    /* skip over line with checkpoint file name */
-    if ( ( (strcmp(word[0],"Redundant") == 0) &&
-           (strcmp(word[1],"internal") == 0)  ) || 
-         ( (strcmp(word[0],"Z-Matrix") == 0) &&
-           (strcmp(word[1],"taken") == 0) ) ) {
-      GET_LINE(buffer, data->file);
-    }
-      
-    /* charge and multiplicity */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s%*s%d%*s%*s%d", &(data->totalcharge),
-           &(data->multiplicity));
-
-    /* parse coordinates from input */
-    numatoms=0;
-    data->initatoms=NULL;
-    i=1;
-    do {
-      char *ptr;
-      qm_atom_t *atm;
-      
-      i=1;
-      GET_LINE(buffer, data->file);
-      ptr = strtok(buffer," ,\t\n");
-      
-      if (ptr == NULL) break;
-      if (strcmp(ptr, "Variables:") == 0) break;
-      if (strcmp(ptr, "Recover") == 0) break;
-      if (strcmp(ptr, "The") == 0) break;
-      if (strcmp(ptr, "Leave") == 0) break;
-      
-      /* for now we only read the atom label */
-      data->initatoms=realloc(data->initatoms,(numatoms+1)*sizeof(qm_atom_t));
-      atm = data->initatoms + numatoms;
-      strncpy(atm->type, ptr, sizeof(atm->type));
-      atm->atomicnum=get_pte_idx(ptr);
-      ++numatoms;
-    } while ( i >= 0 );
-    /* TODO */
-  } else {
-    vmdcon_printf(VMDCON_ERROR,
-                  "gaussianplugin) ERROR, cannot parse input coordinates.\n");
-    return FALSE;
-  }
-  
-  /* store number of atoms in data structure */
-  data->numatoms = numatoms;
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Atoms: %d   Charge: %d   Multiplicity: %d\n", 
-                numatoms, data->totalcharge, data->multiplicity);
-  return TRUE; 
-}
-
-
-/**********************************************************
- *
- * Read data from the Route section.
- *
- * XXX: there currently do not seem to be any provisions
- * XXX: for multi-step jobs, i.e. jobs that either have
- * XXX: multiple run types in one calculations or perform 
- * XXX: several calculation steps subsequently...
- *
- **********************************************************/
-static int get_contrl(gaussiandata *data) {
-
-  char buffer[BUFSIZ];
-  const char *vmdbasis;
-  char *temp;
-  size_t offs;
-
-  buffer[0] = '\0';
-  rewind(data->file);
-  
-  /* try to find route section. */
-  do {
-    GET_LINE(buffer, data->file);
-  } while( strncmp(buffer," #", 2) );
-
-  /* append to string in buffer until we reach the end of 
-   * the route section. this way we'll have the whole info
-   * in one long string.
-   * Gaussian writes this out with format (x,A70), so 
-   * joining lines need some special tricks.  */
-  do {
-    char s; 
-
-    offs=strlen(buffer);
-    temp=&buffer[offs];
-
-    while (*temp == '\n' || *temp == '\r' || *temp == '\0') --temp;
-    s = *temp;
-    fgets(temp,BUFSIZ-offs,data->file);
-    *temp = s;
-  } while ( strncmp(temp+1,"--",2) );
-
-  offs=strlen(buffer);
-  temp=&buffer[offs-1];
-  while (*temp == '-' || *temp == '\n' || *temp == '\r') --temp;
-
-  /* some more magic is required.
-   * make sure we are zero terminated and have a trailing blank.
-   * the latter allows to search for keywords with strstr without
-   * getting false positives on keyword strings that are contained
-   * in other keywords */
-  ++temp;  *temp=' '; ++temp; *temp='\0';
-
-  /* convert to upper case */
-  temp=&buffer[0];
-  while (*temp++) *temp = toupper(*temp);
-
-  /* now we are ready to look for useful information */
-
-  /* will we have wavefunction output? */
-  if (strstr(buffer," IOP(6/7=3) ")) {
-    data->have_wavefunction=TRUE;
-  } else {
-    data->have_wavefunction=FALSE;
-  }
-
-  /* is there a basis set in "input format" */
-  if (strstr(buffer," GFINPUT ")) {
-    data->have_basis=TRUE;
-  } else {
-    data->have_basis=FALSE;
-  }
-
-  /* cartesian d-basis functions */
-  if (strstr(buffer," 6D ")) {
-    data->have_cart_basis |= 1;
-  }
-  /* cartesian f-basis functions */
-  if (strstr(buffer," 10F ")) {
-    data->have_cart_basis |= 2;
-  }
-  /* pure d-basis functions */
-  if (strstr(buffer," 5D ")) {
-    data->have_cart_basis &= ~1;
-  }
-  /* pure f-basis functions */
-  if (strstr(buffer," 7F ")) {
-    data->have_cart_basis &= ~2;
-  }
-
-  /* find scf calculation type. XXX: might be safer to detect from output. */
-  if ((strstr(buffer," ROHF/")) ||
-      (strstr(buffer," ROHF ")) ||
-      (strstr(buffer," ROMP"))) {
-    data->scftyp = SCFTYP_ROHF;
-  } else if (data->multiplicity != 1) {
-    data->scftyp = SCFTYP_UHF;
-  } else {
-    data->scftyp = SCFTYP_RHF;
-  }
-        
-  /* for semi-empirical, we set the basis to valence-STO-3G. */
-  if ((strstr(buffer," AM1/")) ||
-      (strstr(buffer," AM1 ")) ||
-      (strstr(buffer," PM3/")) ||
-      (strstr(buffer," PM3 ")) ||
-      (strstr(buffer," MNDO/")) ||
-      (strstr(buffer," MNDO "))) {
-
-    vmdbasis = getenv("VMDDEFBASISSET");
-    if (vmdbasis == NULL) 
-      vmdbasis = "VSTO-3G";
-    
-    if(strlen(data->gbasis) == 0)
-      strncpy(data->gbasis, vmdbasis, sizeof(data->gbasis));
-
-    if(strlen(data->basis_string) == 0) {
-      strncpy(data->basis_string, "Internal ", sizeof(data->basis_string));
-      strncat(data->basis_string, vmdbasis, sizeof(data->basis_string) - 10);
-
-      if(data->have_cart_basis & 1)
-        strcat(data->basis_string," 6D");
-      else
-        strcat(data->basis_string," 5D");
-      if(data->have_cart_basis & 2)
-        strcat(data->basis_string," 10F");
-      else
-        strcat(data->basis_string," 7F");
-    }
-  }
-
-  /* find run type. XXX: might be safer to detect from output. */
-  data->runtyp = RUNTYP_ENERGY;  /* default */
-  if ((strstr(buffer," FOPT ")) || 
-      (strstr(buffer," FOPT=")) ||
-      (strstr(buffer," FOPT(")) ||
-      (strstr(buffer," OPT=")) ||
-      (strstr(buffer," OPT(")) ||
-      (strstr(buffer," OPT "))) {
-    data->runtyp = RUNTYP_OPTIMIZE;
-  } 
-  if (strstr(buffer," FREQ ")) {
-    data->runtyp = RUNTYP_HESSIAN;
-  }
-  if (strstr(buffer," SCAN ")) {
-    data->runtyp = RUNTYP_SURFACE;
-  }
-        
-  /* make sure we have some basis set string
-   * and allow to set it from within VMD. */
-  vmdbasis = getenv("VMDDEFBASISSET");
-  if(strlen(data->gbasis) == 0) {
-    if (vmdbasis == NULL) {
-      strncpy(data->gbasis, "(unknown)", sizeof(data->gbasis));
-      strncpy(data->basis_string, "(unknown)", sizeof(data->basis_string));
-    } else {
-      strncpy(data->gbasis, vmdbasis, sizeof(data->gbasis));
-      strncpy(data->basis_string, "Internal ", sizeof(data->basis_string));
-      strncat(data->basis_string, vmdbasis, sizeof(data->basis_string) - 10);
-
-      if(data->have_cart_basis & 1)
-        strcat(data->basis_string," 6D");
-      else
-        strcat(data->basis_string," 5D");
-      if(data->have_cart_basis & 2)
-        strcat(data->basis_string," 10F");
-      else
-        strcat(data->basis_string," 7F");
-    }
-  }
-
-  /* TODO: add more. e.g. Opt=(ModRedundant), IRC */
-
-  /* print (some of) our findings */
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) Run-type: %s, SCF-type: %s\n",
-                runtypes[data->runtyp], scftypes[data->scftyp]);
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) using %s basis set.\n", data->basis_string);
-  
-  return TRUE;
-}
-
-static int read_first_frame(gaussiandata *data) {
-  data->qm_timestep = NULL;
-
-  /* the angular momentum is populated in get_wavefunction 
-   * which is called by get_traj_frame(). We have obtained
-   * the array size wavef_size already from the basis set
-   * statistics */
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) preparing for %d atomic basis functions "
-                "per wavefunction.\n", data->wavef_size);
-  SAFE_CALLOC(data->angular_momentum,int,3*data->wavef_size);
-
-  if (!get_traj_frame(data)) {
-    return FALSE;
-  }
-
-  data->num_frames = 1;
-  return TRUE;
-}
-
-/******************************************************
- *
- * Reads the info printed after the geometry search
- * has finished or whatever analysis was done in a 
- * single point run, e.g. ESP charges, Hessian, etc.
- * Rewinds to the beginning of the search when done,
- * because we read this part at in the initial phase
- * and might have to look for additional timesteps
- * later.
- *
- ******************************************************/
-static int get_final_info(gaussiandata *data) {
-  long filepos;
-  filepos = ftell(data->file);
-
-  if (data->runtyp == RUNTYP_OPTIMIZE || 
-      data->runtyp == RUNTYP_SADPOINT ||
-      data->runtyp == RUNTYP_SURFACE) {
-    /* Try to advance to the end of the geometry
-     * optimization. If no regular end is found we
-     * won't find any propertiies to read and return. */
-    if (!find_traj_end(data)) return FALSE;
-  }
-
-  if (data->runtyp == RUNTYP_HESSIAN || data->runtyp == RUNTYP_SURFACE) {
-    vmdcon_printf(VMDCON_WARN, "gaussianplugin) this run type is not fully supported\n");
-  }
-    
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE; 
-}
-
-
-static int get_coordinates(FILE *file, qm_atom_t *atoms, int numatoms) {
-  char buffer[BUFSIZ];
-  int atomicnum;
-  float x,y,z;
-  int i,n;
-
-  /* we look for:
-                              Input orientation:                          
- ---------------------------------------------------------------------
- Center     Atomic     Atomic              Coordinates (Angstroms)
- Number     Number      Type              X           Y           Z
- ---------------------------------------------------------------------
-   */
-  do {
-    GET_LINE(buffer, file);
-  } while ((strstr(buffer,"Input orientation:") == NULL) &&
-           (strstr(buffer,"Z-Matrix orientation:") == NULL));
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  
-  for (i=0; i < numatoms; ++i) {
-    GET_LINE(buffer, file);
-    n = sscanf(buffer,"%*d%d%*d%f%f%f",&atomicnum,&x,&y,&z);
-    if (n!=4) return FALSE;
-    atoms[i].x=x;
-    atoms[i].y=y;
-    atoms[i].z=z;
-  }
-  return TRUE;
-}
-
-/** same as get_coordinates, but we look for coordinates 
-    in internal orientation */
-static int get_int_coordinates(FILE *file, qm_atom_t *atoms, int numatoms) {
-  char buffer[BUFSIZ];
-  int atomicnum;
-  float x,y,z;
-  int i,n;
-
-  /* we look for:
-                              Standard orientation:                          
- ---------------------------------------------------------------------
- Center     Atomic     Atomic              Coordinates (Angstroms)
- Number     Number      Type              X           Y           Z
- ---------------------------------------------------------------------
-   */
-  do {
-    GET_LINE(buffer, file);
-  } while ((strstr(buffer,"Standard orientation:") == NULL) &&
-           (strstr(buffer,"Z-Matrix orientation:") == NULL));
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  
-  for (i=0; i < numatoms; ++i) {
-    GET_LINE(buffer, file);
-    n = sscanf(buffer,"%*d%d%*d%f%f%f",&atomicnum,&x,&y,&z);
-    if (n!=4) return FALSE;
-    atoms[i].x=x;
-    atoms[i].y=y;
-    atoms[i].z=z;
-  }
-  return TRUE;
-}
-
-
-
-/*******************************************************
- *
- * this function reads in the basis set data 
- *
- * ******************************************************/
-/* typical data looks like this: 
- ****
-   <atomnum> 0
-   <shellsymm> <#prims> <scalefactor> 0.0
-   <#prims> lines of <coeff(i)> <exp(i>
-   <shellsymm> <#prims> <scalefactor> 0.0
-   <#prims> lines of <coeff(i)> <exp(i>
-    ...
- ****    
-
-  1 0
- S   6 1.00       0.000000000000
-      0.1941330000D+05  0.1851598923D-02
-      0.2909420000D+04  0.1420619174D-01
-      0.6613640000D+03  0.6999945928D-01
-      0.1857590000D+03  0.2400788603D+00
-      0.5919430000D+02  0.4847617180D+00
-      0.2003100000D+02  0.3351998050D+00
- SP   6 1.00       0.000000000000
-      0.3394780000D+03 -0.2782170105D-02  0.4564616191D-02
-      0.8101010000D+02 -0.3604990135D-01  0.3369357188D-01
-      0.2587800000D+02 -0.1166310044D+00  0.1397548834D+00
-      0.9452210000D+01  0.9683280364D-01  0.3393617168D+00
-      0.3665660000D+01  0.6144180231D+00  0.4509206237D+00
-      0.1467460000D+01  0.4037980152D+00  0.2385858009D+00
- */
-
-int get_basis(gaussiandata *data) {
-
-  char buffer[BUFSIZ];
-  char word[3][MOLFILE_BUFSIZ];
-  int i; 
-
-  /* no point in searching through the log file,
-   * if we cannot have this information */
-  if (!data->have_basis) return FALSE;
-
-  /* search for characteristic line. but only in the next 1000 lines */
-  i=0;
-  if(data->version < 20030000) {            /* g98 */
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-      ++i;
-    } while( (strcmp(word[0],"Basis") || 
-              strcmp(word[1],"set"))  && (i<1000) );
-  } else {                                  /* g03 */
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-      ++i;
-    } while( (strcmp(word[0],"AO") || 
-              strcmp(word[1],"basis"))  && (i<1000) );
-  }
-  if (i>=1000) {
-    /* flag that we have no basis set data */
-    data->num_shells_per_atom=NULL;
-    data->have_basis=FALSE;
-    return MOLFILE_ERROR;
-  }
-  
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  SAFE_CALLOC(data->basis_set,basis_atom_t,data->num_basis_atoms);
-
-  for (i=0; i< data->num_basis_atoms; ++i) {
-    int numshells, numprim;
-    int numread, ishell;
-    float scalef;
-    shell_t *shell;
-    
-    /* this line should be '<atomindex> 0'. gaussian allows much more
-     * flexible input (it is a zero terminated list of indices or labels), 
-     * but upon writing to the log files there is exactly one basis set 
-     * specification per atom. */
-    GET_LINE(buffer, data->file);
-    if (atoi(buffer) != (i+1) ) {
-      vmdcon_printf(VMDCON_WARN, 
-                    "gaussianplugin) basis set atom counter mismatch: %d vs %s\n",
-                    atoi(buffer), i+1);
-      SAFE_FREE(data->basis_set);
-      data->num_shells_per_atom=NULL;
-      return MOLFILE_ERROR;
-    }
-    strncpy(data->basis_set[i].name,data->gbasis,10);
-    
-    numshells=0;
-    shell=NULL;
-    GET_LINE(buffer, data->file);
-    while( strncmp(buffer," ****",5) ) {
-      int n;
-
-      numread=sscanf(buffer,"%s%d%f",word[0],&numprim,&scalef);
-      if (numread == 3) {
-#if GAUSSIAN_DEBUG && GAUSSIAN_BASIS_DEBUG
-        vmdcon_printf(VMDCON_INFO, "gaussianplugin) atom: %d, element: %s, shell: %d "
-                      "%s-type shell, %d primitives, scalefactor %f\n", i,
-                      get_pte_label(data->initatoms[i].atomicnum), numshells+1, 
-                      word[0], numprim, scalef);
-#endif
-        ;
-      } else {
-        vmdcon_printf(VMDCON_WARN, 
-                      "gaussianplugin) basis set parse error: %s",buffer);
-        free(data->basis_set);
-        data->have_basis=FALSE;
-        data->basis_set=NULL;
-        data->num_shells_per_atom=NULL;
-        return FALSE;
-      }
-      ishell=numshells;
-      ++numshells;
-      shell=realloc(shell,numshells*sizeof(shell_t));
-      shell[ishell].numprims=numprim;
-      shell[ishell].symmetry=shellsymm_int(word[0]);
-      shell[ishell].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      if (shell[ishell].symmetry == SP_S_SHELL) {
-        ++numshells;
-        shell=realloc(shell,numshells*sizeof(shell_t));
-        shell[ishell+1].numprims=numprim;
-        shell[ishell+1].symmetry=SP_P_SHELL;
-        shell[ishell+1].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      }
-
-      for (n=0; n<numprim; ++n) {
-        GET_LINE(buffer, data->file);
-        sscanf(buffer,"%s%s%s", word[0],word[1],word[2]);
-        fix_fortran_exp(word[0]);
-        shell[ishell].prim[n].exponent=atof(word[0])*scalef*scalef;
-        fix_fortran_exp(word[1]);
-        shell[ishell].prim[n].contraction_coeff=atof(word[1]);
-        if (shell[ishell].symmetry == SP_S_SHELL) {
-          shell[ishell+1].prim[n].exponent=shell[ishell].prim[n].exponent;
-          fix_fortran_exp(word[2]);
-          shell[ishell+1].prim[n].contraction_coeff=atof(word[2]);
-        }
-      }
-      GET_LINE(buffer, data->file);
-    }
-
-    /* store shells in atom */
-    data->basis_set[i].numshells = numshells;
-    data->basis_set[i].shell = shell;
-  }
-
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Parsed %d uncontracted basis functions with %d shells.\n",
-                data->num_basis_funcs, data->num_shells);
-
-#if GAUSSIAN_DEBUG
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int j,k,primcount,shellcount;
-    primcount=0;
-    shellcount=0;
-    
-    printf("%-8s (%10s)\n\n", data->initatoms[i].type, data->basis_set[i].name);
-    printf("\n");
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j,
-               data->basis_set[i].shell[j].symmetry,
-               primcount+1,
-               data->basis_set[i].shell[j].prim[k].exponent,
-               data->basis_set[i].shell[j].prim[k].contraction_coeff);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-#endif
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  return fill_basis_arrays(data);
-}
-
-
-/*******************************************************
- *
- * this function reads in the basis set data from 
- * <basis>.gbs or $VMDDIR/basis/<basis>.gbs
- *
- * ******************************************************/
-int get_internal_basis(gaussiandata *data) {
-
-  char *vmddir = NULL;
-  FILE *fp;
-  char buffer[BUFSIZ];
-  char word[3][MOLFILE_BUFSIZ];
-  char filepath[256];
-  int  i,n; 
-
-  /* no point in adding a basis set if we already have this information */
-  if (data->have_basis) return TRUE;
-
-  /* try to open basis set database file. */
-  sprintf(filepath,"%s.gbs",data->gbasis);
-  fp=fopen(filepath,"rb");
-  if (fp == NULL) {
-    vmddir=getenv("VMDDIR");
-    if (vmddir == NULL) {
-      vmddir="/usr/local/lib/vmd";
-    }
-    sprintf(filepath,"%s/basis/%s.gbs",vmddir,data->gbasis);
-    fp=fopen(filepath,"rb");
-  }
-  
-  if (fp == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "gaussianplugin) failed to read basis set "
-                  "from data base file %s\n", filepath);
-    data->num_shells_per_atom=NULL;
-    data->have_basis=FALSE;
-    return FALSE;
-  } else {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) reading basis set "
-                  "from data base file %s\n", filepath);
-  }
-  
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  SAFE_CALLOC(data->basis_set,basis_atom_t,data->num_basis_atoms);
-
-  for (i=0; i < data->num_basis_atoms; ++i) {
-    int numshells, numprim;
-    int numread, ishell;
-    float scalef;
-    shell_t *shell;
-    
-    /* search for the characteristic first line starting with '****'. */
-    rewind(fp);
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-    } while(strcmp(word[0],"****"));
-  
-    /* search for an entry for the current atom in the format '<name> 0'. */
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      if (feof(fp)) {
-        free(data->basis_set);
-        data->basis_set=NULL;
-        data->num_shells_per_atom=NULL;
-        data->have_basis=FALSE;
-        vmdcon_printf(VMDCON_ERROR, "gaussianplugin) EOF in data base "
-                      "file %s while looking for element %s.\n", filepath, 
-                      get_pte_label(data->initatoms[i].atomicnum), buffer);
-        fclose(fp);
-        return FALSE;
-      }
-      n=sscanf(buffer,"%s%s",word[0],word[1]);
-    } while ( (n != 2) || strcmp(word[1],"0") ||
-              (strcmp(word[0],get_pte_label(data->initatoms[i].atomicnum))) );
-    
-    strncpy(data->basis_set[i].name,data->gbasis,sizeof(data->gbasis));
-    
-    numshells=0;
-    shell=NULL;
-
-    /* read basis set until end of element */
-    do {
-
-      fgets(buffer, sizeof(buffer), fp);
-      if (strstr(buffer,"****")) break;
-      if (ferror(fp)) {
-        vmdcon_printf(VMDCON_ERROR, "gaussianplugin) read error in data "
-                      "base file %s while reading basis of element %s.\n", 
-                      filepath, get_pte_label(data->initatoms[i].atomicnum));
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      numread=sscanf(buffer,"%s%d%f",word[0],&numprim,&scalef);
-      if (numread == 3) {
-#if GAUSSIAN_DEBUG && GAUSSIAN_BASIS_DEBUG
-        vmdcon_printf(VMDCON_INFO, "gaussianplugin) atom: %d, element: %s, shell: %d "
-                      "%s-type shell, %d primitives, scalefactor %f\n", i,
-                      get_pte_label(data->initatoms[i].atomicnum), numshells+1, 
-                      word[0], numprim, scalef);
-#endif
-        ;
-      } else {
-        vmdcon_printf(VMDCON_WARN, 
-                      "gaussianplugin) basis set parse error: %s",buffer);
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      ishell=numshells;
-      ++numshells;
-      shell=realloc(shell,numshells*sizeof(shell_t));
-      shell[ishell].numprims=numprim;
-      shell[ishell].symmetry=shellsymm_int(word[0]);
-      shell[ishell].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      if (shell[ishell].symmetry == SP_S_SHELL) {
-        ++numshells;
-        shell=realloc(shell,numshells*sizeof(shell_t));
-        shell[ishell+1].numprims=numprim;
-        shell[ishell+1].symmetry=SP_P_SHELL;
-        shell[ishell+1].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      }
-
-      for (n=0; n<numprim; ++n) {
-        fgets(buffer, sizeof(buffer), fp);
-        if (ferror(fp)) {
-          vmdcon_printf(VMDCON_ERROR, "gaussianplugin) read error in data "
-                        "base file %s while reading basis of element %s.\n", 
-                        filepath, get_pte_label(data->initatoms[i].atomicnum));
-          free(data->basis_set);
-          data->basis_set=NULL;
-          return FALSE;
-        }
-        sscanf(buffer,"%s%s%s", word[0],word[1],word[2]);
-        fix_fortran_exp(word[0]);
-        shell[ishell].prim[n].exponent=atof(word[0])*scalef*scalef;
-        fix_fortran_exp(word[1]);
-        shell[ishell].prim[n].contraction_coeff=atof(word[1]);
-        if (shell[ishell].symmetry == SP_S_SHELL) {
-          shell[ishell+1].prim[n].exponent=shell[ishell].prim[n].exponent;
-          fix_fortran_exp(word[2]);
-          shell[ishell+1].prim[n].contraction_coeff=atof(word[2]);
-        }
-      }
-    } while(1);
-
-  
-    /* store shells in atom */
-    data->basis_set[i].numshells = numshells;
-    data->basis_set[i].shell = shell;
-    
-    /* store the total number of basis functions */
-    data->num_shells += numshells;
-  }
-
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Parsed %d uncontracted basis functions. \n",
-                data->num_basis_funcs);
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  data->have_basis = TRUE;
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- *
- * Convert shell symmetry type from char to int.
- *
- ************************************************ */
-static int shellsymm_int(char *symm) {
-  int shell_symmetry;
-
-  switch (toupper(symm[0])) {
-    case 'S':
-      if (symm[1] == '\0') {
-        shell_symmetry = S_SHELL;
-      } else if (toupper(symm[1]) == 'P') {
-        if (symm[2] == '\0') {
-          shell_symmetry = SP_S_SHELL;
-        } else if (toupper(symm[1]) == 'D') {
-          shell_symmetry = SPD_S_SHELL;
-        } else {
-          shell_symmetry = UNK_SHELL;
-        } 
-      } else {
-        shell_symmetry = UNK_SHELL;
-      }
-      break;
-    case 'L':
-      shell_symmetry = SP_S_SHELL;
-      break;
-    case 'M': 
-      shell_symmetry = SP_P_SHELL;
-      break;
-    case 'P':
-      shell_symmetry = P_SHELL;
-      break;
-    case 'D':
-      shell_symmetry = D_SHELL;
-      break;
-    case 'F':
-      shell_symmetry = F_SHELL;
-      break;
-    case 'G':
-      shell_symmetry = G_SHELL;
-      break;
-    default:
-      shell_symmetry = UNK_SHELL;
-      break;
-  }
-
-  return shell_symmetry;
-}
-
-
-/** Populate the flat arrays containing the basis set data. */
-static int fill_basis_arrays(gaussiandata *data) {
-  int i, j, k;
-  int shellcount, primcount;
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_symmetry;
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per primitive gaussian, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  SAFE_CALLOC(basis,float,2*data->num_basis_funcs);
-  SAFE_CALLOC(num_shells_per_atom,int,data->num_basis_atoms);
-  SAFE_CALLOC(shell_symmetry,int,data->num_shells);
-  SAFE_CALLOC(num_prim_per_shell,int,data->num_shells);
-
-  /* place pointers into struct gaussiandata */
-  data->basis = basis;
-  data->shell_symmetry = shell_symmetry;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell  = num_prim_per_shell;
-
-  shellcount=primcount=0;
-  
-  for(i=0; i<data->num_basis_atoms; i++) {
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_symmetry[shellcount] = data->basis_set[i].shell[j].symmetry;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-  return TRUE;
-}
-
-
-
-/** this function extracts the trajectory information
- *  from the output file */
-static int get_traj_frame(gaussiandata *data) {
-  qm_timestep_t *cur_qm_ts;
-  int i;
-  long fpos;
-  char buffer[BUFSIZ];
-  char word[MOLFILE_BUFSIZ];  
-  buffer[0] = '\0';
-  word[0] = '\0';
-
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Timestep %d: =======================\n", 
-                data->num_frames_read);
-#endif
-
-  fpos=ftell(data->file);       /* XXX: */
-  if (!get_coordinates(data->file, data->initatoms, data->numatoms)) {
-    vmdcon_printf(VMDCON_WARN, 
-                  "gaussianplugin) Couldn't find input orientation coordinates"
-                  " for timestep %d\n", data->num_frames_read);
-    vmdcon_printf(VMDCON_WARN, 
-                  "gaussianplugin) Trying internal coordinates instead.\n");
-
-    fseek(data->file, fpos, SEEK_SET); /* XXX: */
-    if(!get_int_coordinates(data->file, data->initatoms, data->numatoms)) {
-      vmdcon_printf(VMDCON_ERROR, 
-                    "gaussianplugin) Couldn't find any coordinates.\n", 
-                    data->num_frames_read);
-      return FALSE;
-    } 
-  }
-  
-  /* allocate more memory for the timestep array */
-  data->qm_timestep = 
-    (qm_timestep_t *)realloc(data->qm_timestep, 
-                             (data->num_frames_read+1)*sizeof(qm_timestep_t));
-
-  /* get a convenient pointer to the current qm timestep and clear it. */
-  cur_qm_ts = data->qm_timestep+data->num_frames_read;
-  memset(cur_qm_ts, 0, sizeof(qm_timestep_t));
-
-  /* XXX: this is a guess only. we need to know this for certain */
-  cur_qm_ts->numwave = 1;
-  if (data->scftyp == SCFTYP_UHF)
-    cur_qm_ts->numwave = 2;
-
-  /* Read the basis set. if available */
-  if (data->num_frames_read == 0) {
-    get_basis(data);
-    get_internal_basis(data);
-  }
-  
-  SAFE_CALLOC(cur_qm_ts->wave,qm_wavefunction_t,cur_qm_ts->numwave);
-  for (i=0; i < cur_qm_ts->numwave; ++i) {
-    cur_qm_ts->wave[i].idtag = i;
-    SAFE_CALLOC(cur_qm_ts->wave[i].orb_indices,int,data->wavef_size);
-    SAFE_CALLOC(cur_qm_ts->wave[i].orb_energies,float,data->wavef_size);
-    SAFE_CALLOC(cur_qm_ts->wave[i].occupancies,float,data->wavef_size);
-    SAFE_CALLOC(cur_qm_ts->wave[i].wave_coeffs,float,
-                data->wavef_size*data->wavef_size);
-  }
-  
-  /* Try to read wavefunction and orbital energies */
-  if (get_wavefunction(data, cur_qm_ts) == FALSE) {
-    vmdcon_printf(VMDCON_WARN, "gaussianplugin) No wavefunction present for timestep %d\n", data->num_frames_read);
-    /* free storage */
-    for (i=0; i < cur_qm_ts->numwave; ++i) {
-      free(cur_qm_ts->wave[i].wave_coeffs);
-      free(cur_qm_ts->wave[i].orb_energies);
-      free(cur_qm_ts->wave[i].occupancies);
-    }
-    free(cur_qm_ts->wave);
-    cur_qm_ts->wave=NULL;
-    cur_qm_ts->numwave=0;
-  } else {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) Wavefunction found for timestep %d\n", data->num_frames_read);
-  }
-
-#if 0
-  if (get_population(data, cur_qm_ts)) {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) Mulliken charges found\n");
-  }
-#endif
-
-  data->num_frames_read++;
-
-  return TRUE;
-}
-
-
-/* Look for the "EQUILIBRIUM GEOMETRY LOCATED" line thereby
- * advancing the file pointer so that the final info block
- * can be parsed.
- * If we don't find this line before the next geometry
- * the file pointer will be set back to where the search
- * started. */
-static int find_traj_end(gaussiandata *data) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(data->file);
-
-  while (1) {
-    if (!fgets(buffer, sizeof(buffer), data->file)) break;
-
-    if (strstr(buffer, "Berny optimization.")) {
-      data->num_frames++;
-    } else if (strstr(buffer, "Optimization completed.")) {
-#if GAUSSIAN_DEBUG
-      vmdcon_printf(VMDCON_INFO, "gaussianplugin) ==== End of trajectory. ====\n");
-#endif
-      data->opt_status = STATUS_CONVERGED;
-      return TRUE;
-    } else if (strstr(buffer, "Optimization stopped.")) {
-#if GAUSSIAN_DEBUG
-      vmdcon_printf(VMDCON_INFO, "gaussianplugin) ==== End of trajectory. ====\n");
-#endif
-      data->opt_status = STATUS_TOO_MANY_STEPS;
-      return TRUE;
-    } else if (strstr(buffer, "Convergence failure -- run terminated.")) {
-      data->opt_status = STATUS_SCF_NOT_CONV;
-      return FALSE;
-    } 
-  }
-
-  /* We didn't find any of the regular key strings,
-   * the run was most likely broken off and we have an
-   * incomplete file. */
-  data->opt_status = STATUS_BROKEN_OFF;
-
-  fseek(data->file, filepos, SEEK_SET);
-  return FALSE;  
-}
-
-/*********************************************************
- *
- * this function reads the actual wavefunction, which is
- * punched at the end of the log file
- *
- **********************************************************/
-static int get_wavefunction(gaussiandata *data, qm_timestep_t *ts)
-{
-  long filepos;
-  char buffer[BUFSIZ];
-  char word[6][MOLFILE_BUFSIZ];
-  float *orb_erg, *orb_occ;
-  int orbital_counter;
-  int i, j, num_values, num_orbs, *orb_idx;
-  qm_wavefunction_t *wf;
-  
-  i=j=num_values=num_orbs=orbital_counter=0;
-
-  buffer[0] = '\0';
-  for (i=0; i<6; i++) word[i][0] = '\0';
-
-  wf = ts->wave;
-  if (wf == NULL || ts->numwave == 0) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  /* no point in searching for wavefunction info, if there cannot be any. */
-  if (!data->have_wavefunction) return FALSE;
-  
-  /* default values. to be changed if needed */
-  wf->type = MOLFILE_WAVE_CANON;
-  wf->spin = SPIN_ALPHA;
-  wf->cartesian = 1;
-  orb_erg = wf->orb_energies;
-  orb_occ = wf->occupancies;
-  orb_idx = wf->orb_indices;
-  
-  /*
-   * the following output requires  IOP(6/7=3) in the route section.
-   *
-   * Scan for something like this (g98 closed shell):
-     Molecular Orbital Coefficients
-                           1         2         3         4         5
-                           O         O         O         O         O
-     EIGENVALUES --    -7.61925  -7.61868  -0.88486  -0.63877  -0.55750
-   1 1   B  1S          0.71623  -0.69260  -0.13195  -0.12199   0.00000
-   2        2S          0.01884  -0.01744   0.20755   0.19054   0.00000
-   3        2PX         0.00000   0.00000   0.00000   0.00000   0.24930
-
-   * or this (g03 closed shell):
-
-     Molecular Orbital Coefficients
-                           1         2         3         4         5
-                       (SGG)--O  (SGU)--O  (SGG)--O  (PIU)--O  (PIU)--O
-     EIGENVALUES --    -1.30558  -1.16543  -0.63335  -0.56287  -0.51096
-   1 1   O  1S          0.68764   0.70168   0.16476   0.00000   0.00000
-   2        1PX         0.00000   0.00000   0.00000   0.70711   0.00000
-   3        1PY         0.00000   0.00000   0.00000   0.00000   0.70711
-
-
-   * or this (g03 open shell):
-
-   Alpha Molecular Orbital Coefficients
-                           1         2         3         4         5
-                       (SGG)--O  (SGU)--O  (SGG)--O  (SGU)--O  (PIU)--O
-     EIGENVALUES --   -20.82303 -20.82274  -1.55752  -1.30463  -0.78343
-   1 1   O  1S          0.70309   0.70312  -0.15839  -0.17089   0.00000
-   2        2S          0.01545   0.01540   0.38998   0.42214   0.00000
-
-
-   */
-
-  /* remember position in order to go back if no wave function was found */
-  filepos = ftell(data->file);
-
-  do {
-    GET_LINE(buffer, data->file);
-    /* check if we searched too far. XXX need more tests here. */
-    if (strstr(buffer,"Input orientation") ) {
-      fseek(data->file, filepos, SEEK_SET);
-      return FALSE;
-    }
-  } while(!strstr(buffer,"Molecular Orbital Coefficients"));
-
-  while (orbital_counter < data->num_orbitals) {
-    /* read up to line of orbital energies */
-    GET_LINE(buffer, data->file);           /* orbital index */
-    num_orbs = sscanf(buffer,"%s%s%s%s%s",word[0],word[1],word[2],word[3],word[4]);
-    /* XXX: we need to keep track of these numbers, since the wavefunction may
-            have only a subset of orbitals, and we want to know where the 
-            frontier orbitals are located. with the similarity reordering 
-            in VMD this information will be essential, if somebody compares 
-            the .log file and the orbital rep. */
-
-    GET_LINE(buffer, data->file); /* occupied or virtual orbital (+ orbital symm) */
-    sscanf(buffer,"%s%s%s%s%s", word[0],word[1],word[2],word[3],word[4]);
-    for (i=0; i<num_orbs; i++) {
-      j=strlen(word[i]);
-      orb_occ[i] = (word[i][j-1] == 'O') ? 1.0f : 0.0f;
-    }
-    
-    GET_LINE(buffer, data->file); /* eigenvalues */
-    sscanf(buffer,"%*s%*s%s%s%s%s%s",word[0],word[1],word[2],word[3],word[4]);
-    for (i=0; i<num_orbs; i++) 
-      orb_erg[i] = atof(word[i]);
-      
-    /* step counters and pointers */
-    orb_erg += num_orbs;
-    orb_occ += num_orbs;
-
-    /* now read in the wavefunction */
-    for (i=0; i<data->num_orbitals; i++) {
-      int xexp=0, yexp=0, zexp=0;
-
-      /* read in the wavefunction coefficients for up 
-       * to 5 orbitals at a time line by line */
-      GET_LINE(buffer, data->file);
-      num_values = sscanf(buffer+12,"%4s%s%s%s%s%s", 
-                          word[0], word[1], word[2],
-                          word[3], word[4], word[5]);
-
-      /* handle magenetic quantum number. in cartesian basis the
-       * labels are: S, PX, PY, PZ, DXX, DXY, DXZ, DYY, DYZ, DZZ, ...*/
-      for (j=1; j<strlen(word[0]); j++) {
-        switch (word[0][j]) {
-          case 'X':
-            xexp++;
-            break;
-          case 'Y':
-            yexp++;
-            break;
-          case 'Z':
-            zexp++;
-            break;
-            /* if we have pure d/f-functions the nomenclature changes to 
-             * 'D 0', 'D-1', 'D+1', 'D-2', 'D+2' */
-          case '+': /* fallthrough */
-          case '-': /* fallthrough */
-          case '0': /* fallthrough */
-          case '1': /* fallthrough */
-          case '2': /* fallthrough */
-            if (wf->cartesian) {
-              wf->cartesian=0;    /* flag it, so we can convert it later. */
-              vmdcon_printf(VMDCON_ERROR, "gaussianplugin) pure basis function "
-                            "detected: '%s'. those are not supported yet. bailing out...\n", word[0]);
-              return FALSE;
-            }
-            break;
-          default:
-            /* do nothing */
-            break;
-        }
-      }
-      data->angular_momentum[3*i  ] = xexp;
-      data->angular_momentum[3*i+1] = yexp;
-      data->angular_momentum[3*i+2] = zexp;
-#if GAUSSIAN_DEBUG && GAUSSIAN_BASIS_DEBUG && 0
-      vmdcon_printf(VMDCON_INFO,"%s:%d orbitals %d/%d/%d/%d  shell %d/%d/%s: %d %d %d\n", 
-                    __FILE__, __LINE__, i, data->num_orbitals, num_orbs, orbital_counter, 
-                    i, data->wavef_size, word[0], xexp, yexp, zexp);
-#endif
-
-      /* each orbital has data->wavef_size entries when converted to 
-       * cartesian spherical harmonics. to ease conversion we use this 
-       * number as offset when storing them in groups. */
-      for (j=0 ; j<num_orbs; j++) {
-        wf->wave_coeffs[(orbital_counter+j)*data->wavef_size+i] = atof(&word[j+1][0]);
-      }
-    }
-    orbital_counter += num_orbs;
-  }
-
-  /* store the number of orbitals read in */
-  wf->num_orbitals = orbital_counter;
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Number of orbitals scanned: %d \n",
-                orbital_counter);
-  return TRUE;
-}
-
-/* Read the population analysis section.
- * Currently we parse only the Mulliken charges
- * but we might want to add support for populations
- * and for Lowdin analysis. */
-static int get_population(gaussiandata *data, qm_timestep_t *ts) {
-#if 0
-  int i;
-  char buffer[BUFSIZ];
-  data->have_mulliken = FALSE;
-
-
-  /* Read Mulliken charges if present */
-  ts->mulliken_charges = 
-    (double *)calloc(data->num_basis_atoms, sizeof(double));
-
-  if (!ts->mulliken_charges) {
-    PRINTERR; 
-    return FALSE;
-  }
-  
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int n;
-    float mullpop, mullcharge, lowpop, lowcharge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*i%*s%f%f%f%f",
-               &mullpop, &mullcharge, &lowpop, &lowcharge);
-    if (n!=4) return FALSE;
-    ts->mulliken_charges[i] = mullcharge;
-  }
-
-  if (i!=data->numatoms) return FALSE;
-
-  data->have_mulliken = TRUE;
-
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Number of orbitals scanned: %d \n",
-                orbital_counter);
-#endif
-
-#endif
-  return TRUE;
-}
-
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "gaussian";
-  plugin.prettyname = "Gaussian Logfile (g94,g98,g03)";
-  plugin.author = "Axel Kohlmeyer, Markus Dittrich, Jan Saam";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "log";
-  plugin.open_file_read = open_gaussian_read;
-  plugin.read_structure = read_gaussian_structure;
-  plugin.close_file_read = close_gaussian_read;
-
-  plugin.read_qm_metadata = read_gaussian_metadata;
-  plugin.read_qm_rundata  = read_gaussian_rundata;
-
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-  plugin.read_timestep = read_timestep;
-#endif
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int numatoms, i, j, optflags;
-  molfile_atom_t *atoms;
-  molfile_timestep_t timestep;
-  molfile_metadata_t metadata;
-  molfile_timestep_metadata_t ts_metadata;
-  molfile_qm_timestep_metadata_t qm_ts_metadata;
-  molfile_qm_metadata_t qm_metadata;
-  molfile_qm_timestep_t qm_ts;
-    
-  void *v;
-
-  while (--argc) {
-    ++argv;
-    v = open_gaussian_read(*argv, "log", &numatoms);
-    if (!v) {
-      fprintf(stderr, "open_gaussian_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_gaussian_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", numatoms);
-    atoms = (molfile_atom_t *)malloc(sizeof(molfile_atom_t)*numatoms);
-    read_gaussian_structure(v,&optflags, atoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*numatoms);
-    
-    while (1) {
-      memset(&ts_metadata, 0, sizeof(molfile_timestep_metadata_t));
-      read_timestep_metadata(v, &ts_metadata);
-      memset(&qm_metadata, 0, sizeof(molfile_qm_metadata_t));
-      read_qm_timestep_metadata(v, &qm_ts_metadata);
-      qm_ts.scfenergies = (double *)malloc(qm_ts_metadata.num_scfiter*sizeof(double));
-      qm_ts.wave        = (molfile_qm_wavefunction_t *)malloc(qm_ts_metadata.num_wavef
-                                                              *sizeof(molfile_qm_wavefunction_t));
-      memset(qm_ts.wave, 0, qm_ts_metadata.num_wavef*sizeof(molfile_qm_wavefunction_t));
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        qm_ts.wave[j].wave_coeffs = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]
-                                                     * qm_ts_metadata.wavef_size * sizeof(float));
-        qm_ts.wave[j].orbital_energies = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]*sizeof(float));
-      }
-      qm_ts.gradient = (float *) malloc(3*numatoms*sizeof(float));
-      if (read_timestep(v, numatoms, &timestep, &qm_metadata, &qm_ts)) break;
-      /* do something with data */
-      /* XXX */
-
-      free(qm_ts.gradient);
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        free(qm_ts.wave[j].wave_coeffs);
-        free(qm_ts.wave[j].orbital_energies);
-      }
-      free(qm_ts.wave);
-      free(qm_ts.scfenergies);
-      i++;
-    }
-    fprintf(stderr, "ended read_timestep on frame %d\n", i);
-    close_gaussian_read(v);
-  }
-  return 0;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gaussianplugin.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gaussianplugin.h
deleted file mode 100644
index 51f6490e63e8f97984e31a760719b5122e20d45f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gaussianplugin.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gaussianplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.10 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-/*******************************************************************
- * 
- *  headerfile for the gaussianplugin
- *  
- ******************************************************************/
-
-#ifndef GAUSSIANPLUGIN_H
-#define GAUSSIANPLUGIN_H
-
-#include <stdio.h>
-#include "molfile_plugin.h"
-
-/* define macros for true/false to make code 
-* look somewhat nicer; the macro DONE signals
-* that we're done with reading an should return
-* with what we have */
-#define FALSE 0
-#define TRUE  1
-
-/** macros describing the RUNTYP */
-#define RUNTYP_UNKNOWN    0     /**< not set.  */
-#define RUNTYP_ENERGY     1     /**< total energy, single point run  */
-#define RUNTYP_OPTIMIZE   2     /**< geometry optimization  */
-#define RUNTYP_SADPOINT   3     /**< transition state search  */
-#define RUNTYP_HESSIAN    4     /**< frequency calculation  */
-#define RUNTYP_SURFACE    5     /**< potential energy scan  */
-#define RUNTYP_DYNAMICS   6     /**< molecular dynamics or monte carlo  */
-#define RUNTYP_PROPERTIES 7     /**< wavefunction analysis  */
-
-/** macros defining the SCFTYP */
-#define SCFTYP_UNKNOWN 0        /**< not set. */
-#define SCFTYP_RHF   1          /**< closed shell or restricted wfn.  */
-#define SCFTYP_UHF   2          /**< open shell or unrestricted wfn.  */
-#define SCFTYP_ROHF  3          /**< restricted open shell wfn.  */
-#define SCFTYP_GVB   4          /**< generalized valence bond wfn. */
-#define SCFTYP_MCSCF 5          /**< multi-configuration SCF.  */
-#define SCFTYP_FF    6          /**< force field calculation.  */
-
-/** XXX: check if this can go away. */
-#define MAX_NUM_WAVE 10
-
-typedef struct {
-  float exponent;
-  float contraction_coeff;
-} prim_t;
-
-
-typedef struct {
-  int symmetry;                 /* symmetry of this shell (S, P, D, ...) */
-  int numprims;                 /* number of primitive basis functions */
-  prim_t *prim;                 /* array of primitives */
-} shell_t;
-
-
-/** Basis set definition for one atom */
-typedef struct {
-  char name[20];                /* atom name or type (pseudopotentialfile?) */
-  int atomicnum;                /* atomic number (nuclear charge XXX) */
-  int numshells;
-  shell_t *shell;
-} basis_atom_t;
-
-
-/** structure for storing temporary values read in 
- * from the gaussian output file */
-typedef struct 
-{
-  char type [8];                /* atom type H,N,O ..... */
-  int atomicnum;                /* index in PTE. */
-  float x,y,z;                  /* coordinates of atom i */
-} qm_atom_t;
-
-
-typedef struct {
-  int   idtag;              /**< unique tag to identify this wavefunction over the trajectory */
-  int   type;               /**< CANONICAL, LOCALIZED, OTHER */
-  int   spin;               /**< 0 for alpha, 1 for beta */
-  int   cartesian;          /**< 1 if cartesian, 0 if pure  */
-  int   excitation;         /**< 0 for ground state, 1,2,3,... for excited states */
-  char info[MOLFILE_BUFSIZ]; /**< string for additional type info */
-
-  int   num_orbitals;       /**< number of orbitals that were really 
-                             *   present in the output for this step */
-  int   *orb_indices;       /**< list of orbital indices for wavefunction */
-  float *occupancies;       /**< list of orbital occupancies for wavefunction */
-  float *orb_energies;      /**< list of orbital energies for wavefunction */
-  float *wave_coeffs;       /**< expansion coefficients for wavefunction in the
-                             *   form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */
-} qm_wavefunction_t;
-
-
-typedef struct {
-  qm_wavefunction_t *wave;  /**<  */
-  int numwave;              /**< number of independent wavefunctions  */
-  int num_orbitals;         /**< number of orbitals per wavefunction  */
-  int num_scfiter;          /**< number of SCF iterations for this step */
-  double *scfenergies;      /* scfenergies per trajectory point 
-                             * XXX: how about post-HF calculations?
-                             *      we have the HF, MP2, CASSCF, CCS,
-                             *      CCSD, CCSD(T) energies... */
-
-  double *mulliken_charges; /* per-atom Mulliken charges */
-  double *lowdin_charges;   /* per-atom Lowdin charges */
-  double *esp_charges;      /* per-atom esp charges */
-  double *npa_charges;      /* per-atom npa charges */
-
-  float *gradient;          /* energy gradient for each atom */
-} qm_timestep_t;
-
-
-/** main gaussian plugin data structure */
-typedef struct 
-{
-  FILE *file;
-  int numatoms;
-  int runtyp;        /* run type of this job as int for internal use */
-  char gbasis[20];   /* canonicalized basis set string
-                        for loading and external basis set. */
-
-  char basis_string[MOLFILE_BUFSIZ]; /* basis name as "nice" string */
-
-  char runtitle[MOLFILE_BUFSIZ];  /* title/info section of run */
-
-  char geometry[MOLFILE_BUFSIZ];  /* either UNIQUE, CART or ZMP/ZMTMPC */
-  char guess[MOLFILE_BUFSIZ];    /* type of guess method used */
-
-  char version_string[MOLFILE_BUFSIZ]; /* full version string of binary used for run */
-  int  version;  /* gaussian version code;
-                  * canonicalized and set up for integer comparisons.
-                  * here we keep track the exact Gaussian version,
-                  * since the log file format keeps changing all
-                  * the time. 
-                  * Format is Year/Revision/Patchlevel: YYYYRRPP
-                  * with:
-                  * YYYY: g94 -> 1994, g98 -> 1998, g03 -> 2003
-                  *   RR: A -> 1, B -> 2, C ->3, ...
-                  *   PP: 01, 02, 03, ...
-                  *
-                  *   Example: G03RevB.04 -> 20030204
-                  *
-                  *   version = 0  => unknown/unreadable version. 
-                  */
-
-  char *file_name;
-
-  /******************************************************
-   * new API functions
-   *****************************************************/
-
-  int  scftyp;              /* UHF, RHF, ROHF, as in for 
-                             * internal use*/
-  char scftyp_string[MOLFILE_BUFSIZ]; /* scftyp as string. XXX: remove */
-  int totalcharge;              /* Total charge of the system */
-  int multiplicity;             /* Multiplicity of the system */
-  int num_electrons;            /* Number of electrons */
-  int nimag;                    /* Number of imaginary frequencies */
-  int *nimag_modes;             /* List of imaginary modes */
-
-  float *wavenumbers;          /* rotational and translational DoF are
-                                 * included, but can be removed due to
-                                 * their zero frequencies */
-  float *intensities;          /* Intensities of spectral lines */
-
-  float *normal_modes;         /* the normal modes themselves */
-
-  int nproc;                    /* Number processors used */
-  int memory;                   /* Amount of memory used in MBytes */
-
-  int have_wavefunction; /** TRUE/FALSE flag indicating if we should
-                          *  try searching for wavefunction data.
-                          *  Gaussian needs IOP(6/7=3) to do this.
-                          *  if it is not set, we can save time searching.
-                          *  should help a lot with large log files... */
-
-  int have_basis;        /** TRUE/FALSE flag initially indicating if we 
-                          *  should try searching for basis set data.
-                          *  Gaussian needs GFINPUT to print the data in a 
-                          *  form that we can parse. If it is not set, we 
-                          *  can save time searching. Should help a lot 
-                          *  with large log files. If there is no basis in
-                          *  the log, we try reading the basis set from
-                          *  a local database. After initial parse it indicates
-                          *  whether basis set data is available.
-                          */
-
-  int have_cart_basis;   /** flag indicating if we have a cartesian
-                          *  basis set. this is additive.
-                          *  0 = none (can only visualize up to P)
-                          *  1 = have cartesian (6 instead of 5) d-functions)
-                          *  2 = have cartesian (10 instead of 7) f-functions)
-                          *  4 = have cartesian (XX instead of X) g-functions)
-                          *  basis transferred to VMD is always cartesian,
-                          *  so wavefunctions expanded in pure atomic orbitals
-                          *  will have to be converted.
-                          */
-
-  /* arrays with atom charges */
-  double *mulliken_charges; 
-  int   have_mulliken; 
-
-  int have_normal_modes; /** TRUE/FALSE flag indicating if we
-			  * could properly read normal modes,
-			  * wavenumbers and intensities. */
-
-  /******************************************************
-   * internal coordinate stuff
-   *****************************************************/
-
-  int have_internals;  /* TRUE/FALSE flag indicating if we
-                        * could properly read the internal
-                        * coordinates + internal hessian */
-
-  int have_cart_hessian; /* TRUE/FALSE flag indicating if the
-                          * cartesian Hessian matrix could
-                          * be read from the output file */
-
-  int nintcoords;    /* Number of internal coordinates */
-  int nbonds;        /* Number of bonds */
-  int nangles;       /* Number of angles */
-  int ndiheds;       /* Number of dihedrals */
-  int nimprops;      /* Number of impropers */
-
-  int *bonds;        /* bond list (atom tuples) */
-  int *angles;       /* angle list (atom triples) */
-  int *dihedrals;    /* dihedral list (atom quadrupels) */
-  int *impropers;    /* improper list (atom quadrupels) */
-
-  double *internal_coordinates; /* value of internal coordinates */ 
-  
-  /*******************************************************
-   * end internal coordinate stuff
-   *******************************************************/
-
-  double *carthessian;  /* Hessian matrix in cartesian coordinates,
-                         * dimension (3*numatoms)*(3*numatoms),
-                         * single array of floats 
-                         * (row(1),row(2),...,row(numatoms))
-                         */
-
-  double *inthessian;  /* Hessian matrix in internal coordinates,
-                        * dimension nintcoords*nintcoords,
-                        * single array of floats 
-                        * (row(1),row(2),...,row(nintcoords))
-                        */
-
-  /*********************************************************
-   * END OF NEW API data members
-   *********************************************************/
-
-  /* this array of floats stores the contraction coefficients
-   * and exponents for the basis functions:
-   * { exp(1), c-coeff(1), exp(2), c-coeff(2), .... }
-   * This holds also for double-zeta basis functions with
-   * exp(i) = exp(j) and c-coeff(i) != c-coeff(j). */
-  float *basis;
-
-  basis_atom_t *basis_set;
-
-  int num_basis_funcs;          /** total number of primitive basis functions */
-  int num_basis_atoms;          /** total number of atoms with basis functions */
-
-  /** atomic number per atom in basis set */
-  int *atomicnum_per_basisatom;
-
-  /** the total number of atomic shells */
-  int num_shells;
-  /** number of shells per atom i */
-  int *num_shells_per_atom;
-  /** number of primitives in shell i */
-  int *num_prim_per_shell;
-  /** symmetry type of each shell */
-  int *shell_symmetry; 
-
-  /** number of occupied spin alpha and beta orbitals */
-  int occ_orbitals_A;
-  int occ_orbitals_B;
-
-  /** Max. rank of the wave_function matrix.
-   * While the actual number of MOs present can be different
-   * for each frame, this is the maximum number of 
-   * possible occupied and virtual orbitals. */
-  int wavef_size;
-  int num_orbitals;      /* number of orbitals in file. can be less if pure WF. */
-
-  /** Array of length 3*num_wave_f containing the exponents 
-   *  describing the cartesian components of the angular momentum. 
-   *  E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}. */
-  int *angular_momentum;
-
-  /** this flag tells if the geometry search converged */
-  int converged;
-  int opt_status;
-
-  /* the structure qm_atom_t was defined to read in data from
-   * the Gaussian output file and store it temporarily;
-   * it is then copied into the VMD specific arrays at the
-   * appropriate point in time;
-   * this was partially implemented since the output file does
-   * not, e.g., contain the number of atoms per se. One rather
-   * has to count them by hand - at that point one could as 
-   * well already read in the initial coordinates, atom types ...
-   * which is not really supported by the way the VMD provided
-   * function are arranged....this implementation could of
-   * course be changed later..... */
-  qm_atom_t *initatoms;
-
-  /** initial cell info (in cpmd notation)":
-   * a, b/a, c/a, cos(alpha), cos(beta), cos(gamma) */
-  float initcell[6];
-
-  /** per timestep data like wavefunctions and scf iterations */
-  qm_timestep_t *qm_timestep;
-
-  /** number of trajectory points; single point corresponds to 1 */
-  int num_frames;
-  int num_frames_sent;
-  int num_frames_read;
-
-  int end_of_trajectory;
-
-} gaussiandata;
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/graspplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/graspplugin.C
deleted file mode 100644
index e907be556c119db2918f37059e48baef7fd1ee0e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/graspplugin.C
+++ /dev/null
@@ -1,520 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: graspplugin.C,v $
- *      $Author: johns $       $:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Reader for GRASP binary surface files
- * The file format is briefly described at these two sites:
- *   http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.1
- *   http://www.msg.ucsf.edu/local/programs/grasp/html/Appendix%20A.html
- */
-
-//Modified by Biol. Angel H. Jiménez Pardo and Luis Rosales Leòn
-//Visualisation Department
-//DGSCA
-//Universidad Nacional Autònoma de Mèxico UNAM
-//2006
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-/// Define variables by the name of Grasp property  
-
-#define POTENTIALS    1
-#define CURVATURES    2
-#define DISTANCES     4
-#define PROPERTY_1    8
-#define PROPERTY_2   16
-#define VERTEXCOLOR  32
-#define GLOBALCOLOR  64
-
-/// Define other variables
-typedef float COLOUR [3]; 
-typedef float COLOUR [3];
-typedef unsigned int SHORTWORD;
-typedef float VECTOR [3];
-
-/// Grasp structure
-typedef struct {
-  SHORTWORD flag, nvert;
-  COLOUR clo, cmd, chi, colors;
-  VECTOR range;
-} GRASSP;
-
-/// plugin data handle
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} grasp_t;
-
-
-/// Sets colour
-void Set_Colour(float *c, float r, float g, float b) {
-  *(c+0)=r;
-  *(c+1)=g;
-  *(c+2)=b;
-} //Set_Colour end
-
-
-/// Combines colour
-void ClinComb2(float c[], float k1, float c1[], float k2, float c2[]) {
-  (c)[0]=(k1)*(c1)[0] + (k2)*(c2)[0];
-  (c)[1]=(k1)*(c1)[1] + (k2)*(c2)[1];
-  (c)[2]=(k1)*(c1)[2] + (k2)*(c2)[2];
-} //ClinComb2 end
-
-
-/// Gets properties
-void Get_Property_Values(GRASSP *grassp, float *properties, float *colores, int nvert) {
-  long  i;
-  const char *name[] = {"potential","curvature","distance","property1","property2"};
-  SHORTWORD  index;
-  int k=0, j=0;
-  float  val, weight, min, mid, max, midmin, maxmid;
-  val = weight = min = mid = max = midmin = maxmid = 0.0;
-
-  //Range values
-  grassp->range[0]=-1000.0;
-  grassp->range[1]= 0.0;
-  grassp->range[2]= 1000.0;
-
-  ///Checks
-  index = (SHORTWORD)( (log((double) grassp->flag) / log(2.0)) + 0.5 );
-
-  ///ojo aqui le quite el  !
-  if ((grassp->flag)!=POTENTIALS) {
-    if (index <= 4)
-      printf("graspplugin) No data available for '%s' option\n", name[index]);
-    else 
-      printf("graspplugin) out of range property, flag: %d index: %d\n", grassp->flag, index);
-    printf("graspplugin) Will use white color instead\n");
-    grassp->flag = GLOBALCOLOR;
-    Set_Colour(grassp->clo, 1, 1, 1);
-  } else {
-    printf("graspplugin) Getting %s values.\n", name[index]);
-  }
-
-  /// init max values 
-  max=  0.01;  /* should be > 0 */
-  min= -0.01;  /* should be < 0 */
-
-  // Get values
-  for(i=0; i < nvert; i++) {
-    if (properties[i] < min)
-      min= properties[i];
-    else if(properties[i] > max)
-      max= properties[i];
-  }
-
-  // cut properties that are out of specified range
-  if (min < grassp->range[0] || max > grassp->range[2]) {
-    for(i=0; i < nvert; i++) {
-      if(properties[i] < grassp->range[0])
-        properties[i]= grassp->range[0];
-      else if(properties[i] > grassp->range[2])
-        properties[i]= grassp->range[2];
-    }
-  } else {
-    // or reset range
-    grassp->range[0] = min;
-    grassp->range[2] = max;
-  }
-
-  // check mid value 
-  if (grassp->range[1] <= grassp->range[0] || 
-      grassp->range[1] >= grassp->range[2])
-   grassp->range[1] = (grassp->range[0] + grassp->range[2]) / 2;
-
-  printf("graspplugin) Computing colors for range %g,%g,%g\n", 
-         grassp->range[0], grassp->range[1], grassp->range[2]);
-
-  // Prepare color interpolation parameters
-  min = grassp->range[0];
-  mid = grassp->range[1];
-  max = grassp->range[2];
-  midmin = mid-min;
-  maxmid = max-mid;
-
-  // Create color for each vertex and copies to a vector
-  k=0;
-  for (i=0; i < nvert; i++) {
-    val = properties[i];
-    if (val <= mid) {
-      weight = (midmin) ? (val-min)/midmin : 0;  
-      ClinComb2(grassp->colors, 1-weight, grassp->clo, weight, grassp->cmd);
-      for(j=0; j<=2; j++) {
-        *(colores+k)=grassp->colors[j];
-        k++;
-      }
-    } else {
-      weight = (maxmid) ? (val-mid)/maxmid : 0;
-      ClinComb2(grassp->colors, 1-weight, grassp->cmd, weight, grassp->chi);
-      for (j=0; j<=2; j++) {
-        *(colores+k)=grassp->colors[j];
-        k++;
-      }       
-    }
-    // clean up 
-  }
-} // Get_Property_Values end
-
-
-/// Reads line3
-void line3 (FILE * infile, GRASSP * grassp) {
-  char line3 [81];
-  fread(line3, 1, 80, infile);
-
-  grassp->flag=0;
-  int i=0;
-  if (line3 [0]==',') i++;
-  while (i<80 && line3[i]!=' ') {
-#if 0
-    // XXX the rest of the code doesn't properly process flags yet, so
-    // there's no point in setting them currently.
-    if(!strncmp(line3+i, "potentials", 10))   grassp->flag |= POTENTIALS;
-    if(!strncmp(line3+i, "curvature",   9))   grassp->flag |= CURVATURES;
-    if(!strncmp(line3+i, "distances",   9))   grassp->flag |= DISTANCES;
-    if(!strncmp(line3+i, "gproperty",   9))   grassp->flag |= PROPERTY_1;
-    if(!strncmp(line3+i, "g2property", 10))   grassp->flag |= PROPERTY_2;
-    if(!strncmp(line3+i, "vertexcolor",11))   grassp->flag |= VERTEXCOLOR;
-#endif
-    i++;
-  }
-
-  // Assign default property colors
-  if (grassp->flag > 0 && grassp->flag < VERTEXCOLOR) {
-    switch (grassp->flag ) {
-      case POTENTIALS:
-        Set_Colour(grassp->clo, 1.0, 0.0, 0.0 );
-        Set_Colour(grassp->cmd, 1.0, 1.0, 1.0 );
-        Set_Colour(grassp->chi, 0.0, 0.0, 1.0 );
-        break;
-
-      case CURVATURES:
-        Set_Colour(grassp->clo, 0.5, 0.5, 0.5 );
-        Set_Colour(grassp->cmd, 1.0, 1.0, 1.0 );
-        Set_Colour(grassp->chi, 0.0, 1.0, 0.0 );
-        break;
-
-     case DISTANCES:
-       Set_Colour(grassp->clo, 1.0, 1.0, 1.0 );
-       Set_Colour(grassp->cmd, 0.0, 0.0, 1.0 );
-       Set_Colour(grassp->chi, 1.0, 0.0, 0.0 );
-       break;
-
-     default: // Global color
-       Set_Colour(grassp->clo, 1.0, 0.0, 0.0 );
-       Set_Colour(grassp->cmd, 0.5, 0.0, 0.5 );
-       Set_Colour(grassp->chi, 0.0, 0.0, 1.0 );
-       break;
-   }
- }
-
- if (!grassp->flag)
-   grassp->flag = GLOBALCOLOR; 
-} //line3 end
-
-
-// check endianness
-static int is_little_endian(void) {
-  int x=1;
-  return *((char *)&x);
-}   
-
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  grasp_t *grasp;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-  grasp = new grasp_t;
-  grasp->fd = fd;
-  grasp->graphics = NULL;
-  *natoms = 0;
-  return grasp;
-}
-
-
-static int read_rawgraphics(void *v, int *nelem, 
-    const molfile_graphics_t **data) {
-  grasp_t *grasp = (grasp_t *)v;
-  FILE *infile = grasp->fd;
-
-  // Reverse engineering is your friend, and combined with FORTRAN code, voila!
-  // od -c shows the header starts off:
-  // \0  \0  \0   P   f   o   r   m   a   t   =   2
-  // and according to ungrasp, this is a 1 for grasp versions 1.0
-  // and 1.1, and 2 for grasp version 1.2
-  // Also, the header lines are of length 80 characters + 4 header chars
-  // + 4 trailer chars
-  // The 4 bytes at the beginning/end are standard Fortran array trash
-
-  /// Pointers grassp type
-  GRASSP datax;
-   
-  char trash[4];
-#define TRASH fread(trash, 4, 1, infile)
-  char line[81];
-
-  // FIRST LINE OF HEADER; contains format type
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  // make sure it says 'format='
-  if (strncmp(line, "format=", 7) != 0) {
-    printf("graspplugin) First characters of file don't look like a GRASP file\n");
-    return MOLFILE_ERROR;
-  }
-  TRASH;
-
-  // next char should be a 0 or 1
-  char gfiletype = line[7];
-  if (gfiletype == '1') {
-    gfiletype = 1;
-  } else if (gfiletype == '2') {
-    gfiletype = 2;
-  } else {
-    printf("graspplugin) GRASP file is in format %c, but only '1' or '2' is supported\n", gfiletype);
-    return MOLFILE_ERROR;
-  }
-
-  // SECOND LINE: contains "vertices,accessibles,normals,triangles"
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  TRASH;
-
-  // THIRD LINE: contains (0 or more of)?
-  //  "potentials,curvature,distances,gproperty,g2property,vertexcolor
-  TRASH; 
-  line3(infile, &datax);/// Reads line 3
-  TRASH;
-
-  // FOURTH LINE stores vertices, triangles, gridsize, lattice spacing
-  int nvert, ntriangles, gridsize;
-  float lattice;
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  TRASH;
-  sscanf(line, "%d%d%d%f", &nvert, &ntriangles, &gridsize, &lattice);
-
-  /// Stores color
-  float *colores = new float [3*nvert];
-
-  // FIFTH LINE stores the center (x,y,z) position
-  float center[3];
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  TRASH;
-  sscanf(line, "%f%f%f", center, center+1, center+2);
-
-  float *vertex = new float[3 * nvert];
-  float *access = new float[3 * nvert];
-  float *normal = new float[3 * nvert];
-  int *triangle = new int[3 * ntriangles];
-  float *properties = new float[3* nvert];
-
-  if (!vertex || !access || !normal || !triangle || !properties) {
-    delete [] vertex;
-    delete [] access;
-    delete [] normal;
-    delete [] triangle;
-    delete [] properties;
-    printf("graspplugin) Failed vertex/access/normal/triangle allocations.\n");
-    return MOLFILE_ERROR;
-  }
-
-  // ungrasp says:
-  //    if (filetype.eq.1) then integer*2
-  //    if (filetype.eq.2) then integer*4
-
-  // And read them in.  Who needs error checking?
-  TRASH; 
-  fread(vertex, 3 * sizeof(float), nvert, infile); 
-  TRASH;
-  TRASH; 
-  fread(access, 3 * sizeof(float), nvert, infile); 
-  TRASH;
-  TRASH; 
-  fread(normal, 3 * sizeof(float), nvert, infile); 
-  TRASH;
- 
-  if (is_little_endian()) {
-    swap4_aligned(vertex, 3*nvert);
-    swap4_aligned(access, 3*nvert);
-    swap4_aligned(normal, 3*nvert);
-  }
-
-  if (gfiletype == 2) {
-    TRASH; 
-    fread(triangle, 3 * sizeof(int), ntriangles, infile); 
-    TRASH;
-    TRASH;
-    fread(properties, 3 * sizeof(float), nvert, infile);
-    if (is_little_endian()) {
-      swap4_aligned(triangle, 3*ntriangles);
-      swap4_aligned(properties, 3*nvert);
-    }
-  } else {
-#if 1
-    int i;
-    short *striangle = new short[3 * ntriangles];
-    if (!striangle) {
-      delete [] vertex;
-      delete [] access;
-      delete [] normal;
-      delete [] triangle;
-      delete [] properties;
-      printf("graspplugin) Failed short triangle allocation.\n");
-      return MOLFILE_ERROR;
-    }
-
-    TRASH;
-    fread(striangle, sizeof(short), 3 * ntriangles, infile);
-    TRASH;
-    TRASH;
-    fread(properties, sizeof(float), 3 * nvert, infile);
-    
-    if (is_little_endian()) {
-    swap2_aligned(striangle, 3 * ntriangles);
-    swap4_aligned(properties, 3*nvert);}
-    
-    for (i=0; i<3*ntriangles; i++) {
-      triangle[i] = striangle[i];
-    }
-    delete [] striangle;  
-    
-#else
-    // do it the slow way (converting from short to int)
-    int i;
-    short tmp[3];
-    TRASH;
-    for (i=0; i<ntriangles; i++) {
-      fread(tmp, sizeof(short), 3, infile);
-      if (is_little_endian()) swap2_aligned(tmp, 3);
-      triangle[3*i+0] = tmp[0];
-      triangle[3*i+1] = tmp[1];
-      triangle[3*i+2] = tmp[2];
-    }
-    TRASH;
-    TRASH;
-    fread(properties, sizeof(float), 3 * nvert, infile);
-      if (is_little_endian())
-      swap4_aligned(properties, 3*nvert);
-
-#endif
-  }   
-  
-  /// Gets properties:  potentials, curvature, distances, gproperty, g2property or vertexcolor 
-  Get_Property_Values(&datax, properties, colores, nvert);
-  
-  // And draw things
-  grasp->graphics = new molfile_graphics_t[3*ntriangles];
-  int vert1, vert2, vert3;
-
-  for (int tri_count = 0; tri_count < ntriangles; tri_count++) {
-    vert1 = triangle[3*tri_count+0] - 1;  // from 1-based FORTRAN
-    vert2 = triangle[3*tri_count+1] - 1;  // to 0-based C++
-    vert3 = triangle[3*tri_count+2] - 1;
-
-    if (vert1 <      0 || vert2 <      0 || vert3 <      0 ||
-        vert1 >= nvert || vert2 >= nvert || vert3 >= nvert) {
-      printf("graspplugin) Error, out-of-range vertex index, aborting.\n"); 
-      delete [] vertex;
-      delete [] access;
-      delete [] normal;
-      delete [] triangle;
-      delete [] properties;
-      return MOLFILE_ERROR;
-    }
-
-    grasp->graphics[2*tri_count  ].type = MOLFILE_TRINORM;
-    grasp->graphics[2*tri_count+1].type = MOLFILE_NORMS;
-    grasp->graphics[2*tri_count+2].type = MOLFILE_COLOR;
-    
-    float *tridata =  grasp->graphics[2*tri_count  ].data;
-    float *normdata = grasp->graphics[2*tri_count+1].data;
-    float *colordata = grasp->graphics[2*tri_count+2].data;
-        
-    memcpy(tridata  , vertex+3*vert1, 3*sizeof(float));
-    memcpy(tridata+3, vertex+3*vert2, 3*sizeof(float));
-    memcpy(tridata+6, vertex+3*vert3, 3*sizeof(float));
-    
-    memcpy(normdata  , normal+3*vert1, 3*sizeof(float));
-    memcpy(normdata+3, normal+3*vert2, 3*sizeof(float));
-    memcpy(normdata+6, normal+3*vert3, 3*sizeof(float));
-    
-    memcpy(colordata  , properties+3*vert1, 3*sizeof(float));
-    memcpy(colordata+3, properties+3*vert2, 3*sizeof(float));
-    memcpy(colordata+6, properties+3*vert3, 3*sizeof(float));
-  } 
-
-  *nelem = 2*ntriangles;
-  *data = grasp->graphics;
-
-  delete [] triangle;
-  delete [] normal;
-  delete [] access;
-  delete [] vertex;
-  delete [] properties;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  grasp_t *grasp = (grasp_t *)v;
-  fclose(grasp->fd);
-  delete [] grasp->graphics;
-  delete grasp;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "grasp";
-  plugin.prettyname = "GRASP";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 8;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "srf,SRF,grasp";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/grdplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/grdplugin.C
deleted file mode 100644
index 5732a03ceb8553633ce982b0a0dc22d36ea89b02..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/grdplugin.C
+++ /dev/null
@@ -1,271 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: grdplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.17 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * "unformatted" binary potential map, as used by Grasp and DelPhi
- *
- * Format (fortran): 
- * character*20 uplbl
- * character*10 nxtlbl,character*60 toplbl
- * real*4 phi(n,n,n)
- * character*16 botlbl
- * real*4 scale,oldmid(3)
- *
- * Where n is the length in grid units of each edge of the grid.
- *
- * More information can be found at:
- * <http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.2>
- * <http://trantor.bioc.columbia.edu/delphi/doc/file_format.html>
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int ndata;
-  int swap;
-  molfile_volumetric_t *vol;
-} grd_t;
-
-
-static void *open_grd_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  grd_t *grd;
-  char uplbl[21], nxtlbl[11], toplbl[61];
-  int swap, recordSize, gridSize, iGrid;
-  float scale, midX, midY, midZ;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "grdplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Check byte order. The first four bytes of the file always make up the
-   * integer 20.
-   */
-  if (fread(&recordSize, 4, 1, fd) != 1) {
-    fprintf(stderr, "grdplugin) Error reading file header: uplbl.\n");
-    return NULL;
-  }
-  if (recordSize == 20) {
-    swap = 0;
-  }
-  else {
-    swap4_aligned(&recordSize, 1);
-    if (recordSize == 20) {
-      swap = 1;
-    }
-    else {
-      fprintf(stderr, "grdplugin) Improperly formatted file header: uplbl.\n");
-      return NULL;
-    }
-  }
-  
-  /* Check for a valid phimap 
-   * XXX - Some programs write gibberish for this record, don't worry about
-   * its contents
-   * character*20 uplbl
-   */
-  if ( (fread(uplbl, 1, 20, fd) != 20) ||
-       (fread(&recordSize, 4, 1, fd) != 1) ) {
-    fprintf(stderr, "grdplugin) Error: uplbl does not match.\n");
-    return NULL;
-  }
-
-  /* Read in the next record:
-   * character*10 nxtlbl, character*60 toplbl 
-   * The labels themselves are currently ignored, but they may be useful in
-   * the future.
-   */ 
-  if (fread(&recordSize, 4, 1, fd) != 1) {
-    fprintf(stderr, "grdplugin) Error reading file header: nxtlbl.\n");
-    return NULL;
-  }
-  if (swap) {
-    swap4_aligned(&recordSize, 1);
-  }
-  if (recordSize != 70) {
-    fprintf(stderr, "grdplugin) Improperly formatted file header: nxtlbl.\n");
-    return NULL;
-  }
-  if ( (fread(nxtlbl, 1, 10, fd) != 10) ||
-       (fread(toplbl, 1, 60, fd) != 60) ||
-       (fread(&recordSize, 4, 1, fd) != 1) ) {
-    fprintf(stderr, "grdplugin) Error reading nxtlbl.\n");
-    return NULL;
-  }
-  
-  /* Find the number of data points in the file
-   * The next integer gives the number of bytes used to store the data.
-   */
-  if (fread(&recordSize, 4, 1, fd) != 1) {
-    fprintf(stderr, "grdplugin) Error reading file header: grid.\n");
-    return NULL;
-  }
-  if (swap) {
-    swap4_aligned(&recordSize, 1);
-  }
-  iGrid = recordSize / 4;
-
-  /* Find the length in grid units of the edge of the cube, make sure it's
-   * an integer 
-   */
-  gridSize = (int) (pow((double) iGrid, (double) 1.0/3.0) + 0.5);
-  if ((gridSize*gridSize*gridSize) != iGrid) {
-    fprintf(stderr, "grdplugin) Error: non-cube grid.\n");
-    return NULL;
-  }
-
-  /* Read the scale and midpoint coordinates from the end of the file.
-   */
-  if ( (fseek(fd, -20, SEEK_END) != 0) ||
-       (fread(&scale, sizeof(float), 1, fd) != 1) ||
-       (fread(&midX, sizeof(float), 1, fd) != 1) ||
-       (fread(&midY, sizeof(float), 1, fd) != 1) ||
-       (fread(&midZ, sizeof(float), 1, fd) != 1) ) {
-    fprintf(stderr, "grdplugin) Error reading scale and midpoint.\n");
-    return NULL;
-  }
-  if (swap) {
-    swap4_aligned(&scale, 1);
-    swap4_aligned(&midX, 1);
-    swap4_aligned(&midY, 1);
-    swap4_aligned(&midZ, 1);
-  }
-
-  /* Allocate and initialize the grd structure */
-  grd = new grd_t;
-  grd->fd = fd;
-  grd->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  grd->nsets = 1; /* this file contains only one data set */
-  grd->ndata = iGrid;
-  grd->swap = swap;
-
-  grd->vol = new molfile_volumetric_t[1];
-  strcpy(grd->vol[0].dataname, "PHIMAP Electron Density Map");
-
-  /* <midX, midY, midZ> is the middle point of the grid. */
-  grd->vol[0].origin[0] = -0.5*(gridSize+1.0) / scale + midX;
-  grd->vol[0].origin[1] = -0.5*(gridSize+1.0) / scale + midY;
-  grd->vol[0].origin[2] = -0.5*(gridSize+1.0) / scale + midZ;
-
-  grd->vol[0].xaxis[0] = gridSize / scale;
-  grd->vol[0].xaxis[1] = 0;
-  grd->vol[0].xaxis[2] = 0;
-
-  grd->vol[0].yaxis[0] = 0;
-  grd->vol[0].yaxis[1] = gridSize / scale;
-  grd->vol[0].yaxis[2] = 0;
-
-  grd->vol[0].zaxis[0] = 0;
-  grd->vol[0].zaxis[1] = 0;
-  grd->vol[0].zaxis[2] = gridSize / scale;
-
-  grd->vol[0].xsize = gridSize;
-  grd->vol[0].ysize = gridSize;
-  grd->vol[0].zsize = gridSize;
-
-  grd->vol[0].has_color = 0;
-
-  return grd;
-}
-
-static int read_grd_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  grd_t *grd = (grd_t *)v;
-  *nsets = grd->nsets; 
-  *metadata = grd->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_grd_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  grd_t *grd = (grd_t *)v;
-  int ndata = grd->ndata;
-  FILE *fd = grd->fd;
-
-  /* Skip the header */
-  fseek(fd, 110, SEEK_SET);
-
-  /* Read the densities. Order for file is x fast, y medium, z slow */
-  if (fread(datablock, sizeof(float), ndata, fd) != (unsigned int) ndata) {
-    fprintf(stderr, "grdplugin) Error reading grid data.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (grd->swap) {
-    swap4_aligned(datablock, ndata);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_grd_read(void *v) {
-  grd_t *grd = (grd_t *)v;
-
-  fclose(grd->fd);
-  if (grd->vol != NULL)
-    delete [] grd->vol; 
-  delete grd;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "grd";
-  plugin.prettyname = "GRASP,Delphi Binary Potential Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "phi,grd";
-  plugin.open_file_read = open_grd_read;
-  plugin.read_volumetric_metadata = read_grd_metadata;
-  plugin.read_volumetric_data = read_grd_data;
-  plugin.close_file_read = close_grd_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gridplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gridplugin.C
deleted file mode 100644
index fd1d9532c13ec772763400d898d7f1d53800dc42..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gridplugin.C
+++ /dev/null
@@ -1,234 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gridplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.15 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Binary potential map format used by Molecular Discovery GRID, 
- * UHBD, and other packages.
- *
- * Files begin with a 160-byte formatted fortran header.
- * For each plane in the grid, there is a 12-byte formatted fortran record
- * giving the grid coordinates, followed by a nx*ny*4 byte formatted fortran
- * record with the grid data.
- *
- * The header has the following format (addresses in bytes):
- * header[0..71]:     char * 72, grid title
- * header[72..79]:    float * 2, grid clearance and cutoff energy (unused by
- *                    VMD)
- * header[80..99]:    unknown
- * header[100..111]:  int * 3, number of planes in each direction
- * header[112..127]:  float * 4, grid spacing in angstroms, followed by grid
- *                    origin
- * header[128..151]:  float * 6, VDW radius, neff, alph, q, emin, rmin
- *                    (unused by VMD)
- * header[152..159]:  int * 2, jd, ja (unused by VMD)
- *
- * XXX - Not sure if slicing order is the same in every file. Also, other
- * values from plane metadata seem to have no use -- I'm probably missing
- * something. 
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-#include "fortread.h"
-
-typedef struct {
-  FILE *fd;
-  int swap;
-  molfile_volumetric_t *vol;
-} grid_t;
-
-
-static void *open_grid_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  grid_t *grid;
-  float header[64], ra, rx, ry, rz;
-  int dataBegin, swap, blocksize, nnx, nny, nnz;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "gridplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // Use the first four-byte integer in the file to determine the file's
-  // byte-order
-  fread(&dataBegin, sizeof(int), 1, fd);
-  if ( (dataBegin > 255) || (dataBegin < 0) ) {
-    // check if the bytes need to be swapped
-    swap4_aligned(&dataBegin, 1);
-    if (dataBegin <= 255) {
-      swap = 1;
-    } else {
-      fprintf(stderr, "gridplugin) Cannot read file: header block is too large.\n");
-      return NULL;
-    }
-  }
-  else {
-    swap = 0;
-  }
-
-  // Read the header
-  rewind(fd);
-  blocksize = fortread_4(header, 64, swap, fd);
-
-  if (blocksize != 40) {
-    fprintf(stderr, "gridplugin) Incorrect header size.\n");
-    return NULL;
-  }
-
-  // number of planes in each dimension
-  nnx = ((int *)header)[25];
-  nny = ((int *)header)[26];
-  nnz = ((int *)header)[27];
-
-  // grid spacing in angstroms
-  ra = header[28];
-
-  // reference point for grid position
-  rx = header[29];
-  ry = header[30];
-  rz = header[31];
-
-  // Allocate and initialize the structure 
-  grid = new grid_t;
-  grid->fd = fd;
-  grid->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  grid->swap = swap;
-
-  grid->vol = new molfile_volumetric_t[1];
-  strcpy(grid->vol[0].dataname, "GRID Electron Density Map");
-
-  // XXX - origin seems to be shifted by one grid point in each direction
-  // from the reference point. 
-  grid->vol[0].origin[0] = rx + ra;
-  grid->vol[0].origin[1] = ry + ra;
-  grid->vol[0].origin[2] = rz + ra;
-
-  grid->vol[0].xaxis[0] = nnx * ra;
-  grid->vol[0].xaxis[1] = 0;
-  grid->vol[0].xaxis[2] = 0;
-
-  grid->vol[0].yaxis[0] = 0;
-  grid->vol[0].yaxis[1] = nny * ra;
-  grid->vol[0].yaxis[2] = 0;
-
-  grid->vol[0].zaxis[0] = 0;
-  grid->vol[0].zaxis[1] = 0;
-  grid->vol[0].zaxis[2] = nnz * ra;
-
-  grid->vol[0].xsize = nnx;
-  grid->vol[0].ysize = nny;
-  grid->vol[0].zsize = nnz;
-
-  grid->vol[0].has_color = 0;   // This file has no color
-
-  return grid;
-}
-
-static int read_grid_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  grid_t *grid = (grid_t *)v;
-  *nsets = 1;                   // This file contains only one data set.
-  *metadata = grid->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_grid_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  grid_t *grid = (grid_t *)v;
-  int planeHeader[3], planeSize, i, z;
-  float *planeData;
-
-  planeSize = grid->vol[0].xsize * grid->vol[0].ysize;
-
-  planeData = new float[planeSize];
-
-  for (i = 0; i < grid->vol[0].zsize; i++) {
-    // read the plane metadata
-    if (fortread_4(planeHeader, 3, grid->swap, grid->fd) != 3) {
-      fprintf(stderr, "gridplugin) Error reading plane metadata.\n");
-      delete [] planeData;
-      return MOLFILE_ERROR;
-    }
-    z = planeHeader[0] - 1;
-
-    // read the plane data
-    if (fortread_4(planeData, planeSize, grid->swap, grid->fd) != planeSize) {
-      fprintf(stderr, "gridplugin) Error reading plane data.\n");
-      delete [] planeData;
-      return MOLFILE_ERROR;
-    }
-
-    // copy the plane data to the datablock
-    memcpy(datablock + z*planeSize, planeData, planeSize * sizeof(float));
-  }
-
-  delete [] planeData;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_grid_read(void *v) {
-  grid_t *grid = (grid_t *)v;
-
-  fclose(grid->fd);
-  if (grid->vol != NULL)
-    delete [] grid->vol; 
-  delete grid;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "grid";
-  plugin.prettyname = "GRID,UHBD Binary Potential Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "grid";
-  plugin.open_file_read = open_grid_read;
-  plugin.read_volumetric_metadata = read_grid_metadata;
-  plugin.read_volumetric_data = read_grid_data;
-  plugin.close_file_read = close_grid_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gromacsplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gromacsplugin.C
deleted file mode 100644
index f4a9e8c7bfe4be7e4f1895460bd1e6e72b28f88e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/gromacsplugin.C
+++ /dev/null
@@ -1,808 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gromacsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.52 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "Gromacs.h"
-#include "molfile_plugin.h"
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#ifndef M_PI
-#define M_PI           3.14159265358979323846
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-typedef struct {
-  md_file *mf;
-  int natoms;
-  int step;
-  float timeval;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-} gmxdata;
-
-static void convert_vmd_box_for_writing(const molfile_timestep_t *ts, float *x, float *y, float *z)
-{
-//     const float sa = sin((double)ts->alpha/180.0*M_PI);
-    const float ca = cos((double)ts->alpha/180.0*M_PI);
-    const float cb = cos((double)ts->beta/180.0*M_PI);
-    const float cg = cos((double)ts->gamma/180.0*M_PI);
-    const float sg = sin((double)ts->gamma/180.0*M_PI);
-
-    x[0] = ts->A / ANGS_PER_NM;
-    y[0] = 0.0;
-    z[0] = 0.0;
-    x[1] = ts->B*cg / ANGS_PER_NM; // ts->B*ca when writing trr?!
-    y[1] = ts->B*sg / ANGS_PER_NM; // ts->B*sa when writing trr?!
-    z[1] = 0.0;
-    x[2] = ts->C*cb / ANGS_PER_NM;
-    y[2] = (ts->C / ANGS_PER_NM)*(ca - cb*cg)/sg;
-    z[2] = (ts->C / ANGS_PER_NM)*sqrt((double)(1.0 + 2.0*ca*cb*cg
-                               - ca*ca - cb*cb - cg*cg)/(1.0 - cg*cg));
-}
-
-static void *open_gro_read(const char *filename, const char *,
-    int *natoms) {
-
-    md_file *mf;
-    md_header mdh;
-    gmxdata *gmx;
-
-    mf = mdio_open(filename, MDFMT_GRO);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-
-    // read in the header data (careful not to rewind!)
-    if (gro_header(mf, mdh.title, MAX_MDIO_TITLE,
-    &mdh.timeval, &mdh.natoms, 0) < 0) {
-        fprintf(stderr, "gromacsplugin) Cannot read header fromm '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-            // XXX should free the file handle...
-        return NULL;
-    }
-    *natoms = mdh.natoms;
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = mdh.natoms;
-    gmx->meta = new molfile_metadata_t;
-    memset(gmx->meta,0,sizeof(molfile_metadata_t));
-    strncpy(gmx->meta->title, mdh.title, 80);
-    gmx->timeval = mdh.timeval;
-    return gmx;
-}
-
-static int read_gro_structure(void *mydata, int *optflags,
-    molfile_atom_t *atoms) {
-
-  md_atom ma;
-  char buf[MAX_GRO_LINE + 1];
-  gmxdata *gmx = (gmxdata *)mydata;
-
-  *optflags = MOLFILE_NOOPTIONS; // no optional data
-
-  // read in each atom and add it into the molecule
-  for (int i = 0; i < gmx->natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (gro_rec(gmx->mf, &ma) < 0) {
-      fprintf(stderr, "gromacsplugin) Error reading atom %d from file, %s\n",
-              i+1, mdio_errmsg(mdio_errno()));
-      return MOLFILE_ERROR;
-    }
-    strcpy(atom->name, ma.atomname);
-    strcpy(atom->type, ma.atomname);
-    strcpy(atom->resname, ma.resname);
-    atom->resid = atoi(ma.resid);
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  if (mdio_readline(gmx->mf, buf, MAX_GRO_LINE + 1, 0) < 0) {
-    fprintf(stderr, "gromacsplugin) Warning, error reading box, %s\n",
-            mdio_errmsg(mdio_errno()));
-  }
-
-  rewind(gmx->mf->f);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_gro_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  gmxdata *gmx = (gmxdata *)v;
-  *metadata = gmx->meta;
-  return MOLFILE_SUCCESS;
-}
-
-static int read_gro_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  gmxdata *gmx = (gmxdata *)v;
-  md_ts mdts;
-  memset(&mdts, 0, sizeof(md_ts));
-  mdts.natoms = natoms;
-
-  if (mdio_timestep(gmx->mf, &mdts) < 0)
-    return MOLFILE_ERROR;
-  if (ts) {
-    memcpy(ts->coords, mdts.pos, 3 * sizeof(float) * gmx->natoms);
-    if (mdts.box) {
-      ts->A = mdts.box->A;
-      ts->B = mdts.box->B;
-      ts->C = mdts.box->C;
-      ts->alpha = mdts.box->alpha;
-      ts->beta = mdts.box->beta;
-      ts->gamma = mdts.box->gamma;
-    }
-  }
-  mdio_tsfree(&mdts);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_gro_read(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx->meta;
-  delete gmx;
-}
-
-// open file for writing
-static void *open_gro_write(const char *filename, const char *filetype,
-    int natoms) {
-
-    md_file *mf;
-    gmxdata *gmx;
-
-    mf = mdio_open(filename, MDFMT_GRO, MDIO_WRITE);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = natoms;
-    gmx->step   = 0;
-    gmx->meta = new molfile_metadata_t;
-    memset(gmx->meta,0,sizeof(molfile_metadata_t));
-    gmx->meta->title[0] = '\0';
-
-    return gmx;
-}
-
-static int write_gro_structure(void *v, int optflags,
-    const molfile_atom_t *atoms) {
-
-  gmxdata *gmx = (gmxdata *)v;
-  int natoms = gmx->natoms;
-  gmx->atomlist = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-  memcpy(gmx->atomlist, atoms, natoms*sizeof(molfile_atom_t));
-
-  return MOLFILE_SUCCESS;
-}
-
-static int write_gro_timestep(void *v, const molfile_timestep_t *ts) {
-  gmxdata *gmx = (gmxdata *)v;
-  const molfile_atom_t *atom;
-  const float *pos, *vel;
-  float x[3], y[3], z[3];
-  int i;
-
-  if (gmx->natoms == 0)
-    return MOLFILE_SUCCESS;
-
-  atom = gmx->atomlist;
-  pos = ts->coords;
-  vel = ts->velocities;
-
-  /* The title cannot be written */
-/*  fprintf(gmx->mf->f, "%s", gmx->meta->title);*/
-  /* Write a dummy title instead */
-  fprintf(gmx->mf->f, "generated by VMD");
-#if vmdplugin_ABIVERSION > 10
-  fprintf(gmx->mf->f, ", t= %f", ts->physical_time);
-#endif
-  fprintf(gmx->mf->f, "\n");
-
-  fprintf(gmx->mf->f, "%d\n", gmx->natoms);
-  for (i=0; i<gmx->natoms; i++)
-  {
-     fprintf(gmx->mf->f, "%5d%-5s%5s%5d%8.3f%8.3f%8.3f",
-             atom->resid, atom->resname, atom->name, i+1,
-             pos[0] / ANGS_PER_NM, pos[1] / ANGS_PER_NM, pos[2] / ANGS_PER_NM);
-     if(vel)
-     {
-         fprintf(gmx->mf->f, "%8.4f%8.4f%8.4f", vel[0] / ANGS_PER_NM, vel[1] / ANGS_PER_NM, vel[2] / ANGS_PER_NM);
-         vel += 3;
-     }
-     fprintf(gmx->mf->f, "\n");
-     ++atom;
-     pos += 3;
-  }
-  convert_vmd_box_for_writing(ts, x, y, z);
-  fprintf(gmx->mf->f, "%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n", x[0], y[1], z[2], y[0], z[0], x[1], z[1], x[2], y[2]);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_gro_write(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  free(gmx->atomlist);
-  delete gmx->meta;
-  delete gmx;
-}
-
-
-static void *open_g96_read(const char *filename, const char *,
-    int *natoms) {
-
-    md_file *mf;
-    md_header mdh;
-    char gbuf[MAX_G96_LINE + 1];
-
-    mf = mdio_open(filename, MDFMT_G96);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-
-        // read in the header data
-        if (g96_header(mf, mdh.title, MAX_MDIO_TITLE, &mdh.timeval) < 0) {
-            fprintf(stderr, "gromacsplugin) Cannot read header from '%s', %s\n",
-                    filename, mdio_errmsg(mdio_errno()));
-            return NULL;
-        }
-
-        // First, look for a timestep block
-        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0) {
-            fprintf(stderr, "gromacsplugin) Cannot read header from '%s', %s\n",
-                    filename, mdio_errmsg(mdio_errno()));
-            return NULL;
-        }
-        if (!strcasecmp(gbuf, "TIMESTEP")) {
-            // Read in the value line and the END line, and the next
-            if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0 ||
-                mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0 ||
-                mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0) {
-              fprintf(stderr, "gromacsplugin) Cannot read header from '%s', %s\n",
-                      filename, mdio_errmsg(mdio_errno()));
-              return NULL;
-            }
-        }
-        if (strcasecmp(gbuf, "POSITION") && strcasecmp(gbuf, "REFPOSITION")) {
-          fprintf(stderr, "gromacsplugin) No structure information in file %s\n", filename);
-          return NULL;
-        }
-        *natoms = g96_countatoms(mf);
-
-        gmxdata *gmx = new gmxdata;
-        memset(gmx,0,sizeof(gmxdata));
-        gmx->mf = mf;
-        gmx->natoms = *natoms; 
-        return gmx;
-}
-
-static int read_g96_structure(void *mydata, int *optflags,
-    molfile_atom_t *atoms) {
-
-    char gbuf[MAX_G96_LINE + 1];
-    gmxdata *gmx = (gmxdata *)mydata;
-    md_atom ma;
-    md_file *mf = gmx->mf;
-
-    *optflags = MOLFILE_NOOPTIONS; // no optional data
-
-        for (int i = 0; i < gmx->natoms; i++) {
-            molfile_atom_t *atom = atoms+i;
-            if (g96_rec(mf, &ma) < 0) {
-                fprintf(stderr, "gromacsplugin) Error reading atom %d from file, %s\n",
-                  i+1, mdio_errmsg(mdio_errno()));
-                return MOLFILE_ERROR;
-            }
-            strcpy(atom->name, ma.atomname);
-            strcpy(atom->type, ma.atomname);
-            strcpy(atom->resname, ma.resname);
-            atom->resid = atoi(ma.resid);
-            atom->chain[0] = '\0';
-            atom->segid[0] = '\0';
-        }
-
-        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0) {
-            fprintf(stderr, "gromacsplugin) Warning, error reading END record, %s\n",
-                mdio_errmsg(mdio_errno()));
-        }
-
-            // ... another problem: there may or may not be a VELOCITY
-            // block or a BOX block, so we need to read one line beyond
-            // the POSITION block to determine this. If neither VEL. nor
-            // BOX are present we've read a line too far and infringed
-            // on the next timestep, so we need to keep track of the
-            // position now for a possible fseek() later to backtrack.
-            long fpos = ftell(mf->f);
-
-            // Now we must read in the velocities and the box, if present
-            if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) >= 0) {
-
-                // Is there a velocity block present ?
-                if (!strcasecmp(gbuf, "VELOCITY") || !strcasecmp(gbuf, "VELOCITYRED")) {
-                        // Ignore all the coordinates - VMD doesn't use them
-                        for (;;) {
-                                if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                                        return MOLFILE_ERROR;
-                                if (!strcasecmp(gbuf, "END")) break;
-                        }
-
-                        // Again, record our position because we may need
-                        // to fseek here later if we read too far.
-                        fpos = ftell(mf->f);
-
-                        // Go ahead and read the next line.
-                        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                    return MOLFILE_ERROR;
-                }
-
-                // Is there a box present ?
-                if (!strcasecmp(gbuf, "BOX")) {
-                        // Ignore the box coordinates at this time.
-                        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                    return MOLFILE_ERROR;
-                        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                    return MOLFILE_ERROR;
-                        if (strcasecmp(gbuf, "END"))
-                    return MOLFILE_ERROR;
-                }
-                else {
-                        // We have read too far, so fseek back to the
-                        // last known safe position so we don't return
-                        // with the file pointer set infringing on the
-                        // next timestep data.
-                        fseek(mf->f, fpos, SEEK_SET);
-                }
-        }
-        else {
-            // Go ahead and rewind for good measure
-            fseek(mf->f, fpos, SEEK_SET);
-        }
-        rewind(mf->f);
-        return MOLFILE_SUCCESS;
-}
-
-static int read_g96_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-
-  gmxdata *gmx = (gmxdata *)v;
-  md_ts mdts;
-  memset(&mdts, 0, sizeof(md_ts));
-  mdts.natoms = natoms;
-
-  if (mdio_timestep(gmx->mf, &mdts) < 0)
-    return MOLFILE_ERROR;
-  if (ts) {
-    memcpy(ts->coords, mdts.pos, 3 * sizeof(float) * gmx->natoms);
-    if (mdts.box) {
-      ts->A = mdts.box->A;
-      ts->B = mdts.box->B;
-      ts->C = mdts.box->C;
-      ts->alpha = mdts.box->alpha;
-      ts->beta = mdts.box->beta;
-      ts->gamma = mdts.box->gamma;
-    }
-  }
-  mdio_tsfree(&mdts);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_g96_read(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx;
-}
-
-
-//
-// TRR and XTC files
-//
-
-static void *open_trr_read(const char *filename, const char *filetype,
-    int *natoms) {
-
-    md_file *mf;
-    md_header mdh;
-    gmxdata *gmx;
-    int format;
-
-    if (!strcmp(filetype, "trr"))
-      format = MDFMT_TRR;
-    else if (!strcmp(filetype, "trj"))
-      format = MDFMT_TRJ;
-    else if (!strcmp(filetype, "xtc"))
-      format = MDFMT_XTC;
-    else
-      return NULL;
-
-    mf = mdio_open(filename, format);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    if (mdio_header(mf, &mdh) < 0) {
-        mdio_close(mf);
-        fprintf(stderr, "gromacsplugin) Cannot read header fromm '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    *natoms = mdh.natoms;
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = mdh.natoms;
-    return gmx;
-}
-
-static int read_trr_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  gmxdata *gmx = (gmxdata *)v;
-  md_ts mdts;
-  memset(&mdts, 0, sizeof(md_ts));
-  mdts.natoms = natoms;
-
-  if (mdio_timestep(gmx->mf, &mdts) < 0) {
-    if (mdio_errno() == MDIO_EOF || mdio_errno() == MDIO_IOERROR) {
-      // XXX Lame, why does mdio treat IOERROR like EOF?
-      return MOLFILE_ERROR;
-    }
-    fprintf(stderr, "gromacsplugin) Error reading timestep, %s\n",
-            mdio_errmsg(mdio_errno()));
-    return MOLFILE_ERROR;
-  }
-  if (mdts.natoms != natoms) {
-    fprintf(stderr, "gromacsplugin) Timestep in file contains wrong number of atoms\n");
-    fprintf(stderr, "gromacsplugin) Found %d, expected %d\n", mdts.natoms, natoms);
-    mdio_tsfree(&mdts);
-    return MOLFILE_ERROR;
-  }
-
-  if (ts) {
-    memcpy(ts->coords, mdts.pos, 3 * sizeof(float) * gmx->natoms);
-    if (mdts.box) {
-      ts->A = mdts.box->A;
-      ts->B = mdts.box->B;
-      ts->C = mdts.box->C;
-      ts->alpha = mdts.box->alpha;
-      ts->beta = mdts.box->beta;
-      ts->gamma = mdts.box->gamma;
-    }
-  }
-  mdio_tsfree(&mdts);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_trr_read(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx;
-}
-
-// open file for writing
-static void *open_trr_write(const char *filename, const char *filetype,
-    int natoms) {
-
-    md_file *mf;
-    gmxdata *gmx;
-    int format;
-
-    if (!strcmp(filetype, "trr"))
-      format = MDFMT_TRR;
-    else if (!strcmp(filetype, "xtc"))
-      format = MDFMT_XTC;
-    else
-      return NULL;
-
-    mf = mdio_open(filename, format, MDIO_WRITE);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = natoms;
-    // set some parameters for the output stream:
-    // start at step 0, convert to big-endian, write single precision.
-    gmx->step   = 0;
-    gmx->mf->rev = host_is_little_endian();
-    gmx->mf->prec = sizeof(float);
-    return gmx;
-}
-
-// write a trr timestep. the file format has a header with each record
-static int write_trr_timestep(void *mydata, const molfile_timestep_t *ts)
-{
-  const float nm=0.1;
-
-  gmxdata *gmx = (gmxdata *)mydata;
-
-  // determine and write header from structure info.
-  // write trr header. XXX: move this to Gromacs.h ??
-  if (gmx->mf->fmt == MDFMT_TRR) {
-    int i;
-
-    if ( put_trx_int(gmx->mf, TRX_MAGIC)            // ID
-         || put_trx_string(gmx->mf, "GMX_trn_file") // version
-         || put_trx_int(gmx->mf, 0)                 // ir_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // e_size (ignored)
-         || put_trx_int(gmx->mf, 9*sizeof(float))   // box
-         || put_trx_int(gmx->mf, 0)                 // vir_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // pres_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // top_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // sym_size (ignored)
-         || put_trx_int(gmx->mf, 3*sizeof(float)*gmx->natoms) // coordinates
-         || put_trx_int(gmx->mf, 0)                 // no velocities
-         || put_trx_int(gmx->mf, 0)                 // no forces
-         || put_trx_int(gmx->mf, gmx->natoms)       // number of atoms
-         || put_trx_int(gmx->mf, gmx->step)         // current step number
-         || put_trx_int(gmx->mf, 0)                 // nre (ignored)
-         || put_trx_real(gmx->mf, 0.1*gmx->step)    // current time. (dummy value: 0.1)
-         || put_trx_real(gmx->mf, 0.0))             // current lambda
-      return MOLFILE_ERROR;
-
-    // set up box according to the VMD unitcell conventions.
-    // the a-vector is collinear with the x-axis and
-    // the b-vector is in the xy-plane.
-    const float sa = sin((double)ts->alpha/180.0*M_PI);
-    const float ca = cos((double)ts->alpha/180.0*M_PI);
-    const float cb = cos((double)ts->beta/180.0*M_PI);
-    const float cg = cos((double)ts->gamma/180.0*M_PI);
-    const float sg = sin((double)ts->gamma/180.0*M_PI);
-    float box[9];
-    box[0] = ts->A;    box[1] = 0.0;      box[2] = 0.0;
-    box[3] = ts->B*ca; box[4] = ts->B*sa; box[5] = 0.0;
-    box[6] = ts->C*cb; box[7] = ts->C*(ca - cb*cg)/sg;
-    box[8] = ts->C*sqrt((double)(1.0 + 2.0*ca*cb*cg
-                                 - ca*ca - cb*cb - cg*cg)/(1.0 - cg*cg));
-
-    for (i=0; i<9; ++i) {
-      if (put_trx_real(gmx->mf, box[i]*nm))
-        return MOLFILE_ERROR;
-    }
-#ifdef TEST_TRR_PLUGIN
-    fprintf(stderr, "gromacsplugin) box is:\n %f %f %f\n %f %f %f\n %f %f %f\n\n",
-            box[0], box[1], box[2], box[3], box[4], box[5], box[6], box[7], box[8]);
-#endif
-
-    // write coordinates
-    for (i=0; i<(3*gmx->natoms); ++i) {
-      if (put_trx_real(gmx->mf, ts->coords[i]*nm))
-        return MOLFILE_ERROR;
-    }
-  } else {
-    fprintf(stderr, "gromacsplugin) only .trr is supported for writing\n");
-    return MOLFILE_ERROR;
-  }
-
-  ++ gmx->step;
-  return MOLFILE_SUCCESS;
-  }
-
-
-static void close_trr_write(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx;
-}
-
-#define GROMACS_PLUGIN_MAJOR_VERSION 1
-#define GROMACS_PLUGIN_MINOR_VERSION 2 
-
-//
-// plugin registration stuff below
-//
-
-static molfile_plugin_t gro_plugin;
-static molfile_plugin_t g96_plugin;
-static molfile_plugin_t trr_plugin;
-static molfile_plugin_t xtc_plugin;
-static molfile_plugin_t trj_plugin;
-
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  // GRO plugin init
-  memset(&gro_plugin, 0, sizeof(molfile_plugin_t));
-  gro_plugin.abiversion = vmdplugin_ABIVERSION;
-  gro_plugin.type = MOLFILE_PLUGIN_TYPE;
-  gro_plugin.name = "gro";
-  gro_plugin.prettyname = "Gromacs GRO";
-  gro_plugin.author = "David Norris, Justin Gullingsrud, Magnus Lundborg";
-  gro_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  gro_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  gro_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  gro_plugin.filename_extension = "gro";
-  gro_plugin.open_file_read = open_gro_read;
-  gro_plugin.read_structure = read_gro_structure;
-  gro_plugin.read_next_timestep = read_gro_timestep;
-  gro_plugin.close_file_read = close_gro_read;
-  gro_plugin.open_file_write = open_gro_write;
-  gro_plugin.write_structure = write_gro_structure;
-  gro_plugin.write_timestep = write_gro_timestep;
-  gro_plugin.close_file_write = close_gro_write;
-  gro_plugin.read_molecule_metadata = read_gro_molecule_metadata;
-
-  // G96 plugin init
-  memset(&g96_plugin, 0, sizeof(molfile_plugin_t));
-  g96_plugin.abiversion = vmdplugin_ABIVERSION;
-  g96_plugin.type = MOLFILE_PLUGIN_TYPE;
-  g96_plugin.name = "g96";
-  g96_plugin.prettyname = "Gromacs g96";
-  g96_plugin.author = "David Norris, Justin Gullingsrud";
-  g96_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  g96_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  g96_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  g96_plugin.filename_extension = "g96";
-  g96_plugin.open_file_read = open_g96_read;
-  g96_plugin.read_structure = read_g96_structure;
-  g96_plugin.read_next_timestep = read_g96_timestep;
-  g96_plugin.close_file_read = close_g96_read;
-
-  // TRR plugin
-  memset(&trr_plugin, 0, sizeof(molfile_plugin_t));
-  trr_plugin.abiversion = vmdplugin_ABIVERSION;
-  trr_plugin.type = MOLFILE_PLUGIN_TYPE;
-  trr_plugin.name = "trr";
-  trr_plugin.prettyname = "Gromacs TRR Trajectory";
-  trr_plugin.author = "David Norris, Justin Gullingsrud, Axel Kohlmeyer";
-  trr_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  trr_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  trr_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  trr_plugin.filename_extension = "trr";
-  trr_plugin.open_file_read = open_trr_read;
-  trr_plugin.read_next_timestep = read_trr_timestep;
-  trr_plugin.close_file_read = close_trr_read;
-  trr_plugin.open_file_write = open_trr_write;
-  trr_plugin.write_timestep = write_trr_timestep;
-  trr_plugin.close_file_write = close_trr_write;
-
-  // XTC plugin 
-  memset(&xtc_plugin, 0, sizeof(molfile_plugin_t));
-  xtc_plugin.abiversion = vmdplugin_ABIVERSION;
-  xtc_plugin.type = MOLFILE_PLUGIN_TYPE;
-  xtc_plugin.name = "xtc";
-  xtc_plugin.prettyname = "Gromacs XTC Compressed Trajectory";
-  xtc_plugin.author = "David Norris, Justin Gullingsrud";
-  xtc_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  xtc_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  xtc_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  xtc_plugin.filename_extension = "xtc";
-  xtc_plugin.open_file_read = open_trr_read;
-  xtc_plugin.read_next_timestep = read_trr_timestep;
-  xtc_plugin.close_file_read = close_trr_read;
-
-  // TRJ plugin
-  memset(&trj_plugin, 0, sizeof(molfile_plugin_t));
-  trj_plugin.abiversion = vmdplugin_ABIVERSION;
-  trj_plugin.type = MOLFILE_PLUGIN_TYPE;
-  trj_plugin.name = "trj";
-  trj_plugin.prettyname = "Gromacs TRJ Trajectory";
-  trj_plugin.author = "David Norris, Justin Gullingsrud";
-  trj_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  trj_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  trj_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  trj_plugin.filename_extension = "trj";
-  trj_plugin.open_file_read = open_trr_read;
-  trj_plugin.read_next_timestep = read_trr_timestep;
-  trj_plugin.close_file_read = close_trr_read;
-
-  return 0;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&gro_plugin);
-  (*cb)(v, (vmdplugin_t *)&g96_plugin);
-  (*cb)(v, (vmdplugin_t *)&trr_plugin);
-  (*cb)(v, (vmdplugin_t *)&trj_plugin);
-  (*cb)(v, (vmdplugin_t *)&xtc_plugin);
-  return 0;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return 0;
-}
-
-
-#ifdef TEST_G96_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-
-  molfile_timestep_t timestep;
-  void *v;
-  int i;
-
-  if (argc < 2) return 1;
-  while (--argc) {
-    ++argv;
-    v = open_g96_read(*argv, "g96", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_g96_read failed for file %s\n", *argv);
-      return 1;
-    }
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    i = 0;
-    while(!read_g96_timestep(v, natoms, &timestep)) {
-      ++i;
-    }
-    fprintf(stderr, "ended read_g96_timestep on step %d\n", i);
-    free(timestep.coords);
-    close_g96_read(v);
-  }
-  return 0;
-}
-
-#endif
-
-#ifdef TEST_TRR_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-
-  molfile_timestep_t timestep;
-  void *v, *w;
-  int i;
-
-  if (argc != 3) return 1;
-  v = open_trr_read(argv[1], "trr", &natoms);
-  if (!v) {
-    fprintf(stderr, "open_trr_read failed for file %s\n", argv[1]);
-    return 1;
-  }
-  timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-  w = open_trr_write(argv[2], "trr", natoms);
-  if (!w) {
-    fprintf(stderr, "open_trr_write failed for file %s\n", argv[2]);
-    return 1;
-  }
-
-  i = 0;
-  while(!read_trr_timestep(v, natoms, &timestep)) {
-    ++i;
-    if (write_trr_timestep(w, &timestep)) {
-      fprintf(stderr, "write error\n");
-      return 1;
-    }
-  }
-
-  fprintf(stderr, "ended read_trr_timestep on step %d\n", i);
-  free(timestep.coords);
-  close_trr_read(v);
-  close_trr_write(w);
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hash.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hash.c
deleted file mode 100644
index 03584fa00addcc31049d2ca4f329dcf8c6129848..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hash.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: hash.c,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for strings, contributed by John Stone,
- *   derived from his ray tracer code.
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "hash.h"
-
-#define HASH_LIMIT 0.5
-
-/** hash table node data structure */
-typedef struct hash_node_t {
-  int data;                           /* data in hash node */
-  const char * key;                   /* key for hash lookup */
-  struct hash_node_t *next;           /* next node in hash chain */
-} hash_node_t;
-
-/*
- *  hash() - Hash function returns a hash number for a given key.
- *
- *  tptr: Pointer to a hash table
- *  key: The key to create a hash number for
- */
-static int hash(const hash_t *tptr, const char *key) {
-  int i=0;
-  int hashvalue;
- 
-  while (*key != '\0')
-    i=(i<<3)+(*key++ - '0');
- 
-  hashvalue = (((i*1103515249)>>tptr->downshift) & tptr->mask);
-  if (hashvalue < 0) {
-    hashvalue = 0;
-  }    
-
-  return hashvalue;
-}
-
-/*
- *  hash_init() - Initialize a new hash table.
- *
- *  tptr: Pointer to the hash table to initialize
- *  buckets: The number of initial buckets to create
- */
-VMDEXTERNSTATIC void hash_init(hash_t *tptr, int buckets) {
-
-  /* make sure we allocate something */
-  if (buckets==0)
-    buckets=16;
-
-  /* initialize the table */
-  tptr->entries=0;
-  tptr->size=2;
-  tptr->mask=1;
-  tptr->downshift=29;
-
-  /* ensure buckets is a power of 2 */
-  while (tptr->size<buckets) {
-    tptr->size<<=1;
-    tptr->mask=(tptr->mask<<1)+1;
-    tptr->downshift--;
-  } /* while */
-
-  /* allocate memory for table */
-  tptr->bucket=(hash_node_t **) calloc(tptr->size, sizeof(hash_node_t *));
-
-  return;
-}
-
-/*
- *  rebuild_table() - Create new hash table when old one fills up.
- *
- *  tptr: Pointer to a hash table
- */
-static void rebuild_table(hash_t *tptr) {
-  hash_node_t **old_bucket, *old_hash, *tmp;
-  int old_size, h, i;
-
-  old_bucket=tptr->bucket;
-  old_size=tptr->size;
-
-  /* create a new table and rehash old buckets */
-  hash_init(tptr, old_size<<1);
-  for (i=0; i<old_size; i++) {
-    old_hash=old_bucket[i];
-    while(old_hash) {
-      tmp=old_hash;
-      old_hash=old_hash->next;
-      h=hash(tptr, tmp->key);
-      tmp->next=tptr->bucket[h];
-      tptr->bucket[h]=tmp;
-      tptr->entries++;
-    } /* while */
-  } /* for */
-
-  /* free memory used by old table */
-  free(old_bucket);
-
-  return;
-}
-
-/*
- *  hash_lookup() - Lookup an entry in the hash table and return a pointer to
- *    it or HASH_FAIL if it wasn't found.
- *
- *  tptr: Pointer to the hash table
- *  key: The key to lookup
- */
-VMDEXTERNSTATIC int hash_lookup(const hash_t *tptr, const char *key) {
-  int h;
-  hash_node_t *node;
-
-
-  /* find the entry in the hash table */
-  h=hash(tptr, key);
-  for (node=tptr->bucket[h]; node!=NULL; node=node->next) {
-    if (!strcmp(node->key, key))
-      break;
-  }
-
-  /* return the entry if it exists, or HASH_FAIL */
-  return(node ? node->data : HASH_FAIL);
-}
-
-/*
- *  hash_insert() - Insert an entry into the hash table.  If the entry already
- *  exists return a pointer to it, otherwise return HASH_FAIL.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to insert into the hash table
- *  data: A pointer to the data to insert into the hash table
- */
-VMDEXTERNSTATIC int hash_insert(hash_t *tptr, const char *key, int data) {
-  int tmp;
-  hash_node_t *node;
-  int h;
-
-  /* check to see if the entry exists */
-  if ((tmp=hash_lookup(tptr, key)) != HASH_FAIL)
-    return(tmp);
-
-  /* expand the table if needed */
-  while (tptr->entries>=HASH_LIMIT*tptr->size)
-    rebuild_table(tptr);
-
-  /* insert the new entry */
-  h=hash(tptr, key);
-  node=(struct hash_node_t *) malloc(sizeof(hash_node_t));
-  node->data=data;
-  node->key=key;
-  node->next=tptr->bucket[h];
-  tptr->bucket[h]=node;
-  tptr->entries++;
-
-  return HASH_FAIL;
-}
-
-/*
- *  hash_delete() - Remove an entry from a hash table and return a pointer
- *  to its data or HASH_FAIL if it wasn't found.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to remove from the hash table
- */
-VMDEXTERNSTATIC int hash_delete(hash_t *tptr, const char *key) {
-  hash_node_t *node, *last;
-  int data;
-  int h;
-
-  /* find the node to remove */
-  h=hash(tptr, key);
-  for (node=tptr->bucket[h]; node; node=node->next) {
-    if (!strcmp(node->key, key))
-      break;
-  }
-
-  /* Didn't find anything, return HASH_FAIL */
-  if (node==NULL)
-    return HASH_FAIL;
-
-  /* if node is at head of bucket, we have it easy */
-  if (node==tptr->bucket[h])
-    tptr->bucket[h]=node->next;
-  else {
-    /* find the node before the node we want to remove */
-    for (last=tptr->bucket[h]; last && last->next; last=last->next) {
-      if (last->next==node)
-        break;
-    }
-    last->next=node->next;
-  }
-
-  /* free memory and return the data */
-  data=node->data;
-  free(node);
-
-  return(data);
-}
-
-
-/*
- * inthash_entries() - return the number of hash table entries.
- *
- */
-VMDEXTERNSTATIC int hash_entries(hash_t *tptr) {
-  return tptr->entries;
-}
-
-
-
-
-/*
- * hash_destroy() - Delete the entire table, and all remaining entries.
- * 
- */
-VMDEXTERNSTATIC void hash_destroy(hash_t *tptr) {
-  hash_node_t *node, *last;
-  int i;
-
-  for (i=0; i<tptr->size; i++) {
-    node = tptr->bucket[i];
-    while (node != NULL) { 
-      last = node;   
-      node = node->next;
-      free(last);
-    }
-  }     
-
-  /* free the entire array of buckets */
-  if (tptr->bucket != NULL) {
-    free(tptr->bucket);
-    memset(tptr, 0, sizeof(hash_t));
-  }
-}
-
-/*
- *  alos() - Find the average length of search.
- *
- *  tptr: Pointer to a hash table
- */
-static float alos(hash_t *tptr) {
-  int i,j;
-  float alos=0;
-  hash_node_t *node;
-
-
-  for (i=0; i<tptr->size; i++) {
-    for (node=tptr->bucket[i], j=0; node!=NULL; node=node->next, j++);
-    if (j)
-      alos+=((j*(j+1))>>1);
-  } /* for */
-
-  return(tptr->entries ? alos/tptr->entries : 0);
-}
-
-
-/*
- *  hash_stats() - Return a string with stats about a hash table.
- *
- *  tptr: A pointer to the hash table
- */
-VMDEXTERNSTATIC char * hash_stats(hash_t *tptr) {
-  static char buf[1024];
-
-  sprintf(buf, "%u slots, %u entries, and %1.2f ALOS",
-    (int)tptr->size, (int)tptr->entries, alos(tptr));
-
-  return(buf);
-}
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hash.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hash.h
deleted file mode 100644
index 49a9e69b34f783e214749dbc12f6f211a8ef3abc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hash.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: hash.h,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for strings, contributed by John Stone,
- *   derived from his ray tracer code.
- ***************************************************************************/
-#ifndef HASH_H
-#define HASH_H
-
-/** hash table top level data structure */
-typedef struct hash_t {
-  struct hash_node_t **bucket;      /* array of hash nodes */
-  int size;                         /* size of the array */
-  int entries;                      /* number of entries in table */
-  int downshift;                    /* shift count, used in hash function */
-  int mask;                         /* used to select bits for hashing */
-} hash_t;
-
-#define HASH_FAIL -1
-
-#if defined(VMDPLUGIN_STATIC)
-#define VMDEXTERNSTATIC static
-#include "hash.c"
-#else
-
-#define VMDEXTERNSTATIC 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** initialize hash table for first use */
-void hash_init(hash_t *, int);
-
-/** lookup a string key in the hash table returning its integer key */
-int hash_lookup (const hash_t *, const char *);
-
-/** insert a string into the hash table, along with an integer key */
-int hash_insert (hash_t *, const char *, int);
-
-/** delete an string from the hash table, given its string name */
-int hash_delete (hash_t *, const char *);
-
-/** return the number of entries in the has table */
-int hash_entries(hash_t *);
-
-/** destroy the hash table completely, deallocate memory */
-void hash_destroy(hash_t *);
-
-/** print hash table vital stats */
-char *hash_stats (hash_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hoomdplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hoomdplugin.c
deleted file mode 100644
index c492a76b24c86ca6883a824a540d407b772825c4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/hoomdplugin.c
+++ /dev/null
@@ -1,2504 +0,0 @@
-/***************************************************************************
- *
- * HOOMD and HOOMD-blue style XML format data/topology file reader and writer
- *
- * Copyright (c) 2009 Axel Kohlmeyer <akohlmey@gmail.com>
- *
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: hoomdplugin.c,v $
- *      $Author: akohlmey $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2011/12/06 04:57:12 $
- *
- ***************************************************************************/
-
-/*
- * HOOMD-blue xml topology/trajectory file format:
- *
- * http://codeblue.umich.edu/hoomd-blue/doc/page_xml_file_format.html
- *
- * NOTES: 
- * - all XML elements are converted to lowercase before parsing, so case 
- *   will be ignored on reading. on writing only lowercase will be written.
- * - attributes are in general optional, but it is recommended to provide 
- *   them all. the plugin will print an informational message if it inserts 
- *   a missing attribute with a default value and a warning message if it 
- *   encounters a yet unknown attribute.
- * - units attributes are deprecated and always ignored.
- * - the angle, dihedral, improper nodes are only supported for 
- *   version 1.1 files. in files with no version attribute to hoomd_xml 
- *   or version 1.0 those nodes will be ignored.
- * - accelerations nodes appear in version 1.2. The molfile API
- *   has no method to pass them on, so they are currently ignored.
- * - charge nodes are only supported for version 1.3 and later files. 
- *   in files with no version attribute to hoomd_xml, version 1.0,
- *   or version 1.2, those nodes will be ignored.
- * - body nodes are supported starting with version 1.4. The body 
- *   value is mapped to the "resid" field in molfile.
- * - as of version 1.4 also the "vizsigma" attribute to the 
- *   configuration node is honored. It provides a scaling factor
- *   for the radius of particles and can be overridded by the 
- *   VMDHOOMDSIGMA environment variable. Both are ignored, however,
- *   if a diameter node is present.
- *
- ***************************************************
-
-<?xml version ="1.0" encoding ="UTF-8" ?>
-<hoomd_xml version="1.4">
-  <!-- comments -->
-  <configuration time_step="0" dimensions="3" vizsigma="0.5" ntypes="2">
-    <box  lx="49.914" ly= "49.914" lz="49.914" />
-    <position>
-      3.943529 4.884501 12.317140
-      3.985539 5.450660 13.107670
-      3.521055 6.212838 13.516340
-    </position>
-    <type num="6">
-      CT
-      CM
-      BB
-      TRP
-      LEU
-      WS
-    </type>
-    <bond num="10">
-      CT-CM 0 1
-      CM-CT 1 2
-      BB-TRP 3 4
-      BB-BB  3 5
-      BB-LEU 5 6
-      BB-BB  5 7
-      BB-TRP 7 8
-      BB-BB  7 9
-      BB-LEU 9 10
-      BB-BB  9 3
-    </bond>
-    <angle num="9">
-      CT-CM-CT   0  1  2
-      BB-BB-TRP  9  3  4
-      BB-BB-TRP  5  3  4
-      BB-BB-LEU  3  5  6
-      BB-BB-BB   3  5  7
-      BB-BB-TRP  5  7  8
-      BB-BB-BB   5  7  9
-      BB-BB-LEU  7  9 10
-      BB-BB-BB   7  9  3
-    </angle>
-    <diameter num="3">
-      1.0 1.0 2.0
-    </diameter>
-    <mass num="3">
-      1.0 1.0 2.0
-    </mass>
-    <charge num="3">
-      -1.0 -1.0 2.0
-    </charge>
-    <body num="3">
-      -1 0 0
-    </charge>
-    <wall>
-      <coord ox="1.0" oy="2.0" oz="3.0" nx="4.0" ny="5.0" nz="6.0"/>
-      <coord ox="7.0" oy="8.0" oz="9.0" nx="10.0" ny="11.0" nz="-12.0"/>
-    </wall>
-  </configuration>
-</hoomd>
-
-****************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#include <math.h>
-#include <errno.h>
-#include "molfile_plugin.h"
-
-#include "periodic_table.h"
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-/* XXX: it is a bit annoying to have to resolve to an external XML 
- * library for parsing. XML is messy and expat is plain c and makes
- * life much easier. perhaps a portable internal xml parser would 
- * do as well, but the one used in hoomd is in c++ and requires to 
- * the the whole file into memory as one gian string. :-( */
-#include <expat.h>
-
-/*! hoomd file format version that this plugin supports.
- *  it will refuse to load file formats with higher major
- *  version and print a warning on higher minor version.
- *  written files will be in exactly this version.
- */
-#define HOOMD_FORMAT_MAJV 1
-#define HOOMD_FORMAT_MINV 4
-
-#define SMALL    1.0e-7f        /*! arbitrary small number. "almost zero"  */
-
-/* numeric and symbolic representations of the supported xml nodes */
-#define HOOMD_NONE      0       /**< undefined            */
-#define HOOMD_XML       1       /**< toplevel tag         */
-#define HOOMD_CONFIG    2       /**< timestep tag         */
-#define HOOMD_BOX       3       /**< box dimensions tag   */
-#define HOOMD_POS       4       /**< coordinates tag      */
-#define HOOMD_IMAGE     5       /**< image counter tag    */
-#define HOOMD_VEL       6       /**< velocities tag       */
-#define HOOMD_TYPE      7       /**< atom type tag        */
-#define HOOMD_BODY      8       /**< body number tag      */
-#define HOOMD_MASS      9       /**< atom mass tag        */
-#define HOOMD_CHARGE   10       /**< atom diameter tag    */
-#define HOOMD_DIAMETER 11       /**< atom diameter tag    */
-#define HOOMD_BOND     12       /**< bond section tag     */
-#define HOOMD_ANGLE    13       /**< angle section tag    */
-#define HOOMD_DIHEDRAL 14       /**< dihedral section tag */
-#define HOOMD_IMPROPER 15       /**< improper section tag */
-#define HOOMD_WALL     16       /**< wall description     */
-#define HOOMD_COORD    17       /**< wall coordinate tag  */
-#define HOOMD_ACCEL    18       /**< accelerations tag    */
-#define HOOMD_ORIENT   19       /**< orientation tag      */
-#define HOOMD_UNKNOWN  20       /**< unknown tag          */
-#define HOOMD_NUMTAGS  21       /**< number of known tags */
-
-/* This list has to stay consistend with the defines above */
-static const char *hoomd_tag_name[HOOMD_NUMTAGS] = {
-  "(none)", "hoomd_xml", "configuration", "box", /*  0 -  3 */
-  "position", "image", "velocity",               /*  4 -  6 */
-  "type", "body", "mass", "charge", "diameter",  /*  7 - 11 */
-  "bond", "angle", "dihedral", "improper",       /* 12 - 15 */
-  "wall", "coord", "acceleration", "orientation",/* 16 - 19 */
-  "(error)"                                      /* 20 -    */
-};
-
-/*! maximum XML element nesting level supported */
-#define HOOMD_MAXDEPTH 5
-
-typedef struct {
-  FILE *fp;
-  XML_Parser p;
-  void *buffer;
-  int parsedepth;
-  int parse_error;
-  int currtag[HOOMD_MAXDEPTH+1];
-  int counter;
-  int majv, minv;
-  int optflags;
-  int numframe;
-  int doneframe;
-  int numdims;
-  int numatoms;
-  int numtypes;
-  int numbonds;
-  int numangles;
-  int numdihedrals;
-  int numimpropers;
-  int numbondtypes;
-  int numangletypes;
-  int numdihedraltypes;
-  int numimpropertypes;
-  int *from;
-  int *to;
-  int *bondtype;
-  int *angle;
-  int *dihedral;
-  int *improper;
-  int *angletype;
-  int *dihedraltype;
-  int *impropertype;
-  char **bondtypename;
-  char **angletypename;
-  char **dihedraltypename;
-  char **impropertypename;
-  char *filename;
-  float mysigma;
-  int *imagecounts;
-  molfile_atom_t *atomlist;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-  molfile_timestep_t ts;
-} hoomd_data_t;
-
-/* forward declaration */
-static molfile_plugin_t plugin;
-
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifndef HOOMD_DEBUG
-#define HOOMD_DEBUG 0
-#endif
-#if HOOMD_DEBUG
-#define PRINTERR vmdcon_printf(VMDCON_ERROR,                            \
-                               "\n In file %s, line %d: \n %s \n \n",   \
-                               __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/* make sure pointers are NULLed after free(3)ing them. */
-#define SAFE_FREE(ptr) free(ptr); ptr=NULL
-/* calloc with test of success */
-#define SAFE_CALLOC(ptr,type,count)       \
-ptr = (type *)calloc(count,sizeof(type)); \
-  if (ptr == NULL) {                      \
-                                          \
-    PRINTERR;                             \
-    return MOLFILE_ERROR;                 \
-  }
-
-/*! convert string to upper case */
-static void make_lower(char *s) 
-{
-  while (*s) {
-    *s = tolower(*s);
-    ++s;
-  }
-}
-
-/*! find string in a NULL terminated list of strings.
- * grow storage and append if needed. return the index. */
-static int addstring(char ***list, const char *key) 
-{
-  int i=0;
-  char **p = *list;
-
-  for (; p[i] != NULL;) {
-    if (strcmp(p[i], key) == 0)
-      return i;
-    ++i;
-  }
-  
-  *list        = realloc(*list, (i+2)*sizeof(char *));
-  (*list)[i]   = strdup(key);
-  (*list)[i+1] = NULL;
-  
-  return i;
-}
-
-
-/*! copy attribute/value pairs and convert to lowercase */
-#define XML_ATTR_COPY(a,n,k,v)                          \
-  strncpy(k, a[n],   sizeof(k)-1); make_lower(k);       \
-  strncpy(v, a[n+1], sizeof(v)-1); make_lower(value)
-
-/*! warning about unknown attribute */
-#define XML_UNK_ATTR(e,k,v)                                         \
-  vmdcon_printf(VMDCON_WARN, "hoomdplugin) ignoring unknown "       \
-                " attribute %s='%s' for element %s\n", k, v, e);
-
-
-/*! element handler for XML file format. 
- * this function is called whenever a new XML element is encountered.
- * this is a companion function to xml_end_tag(). We have to record
- * the nesting level of XML elements, so that we can we can return to
- * the previous element's state. hoomd doesn't use this property yet,
- * but may do so in the future.
- *
- * @param data  data structure with information on this file.
- * @param elmt  name of the XML element
- * @param attr  list of attributes and their values as strings.
- *              the order is attr1, val1, attr2, val2, ... 
- */
-static void xml_new_tag(void *data, 
-                        const XML_Char *elmt, 
-                        const XML_Char **attr)
-{
-  int i, mytag;
-  hoomd_data_t *d=data;
-  char element[MOLFILE_BUFSIZ];
-  char key[MOLFILE_BUFSIZ];
-  char value[MOLFILE_BUFSIZ];
-  
-
-  if (d == NULL) return;
-
-  d->parsedepth ++;
-
-#if HOOMD_DEBUG
-  for (i=0; i < d->parsedepth; ++i) {
-    printf(">");
-  }
-  printf("%s",elmt);
-  for (i=0;attr[i]; i+=2) {
-    printf(" %s='%s'",attr[i],attr[i+1]);
-  }
-  printf("\n");
-#endif
-
-  strncpy(element, elmt, sizeof(element)-1);
-  make_lower(element);
-
-  /* convert text mode tags to numbers and parse attributes. */
-  mytag = HOOMD_UNKNOWN;
-  for (i=0; i < HOOMD_NUMTAGS; ++i) {
-    if (strcmp(elmt, hoomd_tag_name[i]) == 0) {
-      mytag = i;
-      break;
-    }
-  }
-  d->currtag[d->parsedepth] = mytag;
-  d->counter = 0;
-   
-  switch (mytag) {
-
-    case HOOMD_XML:             /* root node */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if(strcmp(key,"version") == 0) {
-          d->majv = atoi(strtok(value, "."));
-          d->minv = atoi(strtok(NULL,  "."));
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      if (d->majv < 0) {
-        vmdcon_printf(VMDCON_INFO, "hoomdplugin) No version attribute found "
-                      "on <%s> element assuming version=\"1.0\"\n", 
-                      hoomd_tag_name[HOOMD_XML] );
-        d->majv = 1;
-        d->minv = 0;
-      }
-      break;
-
-    case HOOMD_CONFIG:          /* new frame */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if(strcmp(key,"time_step") == 0) {
-#if vmdplugin_ABIVERSION > 10
-          d->ts.physical_time = atof(value);
-#else 
-          ;
-#endif
-        } else if(strcmp(key,"natoms") == 0) {
-          d->numatoms = atoi(value);
-        } else if(strcmp(key,"ntypes") == 0) {
-          d->numtypes = atoi(value);
-        } else if(strcmp(key,"dimensions") == 0) {
-          if (d->majv == 1 && d->minv < 2) {
-            vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found dimensions "
-                          "attribute in a pre-1.2 version format file. "
-                          "Ignoring it...\n");
-          } else {
-            d->numdims = atoi(value);
-          }
-        } else if(strcmp(key,"vizsigma") == 0) {
-          if (d->majv == 1 && d->minv < 4) {
-            vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found vizsigma "
-                          "attribute in a pre-1.4 version format file. "
-                          "Ignoring it...\n");
-          } else {
-            d->mysigma = atof(value);
-          }
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_BOX:             /* new box dimensions */
-      /* hoomd only supports orthogonal boxes at the moment */
-      d->ts.A     = d->ts.B    = d->ts.C     = 0.0f;
-      d->ts.alpha = d->ts.beta = d->ts.gamma = 90.0f;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-        } else if(strcmp(key,"lx") == 0) {
-          d->ts.A = atof(value);
-        } else if(strcmp(key,"ly") == 0) {
-          d->ts.B = atof(value);
-        } else if(strcmp(key,"lz") == 0) {
-          d->ts.C = atof(value);
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-      case HOOMD_POS:             /* coordinates */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          if (d->numatoms < 1) {
-            d->numatoms = atoi(value); /* number of positions. */
-          }
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_VEL:             /* velocities */
-#if vmdplugin_ABIVERSION > 10
-      d->ts_meta.has_velocities = 1;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key, "units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          ;                     /* XXX: number of velocities. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-#endif
-      break;
-
-    case HOOMD_BODY:            /* body/resid tag */
-      if (d->majv == 1 && d->minv < 4) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                      "a pre-1.4 version format file. Ignoring it...\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-          if (strcmp(key,"num") == 0) {
-            ;                     /* XXX: number of body tags. use for check. */
-          } else {
-            XML_UNK_ATTR(element, key, value);
-          }
-        }
-      }
-      break;
-
-    case HOOMD_MASS:            /* atom mass */
-      d->optflags |= MOLFILE_MASS;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          ;                     /* XXX: number of masses. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_CHARGE:          /* atom charge */
-      if (d->majv == 1 && d->minv < 3) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found charge "
-                          "section in a pre-1.3 version format file. "
-                          "Ignoring it...\n");
-      } else {
-        d->optflags |= MOLFILE_CHARGE;
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-          if (strcmp(key,"units") == 0) {
-            ;                     /* ignore */
-          } else if (strcmp(key,"num") == 0) {
-            ;                     /* XXX: number of masses. use for check. */
-          } else {
-            XML_UNK_ATTR(element, key, value);
-          }
-        }
-      }
-      break;
-
-    case HOOMD_DIAMETER:          /* particle diameter */
-      d->optflags |= MOLFILE_RADIUS;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          ;                     /* XXX: number of diameters. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_IMAGE:           /* fallthrough */
-    case HOOMD_TYPE:            /* fallthrough */
-    case HOOMD_BOND:
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"num") == 0) {
-          ;                 /* XXX: number of atom types. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    /* angle type definitions */
-    case HOOMD_ANGLE:           /* fallthrough */
-    case HOOMD_DIHEDRAL:        /* fallthrough */
-    case HOOMD_IMPROPER:
-      if (d->majv == 1 && d->minv < 1) {
-        if ( ((mytag == HOOMD_ANGLE) && (d->numangles < -1)) ||
-             ((mytag == HOOMD_DIHEDRAL) && (d->numdihedrals < -1)) ||
-             ((mytag == HOOMD_IMPROPER) && (d->numimpropers < -1)) ) {
-          vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                        "a pre-1.1 version format file. Ignoring it...\n",
-                        hoomd_tag_name[mytag]);
-        } else {
-          for (i=0; attr[i]; i+=2) {
-            XML_ATTR_COPY(attr, i, key, value);
-            if (strcmp(key,"num") == 0) {
-              ;                 /* XXX: number of angles. use for check. */
-            } else {
-              XML_UNK_ATTR(element, key, value);
-            }
-          }
-        }
-      }
-      break;
-
-    case HOOMD_WALL:            /* wall section */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        XML_UNK_ATTR(element, key, value);
-      }
-      break;
-
-    case HOOMD_COORD:           /* wall coordinate */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                       /* ignore */
-        } else if(strcmp(key,"ox") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"oy") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"oz") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"nx") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"ny") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"nz") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_ACCEL:
-      if (d->majv == 1 && d->minv < 2) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                        "a pre-1.2 version format file. Ignoring it...\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-            if (strcmp(key,"num") == 0) {
-              ;                 /* XXX: number of accelerations. use for check. */
-            } else {
-              XML_UNK_ATTR(element, key, value);
-            }
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_ORIENT:            /* orientation tag */
-      if (d->majv == 1 && d->minv < 4) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                      "a pre-1.4 version format file. Ignoring it...\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-          if (strcmp(key,"num") == 0) {
-            ;                     /* XXX: number of orientation tags. use for check. */
-          } else {
-            XML_UNK_ATTR(element, key, value);
-          }
-        }
-      }
-      break;
-
-    default:
-      d->currtag[d->parsedepth] = HOOMD_UNKNOWN;
-      vmdcon_printf(VMDCON_WARN, "hoomdplugin) Ignoring unknown XML "
-                    "element: %s.\n", element);
-      break;
-  }
-}
-
-/*! end of element handler for xml document. */
-static void xml_end_tag(void *data, const XML_Char *elmt)
-{
-  hoomd_data_t *d=data;
-  int mytag;
-
-  if (d == NULL) return;
-
-  mytag = d->currtag[d->parsedepth];
-  switch (mytag) {
-
-    case HOOMD_CONFIG:
-      d->doneframe=1;
-      break;
-
-    case HOOMD_TYPE:
-      /* store number of atoms the first time we read this section and
-       * if it has not yet been passed on at the <configuration> tag.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to parse this more than once. */
-      if (d->numatoms < 0) {    
-        d->numatoms = d->counter;
-      }
-      break;
-
-    case HOOMD_XML:             /* fallthrough. */
-    case HOOMD_BOX:             /* fallthrough. */
-    case HOOMD_IMAGE:           /* fallthrough. */
-    case HOOMD_WALL:            /* fallthrough. */
-    case HOOMD_COORD:           /* fallthrough. */
-    case HOOMD_ACCEL:           /* fallthrough. */
-    case HOOMD_ORIENT:          /* fallthrough. */
-      ;                         /* nothing to do */
-      break;
-
-    case HOOMD_POS:
-      /* assign the number of atoms if it has not been done before */
-      if ( (d->counter > 0) && (d->numatoms < 0) ) {
-        d->numatoms = d->counter/3;
-      }                         /* fallthrough */
-      
-    case HOOMD_VEL:
-      if ( (d->counter > 0) && (d->numatoms > 0) && (d->counter != (3*d->numatoms)) ) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Inconsistent %s data. Expected %d, but "
-                      "got %d items.\n", hoomd_tag_name[mytag], 3*d->numatoms, d->counter);
-        d->parse_error = 1;
-      }
-      break;
-
-    case HOOMD_MASS:            /* fallthrough. */
-    case HOOMD_CHARGE:          /* fallthrough. */
-    case HOOMD_BODY:            /* fallthrough. */
-    case HOOMD_DIAMETER:
-      if ( (d->counter > 0) && (d->numatoms > 0) && (d->counter != d->numatoms) )  {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Inconsistent %s data. Expected %d, but "
-                      "got %d items.\n", hoomd_tag_name[mytag], d->numatoms, d->counter);
-        d->parse_error = 1;
-      }
-      
-      break;
-
-    case HOOMD_BOND:
-      /* store number of bonds the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numbonds < 0) {
-        d->numbonds = d->counter/3; /* three 'words' per bond */
-      }
-      break;
-
-    case HOOMD_ANGLE:
-      /* store number of angles the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numangles < 0) {
-        if (d->majv == 1 && d->minv > 0) { /* angle only valid from version 1.1 on */
-          d->numangles = d->counter/4;    /* four 'words' per angle */
-        } else {
-          d->numangles = 0;
-        }
-      }
-      break;
-
-    case HOOMD_DIHEDRAL:
-      /* store number of dihedrals the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numdihedrals < 0) {
-        if (d->majv == 1 && d->minv > 0) { /* dihedral only valid from version 1.1 on */
-          d->numdihedrals = d->counter/5;    /* four 'words' per dihedral */
-        } else {
-          d->numdihedrals = 0;
-        }
-      }
-      break;
-
-    case HOOMD_IMPROPER:
-      /* store number of impropers the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numimpropers < 0) {
-        if (d->majv == 1 && d->minv > 0) { /* improper only valid from version 1.1 on */
-          d->numimpropers = d->counter/5;    /* four 'words' per improper */
-        } else {
-          d->numimpropers = 0;
-        }
-      }
-      break;
-
-    default: 
-      if (mytag < HOOMD_NUMTAGS) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) No end handler for HOOMD tag '%s'.\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Unknown HOOMD tag id: '%d'.\n", mytag);
-      }
-      
-      break;
-  }
-
-  d->currtag[d->parsedepth] = HOOMD_NONE;
-  d->parsedepth--;
-  d->counter=0;
-#if HOOMD_DEBUG
-  printf("end of tag %s. parsedepth=%d\n",elmt,d->parsedepth);
-#endif
-}
-
-/*! content data handler for xml document */
-static void xml_data_block(void *data, const XML_Char *s, int len) 
-{
-  hoomd_data_t *d =NULL; 
-  int i,lmax, mytag;
-
-  d = (hoomd_data_t *)data;
-  if (d == NULL) return;          /* XXX: bug in program */
-  if (d->parsedepth < 1) return;  /* not yet within XML block */
-  if (d->parsedepth > HOOMD_MAXDEPTH) return;  /* too much nesting */
-  if (len < 1) return;
-
-  mytag = d->currtag[d->parsedepth];
-  switch (mytag) {
-    
-    case HOOMD_TYPE:
-
-      /* count the number of atoms by counting the types */
-      if (d->numatoms < 0) {
-        char buffer[1024];
-        char *p;
-        lmax=1023;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      } else { 
-        /* assign atom types the second time we parse the first frame */
-        if (d->numframe < 2) {
-          char buffer[1024];
-          char *p;
-          molfile_atom_t *atom;
-          
-          if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-          lmax=1023;
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            atom=d->atomlist + d->counter;
-            if (atom == NULL) return;
-
-            strncpy(atom->name, p, sizeof(atom->name));
-            strncpy(atom->type, p, sizeof(atom->type));
-            atom->atomicnumber = get_pte_idx(atom->type);
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_BOND:
-      /* count the number of bonds by counting the types */
-      if ((d->numbonds < 0) || (d->numframe < 2)) {
-        char buffer[1024];
-        char *p;
-        int idx, num, n;
-        lmax=1023;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          num = d->counter / 3;
-          if (d->numbonds > 0) {
-            i=d->counter % 3;
-            if (i == 0) {
-              n = d->numbondtypes;
-              idx=addstring(&(d->bondtypename), p);
-              if (idx < 0)
-                d->parse_error = 1;
-              if (idx >= n)
-                d->numbondtypes=idx+1;
-              d->bondtype[num] = idx;
-
-              /* CAVEAT: atom indices start at 1 here. psf style. XXX */
-            } else if (i == 1) { 
-              d->from[num] = atoi(p) + 1;
-            } else if (i == 2) {
-              d->to[num] = atoi(p) + 1;
-            }
-          }
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_ANGLE:
-      if (d->majv == 1 && d->minv > 0) {  /* angle is only valid from version 1.1 on */
-        /* count the number of angles by counting the types */
-        if ((d->numangles < 0) || (d->numframe < 2)) {
-          char buffer[1024];
-          char *p;
-          int idx, num, n;
-          lmax=1023;
-        
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            num = d->counter / 4;
-            if (d->numangles > 0) {
-              i=d->counter % 4;
-              if (i == 0) {
-                n = d->numangletypes;
-                idx=addstring(&(d->angletypename), p);
-                if (idx < 0)
-                  d->parse_error = 1;
-                if (idx >= n)
-                  d->numangletypes=idx+1;
-                d->angletype[num] = idx;
-
-                /* CAVEAT: atom indices have to start at 1 here. psf style. XXX */
-              } else if (i == 1) { 
-                d->angle[3*num  ] = atoi(p) + 1;
-              } else if (i == 2) {
-                d->angle[3*num+1] = atoi(p) + 1;
-              } else if (i == 3) {
-                d->angle[3*num+2] = atoi(p) + 1;
-              }
-            }
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_DIHEDRAL:
-      if (d->majv == 1 && d->minv > 0) {  /* dihedral is only valid from version 1.1 on */
-        /* count the number of dihedrals by counting the types */
-        if ((d->numdihedrals < 0) || (d->numframe < 2)) {
-          char buffer[1024];
-          char *p;
-          int idx, num, n;
-          lmax=1023;
-        
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            num = d->counter / 5;
-            if (d->numdihedrals > 0) {
-              i=d->counter % 5;
-              if (i == 0) {
-                n = d->numdihedraltypes;
-                idx=addstring(&(d->dihedraltypename), p);
-                if (idx < 0)
-                  d->parse_error = 1;
-                if (idx >= n)
-                  d->numdihedraltypes=idx+1;
-                d->dihedraltype[num] = idx;
-
-                /* CAVEAT: atom indices start at 1 here. psf style. XXX */
-              } else if (i == 1) { 
-                d->dihedral[4*num  ] = atoi(p) + 1;
-              } else if (i == 2) {
-                d->dihedral[4*num+1] = atoi(p) + 1;
-              } else if (i == 3) {
-                d->dihedral[4*num+2] = atoi(p) + 1;
-              } else if (i == 4) {
-                d->dihedral[4*num+3] = atoi(p) + 1;
-              }
-            }
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_IMPROPER:
-      if (d->majv == 1 && d->minv > 0) {  /* improper is only valid from version 1.1 on */
-        /* count the number of impropers by counting the types */
-        if ((d->numimpropers < 0) || (d->numframe < 2)) {
-          char buffer[1024];
-          char *p;
-          int idx, num, n;
-          lmax=1023;
-        
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            num = d->counter / 5;
-            if (d->numimpropers > 0) {
-              i=d->counter % 5;
-              if (i == 0) {
-                n = d->numimpropertypes;
-                idx=addstring(&(d->impropertypename), p);
-                if (idx < 0)
-                  d->parse_error = 1;
-                if (idx >= n)
-                  d->numimpropertypes=idx+1;
-                d->impropertype[num] = idx;
-
-                /* CAVEAT: atom indices start at 1 here. psf style. XXX */
-              } else if (i == 1) { 
-                d->improper[4*num  ] = atoi(p) + 1;
-              } else if (i == 2) {
-                d->improper[4*num+1] = atoi(p) + 1;
-              } else if (i == 3) {
-                d->improper[4*num+2] = atoi(p) + 1;
-              } else if (i == 4) {
-                d->improper[4*num+3] = atoi(p) + 1;
-              }
-            }
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_DIAMETER:
-      /* set radius, from diameter block. radius = 0.5*diameter. */
-      if (d->numatoms > 0) {
-        char buffer[1024];
-        char *p;
-        molfile_atom_t *atom;
-          
-        if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-        lmax=1023;
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          atom=d->atomlist + d->counter;
-          if (atom == NULL) return;
-
-          atom->radius = 0.5 * atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_MASS:
-      /* set mass. */
-      if (d->numatoms > 0) {
-        char buffer[1024];
-        char *p;
-        molfile_atom_t *atom;
-          
-        if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-        lmax=1023;
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          atom=d->atomlist + d->counter;
-          if (atom == NULL) return;
-
-          atom->mass = atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_BODY:
-      /* set resid from <body> tag. */
-      if (d->numatoms > 0) {
-        char buffer[1024];
-        char *p;
-        molfile_atom_t *atom;
-          
-        if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-        lmax=1023;
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          atom=d->atomlist + d->counter;
-          if (atom == NULL) return;
-
-          atom->resid = atoi(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_CHARGE:
-      /* set charge. */
-      if (d->majv == 1 && d->minv > 2) {  /* charge is only valid from version 1.2 on */
-        if (d->numatoms > 0) {
-          char buffer[1024];
-          char *p;
-          molfile_atom_t *atom;
-          
-          if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-          lmax=1023;
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            atom=d->atomlist + d->counter;
-            if (atom == NULL) return;
-
-            atom->charge = atof(p);
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_POS:
-      /* only try to read coordinates. if there is storage for them. */
-      if (d->ts.coords) {
-        char buffer[1024];
-        int lmax=1023;
-        char *p;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          if (d->counter < (3 * d->numatoms))
-            d->ts.coords[d->counter] = atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-        
-      }
-      break;
-
-#if vmdplugin_ABIVERSION > 10
-    case HOOMD_VEL:
-      if ((d->numatoms > 0) && (d->ts.velocities != NULL)) {
-        char buffer[1024];
-        int lmax=1023;
-        char *p;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          if (d->counter < (3 * d->numatoms))
-            d->ts.velocities[d->counter] = atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-#endif
-      
-    case HOOMD_IMAGE:
-      if ((d->numatoms > 0) && (d->imagecounts != NULL)) {
-        char buffer[1024];
-        int lmax=1023;
-        char *p;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          d->imagecounts[d->counter] = atoi(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    default:
-      break;
-  }
-}
-
-/*! comment handler */
-static void xml_comment(void *data, const XML_Char *s)
-{
-  hoomd_data_t *d=data;
-  if (d==NULL) return;
-#if HOOMD_DEBUG
-  printf("COMMENT: %s. parsedepth=%d\n", (char *)s, d->parsedepth);
-#endif
-}
-
-/*! run the XML parser to read the next line */
-static int hoomd_parse_line(hoomd_data_t *data)
-{   
-  int done, len;
-      
-  data->buffer = XML_GetBuffer(data->p, MOLFILE_BIGBUFSIZ);
-  done = (NULL == fgets(data->buffer,MOLFILE_BIGBUFSIZ,data->fp));
-
-  if (!done) 
-    len=strlen(data->buffer);
-  else
-    len=0;
-      
-  if (ferror(data->fp)) {
-    vmdcon_printf(VMDCON_ERROR, "hoomdplugin) problem reading HOOMD"
-                  " data file '%s'\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  if (! XML_ParseBuffer(data->p, len, done)) {
-    vmdcon_printf(VMDCON_ERROR, 
-                  "hoomdplugin) XML syntax error at line %d:\n%s\n",
-                  XML_GetCurrentLineNumber(data->p),
-                  XML_ErrorString(XML_GetErrorCode(data->p)));
-    return MOLFILE_ERROR;
-  }
-      
-  if (data->parse_error > 0) {
-    vmdcon_printf(VMDCON_ERROR, 
-                  "hoomdplugin) XML data parse error at line %d.\n",
-                  XML_GetCurrentLineNumber(data->p));
-    return MOLFILE_ERROR;
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-
-
-/*! open the file and validate that it is indeed a HOOMD file.
- *  we also need to count the number of atoms, so we instead
- *  parse the whole first configuration including bonding info
- *  and so on and store it for later use. */
-  static void *open_hoomd_read(const char *filename, const char *filetype, 
-                               int *natoms) {
-    FILE *fp;
-    XML_Parser p;
-    hoomd_data_t *data;
-
-    fp = fopen(filename, "rb");
-    if (!fp) return NULL;
-  
-    data = (hoomd_data_t *)calloc(1,sizeof(hoomd_data_t));
-    if (data) {
-      
-      data->counter       =  0;
-      data->numatoms      = -1;
-      data->numtypes      = -1;
-      data->numbonds      = -1;
-      data->numangles     = -1;
-      data->numdihedrals  = -1;
-      data->numimpropers  = -1;
-      data->numframe      = -1;
-      data->numbondtypes  = -1;
-      data->numangletypes = -1;
-      data->numdihedraltypes = -1;
-      data->numimpropertypes = -1;
-      data->bondtype      = NULL;
-      data->bondtypename  = NULL;
-      data->angle         = NULL;
-      data->angletype     = NULL;
-      data->angletypename = NULL;
-      data->dihedral         = NULL;
-      data->dihedraltype     = NULL;
-      data->dihedraltypename = NULL;
-      data->dihedral         = NULL;
-      data->dihedraltype     = NULL;
-      data->dihedraltypename = NULL;
-      data->parse_error   =  0;
-      
-      data->majv     = -1;
-      data->minv     = -1;
-
-      data->optflags = MOLFILE_NOOPTIONS;
-      /* scaling factor for guessed diameters */
-      data->mysigma  = 1.0f;
-    
-      p = XML_ParserCreate(NULL);
-      if (!p) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Could not create XML"
-                      " parser for HOOMD-blue data file '%s'\n", filename);
-        SAFE_FREE(data);
-        fclose(fp);
-        return NULL;
-      }
-    
-      XML_SetElementHandler(p, xml_new_tag, xml_end_tag);
-      XML_SetCommentHandler(p, xml_comment);
-      XML_SetCharacterDataHandler(p, xml_data_block);
-      XML_SetUserData(p,data);
-      data->p  = p;
-      data->fp = fp;
-      data->filename = strdup(filename);
-
-      /* loop through file until we have parsed the first configuration */
-      do {
-        if (MOLFILE_ERROR == hoomd_parse_line(data)) {
-          vmdcon_printf(VMDCON_ERROR, "hoomdplugin) XML Parse error "
-                      "while reading HOOMD-blue data file '%s'\n", filename);
-          XML_ParserFree(data->p);
-          data->p = NULL;
-          SAFE_FREE(data->filename);
-          fclose(data->fp);
-          SAFE_FREE(data);
-          return NULL;
-        }
-      } while (!feof(fp) && !data->doneframe);
-
-      if ( data->majv > HOOMD_FORMAT_MAJV ) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Encountered incompatible "
-                      "HOOMD-blue data file format version '%d.%d.\n", 
-                      data->majv, data->minv);
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) This plugin supports only "
-                      "HOOMD-blue data files up to version '%d.%d'.\n",
-                      HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV);
-        XML_ParserFree(data->p);
-        data->p = NULL;
-        SAFE_FREE(data->filename);
-        fclose(data->fp);
-        SAFE_FREE(data);
-        return NULL;
-      } else {
-        if ( (data->majv == HOOMD_FORMAT_MAJV) && 
-             (data->minv > HOOMD_FORMAT_MINV) ) {
-          vmdcon_printf(VMDCON_WARN, "hoomdplugin) Encountered newer HOOMD-blue "
-                        "data file format version '%d.%d'.\n",
-                        data->majv, data->minv);
-          vmdcon_printf(VMDCON_WARN, "hoomdplugin) This plugin supports HOOMD-blue "
-                        "data files up to version '%d.%d'. Continuing...\n", 
-                        HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV);
-        }
-      }
-
-      if (data->numatoms < 0) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Could not determine "
-                      "number of atoms in HOOMD-blue data file '%s'\n", filename);
-        XML_ParserFree(data->p);
-        data->p = NULL;
-        SAFE_FREE(data->filename);
-        fclose(data->fp);
-        SAFE_FREE(data);
-        return NULL;
-      }
-
-      /* reset parsing */
-      XML_ParserFree(p);
-      data->p = NULL;
-      rewind(fp);
-    
-      data->counter  = 0;
-      data->numframe = 0;
-      *natoms=data->numatoms;
-    }
-  
-    return data;
-  }
-
-static int read_hoomd_structure(void *mydata, int *optflags, 
-                                molfile_atom_t *atoms) {
-  molfile_atom_t *a;
-  XML_Parser p;
-  const char *envvar;
-  int i;
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  
-  data->parsedepth = 0;
-  data->counter    = 0;
-  data->numframe   = 0;
-  data->doneframe  = 0;
-  data->atomlist   = atoms;
-  SAFE_CALLOC(data->imagecounts,   int,   3*data->numatoms);
-  SAFE_CALLOC(data->bondtypename,  char*, 1);  /* is grown on demand */
-  SAFE_CALLOC(data->angletypename, char*, 1);  /* is grown on demand */
-  SAFE_CALLOC(data->dihedraltypename, char*, 1);  /* is grown on demand */
-  SAFE_CALLOC(data->impropertypename, char*, 1);  /* is grown on demand */
-  if (data->numbonds > 0) {
-    SAFE_CALLOC(data->from,      int, data->numbonds);
-    SAFE_CALLOC(data->to,        int, data->numbonds);
-    SAFE_CALLOC(data->bondtype,  int, data->numbonds);
-  }
-  if (data->numangles > 0) {
-    SAFE_CALLOC(data->angle,     int, data->numangles * 3);
-    SAFE_CALLOC(data->angletype, int, data->numangles);
-  }
-  if (data->numdihedrals > 0) {
-    SAFE_CALLOC(data->dihedral,     int, data->numdihedrals * 4);
-    SAFE_CALLOC(data->dihedraltype, int, data->numdihedrals);
-  }
-  if (data->numimpropers > 0) {
-    SAFE_CALLOC(data->improper,     int, data->numimpropers * 4);
-    SAFE_CALLOC(data->impropertype, int, data->numimpropers);
-  }
-  SAFE_CALLOC(data->ts.coords,float,3*data->numatoms);
-  data->ts.A = data->ts.B = data->ts.C = 0.0f;
-  data->ts.alpha = data->ts.beta = data->ts.gamma = 90.0f;
-  
-#if vmdplugin_ABIVERSION > 10
-  data->ts_meta.count = -1;
-  data->ts_meta.has_velocities = 0;
-  SAFE_CALLOC(data->ts.velocities,float,3*data->numatoms);
-#endif
-  p = XML_ParserCreate(NULL);
-  if (!p) {
-    vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Could not create XML"
-                  " parser for HOOMD-blue data file '%s'\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  XML_SetElementHandler(p, xml_new_tag, xml_end_tag);
-  XML_SetCommentHandler(p, xml_comment);
-  XML_SetCharacterDataHandler(p,xml_data_block);
-  XML_SetUserData(p,data);
-  data->p = p;
-
-  /* initialize atomdata with typical defaults */
-  for (i=0, a=atoms; i < data->numatoms; ++i, ++a) {
-    a->radius =  1.0f;
-    a->mass =    1.0f;
-    a->resname[0]='\0';
-    a->resid=0;
-    a->segid[0]='\0';
-    a->chain[0]='\0';
-  }
-    
-  /* read the first configuration again, but keep the data this time. */
-  do {
-    if (MOLFILE_ERROR == hoomd_parse_line(data)) {
-      XML_ParserFree(data->p);
-      data->p = NULL;
-      return MOLFILE_ERROR;
-    } 
-  } while (!feof(data->fp) && !data->doneframe);
-
-  /* allow overriding hardcoded sigma values from environment */
-  envvar = getenv("VMDHOOMDSIGMA");
-  if (envvar) data->mysigma = atof(envvar);
-
-  /* fix up settings */
-  for (i=0, a=atoms; i < data->numatoms; ++i, ++a) {
-
-    if (!(data->optflags & MOLFILE_RADIUS)) {
-      /* use vizsigma parameter to adjust guessed particle radii,
-         but only for xml files that don't have a diameter section. */
-      a->radius = data->mysigma * get_pte_vdw_radius(a->atomicnumber);
-    }
-
-    if (!(data->optflags & MOLFILE_MASS)) {
-      /* guess atom mass, if not provided */
-      a->mass = get_pte_mass(a->atomicnumber);
-    }
-  }
-  *optflags = data->optflags | MOLFILE_RADIUS | MOLFILE_MASS;
-    
-  data->numframe=1;
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 10
-/***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  
-  meta->count = -1;
-  meta->has_velocities = data->ts_meta.has_velocities;
-  if (meta->has_velocities) {
-    vmdcon_printf(VMDCON_INFO, "hoomdplugin) Importing velocities.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-#if vmdplugin_ABIVERSION > 14
-static int read_hoomd_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                            float **bondorder, int **bondtype, 
-                            int *nbondtypes, char ***bondtypename) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *nbonds = data->numbonds;
-  *bondorder = NULL;
-
-  if (data->numbonds > 0) {
-    *fromptr      = data->from;
-    *toptr        = data->to;
-    *bondtype     = data->bondtype;
-    *nbondtypes   = data->numbondtypes;
-    *bondtypename = data->bondtypename;
-  } else {
-    *fromptr      = NULL;
-    *toptr        = NULL;
-    *bondtype     = NULL;
-    *nbondtypes   = 0;
-    *bondtypename = NULL;
-    vmdcon_printf(VMDCON_WARN,
-                  "hoomdplugin) no bonds defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_hoomd_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                            float **bondorder) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *nbonds = data->numbonds;
-  *bondorder = NULL;
-
-  if (data->numbonds > 0) {
-    *fromptr      = data->from;
-    *toptr        = data->to;
-  } else {
-    *fromptr      = NULL;
-    *toptr        = NULL;
-    vmdcon_printf(VMDCON_WARN,
-                  "hoomdplugin) no bonds defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-#if vmdplugin_ABIVERSION > 15
-static int read_hoomd_angles(void *v, int *numangles, int **angles, 
-                             int **angletypes, int *numangletypes, 
-                             char ***angletypenames, int *numdihedrals,
-                             int **dihedrals, int **dihedraltypes, 
-                             int *numdihedraltypes, char ***dihedraltypenames,
-                             int *numimpropers, int **impropers, 
-                             int **impropertypes, int *numimpropertypes, 
-                             char ***impropertypenames, int *numcterms, 
-                             int **cterms, int *ctermcols, int *ctermrows) {
-                               
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *numangles         = 0;
-  *angles            = NULL;
-  *angletypes        = NULL;
-  *numangletypes     = 0;
-  *angletypenames    = NULL;
-  *numdihedrals      = 0;
-  *dihedrals         = NULL;
-  *dihedraltypes     = NULL;
-  *numdihedraltypes  = 0;
-  *dihedraltypenames = NULL;
-  *numimpropers      = 0;
-  *impropers         = NULL;
-  *impropertypes     = NULL;
-  *numimpropertypes  = 0;
-  *impropertypenames = NULL;
-  *numcterms         = 0;           /* hoomd does not support CMAP */
-  *cterms            = NULL;
-  *ctermrows         = 0;
-  *ctermcols         = 0;
-  
-  if (data->numangles > 0) {
-    *numangles      = data->numangles;
-    *angles         = data->angle;
-    *angletypes     = data->angletype;
-    *numangletypes  = data->numangletypes;
-    *angletypenames = data->angletypename;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no angles defined in data file.\n");
-  }
-  if (data->numdihedrals > 0) {
-    *numdihedrals      = data->numdihedrals;
-    *dihedrals         = data->dihedral;
-    *dihedraltypes     = data->dihedraltype;
-    *numdihedraltypes  = data->numdihedraltypes;
-    *dihedraltypenames = data->dihedraltypename;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no dihedrals defined in data file.\n");
-  }
-  if (data->numimpropers > 0) {
-    *numimpropers      = data->numimpropers;
-    *impropers         = data->improper;
-    *impropertypes     = data->impropertype;
-    *numimpropertypes  = data->numimpropertypes;
-    *impropertypenames = data->impropertypename;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no impropers defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_hoomd_angles(void *v, int *numangles, int **angles, 
-                             double **angleforces, int *numdihedrals, 
-                             int **dihedrals, double **dihedralforces,
-                             int *numimpropers, int **impropers, 
-                             double **improperforces, int *numcterms,
-                             int **cterms, int *ctermcols, int *ctermrows,  
-                             double **ctermforces) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *numangles      = 0;
-  *angles         = NULL;
-  *angleforces    = NULL;
-  *numdihedrals   = 0;          /* we currently only support angles. */
-  *dihedrals      = NULL;
-  *dihedralforces = NULL;
-  *numimpropers   = 0;
-  *impropers      = NULL;
-  *improperforces = NULL;
-  *numcterms      = 0;
-  *cterms         = NULL;
-  *ctermrows      = 0;
-  *ctermcols      = 0;
-  *ctermforces    = NULL;
-  
-  if (data->numangles > 0) {
-    *numangles      = data->numangles;
-    *angles         = data->angle;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no angles defined in data file.\n");
-  }
-  if (data->numdihedrals > 0) {
-    *numdihedrals      = data->numdihedrals;
-    *dihedrals         = data->dihedral;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no dihedrals defined in data file.\n");
-  }
-  if (data->numimpropers > 0) {
-    *numimpropers      = data->numimpropers;
-    *impropers         = data->improper;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no impropers defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static int read_hoomd_timestep(void *mydata, int natoms, 
-                               molfile_timestep_t *ts) {
-  int i;
-  hoomd_data_t *data;
-  
-  data=(hoomd_data_t *)mydata;
-
-  if (data->parse_error) return MOLFILE_ERROR;
-  if (data->p == NULL) return MOLFILE_ERROR;
-  
-  if (data->numframe > 1) {
-    /* read the next configuration. */
-    data->doneframe =  0;
-    do {
-      if (MOLFILE_ERROR == hoomd_parse_line(data)) {
-        XML_ParserFree(data->p);
-        data->p = NULL;
-        return MOLFILE_ERROR;
-      } 
-      if (data->parse_error) return MOLFILE_ERROR;
-    } while (!feof(data->fp) && !data->doneframe);
-    if (feof(data->fp)) return MOLFILE_ERROR;
-  }
-  data->numframe++;
-  
-  if (ts != NULL) { 
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    for (i=0; i<natoms; ++i) {
-      ts->coords[3*i+0] = data->ts.coords[3*i+0]
-        + data->ts.A * data->imagecounts[3*i+0];
-      ts->coords[3*i+1] = data->ts.coords[3*i+1]
-        + data->ts.B * data->imagecounts[3*i+1];
-      ts->coords[3*i+2] = data->ts.coords[3*i+2]
-        + data->ts.C * data->imagecounts[3*i+2];
-    }
-#if vmdplugin_ABIVERSION > 10    
-    /* copy velocities */
-    if (ts->velocities != NULL) {
-      for (i=0; i<natoms; ++i) {
-        ts->velocities[3*i+0] = data->ts.velocities[3*i+0];
-        ts->velocities[3*i+1] = data->ts.velocities[3*i+1];
-        ts->velocities[3*i+2] = data->ts.velocities[3*i+2];
-      }
-    }
-#endif
-    ts->A = data->ts.A;
-    ts->B = data->ts.B;
-    ts->C = data->ts.C;
-    ts->alpha = data->ts.alpha;
-    ts->beta  = data->ts.beta;
-    ts->gamma = data->ts.gamma;
-  }
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_hoomd_read(void *mydata) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  int i;
-  
-  if (data->p != NULL) XML_ParserFree(data->p);
-
-  fclose(data->fp);
-
-  SAFE_FREE(data->imagecounts);
-  SAFE_FREE(data->from);
-  SAFE_FREE(data->to);
-  SAFE_FREE(data->bondtype);
-  for (i=0; i < data->numbondtypes; ++i) {
-    SAFE_FREE(data->bondtypename[i]);
-  }
-  SAFE_FREE(data->bondtypename);
-  SAFE_FREE(data->angle);
-  SAFE_FREE(data->angletype);
-  for (i=0; i < data->numangletypes; ++i) {
-    SAFE_FREE(data->angletypename[i]);
-  }
-  SAFE_FREE(data->angletypename);
-  SAFE_FREE(data->dihedral);
-  SAFE_FREE(data->dihedraltype);
-  for (i=0; i < data->numdihedraltypes; ++i) {
-    SAFE_FREE(data->dihedraltypename[i]);
-  }
-  SAFE_FREE(data->dihedraltypename);
-  SAFE_FREE(data->improper);
-  SAFE_FREE(data->impropertype);
-  for (i=0; i < data->numimpropertypes; ++i) {
-    SAFE_FREE(data->impropertypename[i]);
-  }
-  SAFE_FREE(data->impropertypename);
-  SAFE_FREE(data->ts.coords);
-  SAFE_FREE(data->ts.velocities);
-  SAFE_FREE(data->filename);
-  SAFE_FREE(data);
-}
-
-/*! open hoomd data file for writing.
- * this will also write the XML identfier tag and the opening 
- * <hoomd> and <configuration> elements */
-static void *open_hoomd_write(const char *filename, const char *filetype, 
-                              int natoms) {
-  FILE *fd;
-  hoomd_data_t *data;
-  time_t mytime;
-
-  mytime = time(NULL);
-  
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Unable to open HOOMD-blue data file %s "
-                  "for writing\n", filename);
-    return NULL;
-  }
-  
-  data = (hoomd_data_t *)malloc(sizeof(hoomd_data_t));
-  data->numatoms = natoms;
-  data->filename = strdup(filename);
-  data->fp   = fd;
-  data->atomlist      = NULL;
-  data->numbonds      = 0;
-  data->to            = NULL;
-  data->from          = NULL;
-  data->bondtype      = NULL;
-  data->numbondtypes  = 0;
-  data->bondtypename  = NULL;
-  data->numangles     = 0;
-  data->angle         = NULL;
-  data->angletype     = NULL;
-  data->numangletypes = 0;
-  data->angletypename = NULL;
-  data->numdihedrals     = 0;
-  data->dihedral         = NULL;
-  data->dihedraltype     = NULL;
-  data->numdihedraltypes = 0;
-  data->dihedraltypename = NULL;
-  data->numimpropers     = 0;
-  data->improper         = NULL;
-  data->impropertype     = NULL;
-  data->numimpropertypes = 0;
-  data->impropertypename = NULL;
-  data->numframe      = 0;
-  data->imagecounts   = (int *)malloc(sizeof(int)*3*(data->numatoms));
-
-  fputs("<?xml version =\"1.0\" encoding =\"UTF-8\" ?>\n",fd);
-  fprintf(fd,"<%s version=\"%d.%d\">\n", hoomd_tag_name[HOOMD_XML],
-          HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV);
-  fprintf(fd, "<!-- generated by VMD on: %s", ctime(&mytime));
-  fprintf(fd, " %s plugin v%d.%d by %s -->\n", plugin.prettyname,
-          plugin.majorv, plugin.minorv, plugin.author);
-
-  fprintf(data->fp,"<%s time_step=\"%d\" natoms=\"%d\">\n",
-          hoomd_tag_name[HOOMD_CONFIG], data->numframe, data->numatoms);
-
-  return data;
-}
-
-
-/* some macros for consistency and convenience */
-#define SECTION_OPEN(tag,num) \
-  fprintf(data->fp, "<%s num=\"%d\">\n", hoomd_tag_name[tag], num)
-
-#define SECTION_CLOSE(tag) \
-  fprintf(data->fp, "</%s>\n", hoomd_tag_name[tag])
-  
-#define SECTION_WRITE_ATOMIC(tag,fmt,val) \
-  SECTION_OPEN(tag,numatoms);             \
-  for (i=0; i < numatoms; ++i)            \
-    fprintf(data->fp,fmt, val);           \
-  SECTION_CLOSE(tag)
-
-/*! write topology data to hoomd data file.
- */
-static int write_hoomd_structure(void *mydata, int optflags, 
-                                 const molfile_atom_t *atoms) {
-  int i, numatoms;
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  numatoms = data->numatoms;
-
-
-  /* write fields we know about */
-  /* required by molfile: */
-  SECTION_WRITE_ATOMIC(HOOMD_TYPE,"%s\n",atoms[i].type);
-  SECTION_WRITE_ATOMIC(HOOMD_BODY,"%d\n",atoms[i].resid);
-
-  /* optional: */
-  if (optflags & MOLFILE_RADIUS) {
-    SECTION_WRITE_ATOMIC(HOOMD_DIAMETER,"%f\n",2.0f*atoms[i].radius);
-  }
-  
-  if (optflags & MOLFILE_MASS) {
-    SECTION_WRITE_ATOMIC(HOOMD_MASS,"%f\n",atoms[i].mass);
-  }
-  
-  if (optflags & MOLFILE_CHARGE) {
-    SECTION_WRITE_ATOMIC(HOOMD_CHARGE,"%f\n",atoms[i].charge);
-  }
-  
-  if ((data->numbonds > 0) && (data->from != NULL) && (data->to != NULL)) {
-    SECTION_OPEN(HOOMD_BOND, data->numbonds);
-    if (data->bondtype != NULL) {
-      if (data->bondtypename != NULL) {
-        /* case 1: symbolic bond types available */
-        for (i=0; i < data->numbonds; ++i) {
-          if (data->bondtype[i] < 0) {
-            /* case 1a: symbolic bond types not assigned */
-            fprintf(data->fp,"unkown %d %d\n", data->from[i]-1, data->to[i]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d\n", data->bondtypename[data->bondtype[i]],
-                    data->from[i]-1, data->to[i]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical bond types available */
-        for (i=0; i < data->numbonds; ++i) {
-          fprintf(data->fp,"bondtype%d %d %d\n", data->bondtype[i], 
-                  data->from[i]-1, data->to[i]-1);
-        }
-      }
-    } else {
-      /* case 3: no bond type info available. */
-      for (i=0; i < data->numbonds; ++i) {
-        fprintf(data->fp,"bond %d %d\n", data->from[i]-1, data->to[i]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_BOND);
-  }
-  
-  if ( (data->numangles > 0) && (data->angle != NULL) ) {
-    SECTION_OPEN(HOOMD_ANGLE,data->numangles);
-    if (data->angletype != NULL) {
-      if (data->angletypename != NULL) {
-        /* case 1: symbolic angle types available */
-        for (i=0; i < data->numangles; ++i) {
-          if (data->angletype[i] < 0) {
-            /* case 1a: symbolic angle types not assigned */
-            fprintf(data->fp,"unkown %d %d %d\n", data->angle[3*i]-1, 
-                    data->angle[3*i+1]-1, data->angle[3*i+2]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d %d\n", 
-                    data->angletypename[data->angletype[i]], 
-                    data->angle[3*i]-1, data->angle[3*i+1]-1, 
-                    data->angle[3*i+2]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical angle types available */
-        for (i=0; i < data->numangles; ++i) {
-          fprintf(data->fp,"angletype%d %d %d %d\n", 
-                  data->angletype[i], data->angle[3*i]-1, 
-                  data->angle[3*i+1]-1, data->angle[3*i+2]-1);
-        }
-      }
-    } else {
-      /* case 3: no angle type info available. */
-      for (i=0; i < data->numangles; ++i) {
-        fprintf(data->fp,"angle %d %d %d\n", data->angle[3*i]-1, 
-                data->angle[3*i+1]-1, data->angle[3*i+2]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_ANGLE);
-  }
-
-  if ( (data->numdihedrals > 0) && (data->dihedral != NULL) ) {
-    SECTION_OPEN(HOOMD_DIHEDRAL, data->numdihedrals);
-    if (data->dihedraltype != NULL) {
-      if (data->dihedraltypename != NULL) {
-        /* case 1: symbolic dihedral types available */
-        for (i=0; i < data->numdihedrals; ++i) {
-          if (data->dihedraltype[i] < 0) {
-            /* case 1a: symbolic dihedral types not assigned */
-            fprintf(data->fp,"unkown %d %d %d %d\n", data->dihedral[4*i]-1, 
-                    data->dihedral[4*i+1]-1, data->dihedral[4*i+2]-1,
-                    data->dihedral[4*i+3]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d %d %d\n", 
-                    data->dihedraltypename[data->dihedraltype[i]], 
-                    data->dihedral[4*i]-1,   data->dihedral[4*i+1]-1, 
-                    data->dihedral[4*i+2]-1, data->dihedral[4*i+3]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical dihedral types available */
-        for (i=0; i < data->numdihedrals; ++i) {
-          fprintf(data->fp,"dihedraltype%d %d %d %d %d\n", 
-                  data->dihedraltype[i],   data->dihedral[4*i]-1, 
-                  data->dihedral[4*i+1]-1, data->dihedral[4*i+2]-1,
-                  data->dihedral[4*i+3]-1);
-        }
-      }
-    } else {
-      /* case 3: no dihedral type info available. */
-      for (i=0; i < data->numdihedrals; ++i) {
-        fprintf(data->fp,"dihedral %d %d %d %d\n", 
-                data->dihedral[4*i]-1,   data->dihedral[4*i+1]-1, 
-                data->dihedral[4*i+2]-1, data->dihedral[4*i+3]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_DIHEDRAL);
-  }
-
-  if ( (data->numimpropers > 0) && (data->improper != NULL) ) {
-    SECTION_OPEN(HOOMD_IMPROPER, data->numimpropers);
-    if (data->impropertype != NULL) {
-      if (data->impropertypename != NULL) {
-        /* case 1: symbolic improper types available */
-        for (i=0; i < data->numimpropers; ++i) {
-          if (data->impropertype[i] < 0) {
-            /* case 1a: symbolic improper types not assigned */
-            fprintf(data->fp,"unkown %d %d %d %d\n", data->improper[4*i]-1, 
-                    data->improper[4*i+1]-1, data->improper[4*i+2]-1,
-                    data->improper[4*i+3]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d %d %d\n", 
-                    data->impropertypename[data->impropertype[i]], 
-                    data->improper[4*i]-1,   data->improper[4*i+1]-1, 
-                    data->improper[4*i+2]-1, data->improper[4*i+3]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical improper types available */
-        for (i=0; i < data->numimpropers; ++i) {
-          fprintf(data->fp,"impropertype%d %d %d %d %d\n", 
-                  data->impropertype[i],   data->improper[4*i]-1, 
-                  data->improper[4*i+1]-1, data->improper[4*i+2]-1,
-                  data->improper[4*i+3]-1);
-        }
-      }
-    } else {
-      /* case 3: no improper type info available. */
-      for (i=0; i < data->numimpropers; ++i) {
-        fprintf(data->fp,"improper %d %d %d %d\n", 
-                data->improper[4*i]-1,   data->improper[4*i+1]-1, 
-                data->improper[4*i+2]-1, data->improper[4*i+3]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_IMPROPER);
-  }
-  return MOLFILE_SUCCESS;
-}
-/* clean up, part 1 */
-#undef SECTION_WRITE_ATOMIC
-
-
-#if vmdplugin_ABIVERSION > 14
-static int write_hoomd_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                             float *bondorder, int *bondtype, 
-                             int nbondtypes, char **bondtypename) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-  int i;
-
-  data->numbonds=0;
-  data->numbondtypes=0;
-  data->bondtype=NULL;
-
-  /* save info until we actually write out the structure data */
-  if ( (nbonds > 0) && (fromptr != NULL) && (toptr != NULL) ) {
-    data->numbonds = nbonds;
-    SAFE_CALLOC(data->from, int, nbonds);
-    memcpy(data->from, fromptr, nbonds * sizeof(int));
-    SAFE_CALLOC(data->to,   int, nbonds);
-    memcpy(data->to,   toptr,   nbonds * sizeof(int));
-    if (bondtype != NULL) {
-      SAFE_CALLOC(data->bondtype, int, nbonds);
-      memcpy(data->bondtype, bondtype, nbonds * sizeof(int));
-    }
-  }
-  if (nbondtypes > 0) {
-    data->numbondtypes=nbondtypes;
-    if (bondtypename != NULL) {
-      SAFE_CALLOC(data->bondtypename, char *, nbondtypes+1);
-      for (i=0; i < nbondtypes; ++i) {
-        data->bondtypename[i] = strdup(bondtypename[i]);
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int write_hoomd_bonds(void *v, int nbonds, int *fromptr, int *toptr, float *bondorder) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  data->numbonds=0;
-  data->numbondtypes=0;
-  data->bondtype=NULL;
-
-  /* save info until we actually write out the structure data */
-  if ( (nbonds > 0) && (fromptr != NULL) && (toptr != NULL) ) {
-    data->numbonds = nbonds;
-    SAFE_CALLOC(data->from, int, nbonds);
-    memcpy(data->from, fromptr, nbonds * sizeof(int));
-    SAFE_CALLOC(data->to,   int, nbonds);
-    memcpy(data->to,   toptr,   nbonds * sizeof(int));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-#if vmdplugin_ABIVERSION > 15
-static int write_hoomd_angles(void * v, int numangles, const int *angles,
-                              const int *angletypes, int numangletypes,
-                              const char **angletypenames, int numdihedrals, 
-                              const int *dihedrals, const int *dihedraltypes,
-                              int numdihedraltypes, const char **dihedraltypenames,
-                              int numimpropers, const int *impropers, 
-                              const int *impropertypes, int numimpropertypes, 
-                              const char **impropertypenames, int numcterms, 
-                              const int *cterm, int ctermcols, int ctermrows) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-  int i;
-  
-  /* save info until we actually write out the structure file */
-  data->numangles    = numangles;
-  data->numdihedrals = numdihedrals;
-  data->numimpropers = numimpropers;
-
-  if (data->numangles > 0) {
-    SAFE_CALLOC(data->angle, int, 3*data->numangles);
-    memcpy(data->angle, angles, 3*(data->numangles)*sizeof(int));
-  }
-  if (data->numdihedrals > 0) {
-    SAFE_CALLOC(data->dihedral, int, 4*data->numdihedrals);
-    memcpy(data->dihedral, dihedrals, 4*(data->numdihedrals)*sizeof(int));
-  }
-  if (data->numimpropers > 0) {
-    SAFE_CALLOC(data->improper, int, 4*data->numimpropers);
-    memcpy(data->improper, impropers, 4*(data->numimpropers)*sizeof(int));
-  }
-
-  if (angletypes != NULL) {
-    SAFE_CALLOC(data->angletype, int, data->numangles);
-    memcpy(data->angletype, angletypes, (data->numangles)*sizeof(int));
-  }
-  if (dihedraltypes != NULL) {
-    SAFE_CALLOC(data->dihedraltype, int, data->numdihedrals);
-    memcpy(data->dihedraltype, dihedraltypes, (data->numdihedrals)*sizeof(int));
-  }
-  if (impropertypes != NULL) {
-    SAFE_CALLOC(data->impropertype, int, data->numimpropers);
-    memcpy(data->impropertype, impropertypes, (data->numimpropers)*sizeof(int));
-  }
-
-  data->numangletypes = numangletypes;
-  if (data->numangletypes > 0) {
-    if (angletypenames != NULL) {
-      SAFE_CALLOC(data->angletypename, char *, (data->numangletypes)+1);
-      for (i=0; i < data->numangletypes; ++i) {
-        data->angletypename[i] = strdup(angletypenames[i]);
-      }
-    }
-  }
-  data->numdihedraltypes = numdihedraltypes;
-  if (data->numdihedraltypes > 0) {
-    if (dihedraltypenames != NULL) {
-      SAFE_CALLOC(data->dihedraltypename, char *, (data->numdihedraltypes)+1);
-      for (i=0; i < data->numdihedraltypes; ++i) {
-        data->dihedraltypename[i] = strdup(dihedraltypenames[i]);
-      }
-    }
-  }
-
-  data->numimpropertypes = numimpropertypes;
-  if (data->numimpropertypes > 0) {
-    if (impropertypenames != NULL) {
-      SAFE_CALLOC(data->impropertypename, char *, (data->numimpropertypes)+1);
-      for (i=0; i < data->numimpropertypes; ++i) {
-        data->impropertypename[i] = strdup(impropertypenames[i]);
-      }
-    }
-  }
-
-#if 0                           /* the rest is not yet supported. */
-  data->numcterms    = numcterms;
-  if (data->numcterms > 0) {
-
-    data->cterms = (int *) malloc(8*data->numcterms*sizeof(int));
-    memcpy(data->cterms, cterms, 8*data->numcterms*sizeof(int));
-  }
-#endif
-  return MOLFILE_SUCCESS;
-}
-
-#else
-static int write_hoomd_angles(void * v, int numangles, const int *angles,
-                        const double *angleforces, int numdihedrals, 
-                        const int *dihedrals, const double *dihedralforces,
-                        int numimpropers, const int *impropers, 
-                        const double *improperforces, int numcterms,   
-                        const int *cterms, int ctermcols, int ctermrows, 
-                        const double *ctermforces) {
-    hoomd_data_t *data = (hoomd_data_t *)v;
-  /* save info until we actually write out the structure file */
-  data->numangles    = numangles;
-  if (data->numangles > 0) {
-    data->angle = (int *) malloc(3*data->numangles*sizeof(int));
-    memcpy(data->angle, angles, 3*data->numangles*sizeof(int));
-  }
-
-  data->numdihedrals = numdihedrals;
-  data->numimpropers = numimpropers;
-  data->numcterms    = numcterms;
-
-  if (data->numdihedrals > 0) {
-    data->dihedrals = (int *) malloc(4*data->numdihedrals*sizeof(int));
-    memcpy(data->dihedrals, dihedrals, 4*data->numdihedrals*sizeof(int));
-  }
-  
-    data->impropers = (int *) malloc(4*data->numimpropers*sizeof(int));
-    memcpy(data->impropers, impropers, 4*data->numimpropers*sizeof(int));
-  }
-#if 0                           /* XXX not yet supported. */
-  if (data->numcterms > 0) {
-
-    data->cterms = (int *) malloc(8*data->numcterms*sizeof(int));
-    memcpy(data->cterms, cterms, 8*data->numcterms*sizeof(int));
-  }
-#endif
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-static int write_hoomd_timestep(void *mydata, const molfile_timestep_t *ts) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata; 
-  const float *pos;
-  float px, py, pz;
-  int i, *img, numatoms;
-  numatoms = data->numatoms;
-
-  if (data->numframe != 0) {
-    fprintf(data->fp,"<%s time_step=\"%d\" natoms=\"%d\" dimensions=\"3\">\n", 
-            hoomd_tag_name[HOOMD_CONFIG],
-#if vmdplugin_ABIVERSION > 10
-            (int)(ts->physical_time+0.5f),
-#else
-            data->numframe,
-#endif
-            numatoms);
-  }
-
-  fprintf(data->fp, "<%s lx=\"%f\" ly=\"%f\" lz=\"%f\" />\n", 
-          hoomd_tag_name[HOOMD_BOX], ts->A, ts->B, ts->C);
-
-#define HOOMD_CONV_POS(crd, box, p, i)  \
-  if (fabsf(box) > SMALL) {            \
-    float tmp;                          \
-    tmp = floorf(crd / box + 0.5f);     \
-    p =  crd - tmp*box;                 \
-    i = (int) tmp;                      \
-  } else {                              \
-    p = crd;                            \
-    i = 0.0f;                           \
-  }
-
-  SECTION_OPEN(HOOMD_POS, numatoms);
-  pos = ts->coords;
-  img = data->imagecounts;
-  for (i = 0; i < numatoms; ++i) {
-    HOOMD_CONV_POS(*pos, ts->A, px, *img);
-    ++pos; ++img;
-    HOOMD_CONV_POS(*pos, ts->B, py, *img);
-    ++pos; ++img;
-    HOOMD_CONV_POS(*pos, ts->C, pz, *img);
-    ++pos; ++img;
-
-    fprintf(data->fp, "%.6f %.6f %.6f\n", px, py, pz);
-  }
-  SECTION_CLOSE(HOOMD_POS);
-
-  /* only print image section if we have (some) box info. */
-  if ( (fabsf(ts->A)+fabsf(ts->B)+fabsf(ts->C)) > SMALL) {
-    SECTION_OPEN(HOOMD_IMAGE,numatoms);
-    img = data->imagecounts;
-    for (i = 0; i < numatoms; ++i) {
-      fprintf(data->fp, "%d %d %d\n", img[0], img[1], img[2]);
-      img += 3;
-    }
-    SECTION_CLOSE(HOOMD_IMAGE);
-  }
-
-#if vmdplugin_ABIVERSION > 10
-  if (ts->velocities != NULL) {
-    const float *vel;
-
-    SECTION_OPEN(HOOMD_VEL, numatoms);
-    vel = ts->velocities;
-    for (i = 0; i < numatoms; ++i) {
-      fprintf(data->fp, "%.6f %.6f %.6f\n", vel[0], vel[1], vel[2]);
-      vel += 3;
-    }
-    SECTION_CLOSE(HOOMD_VEL);
-  }
-#endif
-
-  SECTION_CLOSE(HOOMD_CONFIG);
-  data->numframe ++;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_hoomd_write(void *mydata) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  int i;
-  
-  /* we have not yet written any positions, so the configuration tag is still open. */
-  if (data->numframe == 0) {
-    SECTION_CLOSE(HOOMD_CONFIG);
-  }
-  
-
-  SECTION_CLOSE(HOOMD_XML);
-  fclose(data->fp);
-
-  if (data->numbonds > 0) {
-    free(data->from);
-    free(data->to);
-    if (data->bondtype != NULL) {
-      free(data->bondtype);
-    }
-  }
-  if (data->numbondtypes > 0) {
-    if (data->bondtypename != NULL) {
-      for (i=0; i < data->numbondtypes; ++i) {
-        free(data->bondtypename[i]);
-      }
-      free(data->bondtypename);
-    }
-  }
-  
-  if (data->numangles > 0) {
-    free(data->angle);
-    if (data->angletype != NULL) {
-      free(data->angletype);
-    }
-  }
-  if (data->numangletypes > 0) {
-    if (data->angletypename != NULL) {
-      for (i=0; i < data->numangletypes; ++i) {
-        free(data->angletypename[i]);
-      }
-      free(data->angletypename);
-    }
-  }
-
-  if (data->numdihedrals > 0) {
-    free(data->dihedral);
-    if (data->dihedraltype != NULL) {
-      free(data->dihedraltype);
-    }
-  }
-  if (data->numdihedraltypes > 0) {
-    if (data->dihedraltypename != NULL) {
-      for (i=0; i < data->numdihedraltypes; ++i) {
-        free(data->dihedraltypename[i]);
-      }
-      free(data->dihedraltypename);
-    }
-  }
-
-  if (data->numimpropers > 0) {
-    free(data->improper);
-    if (data->impropertype != NULL) {
-      free(data->impropertype);
-    }
-  }
-  if (data->numimpropertypes > 0) {
-    if (data->impropertypename != NULL) {
-      for (i=0; i < data->numimpropertypes; ++i) {
-        free(data->impropertypename[i]);
-      }
-      free(data->impropertypename);
-    }
-  }
-
-  
-  if (data->atomlist) {
-    free(data->atomlist);
-  }
-  free(data->imagecounts);
-  free(data->filename);
-  free(data);
-}
-/* cleanup, part 2 */
-#undef SECTION_OPEN
-#undef SECTION_CLOSE
-
-/* registration stuff */
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "hoomd";
-  plugin.prettyname = "HOOMD-blue XML File";
-  plugin.author = "Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 10;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "xml";
-
-  plugin.open_file_read = open_hoomd_read;
-  plugin.read_structure = read_hoomd_structure;
-  plugin.read_bonds = read_hoomd_bonds;
-  plugin.read_next_timestep = read_hoomd_timestep;
-  plugin.close_file_read = close_hoomd_read;
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-#endif
-
-  plugin.open_file_write = open_hoomd_write;
-  plugin.write_bonds = write_hoomd_bonds;
-#if vmdplugin_ABIVERSION > 9
-  plugin.read_angles = read_hoomd_angles;
-  plugin.write_angles = write_hoomd_angles;
-#endif
-  plugin.write_structure = write_hoomd_structure;
-  plugin.write_timestep = write_hoomd_timestep;
-  plugin.close_file_write = close_hoomd_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  molfile_atom_t *atoms;
-  void *v, *w;
-  int i, natoms, nbonds, optflags;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-  int nbondtypes, nangletypes, ndihtypes, nimptypes;
-  int nangles, ndihedrals, nimpropers, ncterms;
-  int ctermrows, ctermcols;
-  int *from, *to, *bondtype, *angles, *angletype, *dihedrals, *dihedraltype;
-  int *impropers, *impropertype, *cterms;
-#if vmdplugin_ABIVERSION < 16
-  double *angleforces, *dihedralforces, *improperforces, *ctermforces;
-#endif
-  float *order;
-  char **btnames, **atnames, **dtnames, **itnames;
-
-  bondtype=NULL;
-  btnames=NULL;
-  nbondtypes=0;
-  nangletypes=0;
-
-  VMDPLUGIN_init();
-  
-  while (--argc) {
-    ++argv;
-    v = open_hoomd_read(*argv, "hoomd", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_hoomd_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_hoomd_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    atoms=(molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-    if (read_hoomd_structure(v, &optflags, atoms) != MOLFILE_SUCCESS) return 1;
-#if vmdplugin_ABIVERSION > 14
-    read_hoomd_bonds(v, &nbonds, &from, &to, &order, &bondtype, &nbondtypes, &btnames);
-
-    read_hoomd_angles(v, &nangles, &angles, &angletype, &nangletypes, &atnames, 
-                      &ndihedrals, &dihedrals, &dihedraltype, &ndihtypes, &dtnames, 
-                      &nimpropers, &impropers, &impropertype, &nimptypes, &itnames,
-                      &ncterms, &cterms, &ctermcols, &ctermrows);
-#else
-    read_hoomd_bonds(v, &nbonds, &from, &to, &order);
-#if vmdplugin_ABIVERSION > 9
-    read_hoomd_angles(v, &nangles, &angles, &angleforces, &ndihedrals, 
-                      &dihedrals, &dihedralforces, &nimpropers, &impropers, 
-                      &improperforces, &ncterms, &cterms, &ctermcols, 
-                      &ctermrows, &ctermforces);
-#endif
-#endif
-    fprintf(stderr, "found: %d atoms, %d bonds, %d bondtypes, %d angles, "
-            "%d angletypes\nfound: %d dihedrals, %d impropers, %d cterms\n", 
-            natoms, nbonds, nbondtypes, nangles, nangletypes, ndihedrals,
-            nimpropers, ncterms);
-
-    fputs("ATOMS:\n", stderr);
-    for(i=0; (i<20) && (i<natoms); ++i) {
-      fprintf(stderr,"%05d: %s/%s %d\n",i+1,atoms[i].name, 
-              atoms[i].type, atoms[i].atomicnumber);
-    }
-
-    fputs("BONDS:\n", stderr);
-    if (nbonds > 0) {
-      if (bondtype && nbondtypes > 0) {
-        for(i=0; (i<20) && (i<nbonds);++i) {
-          fprintf(stderr,"%05d: %s/%d %d %d\n", i+1, btnames[bondtype[i]], 
-                  bondtype[i], from[i], to[i]);
-        }
-      } else {
-        for(i=0;(i<20) && (i<nbonds);++i) {
-          fprintf(stderr,"%05d: %d %d\n",i+1,from[i], to[i]);
-        }
-      }
-    }
-    
-#if vmdplugin_ABIVERSION > 9
-    fputs("ANGLES:\n", stderr);
-    if (nangles > 0) {
-      if (angletype && nangletypes > 0) {
-        for(i=0; (i<20) && (i<nangles);++i) {
-          fprintf(stderr,"%05d: %s/%d %d %d %d\n", i+1, atnames[angletype[i]], 
-                  angletype[i], angles[3*i], angles[3*i+1], angles[3*i+2]);
-        }
-      } else {
-        for(i=0;(i<20) && (i<nangles);++i) {
-          fprintf(stderr,"%05d: %d %d %d\n",i+1, angles[3*i], 
-                  angles[3*i+1], angles[3*i+2]);
-        }
-      }
-    }
-#endif
-    
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-#if vmdplugin_ABIVERSION > 10
-    /* XXX: this should be tested at each time step. */
-    timestep.velocities = NULL;
-    read_timestep_metadata(v,&ts_meta);
-    if (ts_meta.has_velocities) {
-      fprintf(stderr, "found timestep velocities metadata.\n");
-    }
-    timestep.velocities = (float *) malloc(3*natoms*sizeof(float));
-#endif
-
-    while (!read_hoomd_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-    if (argc < 2) {
-      w = open_hoomd_write("test.xml","hoomd",natoms);
-#if vmdplugin_ABIVERSION > 14
-      write_hoomd_bonds(w, nbonds, from, to, NULL, bondtype, nbondtypes, btnames);
-#else
-      write_hoomd_bonds(w, nbonds, from, to, NULL);
-#endif
-#if vmdplugin_ABIVERSION > 9
-#if vmdplugin_ABIVERSION > 15
-      write_hoomd_angles(w, nangles, angles, angletype, nangletypes, atnames, 
-                         ndihedrals, dihedrals, dihedraltype, ndihtypes, dtnames, 
-                         nimpropers, impropers, impropertype, nimptypes, itnames,
-                         ncterms, cterms, ctermcols, ctermrows);
-#else
-      write_hoomd_angles(w, nangles, angles, NULL, ndihedrals, dihedrals, NULL,
-                         nimpropers, impropers, NULL, ncterms, cterms, 
-                         ctermcols, ctermrows, NULL);
-#endif
-#endif
-      write_hoomd_structure(w, optflags, atoms);
-      write_hoomd_timestep(w, &timestep);
-      close_hoomd_write(w);
-      fprintf(stderr, "done with writing hoomd file test.xml.\n");
-    }
-    close_hoomd_read(v);
-    
-    free(atoms);
-    free(timestep.coords);
-#if vmd_ABIVERSION > 10
-    free(timestep.velocities);
-#endif
-  }
-  VMDPLUGIN_fini();
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/inthash.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/inthash.c
deleted file mode 100755
index 661aeb20a54c22b93d63e165f9b08cb691809a1b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/inthash.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: inthash.c,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for ints, contributed by John Stone,
- *   derived from his ray tracer code.
- * NOTES: - this can only used for _positive_ data values (HASH_FAIL is -1)
- *        - this code is slightly modified from the version in VMD
- *          so that both, the string hash and the int hash can be used.
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "inthash.h"
-
-#define HASH_LIMIT 0.5
-
-/** hash table node data structure */
-typedef struct inthash_node_t {
-  int data;                           /* data in hash node */
-  int key;                            /* key for hash lookup */
-  struct inthash_node_t *next;        /* next node in hash chain */
-} inthash_node_t;
-
-/*
- *  inthash() - Hash function returns a hash number for a given key.
- *
- *  tptr: Pointer to a hash table
- *  key: The key to create a hash number for
- */
-static int inthash(const inthash_t *tptr, int key) {
-  int hashvalue;
-
-  hashvalue = (((key*1103515249)>>tptr->downshift) & tptr->mask);
-  if (hashvalue < 0) {
-    hashvalue = 0;
-  }    
-
-  return hashvalue;
-}
-
-/*
- *  inthash_init() - Initialize a new hash table.
- *
- *  tptr: Pointer to the hash table to initialize
- *  buckets: The number of initial buckets to create
- */
-VMDEXTERNSTATIC void inthash_init(inthash_t *tptr, int buckets) {
-
-  /* make sure we allocate something */
-  if (buckets==0)
-    buckets=16;
-
-  /* initialize the table */
-  tptr->entries=0;
-  tptr->size=2;
-  tptr->mask=1;
-  tptr->downshift=29;
-
-  /* ensure buckets is a power of 2 */
-  while (tptr->size<buckets) {
-    tptr->size<<=1;
-    tptr->mask=(tptr->mask<<1)+1;
-    tptr->downshift--;
-  } /* while */
-
-  /* allocate memory for table */
-  tptr->bucket=(inthash_node_t **) calloc(tptr->size, sizeof(inthash_node_t *));
-
-  return;
-}
-
-/*
- *  rebuild_table_int() - Create new hash table when old one fills up.
- *
- *  tptr: Pointer to a hash table
- */
-static void rebuild_table_int(inthash_t *tptr) {
-  inthash_node_t **old_bucket, *old_hash, *tmp;
-  int old_size, h, i;
-
-  old_bucket=tptr->bucket;
-  old_size=tptr->size;
-
-  /* create a new table and rehash old buckets */
-  inthash_init(tptr, old_size<<1);
-  for (i=0; i<old_size; i++) {
-    old_hash=old_bucket[i];
-    while(old_hash) {
-      tmp=old_hash;
-      old_hash=old_hash->next;
-      h=inthash(tptr, tmp->key);
-      tmp->next=tptr->bucket[h];
-      tptr->bucket[h]=tmp;
-      tptr->entries++;
-    } /* while */
-  } /* for */
-
-  /* free memory used by old table */
-  free(old_bucket);
-
-  return;
-}
-
-/*
- *  inthash_lookup() - Lookup an entry in the hash table and return a pointer to
- *    it or HASH_FAIL if it wasn't found.
- *
- *  tptr: Pointer to the hash table
- *  key: The key to lookup
- */
-VMDEXTERNSTATIC int inthash_lookup(const inthash_t *tptr, int key) {
-  int h;
-  inthash_node_t *node;
-
-
-  /* find the entry in the hash table */
-  h=inthash(tptr, key);
-  for (node=tptr->bucket[h]; node!=NULL; node=node->next) {
-    if (node->key == key)
-      break;
-  }
-
-  /* return the entry if it exists, or HASH_FAIL */
-  return(node ? node->data : HASH_FAIL);
-}
-
-/*
- *  inthash_insert() - Insert an entry into the hash table.  If the entry already
- *  exists return a pointer to it, otherwise return HASH_FAIL.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to insert into the hash table
- *  data: A pointer to the data to insert into the hash table
- */
-VMDEXTERNSTATIC int inthash_insert(inthash_t *tptr, int key, int data) {
-  int tmp;
-  inthash_node_t *node;
-  int h;
-
-  /* check to see if the entry exists */
-  if ((tmp=inthash_lookup(tptr, key)) != HASH_FAIL)
-    return(tmp);
-
-  /* expand the table if needed */
-  while (tptr->entries>=HASH_LIMIT*tptr->size)
-    rebuild_table_int(tptr);
-
-  /* insert the new entry */
-  h=inthash(tptr, key);
-  node=(struct inthash_node_t *) malloc(sizeof(inthash_node_t));
-  node->data=data;
-  node->key=key;
-  node->next=tptr->bucket[h];
-  tptr->bucket[h]=node;
-  tptr->entries++;
-
-  return HASH_FAIL;
-}
-
-/*
- *  inthash_delete() - Remove an entry from a hash table and return a pointer
- *  to its data or HASH_FAIL if it wasn't found.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to remove from the hash table
- */
-VMDEXTERNSTATIC int inthash_delete(inthash_t *tptr, int key) {
-  inthash_node_t *node, *last;
-  int data;
-  int h;
-
-  /* find the node to remove */
-  h=inthash(tptr, key);
-  for (node=tptr->bucket[h]; node; node=node->next) {
-    if (node->key == key)
-      break;
-  }
-
-  /* Didn't find anything, return HASH_FAIL */
-  if (node==NULL)
-    return HASH_FAIL;
-
-  /* if node is at head of bucket, we have it easy */
-  if (node==tptr->bucket[h])
-    tptr->bucket[h]=node->next;
-  else {
-    /* find the node before the node we want to remove */
-    for (last=tptr->bucket[h]; last && last->next; last=last->next) {
-      if (last->next==node)
-        break;
-    }
-    last->next=node->next;
-  }
-
-  /* free memory and return the data */
-  data=node->data;
-  free(node);
-
-  return(data);
-}
-
-
-/*
- * inthash_entries() - return the number of hash table entries.
- *
- */
-VMDEXTERNSTATIC int inthash_entries(inthash_t *tptr) {
-  return tptr->entries;
-}
-
-
-/*
- * inthash_destroy() - Delete the entire table, and all remaining entries.
- * 
- */
-VMDEXTERNSTATIC void inthash_destroy(inthash_t *tptr) {
-  inthash_node_t *node, *last;
-  int i;
-
-  for (i=0; i<tptr->size; i++) {
-    node = tptr->bucket[i];
-    while (node != NULL) { 
-      last = node;   
-      node = node->next;
-      free(last);
-    }
-  }     
-
-  /* free the entire array of buckets */
-  if (tptr->bucket != NULL) {
-    free(tptr->bucket);
-    memset(tptr, 0, sizeof(inthash_t));
-  }
-}
-
-/*
- *  alos_int() - Find the average length of search.
- *
- *  tptr: Pointer to a hash table
- */
-static float alos_int(inthash_t *tptr) {
-  int i,j;
-  float alos_int=0;
-  inthash_node_t *node;
-
-
-  for (i=0; i<tptr->size; i++) {
-    for (node=tptr->bucket[i], j=0; node!=NULL; node=node->next, j++);
-    if (j)
-      alos_int+=((j*(j+1))>>1);
-  } /* for */
-
-  return(tptr->entries ? alos_int/tptr->entries : 0);
-}
-
-
-/*
- *  inthash_stats() - Return a string with stats about a hash table.
- *
- *  tptr: A pointer to the hash table
- */
-VMDEXTERNSTATIC char * inthash_stats(inthash_t *tptr) {
-  static char buf[1024];
-
-  sprintf(buf, "%u slots, %u entries, and %1.2f ALOS",
-    (int)tptr->size, (int)tptr->entries, alos_int(tptr));
-
-  return(buf);
-}
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/inthash.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/inthash.h
deleted file mode 100755
index b4c9e0e6e5e2b2d4cd2a6c8982be40532fdcd02a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/inthash.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: inthash.h,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.4 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for ints, contributed by John Stone,
- *   derived from his ray tracer code.
- * NOTES: - this can only used for _positive_ data values (HASH_FAIL is -1)
- *        - this code is slightly modified from the version in VMD
- *          so that both, the string hash and the int hash can be used.
- ***************************************************************************/
-#ifndef INTHASH_H
-#define INTHASH_H
-
-/** hash table top level data structure */
-typedef struct inthash_t {
-  struct inthash_node_t **bucket;        /* array of hash nodes */
-  int size;                           /* size of the array */
-  int entries;                        /* number of entries in table */
-  int downshift;                      /* shift cound, used in hash function */
-  int mask;                           /* used to select bits for hashing */
-} inthash_t;
-
-#define HASH_FAIL -1
-
-#if defined(VMDPLUGIN_STATIC)
-#define VMDEXTERNSTATIC static
-#include "inthash.c"
-#else
-
-#define VMDEXTERNSTATIC 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** initialize hash table for first use */
-void inthash_init(inthash_t *, int);
-
-/** lookup a string key in the hash table returning its integer key */
-int inthash_lookup(const inthash_t *, int);
-
-/** insert a string into the hash table, along with an integer key */
-int inthash_insert(inthash_t *, int, int);
-
-/** delete an string from the hash table, given its string name */
-int inthash_delete(inthash_t *, int);
-
-/** return the number of entries in the hash table */
-int inthash_entries(inthash_t *);
-
-/** destroy the hash table completely, deallocate memory */
-void inthash_destroy(inthash_t *);
-
-/** print hash table vital stats */
-char *inthash_stats(inthash_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/jsplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/jsplugin.c
deleted file mode 100644
index 50a3f1b0b52226c4ed03a567ea5f91c0e2b68f5d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/jsplugin.c
+++ /dev/null
@@ -1,2157 +0,0 @@
-/***************************************************************************
- *cr                                                                       
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the           
- *cr                        University of Illinois                       
- *cr                         All Rights Reserved                        
- *cr                                                                   
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: jsplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.77 $       $Date: 2016/11/30 23:28:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   This plugin implements a high-performance binary molecular structure
- *   and trajectory storage format.  This file format currently uses a simple 
- *   non-redundant hash table approach for compression of per-atom
- *   character strings, properties, and tags.  Trajectory data is stored 
- *   with a file structure that avoids the need to transpose or convert
- *   dense blocks of cartesian coordinates into the most commonly used
- *   interleaved  x/y/z ordering.  The file structure also enables zero-copy 
- *   vectorized I/O methods to be used high-performance reads for 
- *   visualization and analysis with reduced operating system overhead.
- *   The plugin optionally supports the use of a block-based file structure
- *   and block-aligned memory buffers for direct I/O that bypasses the 
- *   OS filesystem buffer caches for multi-gigabyte-per-second read rates
- *   from SSD RAID arrays.
- *
- *   At present, only VMD, NAMD, and psfgen make use of this format.
- *   It started out as a test/example code and is slowly becoming
- *   more robust and featureful.
- *
- *   We should be able to implement a selective read approach that gathers
- *   discontiguous blocks of the trajectory using the POSIX lio_listio()
- *   APIs.  On Unix we currently use I/O wrappers that are based on the 
- *   lseek() and readv() APIs.  By using lio_listio() we could eliminate
- *   the separate lseek calls and service multiple timestep reads in a 
- *   single request, even included cases with discontiguous requests.
- *
- *   VMD test results for Linux host with an 8-way RAID0 of commodity 
- *   Intel 510 SSDs with SATA III 6Gbit/sec interfaces:
- *     Non-direct I/O using standard readv(): 1203 MB/sec
- *     Direct I/O, readv(), 4KB blocked file: 2130 MB/sec
- *
- *  Standalone test binary compilation flags for 64-bit Linux:
- *  cc -O3 -m64 -I../../include -DTEST_JSPLUGIN jsplugin.c \
- *    -o ~/bin/readjs -lm
- *  
- *  Standalone test binary compilation flags for 64-bit Linux w/ CUDA:
- *  cc -O3 -m64 -I../../include -I/usr/local/encap/cuda-4.0/include \
- *    -DTEST_JSPLUGIN -DENABLECUDATESTS jsplugin.c \
- *    -o ~/bin/readjs -L/usr/local/encap/cuda-4.0/lib64 -lcudart -lm
- *
- *  Standalone test binary compilation flags for Solaris:
- *  cc -fast -xarch=v9a -I../../include -DTEST_JSPLUGIN jsplugin.c \
- *    -o ~/bin/readjs -lm
- *
- *  Profiling flags for Solaris:
- *  cc -xpg -fast -xarch=v9a -g -I../../include -DTEST_JSPLUGIN jsplugin.c \
- *    -o ~/bin/readjs -lm
- *
- ***************************************************************************/
-
-#define INFOMSGS  1
-
-#if 1
-#define ENABLEJSSHORTREADS 1
-#endif
-
-#define VMDPLUGIN_STATIC
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-#include "fastio.h"       /* must come before others, for O_DIRECT...   */
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "hash.h"
-#include "endianswap.h"
-#include "molfile_plugin.h"
-
-
-/* allocate memory and return a pointer that is aligned on a given   */
-/* byte boundary, to be used for page- or sector-aligned I/O buffers */
-/* We use this if posix_memalign() is not available...               */
-#if 1 /* sizeof(unsigned long) == sizeof(void*) */
-#define myintptrtype unsigned long
-#elif 1   /* sizeof(size_t) == sizeof(void*) */
-#define myintptrtype size_t
-#else
-#define myintptrtype uintptr_t  /* C99 */
-#endif
-/*
- * XXX On MSVC we get warnings about type conversions for 
- *     size_t vs. fio_size_t
- */
-static void *alloc_aligned_ptr(size_t sz, size_t blocksz, void **unalignedptr) {
-  /* pad the allocation to an even multiple of the block size */
-  size_t padsz = (sz + (blocksz - 1)) & (~(blocksz - 1));
-  void * ptr = malloc(padsz + blocksz);
-  *unalignedptr = ptr;
-  return (void *) ((((myintptrtype) ptr) + (blocksz-1)) & (~(blocksz-1)));
-}
-
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#define JSHEADERSTRING   "JS Binary Structure and Trajectory File Format"                
-#define JSMAGICNUMBER    0x31337
-#define JSENDIANISM      0x12345678
-
-#define JSMAJORVERSION   2
-#define JSMINORVERSION   15
-
-#define JSNFRAMESOFFSET  (strlen(JSHEADERSTRING) + 20)
-
-#define JSNOERR             0
-#define JSBADFILE           1
-#define JSBADFORMAT         2
-
-
-/* Threshold atom count beyond which block-based I/O is used by default */
-/* The overhead from block-alignment padding bytes becomes essentially  */
-/* inconsequential (< 1%) for structures with more than 50,000 atoms.   */
-#define JSBLOCKIO_THRESH    50000
-
-
-/* Option flag macros and their meanings */
-#define JSOPT_NOOPTIONS     0x00000000  /* no structure, only coords    */
-
-/* Timesteps are block-size padded and page- or sector-aligned for      */
-/* direct I/O, using  OS-specific APIs that completely bypass the OS    */
-/* kernel filesystem buffer cache.                                      */
-/* The use of direct I/O APIs can raise performance tremendously on     */
-/* high-end RAIDs.  Tests on an 8-way RAID0 of Intel 510 SSDs raise the */
-/* peak I/O rate from 1100 MB/sec up to 2020 MB/sec with direct I/O.    */
-#define JSOPT_TS_BLOCKIO    0x10000000
-
-/* large data blocks */
-#define JSOPT_STRUCTURE     0x00000001  /* file contains structure data */
-#define JSOPT_BONDS         0x00000002  /* file contains bond info      */
-#define JSOPT_BONDORDERS    0x00000004  /* file contains bond orders    */
-#define JSOPT_ANGLES        0x00000008  /* file contains angle info     */
-#define JSOPT_CTERMS        0x00000010  /* file contains cross-terms    */
-
-/* optional per-atom fields */
-#define JSOPT_OCCUPANCY     0x00000100  /* file contains occupancy      */
-#define JSOPT_BFACTOR       0x00000200  /* file contains b-factor       */
-#define JSOPT_MASS          0x00000400  /* file contains masses         */
-#define JSOPT_CHARGE        0x00000800  /* file contains charges        */
-#define JSOPT_RADIUS        0x00001000  /* file contains radii          */
-#define JSOPT_ATOMICNUMBER  0x00002000  /* file contains atomic numbers */
-
-typedef struct {
-  int verbose;                 /* flag to enable console info output    */
-  fio_fd fd;                   /* main file descriptor                  */
-  long natoms;                 /* handle uses a long type for natoms to */
-                               /* help force promotion of file offset   */
-                               /* arithmetic to long types              */
-
-#if JSMAJORVERSION > 1
-  int parsed_structure;        /* flag indicating structure is parsed   */
-  char *path;                  /* path to file                          */
-
-  /* info for block-based direct I/O */ 
-  int directio_enabled;        /* block-based direct I/O is available   */
-  fio_fd directio_fd;          /* block-based direct I/O using O_DIRECT */
-  int directio_block_size;     /* block size to use for direct ts I/O   */
-  void *directio_ucell_ptr;    /* unaligned unit cell buffer ptr        */
-  void *directio_ucell_blkbuf; /* block-aligned unit cell buffer pt r   */
-
-  /* timestep file offset, block padding, and stride information */
-  fio_size_t ts_file_offset;   /* file offset to first timestep         */
-  fio_size_t ts_crd_sz;        /* size of TS coordinates                */
-  fio_size_t ts_crd_padsz;     /* size of TS block-padded coordinates   */
-  fio_size_t ts_ucell_sz;      /* size of TS unit cell                  */
-  fio_size_t ts_ucell_padsz;   /* size of TS block-padded unit cell     */
-  
-  /* structure info */
-  int optflags;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-
-  /* bond info */
-  int nbonds;
-  int *bondfrom;
-  int *bondto;
-  float *bondorders;
-
-  /* angle/dihedral/improper/cross-term info */
-  int numangles, *angles;
-  int numdihedrals, *dihedrals;
-  int numimpropers, *impropers;
-  int numcterms, *cterms;
-#endif
-
-  /* trajectory info */
-  int nframes;
-  double tsdelta;
-  int reverseendian;
-  int with_unitcell;
-
-} jshandle;
-
-
-/* Use block-based I/O by default when writing structures larger */
-/* than JSBLOCKIO_THRESH atoms, or when directed by the user and */
-/* not otherwise prohibited...                                   */
-static int js_blockio_check_and_set(jshandle *js) {
-  if ((getenv("VMDJSNOBLOCKIO") == NULL) && 
-      ((js->natoms > JSBLOCKIO_THRESH) || getenv("VMDJSBLOCKIO"))) {
-    js->optflags |= JSOPT_TS_BLOCKIO;
-    js->directio_block_size = MOLFILE_DIRECTIO_MIN_BLOCK_SIZE; 
-  }
-}
-
-
-static void *open_js_read(const char *path, const char *filetype, int *natoms) {
-  jshandle *js;
-  int jsmagicnumber, jsendianism, jsmajorversion, jsminorversion;
-  struct stat stbuf;
-  char strbuf[1024];
-  int tmpnatoms=0;
-
-  if (!path) return NULL;
-
-  /* See if the file exists, and get its size */
-  memset(&stbuf, 0, sizeof(struct stat));
-  if (stat(path, &stbuf)) {
-    printf("jsplugin) Could not access file '%s'.\n", path);
-    perror("jsplugin) stat: ");
-/*    return NULL; */
-  }
-
-  js = (jshandle *)malloc(sizeof(jshandle));
-  memset(js, 0, sizeof(jshandle));
-  js->verbose = (getenv("VMDJSVERBOSE") != NULL);
-#if JSMAJORVERSION > 1
-  js->parsed_structure=0;
-  js->directio_block_size=1;
-  js->directio_ucell_ptr = NULL;
-  js->directio_ucell_blkbuf = NULL;
-
-  js->directio_enabled=0;
-  js->ts_file_offset=0;
-  js->ts_crd_sz=0;
-  js->ts_ucell_sz=0;
-  js->ts_crd_padsz=0;
-  js->ts_ucell_padsz=0;
-#endif
-
-  if (fio_open(path, FIO_READ, &js->fd) < 0) {
-    printf("jsplugin) Could not open file '%s' for reading.\n", path);
-    free(js);
-    return NULL;
-  }
-
-  /* emit header information */
-  fio_fread(strbuf, strlen(JSHEADERSTRING), 1, js->fd);
-  strbuf[strlen(JSHEADERSTRING)] = '\0';
-  if (strcmp(strbuf, JSHEADERSTRING)) {
-    printf("jsplugin) Bad trajectory header!\n");
-    printf("jsplugin) Read string: %s\n", strbuf);
-    fio_fclose(js->fd);
-    free(js);
-    return NULL;
-  }
-
-  fio_read_int32(js->fd, &jsmagicnumber);
-  fio_read_int32(js->fd, &jsendianism);
-  fio_read_int32(js->fd, &jsmajorversion);
-  fio_read_int32(js->fd, &jsminorversion);
-  fio_read_int32(js->fd, &tmpnatoms); /* handle-internal natoms is a long */
-  fio_read_int32(js->fd, &js->nframes);
-  if ((jsmagicnumber != JSMAGICNUMBER) || (jsendianism != JSENDIANISM)) {
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) opposite endianism file, enabling byte swapping\n");
-#endif
-    js->reverseendian = 1;
-    swap4_aligned(&jsmagicnumber, 1);
-    swap4_aligned(&jsendianism, 1);
-    swap4_aligned(&jsmajorversion, 1);
-    swap4_aligned(&jsminorversion, 1);
-    swap4_aligned(&tmpnatoms, 1); /* handle-internal natoms is a long */
-    swap4_aligned(&js->nframes, 1);
-  } else {
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) native endianism file\n");
-#endif
-  }
-
-  if ((jsmagicnumber != JSMAGICNUMBER) || (jsendianism != JSENDIANISM)) {
-    fio_fclose(js->fd);
-    free(js);
-    return NULL;
-  }
- 
-  if (jsmajorversion != JSMAJORVERSION) {
-    printf("jsplugin) major version mismatch\n");
-    printf("jsplugin)   file version: %d\n", jsmajorversion);
-    printf("jsplugin)   plugin version: %d\n", JSMAJORVERSION);
-    fio_fclose(js->fd);
-    free(js);
-    return NULL;
-  }
-
-  /* Copy integer natoms to handle natoms, which is a long. */
-  /* The handle natoms uses long to help force promotion of */
-  /* integer file offset calculations to long types...      */
-  js->natoms = tmpnatoms;
-  *natoms = tmpnatoms;
-
-  /* copy path if we succeeded in opening the file */
-  js->path = (char *) calloc(strlen(path)+1, 1);
-  strcpy(js->path, path);
-
-  return js;
-}
-
-
-#if JSMAJORVERSION > 1
-
-/* Compute the file offset for the first timestep and move */
-/* the file pointer to the correct position to read/write  */
-/* the first timestep.  Takes care of block alignment when */
-/* needed.                                                 */ 
-static int js_calc_timestep_blocking_info(void *mydata) {
-  fio_size_t ts_block_offset, bszmask;
-  jshandle *js = (jshandle *) mydata;
-  int iorc=0;
-
-  /* Record the current file offset so we can use it to */
-  /* compute the absolute offset to the first timestep. */
-  js->ts_file_offset = fio_ftell(js->fd);
-
-  /* pad current offset to the start of the next block  */ 
-  bszmask = js->directio_block_size - 1;
-  ts_block_offset = (js->ts_file_offset + bszmask) & (~bszmask);
-
-#if defined(INFOMSGS)
-  if (js->verbose) {
-    printf("jsplugin) TS block size %ld  curpos: %ld  blockpos: %ld\n", 
-           (long) js->directio_block_size, 
-           (long) js->ts_file_offset, 
-           (long) ts_block_offset);
-  }
-#endif
-
-  /* seek to the first block of the first timestep */
-  js->ts_file_offset = ts_block_offset;
-  if (js->directio_enabled)
-    iorc = fio_fseek(js->directio_fd, js->ts_file_offset, FIO_SEEK_SET);
-  else
-    iorc = fio_fseek(js->fd, js->ts_file_offset, FIO_SEEK_SET);
-  if (iorc < 0) {
-    perror("jsplugin) fseek(): ");
-  }
-
-  /* compute timestep block padding/skipping for both */
-  /* coordinate blocks and unit cell blocks           */
-  js->ts_crd_sz = js->natoms * 3L * sizeof(float);
-  js->ts_crd_padsz = (js->ts_crd_sz + bszmask) & (~bszmask);
-
-  js->ts_ucell_sz = 6L * sizeof(double);
-  js->ts_ucell_padsz = (js->ts_ucell_sz + bszmask) & (~bszmask);
-
-  /* allocate TS unit cell buffer in an aligned, block-size-multiple buffer */
-  /* unaligned unit cell buffer ptr */
-#if defined(USE_POSIX_MEMALIGN)
-  if (posix_memalign((void**) &js->directio_ucell_ptr, 
-      js->directio_block_size, js->ts_ucell_padsz)) {
-    printf("jsplugin) Couldn't allocate aligned unit cell block buffer!\n");
-  }
-  /* the returned pointer is already block-aligned, and can free() */
-  js->directio_ucell_blkbuf = js->directio_ucell_ptr;
-#else
-  js->directio_ucell_blkbuf = (float *) 
-    alloc_aligned_ptr(js->ts_ucell_padsz, js->directio_block_size, 
-                      (void**) &js->directio_ucell_ptr);
-#endif
-
-#if defined(INFOMSGS)
-  if (js->verbose) {
-    printf("jsplugin) TS crds sz: %ld psz: %ld  ucell sz: %ld psz: %ld\n",
-           (long) js->ts_crd_sz,
-           (long) js->ts_crd_padsz, 
-           (long) js->ts_ucell_sz, 
-           (long) js->ts_ucell_padsz);
-  }
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_js_structure(void *mydata, int *optflags,
-                             molfile_atom_t *atoms) {
-  jshandle *js = (jshandle *) mydata;
-  long i;
-
-  if (optflags != NULL)
-    *optflags = MOLFILE_NOOPTIONS; /* set to no options until we read them */
-
-  /* read flags data from the file */
-  fio_read_int32(js->fd, &js->optflags); 
-  if (js->reverseendian)
-    swap4_aligned(&js->optflags, 1);
-
-#if defined(INFOMSGS)
-  if (js->verbose)
-    printf("jsplugin) read option flags: %0x08x\n", js->optflags);
-#endif
-
-  /* Check to see if block-based trajectory I/O is used  */
-  /* and read in the block size for this file.           */
-  if (js->optflags & JSOPT_TS_BLOCKIO) {
-    fio_fread(&js->directio_block_size, sizeof(int), 1, js->fd);
-    if (js->reverseendian)
-      swap4_aligned(&js->directio_block_size, 1);
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) Block-based I/O enabled: block size %d bytes\n", 
-             js->directio_block_size);
-    }
-#endif
-
-    /* Check to ensure that we can handle the block size used by the */
-    /* file we are reading.  We may use variable block sizes in      */
-    /* the future as more high-end filesystems begin to support      */
-    /* 8KB, 16KB, or larger block sizes for enhanced sequential I/O  */
-    /* performance on very large files.                              */
-    if (js->directio_block_size > MOLFILE_DIRECTIO_MAX_BLOCK_SIZE) {
-      printf("jsplugin) File block size exceeds jsplugin block size limit.\n");
-      printf("jsplugin) Direct I/O unavailable for file '%s'\n", js->path);
-    } else {
-      if (fio_open(js->path, FIO_READ | FIO_DIRECT, &js->directio_fd) < 0) {
-        printf("jsplugin) Direct I/O unavailable for file '%s'\n", js->path);
-      } else {
-        js->directio_enabled = 1;
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin) Direct I/O enabled for file '%s'\n", js->path);
-        }
-#endif
-      } 
-    }
-  }
-
-#if defined(ENABLEJSSHORTREADS)
-  /* test code for an implementation that does short reads that */
-  /* skip bulk solvent, useful for faster loading of very large */
-  /* structures                                                 */
-  if (getenv("VMDJSMAXATOMIDX") != NULL) {
-    long maxatomidx = atoi(getenv("VMDJSMAXATOMIDX"));
-    if (maxatomidx < 0)
-      maxatomidx = 0;
-    if (maxatomidx >= js->natoms)
-      maxatomidx = js->natoms - 1;
-
-    printf("jsplugin) Short-reads of timesteps enabled: %ld / %ld atoms (%.2f%%)\n",
-           maxatomidx, js->natoms, 100.0*(maxatomidx+1) / ((double) js->natoms));
-  }
-#endif
-
-  /* Mark the handle to indicate we've parsed the structure.             */
-  /* If any errors occur after this point, they are likely fatal anyway. */
-  js->parsed_structure = 1;
-
-  /* determine whether or not this file contains structure info or not */
-  if (js->optflags & JSOPT_STRUCTURE) {
-    int numatomnames, numatomtypes, numresnames, numsegids, numchains;
-    char **atomnames = NULL;
-    char **atomtypes = NULL;
-    char **resnames = NULL;
-    char **segids = NULL;
-    char **chains = NULL;
-    short *shortbuf = NULL; /* temp buf for decoding atom records */
-    int *intbuf = NULL;     /* temp buf for decoding atom records */
-    float *fltbuf = NULL;   /* temp buf for decoding atom records */
- 
-    /* read in block of name string table sizes */
-    fio_read_int32(js->fd, &numatomnames); 
-    fio_read_int32(js->fd, &numatomtypes); 
-    fio_read_int32(js->fd, &numresnames);
-    fio_read_int32(js->fd, &numsegids);
-    fio_read_int32(js->fd, &numchains); 
-    if (js->reverseendian) {
-      swap4_aligned(&numatomnames, 1);
-      swap4_aligned(&numatomtypes, 1);
-      swap4_aligned(&numresnames, 1);
-      swap4_aligned(&numsegids, 1);
-      swap4_aligned(&numchains, 1);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) reading string tables...\n");
-      printf("jsplugin) %d %d %d %d %d\n",
-             numatomnames, numatomtypes, numresnames, numsegids, numchains);
-    }
-#endif
-
-    /* skip forward to first TS if the caller gives us NULL ptrs */
-    if (optflags == NULL && atoms == NULL) {
-      size_t offset=0;
-      offset += numatomnames * (16L * sizeof(char));
-      offset += numatomtypes * (16L * sizeof(char));
-      offset += numresnames  * (8L * sizeof(char));
-      offset += numsegids    * (8L * sizeof(char));
-      offset += numchains    * (2L * sizeof(char));
-      offset += js->natoms * sizeof(short); /* atom name indices    */
-      offset += js->natoms * sizeof(short); /* atom type indices    */
-      offset += js->natoms * sizeof(short); /* residue name indices */
-      offset += js->natoms * sizeof(short); /* segment name indices */
-      offset += js->natoms * sizeof(short); /* chain name indices   */
-      offset += js->natoms * sizeof(int);   /* residue indices      */
-      
-      /* optional per-atom fields */
-      if (js->optflags & JSOPT_OCCUPANCY)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_BFACTOR)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_MASS)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_CHARGE)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_RADIUS)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_ATOMICNUMBER)
-        offset += js->natoms * sizeof(int);
-
-      fio_fseek(js->fd, offset, FIO_SEEK_CUR);
-      offset=0;
-
-      /* these require actually seeking as we process... */
-      if (js->optflags & JSOPT_BONDS) {
-        fio_fread(&js->nbonds, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->nbonds, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d bonds...\n", js->nbonds);
-        }
-#endif
-
-        offset += 2L * js->nbonds * sizeof(int);
-        if (js->optflags & JSOPT_BONDORDERS)
-          offset += js->nbonds * sizeof(float);
-
-        fio_fseek(js->fd, offset, FIO_SEEK_CUR);
-        offset=0;
-      }
-
-      if (js->optflags & JSOPT_ANGLES) {
-        fio_fread(&js->numangles, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numangles, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d angles...\n", js->numangles);
-        }
-#endif
-        fio_fseek(js->fd, sizeof(int)*3L*js->numangles, FIO_SEEK_CUR);
-
-        fio_fread(&js->numdihedrals, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numdihedrals, 1);
-#if defined(INFOMSGS)
-        printf("jsplugin)   %d dihedrals...\n", js->numdihedrals);
-#endif
-        fio_fseek(js->fd, sizeof(int)*4L*js->numdihedrals, FIO_SEEK_CUR);
-
-        fio_fread(&js->numimpropers, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numimpropers, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d impropers...\n", js->numimpropers);
-        }
-#endif
-        fio_fseek(js->fd, sizeof(int)*4L*js->numimpropers, FIO_SEEK_CUR);
-      }
-
-      if (js->optflags & JSOPT_CTERMS) {
-        fio_fread(&js->numcterms, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numcterms, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d cterms...\n", js->numcterms);
-        }
-#endif
-        fio_fseek(js->fd, sizeof(int)*8L*js->numcterms, FIO_SEEK_CUR);
-      }
-  
-      /* record the file offset for the first timestep */
-      js_calc_timestep_blocking_info(js);
-
-      return MOLFILE_SUCCESS;
-    }
-
-
-    /* allocate string tables */
-    atomnames = (char **) malloc(numatomnames * sizeof(char *));
-    atomtypes = (char **) malloc(numatomtypes * sizeof(char *));
-    resnames  = (char **) malloc(numresnames  * sizeof(char *));
-    segids    = (char **) malloc(numsegids    * sizeof(char *));
-    chains    = (char **) malloc(numchains    * sizeof(char *));
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom names...\n");
-#endif
-
-    /* read in the string tables */
-    for (i=0; i<numatomnames; i++) {
-      atomnames[i] = (char *) malloc(16L * sizeof(char));
-      fio_fread(atomnames[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom types...\n");
-#endif
-    for (i=0; i<numatomtypes; i++) {
-      atomtypes[i] = (char *) malloc(16L * sizeof(char));
-      fio_fread(atomtypes[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   residue names...\n");
-#endif
-    for (i=0; i<numresnames; i++) {
-      resnames[i] = (char *) malloc(8L * sizeof(char));
-      fio_fread(resnames[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   segment names...\n");
-#endif
-    for (i=0; i<numsegids; i++) {
-      segids[i] = (char *) malloc(8L * sizeof(char));
-      fio_fread(segids[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   chain names...\n");
-#endif
-    for (i=0; i<numchains; i++) {
-      chains[i] = (char *) malloc(2L * sizeof(char));
-      fio_fread(chains[i], 2L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) reading numeric field tables...\n");
-#endif
-    /* read in all of the atom fields */
-    shortbuf = (short *) malloc(js->natoms * sizeof(short));
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom name indices...\n");
-#endif
-    /* read in atom names */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].name, atomnames[shortbuf[i]]);
-    }
-    for (i=0; i<numatomnames; i++)
-      free(atomnames[i]);
-    free(atomnames);
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom type indices...\n");
-#endif
-    /* read in atom types */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].type, atomtypes[shortbuf[i]]);
-    }
-    for (i=0; i<numatomtypes; i++)
-      free(atomtypes[i]);
-    free(atomtypes);
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   residue name indices...\n");
-#endif
-    /* read in resnames */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].resname, resnames[shortbuf[i]]);
-    }
-    for (i=0; i<numresnames; i++)
-      free(resnames[i]);
-    free(resnames);
-    
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   segment name indices...\n");
-#endif
-    /* read in segids */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].segid, segids[shortbuf[i]]);
-    }
-    for (i=0; i<numsegids; i++)
-      free(segids[i]);
-    free(segids);
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   chain name indices...\n");
-#endif
-    /* read in chains */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].chain, chains[shortbuf[i]]);
-    }
-    for (i=0; i<numchains; i++)
-      free(chains[i]);
-    free(chains);
-
-    if (shortbuf != NULL) {
-      free(shortbuf);
-      shortbuf=NULL;
-    }
-
-    /* 
-     * read in integer data blocks 
-     */
-    intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   residue indices...\n");
-#endif
-    /* read in resid */
-    fio_fread(intbuf, js->natoms * sizeof(int), 1, js->fd);
-    if (js->reverseendian)
-      swap4_aligned(intbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      atoms[i].resid = intbuf[i];
-    }    
-     
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) reading optional per-atom tables...\n");
-#endif
-    /*
-     * read in optional single-precision float data blocks
-     */ 
-    if (js->optflags & (JSOPT_OCCUPANCY | JSOPT_BFACTOR | 
-        JSOPT_MASS | JSOPT_RADIUS | JSOPT_CHARGE)) 
-      fltbuf = (float *) malloc(js->natoms * sizeof(float));
-
-    /* read in optional data if it exists */
-    if (js->optflags & JSOPT_OCCUPANCY) {
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   occupancy...\n");
-#endif
-      *optflags |= MOLFILE_OCCUPANCY;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].occupancy = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_BFACTOR) {
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   bfactor...\n");
-#endif
-      *optflags |= MOLFILE_BFACTOR;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].bfactor = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_MASS) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   mass...\n");
-#endif
-      *optflags |= MOLFILE_MASS;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].mass = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_CHARGE) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   charge...\n");
-#endif
-      *optflags |= MOLFILE_CHARGE;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].charge = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_RADIUS) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   radius...\n");
-#endif
-      *optflags |= MOLFILE_RADIUS;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].radius = fltbuf[i];
-      }    
-    }
-
-    if (fltbuf != NULL) {
-      free(fltbuf);
-      fltbuf=NULL;
-    }
-
-    /*
-     * read in optional integer data blocks
-     */ 
-    if (js->optflags & JSOPT_ATOMICNUMBER)
-      intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-    if (js->optflags & JSOPT_ATOMICNUMBER) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   atomic number...\n");
-#endif
-      *optflags |= MOLFILE_ATOMICNUMBER;
-      fio_fread(intbuf, js->natoms * sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(intbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].atomicnumber = intbuf[i];
-      }    
-    }
-
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-
-    /*
-     * read in bonds and fractional bond orders
-     */ 
-    if (js->optflags & JSOPT_BONDS) {
-      fio_fread(&js->nbonds, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->nbonds, 1);
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d bonds...\n", js->nbonds);
-#endif
-
-      js->bondfrom = (int *) malloc(js->nbonds * sizeof(int));
-      js->bondto = (int *) malloc(js->nbonds * sizeof(int));
-      fio_fread(js->bondfrom, js->nbonds * sizeof(int), 1, js->fd);
-      fio_fread(js->bondto, js->nbonds * sizeof(int), 1, js->fd);
-      if (js->reverseendian) {
-        swap4_aligned(js->bondfrom, js->nbonds);
-        swap4_aligned(js->bondto, js->nbonds);
-      }
-
-      if (js->optflags & JSOPT_BONDORDERS) {
-#if defined(INFOMSGS)
-        if (js->verbose)
-          printf("jsplugin)   bond orders...\n");
-#endif
-        js->bondorders = (float *) malloc(js->nbonds * sizeof(float));
-        fio_fread(js->bondorders, js->nbonds * sizeof(float), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(js->bondorders, js->nbonds);
-      }
-    }
-
-    if (js->optflags & JSOPT_ANGLES) {
-      fio_fread(&js->numangles, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numangles, 1);
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d angles...\n", js->numangles);
-#endif
-      js->angles = (int *) malloc(3L * js->numangles * sizeof(int));
-      fio_fread(js->angles, sizeof(int)*3L*js->numangles, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->angles, 3L*js->numangles);
-
-      fio_fread(&js->numdihedrals, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numdihedrals, 1);
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d dihedrals...\n", js->numdihedrals);
-#endif
-      js->dihedrals = (int *) malloc(4L * js->numdihedrals * sizeof(int));
-      fio_fread(js->dihedrals, sizeof(int)*4L*js->numdihedrals, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->dihedrals, 4L*js->numdihedrals);
-
-      fio_fread(&js->numimpropers, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numimpropers, 1);
-      js->impropers = (int *) malloc(4L * js->numimpropers * sizeof(int));
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d impropers...\n", js->numimpropers);
-#endif
-      fio_fread(js->impropers, sizeof(int)*4L*js->numimpropers, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->impropers, 4L*js->numimpropers);
-    }
-    if (js->optflags & JSOPT_CTERMS) {
-      fio_fread(&js->numcterms, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numcterms, 1);
-      js->cterms = (int *) malloc(8L * js->numcterms * sizeof(int));
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d cterms...\n", js->numcterms);
-#endif
-      fio_fread(js->cterms, sizeof(int)*8L*js->numcterms, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->cterms, 8L*js->numcterms);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) final optflags: %08x\n", *optflags);
-      printf("jsplugin) structure information complete\n");
-    }
-#endif
-
-    /* record the file offset for the first timestep */
-    js_calc_timestep_blocking_info(js);
-
-    return MOLFILE_SUCCESS;
-  }
-
-#if defined(INFOMSGS)
-  if (js->verbose)
-    printf("jsplugin) no structure information available\n");
-#endif
-
-  /* record the file offset for the first timestep */
-  js_calc_timestep_blocking_info(js);
-
-  /* else, we have no structure information */
-  return MOLFILE_NOSTRUCTUREDATA;
-}
-
-
-static int read_js_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                         float **bondorder, int **bondtype, 
-                         int *nbondtypes, char ***bondtypename) {
-  jshandle *js = (jshandle *)v;
-
-  *nbonds = 0;
-  *fromptr = NULL;
-  *toptr = NULL;
-  *bondorder = NULL;
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  if (js->optflags & JSOPT_BONDS) {
-    *nbonds = js->nbonds;
-    *fromptr = js->bondfrom;
-    *toptr = js->bondto;
-
-    if (js->optflags & JSOPT_BONDORDERS) {
-      *bondorder = js->bondorders;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int read_js_angles(void *v, int *numangles, int **angles, 
-                          int **angletypes, int *numangletypes, 
-                          char ***angletypenames, int *numdihedrals,
-                          int **dihedrals, int **dihedraltypes, 
-                          int *numdihedraltypes, char ***dihedraltypenames,
-                          int *numimpropers, int **impropers, 
-                          int **impropertypes, int *numimpropertypes, 
-                          char ***impropertypenames, int *numcterms, 
-                          int **cterms, int *ctermcols, int *ctermrows) {
-  jshandle *js = (jshandle *)v;
-
-  /* initialize data to zero */
-  *numangles         = 0;
-  *angles            = NULL;
-  *angletypes        = NULL;
-  *numangletypes     = 0;
-  *angletypenames    = NULL;
-  *numdihedrals      = 0;
-  *dihedrals         = NULL;
-  *dihedraltypes     = NULL;
-  *numdihedraltypes  = 0;
-  *dihedraltypenames = NULL;
-  *numimpropers      = 0;
-  *impropers         = NULL;
-  *impropertypes     = NULL;
-  *numimpropertypes  = 0;
-  *impropertypenames = NULL;
-  *numcterms         = 0;
-  *cterms            = NULL;
-  *ctermrows         = 0;
-  *ctermcols         = 0;
-
-  *numangles = js->numangles;
-  *angles = js->angles;
-
-  *numdihedrals = js->numdihedrals;
-  *dihedrals = js->dihedrals;
-
-  *numimpropers = js->numimpropers;
-  *impropers = js->impropers;
-
-  *numcterms = js->numcterms;
-  *cterms = js->cterms;
-  *ctermcols = 0;
-  *ctermrows = 0;
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_js_angles(void *v,
-               int *numangles,    int **angles,    double **angleforces,
-               int *numdihedrals, int **dihedrals, double **dihedralforces,
-               int *numimpropers, int **impropers, double **improperforces,
-               int *numcterms,    int **cterms,
-               int *ctermcols,    int *ctermrows,  double **ctermforces) {
-  jshandle *js = (jshandle *)v;
-
-  *numangles = js->numangles;
-  *angles = js->angles;
-  *angleforces = NULL;
-
-  *numdihedrals = js->numdihedrals;
-  *dihedrals = js->dihedrals;
-  *dihedralforces = NULL;
-
-  *numimpropers = js->numimpropers;
-  *impropers = js->impropers;
-  *improperforces = NULL;
-
-  *numcterms = js->numcterms;
-  *cterms = js->cterms;
-  *ctermcols = 0;
-  *ctermrows = 0;
-  *ctermforces = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-#endif
-
-
-static int read_js_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  jshandle *js = (jshandle *)v;
-  fio_size_t framelen;
-
-#if JSMAJORVERSION > 1
-  /* If we haven't yet read (or skipped) the structure data, then we    */
-  /* need to begin by skipping past it before we try to read the        */
-  /* first timestep.  In the case of files with block-aligned timesteps,*/
-  /* this will also get our file pointer to the right block-aligned     */
-  /* location.                                                          */
-  if (!js->parsed_structure)
-    read_js_structure(v, NULL, NULL);
-#endif
-
-  /* compute total read/seek size of timestep */
-  framelen = js->ts_crd_padsz + js->ts_ucell_padsz;
-
-  /* if we have a valid ts pointer, read the timestep, otherwise skip it */ 
-  if (ts != NULL) {
-    fio_size_t readlen; 
-    fio_iovec iov[2];
-
-    /* set unit cell pointer to the TS block-aligned buffer area */
-    double *unitcell = (double *) js->directio_ucell_blkbuf;
-
-    unitcell[0] = unitcell[2] = unitcell[5] = 1.0f;
-    unitcell[1] = unitcell[3] = unitcell[4] = 90.0f;
-
-#if defined(ENABLEJSSHORTREADS)
-    /* test code for an implementation that does short reads that */
-    /* skip bulk solvent, useful for faster loading of very large */
-    /* structures                                                 */
-    if (getenv("VMDJSMAXATOMIDX") != NULL) {
-      fio_size_t bszmask;
-      long maxatompadsz, skipatompadsz;
-
-      long maxatomidx = atoi(getenv("VMDJSMAXATOMIDX"));
-      if (maxatomidx < 0)
-        maxatomidx = 0;
-      if (maxatomidx >= js->natoms)
-        maxatomidx = js->natoms - 1;
-
-      /* pad max read to the start of the next block  */
-      bszmask = js->directio_block_size - 1;
-      maxatompadsz = ((maxatomidx*3L*sizeof(float)) + bszmask) & (~bszmask);
-      skipatompadsz = js->ts_crd_padsz - maxatompadsz;
-
-      readlen=0;
-      if (js->directio_enabled) {
-        if (fio_fread(ts->coords, maxatompadsz, 1, js->directio_fd) == 1)
-          readlen = maxatompadsz;
-        if (fio_fseek(js->directio_fd, skipatompadsz, FIO_SEEK_CUR) == 0)
-          readlen += skipatompadsz;
-        if (fio_fread(unitcell, js->ts_ucell_padsz, 1, js->directio_fd) == 1)
-          readlen += js->ts_ucell_padsz;
-      } else {
-        if (fio_fread(ts->coords, maxatompadsz, 1, js->fd) == 1)
-          readlen = maxatompadsz;
-        if (fio_fseek(js->fd, skipatompadsz, FIO_SEEK_CUR) == 0)
-          readlen += skipatompadsz;
-        if (fio_fread(unitcell, js->ts_ucell_padsz, 1, js->fd) == 1)
-          readlen += js->ts_ucell_padsz;
-      }
-
-#if 0
-      /* clear all non-read atom coords to zeros */
-      memset(ts->coords+3L*maxatomidx,0,3L*sizeof(float)*(js->natoms-maxatomidx));
-#endif
-
-    }  else {
-#endif
- 
-    /* setup the I/O vector */
-    iov[0].iov_base = (fio_caddr_t) ts->coords;   /* read coordinates    */
-    iov[0].iov_len  = js->ts_crd_padsz;
-    iov[1].iov_base = (fio_caddr_t) unitcell;     /* read PBC unit cell  */
-    iov[1].iov_len  = js->ts_ucell_padsz;
-
-#if 1
-    /* Use fall-back code instead of readv():                            */
-    /*  Some platforms implement readv() as user level code in libc,     */
-    /*  and due to POSIX atomicity requirements for readv()/writev(),    */
-    /*  they may copy data to internal temp buffers, which can kill      */
-    /*  performance, and in cases when doing single I/O ops on large,    */
-    /*  buffers, e.g. > 2GB, can fail with shorts reads or writes...     */
-    /*  On such platforms it is best to avoid using readv()/writev()...  */
-    {
-      int readcnt = 0;
-      readlen = 0;
-      if (js->directio_enabled) {
-        readcnt =  fio_fread(iov[0].iov_base, iov[0].iov_len, 1, js->directio_fd);
-        readcnt += fio_fread(iov[1].iov_base, iov[1].iov_len, 1, js->directio_fd);
-      } else {
-        readcnt =  fio_fread(iov[0].iov_base, iov[0].iov_len, 1, js->fd);
-        readcnt += fio_fread(iov[1].iov_base, iov[1].iov_len, 1, js->fd);
-      }
-
-      /* if both records read correctly, then the reads are okay */
-      if (readcnt == 2)
-        readlen = framelen;
-    }
-#else
-    /* Do all of the reads with a single syscall, for peak efficiency.   */
-    /* On smart kernels, readv() causes only one context switch, and     */
-    /* can effeciently scatter the reads to the various buffers.         */
-    if (js->directio_enabled)
-      readlen = fio_readv(js->directio_fd, &iov[0], 2); 
-    else
-      readlen = fio_readv(js->fd, &iov[0], 2); 
-#endif
-
-#if defined(ENABLEJSSHORTREADS)
-   }
-#endif 
- 
-    /* check the number of read bytes versus what we expected */
-    if (readlen != framelen) {
-      if (readlen < 0) {
-        perror("jsplugin) fio_readv(): ");
-      } else if (readlen != 0) {
-        printf("jsplugin) mismatched read: %ld, expected %ld\n", 
-               (long) readlen, (long) framelen);
-      }
-
-      return MOLFILE_EOF;
-    }
-
-    /* perform byte swapping if necessary */
-    if (js->reverseendian) {
-      swap4_aligned(ts->coords, js->natoms * 3L);
-      swap8_aligned(unitcell, 6);
-    }
-
-    /* copy unit cell values into VMD */
-    ts->A = unitcell[0];
-    ts->B = unitcell[1];
-    ts->C = unitcell[2];
-    ts->alpha = 90.0 - asin(unitcell[3]) * 90.0 / M_PI_2;
-    ts->beta  = 90.0 - asin(unitcell[4]) * 90.0 / M_PI_2;
-    ts->gamma = 90.0 - asin(unitcell[5]) * 90.0 / M_PI_2;
-  } else {
-    /* skip this frame, seek to the next frame */
-    if (js->directio_enabled) {
-      if (fio_fseek(js->directio_fd, framelen, FIO_SEEK_CUR)) 
-        return MOLFILE_EOF;
-    } else {
-      if (fio_fseek(js->fd, framelen, FIO_SEEK_CUR)) 
-        return MOLFILE_EOF;
-    }
-  }
- 
-  return MOLFILE_SUCCESS;
-}
- 
-
-static void close_js_read(void *v) {
-  jshandle *js = (jshandle *)v;
-  fio_fclose(js->fd);
-
-#if JSMAJORVERSION > 1
-  if (js->path)
-    free(js->path);
-
-  if (js->directio_enabled)
-    fio_fclose(js->directio_fd);
-
-  if (js->directio_ucell_ptr)
-    free(js->directio_ucell_ptr);
-
-  if (js->bondfrom)
-    free(js->bondfrom);
-  if (js->bondto)
-    free(js->bondto);
-  if (js->bondorders)
-    free(js->bondorders);
-
-  /* free angle data */
-  if (js->angles != NULL)
-    free(js->angles);
-  if (js->dihedrals != NULL)
-    free(js->dihedrals);
-  if (js->impropers != NULL)
-    free(js->impropers);
-  if (js->cterms)
-    free(js->cterms);
-#endif
-
-  free(js);
-}
-
-
-static void *open_js_write(const char *path, const char *filetype, int natoms) {
-  jshandle *js;
-
-  js = (jshandle *) malloc(sizeof(jshandle));
-  memset(js, 0, sizeof(jshandle));
-#if JSMAJORVERSION > 1
-  js->parsed_structure=0;
-  js->directio_block_size=1;
-  js->directio_ucell_ptr = NULL;
-  js->directio_ucell_blkbuf = NULL;
-
-  js->directio_enabled=0;
-  js->ts_file_offset=0;
-  js->ts_crd_sz=0;
-  js->ts_ucell_sz=0;
-  js->ts_crd_padsz=0;
-  js->ts_ucell_padsz=0;
-#endif
-
-  if (fio_open(path, FIO_WRITE, &js->fd) < 0) {
-    printf("jsplugin) Could not open file %s for writing\n", path);
-    free(js);
-    return NULL;
-  }
-
-  js->natoms = natoms;
-  js->with_unitcell = 1;
-
-  /* emit header information */
-  fio_write_str(js->fd, JSHEADERSTRING);
-  fio_write_int32(js->fd, JSMAGICNUMBER);
-  fio_write_int32(js->fd, JSENDIANISM);
-  fio_write_int32(js->fd, JSMAJORVERSION);
-  fio_write_int32(js->fd, JSMINORVERSION);
-
-  /* write number of atoms */
-  fio_write_int32(js->fd, natoms);
-
-  /* write number of frames, to be updated later */
-  js->nframes = 0;
-  fio_write_int32(js->fd, js->nframes);
-
-  return js;
-}
-
-
-#if JSMAJORVERSION > 1
-
-static int write_js_structure(void *mydata, int optflags,
-                              const molfile_atom_t *atoms) {
-  jshandle *js = (jshandle *) mydata;
-  long i;
-
-  /* use block-based I/O by default when writing structures larger */
-  /* than JSBLOCKIO_THRESH atoms, or when directed by the user     */
-  js_blockio_check_and_set(js);
-
-  js->optflags |= JSOPT_STRUCTURE;
-
-  if (optflags & MOLFILE_OCCUPANCY)
-    js->optflags |= JSOPT_OCCUPANCY;
-
-  if (optflags & MOLFILE_BFACTOR)
-    js->optflags |= JSOPT_BFACTOR;
-
-  if (optflags & MOLFILE_BFACTOR)
-    js->optflags |= JSOPT_BFACTOR;
-
-  if (optflags & MOLFILE_MASS)
-    js->optflags |= JSOPT_MASS;
-
-  if (optflags & MOLFILE_CHARGE)
-    js->optflags |= JSOPT_CHARGE;
- 
-  if (optflags & MOLFILE_RADIUS)
-    js->optflags |= JSOPT_RADIUS;
-
-  if (optflags & MOLFILE_ATOMICNUMBER)
-    js->optflags |= JSOPT_ATOMICNUMBER;
-
-  /* write flags data to the file */
-  fio_write_int32(js->fd, js->optflags); 
-printf("jsplugin) writing option flags: %0x08x\n", js->optflags);
-
-  /* Check to see if block-based trajectory I/O is used  */
-  /* and write out the block size for this file.         */
-  if (js->optflags & JSOPT_TS_BLOCKIO) {
-    fio_fwrite(&js->directio_block_size, sizeof(int), 1, js->fd);
-    printf("jsplugin) Block-based I/O enabled: block size %d bytes\n", 
-           js->directio_block_size);
-  }
-
-printf("jsplugin) writing structure...\n");
-  /* determine whether or not this file contains structure info or not */
-  if (js->optflags & JSOPT_STRUCTURE) {
-    int numatomnames, numatomtypes, numresnames, numsegids, numchains;
-    char **atomnames = NULL;
-    char **atomtypes = NULL;
-    char **resnames = NULL;
-    char **segids = NULL;
-    char **chains = NULL;
-    short *shortbuf = NULL; /* temp buf for encoding atom records */
-    int *intbuf = NULL;     /* temp buf for encoding atom records */
-    float *fltbuf = NULL;   /* temp buf for encoding atom records */
-
-    hash_t tmphash;         /* temporary hash table */
-    hash_t atomnamehash;
-    hash_t atomtypehash;
-    hash_t resnamehash;
-    hash_t segidhash;
-    hash_t chainhash;
-    int hashcnt;
-
-
-printf("jsplugin) counting atom names, types, etc...\n");
-    /* generate hash tables to count the number of unique strings */
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].name, 0);
-    numatomnames = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].type, 0);
-    numatomtypes = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].resname, 0);
-    numresnames = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].segid, 0);
-    numsegids = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].chain, 0);
-    numchains = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
- 
-printf("jsplugin) writing unique string counts...\n");
-printf("jsplugin) %d %d %d %d %d\n",
-       numatomnames, numatomtypes, numresnames, numsegids, numchains);
-
-    /* write block of name string table sizes */
-    fio_write_int32(js->fd, numatomnames); 
-    fio_write_int32(js->fd, numatomtypes); 
-    fio_write_int32(js->fd, numresnames);
-    fio_write_int32(js->fd, numsegids);
-    fio_write_int32(js->fd, numchains); 
-
-printf("jsplugin) writing string tables...\n");
-
-    atomnames = (char **) malloc(numatomnames * sizeof(char *));
-    atomtypes = (char **) malloc(numatomtypes * sizeof(char *));
-    resnames = (char **) malloc(numresnames * sizeof(char *));
-    segids = (char **) malloc(numsegids * sizeof(char *));
-    chains = (char **) malloc(numchains * sizeof(char *));
-
-printf("jsplugin)   atom names...\n");
-    /* generate and write out the string tables */
-    hash_init(&atomnamehash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&atomnamehash, atoms[i].name, hashcnt) == HASH_FAIL) {
-        atomnames[hashcnt] = (char *) calloc(1, 16L * sizeof(char));
-        strcpy(atomnames[hashcnt], atoms[i].name);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numatomnames; i++) {
-      fio_fwrite(atomnames[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   atom types...\n");
-    hash_init(&atomtypehash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&atomtypehash, atoms[i].type, hashcnt) == HASH_FAIL) {
-        atomtypes[hashcnt] = (char *) calloc(1, 16L * sizeof(char));
-        strcpy(atomtypes[hashcnt], atoms[i].type);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numatomtypes; i++) {
-      fio_fwrite(atomtypes[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   residue names...\n");
-    hash_init(&resnamehash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&resnamehash, atoms[i].resname, hashcnt) == HASH_FAIL) {
-        resnames[hashcnt] = (char *) calloc(1, 8L * sizeof(char));
-        strcpy(resnames[hashcnt], atoms[i].resname);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numresnames; i++) {
-      fio_fwrite(resnames[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   segment names...\n");
-    hash_init(&segidhash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&segidhash, atoms[i].segid, hashcnt) == HASH_FAIL) {
-        segids[hashcnt] = (char *) calloc(1, 8L * sizeof(char));
-        strcpy(segids[hashcnt], atoms[i].segid);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numsegids; i++) {
-      fio_fwrite(segids[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   chain names...\n");
-    hash_init(&chainhash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&chainhash, atoms[i].chain, hashcnt) == HASH_FAIL) {
-        chains[hashcnt] = (char *) calloc(1, 2L * sizeof(char));
-        strcpy(chains[hashcnt], atoms[i].chain);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numchains; i++) {
-      fio_fwrite(chains[i], 2L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin) writing numeric field tables...\n");
-    /* write out all of the atom fields */
-    shortbuf = (short *) malloc(js->natoms * sizeof(short));
-
-    /* write out atom names */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&atomnamehash, atoms[i].name);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    /* write out atom types */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&atomtypehash, atoms[i].type);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    /* write out resnames */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&resnamehash, atoms[i].resname);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    
-    /* write out segids */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&segidhash, atoms[i].segid);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    /* write out chains */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&chainhash, atoms[i].chain);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    if (shortbuf != NULL) {
-      free(shortbuf);
-      shortbuf=NULL;
-    }
-
-    /* done with hash tables */
-    hash_destroy(&atomnamehash);
-    hash_destroy(&atomtypehash);
-    hash_destroy(&resnamehash);
-    hash_destroy(&segidhash);
-    hash_destroy(&chainhash);
-
-
-    /* 
-     * write out integer data blocks 
-     */
-    intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-printf("jsplugin)   residue indices...\n");
-    /* write out resid */
-    for (i=0; i<js->natoms; i++) {
-      intbuf[i] = atoms[i].resid;
-    }    
-    fio_fwrite(intbuf, js->natoms * sizeof(int), 1, js->fd);
-     
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-printf("jsplugin) writing optional per-atom tables...\n");
-    /*
-     * write out optional single-precision float data blocks
-     */ 
-    if (js->optflags & (JSOPT_OCCUPANCY | JSOPT_BFACTOR | 
-        JSOPT_MASS | JSOPT_RADIUS | JSOPT_CHARGE)) 
-      fltbuf = (float *) malloc(js->natoms * sizeof(float));
-
-    /* write out optional data if it exists */
-
-    if (js->optflags & JSOPT_OCCUPANCY) {
-printf("jsplugin)   writing occupancy...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].occupancy;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_BFACTOR) {
-printf("jsplugin)   writing bfactor...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].bfactor;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_MASS) { 
-printf("jsplugin)   writing mass...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].mass;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_CHARGE) { 
-printf("jsplugin)   writing charge...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].charge;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_RADIUS) { 
-printf("jsplugin)   writing radius...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].radius;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (fltbuf != NULL) {
-      free(fltbuf);
-      fltbuf=NULL;
-    }
-
-
-    /*
-     * write out optional integer data blocks
-     */ 
-    if (js->optflags & JSOPT_ATOMICNUMBER)
-      intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-    if (js->optflags & JSOPT_ATOMICNUMBER) { 
-printf("jsplugin)   writing atomic number...\n");
-      for (i=0; i<js->natoms; i++) {
-        intbuf[i] = atoms[i].atomicnumber;
-      }    
-      fio_fwrite(intbuf, js->natoms * sizeof(int), 1, js->fd);
-    }
-
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-
-    /*
-     * write out bonds and fractional bond orders
-     */ 
-    if (js->optflags & JSOPT_BONDS) {
-printf("jsplugin) writing bonds...\n");
-      fio_fwrite(&js->nbonds, sizeof(int), 1, js->fd);
-      fio_fwrite(js->bondfrom, js->nbonds * sizeof(int), 1, js->fd);
-      fio_fwrite(js->bondto, js->nbonds * sizeof(int), 1, js->fd);
-
-      if (js->optflags & JSOPT_BONDORDERS) {
-printf("jsplugin) writing bond orders...\n");
-        fio_fwrite(js->bondorders, js->nbonds * sizeof(float), 1, js->fd);
-      }
-    }
-
-    /*
-     * write out angles/dihedrals/impropers/cross-terms
-     */
-    if (js->optflags & JSOPT_ANGLES) {
-printf("jsplugin) writing angles/dihedrals/impropers...\n");
-      fio_fwrite(&js->numangles, sizeof(int), 1, js->fd);
-      fio_fwrite(js->angles, sizeof(int)*3L*js->numangles, 1, js->fd);
-
-      fio_fwrite(&js->numdihedrals, sizeof(int), 1, js->fd);
-      fio_fwrite(js->dihedrals, sizeof(int)*4L*js->numdihedrals, 1, js->fd);
-
-      fio_fwrite(&js->numimpropers, sizeof(int), 1, js->fd);
-      fio_fwrite(js->impropers, sizeof(int)*4L*js->numimpropers, 1, js->fd);
-    }
-    if (js->optflags & JSOPT_CTERMS) {
-printf("jsplugin) writing cross-terms\n");
-      fio_fwrite(&js->numcterms, sizeof(int), 1, js->fd);
-      fio_fwrite(js->cterms, sizeof(int)*8L*js->numcterms, 1, js->fd);
-    }
-
-    /* update the file offset for the first timestep */
-    js_calc_timestep_blocking_info(js);
-
-    return MOLFILE_SUCCESS;
-  }
-
-  /* update the file offset for the first timestep */
-  js_calc_timestep_blocking_info(js);
-
-  /* else, we have no structure information */
-  return MOLFILE_NOSTRUCTUREDATA;
-}
-
-
-static int write_js_bonds(void *mydata, int nbonds, int *fromptr, int *toptr, 
-                          float *bondorder,  int *bondtype, 
-                          int nbondtypes, char **bondtypename) {
-  jshandle *js = (jshandle *) mydata;
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) write_js_bonds():\n");
-      printf("jsplugin) storing bond info for writing...\n");
-      printf("jsplugin) %d %d\n", nbonds, nbondtypes);
-    }
-#endif
-
-  if (nbonds > 0 && fromptr != NULL && toptr != NULL) {
-    js->optflags |= JSOPT_BONDS; 
-
-    /* save bond info until we actually write out the structure file */
-    js->nbonds = nbonds;
-    js->bondfrom = (int *) malloc(nbonds * sizeof(int));
-    memcpy(js->bondfrom, fromptr, nbonds * sizeof(int));
-    js->bondto = (int *) malloc(nbonds * sizeof(int));
-    memcpy(js->bondto, toptr, nbonds * sizeof(int));
-
-    if (bondorder != NULL) {
-      js->optflags |= JSOPT_BONDORDERS;
-      js->bondorders = (float *) malloc(nbonds * sizeof(float));
-      memcpy(js->bondorders, bondorder, nbonds * sizeof(float));
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int write_js_angles(void * v, int numangles, const int *angles,
-                           const int *angletypes, int numangletypes,
-                           const char **angletypenames, int numdihedrals, 
-                           const int *dihedrals, const int *dihedraltype,
-                           int numdihedraltypes, const char **dihedraltypenames,
-                           int numimpropers, const int *impropers, 
-                           const int *impropertypes, int numimpropertypes, 
-                           const char **impropertypenames, int numcterms, 
-                           const int *cterms, int ctermcols, int ctermrows) {
-  jshandle *js = (jshandle *) v;
-
-  /* save info until we actually write out the structure file */
-  js->numangles = numangles;
-  js->numdihedrals = numdihedrals;
-  js->numimpropers = numimpropers;
-  js->numcterms = numcterms;
-
-#if defined(INFOMSGS)
-  if (js->verbose) {
-    printf("jsplugin) write_js_angles():\n");
-    printf("jsplugin) storing angles/dihedrals/impropers for writing...\n");
-    printf("jsplugin) %d %d %d %d\n",
-           numangles, numdihedrals, numimpropers, numcterms);
-  }
-#endif
-
-  if (js->numangles > 0 || js->numdihedrals > 0 || js->numimpropers > 0) {
-    js->optflags |= JSOPT_ANGLES;
-
-    js->angles = (int *) malloc(3L*js->numangles*sizeof(int));
-    memcpy(js->angles, angles, 3L*js->numangles*sizeof(int));
-    js->dihedrals = (int *) malloc(4L*js->numdihedrals*sizeof(int));
-    memcpy(js->dihedrals, dihedrals, 4L*js->numdihedrals*sizeof(int));
-    js->impropers = (int *) malloc(4L*js->numimpropers*sizeof(int));
-    memcpy(js->impropers, impropers, 4L*js->numimpropers*sizeof(int));
-  }
-  if (js->numcterms > 0) {
-    js->optflags |= JSOPT_CTERMS;
-
-    js->cterms = (int *) malloc(8L*js->numcterms*sizeof(int));
-    memcpy(js->cterms, cterms, 8L*js->numcterms*sizeof(int));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int write_js_angles(void * v,
-        int numangles,    const int *angles,    const double *angleforces,
-        int numdihedrals, const int *dihedrals, const double *dihedralforces,
-        int numimpropers, const int *impropers, const double *improperforces,
-        int numcterms,   const int *cterms,
-        int ctermcols, int ctermrows, const double *ctermforces) {
-  jshandle *js = (jshandle *) v;
-
-  /* save info until we actually write out the structure file */
-  js->numangles = numangles;
-  js->numdihedrals = numdihedrals;
-  js->numimpropers = numimpropers;
-  js->numcterms = numcterms;
-
-  if (js->numangles > 0 || js->numdihedrals > 0 || js->numimpropers > 0) {
-    js->optflags |= JSOPT_ANGLES;
-
-    js->angles = (int *) malloc(3L*js->numangles*sizeof(int));
-    memcpy(js->angles, angles, 3L*js->numangles*sizeof(int));
-    js->dihedrals = (int *) malloc(4L*js->numdihedrals*sizeof(int));
-    memcpy(js->dihedrals, dihedrals, 4L*js->numdihedrals*sizeof(int));
-    js->impropers = (int *) malloc(4L*js->numimpropers*sizeof(int));
-    memcpy(js->impropers, impropers, 4L*js->numimpropers*sizeof(int));
-  }
-  if (js->numcterms > 0) {
-    js->optflags |= JSOPT_CTERMS;
-
-    js->cterms = (int *) malloc(8L*js->numcterms*sizeof(int));
-    memcpy(js->cterms, cterms, 8L*js->numcterms*sizeof(int));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-#endif
-
-
-static int write_js_timestep(void *v, const molfile_timestep_t *ts) { 
-  jshandle *js = (jshandle *)v;
-  double *unitcell=NULL;
-
-  /* If no structure data was written and this is the first timestep */
-  /* we must complete writing the file header and performing the     */
-  /* seek to the next filesystem block and VM-page boundary when     */
-  /* using direct I/O APIs...                                        */
-  if (js->directio_ucell_blkbuf == NULL) {
-    printf("jsplugin) no structure data, writing timesteps only...\n");
-
-    /* use block-based I/O by default when writing structures larger */
-    /* than JSBLOCKIO_THRESH atoms, or when directed by the user     */
-    js_blockio_check_and_set(js);
-
-    /* write flags data to the file */
-    fio_write_int32(js->fd, js->optflags); 
-    printf("jsplugin) writing option flags: %0x08x\n", js->optflags);
-
-    /* Check to see if block-based trajectory I/O is used  */
-    /* and write out the block size for this file.         */
-    if (js->optflags & JSOPT_TS_BLOCKIO) {
-      fio_fwrite(&js->directio_block_size, sizeof(int), 1, js->fd);
-      printf("jsplugin) Block-based I/O enabled: block size %d bytes\n", 
-             js->directio_block_size);
-    }
-
-    /* update the file offset for the first timestep */
-    js_calc_timestep_blocking_info(js);
-  }
-
-  /* set unit cell pointer to the TS block-aligned buffer area */
-  unitcell = (double *) js->directio_ucell_blkbuf;
-
-  js->nframes++; /* increment frame count written to the file so far */
-
-  unitcell[0] = ts->A;
-  unitcell[1] = ts->B;
-  unitcell[2] = ts->C;
-  unitcell[3] = sin((M_PI_2 / 90.0) * (90.0 - ts->alpha));
-  unitcell[4] = sin((M_PI_2 / 90.0) * (90.0 - ts->beta));
-  unitcell[5] = sin((M_PI_2 / 90.0) * (90.0 - ts->gamma));
-
-  /* coordinates for all atoms */
-  if (fio_fwrite(ts->coords, js->ts_crd_padsz, 1, js->fd) != 1) {
-    printf("jsplugin) Error writing timestep coords!\n");;
-    return MOLFILE_ERROR;
-  }
-
-  /* PBC unit cell info */ 
-  if (fio_fwrite(unitcell, js->ts_ucell_padsz, 1, js->fd) != 1) {
-    printf("jsplugin) Error writing timestep unit cell!\n");;
-    return MOLFILE_ERROR;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_js_write(void *v) {
-  jshandle *js = (jshandle *)v;
-
-  /* update the trajectory header information */
-  fio_fseek(js->fd, JSNFRAMESOFFSET, FIO_SEEK_SET);
-  fio_write_int32(js->fd, js->nframes);
-  fio_fseek(js->fd, 0, FIO_SEEK_END);
-
-  fio_fclose(js->fd);
-
-#if JSMAJORVERSION > 1
-  if (js->directio_ucell_ptr)
-    free(js->directio_ucell_ptr);
-
-  if (js->bondfrom)
-    free(js->bondfrom);
-  if (js->bondto)
-    free(js->bondto);
-  if (js->bondorders)
-    free(js->bondorders);
-
-  if (js->angles)
-    free(js->angles);
-  if (js->dihedrals)
-    free(js->dihedrals);
-  if (js->impropers)
-    free(js->impropers);
-  if (js->cterms)
-    free(js->cterms);
-#endif
-
-  free(js);
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "js";
-  plugin.prettyname = "js";
-  plugin.author = "John Stone";
-  plugin.majorv = JSMAJORVERSION;
-  plugin.minorv = JSMINORVERSION;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "js";
-  plugin.open_file_read = open_js_read;
-#if JSMAJORVERSION > 1
-  plugin.read_structure = read_js_structure;
-  plugin.read_bonds = read_js_bonds;
-  plugin.read_angles = read_js_angles;
-#endif
-  plugin.read_next_timestep = read_js_timestep;
-  plugin.close_file_read = close_js_read;
-  plugin.open_file_write = open_js_write;
-#if JSMAJORVERSION > 1
-  plugin.write_structure = write_js_structure;
-  plugin.write_bonds = write_js_bonds;
-  plugin.write_angles = write_js_angles;
-#endif
-  plugin.write_timestep = write_js_timestep;
-  plugin.close_file_write = close_js_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-  
-#ifdef TEST_JSPLUGIN
-
-#include <sys/time.h>
-
-#if defined(ENABLECUDATESTS)
-#include <cuda_runtime.h>
-#endif
-
-/* get the time of day from the system clock, and store it (in seconds) */
-double time_of_day(void) {
-#if defined(_MSC_VER)
-  double t;
-
-  t = GetTickCount();
-  t = t / 1000.0;
-
-  return t;
-#else
-  struct timeval tm;
-  struct timezone tz;
-
-  gettimeofday(&tm, &tz);
-  return((double)(tm.tv_sec) + (double)(tm.tv_usec)/1000000.0);
-#endif
-}
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  float *coords=NULL;
-  float *aligncoords=NULL;
-  void *v;
-  jshandle *js;
-  long i, natoms, sz, blocksz;
-  float sizeMB =0.0, totalMB = 0.0;
-  double starttime, endtime, totaltime = 0.0;
-  int do_io = 1;
-
-  printf("Standalone tests for JS plugin:\n");
-  
-  if (getenv("VMDJSNOIO") != NULL)
-    do_io = 0;
-
-  if (do_io)
-    printf("  Timestep disk I/O enabled.\n");
-  else
-    printf("  Timestep disk I/O DISABLED.\n");
-
-#if defined(ENABLECUDATESTS)
-  printf("  CUDA GPU support compiled in.\n");
-
-  // If the code is compiled with CUDA support, we benchmark 
-  // host I/O immediately followed by host-GPU copies of each timestep
-  cudaError_t crc;
-  int maxatomidx=-1;
-  int devcount;
-  float *devptr=NULL;
-  crc = cudaGetDeviceCount(&devcount);
-
-  printf("  GPU device count: %d\n", devcount);
-  if (devcount==0)
-    printf("  No GPU devices, continuing with host only...\n");
-
-  // Only do the CUDA tests if asked to
-  if (getenv("VMDJSCUDATESTS") == NULL) {
-    devcount = 0;
-    printf("  GPU tests disabled.\n");
-    printf("  Enable GPU tests with VMDJSCUDATESTS env variable\n");
-  } else {
-    printf("  Disable GPU tests by unsetting VMDJSCUDATESTS env variable\n");
-  }
-
-#if defined(ENABLEJSSHORTREADS)
-  /* test code for an implementation that does short reads that */
-  /* skip bulk solvent, useful for faster loading of very large */
-  /* structures                                                 */
-  if (getenv("VMDJSMAXATOMIDX") != NULL) {
-    fio_size_t bszmask;
-
-    maxatomidx = atoi(getenv("VMDJSMAXATOMIDX"));
-    if (maxatomidx < 0)
-      maxatomidx = 0;
-    if (maxatomidx >= js->natoms)
-      maxatomidx = js->natoms - 1;
-
-    printf("jsplugin) Short-copies of GPU timesteps enabled: %d / %d atoms (%.2f%%)\n",
-           maxatomidx, js->natoms, 100.0*(maxatomidx+1) / ((float) js->natoms));
-  }
-#endif
-#endif
-
-
-  while (--argc) {
-    ++argv; 
-    natoms = 0;
-    v = open_js_read(*argv, "js", &natoms);
-    if (!v) {
-      printf("jsplugin) open_js_read failed for file %s\n", *argv);
-      return 1;
-    }
-    js = (jshandle *)v;
-    sizeMB = ((natoms * 3.0) * js->nframes * 4.0) / (1024.0 * 1024.0);
-    totalMB += sizeMB; 
-    printf("jsplugin) file: %s\n", *argv);
-    printf("jsplugin)   %d atoms, %d frames, size: %6.1fMB\n", natoms, js->nframes, sizeMB);
-
-    starttime = time_of_day();
-
-    /* ensure we have a large enough allocation so we can align */
-    /* the starting pointer to a blocksz page boundary          */
-    blocksz = MOLFILE_DIRECTIO_MIN_BLOCK_SIZE;
-    sz = 3L*sizeof(float)*natoms + blocksz;
-    aligncoords = (float *) alloc_aligned_ptr(sz, blocksz, (void**) &coords);
-    timestep.coords = aligncoords;
-
-#if defined(ENABLECUDATESTS)
-    if (crc == cudaSuccess && devcount > 0) {
-      printf("jsplugin) allocating GPU memory buffer for CUDA tests...\n");
-      crc = cudaMalloc((void**) &devptr, sz);
-      if (crc != cudaSuccess) {
-        printf("Failed to allocate GPU buffer!\n");
-        return -1;
-      }
-    }
-#endif
-
-    /* loop over all timesteps ... */
-    for (i=0; i<js->nframes; i++) {
-      if (do_io) {
-        int rc = read_js_timestep(v, natoms, &timestep);
-        if (rc) {
-          printf("jsplugin) error in read_js_timestep on frame %d\n", i);
-          /* return 1; */
-        }
-      }
-
-#if defined(ENABLECUDATESTS)
-      if (crc == cudaSuccess && devcount > 0) {
-        size_t bsz = (maxatomidx >= 0) ? (maxatomidx+1) : natoms;
-        bsz *= 3L*sizeof(float);
-        crc = cudaMemcpy(devptr, timestep.coords, bsz, cudaMemcpyHostToDevice);
-      }
-#endif
-    }
-
-#if defined(ENABLECUDATESTS)
-    /* wait for any pending GPU calls to complete */
-    cudaThreadSynchronize();
-#endif
-
-    endtime = time_of_day();
-    close_js_read(v);
-
-#if defined(ENABLECUDATESTS)
-    if (crc == cudaSuccess && devcount > 0) {
-      cudaFree(devptr);
-    }
-#endif
-    free(coords);
-
-    totaltime += endtime - starttime;
-    printf("jsplugin)  Time: %5.1f seconds\n", endtime - starttime);
-    printf("jsplugin)  Speed: %5.1f MB/sec, %5.1f timesteps/sec\n", sizeMB / (endtime - starttime), (js->nframes / (endtime - starttime)));
-  }
-  printf("jsplugin) Overall Size: %6.1f MB\n", totalMB);
-  printf("jsplugin) Overall Time: %6.1f seconds\n", totaltime);
-  printf("jsplugin) Overall Speed: %5.1f MB/sec\n", totalMB / totaltime);
-  return 0;
-}
-      
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/lammpsplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/lammpsplugin.c
deleted file mode 100644
index f8408f66b982a50f3b7dd3b60a01f02b72034ba5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/lammpsplugin.c
+++ /dev/null
@@ -1,1689 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: lammpsplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.49 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  LAMMPS atom style dump file format:
- *    ITEM: TIMESTEP
- *      %d (timestep number)
- *    ITEM: NUMBER OF ATOMS
- *      %d (number of atoms)
- *    ITEM: BOX BOUNDS
- *      %f %f (boxxlo, boxxhi)
- *      %f %f (boxylo, boxyhi)
- *      %f %f (boxzlo, boxzhi)
- *    ITEM: ATOMS
- *      %d %d %f %f %f  (atomid, atomtype, x, y, z)
- *      ...
- * newer LAMMPS versions have instead
- *    ITEM: ATOMS id x y z
- *      %d %d %f %f %f  (atomid, atomtype, x, y, z)
- *      ...
- * also triclinic boxes are possible:
- *    ITEM: BOX BOUNDS xy xz yz
- *      %f %f %f (boxxlo, boxxhi, xy)
- *      %f %f %f (boxylo, boxyhi, xz)
- *      %f %f %f (boxzlo, boxzhi, yz)
- * 
- * as of 11 April 2011 box bounds always include periodicity settings.
- *    ITEM: BOX BOUNDS pp pp pp xy xz yz
- * instead of p (periodic) also f (fixed), s (shrinkwrap) and m (shrinkwrap 
- *         with minimum) are possible boundaries.
- *
- * SPECIAL NOTICE: these are box _boundaries_ not lengths.
- *                 the dimensions of the box still need to 
- *                 be calculated from them and xy,xz,yz.
- *
- * the newer format allows to handle custom dumps with velocities
- * and other features that are not yet in VMD and the molfile API.
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include "molfile_plugin.h"
-
-#include "periodic_table.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define VMDPLUGIN_STATIC
-#include "hash.h"
-#include "inthash.h"
-
-#ifndef LAMMPS_DEBUG
-#define LAMMPS_DEBUG 0
-#endif
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#ifndef MIN
-#define MIN(A,B) ((A) < (B) ? (A) : (B))
-#endif
-#ifndef MAX
-#define MAX(A,B) ((A) > (B) ? (A) : (B))
-#endif
-
-/* small magnitude floating point number */
-#define SMALL 1.0e-12f
-
-/* maximum supported length of line for line buffers */
-#define LINE_LEN 1024
-
-/* lammps item keywords */
-#define KEY_ATOMS "NUMBER OF ATOMS"
-#define KEY_BOX   "BOX BOUNDS"
-#define KEY_DATA  "ATOMS"
-#define KEY_TSTEP "TIMESTEP"
-
-/* lammps coordinate data styles */
-#define LAMMPS_COORD_NONE       0x000U
-#define LAMMPS_COORD_WRAPPED    0x001U
-#define LAMMPS_COORD_SCALED     0x002U
-#define LAMMPS_COORD_IMAGES     0x004U
-#define LAMMPS_COORD_UNWRAPPED  0x008U
-#define LAMMPS_COORD_UNKNOWN    0x010U
-#define LAMMPS_COORD_VELOCITIES 0x020U
-#define LAMMPS_COORD_FORCES     0x040U
-#define LAMMPS_COORD_DIPOLE     0x080U
-#define LAMMPS_COORD_TRICLINIC  0x100U
-
-/** flags to indicate the property stored in a custom lammps dump */
-#define LAMMPS_MAX_NUM_FIELDS 64
-enum lammps_attribute {
-  LAMMPS_FIELD_UNKNOWN=0,
-  LAMMPS_FIELD_ATOMID, LAMMPS_FIELD_MOLID,  LAMMPS_FIELD_TYPE,
-  LAMMPS_FIELD_POSX,   LAMMPS_FIELD_POSY,   LAMMPS_FIELD_POSZ, 
-  LAMMPS_FIELD_POSXS,  LAMMPS_FIELD_POSYS,  LAMMPS_FIELD_POSZS,
-  LAMMPS_FIELD_POSXU,  LAMMPS_FIELD_POSYU,  LAMMPS_FIELD_POSZU,
-  LAMMPS_FIELD_POSXSU, LAMMPS_FIELD_POSYSU, LAMMPS_FIELD_POSZSU,
-  LAMMPS_FIELD_IMGX,   LAMMPS_FIELD_IMGY,   LAMMPS_FIELD_IMGZ,
-  LAMMPS_FIELD_VELX,   LAMMPS_FIELD_VELY,   LAMMPS_FIELD_VELZ,
-  LAMMPS_FIELD_FORX,   LAMMPS_FIELD_FORY,   LAMMPS_FIELD_FORZ,
-  LAMMPS_FIELD_CHARGE, LAMMPS_FIELD_RADIUS, LAMMPS_FIELD_DIAMETER,
-  LAMMPS_FIELD_ELEMENT,LAMMPS_FIELD_MASS,   LAMMPS_FIELD_QUATW,
-  LAMMPS_FIELD_QUATI,  LAMMPS_FIELD_QUATJ,  LAMMPS_FIELD_QUATK,
-  LAMMPS_FIELD_MUX,    LAMMPS_FIELD_MUY,    LAMMPS_FIELD_MUZ,
-  LAMMPS_FIELD_USER0,  LAMMPS_FIELD_USER1,  LAMMPS_FIELD_USER2,
-  LAMMPS_FIELD_USER3,  LAMMPS_FIELD_USER4,  LAMMPS_FIELD_USER5,
-  LAMMPS_FIELD_USER6,  LAMMPS_FIELD_USER7,  LAMMPS_FIELD_USER8,
-  LAMMPS_FILED_USER9
-};
-
-typedef enum lammps_attribute l_attr_t;
-
-/* for transparent reading of .gz files */
-#ifdef _USE_ZLIB
-#include <zlib.h>
-#define FileDesc gzFile
-#define myFgets(buf,size,fd) gzgets(fd,buf,size)
-#define myFprintf gzprintf
-#define myFopen gzopen
-#define myFclose gzclose
-#define myRewind gzrewind
-#else
-#define FileDesc FILE*
-#define myFprintf fprintf
-#define myFopen fopen
-#define myFclose fclose
-#define myFgets(buf,size,fd) fgets(buf,size,fd)
-#define myRewind rewind
-#endif
-
-typedef struct {
-  FileDesc file;
-  FILE *fp;
-  char *file_name;
-  int *atomtypes;
-  int numatoms;
-  int maxatoms;
-  int nstep;
-  unsigned int coord_data; /* indicate type of coordinate data   */
-  float dip2atoms;         /* scaling factor for dipole to atom data */
-  float dumx,dumy,dumz;    /* location of dummy/disabled atoms */
-  int numfields;           /* number of data fields present */
-  l_attr_t field[LAMMPS_MAX_NUM_FIELDS]; /* type of data fields in dumps */
-  inthash_t *idmap;        /* for keeping track of atomids */
-  int fieldinit;           /* whether the field mapping was initialized */
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-} lammpsdata;
-
-/* merge sort for integer atom id map: merge function */
-static void id_merge(int *output, int *left, int nl, int *right, int nr)
-{
-    int i,l,r;
-    i = l = r = 0;
-    while ((l < nl) && (r < nr)) {
-        if (left[l] < right[r])
-            output[i++] = left[l++];
-        else
-            output[i++] = right[r++];
-    }
-    while (l < nl)
-        output[i++] = left[l++];
-    while (r < nr)
-        output[i++] = right[r++];
-}
-
-/* bottom up merge sort for integer atom id map: main function */
-static void id_sort(int *idmap, int num)
-{
-    int *hold;
-    int i,j,k;
-    
-    hold = (int *)malloc(num*sizeof(int));
-    if (hold == NULL) return;
-
-    for (i=1; i < num; i *=2) {
-        memcpy(hold,idmap,num*sizeof(int));
-        for (j=0; j < (num - i); j += 2*i) {
-            k =(j+2*i > num) ? num-j-i : i;
-            id_merge(idmap+j, hold+j, i, hold+j+i, k);
-        }
-    }
-    free((void *)hold);
-}
-
-/** Check a token against a list of equivalences.
- * The list has the format "toka=tok1,tokb=tok2,tokc=tok3"
- * and is split in pairs "toka=tok1" and then if "tok1" matches,
- * toka will be returned.
- * The first match or tag is returned.
- */
-static const char *remap_field(const char *tag, const char *list) 
-{
-  int i, pos, len, flag;
-  const char *ptr;
-  static char to[32], from[32];
-
-  /* no point in trying to match against NULL pointers */
-  if ((!tag) || (!list))
-    return tag;
-
-  ptr=list;
-  i=pos=flag=0;
-  len=strlen(list);
-
-  /* loop over whole string */
-  while (pos < len) {
-
-    if (flag) { /* case 1: determine the "from" string */
-      if (ptr[pos] == ',') { /* end of value */
-        from[i] = '\0';
-        if (0 == strcmp(tag,from)) { 
-          /* only return a token if it is non-NULL */
-          if (strlen(to))
-            return to;
-
-          flag=0;
-          i=0;
-        } else {
-          /* try next key */
-          flag=0;
-          i=0;
-        }
-      } else { /* copy into "from" */
-        from[i]=ptr[pos];
-        if (i<30)
-          ++i;
-      }
-    } else { /* case 2: determine the "to" string */
-
-      if (ptr[pos] == '=') { /* end of the key */
-        to[i] = '\0';
-        flag=1;
-        i=0;
-      } else if (ptr[pos] == ',') { /* incomplete entry. reset "to".*/
-        i=0;
-        flag=0;
-      } else { /* copy into "to" */
-        to[i]=ptr[pos];
-        if (i<30)
-          ++i;
-      }
-    }
-    ++pos;
-  }
-
-  /* we reached end of the list */
-  if (flag) {
-    from[i] = '\0';
-    if (0 == strcmp(tag,from)) { 
-      /* only return a token if it is non-NULL */
-      if (strlen(to))
-        return to;
-    }
-  }
-
-  return tag;
-}
-
-/** Scan the file for the next line beginning with the string "ITEM: "
- *  and returns a string containing the remainder of that line or NULL.
- *  Upon return, the file descriptor points either to the beginning 
- *  of the next line or at the first character that didn't fit into
- *  the buffer (linebuf[buflen]). */
-static char* find_next_item(FileDesc fd, char* linebuf, int buflen) {
-  char* ptr;
-
-  while(myFgets(linebuf, buflen, fd)) {
-
-    /* strip of leading whitespace */
-    ptr = linebuf;
-    while (ptr && (*ptr == ' ' || *ptr == '\t'))
-      ++ptr;
-
-    /* check if this is an "item" */
-    if(0 == strncmp(ptr, "ITEM:", 5)) {
-      ptr += 5;
-      return ptr;
-    }
-  }
-
-  return NULL;
-}
-
-/** Scan the file for the next occurence of a record of the type given
- *  in keyword.  If such a record is found, the file descriptor points
- *  to the beginning of the record content, and this function returns a
- *  pointer to the remainder of the line (EOL character or or additional
- *  data). otherwise a NULL pointer is returned.
- *  a pointer to a line buffer and its length have to be given.
- *  the return value will point to some location inside this buffer.
- */
-static char *find_item_keyword(FileDesc fd, const char* keyword,
-                               char *linebuf, int buflen) {
-  char *ptr;
-  int len;
-  
-  while(1) {
-    ptr = find_next_item(fd, linebuf, buflen);
-
-    if (ptr == NULL) 
-      break;
-    
-    while (ptr && (*ptr == ' ' || *ptr == '\t'))
-      ++ptr;
-
-#if LAMMPS_DEBUG
-    fprintf(stderr, "text=%s/%s", keyword, ptr);
-#endif
-    len = strlen(keyword);
-    if (0 == strncmp(ptr, keyword, len) ) {
-      ptr += len;
-      if (*ptr == '\0' || *ptr == ' ' || *ptr == '\n' || *ptr == '\r') {
-#if LAMMPS_DEBUG
-        fprintf(stderr, "return=%s", ptr);
-#endif
-        return ptr;
-      } else continue; /* keyword was not an exact match, try again. */
-    }
-  }
-#if LAMMPS_DEBUG
-  fprintf(stderr, "return='NULL'\n");
-#endif
-  return NULL;
-}
-
- 
-static void *open_lammps_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FileDesc fd;
-  lammpsdata *data;
-  char buffer[LINE_LEN];
-  char *ptr;
-  const char *envvar;
-  long tmp, maxatoms;
-
-  fd = myFopen(filename, "rb");
-  if (!fd) return NULL;
- 
-  data = (lammpsdata *)calloc(1, sizeof(lammpsdata));
-  data->file = fd;
-  data->file_name = strdup(filename);
-  data->dip2atoms = -1.0;
-  data->fieldinit = 0;
-  *natoms = 0;
-  maxatoms = 0;
-  
-  ptr = find_item_keyword(data->file, KEY_ATOMS,  buffer, LINE_LEN);
-  if (ptr == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Unable to find '%s' item.\n",
-                  KEY_ATOMS);
-    return NULL;
-  }
-
-  if (!myFgets(buffer, LINE_LEN, data->file)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) dump file '%s' should "
-                  "have the number of atoms after line ITEM: %s\n", 
-                  filename, KEY_ATOMS);
-    return NULL;
-  }
-
-  tmp = atol(buffer);
-  /* we currently only support 32-bit integer atom numbers */
-  if (tmp > 0x7FFFFFFF) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) dump file '%s' contains "
-                  "%ld atoms which is more than what this plugin supports.\n", 
-                  filename, tmp);
-    return NULL;
-  }
-
-  /* hack to allow trajectories with varying number of atoms.
-   * we initialize the structure to the value of LAMMPSMAXATOMS
-   * if that environment variable exists and has a larger value
-   * than the number of actual atoms in the first frame of the
-   * dump file. This way we can provision additional space and
-   * automatically support systems where atoms are lost.
-   * coordinates of atoms that are no longer present are set to
-   * either 0.0 or the content of LAMMPSDUMMYPOS.
-   */
-  envvar=getenv("LAMMPSMAXATOMS");
-  if (envvar) maxatoms = atol(envvar);
-  data->dumx = data->dumy = data->dumz = 0.0f;
-  envvar=getenv("LAMMPSDUMMYPOS");
-  if (envvar) sscanf(envvar,"%f%f%f", &(data->dumx),
-                     &(data->dumy), &(data->dumz));
-
-  if (maxatoms > tmp) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) provisioning space for up to "
-                  "%ld atoms.\n", maxatoms);
-  } else maxatoms = tmp;
-  *natoms = maxatoms;
-
-  /* hack to allow displaying dipoles as two atoms. 
-   * the presence of the environment variable toggles
-   * feature. its value is a scaling factor.
-   */
-  envvar=getenv("LAMMPSDIPOLE2ATOMS");
-  if (envvar) {
-    data->dip2atoms = (float) strtod(envvar,NULL);
-    maxatoms *= 2;
-    tmp *=2;
-  }
-  *natoms = maxatoms;
- 
-  data->maxatoms = maxatoms;  /* size of per-atom storage */
-  data->numatoms = tmp;       /* number of atoms initialized atoms */
-  data->coord_data = LAMMPS_COORD_NONE;  
-  myRewind(data->file); /* prepare for first read_timestep call */
- 
-  return data;
-}
-
-
-static int read_lammps_structure(void *mydata, int *optflags, 
-                                 molfile_atom_t *atoms) {
-  int i, j;
-  char buffer[LINE_LEN];
-  lammpsdata *data = (lammpsdata *)mydata;
-  int atomid, atomtype, needhash;
-  float x, y, z;
-  char *fieldlist;
-  molfile_atom_t thisatom;
-  const char *k;
-  int *idlist=NULL;
-  
-  /* clear atom info. */
-  *optflags = MOLFILE_NOOPTIONS; 
-  data->coord_data = LAMMPS_COORD_NONE;
-  memset(atoms, 0, data->numatoms * sizeof(molfile_atom_t));
-
-  /*  fake info for dummy atoms */
-  strcpy(thisatom.name,"@");
-  strcpy(thisatom.type,"X");
-  strcpy(thisatom.resname,"@@@");
-  strcpy(thisatom.segid,"@@@");
-  strcpy(thisatom.chain,"@");
-  thisatom.resid = -1;
-  thisatom.occupancy = -1.0;
-  thisatom.bfactor = -1.0;
-  thisatom.mass = 0.0;
-  thisatom.charge = 0.0;
-  thisatom.radius = 0.0;
-  thisatom.atomicnumber = 0;
-  for (i=data->numatoms; i < data->maxatoms; ++i)
-    memcpy(atoms+i, &thisatom, sizeof(molfile_atom_t)); 
-
-#if vmdplugin_ABIVERSION > 10
-  data->ts_meta.count = -1;
-  data->ts_meta.has_velocities = 0;
-#endif
- 
-  /* go to the beginning of the file */
-  myRewind(data->file); /* prepare for first read_timestep call */
-
-  /* find the boundary box info to determine if triclinic or not. */
-  fieldlist = find_item_keyword(data->file, KEY_BOX, buffer, LINE_LEN);
-  if (fieldlist == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-  k = myFgets(buffer, LINE_LEN, data->file);
-  if (k == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  j = sscanf(buffer, "%f%f%f", &x, &y, &z);
-  if (j == 3) {
-    data->coord_data |= LAMMPS_COORD_TRICLINIC;
-  } else if (j < 2) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* find the sections with atoms */
-  fieldlist = find_item_keyword(data->file, KEY_DATA, buffer, LINE_LEN);
-  if (fieldlist == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Couldn't find data to "
-                  "read structure from file '%s'.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-#if LAMMPS_DEBUG  
-  fprintf(stderr,"fieldlist for atoms: %s", fieldlist);
-#if 0  /* simulate old style trajectory */
-  fieldlist = strdup("\n");
-#endif
-#endif
-
-  /* parse list of fields */
-  i = 0;
-  k = strtok(fieldlist, " \t\n\r");
-  if (k == NULL) {
-    /* assume old style lammps trajectory  */
-    vmdcon_printf(VMDCON_WARN, "lammpsplugin) Found old style trajectory. "
-                  "assuming data is ordered "
-                  "'id type x|xs|xu y|ys|yu z|zs|zu [...]'.\n");
-    data->coord_data |= LAMMPS_COORD_UNKNOWN;
-  } else {
-    /* try to identify supported output types */
-    do {
-      /* hack to allow re-mapping of arbitrary fields. */
-      const char *envvar;
-      envvar=getenv("LAMMPSREMAPFIELDS");
-      if (envvar)
-        k=remap_field(k,envvar);
-      
-      if (0 == strcmp(k, "id")) {
-        data->field[i] = LAMMPS_FIELD_ATOMID;
-      } else if (0 == strcmp(k, "mol")) {
-        data->field[i] = LAMMPS_FIELD_MOLID;
-      } else if (0 == strcmp(k, "type")) {
-        data->field[i] = LAMMPS_FIELD_TYPE;
-      } else if (0 == strcmp(k, "x")) {
-        data->field[i] = LAMMPS_FIELD_POSX;
-        data->coord_data |= LAMMPS_COORD_WRAPPED;
-      } else if (0 == strcmp(k, "y")) {
-        data->field[i] = LAMMPS_FIELD_POSY;
-        data->coord_data |= LAMMPS_COORD_WRAPPED;
-      } else if (0 == strcmp(k, "z")) {
-        data->field[i] = LAMMPS_FIELD_POSZ;
-        data->coord_data |= LAMMPS_COORD_WRAPPED;
-      } else if (0 == strcmp(k, "xs")) {
-        data->field[i] = LAMMPS_FIELD_POSXS;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "ys")) {
-        data->field[i] = LAMMPS_FIELD_POSYS;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "zs")) {
-        data->field[i] = LAMMPS_FIELD_POSZS;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "xu")) {
-        data->field[i] = LAMMPS_FIELD_POSXU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-      } else if (0 == strcmp(k, "yu")) {
-        data->field[i] = LAMMPS_FIELD_POSYU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-      } else if (0 == strcmp(k, "zu")) {
-        data->field[i] = LAMMPS_FIELD_POSZU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-      } else if (0 == strcmp(k, "xus")) {
-        data->field[i] = LAMMPS_FIELD_POSXU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "yus")) {
-        data->field[i] = LAMMPS_FIELD_POSYU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "zus")) {
-        data->field[i] = LAMMPS_FIELD_POSZU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "ix")) {
-        data->field[i] = LAMMPS_FIELD_IMGX;
-        data->coord_data |= LAMMPS_COORD_IMAGES;
-      } else if (0 == strcmp(k, "iy")) {
-        data->field[i] = LAMMPS_FIELD_IMGY;
-        data->coord_data |= LAMMPS_COORD_IMAGES;
-      } else if (0 == strcmp(k, "iz")) {
-        data->field[i] = LAMMPS_FIELD_IMGZ;
-        data->coord_data |= LAMMPS_COORD_IMAGES;
-      } else if (0 == strcmp(k, "vx")) {
-        data->field[i] = LAMMPS_FIELD_VELX;
-#if vmdplugin_ABIVERSION > 10
-        data->coord_data |= LAMMPS_COORD_VELOCITIES;
-        data->ts_meta.has_velocities = 1;
-#endif
-      } else if (0 == strcmp(k, "vy")) {
-        data->field[i] = LAMMPS_FIELD_VELY;
-#if vmdplugin_ABIVERSION > 10
-        data->coord_data |= LAMMPS_COORD_VELOCITIES;
-        data->ts_meta.has_velocities = 1;
-#endif
-      } else if (0 == strcmp(k, "vz")) {
-        data->field[i] = LAMMPS_FIELD_VELZ;
-#if vmdplugin_ABIVERSION > 10
-        data->coord_data |= LAMMPS_COORD_VELOCITIES;
-        data->ts_meta.has_velocities = 1;
-#endif
-      } else if (0 == strcmp(k, "fx")) {
-        data->field[i] = LAMMPS_FIELD_FORX;
-        data->coord_data |= LAMMPS_COORD_FORCES;
-      } else if (0 == strcmp(k, "fy")) {
-        data->field[i] = LAMMPS_FIELD_FORY;
-        data->coord_data |= LAMMPS_COORD_FORCES;
-      } else if (0 == strcmp(k, "fz")) {
-        data->field[i] = LAMMPS_FIELD_FORZ;
-        data->coord_data |= LAMMPS_COORD_FORCES;
-      } else if (0 == strcmp(k, "q")) {
-        data->field[i] = LAMMPS_FIELD_CHARGE;
-        *optflags |= MOLFILE_CHARGE; 
-      } else if (0 == strcmp(k, "radius")) {
-        data->field[i] = LAMMPS_FIELD_RADIUS;
-        *optflags |= MOLFILE_RADIUS; 
-      } else if (0 == strcmp(k, "diameter")) {
-        data->field[i] = LAMMPS_FIELD_RADIUS;
-        *optflags |= MOLFILE_RADIUS; 
-      } else if (0 == strcmp(k, "element")) {
-        data->field[i] = LAMMPS_FIELD_ELEMENT;
-        *optflags |= MOLFILE_ATOMICNUMBER; 
-        *optflags |= MOLFILE_MASS; 
-        *optflags |= MOLFILE_RADIUS; 
-      } else if (0 == strcmp(k, "mass")) {
-        data->field[i] = LAMMPS_FIELD_MASS;
-        *optflags |= MOLFILE_MASS; 
-      } else if (0 == strcmp(k, "mux")) {
-        data->field[i] = LAMMPS_FIELD_MUX;
-        data->coord_data |= LAMMPS_COORD_DIPOLE;
-      } else if (0 == strcmp(k, "muy")) {
-        data->field[i] = LAMMPS_FIELD_MUY;
-        data->coord_data |= LAMMPS_COORD_DIPOLE;
-      } else if (0 == strcmp(k, "muz")) {
-        data->field[i] = LAMMPS_FIELD_MUZ;
-        data->coord_data |= LAMMPS_COORD_DIPOLE;
-      } else {
-        data->field[i] = LAMMPS_FIELD_UNKNOWN;
-      }
-      ++i;
-      data->numfields = i;
-      k = strtok(NULL," \t\n\r");
-    } while ((k != NULL) && (i < LAMMPS_MAX_NUM_FIELDS));
-  
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) New style dump with %d data "
-                  "fields. Coordinate data flags: 0x%02x\n",
-                  data->numfields, data->coord_data);
-    
-    if ( !(data->coord_data & LAMMPS_COORD_DIPOLE) && (data->dip2atoms >= 0.0f)) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) conversion of dipoles to "
-                    "two atoms requested, but no dipole data found\n");
-      free(idlist);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  idlist = (int *)malloc(data->numatoms * sizeof(int));
-
-  /* read and parse ATOMS data section to build idlist */
-  for(i=0; i<data->numatoms; i++) {
-    k = myFgets(buffer, LINE_LEN, data->file);
-
-    if (k == NULL) { 
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                    "structure from lammps dump file '%s': atom missing in "
-                    "the first timestep\n", data->file_name);
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) expecting '%d' atoms, "
-                    "found only '%d'\n", data->numatoms, i+1);
-      free(idlist);
-      return MOLFILE_ERROR;
-    }
-
-    /* if we have an old-style trajectory we have to guess what is there.
-     * this chunk of code should only be executed once. LAMMPS_COORD_UNKNOWN
-     * will be kept set until the very end or when we find that one position
-     * is outside the box. */
-    if (data->coord_data == LAMMPS_COORD_UNKNOWN) {
-      int ix, iy, iz;
-      j = sscanf(buffer, "%d%d%f%f%f%d%d%d", &atomid, &atomtype, 
-                 &x, &y, &z, &ix, &iy, &iz);
-      if (j > 4) {  /* assume id type xs ys zs .... format */
-        data->coord_data |= LAMMPS_COORD_SCALED;
-        data->numfields = 5;
-        data->field[0] = LAMMPS_FIELD_ATOMID;
-        data->field[1] = LAMMPS_FIELD_TYPE;
-        data->field[2] = LAMMPS_FIELD_POSXS;
-        data->field[3] = LAMMPS_FIELD_POSYS;
-        data->field[4] = LAMMPS_FIELD_POSZS;
-      } else {
-        vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                      "structure from lammps dump file '%s'. Unsupported "
-                      "dump file format.\n", data->file_name);
-        free(idlist);
-        return MOLFILE_ERROR;
-      }
-    }
-
-    atomid = i; /* default, if no atomid given */
-
-    /* parse the line of data and find the atom id */
-    j = 0;
-    k = strtok(buffer, " \t\n\r");
-    while ((k != NULL) && (j < data->numfields)) {
-      switch (data->field[j]) {
-
-        case LAMMPS_FIELD_ATOMID:
-          atomid = atoi(k) - 1; /* convert to 0 based list */
-          break;
-          
-        default:
-          break; /* ignore the rest */
-      }
-      ++j;
-      k = strtok(NULL, " \t\n\r");
-    }
-    if (data->dip2atoms < 0.0f) {
-      idlist[i] = atomid;
-    } else {
-      /* increment for fake second atom */
-      idlist[i] =  2*atomid;
-      ++i;
-      idlist[i] =  2*atomid+1;
-    }
-
-    /* for old-style files, we have to use some heuristics to determine
-     * if we have scaled or unscaled (absolute coordinates).
-     * we assume scaled unless proven differently, and we assume unwrapped
-     * unless we have images present. */
-    if ( (data->coord_data & LAMMPS_COORD_UNKNOWN) != 0) {
-      x=y=z=0.0f;
-      j = sscanf(buffer, "%*d%*d%f%f%f", &x, &y, &z);
-      if ((x<-0.1) || (x>1.1) || (y<-0.1) || (y>1.1) 
-          || (z<-0.1) || (x>1.1)) {
-        data->coord_data &= ~LAMMPS_COORD_UNKNOWN;
-        if ((data->coord_data & LAMMPS_COORD_IMAGES) != 0) {
-          data->coord_data |= LAMMPS_COORD_WRAPPED;
-          data->field[2] = LAMMPS_FIELD_POSX;
-          data->field[3] = LAMMPS_FIELD_POSY;
-          data->field[4] = LAMMPS_FIELD_POSZ;
-        } else {
-          data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-          data->field[2] = LAMMPS_FIELD_POSXU;
-          data->field[3] = LAMMPS_FIELD_POSYU;
-          data->field[4] = LAMMPS_FIELD_POSZU;
-        }
-      }
-    }
-  }
-  data->coord_data &= ~LAMMPS_COORD_UNKNOWN;
-
-  /* pick coordinate type that we want to read and disable the rest. 
-     we want unwrapped > wrapped > scaled. */
-  if (data->coord_data & LAMMPS_COORD_UNWRAPPED) {
-    data->coord_data &= ~(LAMMPS_COORD_WRAPPED|LAMMPS_COORD_SCALED
-                          |LAMMPS_COORD_IMAGES);
-  } else if (data->coord_data & LAMMPS_COORD_WRAPPED) {
-    data->coord_data &= ~LAMMPS_COORD_SCALED;
-  } else if (!(data->coord_data & LAMMPS_COORD_SCALED)) {
-    /* we don't have any proper coordinates, not even scaled: bail out. */
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) No usable coordinate data "
-                  "found in lammps dump file '%s'.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-  
-  if (data->coord_data & LAMMPS_COORD_SCALED) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Reconstructing atomic "
-                  "coordinates from fractional coordinates and box vectors.\n");
-  } else {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Using absolute atomic "
-                  "coordinates directly.\n");
-  }
-  if (data->coord_data & LAMMPS_COORD_DIPOLE) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Detected dipole vector data.\n");
-  }
-  
-  if (data->coord_data & LAMMPS_COORD_TRICLINIC) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Detected triclinic box.\n");
-  }
-  
-#if vmdplugin_ABIVERSION > 10
-  if (data->coord_data & LAMMPS_COORD_VELOCITIES) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Importing atomic velocities.\n");
-  }
-#endif
-
-  /* sort list of atomids and figure out if we need the hash table */
-  id_sort(idlist, data->numatoms);
-  needhash=0;
-  for (i=0; i < data->numatoms; ++i)
-    if (idlist[i] != i) needhash=1;
-
-  /* set up an integer hash to keep a sorted atom id map */
-  if (needhash) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Using hash table to track "
-                  "atom identities.\n");
-    data->idmap = (inthash_t *)calloc(1, sizeof(inthash_t));
-    inthash_init(data->idmap, data->numatoms);
-    for (i=0; i < data->numatoms; ++i) {
-      if (inthash_insert(data->idmap, idlist[i], i) != HASH_FAIL) {
-        vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Duplicate atomid %d or "
-                      "unsupported dump file format.\n", idlist[i]);
-        free(idlist);
-        return MOLFILE_ERROR;
-      }
-    }
-  } else {
-    data->idmap = NULL;
-  }
-  free(idlist);
-  
-
-  /* now go back to the beginning of the file to parse it properly. */
-  myRewind(data->file); 
-
-  /* find the sections with atoms */
-  fieldlist = find_item_keyword(data->file, KEY_DATA, buffer, LINE_LEN);
-  if (fieldlist == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Couldn't find data to "
-                  "read structure from file '%s'.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-  /* read and parse ATOMS data section */
-  for(i=0; i<data->numatoms; i++) {
-    int has_element, has_mass, has_radius;
-    
-    k = myFgets(buffer, LINE_LEN, data->file);
-
-    if (k == NULL) { 
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                    "structure from lammps dump file '%s': atom missing in "
-                    "the first timestep\n", data->file_name);
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) expecting '%d' atoms, "
-                    "found only '%d'\n", data->numatoms, i+1);
-      free(idlist);
-      return MOLFILE_ERROR;
-    }
-
-    /* some defaults */
-    memset(&thisatom, 0, sizeof(molfile_atom_t)); 
-    thisatom.resid = 0; /* mapped to MolID, if present */
-    strncpy(thisatom.resname, "UNK", 4);
-    strncpy(thisatom.chain, "",1);
-    strncpy(thisatom.segid, "",1);
-    atomid = i; /* needed if there is no atomid in a custom dump. */
-    has_element = has_mass = has_radius = 0;
-
-    /* parse the line of data */
-    j = 0;
-    k = strtok(buffer, " \t\n\r");
-    while ((k != NULL) && (j < data->numfields)) {
-      int idx;
-
-      switch (data->field[j]) {
-
-        case LAMMPS_FIELD_ATOMID:
-          atomid = atoi(k) - 1; /* convert to 0 based list */
-          break;
-
-        case LAMMPS_FIELD_ELEMENT:
-          strncpy(thisatom.name, k, 16);
-          thisatom.name[15] = '\0';
-          idx = get_pte_idx(k);
-          thisatom.atomicnumber = idx;
-          has_element = 1;
-          break;
-
-        case LAMMPS_FIELD_TYPE:
-          strncpy(thisatom.type, k, 16); 
-          if (has_element == 0) {
-            /* element label has preference for name */
-            strncpy(thisatom.name, k, 16);
-            thisatom.type[15] = '\0';
-          }
-          /* WARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNING *\
-           * Don't try using the atomid as name. This will waste a _lot_ of  *
-           * memory due to names being stored in a string hashtable.         *
-           * VMD currently cannot handle changing atomids anyways. We thus   *
-           * use a hash table to track atom ids. Within VMD the atomids are  *
-           * then lost, but atoms can be identified uniquely via 'serial'    *
-           * or 'index' atom properties.
-           * WARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNING*/
-          break;
-          
-        case LAMMPS_FIELD_MOLID:
-          thisatom.resid = atoi(k);
-          break;
-
-        case LAMMPS_FIELD_CHARGE:
-          thisatom.charge = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MASS:
-          thisatom.mass = atof(k);
-          has_mass = 1;
-          break;
-
-        case LAMMPS_FIELD_RADIUS:
-          thisatom.radius = atof(k);
-          has_radius = 1;
-          break;
-
-        case LAMMPS_FIELD_DIAMETER:
-          /* radius has preference over diameter */
-          if (has_radius == 0) {
-            thisatom.radius = 0.5*atof(k);
-            has_radius = 1;
-          }
-          break;
-
-        case LAMMPS_FIELD_UNKNOWN: /* fallthrough */
-        default:
-          break;                /* do nothing */
-      }
-      ++j;
-      k = strtok(NULL, " \t\n\r");
-    }
-
-    /* guess missing data from element name */
-    if (has_element) {
-      int idx = get_pte_idx(thisatom.name);
-      if (!has_mass)   thisatom.mass   = get_pte_mass(idx);
-      if (!has_radius) thisatom.radius = get_pte_vdw_radius(idx);
-    }
-
-    /* find position of this atom in the global list and copy its data */
-    if (data->dip2atoms < 0.0f) {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, atomid);
-      } else {
-        j = atomid;
-      }
-      memcpy(atoms+j, &thisatom, sizeof(molfile_atom_t)); 
-    } else {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, 2*atomid);
-      } else {
-        j = 2*atomid;
-      }
-      memcpy(atoms+j, &thisatom, sizeof(molfile_atom_t)); 
-      /* the fake second atom has the same data */
-      ++i;
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, 2*atomid+1);
-      } else {
-        j = 2*atomid+1;
-      }
-      memcpy(atoms+j, &thisatom, sizeof(molfile_atom_t)); 
-    }
-  }
-
-  myRewind(data->file);
-  data->fieldinit = 1;
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 10
-/***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  lammpsdata *data = (lammpsdata *)mydata;
-  
-  meta->count = -1;
-  meta->has_velocities = data->ts_meta.has_velocities;
-  if (meta->has_velocities) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Importing velocities from "
-                      "custom LAMMPS dump file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-/* convert cosine of angle to degrees. 
-   bracket within -1.0 <= x <= 1.0 to avoid NaNs
-   due to rounding errors. */
-static float cosangle2deg(double val)
-{
-  if (val < -1.0) val=-1.0;
-  if (val >  1.0) val= 1.0;
-  return (float) (90.0 - asin(val)*90.0/M_PI_2);
-}
-
-static int read_lammps_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j;
-  char buffer[LINE_LEN];
-  float x, y, z, vx, vy, vz;
-  int atomid, numres, numatoms;
-  float xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, ylohi;
-  float xlo_bound, xhi_bound, ylo_bound, yhi_bound, zlo_bound, zhi_bound;
-
-  lammpsdata *data = (lammpsdata *)mydata;
-  /* we need to read/parse the structure information,
-   * even if we only want to read coordinates later */
-  if (data->fieldinit == 0) {
-    molfile_atom_t *atoms;
-    atoms = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-    read_lammps_structure(mydata,&natoms,atoms);
-    free(atoms);
-  }
-
-  /* check if there is another time step in the file. */
-  if (NULL == find_item_keyword(data->file, KEY_TSTEP, buffer, LINE_LEN)) 
-    return MOLFILE_ERROR;
- 
-  /* check if we should read or skip this step. */
-  if (!ts) return MOLFILE_SUCCESS;
-
-  /* search for the number of atoms in the timestep */
-  if (NULL==find_item_keyword(data->file, KEY_ATOMS, buffer, LINE_LEN)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Unable to find item: %s for "
-                  "current timestep in file %s.\n", KEY_ATOMS, data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-  if (!myFgets(buffer, LINE_LEN, data->file)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Premature EOF for %s.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-  /* check if we have sufficient storage for atoms in this frame */
-  numatoms = atoi(buffer);
-  data->numatoms = numatoms;
-  if (data->dip2atoms < 0.0f) {
-    if (natoms < numatoms) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Too many atoms in timestep."
-                    " %d vs. %d\n", numatoms, natoms);
-      return MOLFILE_ERROR;
-    }
-  } else {
-    if (natoms/2 < numatoms) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Too many atoms in timestep."
-                    " %d vs. %d\n", numatoms, natoms/2);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* now read the boundary box of the timestep */
-  if (NULL == find_item_keyword(data->file, KEY_BOX, buffer, LINE_LEN)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (NULL == myFgets(buffer, LINE_LEN, data->file)) return MOLFILE_ERROR;
-  numres = sscanf(buffer,"%f%f%f", &xlo_bound, &xhi_bound, &xy);
-
-  if (NULL == myFgets(buffer, LINE_LEN, data->file)) return MOLFILE_ERROR;
-  numres += sscanf(buffer,"%f%f%f", &ylo_bound, &yhi_bound, &xz);
-
-  if (NULL == myFgets(buffer, LINE_LEN, data->file)) return MOLFILE_ERROR;
-  numres += sscanf(buffer,"%f%f%f", &zlo_bound, &zhi_bound, &yz);
-
-  xlo = xlo_bound;
-  xhi = xhi_bound;
-  ylo = ylo_bound;
-  yhi = yhi_bound;
-  zlo = zlo_bound;
-  zhi = zhi_bound;
-
-  if (data->coord_data & LAMMPS_COORD_TRICLINIC) {
-    float xdelta;
-
-    /* triclinic box. conveniently, LAMMPS makes the same assumptions
-       about the orientation of the simulation cell than VMD. so
-       hopefully no coordinate rotations or translations will be required */
-
-    if (numres != 9) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Inconsistent triclinic box specifications.\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* adjust box bounds */
-    xdelta = MIN(0.0f,xy);
-    xdelta = MIN(xdelta,xz);
-    xdelta = MIN(xdelta,xy+xz);
-    xlo -= xdelta;
-
-    xdelta = MAX(0.0f,xy);
-    xdelta = MAX(xdelta,xz);
-    xdelta = MAX(xdelta,xy+xz);
-    xhi -= xdelta;
-
-    ylo -= MIN(0.0f,yz);
-    yhi -= MAX(0.0f,yz);
-    
-  } else {
-    if (numres != 6) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Inconsistent orthorhombic box specifications.\n");
-      return MOLFILE_ERROR;
-    }
-    xy = 0.0f;
-    xz = 0.0f;
-    yz = 0.0f;
-  }
-
-  /* convert bounding box info to real box lengths */
-  ts->A = xhi-xlo;
-  ylohi = yhi-ylo;
-  ts->B = sqrt(ylohi*ylohi + xy*xy);
-  ts->C = sqrt((zhi-zlo)*(zhi-zlo) + xz*xz + yz*yz);
-
-  /* compute angles from box lengths and tilt factors */
-  ts->alpha = cosangle2deg((xy*xz + ylohi*yz)/(ts->B * ts->C));
-  ts->beta  = cosangle2deg(xz/ts->C);
-  ts->gamma = cosangle2deg(xy/ts->B);
-
-  /* read the coordinates */
-  if (NULL == find_item_keyword(data->file, KEY_DATA, buffer, LINE_LEN)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) could not find atom data for timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* initialize all coordinates to dummy location */
-  for (i=0; i<natoms; i++) {
-    ts->coords[3*i+0] = data->dumx;
-    ts->coords[3*i+1] = data->dumy;
-    ts->coords[3*i+2] = data->dumz;
-  }
-
-#if vmdplugin_ABIVERSION > 10
-  /* initialize velocities to zero if present */
-  if (ts->velocities != NULL) memset(ts->velocities,0,3*natoms*sizeof(float));
-#endif
-
-  for (i=0; i<numatoms; i++) {
-    float ix, iy, iz, mux, muy, muz;
-    char *k;
-    
-    k = myFgets(buffer, LINE_LEN, data->file);
-
-    if (k == NULL) { 
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                    "data from lammps dump file '%s'.\n", data->file_name);
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) expecting '%d' atoms, "
-                    "found only '%d'\n", numatoms, i+1);
-      return MOLFILE_ERROR;
-    }
-
-    x=y=z=ix=iy=iz=vx=vy=vz=mux=muy=muz=0.0f;
-    atomid=i;
-    
-    /* parse the line of data */
-    j = 0;
-    k = strtok(buffer, " \t\n\r");
-    while ((k != NULL) && (j < data->numfields)) {
-      switch (data->field[j]) {
-
-        case LAMMPS_FIELD_ATOMID:
-          atomid = atoi(k) - 1;
-          break;
-
-        case LAMMPS_FIELD_POSX:
-          if (data->coord_data & LAMMPS_COORD_WRAPPED)
-            x = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSY:
-          if (data->coord_data & LAMMPS_COORD_WRAPPED)
-            y = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSZ:
-          if (data->coord_data & LAMMPS_COORD_WRAPPED)
-            z = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSXU:
-          if (data->coord_data & LAMMPS_COORD_UNWRAPPED)
-            x = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSYU:
-          if (data->coord_data & LAMMPS_COORD_UNWRAPPED)
-            y = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSZU:
-          if (data->coord_data & LAMMPS_COORD_UNWRAPPED)
-            z = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSXS:
-          if (data->coord_data & LAMMPS_COORD_SCALED)
-            x = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSYS:
-          if (data->coord_data & LAMMPS_COORD_SCALED)
-            y = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSZS:
-          if (data->coord_data & LAMMPS_COORD_SCALED)
-            z = atof(k);
-          break;
-
-        case LAMMPS_FIELD_IMGX:
-          if (data->coord_data & LAMMPS_COORD_IMAGES)
-            ix = atof(k);
-          break;
-
-        case LAMMPS_FIELD_IMGY:
-          if (data->coord_data & LAMMPS_COORD_IMAGES)
-            iy = atof(k);
-          break;
-
-        case LAMMPS_FIELD_IMGZ:
-          if (data->coord_data & LAMMPS_COORD_IMAGES)
-            iz = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MUX:
-          if (data->coord_data & LAMMPS_COORD_DIPOLE)
-            mux = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MUY:
-          if (data->coord_data & LAMMPS_COORD_DIPOLE)
-            muy = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MUZ:
-          if (data->coord_data & LAMMPS_COORD_DIPOLE)
-            muz = atof(k);
-          break;
-
-#if vmdplugin_ABIVERSION > 10
-        case LAMMPS_FIELD_VELX:
-          vx = atof(k);
-          break;
-
-        case LAMMPS_FIELD_VELY:
-          vy = atof(k);
-          break;
-
-        case LAMMPS_FIELD_VELZ:
-          vz = atof(k);
-          break;
-#endif
-
-        default: /* do nothing */
-          break;
-      }
-
-      ++j;
-      k = strtok(NULL, " \t\n\r");
-    } 
-    
-    if (data->dip2atoms < 0.0f) {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, atomid);
-      } else {
-        j = atomid;
-      }
-    } else {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, 2*atomid);
-      } else {
-        j = 2*atomid;
-      }
-    }
-    
-    if (data->idmap && (j == HASH_FAIL)) {
-      /* we have space in the hash table. add this atom */
-      if (inthash_entries(data->idmap) < data->maxatoms) {
-        if (data->dip2atoms < 0.0f) {
-          inthash_insert(data->idmap,atomid,i);
-          j = inthash_lookup(data->idmap,atomid);
-        } else {
-          inthash_insert(data->idmap,2*atomid,2*i);
-          inthash_insert(data->idmap,2*atomid+1,2*i+1);
-          j = inthash_lookup(data->idmap, 2*atomid);
-        }
-      } else j = -1;
-    }
-
-    if ((j < 0) || (j >= data->maxatoms)) {
-      vmdcon_printf(VMDCON_WARN, "lammpsplugin) ignoring out of range "
-                    "atom #%d with id %d\n", i, atomid);
-    } else {
-      /* copy coordinates. we may have coordinates in different
-       * formats available in custom dumps. those have been checked
-       * before and we prefer to use unwrapped > wrapped > scaled 
-       * in this order. in the second two cases, we also apply image
-       * shifts, if that data is available. unnecessary or unsupported
-       * combinations of flags have been cleared based on data in 
-       * the first frame in read_lammps_structure(). */
-      int addr = 3 * j;
-      if (data->coord_data & LAMMPS_COORD_TRICLINIC) {
-        if (data->coord_data & LAMMPS_COORD_SCALED) {
-          /* we have fractional coordinates, so they need 
-           * to be scaled accordingly. */
-          ts->coords[addr    ] = xlo + x * ts->A + y * xy + z * xz;
-          ts->coords[addr + 1] = ylo + y * ylohi + z * yz;
-          ts->coords[addr + 2] = zlo + z * (zhi-zlo);
-        } else {
-          /* ... but they can also be absolute values */
-          ts->coords[addr    ] = x;
-          ts->coords[addr + 1] = y;
-          ts->coords[addr + 2] = z;
-        }
-        if (data->coord_data & LAMMPS_COORD_IMAGES) {
-          /* we have image counter data to unwrap coordinates. */
-          ts->coords[addr    ] += ix * ts->A + iy * xy + iz * xz;
-          ts->coords[addr + 1] += iy * ylohi + iz * yz;
-          ts->coords[addr + 2] += iz * (zhi-zlo);
-        }
-      } else {
-        if (data->coord_data & LAMMPS_COORD_SCALED) {
-          /* we have fractional coordinates, so they need 
-           * to be scaled by a/b/c etc. */
-          ts->coords[addr    ] = xlo + x * ts->A;
-          ts->coords[addr + 1] = ylo + y * ts->B;
-          ts->coords[addr + 2] = zlo + z * ts->C;
-        } else {
-          /* ... but they can also be absolute values */
-          ts->coords[addr    ] = x;
-          ts->coords[addr + 1] = y;
-          ts->coords[addr + 2] = z;
-        }
-        if (data->coord_data & LAMMPS_COORD_IMAGES) {
-          /* we have image counter data to unwrap coordinates. */
-          ts->coords[addr    ] += ix * ts->A;
-          ts->coords[addr + 1] += iy * ts->B;
-          ts->coords[addr + 2] += iz * ts->C;
-        }
-      }
-        
-#if vmdplugin_ABIVERSION > 10
-      if (ts->velocities != NULL) {
-        ts->velocities[addr    ] = vx;
-        ts->velocities[addr + 1] = vy;
-        ts->velocities[addr + 2] = vz;
-      }
-#endif
-
-      /* translate and copy atom positions for dipole data */
-      if (data->dip2atoms >= 0.0f) {
-        const float sf = data->dip2atoms;
-        
-        x = ts->coords[addr    ];
-        y = ts->coords[addr + 1];
-        z = ts->coords[addr + 2];
-        ts->coords[addr    ] = x + sf*mux;
-        ts->coords[addr + 1] = y + sf*muy;
-        ts->coords[addr + 2] = z + sf*muz;
-
-        if (data->idmap != NULL) {
-          j = inthash_lookup(data->idmap, 2*atomid + 1);
-        } else {
-          j = 2*atomid + 1;
-        }
-        addr = 3*j;
-        ts->coords[addr    ] = x - sf*mux;
-        ts->coords[addr + 1] = y - sf*muy;
-        ts->coords[addr + 2] = z - sf*muz;
-#if vmdplugin_ABIVERSION > 10
-        if (ts->velocities != NULL) {
-          ts->velocities[addr    ] = vx;
-          ts->velocities[addr + 1] = vy;
-          ts->velocities[addr + 2] = vz;
-        }
-#endif
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_lammps_read(void *mydata) {
-  lammpsdata *data = (lammpsdata *)mydata;
-  myFclose(data->file);
-  free(data->file_name);
-#if LAMMPS_DEBUG
-  if (data->idmap != NULL) 
-    fprintf(stderr, "inthash stats: %s\n", inthash_stats(data->idmap));
-#endif
-  if (data->idmap != NULL) {
-    inthash_destroy(data->idmap);
-    free(data->idmap);
-  }
-  free(data);
-}
-
-static void *open_lammps_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fp;
-  lammpsdata *data;
-
-  fp = fopen(filename, "w");
-  if (!fp) { 
-    vmdcon_printf(VMDCON_ERROR, "Error) Unable to open lammpstrj file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (lammpsdata *)malloc(sizeof(lammpsdata));
-  data->numatoms = natoms;
-  data->fp = fp;
-  data->file_name = strdup(filename);
-  data->nstep = 0;
-  return data;
-}
-
-static int write_lammps_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  lammpsdata *data = (lammpsdata *)mydata;
-  int i, j;
-  hash_t atomtypehash;
-
-  hash_init(&atomtypehash,128);
-
-  /* generate 1 based lookup table for atom types */
-  for (i=0, j=1; i < data->numatoms; i++)
-    if (hash_insert(&atomtypehash, atoms[i].type, j) == HASH_FAIL)
-      j++;
-  
-  data->atomtypes = (int *) malloc(data->numatoms * sizeof(int));
-
-  for (i=0; i < data->numatoms ; i++)
-    data->atomtypes[i] = hash_lookup(&atomtypehash, atoms[i].type);
-
-  hash_destroy(&atomtypehash);
-  
-  return MOLFILE_SUCCESS;
-}
-
-static int write_lammps_timestep(void *mydata, const molfile_timestep_t *ts) {
-  lammpsdata *data = (lammpsdata *)mydata; 
-  const float *pos;
-  float xmin[3], xmax[3], xcen[3];
-  int i, tric, pbcx, pbcy, pbcz;
-
-  fprintf(data->fp, "ITEM: TIMESTEP\n");
-  fprintf(data->fp, "%d\n", data->nstep);
-  fprintf(data->fp, "ITEM: NUMBER OF ATOMS\n");
-  fprintf(data->fp, "%d\n", data->numatoms);
-
-  pos = ts->coords;
-
-  xmax[0] = xmax[1] = xmax[2] = -1.0e30f;
-  xmin[0] = xmin[1] = xmin[2] =  1.0e30f;
-  tric = pbcx = pbcy = pbcz = 0;
-
-#if defined(_MSC_VER)
-  if ((fabs(ts->alpha - 90.0f) > SMALL) ||
-      (fabs(ts->beta  - 90.0f) > SMALL) ||
-      (fabs(ts->gamma - 90.0f) > SMALL)) 
-    tric = 1;
-    if (fabs(ts->A > SMALL)) pbcx = 1;
-    if (fabs(ts->B > SMALL)) pbcy = 1;
-    if (fabs(ts->C > SMALL)) pbcz = 1;
-#else
-  if ((fabsf(ts->alpha - 90.0f) > SMALL) ||
-      (fabsf(ts->beta  - 90.0f) > SMALL) ||
-      (fabsf(ts->gamma - 90.0f) > SMALL))
-    tric = 1;
-    if (fabsf(ts->A > SMALL)) pbcx = 1;
-    if (fabsf(ts->B > SMALL)) pbcy = 1;
-    if (fabsf(ts->C > SMALL)) pbcz = 1;
-#endif  
-
-  /* find min/max coordinates to approximate lo/hi values */
-  for (i = 0; i < data->numatoms; ++i) {
-    xmax[0] = (pos[0] > xmax[0]) ? pos[0] : xmax[0];
-    xmax[1] = (pos[1] > xmax[1]) ? pos[1] : xmax[1];
-    xmax[2] = (pos[2] > xmax[2]) ? pos[2] : xmax[2];
-    xmin[0] = (pos[0] < xmin[0]) ? pos[0] : xmin[0];
-    xmin[1] = (pos[1] < xmin[1]) ? pos[1] : xmin[1];
-    xmin[2] = (pos[2] < xmin[2]) ? pos[2] : xmin[2];
-    pos += 3;
-  }
-  xcen[0] = 0.5f * (xmax[0] + xmin[0]);
-  xcen[1] = 0.5f * (xmax[1] + xmin[1]);
-  xcen[2] = 0.5f * (xmax[2] + xmin[2]);
-
-  pos = ts->coords;
-
-  if (tric == 0 ) {  /* orthogonal box */
-
-    if (pbcx) xmax[0] = xcen[0] + 0.5f*ts->A;
-    if (pbcx) xmin[0] = xcen[0] - 0.5f*ts->A;
-    if (pbcy) xmax[1] = xcen[1] + 0.5f*ts->B;
-    if (pbcy) xmin[1] = xcen[1] - 0.5f*ts->B;
-    if (pbcz) xmax[2] = xcen[2] + 0.5f*ts->C;
-    if (pbcz) xmin[2] = xcen[2] - 0.5f*ts->C;
-
-    /* flag using PBC when box length exists, else shrinkwrap BC */
-    fprintf(data->fp, "ITEM: BOX BOUNDS %s %s %s\n", pbcx ? "pp" : "ss",
-            pbcy ? "pp" : "ss", pbcz ? "pp" : "ss");
-    fprintf(data->fp, "%g %g\n", xmin[0], xmax[0]);
-    fprintf(data->fp, "%g %g\n", xmin[1], xmax[1] );
-    fprintf(data->fp, "%g %g\n", xmin[2], xmax[2] );
-
-  } else { /* triclinic box */
-
-    double lx, ly, lz, xy, xz, yz, xbnd;
-
-    lx = ts->A;
-    xy = ts->B * cos(ts->gamma/90.0*M_PI_2);
-    xz = ts->C * cos(ts->beta/90.0*M_PI_2);
-    ly = sqrt(ts->B*ts->B - xy*xy);
-    if (fabs(ly) > SMALL) 
-      yz = (ts->B*ts->C*cos(ts->alpha/90.0*M_PI_2) - xy*xz) / ly;
-    else
-      yz = 0.0;
-    lz = sqrt(ts->C*ts->C - xz*xz - yz*yz);
-
-    if (pbcx) xmax[0] = xcen[0] + 0.5f*lx;
-    if (pbcx) xmin[0] = xcen[0] - 0.5f*lx;
-    if (pbcy) xmax[1] = xcen[1] + 0.5f*ly;
-    if (pbcy) xmin[1] = xcen[1] - 0.5f*ly;
-    if (pbcz) xmax[2] = xcen[2] + 0.5f*lz;
-    if (pbcz) xmin[2] = xcen[2] - 0.5f*lz;
-
-    /* go from length to boundary */
-
-    xbnd = 0.0;
-    xbnd = (xy > xbnd) ? xy : xbnd;
-    xbnd = (xz > xbnd) ? xz : xbnd;
-    xbnd = (xy+xz > xbnd) ? (xy + xz) : xbnd;
-    xmax[0] += xbnd;
-
-    xbnd = 0.0;
-    xbnd = (xy < xbnd) ? xy : xbnd;
-    xbnd = (xz < xbnd) ? xz : xbnd;
-    xbnd = (xy+xz < xbnd) ? (xy + xz) : xbnd;
-    xmin[0] += xbnd;
-    
-    xbnd = 0.0;
-    xbnd = (yz > xbnd) ? yz : xbnd;
-    xmax[1] += xbnd;
-
-    xbnd = 0.0;
-    xbnd = (yz < xbnd) ? yz : xbnd;
-    xmin[1] += xbnd;
-
-    /* flag using PBC when box length exists, else shrinkwrap BC */
-    fprintf(data->fp, "ITEM: BOX BOUNDS %s %s %s xy xz yz\n", pbcx ? "pp" : "ss",
-            pbcy ? "pp" : "ss", pbcz ? "pp" : "ss");
-    fprintf(data->fp, "%g %g %g\n", xmin[0], xmax[0], xy);
-    fprintf(data->fp, "%g %g %g\n", xmin[1], xmax[1], xz);
-    fprintf(data->fp, "%g %g %g\n", xmin[2], xmax[2], yz);
-  }
-  
-  /* coordinates are written as unwrapped coordinates */
-  fprintf(data->fp, "ITEM: ATOMS id type xu yu zu\n");
-  for (i = 0; i < data->numatoms; ++i) {
-    fprintf(data->fp, " %d %d %g %g %g\n", 
-            i+1, data->atomtypes[i], pos[0], pos[1], pos[2]);
-    pos += 3;
-  }
-
-  data->nstep ++;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_lammps_write(void *mydata) {
-  lammpsdata *data = (lammpsdata *)mydata;
-
-  fclose(data->fp);
-  free(data->atomtypes);
-  free(data->file_name);
-  free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "lammpstrj";
-  plugin.prettyname = "LAMMPS Trajectory";
-  plugin.author = "Marco Kalweit, Axel Kohlmeyer, Lutz Maibaum, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 22;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-#ifdef _USE_ZLIB
-  plugin.filename_extension = "lammpstrj,lammpstrj.gz";
-#else
-  plugin.filename_extension = "lammpstrj";
-#endif
-  plugin.open_file_read = open_lammps_read;
-  plugin.read_structure = read_lammps_structure;
-  plugin.read_next_timestep = read_lammps_timestep;
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-#endif
-  plugin.close_file_read = close_lammps_read;
-  plugin.open_file_write = open_lammps_write;
-  plugin.write_structure = write_lammps_structure;
-  plugin.write_timestep = write_lammps_timestep;
-  plugin.close_file_write = close_lammps_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  molfile_atom_t *atoms = NULL;
-  void *v;
-  int natoms;
-  int i, j, opts;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-
-  while (--argc >=0) {
-    ++argv;
-    v = open_lammps_read(*argv, "lammps", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_lammps_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_lammps_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    atoms = (molfile_atom_t *)malloc(sizeof(molfile_atom_t)*natoms);
-    if (read_lammps_structure(v, &opts, atoms) == MOLFILE_ERROR) {
-      close_lammps_read(v);
-      continue;
-    }
-      
-    fprintf(stderr, "read_lammps_structure: options=0x%08x\n", opts);
-#if 0
-    for (i=0; i<natoms; ++i) {
-      fprintf(stderr, "atom %09d: name=%s, type=%s, resname=%s, resid=%d, segid=%s, chain=%s\n",
-                      i, atoms[i].name, atoms[i].type, atoms[i].resname, atoms[i].resid,
-                      atoms[i].segid, atoms[i].chain);
-    }
-#endif
-#if vmdplugin_ABIVERSION > 10
-    read_timestep_metadata(v,&ts_meta);
-    if (ts_meta.has_velocities) {
-      fprintf(stderr, "found timestep velocities metadata.\n");
-    }
-    timestep.velocities = (float *) malloc(3*natoms*sizeof(float));
-#endif
-    j = 0;
-    while (!read_lammps_timestep(v, natoms, &timestep)) {
-      for (i=0; i<10; ++i) {
-        fprintf(stderr, "atom %09d: type=%s, resid=%d, "
-                      "x/y/z = %.3f %.3f %.3f "
-#if vmdplugin_ABIVERSION > 10
-                      "vx/vy/vz = %.3f %.3f %.3f "
-#endif
-                      "\n",
-                      i, atoms[i].type, atoms[i].resid, 
-                      timestep.coords[3*i], timestep.coords[3*i+1], 
-                      timestep.coords[3*i+2]
-#if vmdplugin_ABIVERSION > 10
-                      ,timestep.velocities[3*i], timestep.velocities[3*i+1], 
-                      timestep.velocities[3*i+2]
-#endif
-                      );    
-      }
-      j++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", j);
-
-    close_lammps_read(v);
-  }
-#if vmdplugin_ABIVERSION > 10
-  free(timestep.velocities);
-#endif
-  free(timestep.coords);
-  free(atoms);
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/largefiles.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/largefiles.h
deleted file mode 100644
index 4495e1c2c6167c1d87f5254cbf43381584b2ff8f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/largefiles.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: largefiles.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.4 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Platform dependent defines for enabling 64-bit file I/O on 32-bit machines
- *
- ***************************************************************************/
- 
-#if defined(_AIX)
-/* Define to enable large file extensions on AIX */
-#define _LARGE_FILE
-#define _LARGE_FILES
-#else
-/* Defines which enable LFS I/O interfaces for large (>2GB) file support
- * on 32-bit machines.  These must be defined before inclusion of any
- * system headers.
- */
-#ifndef _LARGEFILE_SOURCE
-#define _LARGEFILE_SOURCE
-#endif
-#define _FILE_OFFSET_BITS 64
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/maeffplugin.cxx b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/maeffplugin.cxx
deleted file mode 100644
index 839f2a41eadf28073883df146e4b4ab96478474a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/maeffplugin.cxx
+++ /dev/null
@@ -1,2107 +0,0 @@
-//
-// Version info for VMD plugin tree:
-//   $Id: maeffplugin.cxx,v 1.28 2016/11/06 17:49:24 johns Exp $
-//
-// Version info for last sync with D. E. Shaw Research:
-//  //depot/desrad/main/sw/libs/molfile/plugins/maeffplugin.cxx#3
-//
-
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#if defined(_MSC_VER)
-#ifndef DESRES_WIN32
-#define DESRES_WIN32
-#endif
-#endif
-
-#include <molfile_plugin.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <fstream>
-#include <vector>
-#include <map>
-#include <cmath>
-#include <set>
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <stdexcept>
-#include <vector>
-
-#ifdef DESRES_WIN32
-#define ssize_t int
-#define M_PI (3.1415926535897932385)
-#define M_PI_2 (1.5707963267948966192)
-
-#if defined(_MSC_VER)
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
-#endif
-
-namespace {
-
-    /*!
-     * \brief Takes a stream and returns maestro tokens.
-     * This tokenizer is built on streams and uses a small, tight
-     * finite state automata to construct a token
-     */
-    class Tokenizer {
-
-      /*! \brief Actions for the DFA token builder
-       *
-       */
-      typedef enum {
-        DONE = 0,
-        SKIPWHITE,  // 1 
-        INCOMMENT,  //  2
-        CHOOSEKIND,  // 3
-        SINGLECHAR,  // 4
-        STARTSTRING,  // 5 
-        INSTRING,  // 6
-        ESCAPE,  // 7 
-        STARTOTHER,  // 8 
-        CONTINUEOTHER  // 9
-      } action_t;
-
-      //! \brief The current character
-      char m_c;
-
-      //! \brief the stream for the file we're parsing
-      std::ifstream &m_input;
-
-      //! \brief The current token
-      char * m_token;
-
-      //! \brief number of malloc'ed bytes in m_token
-      ssize_t max_token_size;
-
-      //! \brief True iff the token is already read
-      bool m_isfresh;
-
-      //! \brief Current line in file
-      unsigned m_line;
-
-      //! \brief Line where token starts
-      unsigned m_tokenline;
-
-      //! \brief Get current character
-      /*!
-      * Returns the current character in the file
-      * @return current char
-      */
-      inline char peek() { return m_c; }
-
-      //! \brief Read a new character
-      /*!
-      * Read into the current character and update line
-      * and point information.
-      * @return (new) current char
-      */
-      inline char read() {
-        m_c = m_input.get();
-        if (m_c == '\n') m_line++;
-        return m_c;
-      }
-
-      //! \brief True if character is a token
-      /*!
-      * A few Maestro tokens are just 1 char long.  We use
-      * this test to short-circuit the tokenizer when at
-      * [, ], {, or }.
-      */
-      static bool issingle(char c) {
-        return (c == '[' || c == ']' || c == '{' || c == '}');
-      }
-
-      Tokenizer(const Tokenizer&); // No copy c'tor
-
-    public:
-
-      //! \brief Tokenizer based on a file stream
-      Tokenizer(std::ifstream &in);
-
-      //! \brief Clean up and release buffers.
-      ~Tokenizer();
-
-      //! \brief Current token under cursor
-      const char * token(bool ignore_single_character_tokens=false);
-
-      //! \brief Advance to next token
-      void next();
-
-      //! \brief Line number associated with current token
-      unsigned line() const;
-
-      //! \brief File seek point for current token
-      size_t point() const;
-
-      //! \brief Predict a particular token
-      const char * predict(const char * match="");
-
-      //! \brief Predict a value token
-      const char * predict_value();
-
-      //! \brief For while(not_a(match)) loops
-      bool not_a(const char * match=END_OF_FILE);
-
-      static const char * END_OF_FILE;
-    };
-}
-
-/*!
- * Build from an istream
- * @param input The stream to parse
- */
-Tokenizer::Tokenizer(std::ifstream &in)
-  : m_c(0),
-    m_input(in),
-    m_token(NULL),
-    max_token_size(0),
-    m_isfresh(false),
-    m_line(1),
-    m_tokenline(1)
-{
-  max_token_size = 16;
-  m_token = (char *)malloc(max_token_size);
-
-  // grab 1st token.
-  read();
-}
-
-/*!
- * The destructor cleans up any heap allocated temporaries created
- * during construction.
- */
-Tokenizer::~Tokenizer() {
-  if (m_token) free(m_token);
-}
-
-/*!
- * This routine assembles a token character-by-character.
- * At its heart is a little DFA that looks at a character
- * to determine the next state.  For instance, the DFA
- * starts in a SKIPWHITE state and stays there unless
- * it finds a comment (#) or other character.  In the
- * INCOMMENT state, it looks for end-of-line before
- * returning to SKIPWHITE.  Similarly, all tokens are
- * defined using this one-character lookahead.
- * @return The current (possibly new) token 
- */
-const char * Tokenizer::token(bool ignore_single) {
-  // -----------------------------------------------
-  // Keep returning the same token until next()
-  // is called.
-  // -----------------------------------------------
-  if (m_isfresh) return m_token;
-  
-  // -----------------------------------------------
-  // End of file simply returns an empty string
-  // -----------------------------------------------
-
-  // begin at start of token space
-  char * ptr = m_token;
-  m_isfresh = true;
-  
-  unsigned state = SKIPWHITE;
-  char c = peek();
-  bool good = false;
-  ssize_t diff;
-  while(state != DONE && c >= 0) {
-    // make sure we have space in m_token for 2 more characters
-    if ((diff = ptr-m_token) >= max_token_size-1) {
-      m_token = (char *)realloc( m_token, 2*max_token_size );
-      ptr = m_token + diff;
-      max_token_size *= 2;
-    }
-    //std::cout << int(c) << " " << state << std::endl;
-    switch(state) {
-    case SKIPWHITE:
-      // -----------------------------------------------
-      // Skip whitespace and see if its a token or a
-      // comment
-      // -----------------------------------------------
-      if (::isspace(c)) {
-        c = read();
-      } else if (c == '#') {
-        state = INCOMMENT;
-        c = read();
-      } else {
-        state = CHOOSEKIND;
-      }
-      break;
-    case INCOMMENT:
-      // -----------------------------------------------
-      // On a comment, read until end of line
-      // -----------------------------------------------
-      if (c == '\n' || c == '#') state = SKIPWHITE;
-      c = read();
-      break;
-    case CHOOSEKIND:
-      // -----------------------------------------------
-      // We []{} are single character tokens,
-      // Strings start with "
-      // Everything else starts with some other character
-      // -----------------------------------------------
-      if (issingle(c)) {
-        if (ignore_single)
-          state = STARTOTHER;
-        else  
-          state = SINGLECHAR;
-      } else if (c == '"') {
-        state = STARTSTRING;
-      } else {
-        state = STARTOTHER;
-      }
-      break;
-    case SINGLECHAR:
-      good = true;
-      m_tokenline = m_line;
-      *ptr++ = c;
-      *ptr++ = '\0';
-      read();
-      state = DONE;
-      break;
-    case STARTSTRING:
-      good = true;
-      m_tokenline = m_line;
-      *ptr++ = c;
-      read(); // Skip opening quote
-      c = peek();
-      state = INSTRING;
-      break;
-    case INSTRING:
-      if ( c == '"' ) {
-        *ptr++ = c;
-        *ptr++ = '\0';
-        state = DONE;
-      } else if ( c == '\\' ) {
-        state = ESCAPE;
-      } else {
-        *ptr++ = c;
-      }
-      c = read();
-      break;
-    case ESCAPE:
-      *ptr++ = c;
-      state = INSTRING;
-      c = read();
-      break;
-    case STARTOTHER:
-      good = true;
-      m_tokenline = m_line;
-      state = CONTINUEOTHER;
-      break;
-    case CONTINUEOTHER:
-      if (ignore_single) {
-        if (isspace(c) || c == '\n') {
-          *ptr++ = '\0';
-          state = DONE;
-        } else {
-          *ptr++ = c;
-          c = read();
-        }
-      } else {
-        if (issingle(c) || isspace(c) || c == '#' || c == '"') {
-          *ptr++ = '\0';
-          state = DONE;
-        } else {
-          *ptr++ = c;
-          c = read();
-        }
-      }
-      break;
-    }
-  }
-  
-  // -----------------------------------------------
-  // Maybe we just read trailing whitespace...
-  // -----------------------------------------------
-  if (!good) *m_token = '\0';
-  
-  return m_token;
-}
-
-/*!
- * Set state to read a new token on the next request.
- */
-void Tokenizer::next() {
-  m_isfresh = false;
-}
-
-/*!
- * Line associated with current token
- * @return The line number
- */
-unsigned Tokenizer::line() const {
-  return m_tokenline;
-}
-
-/*!
- * The predictive, recursive-descent parsers I use do a lot
- * of "I expect the next token to look like this" calls.
- * (e.g. I expect a "{" here).  This simplifies the logic
- * for that.
- * @param match
- * @return The matching token body
- */
-const char *
-Tokenizer::predict(const char * match) {
-  const char * tok = token();
-  if (strcmp(match, "") && strcmp(tok, match)) {
-    std::stringstream str;
-    str << "Line " <<line()<< " predicted '" <<std::string(match)<< "' have '"
-        << (isprint(tok[0])?tok:"<unprintable>")
-        << "'" << std::endl;
-    throw std::runtime_error(str.str());
-  }
-  next();
-  return tok;
-}
-
-const char *
-Tokenizer::predict_value() {
-    const char * tok = token(true); // ignore single char tokens here
-    if ( (tok[0] == '\0') || (strcmp(tok,":::") == 0) || (strcmp(tok,"}") == 0)) {
-        std::stringstream str;
-        str << "Line " << line() << " predicted a value token, but I have a '"
-            << (isprint(tok[0])?tok:"<unprintable>")
-            << "'" << std::endl;
-        throw std::runtime_error(str.str());
-    }
-    next();
-    return tok;
-}
-
-/*!
- * Another common pattern is replication.  So, while (not_a("}")) { ... }
- * This function makes that easy.
- * @param match Token body to try to match
- * @return True on a match, False on EOF or a non-match
- */
-bool Tokenizer::not_a(const char * match) {
-  const char * tok = token();
-  if (!strcmp(tok, END_OF_FILE)) return false; // EOF always quits
-  return strcmp(tok, match);
-}
-
-/*!
- * The special end of file token (string of length 1 containing a null byte)
- * Normal parsing will not create this character sequence, so it makes a
- * good special token.
- */
-const char * Tokenizer::END_OF_FILE = "";
-
-namespace {
-  struct element {
-    double daltons;
-    const char* abbreviation;
-    const char* name;
-  };
-}
-
-// url = "http://physics.nist.gov/cgi-bin/Elements/elInfo.pl?element=%d&context=noframes"%element
-static struct element amu[] = {
-  {1.00794,"H","Hydrogen"},
-  {4.002602,"He","Helium"},
-  {6.941,"Li","Lithium"},
-  {9.012182,"Be","Beryllium"},
-  {10.811,"B","Boron"},
-  {12.0107,"C","Carbon"},
-  {14.0067,"N","Nitrogen"},
-  {15.9994,"O","Oxygen"},
-  {18.9984032,"F","Fluorine"},
-  {20.1797,"Ne","Neon"},
-  {22.989770,"Na","Sodium"},
-  {24.3050,"Mg","Magnesium"},
-  {26.981538,"Al","Aluminum"},
-  {28.0855,"Si","Silicon"},
-  {30.973761,"P","Phosphorus"},
-  {32.065,"S","Sulfur"},
-  {35.453,"Cl","Chlorine"},
-  {39.0983,"K","Potassium"},
-  {39.948,"Ar","Argon"},
-  {40.078,"Ca","Calcium"},
-  {44.955910,"Sc","Scandium"},
-  {47.867,"Ti","Titanium"},
-  {50.9415,"V","Vanadium"},
-  {51.9961,"Cr","Chromium"},
-  {54.938049,"Mn","Manganese"},
-  {55.845,"Fe","Iron"},
-  {58.6934,"Ni","Nickel"},
-  {58.933200,"Co","Cobalt"},
-  {63.546,"Cu","Copper"},
-  {65.409,"Zn","Zinc"},
-  {69.723,"Ga","Gallium"},
-  {72.64,"Ge","Germanium"},
-  {74.92160,"As","Arsenic"},
-  {78.96,"Se","Selenium"},
-  {79.904,"Br","Bromine"},
-  {83.798,"Kr","Krypton"},
-  {85.4678,"Rb","Rubidium"},
-  {87.62,"Sr","Strontium"},
-  {88.90585,"Y","Yttrium"},
-  {91.224,"Zr","Zirconium"},
-  {92.90638,"Nb","Niobium"},
-  {95.94,"Mo","Molybdenum"},
-  {101.07,"Ru","Ruthenium"},
-  {102.90550,"Rh","Rhodium"},
-  {106.42,"Pd","Palladium"},
-  {107.8682,"Ag","Silver"},
-  {112.411,"Cd","Cadmium"},
-  {114.818,"In","Indium"},
-  {118.710,"Sn","Tin"},
-  {121.760,"Sb","Antimony"},
-  {126.90447,"I","Iodine"},
-  {127.60,"Te","Tellurium"},
-  {131.293,"Xe","Xenon"},
-  {132.90545,"Cs","Cesium"},
-  {137.327,"Ba","Barium"},
-  {138.9055,"La","Lanthanum"},
-  {140.116,"Ce","Cerium"},
-  {140.90765,"Pr","Praseodymium"},
-  {144.24,"Nd","Neodymium"},
-  {150.36,"Sm","Samarium"},
-  {151.964,"Eu","Europium"},
-  {157.25,"Gd","Gadolinium"},
-  {158.92534,"Tb","Terbium"},
-  {162.500,"Dy","Dysprosium"},
-  {164.93032,"Ho","Holmium"},
-  {167.259,"Er","Erbium"},
-  {168.93421,"Tm","Thulium"},
-  {173.04,"Yb","Ytterbium"},
-  {174.967,"Lu","Lutetium"},
-  {178.49,"Hf","Hafnium"},
-  {180.9479,"Ta","Tantalum"},
-  {183.84,"W","Tungsten"},
-  {186.207,"Re","Rhenium"},
-  {190.23,"Os","Osmium"},
-  {192.217,"Ir","Iridium"},
-  {195.078,"Pt","Platinum"},
-  {196.96655,"Au","Gold"},
-  {200.59,"Hg","Mercury"},
-  {204.3833,"Tl","Thallium"},
-  {207.2,"Pb","Lead"},
-  {208.98038,"Bi","Bismuth"},
-  {231.03588,"Pa","Protactinium"},
-  {232.0381,"Th","Thorium"},
-  {238.02891,"U","Uranium"}
-};
-
-static const int nelements = sizeof(amu)/sizeof(amu[0]);
-
-static std::pair<int, const char *> 
-find_element_by_amu(double target) {
-  int left = 0;
-  int right = nelements-1;
-
-  // -----------------------------------------------
-  // Knuth's binary search
-  // -----------------------------------------------
-  while(left <= right) {
-    int mid = (left+right)/2;
-    if (target> amu[mid].daltons) {
-      left = mid + 1;
-    } else if (target< amu[mid].daltons) {
-      right = mid - 1;
-    } else {
-      /* Exact match (unlikely) */
-      left = right = mid;
-      return std::pair<int, const char *>( left+1, amu[left].abbreviation );
-    }
-  }
-
-  // -----------------------------------------------
-  // CAUTION: at this point, the meanings of 
-  // left and right are switched (i.e. left >= right,
-  // see the while() loop above if you don't believe me!
-  // -----------------------------------------------
-  int swap = left;
-  left = right;
-  right = swap;
-
-  if (left < 0) left = right;
-  if (right > nelements-1) right = left;
-
-  if (target - amu[left].daltons < amu[right].daltons - target) {
-    return std::pair<int, const char *>( left+1, amu[left].abbreviation );
-  }
-
-  return std::pair<int, const char *>( right+1, amu[left].abbreviation );
-}
-
-static std::pair<double, const char *> 
-find_element_by_atomic_number(int target) {
-  if (target < 1) target=1;
-  if (target >= nelements) target = nelements-1;
-  return std::pair<double,const char *> ( amu[target-1].daltons,
-                                          amu[target-1].abbreviation );
-}
-
-namespace {
-
-  struct schema_t { /*GCOV-IGNORE*/
-    char type;
-    std::string attr;
-  };
-
-  struct site {
-    float mass;
-    float charge;
-    bool  pseudo;
-    site() : mass(0), charge(0), pseudo(0) {}
-  };
-
-  struct vsite {
-    int ai;             // parent atom of virtual
-    std::string funct;  // ffio_funct
-  };
-  // mapping from index in sites to entry in ffio_virtuals
-  typedef std::map<int,vsite> VirtualsMap;
-
-  struct bond_t {
-    int from, to;
-    float order;
-    bond_t() {}
-    bond_t(int f, int t, float o) : from(f), to(t), order(o) {}
-  };
-  
-  struct pos_t {
-    float x, y, z;
-    pos_t() {}
-    pos_t(float x_, float y_, float z_) : x(x_), y(y_), z(z_) {}
-  };
-  struct vel_t {
-    float x, y, z;
-    vel_t() {}
-    vel_t(float x_, float y_, float z_) : x(x_), y(y_), z(z_) {}
-  };
-
-  struct ct_data {
-    int natoms;    // number of physical atoms from m_atom block
-    int npseudos;  // number of pseudoatoms from ffio_pseudo
-
-    std::vector<molfile_atom_t> particles;
-    std::vector<pos_t>          position;
-    std::vector<vel_t>          velocity;
-    std::vector<site>           sites;
-    std::vector<bond_t>         bonds;
-
-    std::map<size_t,int> atommap, pseudomap;
-
-    VirtualsMap virtuals;
-    ct_data() : natoms(0), npseudos(0) {}
-  };
-
-  typedef std::vector<schema_t> Schema;
-  typedef std::vector<std::string> Row;
-  typedef std::map<std::string, std::string> AttrMap;
-  typedef std::map<int, ct_data> CtMap;
-
-  /*! entries in fepio_fep table */
-  struct fep_elem {
-    //! variable names correspond to fepio_fep field names
-    //!@{
-    int ti, tj;
-    int ai, aj, ak, al;
-    int am, an, ao, ap; // Allow treatment of torsion-torsion terms
-    int moiety; //!< The moiety that each mapped term belongs to.
-    fep_elem() : ti(-1), tj(-1), ai(-1), aj(-1), ak(-1), al(-1),
-                 am(-1), an(-1), ao(-1), ap(-1), moiety(-1) {}
-    //!@}
-  };
-  /*! Represnts a single table in fepio_fep */
-  typedef std::vector<fep_elem> FepList;
-  /*! Represnts the entire fepio_fep section */
-  typedef std::map<std::string, FepList > FepioMapping;
-
-  double dotprod(const double *x, const double *y) {
-    return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
-  }
-
-  void strip_whitespace(char *buf) {
-    if (!buf) return;
-    char *ptr = buf;
-    while (isspace(*ptr)) ++ptr;
-    while (*ptr && !isspace(*ptr)) {
-      *buf++ = *ptr++;
-    }
-    *buf='\0';
-  }
-
-  struct Handle {
-    std::ofstream output;
-    bool eof;
-    double A[3], B[3], C[3];        // global cell vectors
-    int optflags;
-
-    int stage1, stage2;  // alchemical stages
-    FepioMapping fepmap;
-
-    int nparticles;
-    std::vector<int> bond_from, bond_to;
-    std::vector<float> bond_order;
-    std::vector<molfile_atom_t> particles; // for writing
-    CtMap ctmap;
-
-    Handle() 
-    : eof(false), stage1(0), stage2(0), nparticles(0) {
-      for (int i=0; i<3; i++) A[i] = B[i] = C[i] = 0;
-      A[0] = 1;
-      B[1] = 1;
-      C[2] = 1;
-    }
-
-    void set_box( AttrMap &attrs ) {
-      std::string abox("chorus_box_a_");
-      std::string bbox("chorus_box_b_");
-      std::string cbox("chorus_box_c_");
-      for (int i=0; i<3; i++) {
-        char x='x'+i;
-        abox[abox.size()-1] = x;
-        bbox[bbox.size()-1] = x;
-        cbox[cbox.size()-1] = x;
-        A[i] = atof(attrs[abox].c_str());
-        B[i] = atof(attrs[bbox].c_str());
-        C[i] = atof(attrs[cbox].c_str());
-      }
-    }
-    void set_box( const molfile_timestep_t *ts) {
-      // Convert VMD's unit cell information
-      double cosBC = sin( ((90 - ts->alpha ) / 180) * M_PI );
-      double cosAC = sin( ((90 - ts->beta  ) / 180) * M_PI );
-      double cosAB = sin( ((90 - ts->gamma ) / 180) * M_PI );
-      double sinAB = cos( ((90 - ts->gamma ) / 180) * M_PI );
-
-      double Ax = ts->A;
-      double Ay = 0;
-      double Az = 0;
-      double Bx = ts->B * cosAB;
-      double By = ts->B * sinAB;
-      double Bz = 0;
-      double Cx,Cy,Cz;
-      if (sinAB != 0) {
-        Cx = cosAC;
-        Cy = (cosBC - cosAC*cosAB) / sinAB;
-        Cz = sqrt(1-Cx*Cx-Cy*Cy);
-        Cx *= ts->C;
-        Cy *= ts->C;
-        Cz *= ts->C;
-      } else {
-        Cx=Cy=Cz=0;
-      }
-      A[0] = Ax; A[1] = Ay; A[2] = Az;
-      B[0] = Bx; B[1] = By; B[2] = Bz;
-      C[0] = Cx; C[1] = Cy; C[2] = Cz;
-    }
-    void get_box( molfile_timestep_t *ts) const {
-      ts->A = sqrt(dotprod(A,A));
-      ts->B = sqrt(dotprod(B,B));
-      ts->C = sqrt(dotprod(C,C));
-
-      if (ts->A == 0 || ts->B == 0 || ts->C == 0) {
-        // bogosity in the unit cell.  Warn the user and
-        // provide 90 degree angles for all.
-        fprintf(stderr, "WARNING: Some unit cell dimensions were zero; all unit cell angles set to 90.\n");
-        ts->alpha = ts->beta = ts->gamma = 90;
-      } else {
-
-        // compute angles
-        double cosAB = dotprod(A,B)/(ts->A * ts->B);
-        double cosAC = dotprod(A,C)/(ts->A * ts->C);
-        double cosBC = dotprod(B,C)/(ts->B * ts->C);
-
-        // clamp
-        if (cosAB > 1.0) cosAB = 1.0; else if (cosAB < -1.0) cosAB = -1.0;
-        if (cosAC > 1.0) cosAC = 1.0; else if (cosAC < -1.0) cosAC = -1.0;
-        if (cosBC > 1.0) cosBC = 1.0; else if (cosBC < -1.0) cosBC = -1.0;
-
-        // convert to angles using asin to avoid nasty rounding when we are
-        // close to 90 degree angles.
-        ts->alpha = 90.0 - asin(cosBC) * 90.0 / M_PI_2; /* cosBC */
-        ts->beta  = 90.0 - asin(cosAC) * 90.0 / M_PI_2; /* cosAC */
-        ts->gamma = 90.0 - asin(cosAB) * 90.0 / M_PI_2; /* cosAB */
-      }
-    }
-  };
-
-  class Array {
-  protected:
-    Handle *h;
-    const int m_ct;
-
-  public:
-    Array(Handle *h_, int ct) : h(h_), m_ct(ct) {}
-    virtual ~Array() {}
-
-    virtual void set_schema( const Schema &schema ) {}
-    virtual void insert_row(const Row &row) {}
-
-    static void get_str(const std::string &value, char *arr, int N) {
-      if (value == "<>") return;
-      if (value.size() && value[0] == '"' && value[value.size()-1]) {
-        strncpy(arr, value.substr(1,value.size()-2).c_str(), N);
-      } else {
-        strncpy(arr, value.c_str(), N);
-      }
-      strip_whitespace(arr);
-    }
-
-    static void get_int(const std::string &value, int &ival) {
-      ival=atoi(value.c_str());
-    }
-    static void get_float(const std::string &value, float &fval) {
-      fval=atof(value.c_str());
-    }
-  };
-#define GET_STR( val_, arr_) do { get_str(val_, arr_, sizeof(arr_)); } while(0)
-
-  class AtomArray : public Array {
-    int i_name, i_resname, i_resid, i_x, i_y, i_z, i_vx, i_vy, i_vz, 
-        i_anum, i_chain, i_segid, i_charge;
-    std::vector<molfile_atom_t> &atoms;
-    std::vector<pos_t> &pos;
-    std::vector<vel_t> &vel;
-    int &natoms;
-
-  public:
-    AtomArray(Handle *h_, int ct) 
-    : Array(h_, ct),
-      i_name(-1), i_resname(-1), i_resid(-1), 
-      i_x(-1), i_y(-1), i_z(-1), 
-      i_vx(-1), i_vy(-1), i_vz(-1),
-      i_anum(-1), i_chain(-1), i_segid(-1),
-      i_charge(0),
-      atoms( h->ctmap[m_ct].particles ),
-      pos( h->ctmap[m_ct].position),
-      vel( h->ctmap[m_ct].velocity),
-      natoms( h->ctmap[m_ct].natoms )
-    {
-      h->optflags = MOLFILE_NOOPTIONS; // ensure initialization
-#if defined(DESRES_CTNUMBER)
-      h->optflags = MOLFILE_CTNUMBER;
-#endif
-    }
-
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="m_pdb_atom_name")    i_name=i;
-        else if (attr=="m_pdb_residue_name") i_resname=i;
-        else if (attr=="m_residue_number")   i_resid=i;
-        else if (attr=="m_x_coord")          i_x=i;
-        else if (attr=="m_y_coord")          i_y=i;
-        else if (attr=="m_z_coord")          i_z=i;
-        else if (attr=="ffio_x_vel")         i_vx=i;
-        else if (attr=="ffio_y_vel")         i_vy=i;
-        else if (attr=="ffio_z_vel")         i_vz=i;
-        else if (attr=="m_atomic_number")  { i_anum=i; h->optflags |= MOLFILE_ATOMICNUMBER; }
-        else if (attr=="m_chain_name")       i_chain=i;
-        else if (attr=="m_pdb_segment_name") i_segid=i;
-        else if (attr=="m_formal_charge")  { i_charge=i; h->optflags |= MOLFILE_CHARGE; }
-      }
-    }
-
-    virtual void insert_row(const Row &row) {
-      molfile_atom_t a;
-      memset(&a, 0, sizeof(molfile_atom_t));
-      if (i_name>=0)    GET_STR(row[i_name], a.name);
-      if (i_name>=0)    GET_STR(row[i_name], a.type);
-      if (i_resname>=0) GET_STR(row[i_resname], a.resname);
-      if (i_resid>=0)   get_int(row[i_resid], a.resid);
-      if (i_segid>=0)   GET_STR(row[i_segid], a.segid);
-      if (i_chain>=0)   GET_STR(row[i_chain], a.chain);
-
-#if defined(DESRES_CTNUMBER)
-      a.ctnumber = m_ct;
-#endif
-      if (i_anum>=0)    get_int(row[i_anum], a.atomicnumber);
-
-      // if we didn't get an atom name, try to get one from the atomic number.
-      bool bad_name=true;
-      for (const char *p=a.name; *p; ++p) {
-        if (!isspace(*p)) {
-          bad_name = false;
-          break;
-        }
-      }
-      if (bad_name && a.atomicnumber>0) {
-        strncpy( a.name, 
-                 find_element_by_atomic_number(a.atomicnumber).second,
-                 sizeof(a.name) );
-      }
-      
-      // if we didn't get a segid, encode the ct index.
-      if (!strlen(a.segid)) {
-        snprintf(a.segid, 4, "C%d", m_ct);
-      }
-      atoms.push_back(a);
-      natoms += 1;
-
-      pos_t pnt(0,0,0);
-      vel_t v(0,0,0);
-      if (i_x>=0 && i_y>=0 && i_z>=0) {
-        get_float(row[i_x], pnt.x);
-        get_float(row[i_y], pnt.y);
-        get_float(row[i_z], pnt.z);
-      }
-      if (i_vx>=0 && i_vy>=0 && i_vz>=0) {
-        get_float(row[i_vx], v.x);
-        get_float(row[i_vy], v.y);
-        get_float(row[i_vz], v.z);
-      }
-      pos.push_back(pnt);
-      vel.push_back(v);
-    }
-  };
-
-  class SitesArray : public Array {
-    int i_mass, i_charge, i_type;
-    std::vector<site> &sites;
-  public:
-    SitesArray(Handle *h_, int ct) 
-    : Array(h_, ct), i_mass(-1), i_charge(-1), i_type(-1),
-      sites(h->ctmap[ct].sites) 
-    {}
-
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="ffio_mass")   { i_mass=i; h->optflags |= MOLFILE_MASS;}
-        else if (attr=="ffio_charge") { i_charge=i; h->optflags |= MOLFILE_CHARGE; }
-        else if (attr=="ffio_type")   i_type=i;
-      }
-    }
-    virtual void insert_row(const Row &row) {
-      site s;
-      if (i_mass>=0) get_float(row[i_mass], s.mass);
-      if (i_charge>=0) get_float(row[i_charge], s.charge);
-      if (i_type>=0) {
-        char type[32];
-        GET_STR(row[i_type], type);
-        s.pseudo = !strcmp(type, "pseudo");
-      }
-      sites.push_back(s);
-    }
-  };
-  
-  struct BondArray : public Array {
-    int i_from, i_to, i_order;
-    std::vector<bond_t> &bonds;
-
-  public:
-    BondArray(Handle *h_, int ct)
-    : Array(h_, ct), i_from(-1), i_to(-1), i_order(-1),
-      bonds(h->ctmap[m_ct].bonds)
-    {}
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="m_from")  i_from=i;
-        else if (attr=="m_to")    i_to=i;
-        else if (attr=="m_order") i_order=i;
-      }
-    }
-    virtual void insert_row(const Row &row) {
-      if (i_from>=0 && i_to>=0) {
-        int from, to, order;
-        get_int(row[i_from], from);
-        get_int(row[i_to], to);
-        if (from < to) {
-          if (i_order>=0) get_int(row[i_order], order);
-          else            order=1;
-          bonds.push_back(bond_t( from, to, order ));
-        }
-      }
-    }
-  };
-
-  class VirtualsArray : public Array {
-    int i_index, i_ai, i_funct;
-    std::string default_funct;
-
-  public:
-    VirtualsArray(Handle *h_, int ct, const std::string &def_funct)
-    : Array(h_, ct), i_index(-1), i_ai(-1), i_funct(-1),
-      default_funct(def_funct)
-    {}
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="ffio_index")   i_index=i;
-        else if (attr=="ffio_ai")      i_ai=i;
-        else if (attr=="ffio_funct")   i_funct=i;
-      }
-    }
-    virtual void insert_row( const Row &row ) {
-      if (i_index<0 || i_ai<0) return;
-      vsite v;
-      int pseudo;
-      get_int( row[i_ai], v.ai);
-      get_int( row[i_index], pseudo );
-      v.funct = (i_funct>=0) ? row[i_funct] : default_funct;
-      h->ctmap[m_ct].virtuals[pseudo] = v;
-    }
-  };
-
-  class PseudoArray : public Array {
-    int i_x, i_y, i_z, i_vx, i_vy, i_vz;
-    int i_resname, i_chain, i_segid, i_resid;
-    std::vector<molfile_atom_t> &atoms;
-    std::vector<pos_t> &pos;
-    std::vector<vel_t> &vel;
-    int &npseudos;
-
-  public:
-    PseudoArray(Handle *h_, int ct) 
-    : Array(h_, ct),
-      i_x(-1), i_y(-1), i_z(-1), 
-      i_vx(-1), i_vy(-1), i_vz(-1),
-      i_resname(-1), i_chain(-1), i_segid(-1), i_resid(-1),
-      atoms( h->ctmap[m_ct].particles ),
-      pos( h->ctmap[m_ct].position),
-      vel( h->ctmap[m_ct].velocity),
-      npseudos( h->ctmap[m_ct].npseudos)
-    {}
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="ffio_x_coord")          i_x=i;
-        else if (attr=="ffio_y_coord")          i_y=i;
-        else if (attr=="ffio_z_coord")          i_z=i;
-        else if (attr=="ffio_x_vel")         i_vx=i;
-        else if (attr=="ffio_y_vel")         i_vy=i;
-        else if (attr=="ffio_z_vel")         i_vz=i;
-
-        else if (attr=="ffio_pdb_residue_name") i_resname=i;
-        else if (attr=="ffio_chain_name")       i_chain=i;
-        else if (attr=="ffio_pdb_segment_name") i_segid=i;
-        else if (attr=="ffio_residue_number")   i_resid=i;
-      }
-    }
-
-    virtual void insert_row( const Row &row ) {
-      molfile_atom_t a;
-      memset(&a, 0, sizeof(molfile_atom_t));
-
-      strcpy(a.name, "pseudo");
-      strcpy(a.type, "pseudo");
-      if (i_resname>=0) GET_STR(row[i_resname], a.resname);
-      if (i_chain>=0) GET_STR(row[i_chain], a.chain);
-      if (i_segid>=0) GET_STR(row[i_segid], a.segid);
-      if (i_resid>=0) get_int(row[i_resid], a.resid);
-
-#if defined(DESRES_CTNUMBER)
-      a.ctnumber = m_ct;
-#endif
-      atoms.push_back(a);
-      npseudos += 1;
-
-      pos_t p(0,0,0);
-      vel_t v(0,0,0);
-      if (i_x>=0 && i_y>=0 && i_z>=0) {
-        get_float(row[i_x], p.x);
-        get_float(row[i_y], p.y);
-        get_float(row[i_z], p.z);
-      }
-      if (i_vx>=0 && i_vy>=0 && i_vz>=0) {
-        get_float(row[i_vx], v.x);
-        get_float(row[i_vy], v.y);
-        get_float(row[i_vz], v.z);
-      }
-      pos.push_back(p);
-      vel.push_back(v);
-    }
-  };
-
-  class FepioArray : public Array {
-    std::string m_name;
-    int i_ai, i_aj;
-  public:
-    FepioArray(Handle *h_, int ct, const std::string &name) 
-    : Array(h_, ct), m_name(name), i_ai(-1), i_aj(-1) {}
-
-    void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="fepio_ai") i_ai=i;
-        else if (attr=="fepio_aj") i_aj=i;
-      }
-    }
-    void insert_row( const Row &row ) {
-      if (i_ai<0 || i_aj<0) return;
-      fep_elem elem;
-      get_int( row[i_ai], elem.ai );
-      get_int( row[i_aj], elem.aj );
-      h->fepmap[m_name].push_back(elem);
-    }
-  };
-
-  struct Block {
-    Handle *h;
-    const std::string m_name;
-    const int m_ct;
-    bool m_full_system;
-    std::vector<Array *> m_arrays;
-
-    Block(Handle *h_, const std::string &name_, int ct) 
-    : h(h_), m_name(name_), m_ct(ct), m_full_system(false) {
-    }
-
-    virtual ~Block() {
-      for (unsigned i=0; i<m_arrays.size(); i++) delete m_arrays[i];
-    }
-
-    void set_attrs( AttrMap &attrs) {
-      if (m_name=="f_m_ct") {
-        // check for full system
-        if (attrs["ffio_ct_type"]=="full_system") {
-          m_full_system=true;
-          return;
-        }
-        if (attrs.find("chorus_box_ax")!=attrs.end()) {
-          h->set_box(attrs);
-        }
-        if (attrs.find("fepio_stage")!=attrs.end()) {
-          int stage = atoi(attrs["fepio_stage"].c_str());
-          if      (stage==1) h->stage1 = m_ct;
-          else if (stage==2) h->stage2 = m_ct;
-        }
-      }
-    }
-
-    Block new_block(const std::string &name) {
-      Block block(h, m_name + "_" + name, m_ct);
-      block.m_full_system = m_full_system;
-      return block;
-    }
-    Array& new_array(const std::string &name) {
-
-      // create array subclass based on the name
-      Array *arr=NULL;
-      if (m_full_system) {
-        arr = new Array(h, m_ct);
-
-      } else if (name=="m_atom") {
-        arr=new AtomArray(h, m_ct);
-
-      } else if (name=="ffio_pseudo") {
-        arr=new PseudoArray(h, m_ct);
-
-      } else if (name=="ffio_virtuals") {
-        arr=new VirtualsArray(h, m_ct, "virtual");
-
-      } else if (name=="ffio_polarizable") {
-        arr=new VirtualsArray(h, m_ct, "polar");
-
-      } else if (name=="ffio_sites") {
-        arr=new SitesArray(h, m_ct);
-
-      } else if (m_name=="f_m_ct_fepio_fep" && name=="fepio_atommaps") {
-        arr=new FepioArray(h, m_ct, name);
-
-      } else if (name=="m_bond") {
-        arr=new BondArray(h, m_ct);
-
-      } else {
-        arr = new Array(h, m_ct);
-      }
-      m_arrays.push_back(arr);
-      return *arr;
-    }
-  };
-
-  /// parser callbacks
-
-  Schema predict_schema(Tokenizer& tokenizer) {
-    Schema schemas;
-    while(tokenizer.not_a(":::")) {
-      schema_t schema;
-      std::string token = tokenizer.token();
-      if (token[0] != 'b' && token[0] != 'i' && token[0] != 'r' && token[0] != 's') {
-        std::stringstream str;
-        str << "Line " << tokenizer.line() << " predicted a schema, but " 
-            << token << " didn't start b_ i_ r_ or s_ ";
-        throw std::runtime_error(str.str());
-      }
-      schema.type = token[0];
-      schema.attr = token.substr(2);
-      //schema.doc  = tokenizer.optional_comment();
-      schemas.push_back(schema);
-      tokenizer.next();
-    }
-    return schemas;
-  }
-
-  void
-  predict_schema_and_values(Block& M, Tokenizer& tokenizer) {
-    Schema schema = predict_schema(tokenizer);
-    AttrMap attrs;
-    tokenizer.predict(":::");
-    for (unsigned i=0;i<schema.size();++i) {
-      std::string value = tokenizer.predict_value();
-      if (value == "<>" || value == "") continue; // use default element
-      // Strip quotes if present
-      if (value[0] == '"' && value[value.size()-1]) {
-        value = value.substr(1,value.size()-2);
-      }
-      attrs[schema[i].attr] = value;
-    }
-    M.set_attrs(attrs);
-  }
-
-  void
-  check_name(const Tokenizer& tokenizer,const std::string& name) {
-    if (name.size() > 0 && !(isalpha(name[0]) || name[0] == '_')) {
-      std::stringstream str;
-      str << "Line " << tokenizer.line() << " predicted a block name have " << name << std::endl;
-      throw std::runtime_error(str.str());
-    }
-  }
-
-  // forward declaration
-  void predict_block(Block& M, Tokenizer& tokenizer);
-
-  void predict_blockbody(Block& subblock, Tokenizer& tokenizer) {
-    tokenizer.predict("{");
-    predict_schema_and_values(subblock,tokenizer);
-    while(tokenizer.not_a("}")) {
-      predict_block(subblock,tokenizer);
-    }
-    tokenizer.predict("}");
-  }
-
-  void predict_arraybody(Array& subarray, Tokenizer& tokenizer) {
-  
-    // Read header
-    tokenizer.predict("[");
-    tokenizer.predict();
-    tokenizer.predict("]");
-    tokenizer.predict("{");
-  
-    // Read schema
-    Schema schema = predict_schema(tokenizer);
-    subarray.set_schema(schema);
-    size_t width = schema.size();
-    Row row(width);
-    tokenizer.predict(":::");
-  
-    // Read rows
-    while(tokenizer.not_a(":::")) {
-      // throw away row index
-      tokenizer.predict();
-      for(unsigned i=0;i<width;++i) {
-        row[i] = tokenizer.predict_value();
-      }
-      subarray.insert_row(row);
-    }
-  
-    tokenizer.predict(":::");
-  
-    tokenizer.predict("}");
-  }
-  
-
-  void predict_nameless_block(std::string name,Block& M, Tokenizer& tokenizer) {
-    // -----------------------------------------------
-    // May be an array
-    // -----------------------------------------------
-    std::string tok = tokenizer.token();
-    if (tok == "[") {
-      predict_arraybody(M.new_array(name),tokenizer);
-    } 
-  
-    // -----------------------------------------------
-    // Otherwise just a block
-    // -----------------------------------------------
-    else {
-      Block subblock = M.new_block(name);
-      predict_blockbody(subblock,tokenizer);
-    }
-  }
-
-/**************************************************************************/
-/* LOCAL  **************         check_name        ************************/
-
-
-  void predict_block(Block& M, Tokenizer& tokenizer) {
-    std::string name = tokenizer.predict();
-    check_name(tokenizer,name);
-    predict_nameless_block(name,M,tokenizer);
-  }
-
-  void fill_nameless( Block &block, Tokenizer& tokenizer) {
-    predict_blockbody(block,tokenizer);
-  }
-
-}
-
-
-namespace {
-
-  std::string quotify( const std::string &s, unsigned pad=0 ) {
-
-    std::string raw(s);
-    for (unsigned i=raw.size(); i<pad; i++) {
-      //printf("adding %d'th space to %s\n", (int)i, raw.c_str());
-      if (i%2) raw = raw + std::string(" ");
-      else     raw = std::string(" ") + raw;
-    }
-
-    // empty string --> quoted ""
-    if (raw == "") return "\"\"";
-
-    // Check for non-printable characters and "
-    for(std::string::iterator p=raw.begin(), en=raw.end();
-        p != en; ++p) {
-      if (isspace(*p) || !isprint(*p) || *p == '"' || *p == '<' || *p == '\\') {
-        std::string escaped(raw.begin(),p);
-        for(;p!=en;++p) {
-          // We only support space and tab
-          if (isspace(*p) && !(*p == ' ' || *p == '\t')) {
-            throw std::invalid_argument("unprintable whitespace in '" + raw + '\'');
-          }
-
-          if (*p == '"') {
-            escaped += "\\\"";
-          } else if (*p == '\\') {
-            escaped += "\\\\";
-          } else {
-            escaped += *p;
-          }
-
-        }
-        raw = '"' + escaped + '"';
-        break;
-      }
-    }
-    return raw;
-  }
-
-  void write_meta(std::ofstream &output) {
-    output << "{" << std::endl
-           << "  s_m_m2io_version" << std::endl
-           << "  :::" << std::endl
-           << "  2.0.0" << std::endl
-           << "}" << std::endl;
-  }
-  void write_ct_header( std::ofstream &output, 
-                        const double *A, const double *B, const double *C ) {
-    output << "f_m_ct {\n"
-           << "  s_m_title\n"
-           << "  r_chorus_box_ax\n"
-           << "  r_chorus_box_ay\n"
-           << "  r_chorus_box_az\n"
-           << "  r_chorus_box_bx\n"
-           << "  r_chorus_box_by\n"
-           << "  r_chorus_box_bz\n"
-           << "  r_chorus_box_cx\n"
-           << "  r_chorus_box_cy\n"
-           << "  r_chorus_box_cz\n"
-           << "  :::\n"
-           << "  \"\"\n";
-    int i;
-    for (i=0; i<3; i++) output << "  " << A[i] << std::endl;
-    for (i=0; i<3; i++) output << "  " << B[i] << std::endl;
-    for (i=0; i<3; i++) output << "  " << C[i] << std::endl;
-  }
-  void write_ct_atoms(  std::ofstream &output,
-                        const std::map<size_t,int>& atommap,
-                        const std::vector<molfile_atom_t> &atoms,
-                        const float *pos, const float *vel ) {
-
-    output << "  m_atom[" << atommap.size() << "] {\n";
-    output << "    # First column is atom index #\n";
-    output << "    i_m_mmod_type\n";
-    output << "    r_m_x_coord\n";
-    output << "    r_m_y_coord\n";
-    output << "    r_m_z_coord\n";
-    output << "    i_m_residue_number\n";
-    output << "    s_m_insertion_code\n";
-    output << "    s_m_mmod_res\n";
-    output << "    s_m_chain_name\n";
-    output << "    i_m_color\n";
-    output << "    r_m_charge1\n";
-    output << "    r_m_charge2\n";
-    output << "    s_m_pdb_residue_name\n";
-    output << "    s_m_pdb_atom_name\n";
-    output << "    s_m_grow_name\n";
-    output << "    i_m_atomic_number\n";
-    output << "    i_m_formal_charge\n";
-    output << "    i_m_visibility\n";
-    output << "    s_m_pdb_segment_name\n";
-    if (vel) {
-      output << "    r_ffio_x_vel\n";
-      output << "    r_ffio_y_vel\n";
-      output << "    r_ffio_z_vel\n";
-    }
-    output << "    :::\n";
-
-    for (std::map<size_t,int>::const_iterator i=atommap.begin(); 
-        i!=atommap.end(); ++i) {
-      const molfile_atom_t &a = atoms[i->first];
-
-      // get atomic number from mass if not provided explicitly.
-      int anum = a.atomicnumber;
-      if (anum < 1) anum = find_element_by_amu(a.mass).first;
-      // Don't write a zero-length chain
-      const char * chain = a.chain[0] ? a.chain : " ";
-      // Don't write a zero-length insertion
-      const char * insertion = a.insertion[0] ? a.insertion : " ";
-      // the other setting make Maestro happy
-      int color=2; // gray
-      int mmod=64; // mmod_type; 64="any atom"
-      switch  (anum) {
-        case 1:  color=21; mmod=48; break;  // H
-        case 3:  color=4;  mmod=11; break;  // Li+ ion
-        case 6:  color=2 ; mmod=14; break;  // C
-        case 7:  color=43; mmod=40; break;  // N
-        case 8:  color=70; mmod=23; break;  // O
-        case 9:  color=8;  mmod=56; break;  // F
-        case 11: color=4;  mmod=66; break;  // Na+ ion
-        case 12: color=4;  mmod=72; break;  // Mg2+ ion
-        case 14: color=14; mmod=60; break;  // Si
-        case 15: color=15; mmod=53; break;  // P
-        case 16: color=13; mmod=52; break;  // S
-        case 17: color=13; mmod=102; break;  // Cl- ion
-        case 19: color=4;  mmod=67; break;  // K+ ion
-        case 20: color=4;  mmod=70; break;  // Ca2+ ion
-        default: ;
-      }
-      static const std::string blank("\" \"");
-
-      output << "    " << i->second << ' '
-             << mmod << ' '       // mmod_type
-             << pos[0+3*i->first] << ' '
-             << pos[1+3*i->first] << ' '
-             << pos[2+3*i->first] << ' '
-             << a.resid << ' '
-             << quotify(insertion) << ' '   // m_insertion_code
-             << blank << ' '                // mmod_res
-             << quotify(chain) << ' '
-             << color << ' '                // m_color
-             << 0.0 << ' '                  // charge1
-             << 0.0 << ' '                  // charge2
-             << quotify(a.resname, 4) << ' '
-             << quotify(a.name) << ' '
-             << blank << ' '                // m_grow_name
-             << anum << ' '
-             << a.charge   << ' '           // formal charge
-             << 1 << ' '       // m_visibility
-             << quotify(a.segid) << ' '
-             ;
-      if (vel) {
-        output << vel[0+3*i->first] << ' '
-               << vel[1+3*i->first] << ' '
-               << vel[2+3*i->first] << ' ';
-      }
-      output 
-             << std::endl;    
-    }
-    output << "    :::\n";
-    output << "  }\n";
-  }
-
-  void write_ct_bonds( std::ofstream &output, 
-                       const std::vector<bond_t> &bonds ) {
-
-    // don't write 0-element m_bond (ev85392)
-    if (!bonds.size()) return;
-    output << "  m_bond[" << bonds.size() << "] {\n"
-           << "    i_m_from\n"
-           << "    i_m_to\n"
-           << "    i_m_order\n"
-           << "    :::\n";
-    for (unsigned i=0; i<bonds.size(); i++) {
-      output << "    " 
-             << i+1 << ' '
-             << bonds[i].from << ' '
-             << bonds[i].to << ' '
-             << (int)floorf(0.5+bonds[i].order) << "\n";
-    }
-    output << "    :::\n"
-           << "  }\n";
-  }
-
-  void write_ct_ffio_header( std::ofstream &output ) {
-    output << "  ffio_ff {\n"
-           << "    :::\n";
-  }
-  void write_ct_ffio_footer( std::ofstream &output ) {
-    output << "  }\n";
-  }
-
-  void write_ct_sites( std::ofstream &output, 
-                       const std::vector<site>& sites ) {
-
-    output << "    ffio_sites[" << sites.size() << "] {\n"
-           << "      s_ffio_type\n"
-           << "      r_ffio_charge\n"
-           << "      r_ffio_mass\n"
-           << "      :::\n";
-    for (size_t i=0; i<sites.size(); i++) {
-      output << "      " << i+1 << ' '
-             << (sites[i].pseudo ? "pseudo " : "atom ")
-             << sites[i].charge << ' '
-             << sites[i].mass << "\n";
-    }
-    output << "      :::\n";
-    output << "    }\n";
-  }
-
-  void write_ct_pseudos( std::ofstream &output,
-                         const std::map<size_t,int> &pseudos,
-                         const std::vector<molfile_atom_t> &particles,
-                         const float *pos, const float *vel ) {
-    if (!pseudos.size()) return;
-    output << "    ffio_pseudo[" << pseudos.size() << "] {\n"
-           << "      r_ffio_x_coord\n"
-           << "      r_ffio_y_coord\n"
-           << "      r_ffio_z_coord\n"
-           << "      s_ffio_pdb_residue_name\n"
-           << "      s_ffio_chain_name\n"
-           << "      s_ffio_pdb_segment_name\n"
-           << "      i_ffio_residue_number\n";
-    if (vel) output << "      r_ffio_x_vel\n"
-                    << "      r_ffio_y_vel\n"
-                    << "      r_ffio_z_vel\n";
-    output << "      :::\n";
-
-    for (std::map<size_t,int>::const_iterator i=pseudos.begin(); 
-        i!=pseudos.end(); ++i) {
-      const molfile_atom_t &a = particles[i->first];
-      output << "      " 
-             << i->second << ' '
-             << pos[0+3*i->first] << ' ' 
-             << pos[1+3*i->first] << ' ' 
-             << pos[2+3*i->first] << ' ' 
-             << quotify(a.name) << ' '
-             << quotify(a.chain) << ' '
-             << quotify(a.segid) << ' '
-             << a.resid;
-      if (vel) { 
-        output << ' ' 
-               << vel[0+3*i->first] << ' ' 
-               << vel[1+3*i->first] << ' ' 
-               << vel[2+3*i->first];
-      }
-      output << "\n";
-    }
-    output << "      :::\n";
-    output << "    }\n";
-  }
-
-  void write_ct_footer( std::ofstream &output ) {
-    output << "}\n";
-    output << "\n";
-  }
-}
-
-////// support for alchemical mae files
-
-namespace {
-#if 1
-  /*! Map m_bond records from stage2 into stage1
-   *  @param a2inv mapping from ct2 atom index to 
-   *  @param ct1 stage 1 ct
-   *  @param ct2 stage 2 ct
-   */
-  void fixup_m_bond(const std::map<int,int>& a2inv, 
-                    ct_data &ct1, ct_data &ct2) {
-
-    // go through every m_bond record in ct2 and add it to ct1 after
-    // mapping the atom indices.  
-    if (!ct2.bonds.size()) return; // nothing to do
-
-    // Keep track of the bonds we already have
-    typedef std::set<std::pair<int,int> > BondSet;
-    BondSet bondset;
-    unsigned i;
-    for (i=0; i<ct1.bonds.size(); i++) {
-      const bond_t &b = ct1.bonds[i];
-      bondset.insert(std::make_pair(b.from,b.to));
-    }
-
-    // add the others
-    for (i=0; i<ct2.bonds.size(); i++) {
-      const bond_t &b = ct2.bonds[i];
-      int from = b.from;
-      int to   = b.to;
-      std::map<int,int>::const_iterator from_iter = a2inv.find(from);
-      std::map<int,int>::const_iterator to_iter   = a2inv.find(to);
-      if (from_iter == a2inv.end() ||
-          to_iter == a2inv.end())  {
-        fprintf(stderr, "Missing entry in fepio_atommap for %d %d\n", from, to );
-        throw std::runtime_error("Bad fepio_atommap");
-      }
-      BondSet::value_type p(from_iter->second, to_iter->second);
-      if (bondset.find(p) != bondset.end()) continue;
-      bondset.insert(p);
-      ct1.bonds.push_back( bond_t( p.first, p.second, 1 ));
-    }
-  }
-#endif
-
-  /*! append alchemical forms of atoms and groups onto mapped original forms
-   * @param fm1 stage 1 ct
-   * @param fm2 stage 2 ct
-   * @param map fepio_fep map
-   */
-  void alchemical_combine( Handle *h ) {
-    // check if alchemical stages were assigned
-    if (h->stage1<1 || h->stage2<1) return;
-    fprintf(stderr, "alchemical system detected\n");
-    ct_data &stage1 = h->ctmap[h->stage1];
-    ct_data &stage2 = h->ctmap[h->stage2];
-
-    // Map perturbed ct atom numbers into combined ct numbers
-    std::map<int,int> a2_inv_map;
-    for (int i=1; i<=stage2.natoms; i++) a2_inv_map[i]=i;
-
-    // find the atom mapping
-    FepioMapping::const_iterator atoms = h->fepmap.find("fepio_atommaps");
-    if (atoms != h->fepmap.end()) {
-      for (FepList::const_iterator i=atoms->second.begin();
-          i!=atoms->second.end(); ++i) {
-        int const ai = i->ai;
-        int const aj = i->aj;
-        if (ai > 0 && aj > 0) {
-          a2_inv_map[aj] = ai;
-        } else if ( ai > 0 && aj < 0 ) {
-          // nothing to do
-	} else if ( ai < 0 && aj > 0 ) {
-	  a2_inv_map[aj] = ::abs(ai);
-
-          // copy atom to stage1
-          molfile_atom_t &atom = stage2.particles.at( aj-1 );
-#if defined(DESRES_CTNUMBER)
-          atom.ctnumber = h->stage1;
-#endif
-          stage1.particles.push_back(atom);
-          stage1.natoms += 1;
-
-          // copy site as well
-          stage1.sites.push_back( stage2.sites.at(aj-1));
-          stage1.sites[stage1.sites.size()-1].charge = 0.0;
-          
-          // copy position and velocity
-          stage1.position.push_back( stage2.position.at(aj-1) );
-          stage1.velocity.push_back( stage2.velocity.at(aj-1) );
-
-	} else {
-          fprintf(stderr, "ai(%d) and aj(%d) < 0 in atommap\n", ai, aj);
-        }
-      }
-    }
-    fixup_m_bond(a2_inv_map, stage1, stage2);
-    h->ctmap.erase(h->stage2);
-  }
-}
-
-namespace {
-
-  void *open_file_read( const char *fname, const char *ftype, int *vmdatoms) {
-
-    std::ifstream in(fname, std::ifstream::in | std::ifstream::binary );
-    if (!in) return NULL;
-
-    Handle *h = new Handle;
-    *vmdatoms = 0;
-
-    try {
-      // parse the mae file contents
-      Tokenizer tokenizer(in);
-
-      Block meta(h, "meta", 0);
-      fill_nameless( meta, tokenizer);
-      int ct=1;
-      while (tokenizer.not_a()) {
-        std::string name = tokenizer.predict();
-        Block block(h, name, ct++);
-        fill_nameless( block, tokenizer );
-      }
-      alchemical_combine(h);
-    }
-    catch (std::exception &e) {
-      fprintf(stderr, "Reading mae file failed: %s\n", e.what());
-      delete h;
-      return NULL;
-    }
-
-    // post-processing once all arrays have been read
-    for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      int natoms = i->second.natoms;
-      int npseudos = i->second.npseudos;
-      int nparticles = natoms + npseudos;
-      int nsites = i->second.sites.size();
-
-      *vmdatoms += nparticles;
-
-      if (nsites>0) {
-        // check particle/site consistency
-        if (nsites > nparticles ) {
-          fprintf(stderr, "ERROR: Too many ffio_sites records in ct %d\n", 
-              i->first);
-          delete h;
-          return NULL;
-        }
-        int nblks = nparticles / nsites;
-        int Np = npseudos / nblks;
-        int Na = natoms / nblks;
-        if (Np + Na != nsites) {
-          fprintf(stderr, "ERROR: Number of particles in ct %d not a multiple of the number of ffio_sites\n", i->first);
-          delete h;
-          return NULL;
-        }
-      }
-
-    }
-    h->nparticles = *vmdatoms;
-    return h;
-  }
-
-  int read_structure(void* v, int* optflags, molfile_atom_t *atoms) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-
-    // apply sites information
-    for (CtMap::iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      ct_data &ct = i->second;
-      int natoms = ct.natoms;
-      int npseudos = ct.npseudos;
-      int nsites = ct.sites.size();
-      int nparticles = natoms + npseudos;
-
-      if (nsites) {
-
-        int nblks = nparticles / nsites;
-        int Np = npseudos / nblks;
-        int Na = natoms / nblks;
-        int atom_number = 0;
-        int pseudo_number = natoms;
-
-        // mapping from index in site block to relative order in site block
-        std::map<int,int> pseudo_index;
-
-        for (int j=0; j<nsites; ++j) {
-          float mass = ct.sites[j].mass;
-          float charge = ct.sites[j].charge;
-
-          if (!ct.sites[j].pseudo) {
-            // regular atom
-            for(int k=0; k<nblks; ++k) {
-              int ia = atom_number + k*Na;
-              ct.particles[ia].mass = mass;
-              ct.particles[ia].charge = charge;
-            }
-            ++atom_number;
-
-          } else {
-            // pseudo
-            int n = pseudo_index.size();
-            pseudo_index[j+1] = n;
-            for(int k=0; k<nblks; ++k) {
-              int ip = pseudo_number + k*Np;
-              ct.particles[ip].mass = mass;
-              ct.particles[ip].charge = charge;
-            }
-            ++pseudo_number;
-          }
-        }
-
-        // check ffio_virtuals for pseudobonds
-        for (VirtualsMap::const_iterator v=ct.virtuals.begin();
-            v!=ct.virtuals.end(); ++v) {
-          int index = v->first;
-          int ai = v->second.ai;
-          if (ai && index) {
-            atom_number = ai - 1;
-            pseudo_number = natoms + pseudo_index[index];
-
-            for (int k=0; k<nblks; k++) {
-              int from = atom_number + k*Na;
-              int to = pseudo_number + k*Np;
-
-              // copy residue information from parent to the pseudo
-              strcpy( ct.particles[to].resname, ct.particles[from].resname );
-              strcpy( ct.particles[to].chain,   ct.particles[from].chain);
-              strcpy( ct.particles[to].segid,   ct.particles[from].segid);
-              ct.particles[to].resid = ct.particles[from].resid;
-              strncpy( ct.particles[to].type, v->second.funct.c_str(), 
-                       sizeof(ct.particles[to].type ) );
-
-              // add a pseudobond between the pseudo and the parent atom
-              ct.bonds.push_back(bond_t( from+1, to+1, 1 ));
-            }
-          }
-        }
-      }
-      memcpy( atoms, &ct.particles[0], nparticles*sizeof(molfile_atom_t) );
-      atoms += nparticles;
-    }
-
-    *optflags = h->optflags;
-#if defined(DESRES_CTNUMBER)
-    *optflags |= MOLFILE_CTNUMBER;
-#endif
-    return MOLFILE_SUCCESS;
-  }
-
-#if vmdplugin_ABIVERSION > 14
-  int read_bonds(void *v, int *nbonds, int **from, int **to, float** order,
-                 int **bondtype, int *nbondtypes, char ***bondtypename) {
-#else
-  int read_bonds(void *v, int *nbonds, int **from, int **to, float** order) {
-#endif
-    Handle *h = reinterpret_cast<Handle *>(v);
-
-    // map bonds from ct arrays to from/to/order arrays
-    int offset=0;
-    for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      const ct_data &ct = i->second;
-      for (std::vector<bond_t>::const_iterator b=i->second.bonds.begin(),
-           e=i->second.bonds.end(); b!=e; ++b) {
-        h->bond_from.push_back( b->from + offset );
-        h->bond_to.push_back( b->to + offset );
-        h->bond_order.push_back( b->order );
-      }
-      offset += ct.particles.size();
-    }
-    *nbonds = h->bond_from.size();
-    *from = &h->bond_from[0];
-    *to = &h->bond_to[0];
-    *order = &h->bond_order[0];
-#if vmdplugin_ABIVERSION > 14
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-#endif
-    return MOLFILE_SUCCESS;
-  }
-
-  int read_timestep_metadata(void *v, molfile_timestep_metadata *m) {
-    m->has_velocities = true;
-    m->count = 1;
-    return MOLFILE_SUCCESS;
-  }
-
-  int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    if (h->eof) return MOLFILE_EOF;
-
-    float *pos = ts->coords;
-    float *vel = ts->velocities;
-    for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      const ct_data &ct = i->second;
-      unsigned nparticles = ct.position.size();
-      memcpy( pos, &ct.position[0], 3*nparticles*sizeof(float) );
-      pos += 3*nparticles;
-      if (vel) {
-        memcpy( vel, &ct.velocity[0], 3*nparticles*sizeof(float) );
-        vel += 3*nparticles;
-      }
-    }
-
-    h->get_box(ts);
-    h->eof = true;
-    return MOLFILE_SUCCESS;
-  }
-
-#if defined(DESRES_READ_TIMESTEP2)
-  int read_timestep2(void *v, ssize_t n, molfile_timestep_t *ts) {
-      Handle *h = reinterpret_cast<Handle *>(v);
-      if (n!=0) return MOLFILE_EOF;
-      bool save_eof = h->eof;
-      h->eof = false;
-      int rc = read_next_timestep(v, h->nparticles, ts);
-      h->eof = save_eof;
-      return rc;
-  }
-#endif
-
-  void close_file_read( void *v) {
-    delete reinterpret_cast<Handle *>(v);
-  }
-
-  void *open_file_write(const char *path, const char *type, int natoms) {
-    Handle *h = new Handle;
-    h->output.open(path);
-    if (!h->output) {
-      fprintf(stderr, "Could not open '%s' for writing.\n", path);
-      delete h;
-      return NULL;
-    }
-    h->nparticles = natoms;
-    h->particles.resize(natoms);
-    return h;
-  }
-
-  int write_structure(void *v, int optflags, const molfile_atom_t *atoms) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    h->optflags = optflags;
-    memcpy(&h->particles[0], atoms, h->particles.size()*sizeof(molfile_atom_t));
-
-    // assign ct for each particle, and count ct atoms and pseudos
-    std::vector<int> atom_ct(h->nparticles);
-    int last_ctnumber = -1;
-    int ct = 1;
-    for (int i=0; i<h->nparticles; i++) {
-      const molfile_atom_t &a = atoms[i];
-#if defined(DESRES_CTNUMBER)
-      if (i==0) last_ctnumber = a.ctnumber;
-      else if (a.ctnumber != last_ctnumber) {
-        last_ctnumber = a.ctnumber;
-        ++ct;
-      }
-#endif
-      atom_ct[i] = ct;
-      ct_data &data = h->ctmap[ct];
-      site s;
-      s.charge = a.charge;
-      s.mass = a.mass;
-
-      if ((optflags & MOLFILE_ATOMICNUMBER) && a.atomicnumber<1) {
-        data.pseudomap[i] = ++data.npseudos;
-        s.pseudo = true;
-      } else {
-        data.atommap[i] = ++data.natoms;
-        s.pseudo = false;
-      }
-      data.sites.push_back(s);
-    }
-
-    // add bonds to their proper ct
-    int badbonds=0, skipped=0;
-    for (unsigned b=0; b<h->bond_from.size(); b++) {
-      int from = h->bond_from[b]-1;
-      int to   = h->bond_to[b]-1;
-      float order = h->bond_order[b];
-      if (from > to) continue;
-      int ct = atom_ct[from];
-      if (ct != atom_ct[to]) {
-        ++badbonds;
-        continue;
-      }
-      // map 0-based bond index to 1-based ct index
-      ct_data &data = h->ctmap[ct];
-      // add the bond only if it's between atoms, not pseudos
-      std::map<size_t,int>::const_iterator ifrom=data.atommap.find(from);
-      std::map<size_t,int>::const_iterator ito=data.atommap.find(to);
-      if (ifrom != data.atommap.end() && ito != data.atommap.end())
-        data.bonds.push_back(bond_t(ifrom->second, ito->second, order));
-      else 
-        ++skipped;
-    }
-    if (badbonds) {
-      fprintf(stderr, "Could not store all bonds in mae file\n");
-      fprintf(stderr, "Check that no bonded atoms have different ctnumber\n");
-      return MOLFILE_ERROR;
-    }
-    if (skipped) {
-      fprintf(stderr, "Info) Skipped %d pseudobonds.\n", skipped);
-    }
-
-    return MOLFILE_SUCCESS;
-  }
-
-#if vmdplugin_ABIVERSION > 14
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order,
-                  int *bondtype, int nbondtypes, char **bondtypename) {
-#else
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order) {
-#endif
-    Handle *h = reinterpret_cast<Handle *>(v);
-    h->bond_from.resize(nbonds);
-    h->bond_to.resize(nbonds);
-    h->bond_order.resize(nbonds);
-    memcpy( &h->bond_from[0], from, nbonds*sizeof(int) );
-    memcpy( &h->bond_to[0],   to,   nbonds*sizeof(int) );
-    for (int i=0; i<nbonds; i++) h->bond_order[i] = order ? order[i] : 1;
-
-    return MOLFILE_SUCCESS;
-  }
-
-  int write_timestep(void *v, const molfile_timestep_t *ts) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    if (h->eof) {
-      fprintf(stderr, "Cannot write multiple frames to mae file\n");
-      return MOLFILE_EOF;
-    }
-    try {
-      h->set_box(ts);
-
-      write_meta(h->output);
-      for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-        const ct_data &data = i->second;
-        write_ct_header( h->output, h->A, h->B, h->C );
-        write_ct_atoms(  h->output, data.atommap, h->particles, ts->coords, ts->velocities );
-        write_ct_bonds(  h->output, data.bonds );
-
-        write_ct_ffio_header( h->output );
-          write_ct_sites( h->output, data.sites );
-          write_ct_pseudos( h->output, data.pseudomap, h->particles, ts->coords, ts->velocities );
-        write_ct_ffio_footer( h->output );
-
-        write_ct_footer( h->output );
-      }
-    }
-    catch (std::exception &e) {
-      fprintf(stderr, "%s", e.what());
-      return MOLFILE_ERROR;
-    }
-    return MOLFILE_SUCCESS;
-  }
-
-  void close_file_write( void *v ) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    h->output.close();
-    delete h;
-  }
-}
-
-///////////////////////////////////////////////////////////////////
-//
-// Plugin Interface
-//
-// ////////////////////////////////////////////////////////////////
-
-static molfile_plugin_t maeff;
-
-VMDPLUGIN_API int VMDPLUGIN_init (void) {
-  /* Plugin for maeff trajectory files */
-  ::memset(&maeff,0,sizeof(maeff));
-  maeff.abiversion = vmdplugin_ABIVERSION;
-  maeff.type = MOLFILE_PLUGIN_TYPE;
-  maeff.name = "mae";
-  maeff.prettyname = "Maestro File";
-  maeff.author = "D. E. Shaw Research";
-  maeff.majorv = 3;
-  maeff.minorv = 8;
-  maeff.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-
-  maeff.filename_extension = "mae,maeff,cms";
-  maeff.open_file_read = open_file_read;
-  maeff.read_structure = read_structure;
-  maeff.read_bonds = read_bonds;
-  maeff.read_timestep_metadata = read_timestep_metadata;
-  maeff.read_next_timestep = read_next_timestep;
-#if defined(DESRES_READ_TIMESTEP2)
-  maeff.read_timestep2 = read_timestep2;
-#endif
-  maeff.close_file_read = close_file_read;
-
-  maeff.open_file_write = open_file_write;
-  maeff.write_structure = write_structure;
-  maeff.write_bonds = write_bonds;
-  maeff.write_timestep = write_timestep;
-  maeff.close_file_write = close_file_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  cb(v,reinterpret_cast<vmdplugin_t*>(&maeff));
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-#if defined(TEST_MAEFFPLUGIN)
-
-int main(int argc, char *argv[]) {
-  if (argc != 3) {
-    fprintf(stderr, "Usage: %s input.mae output.mae\n", argv[0]);
-    return 1;
-  }
-  int natoms=0;
-  void *v = open_file_read( argv[1], "mae", &natoms);
-  if (!v) return 1;
-  // read an existing mae file
-  printf("%d atoms\n", natoms);
-  std::vector<molfile_atom_t> atoms(natoms);
-  memset(&atoms[0], 0, natoms*sizeof(molfile_atom_t));
-  int optflags=0;
-  if (read_structure(v, &optflags, &atoms[0])!=MOLFILE_SUCCESS) return 1;
-  int nbonds;
-
-  // read bonds
-  int *from, *to;
-  float *order;
-  if (read_bonds(v, &nbonds, &from, &to, &order) !=MOLFILE_SUCCESS) return 1;
-  std::vector<int> bond_from(nbonds), bond_to(nbonds);
-  std::vector<float> bond_order(nbonds);
-  memcpy(&bond_from[0], from, nbonds*sizeof(int));
-  memcpy(&bond_to[0], to, nbonds*sizeof(int));
-  memcpy(&bond_order[0], order, nbonds*sizeof(float));
-
-  // read coordinates
-  molfile_timestep_t ts[1];
-  ts->coords = new float[3*natoms];
-  ts->velocities = new float[3*natoms];
-  if (read_next_timestep(v, natoms, ts) != MOLFILE_SUCCESS) return 1;
-
-  // close
-  close_file_read(v);
-
-  // write file
-  v = open_file_write( argv[2], "mae", natoms );
-  if (!v) return 1;
-  if (write_bonds(v, nbonds, &bond_from[0], &bond_to[0], &bond_order[0]) 
-      != MOLFILE_SUCCESS) return 1;
-  if (write_structure( v, optflags, &atoms[0] ) != MOLFILE_SUCCESS) return 1;
-  if (write_timestep( v, ts ) != MOLFILE_SUCCESS ) return 1;
-  close_file_write(v);
-
-  delete [] ts->coords;
-  delete [] ts->velocities;
-
-  // make sure we can still parse the file we wrote
-  int new_natoms;
-  v = open_file_read( argv[2], "mae", &new_natoms );
-  if (!v) return 1;
-  if (new_natoms != natoms) {
-    fprintf(stderr, "number of atoms changed: %d -> %d\n", natoms, new_natoms);
-    return 1;
-  }
-  close_file_read(v);
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/main.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/main.c
deleted file mode 100644
index a2f02897a83f83818e567f5ad1577e4c74211550..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/main.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: main.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * A general main for testing plugins.  
- * Compile using: gcc main.c plugin.c -I../../include -o plugintest
- * Replace plugin.c with the plugin file you want to test.
- * Usage: plugintest <filetype> <file> [<filetype> <file>]
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-
-/* Structure and coordintes plugin */
-static molfile_plugin_t *splugin = 0;
-static molfile_plugin_t *cplugin = 0;
-static const char *sfiletype = NULL;
-static const char *cfiletype = NULL;
-
-static int register_cb(void *v, vmdplugin_t *p) {
-  if (!strcmp(p->type, MOLFILE_PLUGIN_TYPE)) {
-    if (!strcmp(p->name, sfiletype))
-      splugin = (molfile_plugin_t *)p;
-    if (!strcmp(p->name, cfiletype))
-      cplugin = (molfile_plugin_t *)p;
-  }
-  return VMDPLUGIN_SUCCESS;
-}
-
-int main(int argc, char *argv[]) {
-  const char *sfilename;
-  const char *cfilename;
-  int rc, natoms;
-  void *handle;
-  void *chandle;
-  molfile_timestep_t timestep;
-
-  if (argc != 3 && argc != 5) {
-    fprintf(stderr, "Usage: %s <filetype> <filename> [<filetype> <filename>]\n", argv[0]);
-    return 1;
-  }
-
-  if (argc == 3) {
-    sfiletype = argv[1];
-    sfilename = argv[2];
-    cfiletype = sfiletype;
-    cfilename = sfilename;
-  } else {
-    sfiletype = argv[1];
-    sfilename = argv[2];
-    cfiletype = argv[3];
-    cfilename = argv[4];
-  }
-  
-  vmdplugin_init();
-  vmdplugin_register(NULL, register_cb);
-
-  if (!splugin) {
-    fprintf(stderr, "No plugin for filetype %s was linked in!\n", sfiletype);
-    return 1;
-  }
-  if (!cplugin) {
-    fprintf(stderr, "No plugin for filetype %s was linked in!\n", cfiletype);
-    return 1;
-  }
-
-  /* Read structure */
-  if (!splugin->open_file_read) {
-    fprintf(stdout, "FAILED: No open_file_read found in structure plugin.\n");
-    return 1;
-  } 
-  handle = splugin->open_file_read(sfilename, sfiletype, &natoms);
-  if (!handle) {
-    fprintf(stderr, "FAILED: open_file_read returned NULL in structure plugin.\n");
-    return 1;
-  }
-  printf("Opened file %s; structure plugin found %d atoms\n", sfilename, natoms);
-  if (splugin->read_structure) {
-    int optflags;
-    molfile_atom_t *atoms;
-    atoms = (molfile_atom_t *)malloc(natoms * sizeof(molfile_atom_t));
-    rc = splugin->read_structure(handle, &optflags, atoms);
-    free(atoms);
-    if (rc) {
-      fprintf(stderr, "FAILED: read_structure returned %d\n", rc);
-      splugin->close_file_read(handle);
-      return 1;
-    } else {
-      printf("Successfully read atom structure information.\n");
-    }
-    if (splugin->read_bonds) {
-      int nbonds, *from, *to, *bondtype, nbondtypes;
-      float *bondorder;
-      char **bondtypename;
-      if ((rc = splugin->read_bonds(handle, &nbonds, &from, &to, 
-				   &bondorder, &bondtype, &nbondtypes, &bondtypename))) {
-        fprintf(stderr, "FAILED: read_bonds returned %d\n", rc);
-      } else {
-        printf("read_bonds read %d bonds\n", nbonds);
-      }
-    } else {
-      printf("Structure file contains no bond information\n");
-    }
-  } else {
-    fprintf(stderr, "FAILED: File contains no structure information!\n");
-    return 1;
-  }
-
-  /* Check whether we use one plugin for both structure and coords */
-  if (splugin != cplugin) {
-    splugin->close_file_read(handle);
-    int cnatoms;
-    chandle = cplugin->open_file_read(cfilename, cfiletype, &cnatoms);
-    printf("Opened coordinates file %s\n", cfilename);
-    if (cnatoms != MOLFILE_NUMATOMS_UNKNOWN && cnatoms != natoms) {
-      fprintf(stderr, "FAILED: Different number of atoms in structure file (%d) than in coordinates file (%d)!",
-	      natoms, cnatoms);
-      cplugin->close_file_read(chandle);
-      exit(1);
-    }
-  } else {
-    chandle = handle;
-  }
-
-  /* Read coordinates */
-  if (cplugin->read_next_timestep) {
-    timestep.velocities = NULL;
-    int nsteps = 0;
-    timestep.coords = (float *)malloc(3*natoms*sizeof(float));
-    while (!(rc = cplugin->read_next_timestep(chandle, natoms, &timestep)))
-      nsteps++;
-    free(timestep.coords);
-    if (rc != MOLFILE_SUCCESS) {
-      fprintf(stderr, "FAILED: read_next_timestep returned %d\n", rc);
-    } else {
-      printf("Successfully read %d timesteps\n", nsteps);
-    }
-  }
-
-  /* Close plugin(s) */
-  cplugin->close_file_read(chandle); 
-
-  vmdplugin_fini();
-  printf("Tests finished.\n");
-  return 0;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mapplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mapplugin.C
deleted file mode 100644
index d2a0b65169f1d50adf586d232446bcd283e8d119..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mapplugin.C
+++ /dev/null
@@ -1,225 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mapplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.15 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Autodock Grid Map File format plugin
- *
- * More info for this format can be found at
- * <http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/
- *  Using_AutoDock_305.21.html#pgfId=75765>
- * 
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} gridmap_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *mapgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    fprintf(stderr, "mapplugin) Unexpected end-of-file.\n");
-    returnVal = NULL;
-  }
-  else if (ferror(stream)) {
-    fprintf(stderr, "mapplugin) Error reading file.\n");
-    return NULL;
-  }
-  else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      fprintf(stderr, "mapplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static void *open_map_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  gridmap_t *map;
-  char inbuf[LINESIZE];
-
-  float spacing, midX, midY, midZ;
-  int xsize, ysize, zsize;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "mapplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Skip the header */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-
-  /* Space between grid points */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (sscanf(inbuf, "SPACING %f", &spacing) != 1)
-    return NULL;
-
-  /* Grid size in grid units */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (sscanf(inbuf, "NELEMENTS %d %d %d", &xsize, &ysize, &zsize) != 3) {
-    fprintf(stderr, "mapplugin) Cannot read NELEMENTS.\n");
-    return NULL;
-  }
-
-  /* XXX - I don't know why this is necessary */
-  xsize++;
-  ysize++;
-  zsize++;
-
-  /* Center of the cell */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (sscanf(inbuf, "CENTER %f %f %f", &midX, &midY, &midZ) != 3)
-    return NULL;
-
-  /* Allocate and initialize the map structure */
-  map = new gridmap_t;
-  map->fd = fd;
-  map->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  map->nsets = 1; /* this file contains only one data set */
-
-  map->vol = new molfile_volumetric_t[1];
-  strcpy(map->vol[0].dataname, "Grid Map File");
-
-  /* <midX, midY, midZ> is the middle point of the grid. */
-  map->vol[0].origin[0] = -0.5*(xsize+1.0)* spacing  + midX;
-  map->vol[0].origin[1] = -0.5*(ysize+1.0)* spacing  + midY;
-  map->vol[0].origin[2] = -0.5*(zsize+1.0)* spacing  + midZ;
-
-  map->vol[0].xaxis[0] = xsize * spacing;
-  map->vol[0].xaxis[1] = 0;
-  map->vol[0].xaxis[2] = 0;
-
-  map->vol[0].yaxis[0] = 0;
-  map->vol[0].yaxis[1] = ysize * spacing;
-  map->vol[0].yaxis[2] = 0;
-  
-  map->vol[0].zaxis[0] = 0;
-  map->vol[0].zaxis[1] = 0;
-  map->vol[0].zaxis[2] = zsize * spacing;
-
-  map->vol[0].xsize = xsize;
-  map->vol[0].ysize = ysize;
-  map->vol[0].zsize = zsize;
-
-  map->vol[0].has_color = 0;
-
-  return map;
-}
-
-static int read_map_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  gridmap_t *map = (gridmap_t *)v;
-  *nsets = map->nsets; 
-  *metadata = map->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_map_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  gridmap_t *map = (gridmap_t *)v;
-  FILE *fd = map->fd;
-  float *cellIndex;
-  char inbuf[LINESIZE];
-  int count, ndata;
-
-  cellIndex = datablock;
-  count = 0;
-  ndata = map->vol[0].xsize * map->vol[0].ysize * map->vol[0].zsize;
-
-  /* Read the densities. Order for file is x fast, y medium, z slow */
-  while (count < ndata) {
-    if (mapgets(inbuf, LINESIZE, fd) == NULL) {
-      return MOLFILE_ERROR;
-    }
-
-    *cellIndex = atof(inbuf);
-
-    cellIndex++;
-    count++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_map_read(void *v) {
-  gridmap_t *map = (gridmap_t *)v;
-
-  fclose(map->fd);
-  if (map->vol != NULL)
-    delete [] map->vol; 
-  delete map;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "map";
-  plugin.prettyname = "Autodock Grid Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "map";
-  plugin.open_file_read = open_map_read;
-  plugin.read_volumetric_metadata = read_map_metadata;
-  plugin.read_volumetric_data = read_map_data;
-  plugin.close_file_read = close_map_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mdfplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mdfplugin.C
deleted file mode 100644
index 9f01648994b20dd66b32168952ff667f8e96f40b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mdfplugin.C
+++ /dev/null
@@ -1,417 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mdfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.21 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * Molecular data file (.mdf) reader
- * Insight II, Discover, etc. structure and bond information. This plugin
- * reads only the topology section, ignoring the optional symmetry and
- * atomset sections.
- *
- * Format specification can be found at:
- * http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#484257
- *
- * TODO: The current code reads the file *four* times -- once on open, once
- * to read the structure, and twice to read the bonds. Perhaps these could
- * be consolidated, e.g. by counting the bonds and populating the hash
- * tables during open or read_structure.
- *
- */
-
-#include "molfile_plugin.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define VMDPLUGIN_STATIC
-#include "hash.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-#define NAMESIZE 32
-
-typedef struct {
-  FILE *file;
-  int natoms, nmols, *from, *to;
-  long mol_data_location;
-} mdfdata;
-
-// Read a line of atom data and store the values in the atom structure
-// Return 1 on success, 0 on error
-static int read_mdf_structure_line(molfile_atom_t *atom, const char *line) {
-  // Read pertinent structure information from the line
-  if ( sscanf(line, "%[^:]:%s %s %*s %*s %*d %*s %f %*d %*d %*d %f",
-              atom->resname, atom->name, atom->type, 
-              &atom->charge, &atom->occupancy) != 5 ) {
-    return 0;
-  }
-
-  // Get the resid from the resname
-  if ( sscanf(atom->resname, "%*[^_]_%d", &atom->resid) != 1 ) {
-    return 0;
-  }
-
-  // Provide defaults for missing values
-  atom->chain[0] = '\0';
-  atom->segid[0] = '\0';
-
-  return 1;
-}
-
-// Read the atom info from src and copy the connectivity record to dest.
-// Convert each record to resname_resnumber:atom form
-// Return 1 on success, 0 on error
-static int get_mdf_bonds(char *dest, const char *src) {
-  char resinfo[NAMESIZE], bond_records[LINESIZE], *curr, *next, *tmp;
-  int retval;
-
-  // Get the connectivity records
-  retval = sscanf(src, "%[^:]:%*s %*s %*s %*s %*d %*s %*f %*d %*d %*d %*f %*f %255c", resinfo, bond_records);
-  if (retval < 1) {
-    // parse error.
-    return -1;
-    // no bonds for this atom
-  } else if (retval == 1) return 0;
-  
-  // Append the bonds to the destination string, converting then to the
-  // correct format along the way.
-  dest[0] = '\0';
-  for ( curr = bond_records; (next = strchr(curr, ' ')) != NULL;
-        curr = next + 1 ) {
-    *next = '\0';
-
-    // Prepend the resname and resid to the destination atom name if it's
-    // not already present.
-    if ( strchr(curr, ':') == NULL ) {
-      strcat(dest, resinfo);
-      strcat(dest, ":");
-    }
-
-    // Remove cell/sympop/bondorder information from the bond
-    if ( ((tmp = strchr(curr, '%')) != NULL) ||
-         ((tmp = strchr(curr, '#')) != NULL) ||
-         ((tmp = strchr(curr, '/')) != NULL) ||
-         ((tmp = strchr(curr, '\n')) != NULL) ) {
-      *tmp = '\0';
-    }
-    strcat(dest, curr);
-    strcat(dest, " ");
-  }
-
-  return 1;
-}
-
-// Return the number of bond records on a line
-static int count_mdf_bonds(const char *line) {
-  char bond_records[LINESIZE];
-  int bonds = 0;
-  char *tmp;
-  
-  // no bonds or parse error
-  if ( get_mdf_bonds(bond_records, line) < 1) {
-    return 0;
-  }
-  
-  for ( tmp = bond_records; (tmp = strchr(tmp, ' ')) != NULL;
-        tmp++ ) {
-    bonds++;
-  }
-
-  return bonds;
-}
-
-// Open the file and create the mdf struct used to pass data to the other
-// functions.
-static void *open_mdf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  mdfdata *mdf;
-  long mol_data_location;
-  char line[LINESIZE]; 
-  int nmols = 0;
-
-  fd = fopen(path, "r");
-  if (!fd)
-    return NULL;
-  
-  // Find the first molecule record
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      vmdcon_printf(VMDCON_ERROR, "mdfplugin) No molecule record found in file.\n");
-      return NULL;
-    }
-  } while ( strncmp(line, "@molecule", 9) );
-
-  // Remember the location of the beginning of the molecule data
-  mol_data_location = ftell(fd);
-
-  // Count the atoms in each molecule
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, fd);
-
-    // Count atoms until a new molecule or the end of the section is reached
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') )
-        *natoms = *natoms + 1;
-      fgets(line, LINESIZE, fd);
-      if ( ferror(fd) || feof(fd) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) Error while counting atoms.\n");
-        return NULL;
-      }
-    }
-    nmols++;
-  }
-
-  // Allocate and initialize the mdf structure
-  vmdcon_printf(VMDCON_INFO, "mdfplugin) %d molecule records found in file.\n", nmols);
-  mdf = new mdfdata;
-  mdf->file = fd;
-  mdf->natoms = *natoms;
-  mdf->nmols = nmols;
-  mdf->from = NULL;
-  mdf->to = NULL;
-  mdf->mol_data_location = mol_data_location; 
-
-  return mdf;
-}
-
-// Read the atom information for each molecule, but not bonds.
-// XXX - this ignores the column records, which may cause the atom records
-// to be read incorrectly.
-static int read_mdf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  mdfdata *mdf = (mdfdata *)v;
-  char line[LINESIZE];
-  int mol_num;
-  molfile_atom_t *atom = atoms;
-
-  *optflags = MOLFILE_OCCUPANCY | MOLFILE_CHARGE;
-
-  // Seek to the first molecule record
-  fseek(mdf->file, mdf->mol_data_location, SEEK_SET);
-  line[0] = '\0';
-
-  // Read the atom structure for each molecule
-  mol_num = 0;
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, mdf->file);
-
-    // Read atom structure for the current molecule
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') ) {
-        if ( !read_mdf_structure_line(atom, line) ) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Improperly formatted atom record encountered while reading structure.\n");
-          return MOLFILE_ERROR;
-        }
-
-        // use the chain name to flag different molecules by using
-        // characters A-Z. NOTE: chain can only hold 1 char.
-        sprintf(atom->chain, "%c", ('A'+(mol_num % 26)));
-
-        atom++;
-      }
-
-      fgets(line, LINESIZE, mdf->file);
-      if ( ferror(mdf->file) || feof(mdf->file) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) File error while reading structure.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-    mol_num++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-// Create arrays of one-based bond indicies.
-static int read_mdf_bonds(void *v, int *nbonds, int **from_data, int **to_data, 
-                          float **bondorderptr, int **bondtype, 
-                          int *nbondtypes, char ***bondtypename) {
-  mdfdata *mdf = (mdfdata *)v;
-  int mol, atom, bond_count, *fromptr, *toptr, tmp_to;
-  char *curr, *next, line[LINESIZE], bond_records[LINESIZE];
-  char (*atomnames)[NAMESIZE]; // Dynamic array of cstrings
-  hash_t *hasharray;           // Array of hash tables
-
-  // Allocate and initialize the hash table for each molecule.
-  hasharray = new hash_t[mdf->nmols];
-  for (mol = 0; mol < mdf->nmols; mol++) {
-    hash_init(&hasharray[mol], 256);
-  }
-  atomnames = new char[mdf->natoms][NAMESIZE];
-
-  // Populate the hash table; key: atom name; value: one-based atom index.
-  // Count the bonds, each bond is counted twice.
-  fseek(mdf->file, mdf->mol_data_location, SEEK_SET);
-  line[0] = '\0';
-  atom = 1;
-  mol = 0;
-  bond_count = 0;
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, mdf->file);
-
-    // Read the atom names
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') ) {
-        if ( sscanf(line, "%s %*s", atomnames[atom-1]) != 1 ) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Improperly formatted atom record encountered while reading bonds.\n");
-          return MOLFILE_ERROR;
-        }
-        if ( hash_insert(&hasharray[mol], atomnames[atom-1], atom) != HASH_FAIL ) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Could not add atom to hash table.\n");
-          return MOLFILE_ERROR;
-        }
-
-        bond_count += count_mdf_bonds(line);
-        atom++;
-      }
-
-      fgets(line, LINESIZE, mdf->file);
-      if ( ferror(mdf->file) || feof(mdf->file) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) File error while reading bonds.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    mol++;
-  }
-
-  bond_count /= 2;
-  mdf->from = new int[bond_count];
-  mdf->to = new int[bond_count];
-  fromptr = mdf->from;
-  toptr = mdf->to;
-
-  // Read the molecules, storing the bond-indicies in fromptr and toprt
-  fseek(mdf->file, mdf->mol_data_location, SEEK_SET);
-  line[0] = '\0';
-  atom = 1;
-  mol = 0;
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, mdf->file);
-
-    // Read the bonds
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      int retval;
-
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') ) {
-        retval = get_mdf_bonds(bond_records, line);
-        if (retval < 0) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Error reading bonds from atom data.\n");
-          return MOLFILE_ERROR;
-        }
-
-        if (retval > 0) {
-          // Read each bond in the line
-          for ( curr = bond_records; (next = strchr(curr, ' ')) != NULL; 
-                curr = next+1 ) {
-            *next = '\0';
-            tmp_to = hash_lookup(&hasharray[mol], curr);
-            if (tmp_to == HASH_FAIL) {
-              vmdcon_printf(VMDCON_ERROR, "mdfplugin) Could not find atom '%s' in hash table.\n", curr);
-              return MOLFILE_ERROR;
-            }
-            else if (tmp_to > atom) {
-              // Only count bonds to atoms greater than the current one, since
-              // each bond is listed twice
-              *fromptr = atom;
-              *toptr = tmp_to;
-              fromptr++;
-              toptr++;
-            }
-          }
-        }
-
-        atom++;
-      }
-
-      fgets(line, LINESIZE, mdf->file);
-      if ( ferror(mdf->file) || feof(mdf->file) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) File error while reading bonds.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    mol++;
-  }
-
-  for (mol = 0; mol < mdf->nmols; mol++) {
-    hash_destroy(&hasharray[mol]);
-  }
-  delete [] hasharray;
-  delete [] atomnames;
-
-  *nbonds = bond_count;
-  *from_data = mdf->from;
-  *to_data = mdf->to;
-  *bondorderptr = NULL; // not implemented yet
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-// Free the memory used by the mdf structure
-static void close_mdf_read(void *v) {
-  mdfdata *mdf = (mdfdata *)v;
-  if (mdf) {
-    if (mdf->file) fclose(mdf->file);
-    if (mdf->from) delete [] mdf->from;
-    if (mdf->to)   delete [] mdf->to;
-    delete mdf;
-  }
-}
-
-// Plugin Initialization
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "mdf";
-  plugin.prettyname = "InsightII MDF";
-  plugin.author = "Eamon Caddigan, Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mdf";
-  plugin.open_file_read = open_mdf_read;
-  plugin.read_structure = read_mdf_structure;
-  plugin.read_bonds = read_mdf_bonds;
-  plugin.close_file_read = close_mdf_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mmcif.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mmcif.C
deleted file mode 100644
index 1a7c73f20c3b0511c533f3ac89083390e5fe40c9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mmcif.C
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mmcif.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  mmCIF molecule file format (a subset of the STAR file format):
- *    http://mmcif.rcsb.org/mmcif-early/background/index.html#1
- *    http://mmcif.rcsb.org/mmcif-early/workshop/mmCIF-tutorials/
- *
- *  mmCIF reserved keywords: data_ loop_ global_ save_ stop_
- *
- *  STAR file syntax and rules (superset of mmCIF):
- *    http://journals.iucr.org/iucr-top/cif/standard/cifstd4.html
- *
- *  STAR syntactic entities: 
- *    Text string: string of characters bounded by blanks, single quotes (') 
- *                 double quotes ("), or by semi-colons (;) as the first 
- *                 character of a line
- *
- *    Data name:   a text string starting with an underline (_) character 
- *
- *    Data item:   a text string not starting with an underline, but preceded 
- *                 by a data name to identify it 
- * 
- *    Data loop:   a list of data names, preceded by loop_ and followed by 
- *                 a repeated list of data items 
- *
- *    Data block:  a collection of data names (looped or not) and data items 
- *                 that are preceded by a data_ code record. A data name must 
- *                 be unique within a data block. A data block is terminated 
- *                 by another data_ statement or the end of file 
- * 
- *    Data file:   a collection of data blocks; the block codes must be 
- *                 unique within a data file  
- *
- *  CIF restrictions to STAR syntax:
- *    http://journals.iucr.org/iucr-top/cif/standard/cifstd5.html
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-#include "periodic_table.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  molfile_atom_t *atomlist;
-} mmcifdata;
- 
-static void *open_mmcif_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  // XXX not finished yet
-  return NULL;
-}
-
-static int read_mmcif_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  // XXX not finished yet 
-  return MOLFILE_ERROR;
-}
-
-static int read_mmcif_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  mmcifdata *data = (mmcifdata *)mydata;
-
-  // XXX not finished yet 
-  return MOLFILE_ERROR;
-}
-    
-static void close_mmcif_read(void *mydata) {
-  mmcifdata *data = (mmcifdata *)mydata;
-  fclose(data->file);
-  free(data);
-}
-
-
-static void *open_mmcif_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  mmcifdata *data;
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    fprintf(stderr, "mmcifplugin) Error: unable to open mmcif file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (mmcifdata *)malloc(sizeof(mmcifdata));
-  data->numatoms = natoms;
-  data->file = fd;
-  return data;
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "mmcif";
-  plugin.prettyname = "mmCIF";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cif";
-  plugin.open_file_read = open_mmcif_read;
-  plugin.read_structure = read_mmcif_structure;
-  plugin.read_next_timestep = read_mmcif_timestep;
-  plugin.close_file_read = close_mmcif_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_mmcif_read(*argv, "mmcif", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_mmcif_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_mmcif_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_mmcif_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_mmcif_read(v);
-  }
-  return 0;
-}
-
-#endif
-
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mol2plugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mol2plugin.C
deleted file mode 100644
index c527043672dde08983c67f700aa97bdfaf514e79..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/mol2plugin.C
+++ /dev/null
@@ -1,609 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mol2plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.38 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-  
-/*
- * mol2 file reader
- * More information on this format is available at
- *   http://www.tripos.com/data/support/mol2.pdf
- *   http://www.tripos.com/mol2/
- *
- *   DOCK mol2 page: 
- *     http://www.csb.yale.edu/userguides/datamanip/dock/DOCK_4.0.1/html/Manual.41.html
- *
- * This plugin currently reads the following record types:
- *  MOLECULE
- *  ATOM
- *  BOND
- *
- */
-
-#include "molfile_plugin.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-
-typedef struct {
-  FILE *file;
-  molfile_atom_t *atomlist;
-  int natoms, nbonds, optflags, coords_read;
-  int *from, *to;
-  float *bondorder;
-} mol2data;
-
-// Open the file and create the mol2 struct used to pass data to the other
-// functions.
-static void *open_mol2_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  mol2data *mol2;
-  char line[LINESIZE]; 
-  int match, nbonds, optflags;
-
-  fd = fopen(path, "r");
-  if (!fd)
-    return NULL;
-  
-  // Find and read the MOLECULE record
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      fprintf(stderr, "mol2plugin) No molecule record found in file.\n");
-      return NULL;
-    }
-  } while ( strncmp(line, "@<TRIPOS>MOLECULE", 17) );
-
-  fgets(line, LINESIZE, fd);  // Read and ignore the mol_name
-  fgets(line, LINESIZE, fd);  // Read the molecule info
-  match = sscanf(line, " %d %d", natoms, &nbonds);
-  if (match == 1) {
-    nbonds = 0;
-  }
-  else if (match != 2) {
-    fprintf(stderr, "mol2plugin) Cannot determine the number of atoms.\n");
-    return NULL;
-  }
-  fgets(line, LINESIZE, fd);  // Read and ignore the mol_type
-  fgets(line, LINESIZE, fd);  // Read the charge_type
-  if ( strncmp(line, "NO_CHARGES", 10) == 0 ) {
-    optflags = MOLFILE_NOOPTIONS;
-  }
-  else {
-    optflags = MOLFILE_CHARGE;
-  }
-
-  // Allocate and initialize the mol2 structure
-  mol2 =  (mol2data *) malloc(sizeof(mol2data));
-  memset(mol2, 0, sizeof(mol2data));
-  mol2->file = fd;
-  mol2->natoms = *natoms;
-  mol2->nbonds = nbonds;
-  mol2->optflags = optflags;
-  mol2->coords_read = 0;
-  mol2->from = NULL;
-  mol2->to = NULL;
-  mol2->bondorder = NULL;
-
-  return mol2;
-}
-
-// Read atom information, but not coordinates.
-static int read_mol2(void *v, int *optflags, molfile_atom_t *atoms) {
-  mol2data *mol2 = (mol2data *)v;
-  char line[LINESIZE]; 
-  int i, match;
-  molfile_atom_t *atom;
-
-  *optflags = mol2->optflags;
-
-  // Find and read the ATOM record
-  rewind(mol2->file);
-  do {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) No atom record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "@<TRIPOS>ATOM", 13) );
-
-  // Read the atoms
-  for (i = 0; i < mol2->natoms; i++) {
-    atom = atoms+i;
-
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) Error occurred reading atom record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    match = sscanf(line, " %*d %s %*f %*f %*f %s %d %s %f", 
-      atom->name, atom->type, &atom->resid, atom->resname, &atom->charge);
-
-    // The last three records are optional for mol2 files, supply values if
-    // any are missing. Note that these cases are meant to fall through.
-    switch (match) {
-      case 0: 
-        fprintf(stderr, "mol2plugin) Improperly formatted atom record.\n");
-        return MOLFILE_ERROR;
-
-      case 1:
-        atom->resid = 0;
-
-      case 2:
-        sprintf(atom->resname, "%d", atom->resid);
-
-      case 3:
-        atom->charge = 0.0;
-
-      default:
-        break;
-    }
-
-    // Leave these blank when not provided by the file.
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(mol2->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-
-// Create arrays of one-based bond indicies.
-static int read_mol2_bonds_aux(void *v, int *nbonds, int **fromptr, int **toptr, 
-                               float **bondorderptr) {
-  mol2data *mol2 = (mol2data *)v;
-  char line[LINESIZE], bond_type[16]; 
-  int i, match, bond_from, bond_to, bond_index, current_nbonds;
-  float curr_order;
-
-  if (mol2->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    return MOLFILE_SUCCESS;
-  }
-
-  current_nbonds = mol2->nbonds;
-
-  // Find and read the BOND record
-  rewind(mol2->file);
-  do {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) No bond record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "@<TRIPOS>BOND", 13) );
-
-  // Read the bonds
-  bond_index = 0;
-  for (i = 0; i < mol2->nbonds; i++) {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) Error occurred reading bond record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    // Move on if the next line is a header
-    if (strncmp(line, "@", 1) == 0) {
-      //Then the bonds are over
-      break;
-    }
-
-    match = sscanf(line, " %*d %d %d %s", &bond_from, &bond_to, bond_type);
-    if (match < 3) {
-      fprintf(stderr, "mol2plugin) Improperly formatted bond record.\n");
-      continue;
-    }
-    if ( strncmp(bond_type, "nc", 2) == 0 ) {
-      // Not an actual bond, don't add it to the list
-      current_nbonds--;
-    } else if ( strncmp(bond_type, "ar", 2) == 0) {
-       // Aromatic; consider it order 1.5
-       curr_order = 1.5;
-       mol2->from[bond_index] = bond_from;
-       mol2->to[bond_index] = bond_to;
-       mol2->bondorder[bond_index]=curr_order;
-       bond_index++;
-     } else {
-      // Add the bond to the list
-      curr_order=strtod(bond_type,NULL);
-      if (curr_order<1.0 || curr_order>4.0) curr_order=1;
-      //fprintf(stdout,"mol2plugin: Bond from %d to %d of order %f\n", bond_from, bond_to, curr_order);
-      fflush(stdout);
-      mol2->from[bond_index] = bond_from;
-      mol2->to[bond_index] = bond_to;
-      mol2->bondorder[bond_index]=curr_order;
-      bond_index++;
-    }
-  }
-  if (bond_index > 0) {
-    *nbonds = current_nbonds;
-    *fromptr = mol2->from;
-    *toptr = mol2->to;
-    *bondorderptr = mol2->bondorder; 
-  } else {
-    printf("mol2plugin) WARNING: no bonds defined in mol2 file\n");
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL; 
-  }
-    
-  rewind(mol2->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-// Read atom coordinates
-static int read_mol2_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  mol2data *mol2 = (mol2data *)v;
-  char line[LINESIZE];
-  int i, match;
-  float x, y, z;
-
-  // Find and read the ATOM record
-  do {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-
-      //This is a problem, unless we've read at least one timestep
-      if (mol2->coords_read == 0) {
-        fprintf(stderr, "mol2plugin) No atom record found in file.\n");
-      }
-
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "@<TRIPOS>ATOM", 13) );
-
-  // Read the atoms
-  for (i = 0; i < mol2->natoms; i++) {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) Error occurred reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-
-    match = sscanf(line, " %*d %*s %f %f %f", &x, &y, &z);
-    if (match < 3) {
-      fprintf(stderr, "mol2plugin) Improperly formatted atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (ts) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-  mol2->coords_read = 1;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void *open_mol2_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  mol2data *data;
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    fprintf(stderr, "mol2plugin) Error: unable to open mol2 file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (mol2data *) malloc(sizeof(mol2data));
-  memset(data, 0, sizeof(mol2data));
-  data->natoms = natoms;
-  data->file = fd;
-  data->nbonds = 0;
-//  data->file_name = strdup(filename);
-  return data;
-}
-
-
-static int write_mol2_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  mol2data *data = (mol2data *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->natoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->natoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-/*
-void getmol2ff(char* outputtype, const char* psftype) {
-  //fprintf(stdout,"Doing ff typing on %s\n",psftype);
-  if (strncmp(psftype,"H",1)==0) {
-    //It's a hydrogen
-    strncpy(outputtype, "H   ",4);
-    return;
-  } else if (strncmp(psftype,"C",1)==0) {
-    //It's a carbon... probably
-    if (strncmp(psftype,"C ",2)==0  || strncmp(psftype,"CA ",3)==0 || 
-        strncmp(psftype,"CPH",3)==0 || strncmp(psftype,"CPT",3)==0 || 
-        strncmp(psftype,"CC ",3)==0 || strncmp(psftype,"CD ",3)==0 || 
-        strncmp(psftype,"CN1",3)==0 || strncmp(psftype,"CN2",3)==0 || 
-        strncmp(psftype,"CN3",3)==0 || strncmp(psftype,"CN4",3)==0 || 
-        strncmp(psftype,"CN5",3)==0 || strncmp(psftype,"CNA",3)==0) {
-      strncpy(outputtype, "C.2 ",4);
-      return;
-    } else {
-      strncpy(outputtype, "C.3 ",4);
-      return;
-    }  
-  } else if (strncmp(psftype,"N",1)==0) {
-     //It"s probably nitrogen
-     if (strncmp(psftype,"NR",2)==0 || strncmp(psftype,"NH1",3)==0 || 
-         strncmp(psftype,"NH2",3)==0 || strncmp(psftype,"NC2",3)==0 || 
-         strncmp(psftype,"NY",2)==0 || 
-         (strncmp(psftype,"NN",2)==0 && strncmp(psftype,"NN6",3)!=0)) {
-       strncpy(outputtype, "N.am",4);
-       return;
-       } else {
-       strncpy(outputtype, "N.3 ",4);
-       return;
-       }
-  } else if (strncmp(psftype,"O",1)==0) {
-     //Probably an oxygen
-     if (strncmp(psftype,"OH1",3)==0 || strncmp(psftype,"OS",2)==0 || 
-         strncmp(psftype,"OT ",3)==0 || strncmp(psftype,"ON4",3)==0 || 
-         strncmp(psftype,"ON5",3)==0 || strncmp(psftype,"ON6",3)==0) {
-       strncpy(outputtype, "O.3 ",4);
-       return;
-     } else {
-       strncpy(outputtype, "O.2 ",4);
-       return;
-     } 
-  } else if (strncmp(psftype,"S",1)==0) {
-     strncpy(outputtype, "S.3 ",4);
-     return;
-  } else if (strncmp(psftype,"P",1)==0) {
-     strncpy(outputtype, "P.3 ",4);
-     return;
-  } else {
-     strncpy(outputtype, "X.  ",4);
-     return;
-  }
-}
-*/
-
-
-
-
-
-
-static int write_mol2_timestep(void *mydata, const molfile_timestep_t *ts) {
-  mol2data *data = (mol2data *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  float chrgsq;
-  int i;
-
-  // try to guess whether we have charge information.
-  chrgsq=0.0;
-  atom = data->atomlist;
-  for (i = 0; i < data->natoms; i++) {
-      chrgsq += atom->charge*atom->charge;
-      ++atom;
-  }
-
-  //print header block
-  fprintf(data->file, "@<TRIPOS>MOLECULE\n");
-  fprintf(data->file, "generated by VMD\n");
-  fprintf(data->file, " %4d %4d    1    0    0\n", data->natoms, data->nbonds);
-  fprintf(data->file, "SMALL\n");
-  // educated guess
-  if (chrgsq > 0.0001) {
-      fprintf(data->file, "USER_CHARGES\n");
-  } else {
-      fprintf(data->file, "NO_CHARGES\n");
-  }
-  fprintf(data->file, "****\n");
-  fprintf(data->file, "Energy = 0\n\n");
-  
-  //print atoms block
-  fprintf(data->file, "@<TRIPOS>ATOM\n");
-  atom = data->atomlist;
-  pos = ts->coords;
-  //char mol2fftype[5];
-  //mol2fftype[4] = '\0';
-  for (i = 0; i < data->natoms; i++) {
-#if 0
-    getmol2ff(mol2fftype, atom->type);
-    fprintf(data->file, "%7d %-4s      %8.4f  %8.4f  %8.4f %4s %4d  %3s        %8.6f\n", i+1, atom->name, pos[0], pos[1], pos[2], mol2fftype, atom->resid, atom->resname, atom->charge);
-#else
-    fprintf(data->file, "%7d %-4s      %8.4f  %8.4f  %8.4f %4s %4d  %3s        %8.6f\n", i+1, atom->name, pos[0], pos[1], pos[2], atom->type, atom->resid, atom->resname, atom->charge);
-#endif
-    ++atom; 
-    pos += 3;
-  }
-
-  //print bond info
-
-  int l=1; //number of bond record
-  printf("mol2plugin) numbonds: %d\n", data->nbonds);
-  if (data->nbonds>0) fprintf(data->file, "@<TRIPOS>BOND\n");
-  for (i=0; i<data->nbonds; i++) {
-    // For mol2, only write bonds for fromptr[i]<toptr[i]
-    // bondorder is either 1, 2, 3 or a textual representation: am,ar,du,un,nc
-    // we don't have the info for the text, so we truncate to integer.
-    if (data->bondorder != NULL) {
-      fprintf(data->file, "%5d %5d %5d %2d\n", l ,data->from[i], data->to[i],
-              (int)data->bondorder[i]);
-    } else {
-      fprintf(data->file, "%5d %5d %5d %2d\n", l ,data->from[i], data->to[i], 1);
-    }
-
-    l++;
-  } 
-
-  // Print out substructure info to keep some programs sane
-  fprintf(data->file,"\n@<TRIPOS>SUBSTRUCTURE\n");
-  fprintf(data->file,"1 ****        1 TEMP                        ");
-  fprintf(data->file,"0 ****  **** 0 ROOT\n");
-
-  return MOLFILE_SUCCESS;
-}
-
-static int write_mol2_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                            float *bondorderptr,  int *bondtype, 
-                            int nbondtypes, char **bondtypename) {
-  printf("*** RUNNING WRITE_MOL2_BONDS\n");
-  mol2data *data = (mol2data *)v;
-  data->nbonds = nbonds;
-  data->from = (int *) malloc(nbonds * sizeof(int));
-  data->to = (int *) malloc(nbonds * sizeof(int));
-  //set the pointers for use later
-  for (int i=0;i<nbonds;i++) {
-    data->from[i]=fromptr[i];
-    data->to[i]=toptr[i];
-  }
-  printf("*** I THINK nbonds is %i\n", nbonds);
-  data->nbonds = nbonds;
-  if (bondorderptr != NULL) {
-    data->bondorder = (float *) malloc(nbonds * sizeof(float));
-    for (int i=0;i<nbonds;i++) {
-      data->bondorder[i]=bondorderptr[i];
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_mol2_write(void *mydata) {
-  mol2data *data = (mol2data *)mydata;
-  if (data) {
-    if (data->file) fclose(data->file);
-    if (data->from != NULL) free(data->from);
-    data->from = NULL;
-    if (data->to != NULL)   free(data->to);
-    data->to = NULL;
-    if (data->bondorder != NULL)   free(data->bondorder);
-    data->bondorder = NULL;
-    if (data->atomlist != NULL) free(data->atomlist);
-    data->atomlist = NULL;
-    free(data);
-  }
-}
-
-//
-// Free the memory used by the mol2 structure
-static void close_mol2_read(void *v) {
-  mol2data *mol2 = (mol2data *)v;
-  if (mol2) {
-    if (mol2->file) fclose(mol2->file);
-    if (mol2->from != NULL) free(mol2->from);
-    mol2->from = NULL;
-    if (mol2->to != NULL)   free(mol2->to);
-    mol2->to = NULL;
-    if (mol2->bondorder != NULL)   free(mol2->bondorder);
-    mol2->bondorder = NULL;
-    free(mol2);
-  }
-}
-
-
-static int read_mol2_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                           float **bondorderptr, int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  mol2data *mol2 = (mol2data *)v;
-
-  /* now read bond data */
-//  *nbonds = start_psf_bonds(psf->fp);
-
-  if (mol2->nbonds > 0) {
-    mol2->from = (int *) malloc(mol2->nbonds*sizeof(int));
-    mol2->to = (int *) malloc(mol2->nbonds*sizeof(int));
-    mol2->bondorder = (float *) malloc(mol2->nbonds*sizeof(float));
-    if (mol2->from == NULL || mol2->to == NULL || mol2->bondorder == NULL) {
-      fprintf(stderr, "mol2plugin) ERROR: Failed to allocate memory for bonds\n");
-      fclose(mol2->file);
-      mol2->file = NULL;
-      return MOLFILE_ERROR;
-    }
-    if ((read_mol2_bonds_aux(mol2, nbonds, &(mol2->from), &(mol2->to), &(mol2->bondorder))) != MOLFILE_SUCCESS) {
-      fclose(mol2->file);
-      mol2->file = NULL;
-      return MOLFILE_ERROR;
-    }
-    *fromptr = mol2->from;
-    *toptr = mol2->to;
-    *bondorderptr = mol2->bondorder; 
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  } else {
-    printf("mol2plugin) WARNING: zero bonds defined in mol2 file.\n");
-    *nbonds = 0;
-    *fromptr=NULL;
-    *toptr=NULL;
-    *bondorderptr=NULL;
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "mol2";
-  plugin.prettyname = "MDL mol2";
-  plugin.author = "Peter Freddolino, Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 17;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mol2";
-  plugin.open_file_read = open_mol2_read;
-  plugin.read_structure = read_mol2;
-  plugin.read_bonds = read_mol2_bonds;
-  plugin.read_next_timestep = read_mol2_timestep;
-  plugin.close_file_read = close_mol2_read;
-  plugin.open_file_write = open_mol2_write;
-  plugin.write_structure = write_mol2_structure;
-  plugin.write_timestep = write_mol2_timestep;
-  plugin.close_file_write = close_mol2_write;
-  plugin.write_bonds = write_mol2_bonds;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/moldenplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/moldenplugin.c
deleted file mode 100644
index 1dac910f1daa2ee682c703eebc79cde48b21aa9e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/moldenplugin.c
+++ /dev/null
@@ -1,1332 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: moldenplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.40 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* This is a plugin that will read input from a MOLDEN
-** generated output file 
-** some more details will go here soon 
-** NOTE: The current version of the plugin relies
-** on the fact that the [Atom] field comes before
-** the [Geometries] field */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#include "molfile_plugin.h"
-#include "unit_conversion.h"
-#include "periodic_table.h"
-#include "qmplugin.h"
-
-
-#define ALLOCATE(array, type, size) \
-  array = (type *)calloc(size, sizeof(type)); \
-  if (array == NULL) { \
-    fprintf(stderr, "moldenplugin) Memory allocation for %s failed!\n", #array); \
-    return FALSE; \
-  }
-
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-
-
-/* I could use a flag already present in qmdata_t to 
- * indicate a trajectory, but I'm using moldendata_t 
- * to demonstrate the use of 
- * void *format_specific_data;
- * in qmdata_t as a means to store data specific to 
- * the plugin. 
- */
-typedef struct {
-  long filepos_atoms;   /* [ATOMS] section */
-  long filepos_geomxyz; /* [GEOMETRIES] XYZ section */
-  long filepos_gto;     /* [GTO] section */
-  long filepos_mo;      /* [MO] section */
-  char units[16];
-  int coordsonly;
-} moldendata_t;
-
-
-
-/* Read the basis set data */
-static int get_basis (qmdata_t *);
-static int shelltype_int(char *type);
-static int fill_basis_arrays(qmdata_t *data);
-
-static int read_geom_block(qmdata_t *data);
-static int read_molecular_orbitals(qmdata_t *data);
-static int read_wave_coeffs(FILE *file, qm_wavefunction_t *wave);
-static int count_orbitals(qmdata_t *data);
-
-
-/*********************************************************
- *
- * Open file and return number of atoms.
- *
- * In order to determine the # atom we have to read into
- * the [ATOMS]/[GEOMETRIES] sections where the atoms are
- * defined.
- * There can be either [ATOMS] or [GEOMETRIES] or both.
- * While [GEOMETRIES] has the # atoms as its first line,
- * we actually have to count lines in [ATOMS].
- *
- * We assume no particular order for the sections and scan
- * the entire file for the according keywords. In order to
- * save time when the section contents are actually read
- * we store the file pointers to the beginning of each
- * section in moldendata_t.
- *
- *********************************************************/
-static void *open_molden_read(const char *filename,
-                              const char *filetype,
-                              int *natoms) {
-  FILE *fd;
-  qmdata_t *data = NULL;
-  moldendata_t *moldendata;
-  char buffer[1024];
-  char keystring[20];
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  /* allocate memory for main QM data structure */
-  data = init_qmdata();
-  if (!data) return NULL;
-
-  data->file = fd;
-
-  /* allocate GAMESS specific data */
-  moldendata = (moldendata_t *)calloc(1, sizeof(moldendata_t));
-  if (!moldendata) return NULL;
-
-  data->format_specific_data = moldendata;
-
-
-  /* Read first line */
-  if (!fgets(buffer,1024,data->file)) return NULL;
-
-  /* Check if the file is MOLDEN format */
-  if (!strcmp(strtoupper(trimleft(trimright(buffer))), "[MOLDEN FORMAT]")) {
-    printf("moldenplugin) Detected MOLDEN file format!\n");
-  } else {
-    printf("moldenplugin) The file is not in MOLDEN format!\n");
-    return NULL;
-  }
-
-  eatwhitelines(data->file);
-
-
-  /* Identify the different sections. */
-  while (fgets(buffer,1024,data->file)) {
-
-    /* Get key string (ignoring empty lines) */
-    if (!sscanf(buffer, "%s", keystring)) continue;
-
-    /* Quick test avoiding the uppercase transformation */
-    if (keystring[0]!='[') continue;
-
-    /* Make keystring upper case */
-    strtoupper(keystring);
-
-    if (!strcmp(keystring, "[5D]") || !strcmp(keystring, "[5D7F]") ||
-	!strcmp(keystring, "[7F]") || !strcmp(keystring, "[5D10F]") ||
-	!strcmp(keystring, "[9G]")) {
-      printf("moldenplugin) Spherical harmonic basis found %s. \n", keystring);
-      printf("moldenplugin)   Currently VMD handles only basis sets/wave functions\n");
-      printf("moldenplugin)   with cartesian Gaussian functions.\n");
-      printf("moldenplugin)   Loading coordinates only.\n");
-      moldendata->coordsonly = 1;
-    }
-
-    if (!strcmp(keystring, "[ATOMS]")) {
-      char *s;
-      long prevline=ftell(fd);
-      printf("moldenplugin) Found [ATOMS] section ...\n");
-      moldendata->filepos_atoms = ftell(data->file);
-
-      if (!sscanf(buffer, "%*s %s", moldendata->units)) {
-        printf("moldenplugin) Missing units in [ATOMS] section!\n");
-        return NULL;
-      }
-
-      /* start counting the atoms; 
-       * read until I hit the first line that starts with a "["
-       * bracket */      
-      (*natoms) = 0; 
-      s = fgets(buffer, 1024, fd);
-
-      /* Here we assume that the [ATOMS] section goes
-       * on until the next empty line or another section
-       * starts, i.e. there is a "[" or we encounter EOF */
-      while (trimleft(buffer)[0]!='[' && s!=NULL && !iswhiteline(buffer)) {
-        (*natoms)++;
-        prevline = ftell(fd);
-        s = fgets(buffer, 1024, fd);
-      }
-      data->numatoms = *natoms;
-      data->num_frames = 1;
-
-      /* Go back to the previous line, it might contain
-       * the next keyword */
-      fseek(data->file, prevline, SEEK_SET);
-    }
-
-    else if (!strcmp(keystring, "[GEOMETRIES]")) {
-      if (!strcmp(trimright(buffer), "[GEOMETRIES] XYZ")) {
-        printf("moldenplugin) Found [GEOMETRIES] XYZ section ...\n");
-
-        moldendata->filepos_geomxyz = ftell(data->file);
-
-        /* The first line of the XYZ type [GEOMETRIES] input
-         * contains the number of atoms. */
-        if (fscanf(data->file, "%d", natoms) != 1) {
-          printf("moldenplugin) No # atoms found in [GEOMETRIES] section!\n");
-          return NULL;
-        }
-        data->numatoms = *natoms;
-
-        /* Jump back to the beginning of the section */
-        fseek(data->file, moldendata->filepos_geomxyz, SEEK_SET);
-
-        /* Count # frames */
-        data->num_frames = 0;
-        do {
-          int natm = 0;
-          fscanf(data->file, "%d", &natm);
-          if (natm!=data->numatoms) break;
-          eatline(data->file, 1);
-
-          data->filepos_array = (long*)realloc(data->filepos_array,
-                                               (data->num_frames+1)*sizeof(long));
-          data->filepos_array[data->num_frames] = ftell(data->file);
-
-          /* Skip title line + numatoms lines */
-          eatline(data->file, 1+data->numatoms);
-          if (feof(data->file)) break;
-
-          data->num_frames++;
-        } while (1);
-
-        printf("moldenplugin) Found %d frames\n", data->num_frames);
-      } else if (!strcmp(trimright(buffer), "[GEOMETRIES] ZMAT")) {
-        printf("moldenplugin) [GEOMETRIES] ZMAT not supported!\n");
-      }
-    }
-
-    else if (!strcmp(keystring,"[GTO]")) {
-      printf("moldenplugin) Found [GTO] section ...\n");
-      moldendata->filepos_gto = ftell(data->file);
-    }
-
-    else if (!strcmp(keystring,"[MO]")) {
-      printf("moldenplugin) Found [MO] section ...\n");
-      moldendata->filepos_mo = ftell(data->file);
-    }
-
-  };
-  
-  return data;
-}
-
-
-
-/*********************************************************
- *
- * Read geometry from file
- *
- * The [ATOMS] section provides atom name, atomic number
- * and coordinates while the [GEOMETRIES] XYZ section
- * provides atom type and coordinates. Trajectories can
- * only be specified using [GEOMETRIES].
- * In case we only have [GEOMETRIES] the atomic number
- * will have to be deduced from the atom name.
- *
- *********************************************************/
-static int read_molden_structure(void *mydata, int *optflags, 
-                                 molfile_atom_t *atoms) 
-{
-  int i;
-  char buffer[1024];
-  char atname[1024];
-  int num, atomicnum;
-  molfile_atom_t *atom;
-  qmdata_t *data = (qmdata_t *)mydata;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-
-  ALLOCATE(data->atoms, qm_atom_t, data->numatoms);
-
-  /* atomic number is provided by plugin.
-   * (This is required for QM plugins!) */
-  *optflags = MOLFILE_ATOMICNUMBER;
-
-  /* [ATOMS] section */
-  if (moldendata->filepos_atoms) { 
-    float unitfac = 1.f;
-
-    /* If the units are given in AU we have to convert them.       */
-    /* Note: Also recognize parenthesized units emitted by Molcas. */
-    if (!strcmp(moldendata->units, "AU") ||
-        !strcmp(moldendata->units, "(AU)")) {
-      unitfac = BOHR_TO_ANGS;
-    }
-    
-    /* Jump to beginning of [ATOMS] section. */
-    fseek(data->file, moldendata->filepos_atoms, SEEK_SET);
-
-    /* Read the atom types, names, atomic numbers
-     * as well as x,y,z coordinates */
-    for (i=0; i<data->numatoms; i++) {
-      float x,y,z;
-      atom = atoms+i;
-      
-      if (!fgets(buffer,1024,data->file)) return MOLFILE_ERROR;
-      
-      sscanf(buffer,"%s %d %d %f %f %f", atname, &num,
-             &atomicnum, &x, &y, &z);
-
-      /* populate data structure for VMD */
-      strncpy(atom->name, atname,     sizeof(atom->name)); 
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->atomicnumber = atomicnum;
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->chain[0] = '\0';
-      atom->segid[0] = '\0';
-
-      /* keep local copy */
-      strncpy(data->atoms[i].type, atname, sizeof(data->atoms[i].type));
-      data->atoms[i].atomicnum = atomicnum;
-      data->atoms[i].x = x*unitfac;
-      data->atoms[i].y = y*unitfac;
-      data->atoms[i].z = z*unitfac;
-    }
-    data->num_frames_read = 1;
-
-    return MOLFILE_SUCCESS;
-  }
-
-  /* [GEOMETRIES] XYZ section */
-  if (moldendata->filepos_geomxyz) {
-
-    /* Jump to beginning of [GEOMETRIES] section. */
-    fseek(data->file, moldendata->filepos_geomxyz, SEEK_SET);
-    eatline(data->file, 2);
-
-    /* Read block from file */
-    for (i=0; i<data->numatoms; i++) {
-      atom = atoms+i;
-      if (!fgets(buffer,1024,data->file)) return MOLFILE_ERROR;
-      sscanf(buffer,"%s %*f %*f %*f", atname);
-
-      strncpy(atom->type, atname, sizeof(atom->type));
-      strncpy(atom->name, atname, sizeof(atom->name)); 
-      atom->atomicnumber = get_pte_idx_from_string(atname);
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->chain[0] = '\0';
-      atom->segid[0] = '\0';
-      data->atoms[i].atomicnum = atom->atomicnumber;
-    }
-    data->num_frames_read = 0;
-
-    return MOLFILE_SUCCESS;
-  }
-
-  printf("Sorry, could not obtain structure information \n");
-  printf("from either the [ATOMS] or [GEOMETRIES] section! \n");
-  printf("Please check your MOLDEN output file! \n"); 
-  return MOLFILE_ERROR; 
-}
-
-
-/***********************************************************
- *
- * Read atoms for one frame from [GEOMETRIES] section.
- *
- ***********************************************************/
-static int read_geom_block(qmdata_t *data) {
-  int i;
-  char buffer[1024];
-  float x,y,z;
-
-  /* Skip title line */
-  eatline(data->file, 1);
-
-  for (i=0; i<data->numatoms; i++) {
-    if (!fgets(buffer,1024,data->file)) return 0;
-    sscanf(buffer,"%*s %f %f %f", &x, &y, &z);
-    data->atoms[i].x = x;
-    data->atoms[i].y = y;
-    data->atoms[i].z = z;
-  }
-
-  return 1;
-}
-
-
-/***********************************************************
- *
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- *
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * We are not reading the coefficients themselves,
- * because that could require a large amount of memory.
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  qmdata_t *data = (qmdata_t *)mydata;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-
-  if (data->num_frames_sent >= data->num_frames) {
-    /* All frames were sent. */
-    return MOLFILE_ERROR;
-  }
-
-  /* Can't send metadata if only coordinates were read */
-  if (moldendata->coordsonly) return MOLFILE_ERROR;
-
-  /* Count the number of cartesian basis functions in 
-     the basis set */
-  if (data->num_frames_sent == data->num_frames-1) {
-    int i;
-    qm_timestep_t *cur_ts;
-
-    if (!count_orbitals(data)) return MOLFILE_ERROR;
-
-    /* get a pointer to the current qm timestep */
-    cur_ts = data->qm_timestep;
-    
-    for (i=0; (i<MOLFILE_MAXWAVEPERTS && i<cur_ts->numwave); i++) {
-      meta->num_orbitals_per_wavef[i] = cur_ts->wave[i].num_orbitals;
-      meta->has_occup_per_wavef[i]    = cur_ts->wave[i].has_occup;
-      meta->has_orben_per_wavef[i]    = cur_ts->wave[i].has_orben;
-    }
-    meta->wavef_size   = data->wavef_size;
-    meta->num_wavef    = cur_ts->numwave;
-    meta->num_scfiter  = cur_ts->num_scfiter;
-    meta->has_gradient = FALSE;
-    meta->num_charge_sets = 0;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-
-/***********************************************************
- *
- * Provides VMD with the data of the next timestep.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-                         molfile_qm_timestep_t *qm_ts) {
-  int i;
-  qmdata_t *data = (qmdata_t *)mydata;
-  qm_timestep_t *cur_ts;
-
-  if (data->num_frames_sent >= data->num_frames) {
-    /* All frames were sent. */
-    return MOLFILE_ERROR;
-  }
-
-  if (data->num_frames_sent == data->num_frames_read) {
-    /* Read next coordinate block from file */
-    fseek(data->file, data->filepos_array[data->num_frames_read], SEEK_SET);
-    read_geom_block(data);
-
-    /*printf("moldenplugin) Read frame %d\n", data->num_frames_read); */
-    data->num_frames_read++;
-  }
-
-
-  /* Copy the coordinates */
-  for (i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = data->atoms[i].x;
-    ts->coords[3*i+1] = data->atoms[i].y;
-    ts->coords[3*i+2] = data->atoms[i].z; 
-  }
-
-  /*printf("moldenplugin) Sent frame %d\n", data->num_frames_sent); */
-  data->num_frames_sent++;
-
-  /* In MOLDEN the MOs are listed only for the last frame */
-  if (data->num_frames_sent == data->num_frames) {
-
-    /* get a convenient pointer to the current qm timestep */
-    cur_ts = data->qm_timestep;
-
-    read_molecular_orbitals(data);
-
-    /* store the wave function and orbital energies */
-    if (cur_ts != NULL && cur_ts->wave != NULL) {
-      for (i=0; i<cur_ts->numwave; i++) {
-        qm_wavefunction_t *wave = &cur_ts->wave[i];
-        qm_ts->wave[i].type         = wave->type;
-        qm_ts->wave[i].spin         = wave->spin;
-        qm_ts->wave[i].excitation   = wave->exci;
-        qm_ts->wave[i].multiplicity = wave->mult;
-        qm_ts->wave[i].energy       = wave->energy;
-        strncpy(qm_ts->wave[i].info, wave->info, MOLFILE_BUFSIZ);
-        
-        if (wave->wave_coeffs) {
-          memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-                 wave->num_orbitals*data->wavef_size*sizeof(float));
-        }
-        if (wave->orb_energies) {
-          memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-                 wave->num_orbitals*sizeof(float));
-        }
-        if (wave->has_occup) {
-          memcpy(qm_ts->wave[i].occupancies, wave->orb_occupancies,
-                 wave->num_orbitals*sizeof(float));
-        }
-      }
-    }
-
-  }
-
-  return MOLFILE_SUCCESS;
-}
-  
-
-/*****************************************************
- *
- * Provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available.
- * Since we cannot determine the basis set meta data
- * without parsing the whole basis set section, we
- * read all basis set data here. The data is stored
- * in the qmdata_t structure for later use in
- * read_molden_rundata().
- *
- *****************************************************/
-static int read_molden_metadata(void *mydata, 
-    molfile_qm_metadata_t *metadata) {
-
-  qmdata_t *data;
-  moldendata_t *moldendata;
-  data = (qmdata_t *)mydata;
-  moldendata = (moldendata_t *)data->format_specific_data;
-
-
-  metadata->ncart = 0;
-  metadata->nimag = 0;
-  metadata->nintcoords = 0;
-
-  metadata->have_sysinfo = 0;
-  metadata->have_carthessian = 0;
-  metadata->have_inthessian = 0;
-  metadata->have_normalmodes = 0;
-
-  metadata->num_basis_funcs = 0;
-  metadata->num_basis_atoms = 0;
-  metadata->num_shells = 0;
-  metadata->wavef_size = 0;
-
-  if (!moldendata->coordsonly) {
-    /* Read the basis set */
-    if (!get_basis(data)) return MOLFILE_ERROR; 
-
-    /* orbital + basis set data */
-    metadata->num_basis_funcs = data->num_basis_funcs;
-    metadata->num_basis_atoms = data->num_basis_atoms;
-    metadata->num_shells      = data->num_shells;
-    metadata->wavef_size      = data->wavef_size;  
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_molden_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i;
-  molfile_qm_hessian_t *hessian_data;
-  molfile_qm_basis_t   *basis_data;
-  molfile_qm_sysinfo_t *sys_data;
-
-  if (!qm_data) return MOLFILE_ERROR;
-
-
-  hessian_data = &qm_data->hess;
-  basis_data   = &qm_data->basis;
-  sys_data     = &qm_data->run;
-
-  sys_data->num_electrons = data->num_electrons;
-  sys_data->totalcharge = data->totalcharge;
-
-  /* Populate basis set data */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->num_basis_atoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-      basis_data->atomic_number[i] = data->atomicnum_per_basisatom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_types[i] = data->shell_types[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-
-    /* If we have MOs in the file we must provide the 
-     * angular momentum exponents */
-    if (data->angular_momentum) {
-      for (i=0; i<3*data->wavef_size; i++) {
-        basis_data->angular_momentum[i] = data->angular_momentum[i];
-      }
-    }
-  }
-
-  /* fill in molfile_qm_sysinfo_t */
-  /*sys_data->runtype = data->runtype;
-  sys_data->scftype = data->scftype;
-  sys_data->nproc   = data->nproc;
-  sys_data->num_electrons  = data->num_electrons;
-  sys_data->totalcharge    = data->totalcharge;
-  sys_data->num_occupied_A = data->num_occupied_A;
-  sys_data->num_occupied_B = data->num_occupied_B;
-  sys_data->status         = data->opt_status;
-  */
-  return MOLFILE_SUCCESS;
-}
-
-
-/**********************************************************
- *
- * close file and free memory
- *
- **********************************************************/
-static void close_molden_read(void *mydata) {
-  int i, j;
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  fclose(data->file);
-
-  free(data->atoms);
-  free(data->basis);
-  free(data->shell_types);
-  free(data->atomicnum_per_basisatom);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->angular_momentum);
-
-  if (data->basis_set) {
-    for(i=0; i<data->num_basis_atoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  free(data->format_specific_data);
-  free(data->filepos_array);
-
-  if (data->qm_timestep != NULL) {
-    for (j=0; j<data->qm_timestep[0].numwave; j++) {
-      free(data->qm_timestep[0].wave[j].wave_coeffs);
-      free(data->qm_timestep[0].wave[j].orb_energies);
-      free(data->qm_timestep[0].wave[j].orb_occupancies);
-    }
-    free(data->qm_timestep[0].wave);
-    free(data->qm_timestep);
-  } else {
-    printf("close_molden_read(): NULL qm_timestep!\n");
-  }
-
-  free(data);
-}
-
-
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-/******************************************************
- * 
- * Format specification of the basis-set consisting of 
- * contracted Gaussian Type Orbitals.
- *
- * [GTO]
- * atom_sequence_number1 0
- * shell_label number_of_primitives 1.00
- * exponent_prim_1 contraction_coeff_1 (contraction_coeff_sp_1)
- * ...
- * <empty line>
- * atom_sequence_number2 0
- * shell_label number_of_primitives 1.00
- * exponent_prim_1 contraction_coeff_1 (contraction_coeff_1)
- * ...
- * <empty line>
- *
- * recognized shell_labels: s, p, d, f, sp, g
- *
- * For 'sp' shells two contraction coefficients must be given,
- * for both s and p functions. 
- * The 0 on the shell_number line and the 1.00 on the
- * shell_label line are no longer functional and can be
- * ignored.
- *
- * All workings with the [GTO] keyword are in Atomic Units.
- *
- ******************************************************/
-
-
-/*******************************************************
- *
- * Read the basis set data
- *
- * Format example:
- * [GTO]
- *   1 0
- *  s    2 1.00
- *   0.2738503300E+02  0.4301284983E+00
- *   0.4874522100E+01  0.6789135305E+00
- *  sp   2 1.00
- *   0.1136748200E+01  0.4947176920E-01  0.5115407076E+00
- *   0.2883094000E+00  0.9637824081E+00  0.6128198961E+00
- *
- *   2 0
- *  s    2 1.00
- *   0.1309756400E+01  0.4301284983E+00
- *   0.2331360000E+00  0.6789135305E+00
- *  ...
- *
- * qmdata_t provides hierarchical data structures for 
- * the basis set which are convenient for parsing. 
- * The molfile_plugin interface, however, requires flat
- * arrays, so after reading is done we have to populate
- * the according arrays using fill_basis_arrays().
- * 
- *******************************************************/
-static int get_basis(qmdata_t *data) {
-  char buffer[1024];
-  char shelltype[1024];
-  int atomid, numprims;
-  int i, j=0;
-  int numshells;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-
-  /* XXX already initialized in open_molden_read() */
-  data->num_shells = 0;
-  data->num_basis_funcs = 0;
-  data->num_basis_atoms = 0;
-
-  /* initialize basis set the character array */
-  memset(data->basis_string, 0, sizeof(data->basis_string));
-
-
-  /* Place file pointer on line after the [GTO] keyword. */
-  fseek(data->file, moldendata->filepos_gto, SEEK_SET);
- 
-  /* Allocate memory for the basis of all atoms. */
-  ALLOCATE(data->basis_set, basis_atom_t, data->numatoms);
-
-  /* Loop over all atoms. */
-  for (i=0; i<data->numatoms; i++) {
-
-    if (!fgets(buffer,1024,data->file)) return FALSE;
-    sscanf(buffer,"%d %*d", &atomid);
-
-    numshells = 0;
-    data->basis_set[i].shell = NULL;
-
-    /* Read an unknown number of shells */
-    while (1) {
-      shell_t *shell, *shell2=NULL;
-
-      if (!fgets(buffer,1024,data->file)) return FALSE;
-      
-      /* Empty line signifies beginning of next atom */
-      if (!strlen(trimleft(buffer))) break;
-      
-      /* Get shell type (s, p, d, f, g, sp) and # of primitives */
-      sscanf(buffer,"%s %d %*f", shelltype, &numprims);
-
-
-      /* Add new shell(s). */
-      if (!strcasecmp(shelltype, "sp")) {
-        /* Two new shells for SP */
-        data->basis_set[i].shell =
-          (shell_t*)realloc(data->basis_set[i].shell,
-                            (numshells+2)*sizeof(shell_t));
-      } else {
-        /* One new shell for non-SP */
-        data->basis_set[i].shell =
-          (shell_t*)realloc(data->basis_set[i].shell,
-                            (numshells+1)*sizeof(shell_t));
-      }
-
-      shell  = &(data->basis_set[i].shell[numshells]);
-      memset(shell, 0, sizeof(shell_t));
-      shell->numprims = numprims;
-      shell->type     = shelltype_int(shelltype);
-      shell->prim     = (prim_t*)calloc(numprims, sizeof(prim_t));
-
-      /* If this is an SP-shell we have to add as separate 
-       * S-shell and P-shell. */
-      if (!strcasecmp(shelltype, "sp")) {
-        shell->type      = SP_S_SHELL;
-        shell2 = &(data->basis_set[i].shell[numshells+1]);
-        shell2->numprims = numprims;
-        shell2->type     = SP_P_SHELL;
-        shell2->prim     = (prim_t*)calloc(numprims, sizeof(prim_t));
-      }
-
-      /* Loop over the primitives */
-      for (j=0; j<numprims; j++) {
-        int nr;
-        double expon=0.f, coeff1, coeff2=0.f;
-        if (!fgets(buffer,1024,data->file)) return FALSE;
-
-	/* MOLDEN writes the basis set coefficients using Fortran style notation 
-	 * where the exponential character is 'D' instead of 'E'. Other packages 
-	 * adhere to C-style notation. Unfortunately sscanf() won't recognize 
-	 * Fortran-style numbers. Therefore we have to read the line as string 
-	 * first, convert the numbers by replacing the 'D' and then extract the 
-	 * floats using sscanf(). */
-	fpexpftoc(buffer);
-	nr = sscanf(buffer,"%lf %lf %lf", &expon, &coeff1, &coeff2);
-        if (nr<2) {
-          printf("moldenplugin) Bad format in [GTO] section\n");
-          return FALSE;
-        }
-        shell->prim[j].exponent = expon;
-        shell->prim[j].contraction_coeff = coeff1;
-
-        /* P-shell component of SP-shell */
-        if (!strcasecmp(shelltype, "sp")) {
-          if (nr!=3) {
-            printf("moldenplugin) Bad SP-shell format in [GTO] section\n");
-            return FALSE;
-          }
-          shell2->prim[j].exponent = expon;
-          shell2->prim[j].contraction_coeff = coeff2;
-        }
-      }
-
-      /* Update # uncontracted basis functions */
-      data->num_basis_funcs += numprims;
-
-      numshells++;
-
-      /* Account for SP-shells */
-      if (!strcasecmp(shelltype, "sp")) {
-        numshells++;
-        data->num_basis_funcs += numprims;
-      }
-    }
-
-    /* Store # shells for current atom */
-    data->basis_set[i].numshells = numshells;
-
-    /* Update total number of basis functions */
-    data->num_shells += numshells;
-  }
-
-  /* As far as I know in Molden format the basis has
-   * to be specified for each individual atom, even
-   * if the types are the same. */
-  data->num_basis_atoms = data->numatoms;
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  fill_basis_arrays(data);
-
-  /* Count the number of cartesian basis functions in 
-   * the basis set */
-  data->wavef_size = 0;
-  for (i=0; i<data->num_shells; i++) {
-    switch (data->shell_types[i]) {
-    case S_SHELL:
-    case SP_S_SHELL:
-      data->wavef_size += 1;
-      break;
-    case P_SHELL:
-    case SP_P_SHELL:
-      data->wavef_size += 3;
-      break;
-    case D_SHELL:
-      data->wavef_size += 6;
-      break;
-    case F_SHELL:
-      data->wavef_size += 10;
-      break;
-    case G_SHELL:
-      data->wavef_size += 15;
-      break;
-    }
-  }
-
-  /* If we have MOs in the file we must provide the 
-   * angular momentum exponents.
-   * The order of P, D, F en G functions is as follows:
-
-   *  5D: D 0, D+1, D-1, D+2, D-2
-   *  6D: xx, yy, zz, xy, xz, yz
-
-   *  7F: F 0, F+1, F-1, F+2, F-2, F+3, F-3
-   * 10F: xxx, yyy, zzz, xyy, xxy, xxz, xzz, yzz, yyz, xyz
-
-   *  9G: G 0, G+1, G-1, G+2, G-2, G+3, G-3, G+4, G-4
-   * 15G: xxxx yyyy zzzz xxxy xxxz yyyx yyyz zzzx zzzy,
-   *      xxyy xxzz yyzz xxyz yyxz zzxy
-   */
-  ALLOCATE(data->angular_momentum, int, 3*data->wavef_size);
-
-  j=0;
-  for (i=0; i<data->num_shells; i++) {
-    switch (data->shell_types[i]) {
-    case S_SHELL:
-    case SP_S_SHELL:
-      data->angular_momentum[j  ]=0;
-      data->angular_momentum[j+1]=0;
-      data->angular_momentum[j+2]=0;
-      j += 3;
-      break;
-    case P_SHELL:
-    case SP_P_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j  ], "x");
-      angular_momentum_expon(&data->angular_momentum[j+3], "y");
-      angular_momentum_expon(&data->angular_momentum[j+6], "z");
-      j += 9;
-      break;
-    case D_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j   ], "xx");
-      angular_momentum_expon(&data->angular_momentum[j+3 ], "yy");
-      angular_momentum_expon(&data->angular_momentum[j+6 ], "zz");
-      angular_momentum_expon(&data->angular_momentum[j+9 ], "xy");
-      angular_momentum_expon(&data->angular_momentum[j+12], "xz");
-      angular_momentum_expon(&data->angular_momentum[j+15], "yz");
-      j += 18;
-      break;
-    case F_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j   ], "xxx");
-      angular_momentum_expon(&data->angular_momentum[j+3 ], "yyy");
-      angular_momentum_expon(&data->angular_momentum[j+6 ], "zzz");
-      angular_momentum_expon(&data->angular_momentum[j+9 ], "xyy");
-      angular_momentum_expon(&data->angular_momentum[j+12], "xxy");
-      angular_momentum_expon(&data->angular_momentum[j+15], "xxz");
-      angular_momentum_expon(&data->angular_momentum[j+18], "xzz");
-      angular_momentum_expon(&data->angular_momentum[j+21], "yzz");
-      angular_momentum_expon(&data->angular_momentum[j+24], "yyz");
-      angular_momentum_expon(&data->angular_momentum[j+27], "xyz");
-      j += 30;
-      break;
-    case G_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j   ], "xxxx");
-      angular_momentum_expon(&data->angular_momentum[j+3 ], "yyyy");
-      angular_momentum_expon(&data->angular_momentum[j+6 ], "zzzz");
-      angular_momentum_expon(&data->angular_momentum[j+9 ], "xxxy");
-      angular_momentum_expon(&data->angular_momentum[j+12], "xxxz");
-      angular_momentum_expon(&data->angular_momentum[j+15], "yyyx");
-      angular_momentum_expon(&data->angular_momentum[j+18], "yyyz");
-      angular_momentum_expon(&data->angular_momentum[j+21], "zzzx");
-      angular_momentum_expon(&data->angular_momentum[j+24], "zzzy");
-      angular_momentum_expon(&data->angular_momentum[j+27], "xxyy");
-      angular_momentum_expon(&data->angular_momentum[j+30], "xxzz");
-      angular_momentum_expon(&data->angular_momentum[j+33], "yyzz");
-      angular_momentum_expon(&data->angular_momentum[j+36], "xxyz");
-      angular_momentum_expon(&data->angular_momentum[j+39], "yyxz");
-      angular_momentum_expon(&data->angular_momentum[j+42], "zzxy");
-      j += 45;
-      break;
-    }
-  }
-
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * Populate the flat arrays containing the basis
- * set data.
- *
- ******************************************************/
-static int fill_basis_arrays(qmdata_t *data) {
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0;
-
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_types;
-  int *atomicnum_per_basisatom;
-
-  /* Count the total number of primitives which
-   * determines the size of the basis array. */
-  for(i=0; i<data->num_basis_atoms; i++) {
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      primcount += data->basis_set[i].shell[j].numprims;
-    }
-  }
-  data->num_basis_funcs = primcount;
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per basis function, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  ALLOCATE(basis,                   float, 2*primcount);
-  ALLOCATE(shell_types,             int,   data->num_shells);
-  ALLOCATE(num_shells_per_atom,     int,   data->num_basis_atoms);
-  ALLOCATE(num_prim_per_shell,      int,   data->num_shells);
-  ALLOCATE(atomicnum_per_basisatom, int,   data->num_basis_atoms);
-
-
-
-  /* store pointers in struct qmdata_t */
-  data->basis = basis;
-  data->shell_types = shell_types;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell  = num_prim_per_shell;
-  data->atomicnum_per_basisatom = atomicnum_per_basisatom;
-
-  primcount = 0;
-  for (i=0; i<data->num_basis_atoms; i++) {
-    /* assign atomic number */
-    data->basis_set[i].atomicnum = data->atoms[i].atomicnum;
-    atomicnum_per_basisatom[i]   = data->atoms[i].atomicnum;
-
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_types[shellcount]        = data->basis_set[i].shell[j].type;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-
-  return TRUE;
-}
-
-
-
-/**************************************************
- *
- * Convert shell type from char to int.
- * Note that SP_P shells are assigned in get_basis()
- *
- ************************************************ */
-static int shelltype_int(char *type) {
-  int shelltype;
-  if      (!strcasecmp(type, "sp")) shelltype = SP_SHELL;
-  else if (!strcasecmp(type, "s"))  shelltype = S_SHELL;
-  else if (!strcasecmp(type, "p"))  shelltype = P_SHELL;
-  else if (!strcasecmp(type, "d"))  shelltype = D_SHELL;
-  else if (!strcasecmp(type, "f"))  shelltype = F_SHELL;
-  else if (!strcasecmp(type, "g"))  shelltype = G_SHELL;
-  else shelltype = UNK_SHELL;
-  
-  return shelltype;
-}
-
-
-/***********************************************************
- *
- * Parse through the [MO] section and count orbitals and
- * the number of wavefunction coefficients per orbital.
- *
- * Format example of [MO] section:
- *  [MO]
- *  Sym=   1a         <-- this line is optional
- * Ene=   -15.5764
- *  Spin= Alpha
- * Occup=    2.00000
- *    1        -0.00000435
- *    2         0.00005919
- *    ...
- *
- ***********************************************************/
-static int count_orbitals(qmdata_t *data) {
-  int nr;
-  int num_wave_coeff=0;
-  float orbenergy, occu;
-  char spin[1024];
-  qm_wavefunction_t *wave;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-  int dummy1;
-  float dummy2;
-
-  /* Place file pointer after [MO] keyword in line containing "Spin". */
-  fseek(data->file, moldendata->filepos_mo, SEEK_SET);
-  if (!goto_keyline(data->file, "Spin=", NULL)) {
-    printf("moldenplugin) Couldn't find keyword 'Spin' in [MO] section!\n");
-    return FALSE;
-  }
- 
-  nr = fscanf(data->file, " Spin= %s\n", spin);
-  eatline(data->file, 1);
-
-  /* The first wavefunction should have spin alpha */
-  strtoupper(spin);
-  if (strcmp(spin, "ALPHA")) return FALSE;
-
-  /* Removed redundant count of num_wave_coeff as this is equivalent to wavef_size */
-  num_wave_coeff = data->wavef_size;
-
-  /* For pruned AOs, with only non-zero coeffs, this is redundant */
-  /*
-  if (data->wavef_size && 
-      data->wavef_size != num_wave_coeff) {
-    printf("moldenplugin) Mismatch between # wavefunction coefficients (%d)\n",
-           num_wave_coeff);
-    printf("moldenplugin) and # cart. basis functions (%d)in basis set!\n", 
-           data->wavef_size);
-    return FALSE;
-  }
-  */
-
-  /* Allocate memory for the qm_timestep frame */
-  data->qm_timestep = (qm_timestep_t *)calloc(1, sizeof(qm_timestep_t));
-
-  /* Add wavefunction for spin alpha */
-  wave = add_wavefunction(data->qm_timestep);
-
-  wave->spin = SPIN_ALPHA;
-  wave->type = MOLFILE_WAVE_UNKNOWN;
-  wave->exci = 0;
-  wave->mult = 1;
-  wave->num_coeffs = num_wave_coeff;
-
-  /* Place file pointer on line after the [MO] keyword. */
-  fseek(data->file, moldendata->filepos_mo, SEEK_SET);
-
-  /* Count MOs */
-  fscanf(data->file, " Ene= %f\n", &orbenergy);
-  fscanf(data->file, " Spin= %s\n", spin);
-  fscanf(data->file, " Occup= %f\n", &occu);
-
-  while (1) {
-    int check_reads = 2;
-    wave->num_orbitals++;
-
-    /* skip over MO coeffs */
-    while(check_reads == 2)
-    {
-      check_reads = fscanf(data->file, "%d %f", &dummy1, &dummy2);
-    }
-
-    nr  = fscanf(data->file, " Ene= %f\n", &orbenergy);
-    nr += fscanf(data->file, " Spin= %s\n", spin);
-    nr += fscanf(data->file, " Occup= %f\n", &occu);
-
-    if (nr!=3 || toupper(spin[0])!='A') 
-      break;
-  }
-  //printf("found %d MOs!\n",wave->num_orbitals);
-
-
-  /* Add wavefunction for spin beta */
-  if (!strcmp(strtoupper(spin), "BETA")) {
-    wave = add_wavefunction(data->qm_timestep);
-    wave->spin = SPIN_BETA;
-    wave->type = MOLFILE_WAVE_UNKNOWN;
-    wave->exci = 0;
-    wave->mult = 1;
-    wave->num_coeffs = num_wave_coeff;
-    wave->num_orbitals = 1;
-
-    while (1) {
-      int check_reads = 2;
-      wave->num_orbitals++;
-
-      /* skip over MO coeffs */
-      while(check_reads == 2)
-      {
-        check_reads = fscanf(data->file, "%d %f", &dummy1, &dummy2);
-      }
-
-      nr  = fscanf(data->file, " Ene= %f\n", &orbenergy);
-      nr += fscanf(data->file, " Spin= %s\n", spin);
-      nr += fscanf(data->file, " Occup= %f\n", &occu);
-
-      if (nr!=3 || toupper(spin[0])!='B' ||
-          wave->num_orbitals>=num_wave_coeff) break;
-    }
-  }
-
-  return TRUE;
-}
-
-
-static int read_molecular_orbitals(qmdata_t *data) {
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-  qm_wavefunction_t *wave;
-
-  if (!data->qm_timestep || moldendata->coordsonly) return FALSE;
-
-  /* Place file pointer on line after the [MO] keyword. */
-  fseek(data->file, moldendata->filepos_mo, SEEK_SET);
-
-  wave = &data->qm_timestep->wave[0];
-  ALLOCATE(wave->wave_coeffs, float, wave->num_coeffs*wave->num_orbitals);
-  // DEBUG
-  /*
-  printf("moldenplugin) num_coeffs   = %d\n", wave->num_coeffs);
-  printf("moldenplugin) num_orbitals = %d\n", wave->num_orbitals);
-  printf("moldenplugin) num_wave     = %d\n", data->qm_timestep->numwave);
-  */
-  
-
-  /* Read wavefunction coefficients for spin alpha */
-  if (!read_wave_coeffs(data->file, wave)) return FALSE;
-
-  if (data->qm_timestep->numwave==1) return TRUE;
-
-  /* Read wavefunction coefficients for spin beta */
-  wave = &data->qm_timestep->wave[1];
-  ALLOCATE(wave->wave_coeffs, float, wave->num_coeffs*wave->num_orbitals);
-
-  if (!read_wave_coeffs(data->file, wave)) return FALSE;
-
-  return TRUE;
-}
-
-static int read_wave_coeffs(FILE *file, qm_wavefunction_t *wave) {
-  int i, j, nr;
-  char buffer[1024];
-  int AOid;
-  float wf_coeff;
-  char keystring[10];
-  float *wave_coeffs = wave->wave_coeffs;
-
-  /* This works for pruned and unpruned (all zero coeffs are preserved) MO representaitions.
-   * Clearly this data redundancy should be avoided on systems with a few hundred atoms. */
-
-  /* set all coeffs to zero */
-  for (i=0; i<wave->num_orbitals; i++)
-    for (j=0; j<wave->num_coeffs; j++)
-        wave_coeffs[i*wave->num_coeffs + j] = 0.0;
-
-  /* each molecular orbital must have at least 1 non-zero coeff in its represenation */
-  /* eat Ene= Spin= Occup=  lines */
-  eatline(file, 3);
-  for (i=0; i<wave->num_orbitals; i++) {
-    while(1) {
-      int nr2;
-      if (!fgets(buffer,1024,file)) return FALSE;
-      nr = sscanf(buffer,"%d %f", &AOid, &wf_coeff);
-      wave_coeffs[i*wave->num_coeffs+AOid-1] = wf_coeff;
-      
-      // DEBUG
-      //printf("moldenplugin) %d,%d: %d %f\n", i, AOid-1, AOid, wave_coeffs[i*wave->num_coeffs+AOid-1]);
-      nr2 = sscanf(buffer, "%s", &keystring);
-      if(!strcmp(keystring,"Ene=")||nr2==-1) 
-        break;
-
-      if (nr==0) {
-        printf("moldenplugin) Error reading wavefunction coefficients!\n");
-        return FALSE;
-      }
-    }
-    eatline(file, 2);
-  }
-  return TRUE;
-}
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "molden";
-  plugin.prettyname = "Molden";
-  plugin.author = "Markus Dittrich, Jan Saam, Alexey Titov";
-  plugin.majorv = 0;
-  plugin.minorv = 10;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "molden";
-  plugin.open_file_read = open_molden_read;
-  plugin.read_structure = read_molden_structure;
-
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-  plugin.read_timestep             = read_timestep;
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-
-  plugin.read_qm_metadata = read_molden_metadata;
-  plugin.read_qm_rundata  = read_molden_rundata;
-
-  plugin.close_file_read = close_molden_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/molemeshplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/molemeshplugin.C
deleted file mode 100644
index be1715c4493632b743d318aea15162738501fd05..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/molemeshplugin.C
+++ /dev/null
@@ -1,331 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: molemeshplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  quadrilaterals are used to represent the geometry. 
- *
- *  ASCII pmesh file from mole 2.0 follows the following format. Files are case 
-insensitive
- *  and whitespace is ignored.
- *
- *  number of vertices        ()
- *  vertex v1x v1y v1z        (<v1> is the first vertex)
- *  vertex v2x v2y v2z        (vertices are given in some order)
- *  vertex v3x v3y v3z        (vertices are given as floating-point values)
- *  vertex v4x v4y v4z        (vertices are given as floating-point values)
- *  number of polygons/faces  
- *  face number               (in groups of 4?)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
- 
-#include "molfile_plugin.h"
-
-typedef struct graphics_list {
-  molfile_graphics_t gItem;
-  struct graphics_list *next;
-} molfile_graphics_list;
-
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} pmesh_t;
-
-static void *open_file_read(const char *filepath, const char *filetype, int *natoms) {
-   FILE *fd;
-   pmesh_t *pmesh;
-
-   fd = fopen(filepath, "rb");
-   if (!fd) {
-     fprintf(stderr, "molemeshplugin) Error opening file.\n");
-     return NULL;
-   }
-   pmesh = new pmesh_t;
-   pmesh->fd = fd;
-   pmesh->graphics = NULL;
-   *natoms = 0;
-   return pmesh;
-} 
-static int read_rawgraphics(void *v, int *nelem, const molfile_graphics_t **data) {
-    molfile_graphics_list *gListPtr=NULL, *tmpPtr=NULL;
-    int i=0, ntriangles=0,j=0;
-    int error=0, numVerts=0, numFacets=0, facetType=0, facet=0, tmpFacet[5];
-    pmesh_t *pmesh = (pmesh_t *)v;
-    FILE *infile = pmesh->fd;
-    char line[81];
-    float **tmpData;
-
-    // Check your head(er)
-    // "number of vertices"
-    fgets(line, 80, infile);
-    sscanf(line, "%d", &numVerts);
-    if (numVerts  < 1) {
-      fprintf(stderr, "molespmeshplugin) error: expected \"Positive Number of Vertices\".\n");
-      error = 1;
-      return MOLFILE_ERROR;
-    } else {
-     gListPtr = new molfile_graphics_list;
-     gListPtr->next = NULL;
-     gListPtr->gItem.type = MOLFILE_TRIANGLE;
-     ntriangles++;
-     tmpPtr = gListPtr;
-   }
-
-//Allocate memory for 2d array.  maybe there is a better way to do this.
-    tmpData = new float*[numVerts];
-    for (int h=0 ; h < numVerts ; h++ ) {
-         tmpData[h] = new float[3];
-    }
-
-//we know how many vertices there are read them all into tmpData[j][i]
-   for ( j=0 ; j < numVerts; j++) {
-// "first loop"
-// scan each vertex vx, vy, vz  
-    i=0;
-    fgets(line, 80, infile);
-    float t1=0.0f, t2=0.0f, t3=0.0f;
-    if ( sscanf(line, "%f %f %f", &t1, &t2, &t3) == 3 ) {
-        tmpData[j][i++] = t1;
-        tmpData[j][i++] = t2;
-        tmpData[j][i++] = t3;
-     } else if(ferror(infile)) {
-       fprintf(stderr, "molespmeshplugin) error: problem reading file\n");
-       error = 1;
-       return MOLFILE_ERROR;
-     }
-   }
-//Read in the total number of facets.  For pmesh files the next number is the total number of triangle or quadrilaterals
-//If triangles, then the next number after the total is a 4, and the next four numbers after that describe the vertex index for
-//each point of the triangle.  If the set begins with a 5 then the next 5 numbers describe the vertex number for
-//each point of the quadrilateral.  So far this reader does not support multiple/concatenated mpesh files yet.
-   fgets(line, 80, infile);
-   sscanf(line, "%d", &numFacets);
-//printf("numFacets %d \n",numFacets);
-   if (numFacets  < 1) {
-      fprintf(stderr, "molespmeshplugin) error: expected \"Positive Number of Facets\".\n");
-      error = 1;
-      return MOLFILE_ERROR;
-    } else {
-     gListPtr = new molfile_graphics_list;
-
-     gListPtr->next = NULL;
-     gListPtr->gItem.type = MOLFILE_TRIANGLE;
-     ntriangles++;
-     tmpPtr = gListPtr;
-   }
-//Read in the facet type 4=triangle 5=quadrilateral. need to do a while loop here, as long as xxxx<numFacets keep reading
-   while ( !feof(infile) && ( error == 0 ) ) {
-     fgets(line, 80, infile);
-     sscanf(line, "%d", &facetType);
-     if (facetType == 4) {
-//printf("facetype %d \n", facetType);
-        int l=0;
-        for (int k=0 ; k < facetType-1; k++) {
-              fgets(line, 80, infile);
-              sscanf(line, "%d", &facet);
-              tmpPtr->gItem.data[l++] = tmpData[facet][0];
-              tmpPtr->gItem.data[l++] = tmpData[facet][1];
-              tmpPtr->gItem.data[l++] = tmpData[facet][2];
-         }
-     fgets(line, 80, infile); //one more read to keep us in sync
-// Create a new list item and initialize it for second triangle.
-         tmpPtr->next = new molfile_graphics_list;
-         tmpPtr = tmpPtr->next;
-         tmpPtr->next = NULL;
-         tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-         ntriangles++;
-     } else if (facetType == 5 ) { 
-                for (int k=0 ; k < facetType-1; k++) {
-                     fgets(line, 80, infile);
-                     sscanf(line, "%d", &facet);
-                     tmpFacet[k]=facet;
-                }
-              
-                tmpPtr->gItem.data[0] = tmpData[tmpFacet[0]][0];
-                tmpPtr->gItem.data[1] = tmpData[tmpFacet[0]][1];
-                tmpPtr->gItem.data[2] = tmpData[tmpFacet[0]][2];
-
-                tmpPtr->gItem.data[3] = tmpData[tmpFacet[1]][0];
-                tmpPtr->gItem.data[4] = tmpData[tmpFacet[1]][1];
-                tmpPtr->gItem.data[5] = tmpData[tmpFacet[1]][2];
-
-                tmpPtr->gItem.data[6] = tmpData[tmpFacet[2]][0];
-                tmpPtr->gItem.data[7] = tmpData[tmpFacet[2]][1];
-                tmpPtr->gItem.data[8] = tmpData[tmpFacet[2]][2];
-
-// Create a new list item and initialize it for second triangle.
-                tmpPtr->next = new molfile_graphics_list;
-                tmpPtr = tmpPtr->next;
-                tmpPtr->next = NULL;
-                tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-                ntriangles++;
-
-                tmpPtr->gItem.data[0] = tmpData[tmpFacet[0]][0];
-                tmpPtr->gItem.data[1] = tmpData[tmpFacet[0]][1];
-                tmpPtr->gItem.data[2] = tmpData[tmpFacet[0]][2];
-
-                tmpPtr->gItem.data[3] = tmpData[tmpFacet[2]][0];
-                tmpPtr->gItem.data[4] = tmpData[tmpFacet[2]][1];
-                tmpPtr->gItem.data[5] = tmpData[tmpFacet[2]][2];
-
-                tmpPtr->gItem.data[6] = tmpData[tmpFacet[3]][0];
-                tmpPtr->gItem.data[7] = tmpData[tmpFacet[3]][1];
-                tmpPtr->gItem.data[8] = tmpData[tmpFacet[3]][2];
-
-// Create a new list item and initialize it for first triangle of the second quadrilateral.
-                tmpPtr->next = new molfile_graphics_list;
-                tmpPtr = tmpPtr->next;
-                tmpPtr->next = NULL;
-                tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-                ntriangles++;
-     } else if ( (facetType != 4 || facetType != 5) && facetType >= 6 ) {
-//Find out if this is a concatenated file by reading the next value and testing for a series of three floats.
-//If so, free tmpData and reallocate according to this number. then read all the vertices into tmpData and do
-//a drop back into the while loop.
-//If not, exit with error.
-         fgets(line, 80, infile);
-         float t1=0.0f, t2=0.0f, t3=0.0f;
-         if ( sscanf(line, "%f %f %f", &t1,&t2,&t3) ==3 ) {
-//free tmpData
-             for (int x=0; x< 3; x++) free(tmpData[x]);
-                  free (tmpData);
-             numVerts=facetType;
-             facetType=0;
-//Allocate new size for vertices array
-             tmpData = new float*[numVerts];
-             for (int h=0 ; h < numVerts ; h++ ) {
-                 tmpData[h] = new float[3];
-             }
-
-//Read in all new vertices after adding the first test vertex
-             tmpData[0][0] = t1;
-             tmpData[0][1] = t2;
-             tmpData[0][2] = t3;
-             for ( j=1 ; j < numVerts; j++) {
-                 i=0;
-                 fgets(line, 80, infile);
-                 float t1=0.0f, t2=0.0f, t3=0.0f;
-                 if ( sscanf(line, "%f %f %f", &t1, &t2, &t3) == 3 ) {
-                    tmpData[j][i++] = t1;
-                    tmpData[j][i++] = t2;
-                    tmpData[j][i++] = t3;
-                 } else if(ferror(infile)) {
-                           fprintf(stderr, "molespmeshplugin) error: problem reading vertices from concatenated file\n");
-                           error = 1;
-                           break;
-                }
-             }
-         } else if ( feof(infile)  ) {
-//end file read gracefully at the last facet
-                    break;
-         } else { fprintf(stderr, "molespmeshplugin) error: problem reading concatenated file?\n");
-                error = 1;
-                break;
-         }
-         fgets(line, 80, infile);
-         sscanf(line, "%d", &numFacets);
-         if (numFacets  < 1) {
-            fprintf(stderr, "molespmeshplugin) error: expected \"Positive Number of Facets\".\n");
-           error = 1;
-         }
-     }
-//go back into the while loop with error=0 so that we can reuse the facet code
-//for additional meshes
-     error = 0;
-    }
-    // If an error occurred, free the linked list and return MOLFILE_ERROR
-    if (error != 0) {
-      while (gListPtr != NULL) {
-        tmpPtr = gListPtr->next;
-        delete gListPtr;
-        gListPtr = tmpPtr;
-      }
-     for (int x=0; x< 3; x++) free(tmpData[x]);
-     free (tmpData);
-      return MOLFILE_ERROR;
-    }
-
-    // Create the array of molfile_graphics_t, and copy the data from the
-    // linked list into it, deleting the list as you go.
-    pmesh->graphics = new molfile_graphics_t[ntriangles-1];
-//    printf("ntriangles %d \n", ntriangles);
-    i = 0;
-    while (gListPtr != NULL) {
-      pmesh->graphics[i] = gListPtr->gItem;
-      tmpPtr = gListPtr->next;
-      delete gListPtr;
-      gListPtr = tmpPtr;
-      i++;
-    }
-
-    *nelem = ntriangles-1;
-    *data = pmesh->graphics;
-     for (int x=0; x< 3; x++) free(tmpData[x]);
-     free(tmpData);
-    return MOLFILE_SUCCESS;
-}
-
-static void close_file_read(void *v) {
-  pmesh_t *pmesh = (pmesh_t *)v;
-  fclose(pmesh->fd);
-  if (pmesh->graphics != NULL)
-    delete [] pmesh->graphics;
-  delete pmesh;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pmesh";
-  plugin.prettyname = "polygon mesh";
-  plugin.author = "Brian Bennion";
-  plugin.minorv = 0;
-  plugin.majorv = 1;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mesh";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/msmsplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/msmsplugin.C
deleted file mode 100644
index c9c7a439631371ceb38bbb9200ad0ce2630deee5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/msmsplugin.C
+++ /dev/null
@@ -1,251 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: msmsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.13 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Reader for MSMS surface files
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *ffd;
-  FILE *vfd;
-  molfile_graphics_t *graphics;
-} msms_t;
-
-// Get a string from a stream, printing any errors that occur
-static char *msmsgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    return NULL;
-  } else if (ferror(stream)) {
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-  }
-
-  return returnVal;
-}
-
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *ffd; // face file
-  FILE *vfd; // vertex file
-  msms_t *msms;
-  char * facefilepath;
-  char * vertfilepath;
-  char * cp;
-
-  int filenamelen = strlen(filepath);
-  facefilepath = (char *) malloc(filenamelen + 10);
-  vertfilepath = (char *) malloc(filenamelen + 10);
-  strcpy(facefilepath, filepath);
-  strcpy(vertfilepath, filepath);
-
-  // require the MSMS output filenames to match what MSMS does
-  // If the user selected the .face file or the .vert file, we should
-  // be able to cope either way by assigning the right filenames to the
-  // right strings and getting the right files opened accordingly.
-  cp = strstr(facefilepath, ".face");
-  if (cp == NULL) {
-    cp = strstr(facefilepath, ".vert");
-    if (cp != NULL) {
-       strcpy(cp, ".face");
-    } else {
-      printf("msmsplugin) file names don't match expected MSMS output\n");
-      free(facefilepath);
-      free(vertfilepath);
-      return NULL;
-    } 
-  }
-  cp = strstr(vertfilepath, ".vert");
-  if (cp == NULL) {
-    cp = strstr(vertfilepath, ".face");
-    if (cp != NULL) {
-       strcpy(cp, ".vert");
-    } else {
-      printf("msmsplugin) file names don't match expected MSMS output\n");
-      free(facefilepath);
-      free(vertfilepath);
-      return NULL;
-    } 
-  }
- 
-  ffd = fopen(facefilepath, "r");
-  vfd = fopen(vertfilepath, "r");
-  if (!ffd || !vfd) { 
-    printf("msmsplugin) failed to open either the MSMS face or vertex file\n");
-    if (ffd) fclose(ffd);
-    if (vfd) fclose(vfd);
-    free(facefilepath);
-    free(vertfilepath);
-    return NULL;
-  }
-  msms = new msms_t;
-  msms->ffd = ffd;
-  msms->vfd = vfd;
-  msms->graphics = NULL;
-  *natoms = 0;
-  return msms;
-}
-
-static int read_rawgraphics(void *v, int *nelem, 
-    const molfile_graphics_t **data) {
-  msms_t *msms = (msms_t *)v;
-  #define LINESIZE 180
-  char inbuf[LINESIZE];
-  int i, t;
-  float tf=0.0f;
-  int facecount=0;
-  int vertexcount=0;
-
-  //
-  // count number of faces
-  //
-  while (msmsgets(inbuf, LINESIZE, msms->ffd) != NULL) {
-    if (sscanf(inbuf, "%d %d %d %d %d", &t, &t, &t, &t, &t) == 5) 
-      facecount++;
-  }
-  rewind(msms->ffd);
-
-  //
-  // count number of vertices
-  //
-  while (msmsgets(inbuf, LINESIZE, msms->vfd) != NULL) {
-    if (sscanf(inbuf, "%f %f %f %f %f %f %d %d %d", 
-        &tf, &tf, &tf, &tf, &tf, &tf, &t, &t, &t) == 9)
-      vertexcount++;
-  }
-  rewind(msms->vfd);
-
-  // simple sanity check to insure we have at least one usable triangle
-  if (facecount < 1 || vertexcount < 3) 
-    return MOLFILE_ERROR;
-
-  // allocate storage for vertex and normal data
-  float *vertex = new float[3 * vertexcount];
-  float *normal = new float[3 * vertexcount];
-
-  //
-  // read in the vertex data
-  //
-  i=0;
-  while (msmsgets(inbuf, LINESIZE, msms->vfd) != NULL) {
-    int addr = i * 3;
-    int atomid, l0fa, l;
-    
-    if (inbuf[0] != '#') { 
-      if (sscanf(inbuf, "%f %f %f %f %f %f %d %d %d",
-                 &vertex[addr], &vertex[addr+1], &vertex[addr+2], 
-                 &normal[addr], &normal[addr+1], &normal[addr+2], 
-                 &l0fa, &atomid, &l) == 9)
-        i++;
-    }
-  }
- 
-  // allocate the graphics objects, read in the facet data and 
-  // copy the vertex coordinates into triangles as necessary 
-  msms->graphics = new molfile_graphics_t[2*facecount];
-
-  //
-  // read in the facet data
-  //
-  i=0;
-  while (msmsgets(inbuf, LINESIZE, msms->ffd) != NULL) {
-    int v0, v1, v2, surftype, ana;
-
-    if (inbuf[0] != '#') { 
-      // read in the next facet
-      if (sscanf(inbuf, "%d %d %d %d %d", &v0, &v1, &v2, &surftype, &ana) == 5) {
-        // set the graphics object type
-        msms->graphics[2*i    ].type = MOLFILE_TRINORM;  
-        msms->graphics[2*i + 1].type = MOLFILE_NORMS;
-
-        v0--; // convert from 1-based indexing to 0-based indexing
-        v1--;
-        v2--;
-
-        // copy the triangle vertices
-        float *tri = msms->graphics[2*i    ].data;
-        float *nrm = msms->graphics[2*i + 1].data;
-        memcpy(tri  , vertex+(3*v0), 3*sizeof(float)); 
-        memcpy(tri+3, vertex+(3*v1), 3*sizeof(float)); 
-        memcpy(tri+6, vertex+(3*v2), 3*sizeof(float)); 
-        memcpy(nrm  , normal+(3*v0), 3*sizeof(float)); 
-        memcpy(nrm+3, normal+(3*v1), 3*sizeof(float)); 
-        memcpy(nrm+6, normal+(3*v2), 3*sizeof(float)); 
-
-        i++;
-      }
-    }
-  }
-
-  // set the result array pointers
-  *nelem = 2*facecount;
-  *data = msms->graphics;
-
-  // delete work area storage
-  delete [] normal;
-  delete [] vertex;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  msms_t *msms = (msms_t *)v;
-  fclose(msms->ffd);
-  fclose(msms->vfd);
-  delete [] msms->graphics;
-  delete msms;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "msms";
-  plugin.prettyname = "MSMS Surface Mesh";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "face,vert";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/namdbinplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/namdbinplugin.c
deleted file mode 100644
index 8397178c44001209ccc315a81a488b476f7946fc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/namdbinplugin.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: namdbinplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-
-#include "molfile_plugin.h"
-
-#if INT_MAX == 2147483647
-  typedef int namdbin_int32;
-#elif SHRT_MAX == 2147483647
-  typedef short namdbin_int32;
-#elif LONG_MAX == 2147483647
-  typedef long namdbin_int32;
-#endif
-
-#define BLOCK 500
-
-typedef struct {
-  double xyz[3*BLOCK];
-  FILE *fd;
-  int numatoms;
-  int wrongendian;
-} namdbinhandle;
-
-static void *open_namdbin_read(const char *path, const char *filetype, 
-    int *natoms) {
-  namdbinhandle *namdbin;
-  FILE *fd;
-  int numatoms;
-  namdbin_int32 filen;
-  char lenbuf[4];
-  char tmpc;
-
-  namdbin = (namdbinhandle *)malloc(sizeof(namdbinhandle));
-  if (!namdbin) {
-    fprintf(stderr, "Unable to allocate space for read buffer.\n");
-    return NULL;
-  }
-  memset(namdbin, 0, sizeof(namdbinhandle));
-
-  fd = fopen(path, "rb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file '%s' for reading.\n", path);
-    free(namdbin);
-    return NULL;
-  }
-  fseek(fd,0,SEEK_END);
-  numatoms = (ftell(fd)-4)/24;
-  if (numatoms < 1) {
-    fprintf(stderr, "File '%s' is too short.\n", path);
-    fclose(fd);
-    free(namdbin);
-    return NULL;
-  }
-  fseek(fd,0,SEEK_SET);
-  fread(&filen, sizeof(namdbin_int32), 1, fd);
-  if (filen != numatoms) {
-    namdbin->wrongendian = 1;
-    memcpy(lenbuf, (const char *)&filen, 4);
-    tmpc = lenbuf[0]; lenbuf[0] = lenbuf[3]; lenbuf[3] = tmpc;
-    tmpc = lenbuf[1]; lenbuf[1] = lenbuf[2]; lenbuf[2] = tmpc;
-    memcpy((char *)&filen, lenbuf, 4);
-  }
-  if (filen != numatoms) {
-    fprintf(stderr, "Inconsistent atom count in file '%s'.\n", path);
-    fclose(fd);
-    free(namdbin);
-    return NULL;
-  }
-  if ( namdbin->wrongendian ) {
-    fprintf(stderr, "File '%s' appears to be other-endian.\n", path);
-  }
-  namdbin->fd = fd;
-  namdbin->numatoms = numatoms;
-  *natoms = namdbin->numatoms;
-  return namdbin;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  namdbinhandle *namdbin;
-  int i, numatoms;
-  char *cdata;
-
-  namdbin = (namdbinhandle *)v;
-  if (!namdbin->fd) 
-    return MOLFILE_ERROR;  /* Done reading frames */
-
-  numatoms = namdbin->numatoms;
-
-  for (i=0; i<namdbin->numatoms; i+=BLOCK) {
-    int j, n;
-    n = namdbin->numatoms - i;
-    if ( n > BLOCK ) n = BLOCK;
-
-    if (fread(namdbin->xyz, sizeof(double), 3*n, namdbin->fd) != (size_t)(3*n)) {
-      fprintf(stderr, "Failure reading data from NAMD binary file.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (namdbin->wrongendian) {
-      if ( ! i ) fprintf(stderr, "Converting other-endian data from NAMD binary file.\n");
-      cdata = (char *) namdbin->xyz;
-      for ( j=0; j<3*n; ++j, cdata+=8 ) {
-        char tmp0, tmp1, tmp2, tmp3;
-        tmp0 = cdata[0]; tmp1 = cdata[1];
-        tmp2 = cdata[2]; tmp3 = cdata[3];
-        cdata[0] = cdata[7]; cdata[1] = cdata[6];
-        cdata[2] = cdata[5]; cdata[3] = cdata[4];
-        cdata[7] = tmp0; cdata[6] = tmp1;
-        cdata[5] = tmp2; cdata[4] = tmp3;
-      }
-    }
-
-    if (ts) {
-      for (j=0; j<n; ++j) {
-        ts->coords[3L*(i+j)  ] = namdbin->xyz[3*j  ];
-        ts->coords[3L*(i+j)+1] = namdbin->xyz[3*j+1];
-        ts->coords[3L*(i+j)+2] = namdbin->xyz[3*j+2];
-      }
-    }
-
-  }
-  /*
-   * Close the file handle and set to NULL so we know we're done reading 
-   */
-  fclose(namdbin->fd);
-  namdbin->fd = NULL;
-
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_file_read(void *v) {
-  namdbinhandle *namdbin = (namdbinhandle *)v;
-  if (namdbin->fd)
-    fclose(namdbin->fd);
-  free(namdbin);
-}
-
-static void *open_namdbin_write(const char *path, const char *filetype, 
-    int natoms) {
-  namdbinhandle *namdbin;
-  FILE *fd;
-
-  namdbin = (namdbinhandle *)malloc(sizeof(namdbinhandle));
-  if (!namdbin) {
-    fprintf(stderr, "Unable to allocate space for write buffer.\n");
-    return NULL;
-  }
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file %s for writing\n", path);
-    free(namdbin);
-    return NULL;
-  }
-
-  namdbin->fd = fd;
-  namdbin->numatoms = natoms;
-  return namdbin;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  
-  int i;
-  namdbin_int32 myint;
-  namdbinhandle *namdbin = (namdbinhandle *)v;
-  
-  if (!namdbin->fd)
-    return MOLFILE_ERROR;
-  
-  myint = (namdbin_int32)namdbin->numatoms;
-  fwrite(&myint, 4, 1, namdbin->fd);
-
-  for (i=0; i<namdbin->numatoms; i+=BLOCK) {
-    double *tmp = namdbin->xyz;
-    int j, n;
-    n = namdbin->numatoms - i;
-    if ( n > BLOCK ) n = BLOCK;
-    for (j=0; j<n; ++j) {
-      tmp[3*j  ] = ts->coords[3L*(i+j)  ];
-      tmp[3*j+1] = ts->coords[3L*(i+j)+1];
-      tmp[3*j+2] = ts->coords[3L*(i+j)+2];
-    }
-    if (fwrite(tmp, sizeof(double), 3*n, namdbin->fd) != 3*n) {
-      fprintf(stderr, "Error writing namd binary file\n");
-      return MOLFILE_ERROR;
-    }
-  }
-  
-  /*
-   * Close and NULLify the file handle so we don't write any more frames.
-   */
-  fclose(namdbin->fd);
-  namdbin->fd = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-       
-static void close_file_write(void *v) {
-  namdbinhandle *namdbin = (namdbinhandle *)v;
-  if (namdbin->fd)
-    fclose(namdbin->fd);
-  free(namdbin);
-}
-
-/*
- * Initialization stuff here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "namdbin";
-  plugin.prettyname = "NAMD Binary Coordinates";
-  plugin.author = "James Phillips, Justin Gullingsrud";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "coor";
-  plugin.open_file_read = open_namdbin_read;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_file_read;
-  plugin.open_file_write = open_namdbin_write;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-  
-#ifdef TEST_NAMDBINPLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_header_t header;
-  molfile_timestep_t timestep;
-  void *v;
-  int i;
-
-  while (--argc) {
-    ++argv; 
-    v = open_namdbin_read(*argv, &header);
-    if (!v) {
-      fprintf(stderr, "open_namdbin_read failed for file %s\n", *argv);
-      return 1;
-    }
-    timestep.coords = (float *)malloc(3*sizeof(float)*header.numatoms);
-    for (i=0; i<header.numsteps; i++) {
-      int rc = read_next_timestep(v, &timestep);
-      if (rc) {
-        fprintf(stderr, "error in read_next_timestep\n");
-        return 1;
-      }
-    }
-    close_file_read(v);
-  }
-  return 0;
-}
- 
-      
-#endif  
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/netcdfplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/netcdfplugin.c
deleted file mode 100644
index 6871d453ea8b10a34d1c5d820b5041d6014cd5c0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/netcdfplugin.c
+++ /dev/null
@@ -1,1140 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: netcdfplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.29 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * NetCDF based trajectories, used by AMBER 9, MMTK, etc.
- */
-
-#include <netcdf.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#define CDF_TYPE_UNKNOWN 0
-#define CDF_TYPE_AMBER   1
-#define CDF_TYPE_MMTK    2
-
-#define CDF_SUCCESS      0
-#define CDF_ERR         -1
-
-typedef struct {
-  int trajectorytype;
-  int step_numberdimid;
-  size_t step_numberdim;
-  int minor_step_numberdimid;
-  size_t minor_step_numberdim;
-  int atom_numberdimid;
-  size_t atom_numberdim;
-  int xyzdimid;
-  size_t xyzdim;
-  int box_size_lengthdimid;
-  size_t box_size_lengthdim;
-  int description_lengthdimid;
-  size_t description_lengthdim;
-  char *description;
-  int description_id;
-  int step_id;
-  int time_id;
-  int box_size_id;
-  int configuration_id;
-  int has_box;
-  char *comment;
-} mmtkdata;
-
-typedef struct {
-  int is_restart;
-  int is_trajectory;
-  int has_box;
-  int atomdimid;
-  size_t atomdim;
-  int spatialdimid;
-  size_t spatialdim;
-  int framedimid;
-  size_t framedim;
-  char *conventionversion;
-  char *title;
-  char *application;
-  char *program;
-  char *programversion;
-  int spatial_id;                  /* "xyz" */
-  int cell_spatial_id;             /* "abc" */
-  int cell_angular_id;             /* "alpha, beta, gamma" */
-  int time_id;                     /* frame time in picoseconds */
-  int coordinates_id;              /* coords in angstroms */
-  char *coordinates_units;         /* coordinates units */
-  float coordinates_scalefactor;   /* coordinates scaling factor */
-  int cell_lengths_id;             /* cell lengths in angstroms */
-  char *cell_lengths_units;        /* cell lengths units */
-  float cell_lengths_scalefactor;  /* cell lengths scaling factor */
-  int cell_angles_id;              /* cell angles in degrees */
-  char *cell_angles_units;         /* cell angles units */
-  float cell_angles_scalefactor;   /* cell angles scaling factor */
-  int velocities_id;               /* velocities in angstroms/picosecond */
-} amberdata;
-
-
-typedef struct {
-  /* sub-format independent data */
-  int ncid;
-  int type;
-  int natoms; 
-  int curframe;
-  char *conventions;
-
-  /* stuff used by AMBER */
-  amberdata amber;
-
-  /* stuff used by MMTK */
-  mmtkdata mmtk;
-
-} cdfdata;
-
-
-static void close_cdf_read(void *mydata) {
-  cdfdata *cdf = (cdfdata *)mydata;
-
-  nc_close(cdf->ncid);
-
-  /* AMBER stuff */
-  if (cdf->amber.title)
-    free(cdf->amber.title);
-
-  if (cdf->amber.application)
-    free(cdf->amber.application);
-
-  if (cdf->amber.program)
-    free(cdf->amber.program);
-
-  if (cdf->amber.programversion)
-    free(cdf->amber.programversion);
-
-  if (cdf->amber.conventionversion)
-    free(cdf->amber.conventionversion);
-
-  if (cdf->amber.coordinates_units)
-    free(cdf->amber.coordinates_units);
-
-  if (cdf->amber.cell_lengths_units)
-    free(cdf->amber.cell_lengths_units);
-
-  /* MMTK stuff */
-  if (cdf->mmtk.comment)
-    free(cdf->mmtk.comment);
-
-  /* format independent stuff */
-  if (cdf->conventions)
-    free(cdf->conventions);
-
-  free(cdf);
-}
-
-
-
-static int open_amber_cdf_read(cdfdata *cdf) {
-  int rc;
-  size_t len; 
-  amberdata *amber = &cdf->amber;
-
-  /* check if this is a restart file or not */
-  if (!strcmp(cdf->conventions, "AMBERRESTART")) {
-    amber->is_restart = 1;
-  } else {
-    amber->is_trajectory = 1;
-  }
-
-  /* global attrib: "ConventionVersion" -- required */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "ConventionVersion", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->conventionversion = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "ConventionVersion", amber->conventionversion);
-    amber->conventionversion[len] = '\0';
-    printf("netcdfplugin) %s follows AMBER conventions version '%s'\n", 
-           (amber->is_restart) ? "restart file" : "trajectory",
-           amber->conventionversion);
-  } else {
-    return CDF_ERR;
-  }
-
-  /* at this point we know that this is an AMBER trajectory or restart file */
-  cdf->type = CDF_TYPE_AMBER;
-
-  /* initialize default scaling factors so they are always set to a sane */
-  /* value even if problems occur later */
-  amber->coordinates_scalefactor = 1.0;
-  amber->cell_lengths_scalefactor = 1.0;
-  amber->cell_angles_scalefactor = 1.0;
-
-  /* global attrib: "program" -- required */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "program", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->program = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "program", amber->program);
-    amber->program[len] = '\0';
-    printf("netcdfplugin) AMBER: program '%s'\n", amber->program);
-  } else {
-    printf("netcdfplugin) AMBER: Missing required 'program' global attribute, corrupt file?\n");
-  }
-
-
-  /* global attrib: "programVersion" -- required */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "programVersion", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->programversion = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "programVersion", amber->programversion);
-    amber->programversion[len] = '\0';
-    printf("netcdfplugin) AMBER: program version '%s'\n", amber->programversion);
-  } else {
-    printf("netcdfplugin) AMBER: Missing required 'programVersion' global attribute, corrupt file?\n");
-  }
-
-
-  /* global attrib: "title" -- optional */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "title", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->title = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "title", amber->title);
-    amber->title[len] = '\0';
-    printf("netcdfplugin) AMBER: title '%s'\n", amber->title);
-  } 
-
-
-  /* global attrib: "application" -- optional */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "application", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->application = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "application", amber->application);
-    amber->application[len] = '\0';
-    printf("netcdfplugin) AMBER: application '%s'\n", amber->application);
-  } 
-
-
-/* XXX lots of additional error checking is needed below... */
-
-  /* read in spatial dimension */
-  rc = nc_inq_dimid(cdf->ncid, "spatial", &amber->spatialdimid);
-  if (rc == NC_NOERR) {    
-    rc = nc_inq_dimlen(cdf->ncid, amber->spatialdimid, &amber->spatialdim);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) AMBER: spatial dimension: %ld\n", (long)amber->spatialdim);
-    } else {
-      printf("netcdfplugin) AMBER: Missing spatial dimension, corrupt file?\n");
-      printf("netcdfplugin) AMBER: Fixing by guessing spatialdim as '3'\n");
-      amber->spatialdim = 3;
-    }
-  } else {
-    printf("netcdfplugin) AMBER: Missing spatial dimension, corrupt file?\n");
-    printf("netcdfplugin) AMBER: Fixing by guessing spatialdim as '3'\n");
-    amber->spatialdim = 3;
-  }
- 
-  /* read in atom dimension */
-  rc = nc_inq_dimid(cdf->ncid, "atom", &amber->atomdimid);
-  if (rc == NC_NOERR) {    
-    rc = nc_inq_dimlen(cdf->ncid, amber->atomdimid, &amber->atomdim);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) AMBER: atom dimension: %ld\n", (long)amber->atomdim);
-      cdf->natoms = amber->atomdim; /* copy to format independent part */
-    } else  {
-      printf("netcdfplugin) AMBER: missing atom dimension, aborting\n");
-      return CDF_ERR;
-    }
-  } else {
-    printf("netcdfplugin) AMBER: missing atom dimension, aborting\n");
-    return CDF_ERR;
-  }
- 
-  /* if this is a trajectory, read in frame dimension */
-  if (amber->is_trajectory) {
-    rc = nc_inq_dimid(cdf->ncid, "frame", &amber->framedimid);
-    if (rc == NC_NOERR) {    
-      rc = nc_inq_dimlen(cdf->ncid, amber->framedimid, &amber->framedim);
-      if (rc == NC_NOERR) {
-        printf("netcdfplugin) AMBER: frame dimension: %ld\n", (long)amber->framedim);
-      } else {
-        printf("netcdfplugin) AMBER: missing frame dimension, aborting\n");
-        return CDF_ERR;
-      }
-    } else {
-      printf("netcdfplugin) AMBER: missing frame dimension, aborting\n");
-      return CDF_ERR;
-    }
-  }
-
-
-  /* 
-   * get ID values for all of the variables we're interested in 
-   */
-#if 0
-  /* VMD can live without the various human readable label variables. */
-  rc = nc_inq_varid(cdf->ncid, "spatial", &amber->spatial_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  rc = nc_inq_varid(cdf->ncid, "cell_spatial", &amber->cell_spatial_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  rc = nc_inq_varid(cdf->ncid, "cell_angular", &amber->cell_angular_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-#endif
-
-  /* VMD requires coordinates at a minimum */
-  rc = nc_inq_varid(cdf->ncid, "coordinates", &amber->coordinates_id);
-  if (rc != NC_NOERR) {
-    printf("netcdfplugin) AMBER: no coordinates variable, nothing to load\n");
-    return CDF_ERR;
-  }
-
-  /* Coordinate units */
-  rc = nc_inq_attlen(cdf->ncid, amber->coordinates_id, "units", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->coordinates_units = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, amber->coordinates_id, "units", amber->coordinates_units);
-    amber->coordinates_units[len] = '\0';
-    printf("netcdfplugin) AMBER: coordinates units: '%s'\n", amber->coordinates_units);
-  } else {
-    printf("netcdfplugin) AMBER: no coordinates units attribute, Angstroms assumed\n");
-  }
-
-  /* Coordinate scaling factor to get to Angstroms */
-  if (nc_get_att_float(cdf->ncid, amber->coordinates_id, "scale_factor", &amber->coordinates_scalefactor) != NC_NOERR) {
-    printf("netcdfplugin) AMBER: no coordinates scalefactor attribute, 1.0 assumed\n");
-  }
-  printf("netcdfplugin) AMBER: coordinates scalefactor: %f\n", amber->coordinates_scalefactor);
-
-#if 0
-  /* we don't need velocities at this time */
-  rc = nc_inq_varid(cdf->ncid, "velocities", &amber->velocities_id);
-  if (rc != NC_NOERR) {
-    printf("netcdfplugin) AMBER: missing velocities variable, aborting\n");
-    return CDF_ERR;
-  }
-#endif
-
-  /* optional periodic cell info */
-  rc = nc_inq_varid(cdf->ncid, "cell_lengths", &amber->cell_lengths_id);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_varid(cdf->ncid, "cell_angles", &amber->cell_angles_id);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) AMBER trajectory contains periodic cell information\n");
-      amber->has_box = 1;
-
-      /* Cell lengths units */
-      rc = nc_inq_attlen(cdf->ncid, amber->cell_lengths_id, "units", &len);
-      if (rc == NC_NOERR && len > 0) {
-        amber->cell_lengths_units = (char *) malloc((len+1) * sizeof(char));
-        nc_get_att_text(cdf->ncid, amber->cell_lengths_id, "units", amber->cell_lengths_units);
-        amber->cell_lengths_units[len] = '\0';
-        printf("netcdfplugin) AMBER: cell lengths units: '%s'\n", amber->cell_lengths_units);
-      } else {
-        printf("netcdfplugin) AMBER: no cell lengths units attribute, Angstroms assumed\n");
-      }
-
-      /* Cell lengths scaling factor to get to Angstroms */
-      if (nc_get_att_float(cdf->ncid, amber->cell_lengths_id, "scale_factor", &amber->cell_lengths_scalefactor) != NC_NOERR) {
-        printf("netcdfplugin) AMBER: no cell lengths scalefactor attribute, 1.0 assumed\n");
-      }
-      printf("netcdfplugin) AMBER: cell lengths scalefactor: %f\n", amber->cell_lengths_scalefactor);
-
-      /* Cell angles units */
-      rc = nc_inq_attlen(cdf->ncid, amber->cell_angles_id, "units", &len);
-      if (rc == NC_NOERR && len > 0) {
-        amber->cell_angles_units = (char *) malloc((len+1) * sizeof(char));
-        nc_get_att_text(cdf->ncid, amber->cell_angles_id, "units", amber->cell_angles_units);
-        amber->cell_angles_units[len] = '\0';
-        printf("netcdfplugin) AMBER: cell angles units: '%s'\n", amber->cell_angles_units);
-      } else {
-        printf("netcdfplugin) AMBER: no cell angles units attribute, Degrees assumed\n");
-      }
-
-      /* Cell angles scaling factor to get to degrees */
-      if (nc_get_att_float(cdf->ncid, amber->cell_angles_id, "scale_factor", &amber->cell_angles_scalefactor) != NC_NOERR) {
-        printf("netcdfplugin) AMBER: no cell angles scalefactor attribute, 1.0 assumed\n");
-      }
-      printf("netcdfplugin) AMBER: cell angles scalefactor: %f\n", amber->cell_angles_scalefactor);
-    }
-  }
-
-  return CDF_SUCCESS;
-}
-
-
-static int open_mmtk_cdf_read(cdfdata *cdf, int conventionsknown) {
-  int rc;
-  size_t len; 
-  mmtkdata *mmtk = &cdf->mmtk;
-
-  /* If conventions specify MMTK then we're safe to continue */
-  /* and we know what we're dealing with */
-  if (conventionsknown) {
-    cdf->type = CDF_TYPE_MMTK;
-  }
-
-  /* global attrib: "trajectory_type" (new format) */
-  rc = nc_get_att_int(cdf->ncid, NC_GLOBAL, "trajectory_type", &mmtk->trajectorytype);
-  if (rc == NC_NOERR) {
-    printf("netcdfplugin) MMTK trajectory type: %d\n", mmtk->trajectorytype);
-  } else {
-    printf("netcdfplugin) Assuming MMTK trajectory type: %d\n", mmtk->trajectorytype);
-    mmtk->trajectorytype = 0;
-  }
-
-  /* read in spatial dimension */
-  rc = nc_inq_dimid(cdf->ncid, "xyz", &mmtk->xyzdimid);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->xyzdimid, &mmtk->xyzdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: xyz dimension: %ld\n", (long)mmtk->xyzdim);
-    else 
-      return CDF_ERR;
-  } else {
-    return CDF_ERR;
-  }
-
-  /* read in atom dimension */
-  rc = nc_inq_dimid(cdf->ncid, "atom_number", &mmtk->atom_numberdimid); 
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->atom_numberdimid, &mmtk->atom_numberdim);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) MMTK: atom_number dimension: %ld\n", (long)mmtk->atom_numberdim);
-      cdf->natoms = mmtk->atom_numberdim; /* copy to format independent part */
-    } else {
-      return CDF_ERR;
-    }
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* read in frame dimension */
-  rc = nc_inq_dimid(cdf->ncid, "step_number", &mmtk->step_numberdimid);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->step_numberdimid, &mmtk->step_numberdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: step_number dimension: %ld\n", (long)mmtk->step_numberdim);
-    else 
-      return CDF_ERR;
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* read in minor step number dimension */
-  rc = nc_inq_dimid(cdf->ncid, "minor_step_number", &mmtk->minor_step_numberdimid);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->minor_step_numberdimid, &mmtk->minor_step_numberdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: minor_step_number dimension: %ld\n", (long)mmtk->minor_step_numberdim);
-    else 
-      return CDF_ERR;
-  } else if (rc == NC_EBADDIM) {
-    printf("netcdfplugin) MMTK: no minor_step_number dimension\n");
-    mmtk->minor_step_numberdim = 0;
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* read in description_length dimension */
-  rc = nc_inq_dimid(cdf->ncid, "description_length", &mmtk->description_lengthdimid); 
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->description_lengthdimid, &mmtk->description_lengthdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: description_length dimension: %ld\n", (long)mmtk->description_lengthdim);
-    else
-      return CDF_ERR;
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* get ID values for all of the variables we're interested in */
-  rc = nc_inq_varid(cdf->ncid, "configuration", &mmtk->configuration_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  rc = nc_inq_varid(cdf->ncid, "description", &mmtk->description_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  /* check for PBC */
-  rc = nc_inq_varid(cdf->ncid, "box_size", &mmtk->box_size_id);
-  if (rc == NC_NOERR) {
-    mmtk->has_box = 1;
-    printf("netcdfplugin) MMTK: system has periodic boundary conditions\n");
-  }
-  else if (rc == NC_ENOTVAR)
-    mmtk->has_box = 0;
-  else
-    return CDF_ERR;
-
-
-  /* global attrib: "comment" -- optional */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "comment", &len);
-  if (rc == NC_NOERR && len > 0) {
-    mmtk->comment = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "comment", mmtk->comment);
-    mmtk->comment[len] = '\0';
-    printf("netcdfplugin) MMTK: comment '%s'\n", mmtk->comment);
-  } 
-
-  /* at this point we know that this is an MMTK trajectory */
-  if (!conventionsknown) {
-    printf("netcdfplugin) File is an old format MMTK trajectory without conventions\n");    
-    cdf->type = CDF_TYPE_MMTK;
-  }
-
-  return CDF_SUCCESS;
-}
-
- 
-static void *open_cdf_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  int ncid, rc;
-  size_t len;
-  cdfdata *cdf;
- 
-  rc = nc_open(filename, NC_NOWRITE, &ncid);
-  if (rc != NC_NOERR) return NULL;
-
-  cdf = (cdfdata *) malloc(sizeof(cdfdata));
-  memset(cdf, 0, sizeof(cdfdata));
-
-  cdf->ncid = ncid;
-  cdf->type = CDF_TYPE_UNKNOWN;
-
-  /* Determine what NetCDF conventions apply to this data, if any */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "Conventions", &len);
-  if (rc == NC_NOERR && len > 0) {
-    cdf->conventions = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "Conventions", cdf->conventions);
-    cdf->conventions[len] = '\0';
-    printf("netcdfplugin) conventions: '%s'\n", cdf->conventions);
-  } 
-
-  if (cdf->conventions != NULL) {
-    /* Check if this is a file generated by AMBER */
-    if (strstr(cdf->conventions, "AMBER") != NULL) {
-      if (!open_amber_cdf_read(cdf)) {
-        *natoms = cdf->natoms;
-        return cdf;
-      }
-    } 
-
-    /* Check if this is a file generated by MMTK */
-    if (strstr(cdf->conventions, "MMTK") != NULL) {
-      if (!open_mmtk_cdf_read(cdf, 1)) {
-        *natoms = cdf->natoms;
-        return cdf;
-      }
-    } 
-  } 
-
-  printf("netcdfplugin) Missing or unrecognized conventions attribute\n");
-  printf("netcdfplugin) checking for old format MMTK NetCDF file...\n");
-
-  /* If no conventions are specified, then maybe it's from MMTK */
-  if (!open_mmtk_cdf_read(cdf, 0)) {
-    *natoms = cdf->natoms;
-    return cdf;
-  } 
-
-  /* if no conventions are recognized, then we free everything */
-  /* and return failure                                        */
-  close_cdf_read(cdf);
-
-  return NULL; 
-}
-
-/* A very basic bracket counter. It assumes that the expression
-   is syntactically correct. */
-static char *find_closing_bracket(char *s) {
-  int count = 1;
-  while (*s && count > 0) {
-    if (*s == '(' || *s == '[')
-      count++;
-    if (*s == ')' || *s == ']')
-      count--;
-    s++;
-  }
-  return s;
-}
-
-/* Simple string replacement routine for fixing atom names. */
-static void atom_name_replace(char *name, char *substring, char letter) {
-  char *s = strstr(name, substring);
-  if (s != NULL) {
-    *s = letter;
-    strcpy(s+1, s+strlen(substring));
-  }
-}
-
-static void atom_name_remove_underscores(char *name) {
-  char *s = name;
-  while (1) {
-    s = strchr(s, '_');
-    if (s == NULL)
-      break;
-    strcpy(s, s+1);
-  }
-}
-
-/* Set chainid, resname, and resnum for a range of atoms
-   and fix atom names. */
-static void set_atom_attributes(molfile_atom_t *atoms, int natoms,
-				char **atom_pointers, char chain_id,
-				char *resname, int resnum,
-				char *start, char *end,
-				int name_correction_type) {
-  int i;
-  for (i=0; i<natoms; i++)
-    if (atom_pointers[i] > start && atom_pointers[i] < end) {
-      molfile_atom_t *atom = atoms + i;
-      atom->chain[0] = chain_id;      
-      atom->chain[1] = '\0';      
-      strcpy(atom->resname, resname);
-      atom->resid = resnum;
-      if (name_correction_type == 1 /* proteins */) {
-	atom_name_replace(atom->name, "_alpha", 'A');
-	atom_name_replace(atom->name, "_beta", 'B');
-	atom_name_replace(atom->name, "_gamma", 'G');
-	atom_name_replace(atom->name, "_delta", 'D');
-	atom_name_replace(atom->name, "_epsilon", 'E');
-	atom_name_replace(atom->name, "_zeta", 'Z');
-	atom_name_replace(atom->name, "_eta", 'H');
-	atom_name_remove_underscores(atom->name);
-      }
-      else if (name_correction_type == 2 /* nucleic acids */) {
-	if (strcmp(atom->name, "O_1") == 0)
-	  strcpy(atom->name, "O1P");
-	else if (strcmp(atom->name, "O_2") == 0)
-	  strcpy(atom->name, "O2P");
-	else if (strcmp(atom->name, "C_1") == 0)
-	  strcpy(atom->name, "C1'");
-	else if (strcmp(atom->name, "C_2") == 0)
-	  strcpy(atom->name, "C2'");
-	else if (strcmp(atom->name, "C_3") == 0)
-	  strcpy(atom->name, "C3'");
-	else if (strcmp(atom->name, "O_3") == 0)
-	  strcpy(atom->name, "O3'");
-	else if (strcmp(atom->name, "C_4") == 0)
-	  strcpy(atom->name, "C4'");
-	else if (strcmp(atom->name, "O_4") == 0)
-	  strcpy(atom->name, "O4'");
-	else if (strcmp(atom->name, "C_5") == 0)
-	  strcpy(atom->name, "C5'");
-	else if (strcmp(atom->name, "O_5") == 0)
-	  strcpy(atom->name, "O5'");
-	else
-	  atom_name_remove_underscores(atom->name);
-      }
-    }
-}
-
-/* Get structure from an MMTK trajectory file */
-static int read_mmtk_cdf_structure(void *mydata, int *optflags,
-                                   molfile_atom_t *atoms) {
-  int i, rc;
-  molfile_atom_t *atom;
-  cdfdata *cdf = (cdfdata *) mydata;
-  mmtkdata *mmtk = &cdf->mmtk;
-  size_t start[3], count[3];
-  char *dstr;
-  char **atom_pointers;
-  int resnum;
-  char resname[8];
-
-  *optflags = MOLFILE_NOOPTIONS;
-
-  mmtk->description = (char *) malloc((mmtk->description_lengthdim + 1) * sizeof(char));
-  if (mmtk->description == NULL) 
-    return MOLFILE_ERROR;
-
-  start[0] = cdf->curframe; /* frame */
-  count[0] = mmtk->description_lengthdim;
-
-  rc = nc_get_vara_text(cdf->ncid, mmtk->description_id,
-                        start, count, mmtk->description);
-  if (rc != NC_NOERR)
-    return MOLFILE_ERROR;
-
-  /* initialize all atoms with name "X" to start with */
-  /* indicating unknown atom types etc..              */
-  for (i=0; i<cdf->natoms; i++) {
-    atom = atoms + i;
-    strncpy(atom->name, "X", sizeof(atom->name)-1);
-    atom->name[sizeof(atom->name)-1] = '\0';
-    strncpy(atom->type, atom->name, sizeof(atom->type)-1);
-    atom->type[sizeof(atom->type)-1] = '\0';
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  /* Allocate a pointer array that will hold each atom's location in
-     the description string. This will be used in a second pass through
-     the description string in which residue names and indices will
-     be assigned. */
-  atom_pointers = (char **) malloc(cdf->natoms * sizeof(char *));
-  if (atom_pointers == NULL)
-    return MOLFILE_ERROR;
-
-  /* First pass: look only at atoms */
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *atomstr;
-    atomstr = strstr(dstr, "A('");
-
-    if (atomstr != NULL) {
-      char name[1024];
-      char *nmstart = NULL;
-      char *nmend = NULL;
-      char *indstart = NULL;
-      char *endp = NULL;
-      int index, len;
-
-      endp = strchr(atomstr, ')');
-      nmstart = strchr(atomstr, '\'');
-      if (nmstart != NULL)
-        nmend = strchr(nmstart+1, '\'');
-      indstart = strchr(atomstr, ',');
-      if (endp == NULL || nmstart == NULL || nmend == NULL || indstart == NULL) {
-        printf("netcdfplugin) mmtk_read_structure(): unable to parse atom tag\n");
-        break; /* something went wrong */
-      }
-
-      len = nmend - nmstart - 1;
-      if (len > sizeof(name)) {
-        printf("netcdfplugin) mmtk_read_structure(): bad length: %d\n", len);
-        break; /* something went wrong */
-      }
-      memcpy(name, nmstart+1, len); 
-      name[len] = '\0';
-
-      index = -1;
-      sscanf(indstart, ",%d)", &index);
-      atom_pointers[index] = atomstr;
-
-      if (index >= 0 && index < cdf->natoms) {
-        atom = atoms + index;
-        strncpy(atom->name, name, sizeof(atom->name)-1);
-        atom->name[sizeof(atom->name)-1] = '\0';
-        strncpy(atom->type, atom->name, sizeof(atom->type)-1);
-        atom->type[sizeof(atom->type)-1] = '\0';
-      }
-
-      dstr = atomstr+1;
-    } else {
-      break; /* no more atom records found */
-    }
-  }
-
-  /* Second pass: peptide chains */
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *peptide, *pend;
-    char *group, *gend;
-    char *nmstart, *nmend;
-    char chain_id = 'A';
-    char *s;
-
-    peptide = strstr(dstr, "S('");
-    if (peptide == NULL)
-      break;
-    pend = find_closing_bracket(peptide+2);
-
-    resnum = 1;
-    group = peptide;
-    while (1) {
-      group = strstr(group, "G('");
-      if (group == NULL || group >= pend)
-	break;
-      gend = find_closing_bracket(group+2);
-      nmstart = strchr(group, '\'') + 1;
-      nmend = strchr(nmstart, '\'');
-      while (nmend > nmstart && isdigit(*(nmend-1)))
-	nmend--;
-      if (nmend-nmstart > 7)
-	nmend = nmstart+7;
-      strncpy(resname, nmstart, nmend-nmstart);
-      resname[nmend-nmstart] = '\0';
-      s = resname;
-      while (*s) {
-	*s = toupper(*s);
-	s++;
-      }
-      set_atom_attributes(atoms, cdf->natoms, atom_pointers,
-			  chain_id, resname, resnum, group, gend, 1);
-      group = gend;
-      resnum++;
-    }
-
-    if (chain_id == 'Z')
-      chain_id = 'A';
-    else
-	chain_id++;
-    dstr = pend;
-  }
-
-  /* Third pass: nucleic acid chains */
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *nacid, *nend;
-    char *group, *gend;
-    char *nmstart, *nmend;
-    char chain_id = 'a';
-    char *s;
-
-    nacid = strstr(dstr, "N('");
-    if (nacid == NULL)
-      break;
-    nend = find_closing_bracket(nacid+2);
-
-    resnum = 1;
-    group = nacid;
-    while (1) {
-      group = strstr(group, "G('");
-      if (group == NULL || group >= nend)
-	break;
-      gend = find_closing_bracket(group+2);
-      nmstart = strchr(group, '\'') + 1;
-      nmend = strchr(nmstart, '\'');
-      while (nmend > nmstart && isdigit(*(nmend-1)))
-	nmend--;
-      if (nmend > nmstart && nmend[-1] == '_')
-	nmend--;
-      if (nmend-nmstart > 7)
-	nmend = nmstart+7;
-      strncpy(resname, nmstart, nmend-nmstart);
-      resname[nmend-nmstart] = '\0';
-      s = resname;
-      while (*s) {
-	*s = toupper(*s);
-	s++;
-      }
-      if (resname[0] == 'R' || resname[0] == 'D') {
-	switch (resname[1]) {
-	case 'A':
-	  strcpy(resname, "ADE");
-	  break;
-	case 'C':
-	  strcpy(resname, "CYT");
-	  break;
-	case 'G':
-	  strcpy(resname, "GUA");
-	  break;
-	case 'T':
-	  strcpy(resname, "THY");
-	  break;
-	case 'U':
-	  strcpy(resname, "URA");
-	  break;
-	}
-      }
-      set_atom_attributes(atoms, cdf->natoms, atom_pointers,
-			  chain_id, resname, resnum, group, gend, 2);
-      group = gend;
-      resnum++;
-    }
-
-    if (chain_id == 'z')
-      chain_id = 'a';
-    else
-	chain_id++;
-    dstr = nend;
-  }
-
-  /* Fourth pass: non-chain molecules */
-  resnum = 1;
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *molecule, *mend;
-    char *nmstart, *nmend;
-
-    molecule = strstr(dstr, "M('");
-    if (molecule == NULL)
-      break;
-    mend = find_closing_bracket(molecule+2);
-    nmstart = strchr(molecule, '\'') + 1;
-    nmend = strchr(nmstart, '\'');
-    if (strncmp(nmstart, "water", 5) == 0)
-      strcpy(resname, "HOH");
-    else {
-      if (nmend-nmstart > 7)
-	nmend = nmstart+7;
-      strncpy(resname, nmstart, nmend-nmstart);
-      resname[nmend-nmstart] = '\0';
-    }
-    set_atom_attributes(atoms, cdf->natoms, atom_pointers,
-			'_', resname, resnum, molecule, mend, 0);
-    resnum++;
-    dstr = mend;
-  }
-
-  free(atom_pointers);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_cdf_structure(void *mydata, int *optflags,
-                                   molfile_atom_t *atoms) {
-  cdfdata *cdf = (cdfdata *)mydata;
-
-  switch (cdf->type) {
-    case CDF_TYPE_AMBER:
-      return MOLFILE_NOSTRUCTUREDATA; /* not an error, just no data */
-
-    case CDF_TYPE_MMTK:
-      return read_mmtk_cdf_structure(mydata, optflags, atoms);
-  }
-
-  return MOLFILE_ERROR;
-}
-
-
-static int read_amber_cdf_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  size_t start[3], count[3];
-  cdfdata *cdf = (cdfdata *)mydata;
-  amberdata *amber = &cdf->amber;
-  int rc;
-
-  /* Read in the atom coordinates and unit cell information */
-  /* only save coords if we're given a valid ts pointer     */ 
-  /* otherwise VMD wants us to skip it.                     */
-  if (ts != NULL) {
-    if (amber->is_restart) {
-      // restart files only contain one frame, so return if we get called again
-      if (cdf->curframe > 0)
-        return MOLFILE_ERROR;
-
-      start[0] = 0;             /* atom */
-      start[1] = 0;             /* spatial */
-      start[2] = 0;
-
-      count[0] = amber->atomdim;
-      count[1] = amber->spatialdim;
-      count[2] = 0;
-
-      rc = nc_get_vara_float(cdf->ncid, amber->coordinates_id, 
-                             start, count, ts->coords);
-      if (rc != NC_NOERR) { 
-        printf("netcdfplugin) AMBER: failed to parse restart file coordinates!\n");
-      }
-    } else {
-      start[0] = cdf->curframe; /* frame */
-      start[1] = 0;             /* atom */
-      start[2] = 0;             /* spatial */
-
-      count[0] = 1;
-      count[1] = amber->atomdim;
-      count[2] = amber->spatialdim;
-
-      /* parse trajectory timestep */
-      rc = nc_get_vara_float(cdf->ncid, amber->coordinates_id, 
-                             start, count, ts->coords);
-    }
-
-    if (rc != NC_NOERR) 
-      return MOLFILE_ERROR;
-
-    /* apply coordinate scaling factor if not 1.0 */
-    if (amber->coordinates_scalefactor != 1.0) {
-      int i;
-      float s = amber->coordinates_scalefactor;
-      for (i=0; i<natoms*3; i++) {
-        ts->coords[i] *= s;
-      }
-    }
-
-    /* Read the PBC box info. */
-    if (amber->has_box) {
-      size_t start[3], count[3];
-      double lengths[3];
-      double angles[3];
-
-      if (amber->is_restart) {
-        start[0] = 0;             /* spatial */
-        start[1] = 0;
-        start[2] = 0;
-        count[0] = amber->spatialdim;
-        count[1] = 0;
-        count[2] = 0;
-      } else {
-        start[0] = cdf->curframe; /* frame */
-        start[1] = 0;             /* spatial */
-        start[2] = 0;
-        count[0] = 1;
-        count[1] = amber->spatialdim;
-        count[2] = 0;
-      }
-
-      rc = nc_get_vara_double(cdf->ncid, amber->cell_lengths_id, 
-                              start, count, lengths);
-      if (rc != NC_NOERR) 
-        return MOLFILE_ERROR;
-
-      rc = nc_get_vara_double(cdf->ncid, amber->cell_angles_id, 
-                              start, count, angles);
-      if (rc != NC_NOERR) 
-        return MOLFILE_ERROR;
-
-      ts->A = lengths[0] * amber->cell_lengths_scalefactor;
-      ts->B = lengths[1] * amber->cell_lengths_scalefactor;
-      ts->C = lengths[2] * amber->cell_lengths_scalefactor;
-
-      ts->alpha = angles[0] * amber->cell_angles_scalefactor;
-      ts->beta  = angles[1] * amber->cell_angles_scalefactor;
-      ts->gamma = angles[2] * amber->cell_angles_scalefactor;
-    }
-  }
-
-  cdf->curframe++;
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_mmtk_cdf_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  cdfdata *cdf = (cdfdata *)mydata;
-  mmtkdata *mmtk = &cdf->mmtk;
-  int rc;
-
-  /* Read in the atom coordinates and unit cell information */
-  /* only save coords if we're given a valid ts pointer     */ 
-  /* otherwise VMD wants us to skip it.                     */
-  if (ts != NULL) {
-    size_t start[4], count[4];
-    int i;
-
-    if (mmtk->minor_step_numberdim == 0) {
-      start[0] = cdf->curframe; /* step */
-      start[1] = 0;             /* atom */
-      start[2] = 0;             /* spatial */
-      start[3] = 0;             /* minor step */
-    }
-    else {
-      start[0] = cdf->curframe/mmtk->minor_step_numberdim;   /* step */
-      start[1] = 0;             /* atom */
-      start[2] = 0;             /* spatial */
-      start[3] = cdf->curframe % mmtk->minor_step_numberdim; /* minor step */
-    }
-
-    count[0] = 1;
-    count[1] = mmtk->atom_numberdim;
-    count[2] = mmtk->xyzdim;
-    count[3] = 1;             /* only want one minor step, regardless */
-
-    rc = nc_get_vara_float(cdf->ncid, mmtk->configuration_id, 
-                           start, count, ts->coords);
-    if (rc != NC_NOERR) 
-      return MOLFILE_ERROR;
-
-    /* check for allocated but not yet used frame */
-    if (ts->coords[0] == NC_FILL_FLOAT)
-      return MOLFILE_ERROR;
-
-    /* scale coordinates from nanometers to angstroms */
-    for (i=0; i<(3 * mmtk->atom_numberdim); i++) {
-      ts->coords[i] *= 10.0f;
-    }
-
-    /* Read the PBC box info. */
-    if (mmtk->has_box) {
-      float lengths[3];
-
-      if (mmtk->minor_step_numberdim == 0) {
-	start[0] = cdf->curframe; /* step */
-	start[1] = 0;             /* box_size */
-	start[2] = 0;             /* minor step */
-      }
-      else {
-	start[0] = cdf->curframe/mmtk->minor_step_numberdim;   /* step */
-	start[1] = 0;             /* box_size */
-	start[2] = cdf->curframe % mmtk->minor_step_numberdim; /* minor step */
-      }
-
-      count[0] = 1;
-      count[1] = 3;
-      count[2] = 1;
-
-      rc = nc_get_vara_float(cdf->ncid, mmtk->box_size_id,
-                             start, count, lengths);
-      if (rc != NC_NOERR) 
-        return MOLFILE_ERROR;
-
-      ts->A = 10.*lengths[0];
-      ts->B = 10.*lengths[1];
-      ts->C = 10.*lengths[2];
-
-      ts->alpha = 90.;
-      ts->beta  = 90.;
-      ts->gamma = 90.;
-    }
-  }
-
-  cdf->curframe++;
-  return MOLFILE_SUCCESS;
-}
-
-
-
-static int read_cdf_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  cdfdata *cdf = (cdfdata *)mydata;
-
-  switch (cdf->type) {
-    case CDF_TYPE_AMBER: 
-      return read_amber_cdf_timestep(mydata, natoms, ts); 
-
-    case CDF_TYPE_MMTK:
-      return read_mmtk_cdf_timestep(mydata, natoms, ts); 
-  }
-
-  return MOLFILE_ERROR;
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "netcdf";
-  plugin.prettyname = "NetCDF (AMBER, MMTK)";
-  plugin.author = "Konrad Hinsen, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 1;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "nc,ncrst";
-  plugin.open_file_read = open_cdf_read;
-  plugin.read_structure = read_cdf_structure;
-  plugin.read_next_timestep = read_cdf_timestep;
-  plugin.close_file_read = close_cdf_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/offplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/offplugin.C
deleted file mode 100644
index a14ccc04746f290eb8eba7b4dec7649baac53bab..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/offplugin.C
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- *  Object File Format (.off)
- *
- *  Represent surfaces composed of polygons. It is documented there:
- *  http://people.sc.fsu.edu/~jburkardt/data/off/off.html
- *  http://shape.cs.princeton.edu/benchmark/documentation/off_format.html
- *
- *  Contributed by Francois-Xavier Coudert (fxcoudert@gmail.com)
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#include "molfile_plugin.h"
-
-// internal buffer size used in read_rawgraphics()
-#define BUFFLEN 1024
-
-static void *open_file_read(const char *filepath, const char *filetype,
-                            int *natoms) {
-  FILE *f;
-  
-  f = fopen(filepath, "rb");
-  if (!f) {
-    fprintf(stderr, "offplugin) Error opening file.\n");
-    return NULL;
-  }
-  *natoms = 0;
-  return f;
-}
-
-
-static char *nextNoncommentLine(char *buff, int bufflen, FILE *f) {
-  while (1) {
-    char *res = fgets(buff, bufflen, f);
-    if (!res || (res[0] != '#' && res[0] != '\n' && res[0] != '\r'))
-      return res;
-  };
-}
-
-
-static void calcNormals (float vert[9], float norm[9]) {
-  float x1 = vert[3] - vert[0];
-  float y1 = vert[4] - vert[1];
-  float z1 = vert[5] - vert[2];
-  float x2 = vert[6] - vert[0];
-  float y2 = vert[7] - vert[1];
-  float z2 = vert[8] - vert[2];
-  float nx = y1 * z2 - z1 * y2;
-  float ny = z1 * x2 - x1 * z2;
-  float nz = x1 * y2 - y1 * x2;
-  float n = 1 / sqrtf(nx*nx+ny*ny+nz*nz);
-  norm[0] = norm[3] = norm[6] = n * nx;
-  norm[1] = norm[4] = norm[7] = n * ny;
-  norm[2] = norm[5] = norm[8] = n * nz;
-}
-
-
-static int read_rawgraphics(void *v, int *nelem, 
-                            const molfile_graphics_t **data) {
-  int i, k, n;
-  int nVert, nFaces, nEdges;
-  float *vertices = NULL, *vertColors = NULL;
-  char *vertHasColor = NULL;
-  molfile_graphics_t *graphics = NULL;
-  int j=0;
-
-  char buff[BUFFLEN+1];
-  FILE *infile = (FILE *)v;
-
-  // First line is the header: "OFF"
-  nextNoncommentLine(buff, BUFFLEN, infile);
-  if (buff[0] != 'O' || buff[1] != 'F' || buff[2] != 'F') {
-    fprintf(stderr, "offplugin) error: expected \"OFF\" header.\n");
-    goto error;
-  }
-
-  // Second line: numVertices numFaces numEdges
-  nextNoncommentLine(buff, BUFFLEN, infile);
-  if (sscanf (buff, " %d %d %d", &nVert, &nFaces, &nEdges) < 2 || 
-      nVert <= 0 || nFaces <= 0) {
-    fprintf(stderr, "offplugin) error: wrong number of elements.\n");
-    goto error;
-  }
-
-  // Read vertices
-  vertices = (float *) calloc (3 * nVert, sizeof(float));
-  vertHasColor = (char *) calloc (nVert, sizeof(char));
-  vertColors = (float *) calloc (3 * nVert, sizeof(float));
-  for (i = 0; i < nVert; i++) {
-    nextNoncommentLine(buff, BUFFLEN, infile);
-    int n = sscanf (buff, " %g %g %g %g %g %g", 
-                    &vertices[3*i], &vertices[3*i+1], &vertices[3*i+2],
-                    &vertColors[3*i], &vertColors[3*i+1], &vertColors[3*i+2]);
-    if (n != 3 && n != 6) {
-      fprintf(stderr, "offplugin) error: not enough data.\n");
-      goto error;
-    }
-    vertHasColor[i] = (n == 6);
-  }
-
-  // Read faces
-  // We alloc 6 times the memory because:
-  //   -- a quadrangle will be transformed into two triangles.
-  //   -- each triangle may have color, and then also its norm will be specified
-  graphics = (molfile_graphics_t *) calloc(6*nFaces, sizeof(molfile_graphics_t));
-  n = 0;
-  for (i = 0; i < nFaces; i++) {
-    int idx[4];
-    float c[3];
-    nextNoncommentLine(buff, BUFFLEN, infile);
-
-    if (sscanf (buff, "%d", &k) != 1 || k < 3) {
-      fprintf(stderr, "offplugin) error: not enough data.\n");
-      goto error;
-    }
-
-    if (k > 4) {
-      // TODO -- handle polygon decomposition into triangles
-      // Follow the algorithm there:
-      // http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml
-      fprintf(stderr, "offplugin) error: TODO -- handling polygons with more than 4 vertices.\n");
-      goto error;
-    }
-
-    if (k == 3) {
-      j = sscanf (buff, "%d %d %d %d %g %g %g", &k, &idx[0], &idx[1], &idx[2], &c[0], &c[1], &c[2]);
-      bool hasColor = ((j == 7) || (vertHasColor[idx[0]] && vertHasColor[idx[1]] && vertHasColor[idx[2]]));
-
-      graphics[n].type = (hasColor ? MOLFILE_TRICOLOR : MOLFILE_TRIANGLE);
-      graphics[n].data[0] = vertices[3*idx[0]  ];
-      graphics[n].data[1] = vertices[3*idx[0]+1];
-      graphics[n].data[2] = vertices[3*idx[0]+2];
-      graphics[n].data[3] = vertices[3*idx[1]  ];
-      graphics[n].data[4] = vertices[3*idx[1]+1];
-      graphics[n].data[5] = vertices[3*idx[1]+2];
-      graphics[n].data[6] = vertices[3*idx[2]  ];
-      graphics[n].data[7] = vertices[3*idx[2]+1];
-      graphics[n].data[8] = vertices[3*idx[2]+2];
-      n++;
-
-      if (j == 7) {
-        // The facet has a specific color, use it.
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = graphics[n].data[3] = graphics[n].data[6] = c[0];
-        graphics[n].data[1] = graphics[n].data[4] = graphics[n].data[7] = c[1];
-        graphics[n].data[2] = graphics[n].data[5] = graphics[n].data[8] = c[2];
-        n++;
-      } else if (hasColor) {
-        // All three vertices have a color attribute
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = vertColors[3*idx[0]  ];
-        graphics[n].data[1] = vertColors[3*idx[0]+1];
-        graphics[n].data[2] = vertColors[3*idx[0]+2];
-        graphics[n].data[3] = vertColors[3*idx[1]  ];
-        graphics[n].data[4] = vertColors[3*idx[1]+1];
-        graphics[n].data[5] = vertColors[3*idx[1]+2];
-        graphics[n].data[6] = vertColors[3*idx[2]  ];
-        graphics[n].data[7] = vertColors[3*idx[2]+1];
-        graphics[n].data[8] = vertColors[3*idx[2]+2];
-        n++;
-      }
-    } else if (k == 4) {
-      j = sscanf (buff, "%d %d %d %d %d %g %g %g", &k, &idx[0], &idx[1], &idx[2], &idx[3], &c[0], &c[1], &c[2]);
-      bool hasColor = ((j == 8) || (vertHasColor[idx[0]] && vertHasColor[idx[1]] && vertHasColor[idx[2]] && vertHasColor[idx[3]]));
-
-      // Split a quadrangle into two triangles
-      graphics[n].type = (hasColor ? MOLFILE_TRICOLOR : MOLFILE_TRIANGLE);
-      graphics[n].data[0] = vertices[3*idx[0]  ];
-      graphics[n].data[1] = vertices[3*idx[0]+1];
-      graphics[n].data[2] = vertices[3*idx[0]+2];
-      graphics[n].data[3] = vertices[3*idx[1]  ];
-      graphics[n].data[4] = vertices[3*idx[1]+1];
-      graphics[n].data[5] = vertices[3*idx[1]+2];
-      graphics[n].data[6] = vertices[3*idx[2]  ];
-      graphics[n].data[7] = vertices[3*idx[2]+1];
-      graphics[n].data[8] = vertices[3*idx[2]+2];
-      n++;
-
-      if (j == 8) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-      
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = graphics[n].data[3] = graphics[n].data[6] = c[0];
-        graphics[n].data[1] = graphics[n].data[4] = graphics[n].data[7] = c[1];
-        graphics[n].data[2] = graphics[n].data[5] = graphics[n].data[8] = c[2];
-        n++;
-      } else if (hasColor) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = vertColors[3*idx[0]];
-        graphics[n].data[1] = vertColors[3*idx[0]+1];
-        graphics[n].data[2] = vertColors[3*idx[0]+2];
-        graphics[n].data[3] = vertColors[3*idx[1]];
-        graphics[n].data[4] = vertColors[3*idx[1]+1];
-        graphics[n].data[5] = vertColors[3*idx[1]+2];
-        graphics[n].data[6] = vertColors[3*idx[2]];
-        graphics[n].data[7] = vertColors[3*idx[2]+1];
-        graphics[n].data[8] = vertColors[3*idx[2]+2];
-        n++;
-      }
-
-      graphics[n].type = (hasColor ? MOLFILE_TRICOLOR : MOLFILE_TRIANGLE);
-      graphics[n].data[0] = vertices[3*idx[2]];
-      graphics[n].data[1] = vertices[3*idx[2]+1];
-      graphics[n].data[2] = vertices[3*idx[2]+2];
-      graphics[n].data[3] = vertices[3*idx[3]];
-      graphics[n].data[4] = vertices[3*idx[3]+1];
-      graphics[n].data[5] = vertices[3*idx[3]+2];
-      graphics[n].data[6] = vertices[3*idx[0]];
-      graphics[n].data[7] = vertices[3*idx[0]+1];
-      graphics[n].data[8] = vertices[3*idx[0]+2];
-      n++;
-
-      if (j == 8) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = graphics[n].data[3] = graphics[n].data[6] = c[0];
-        graphics[n].data[1] = graphics[n].data[4] = graphics[n].data[7] = c[1];
-        graphics[n].data[2] = graphics[n].data[5] = graphics[n].data[8] = c[2];
-        n++;
-      } else if (hasColor) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = vertColors[3*idx[2]];
-        graphics[n].data[1] = vertColors[3*idx[2]+1];
-        graphics[n].data[2] = vertColors[3*idx[2]+2];
-        graphics[n].data[3] = vertColors[3*idx[3]];
-        graphics[n].data[4] = vertColors[3*idx[3]+1];
-        graphics[n].data[5] = vertColors[3*idx[3]+2];
-        graphics[n].data[6] = vertColors[3*idx[0]];
-        graphics[n].data[7] = vertColors[3*idx[0]+1];
-        graphics[n].data[8] = vertColors[3*idx[0]+2];
-        n++;
-      }
-    }
-  }
-
-  *nelem = n;
-  *data = (molfile_graphics_t *) realloc(graphics, n*sizeof(molfile_graphics_t));
-  return MOLFILE_SUCCESS;
-
-  // goto jump target for disaster handling: free memory and bail out
-  error:
-    free (graphics);
-    free (vertices);
-    return MOLFILE_ERROR;
-}
-
-
-static void close_file_read(void *v) {
-  fclose((FILE *)v);
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "off";
-  plugin.prettyname = "Object File Format (OFF)";
-  plugin.author = "Francois-Xavier Coudert";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "off";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/parm7plugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/parm7plugin.C
deleted file mode 100644
index 67a72f9040f81bb9a26574c183cabd820d2686f3..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/parm7plugin.C
+++ /dev/null
@@ -1,174 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: parm7plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <string.h>
-#include "molfile_plugin.h"
-#include "ReadPARM7.h"
-
-typedef struct {
-  parmstruct *prm;
-  int popn;
-  FILE *fd;
-  int nbonds;
-  int *from, *to;
-} parmdata;
-
-static void *open_parm7_read(const char *filename, const char *,int *natoms) {
-  FILE *fd;
-  int popn = 0;
-  if(!(fd = open_parm7_file(filename, &popn))) {
-    fprintf(stderr, "parm7plugin) Cannot open parm file '%s'\n", filename);
-    return NULL;
-  }
-  parmstruct *prm = read_parm7_header(fd);
-  if (!prm) {
-    close_parm7_file(fd, popn);
-    return NULL; 
-  }
-
-  *natoms = prm->Natom;
-  parmdata *p = new parmdata;
-  memset(p, 0, sizeof(parmdata));
-  p->prm = prm;
-  p->popn = popn;
-  p->fd = fd;
-  p->from = new int[prm->Nbonh + prm->Nbona];
-  p->to   = new int[prm->Nbonh + prm->Nbona];
-  return p;
-}
-
-static int read_parm7_structure(void *mydata, int *optflags, molfile_atom_t *atoms) {
-  parmdata *p = (parmdata *)mydata;
-  const parmstruct *prm = p->prm;
-  FILE *file = p->fd;
-  char buf[85];
-  char field[85];
-  char *resnames = NULL;
-
-  *optflags = MOLFILE_NOOPTIONS; /* no optional data to start with */
-
-  while (fgets(buf, 85, file)) {
-    // find the next line starting with %FLAG, indicating a new section
-    if (strncmp(buf, "%FLAG ", 6)) 
-      continue;
-    sscanf(buf+6, "%s\n", field); // type of record
-
-    // skip any number of lines until we get to "FORMAT". This handles
-    // the %COMMENT lines that may or may not be present
-    while (strncmp(buf, "%FORMAT", 7)) {
-        fgets(buf, 85, file);
-    }
-
-    if (!strcmp(field, "ATOM_NAME")) {
-      if (!parse_parm7_atoms(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "CHARGE")) {
-      *optflags |= MOLFILE_CHARGE;
-      if (!parse_parm7_charge(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "MASS")) {
-      *optflags |= MOLFILE_MASS;
-      if (!parse_parm7_mass(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "AMBER_ATOM_TYPE")) {
-      if (!parse_parm7_atype(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "RESIDUE_LABEL")) {
-      resnames = new char[4*prm->Nres];
-      if (!parse_parm7_resnames(buf, prm->Nres, resnames, file)) break;
-    } else if (!strcmp(field, "RESIDUE_POINTER")) {
-      if (!resnames) {
-        fprintf(stderr, 
-            "parm7plugin) Cannot parse RESIDUE_POINTER before RESIDUE_LABEL\n");
-        continue;
-      }
-      if (!parse_parm7_respointers(buf, prm->Natom, atoms, 
-                                   prm->Nres, resnames, file)) 
-        break;
-      // XXX: we could count the bonded parameters and assign bond types.
-    } else if (!strcmp(field, "BONDS_WITHOUT_HYDROGEN")) {
-      if (!parse_parm7_bonds(buf, prm->Nbona, p->from+p->nbonds,
-            p->to+p->nbonds, file)) break;
-      p->nbonds += prm->Nbona;
-    } else if (!strcmp(field, "BONDS_INC_HYDROGEN")) {
-      if (!parse_parm7_bonds(buf, prm->Nbonh, p->from+p->nbonds,
-            p->to+p->nbonds, file)) break;
-      p->nbonds += prm->Nbonh;
-    }
-  }
-
-  // unused items
-  for (int i=0; i<prm->Natom; i++) {
-    atoms[i].chain[0] = '\0';
-    atoms[i].segid[0] = '\0';
-  }
-
-  delete [] resnames;
-  return MOLFILE_SUCCESS;
-}
-
-static int read_parm7_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                            float **bondorderptr, int **bondtype, 
-                            int *nbondtypes, char ***bondtypename){
-  parmdata *p = (parmdata *)v;
-  *nbonds = p->nbonds;
-  *fromptr = p->from;
-  *toptr = p->to;
-  *bondorderptr = NULL; // parm files don't contain bond order information
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_parm7_read(void *mydata) {
-  parmdata *p = (parmdata *)mydata;
-  close_parm7_file(p->fd, p->popn);
-  delete p->prm;
-  delete [] p->from;
-  delete [] p->to;
-  delete p;
-}
- 
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(){
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "parm7";
-  plugin.prettyname = "AMBER7 Parm";
-  plugin.author = "Brian Bennion, Justin Gullingsrud, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 15;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "prmtop,parm7";
-  plugin.open_file_read = open_parm7_read;
-  plugin.read_structure = read_parm7_structure;
-  plugin.read_bonds = read_parm7_bonds;
-  plugin.close_file_read = close_parm7_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v,(vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(){
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/parmplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/parmplugin.C
deleted file mode 100644
index 777e15379e1e9f15bbf7beadfc539a4d2294581a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/parmplugin.C
+++ /dev/null
@@ -1,147 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: parmplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.35 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <string.h>
-#include "ReadPARM.h"
-#include "molfile_plugin.h"
-
-typedef struct {
-  ReadPARM *rp;
-  FILE *parm;
-  int natoms;
-  int *from, *to;
-} parmdata;
-
-static void *open_parm_read(const char *filename, const char *, 
-    int *natoms) {
- 
-  FILE *parm;
-  ReadPARM *rp = new ReadPARM;
-  if(!(parm = rp->open_parm_file(filename))) {
-    fprintf(stderr, "parmplugin) Cannot open parm file '%s'\n", filename);
-    delete rp;
-    return NULL;
-  }
-  
-  if (rp->readparm(parm) != 0) {
-    delete rp;
-    // XXX should we call close_parm_file???
-    return NULL; 
-  }
-  *natoms = rp->get_parm_natoms();
-  
-  parmdata *p = new parmdata;
-  memset(p, 0, sizeof(parmdata));
-  p->rp = rp;
-  p->parm = parm;
-  p->natoms = *natoms;
-  return p;
-}
-
-static int read_parm_structure(void *mydata, int *optflags,
-    molfile_atom_t *atoms) {
-  
-  parmdata *p = (parmdata *)mydata;
-  ReadPARM *rp = p->rp;
-  rp->get_parm_boxInfo();
-  int i;
- 
-  *optflags = MOLFILE_CHARGE | MOLFILE_MASS;
-
-  for (i=0; i<p->natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    // XXX Why isn't there a return code for error on read????
-    rp->get_parm_atom(i, atom->name, atom->type, atom->resname, atom->segid, 
-        &atom->resid, &atom->charge, &atom->mass);
-    atom->chain[0] = '\0';
-  }
-  // XXX amber box info not supported in the API
-  return MOLFILE_SUCCESS;
-}
-
-static int read_parm_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                           float **bondorderptr,  int **bondtype, 
-                           int *nbondtypes, char ***bondtypename) {
-  parmdata *p = (parmdata *)v;
-  ReadPARM *rp = p->rp;
-  int i, j;
-  int numbonds = rp->get_parm_nbonds();
-  p->from = (int *)malloc(numbonds*sizeof(int));
-  p->to = (int *)malloc(numbonds*sizeof(int));
-  j = 0;
-  for (i=0; i<numbonds; i++) {
-    int a1, a2;
-    rp->get_parm_bond(i, (&a1)-i, (&a2)-i);
-    if ( a1 <= p->natoms && a2 <= p->natoms) {
-      p->from[j] = a1;
-      p->to[j] = a2;
-      j++;
-    } else {
-      printf("parmplugin) skipping bond (%d %d)\n", a1, a2); 
-    }
-  }
-  *nbonds = j;
-  *fromptr = p->from;
-  *toptr = p->to;
-  *bondorderptr = NULL; // PARM files don't have bond order information
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_parm_read(void *mydata) {
-  parmdata *p = (parmdata *)mydata;
-  p->rp->close_parm_file(p->parm);
-  if (p->from) free(p->from);
-  if (p->to) free(p->to);
-  delete p->rp;
-}
- 
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "parm";
-  plugin.prettyname = "AMBER Parm";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 4;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "parm";
-  plugin.open_file_read = open_parm_read;
-  plugin.read_structure = read_parm_structure;
-  plugin.read_bonds = read_parm_bonds;
-  plugin.close_file_read = close_parm_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return 0;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pbeqplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pbeqplugin.C
deleted file mode 100644
index 1e540ae862f1938e5ea684f9fb7b22957acc8452..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pbeqplugin.C
+++ /dev/null
@@ -1,328 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pbeqplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * "unformatted" binary potential map, created by CHARMM PBEQ module
- *
- * Format (fortran): 
- *      INTEGER UNIT
- *      INTEGER NCLX,NCLY,NCLZ
- *      REAL*8  DCEL
- *      REAL*8  XBCEN,YBCEN,ZBCEN,EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
- *      REAL*4  PHI(*)
- *C
- *C     Local variable
- *      INTEGER I
- *
- *      WRITE(UNIT) NCLX,NCLY,NCLZ,DCEL,XBCEN,YBCEN,ZBCEN
- *      WRITE(UNIT) EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
- *      WRITE(UNIT)(PHI(I),I=1,NCLX*NCLY*NCLZ)
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int ndata;
-  int nclx;
-  int ncly;
-  int nclz;
-  int swap;
-  molfile_volumetric_t *vol;
-} pbeq_t;
-
-
-static void *open_pbeq_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  pbeq_t *pbeq;
-  int nclx, ncly, nclz;
-  int trash, length;
-  double dcel; 
-  double xbcen, ybcen, zbcen;
-  double epsw, epsp, conc, tmemb, zmemb, epsm;
-  int swap=0; 
-
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    printf("pbeqplugin) Error opening file %s.\n", filepath);
-    return NULL;
-  }
-
-  // skip first Fortran length record for
-  // WRITE(UNIT) NCLX,NCLY,NCLZ,DCEL,XBCEN,YBCEN,ZBCEN
-  if (fread(&length, 4, 1, fd) != 1)
-    return NULL;
-
-  if (fread(&nclx, 4, 1, fd) != 1)
-    return NULL;
-  if (fread(&ncly, 4, 1, fd) != 1)
-    return NULL;
-  if (fread(&nclz, 4, 1, fd) != 1)
-    return NULL;
-
-  // test endianness first
-  if (length != 44) {
-    swap = 1;
-    swap4_aligned(&length, 1);
-    if (length != 44) {
-      printf("pbeqplugin) length record != 44, unrecognized format (length: %d)\n", length);
-      return NULL;
-    }
-  }
-
-  if (swap) {
-    swap4_aligned(&nclx, 1);
-    swap4_aligned(&ncly, 1);
-    swap4_aligned(&nclz, 1);
-  } 
-
-  // this is a risky strategy for detecting endianness, 
-  // but it works so far, and the charmm potential maps don't
-  // have version numbers, magic numbers, or anything else that we
-  // might otherwise use for this purpose.
-  if ((nclx > 4000 && ncly > 4000 && nclz > 4000) ||
-      (nclx * ncly * nclz < 0)) {
-    printf("pbeqplugin) inconclusive byte ordering, bailing out\n");
-    return NULL;
-  }
-
-  // read the rest of the header
-  if (fread(&dcel, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&xbcen, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&ybcen, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&zbcen, 8, 1, fd) != 1) 
-    return NULL;
-
-  // skip second Fortran length record for
-  // WRITE(UNIT) NCLX,NCLY,NCLZ,DCEL,XBCEN,YBCEN,ZBCEN
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  // skip first Fortran length record for 
-  // WRITE(UNIT) EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  if (fread(&epsw, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&epsp, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&conc, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&tmemb, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&zmemb, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&epsm, 8, 1, fd) != 1) 
-    return NULL;
-
-  // skip second Fortran length record for 
-  // WRITE(UNIT) EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  // byte swap the header data if necessary
-  if (swap) {
-    swap8_aligned(&dcel, 1);
-    swap8_aligned(&xbcen, 1);
-    swap8_aligned(&ybcen, 1);
-    swap8_aligned(&zbcen, 1);
-    swap8_aligned(&epsw, 1);
-    swap8_aligned(&epsp, 1);
-    swap8_aligned(&conc, 1);
-    swap8_aligned(&tmemb, 1);
-    swap8_aligned(&zmemb, 1);
-    swap8_aligned(&epsm, 1);
-  }
-
-#if 0
-  // print header info for debugging of early versions
-  printf("pbeqplugin) nclx:%d nxly:%d nclz:%d\n", nclx, ncly, nclz);
-  printf("pbeqplugin) dcel: %f\n", dcel); 
-  printf("pbeqplugin) x/y/zbcen: %g %g %g\n", xbcen, ybcen, zbcen); 
-  printf("pbeqplugin) epsw/p: %g %g  conc: %g  tmemb: %g zmemb: %g  epsm: %g\n",
-         epsw, epsp, conc, tmemb, zmemb, epsm);
-#endif
-
-  /* Allocate and initialize the pbeq structure */
-  pbeq = new pbeq_t;
-  pbeq->fd = fd;
-  pbeq->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  pbeq->nsets = 1; /* this file contains only one data set */
-  pbeq->ndata = nclx*ncly*nclz;
-  pbeq->nclx = nclx;
-  pbeq->ncly = ncly;
-  pbeq->nclz = nclz;
-  pbeq->swap = swap;
-
-  pbeq->vol = new molfile_volumetric_t[1];
-  strcpy(pbeq->vol[0].dataname, "CHARMM PBEQ Potential Map");
-
-  pbeq->vol[0].origin[0] = -0.5*((nclx-1) * dcel) + xbcen;
-  pbeq->vol[0].origin[1] = -0.5*((ncly-1) * dcel) + ybcen;
-  pbeq->vol[0].origin[2] = -0.5*((nclz-1) * dcel) + zbcen;
-
-  // print origin info, for debuggin of early versions
-  printf("pbeqplugin) box LL origin: %g %g %g\n", 
-         pbeq->vol[0].origin[0],
-         pbeq->vol[0].origin[1],
-         pbeq->vol[0].origin[2]);
-
-  pbeq->vol[0].xaxis[0] = (nclx-1) * dcel;
-  pbeq->vol[0].xaxis[1] = 0;
-  pbeq->vol[0].xaxis[2] = 0;
-
-  pbeq->vol[0].yaxis[0] = 0;
-  pbeq->vol[0].yaxis[1] = (ncly-1) * dcel;
-  pbeq->vol[0].yaxis[2] = 0;
-
-  pbeq->vol[0].zaxis[0] = 0;
-  pbeq->vol[0].zaxis[1] = 0;
-  pbeq->vol[0].zaxis[2] = (nclz-1) * dcel;
-
-  pbeq->vol[0].xsize = nclx;
-  pbeq->vol[0].ysize = ncly;
-  pbeq->vol[0].zsize = nclz;
-
-  pbeq->vol[0].has_color = 0;
-
-  return pbeq;
-}
-
-static int read_pbeq_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  pbeq_t *pbeq = (pbeq_t *)v;
-  *nsets = pbeq->nsets; 
-  *metadata = pbeq->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_pbeq_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  pbeq_t *pbeq = (pbeq_t *)v;
-  int ndata = pbeq->ndata;
-  int nclx = pbeq->nclx;
-  int ncly = pbeq->ncly;
-  int nclz = pbeq->nclz;
-  FILE *fd = pbeq->fd;
-  int trash;
-
-  // skip first Fortran length record for 
-  // WRITE(UNIT)(PHI(I),I=1,NCLX*NCLY*NCLZ)
-  if (fread(&trash, 4, 1, fd) != 1)
-    return MOLFILE_ERROR;
-
-  /* Read the densities. Order for file is z fast, y medium, x slow */
-  int x, y, z;
-  int count=0;
-  for (x=0; x<nclx; x++) {
-    for (y=0; y<ncly; y++) {
-      for (z=0; z<nclz; z++) {
-        int addr = z*nclx*ncly + y*nclx + x;
-        if (fread(datablock + addr, 4, 1, fd) != 1) {
-          printf("pbeqplugin) Error reading potential map cell: %d,%d,%d\n", x, y, z);
-          printf("pbeqplugin) offset: %d\n", (int) ftell(fd));
-          return MOLFILE_ERROR;
-        }
-        count++;
-      }
-    }
-  }
-
-
-#if 0
-  // skip last Fortran length record for 
-  // WRITE(UNIT)(PHI(I),I=1,NCLX*NCLY*NCLZ)
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  // print debugging info for early versions
-  printf("pbeqplugin) read %d phi values from block\n", count);
-  for (x=0; x<1000000; x++) {
-    int trash;
-    if (fread(&trash, 4, 1, fd) != 1) {
-      printf("pbeqplugin) read %d extra phi values past the end of the block\n", x);
-      break;
-    }
-  }   
-#endif
-
-  if (pbeq->swap) {
-    swap4_aligned(datablock, ndata);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pbeq_read(void *v) {
-  pbeq_t *pbeq = (pbeq_t *)v;
-
-  fclose(pbeq->fd);
-  if (pbeq->vol != NULL)
-    delete [] pbeq->vol; 
-  delete pbeq;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pbeq";
-  plugin.prettyname = "CHARMM PBEQ Binary Potential Map";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "pbeq, phi80";
-  plugin.open_file_read = open_pbeq_read;
-  plugin.read_volumetric_metadata = read_pbeq_metadata;
-  plugin.read_volumetric_data = read_pbeq_data;
-  plugin.close_file_read = close_pbeq_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pdbplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pdbplugin.c
deleted file mode 100644
index 18cd9fbcc82ef71c5922fae02dd27bf8de91cf1e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pdbplugin.c
+++ /dev/null
@@ -1,604 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pdbplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.73 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * PDB file format specifications:
- *   http://www.rcsb.org/pdb/static.do?p=file_formats/pdb/index.html
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include "molfile_plugin.h"
-#include "readpdb.h"
-#include "periodic_table.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * API functions start here
- */
-
-typedef struct {
-  FILE *fd;
-  int first_frame;
-  int natoms;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-  int nconect;
-  int nbonds, maxbnum;
-  int *from, *to, *idxmap;
-} pdbdata;
-
-static void *open_pdb_read(const char *filepath, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  pdbdata *pdb;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx, nconect;
-
-  fd = fopen(filepath, "r");
-  if (!fd) 
-    return NULL;
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->fd = fd;
-  pdb->meta = (molfile_metadata_t *) malloc(sizeof(molfile_metadata_t));
-  memset(pdb->meta, 0, sizeof(molfile_metadata_t));
-
-  pdb->meta->remarklen = 0;
-  pdb->meta->remarks = NULL;
-
-  *natoms=0;
-  nconect=0;
-  do {
-    indx = read_pdb_record(pdb->fd, pdbstr);
-    if (indx == PDB_ATOM) {
-      *natoms += 1;
-    } else if (indx == PDB_CONECT) {
-      nconect++;
-    } else if (indx == PDB_HEADER) {
-      get_pdb_header(pdbstr, pdb->meta->accession, pdb->meta->date, NULL);
-      if (strlen(pdb->meta->accession) > 0) 
-        strcpy(pdb->meta->database, "PDB");
-    } else if (indx == PDB_REMARK || indx == PDB_CONECT || indx == PDB_UNKNOWN) {
-      int len=strlen(pdbstr);
-      int newlen = len + pdb->meta->remarklen;
-
-      char *newstr=realloc(pdb->meta->remarks, newlen + 1);
-      if (newstr != NULL) {
-        pdb->meta->remarks = newstr;
-        pdb->meta->remarks[pdb->meta->remarklen] = '\0';
-        memcpy(pdb->meta->remarks + pdb->meta->remarklen, pdbstr, len);
-        pdb->meta->remarks[newlen] = '\0';
-        pdb->meta->remarklen = newlen;
-      }
-    }
- 
-  } while (indx != PDB_END && indx != PDB_EOF);
-
-  /* If no atoms were found, this is probably not a PDB file! */
-  if (!*natoms) {
-    fprintf(stderr, "PDB file '%s' contains no atoms.\n", filepath);
-    if (pdb->meta->remarks != NULL)
-      free(pdb->meta->remarks);
-    if (pdb->meta != NULL)
-      free(pdb->meta);
-    free(pdb);
-    return NULL;
-  }
-
-  rewind(pdb->fd); /* if ok, rewind file and prepare to parse it for real */
-  pdb->natoms = *natoms;
-  pdb->nconect = nconect;
-  pdb->nbonds = 0;
-  pdb->maxbnum = 0;
-  pdb->from = NULL;
-  pdb->to = NULL;
-  pdb->idxmap = NULL;
-  pdb->atomlist = NULL;
-
-#if defined(VMDUSECONECTRECORDS)
-  /* allocate atom index translation table if we have 99,999 atoms or less */
-  /* and we have conect records to process                                 */
-  if (pdb->natoms < 100000 && pdb->nconect > 0) {
-    pdb->idxmap = (int *) malloc(100000 * sizeof(int));
-    memset(pdb->idxmap, 0, 100000 * sizeof(int));
-  }
-#endif
- 
-  return pdb; 
-}
-
-static int read_pdb_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) { 
-  pdbdata *pdb = (pdbdata *)mydata;
-  molfile_atom_t *atom;
-  char pdbrec[PDB_BUFFER_LENGTH];
-  int i, rectype, atomserial, pteidx;
-  char ridstr[8];
-  char elementsymbol[3];
-  int badptecount = 0;
-  long fpos = ftell(pdb->fd);
-
-  *optflags = MOLFILE_INSERTION | MOLFILE_OCCUPANCY | MOLFILE_BFACTOR |
-              MOLFILE_ALTLOC | MOLFILE_ATOMICNUMBER | MOLFILE_BONDSSPECIAL;
-
-  i = 0;
-  do {
-    rectype = read_pdb_record(pdb->fd, pdbrec);
-    switch (rectype) {
-    case PDB_ATOM:
-      atom = atoms+i;
-      get_pdb_fields(pdbrec, strlen(pdbrec), &atomserial, 
-          atom->name, atom->resname, atom->chain, atom->segid, 
-          ridstr, atom->insertion, atom->altloc, elementsymbol,
-          NULL, NULL, NULL, &atom->occupancy, &atom->bfactor);
-
-      if (pdb->idxmap != NULL && atomserial < 100000) {
-        pdb->idxmap[atomserial] = i; /* record new serial number translation */ 
-      }
- 
-      atom->resid = atoi(ridstr);
-
-      /* determine atomic number from the element symbol */
-      pteidx = get_pte_idx_from_string(elementsymbol);
-      atom->atomicnumber = pteidx;
-      if (pteidx != 0) {
-        atom->mass = get_pte_mass(pteidx);
-        atom->radius = get_pte_vdw_radius(pteidx);
-      } else {
-        badptecount++; /* unrecognized element */
-      }
- 
-      strcpy(atom->type, atom->name);
-      i++;
-      break;
-
-    case PDB_CONECT:
-      /* only read CONECT records for structures where we know they can */
-      /* be valid for all of the atoms in the structure                 */
-      if (pdb->idxmap != NULL) {
-        get_pdb_conect(pdbrec, pdb->natoms, pdb->idxmap, 
-                       &pdb->maxbnum, &pdb->nbonds, &pdb->from, &pdb->to);
-      }
-      break;
-
-    default:
-      /* other record types are ignored in the structure callback */
-      /* and are dealt with in the timestep callback or elsewhere */
-      break;
-    }
-  } while (rectype != PDB_END && rectype != PDB_EOF);
-
-  fseek(pdb->fd, fpos, SEEK_SET);
-
-  /* if all atoms are recognized, set the mass and radius flags too,  */
-  /* otherwise let VMD guess these for itself using it's own methods  */
-  if (badptecount == 0) {
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                      float ** bondorder,int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  pdbdata *pdb = (pdbdata *)v;
-  
-  *nbonds = 0;
-  *fromptr = NULL;
-  *toptr = NULL;
-  *bondorder = NULL; /* PDB files don't have bond order information */
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-/* The newest plugin API allows us to return CONECT records as 
- * additional bonds above and beyond what the distance search returns.
- * Without that feature, we otherwise have to check completeness and
- * ignore them if they don't look to be fully specified for this molecule */
-#if !defined(MOLFILE_BONDSSPECIAL)
-  if (pdb->natoms >= 100000) {
-    printf("pdbplugin) Warning: more than 99,999 atoms, ignored CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (((float) pdb->nconect / (float) pdb->natoms) <= 0.85) {
-    printf("pdbplugin) Warning: Probable incomplete bond structure specified,\n");
-    printf("pdbplugin)          ignoring CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (pdb->nconect == 0) {
-    return MOLFILE_SUCCESS;
-  }
-#endif
-
-  *nbonds = pdb->nbonds;
-  *fromptr = pdb->from;
-  *toptr = pdb->to;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/* 
- * 
- */
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx, i;
-  float *x, *y, *z;
-  float occup, bfac;
-  if (pdb->natoms == 0) 
-    return MOLFILE_ERROR; /* EOF */
-  if (ts) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = 0;
-  } 
-  i = 0;
-  do {
-    indx = read_pdb_record(pdb->fd, pdbstr);
-    if((indx == PDB_END || indx == PDB_EOF) && (i < pdb->natoms)) {
-      return MOLFILE_ERROR;
-    } else if(indx == PDB_ATOM) {
-      if(i++ >= pdb->natoms) {
-        break;      
-      }
-      /* just get the coordinates, and store them */
-      if (ts) {
-        get_pdb_coordinates(pdbstr, x, y, z, &occup, &bfac);
-        x += 3;
-        y += 3;
-        z += 3;
-      } 
-    } else if (indx == PDB_CRYST1) {
-      if (ts) {
-        get_pdb_cryst1(pdbstr, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    }
-  } while(!(indx == PDB_END || indx == PDB_EOF));
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pdb_read(void *v) { 
-  pdbdata *pdb = (pdbdata *)v;
-  if (pdb->fd != NULL)
-    fclose(pdb->fd);
-  if (pdb->idxmap != NULL)
-    free(pdb->idxmap);
-  if (pdb->meta->remarks != NULL)
-    free(pdb->meta->remarks);
-  if (pdb->meta != NULL) 
-    free(pdb->meta);
-  free(pdb);
-}
-
-static void *open_file_write(const char *path, const char *filetype, 
-    int natoms) {
-
-  FILE *fd;
-  pdbdata *pdb;
-  fd = fopen(path, "w");
-  if (!fd) {
-    fprintf(stderr, "Unable to open file %s for writing\n", path);
-    return NULL;
-  }
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->fd = fd;
-  pdb->natoms = natoms; 
-  pdb->atomlist = NULL;
-  pdb->first_frame = 1;
-  return pdb;
-}
- 
-static int write_structure(void *v, int optflags, 
-    const molfile_atom_t *atoms) {
-
-  int i;
-  pdbdata *pdb = (pdbdata *)v;
-  int natoms = pdb->natoms;
-  pdb->atomlist = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-  memcpy(pdb->atomlist, atoms, natoms*sizeof(molfile_atom_t));
-
-  /* If occ, bfactor, and insertion aren't given, we assign defaultvalues. */
-  if (!(optflags & MOLFILE_OCCUPANCY)) {
-    for (i=0; i<natoms; i++) pdb->atomlist[i].occupancy = 0.0f;
-  }
-  if (!(optflags & MOLFILE_BFACTOR)) {
-    for (i=0; i<natoms; i++) pdb->atomlist[i].bfactor= 0.0f;
-  }
-  if (!(optflags & MOLFILE_INSERTION)) {
-    for (i=0; i<natoms; i++) {
-      pdb->atomlist[i].insertion[0] =' ';
-      pdb->atomlist[i].insertion[1] ='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ALTLOC)) {
-    for (i=0; i<natoms; i++) {
-      pdb->atomlist[i].altloc[0]=' ';
-      pdb->atomlist[i].altloc[1]='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ATOMICNUMBER)) {
-    for (i=0; i<natoms; i++) pdb->atomlist[i].atomicnumber = 0;
-  }
-
-  /* TODO: put bonds into CONECT records? */
-  return MOLFILE_SUCCESS;
-}
-
-/* SEQRES records look like this:
-
-COLUMNS        DATA TYPE       FIELD         DEFINITION
----------------------------------------------------------------------------------
- 1 -  6        Record name     "SEQRES"
-
- 9 - 10        Integer         serNum        Serial number of the SEQRES record
-                                             for the current chain.  Starts at 1
-                                             and increments by one each line.
-                                             Reset to 1 for each chain.
-
-12             Character       chainID       Chain identifier.  This may be any
-                                             single legal character, including a
-                                             blank which is used if there is
-                                             only one chain.
-
-14 - 17        Integer         numRes        Number of residues in the chain.
-                                             This value is repeated on every
-                                             record.
-
-20 - 22        Residue name    resName       Residue name.
-
-24 - 26        Residue name    resName       Residue name.
-
-... and so forth out to 68-70, for a total of 13 in each line (except possibly
-the last.
-
-source:
-http://www.rcsb.org/pdb/file_formats/pdb/pdbguide2.2/part_35.html
-*/
-
-/*
- * However, we don't use them right now because of several issues that
- * can't presently be resolved satisfactorily in VMD:
-
-According to the RCSB, SEQRES records have to contain all residues, not
-just those in the structure, which means VMD will usually produce incorrect
-output and there's nothing we can do about it.  The RCSB actually specifies
-that all residues in the chain have to present in the SEQRES records, even
-if they're not in the structure.
-  
-We can never know which residues to output.  Our current system of outputting   
-everything is just terrible when you have 20,000 waters in your system; we
-have to fix this immediately.  We could almost get away with making a hash
-table of the names of protein and nucleic acid residues and only write chains
-containing those residues.  However, there's this little snippet from the
-specification:
-  
-* Heterogens which are integrated into the backbone of the chain are listed
-  as being part of the chain and are included in the SEQRES records for
-  that chain.
-  
-That means that we can never know what might appear in the sequence unless we
-also read HET records and keep track of them in VMD as well.  We shouldn't 
-get people depending on such fallible SEQRES records.
-  
-And of course, there's the fact that no other program that we know of besides   
-CE needs these SEQRES records.
-
- * Uncomment the write_seqres line in write_timestep to turn them back on.
- */
-
-
-#if 0
-static void write_seqres(FILE * fd, int natoms, const molfile_atom_t *atomlist) {
-  int i=0;
-  while (i < natoms) {
-    int k, serNum;
-    int j = i;
-    int ires, nres = 1;
-    int resid = atomlist[i].resid;
-    /* Count up the number of residues in the chain */
-    const char *chain = atomlist[i].chain;
-    while (j < natoms && !strcmp(chain, atomlist[j].chain)) {
-      if (resid != atomlist[j].resid) {
-        nres++;
-        resid = atomlist[j].resid;
-      }
-      j++;
-    }
-    /* There are nres residues in the chain, from atoms i to j. */
-    serNum = 1;
-    ires = 1;
-    resid = atomlist[i].resid;
-    fprintf(fd, "SEQRES  %2d %c %4d  ",  serNum, chain[0], nres);
-    serNum = 2;
-    fprintf(fd, "%3s ", atomlist[i].resname);
-    for (k=i; k<j; k++) {
-      if (resid != atomlist[k].resid) {
-        resid = atomlist[k].resid;
-        if (!(ires % 13)) {
-          fprintf(fd, "\nSEQRES  %2d %c %4d  ",  serNum, chain[0], nres);
-          serNum++;
-        }
-        fprintf(fd, "%3s ", atomlist[k].resname);
-        ires++;
-      }
-    }
-    i = j;
-    fprintf(fd, "\n");
-  }
-}
-#endif
-
-/*
-CRYST1 records look like this:
-The CRYST1 record presents the unit cell parameters, space group, and Z value. If the structure was not determined by crystallographic means, CRYST1 simply defines a unit cube. 
-
-
-Record Format 
-
-COLUMNS       DATA TYPE      FIELD         DEFINITION
--------------------------------------------------------------
- 1 -  6       Record name    "CRYST1"
-
- 7 - 15       Real(9.3)      a             a (Angstroms).
-
-16 - 24       Real(9.3)      b             b (Angstroms).
-
-25 - 33       Real(9.3)      c             c (Angstroms).
-
-34 - 40       Real(7.2)      alpha         alpha (degrees).
-
-41 - 47       Real(7.2)      beta          beta (degrees).
-
-48 - 54       Real(7.2)      gamma         gamma (degrees).
-
-56 - 66       LString        sGroup        Space group.
-
-67 - 70       Integer        z             Z value.
-
-* If the coordinate entry describes a structure determined by a technique
-other than crystallography, CRYST1 contains a = b = c = 1.0, alpha =
-beta = gamma = 90 degrees, space group = P 1, and Z = 1.
-
-We will use "P 1" and "1" for space group and z value, as recommended, but
-we'll populate the other fields with the unit cell information we do have.
-
-*/
-  
-static void write_cryst1(FILE *fd, const molfile_timestep_t *ts) {
-  fprintf(fd, "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f P 1           1\n", 
-    ts->A, ts->B, ts->C, ts->alpha, ts->beta, ts->gamma);
-}
-
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-  char elementsymbol[3];
-
-  if (pdb->natoms == 0)
-    return MOLFILE_SUCCESS;
-
-  if (pdb->first_frame) {
-    /* Turn off SEQRES writing for now; see comments above.
-    write_seqres(pdb->fd, pdb->natoms, pdb->atomlist);
-    */
-    write_cryst1(pdb->fd, ts);
-    pdb->first_frame = 0;
-  }
-  atom = pdb->atomlist;
-  pos = ts->coords;
-  for (i=0; i<pdb->natoms; i++) {
-    /*
-     * The 8.3 format for position, occupancy, and bfactor permits values 
-     * only in the range of -999.9994 to 9999.9994 (so that they round
-     * to the range [-999.999, 9999.999]).  If values fall outside of that
-     * range, fail and emit an error message rather than generate a
-     * misformatted PDB file.
-     */
-#define PDBBAD(x) ((x) < -999.9994f || (x) > 9999.9994f)
-    if (PDBBAD(pos[0]) || PDBBAD(pos[1]) || PDBBAD(pos[2]) ||
-		PDBBAD(atom->occupancy) || PDBBAD(atom->bfactor)) {
-	    fprintf(stderr, "PDB WRITE ERROR: Position, occupancy, or b-factor (beta) for atom %d\n", i);
-      fprintf(stderr, "                 cannot be written in PDB format.\n");
-      fprintf(stderr, "                 File will be truncated.\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check the atomicnumber and format the atomic element symbol string */
-    strcpy(elementsymbol, (atom->atomicnumber < 1) ? "  " : get_pte_label(atom->atomicnumber));
-    elementsymbol[0] = toupper(elementsymbol[0]);
-    elementsymbol[1] = toupper(elementsymbol[1]);
- 
-    if (!write_raw_pdb_record(pdb->fd,  
-        "ATOM  ", i+1, atom->name, atom->resname, atom->resid, 
-        atom->insertion, atom->altloc, elementsymbol,
-        pos[0], pos[1], pos[2], 
-        atom->occupancy, atom->bfactor, atom->chain, atom->segid)) {
-      fprintf(stderr, 
-          "PDB: Error encoutered writing atom %d; file may be incomplete.\n", 
-          i+1);
-      return MOLFILE_ERROR;
-    }
-    ++atom;
-    pos += 3;
-  }
-  fprintf(pdb->fd, "END\n");
-
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_file_write(void *v) {
-  pdbdata *pdb = (pdbdata *)v; 
-  fclose(pdb->fd);
-  free(pdb->atomlist);
-  free(pdb);
-}
-
-static int read_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  pdbdata *pdb = (pdbdata *)v; 
-  *metadata = pdb->meta;
-  return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
- 
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pdb";
-  plugin.prettyname = "PDB";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 16;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "pdb,ent";
-  plugin.open_file_read = open_pdb_read;
-  plugin.read_structure = read_pdb_structure;
-  plugin.read_bonds = read_bonds;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_pdb_read;
-  plugin.open_file_write = open_file_write;
-  plugin.write_structure = write_structure;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  plugin.read_molecule_metadata = read_molecule_metadata;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pdbxplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pdbxplugin.C
deleted file mode 100755
index f65e3a5d361ddb886d8e68b650d2415cc0107173..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pdbxplugin.C
+++ /dev/null
@@ -1,1555 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pdbxplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.17 $       $Date: 2016/11/28 05:01:22 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include "molfile_plugin.h"
-#include "periodic_table.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if !(defined(WIN32) || defined(WIN64))
-#include <sys/time.h>
-#endif
-
-#define VMDPLUGIN_STATIC
-#include "inthash.h"
-
-//#define PDBX_DEBUG 1
-
-//used for reading author defined values needed when reading bond info
-#define CHAIN_SIZE 4
-#define TYPE_SIZE 8
-#define BUFFER_SIZE 1024
-
-struct list_node { 
-  unsigned int next;
-  unsigned int index;
-};
-
-// class definition
-typedef struct pdbxParser {
-  FILE *file;
-  int natoms;
-  int nbonds;
-  int* resid_auth;
-  char * chain_auth;
-  char * type_auth;
-  float* xyz;
-  int* bondsTo;
-  int* bondsFrom;
-  bool error;
-  int table[64];
-  unsigned int tableSize;
-  inthash_t bondHash;
-  list_node * hashMem;
-} pdbxParser;
-
-// XXX yuck, this needs to go!
-static unsigned char charToNum[128];
-
-enum TableColums {
-  COLUMN_NUMBER,
-  COLUMN_NAME,
-  COLUMN_TYPE,
-  COLUMN_TYPE_AUTH,
-  COLUMN_RESNAME,
-  COLUMN_RESID,
-  COLUMN_RESID_AUTH,
-  COLUMN_INSERTION,
-  COLUMN_X,
-  COLUMN_Y,
-  COLUMN_Z,
-  COLUMN_OCCUPANCY,
-  COLUMN_BFACTOR,
-  COLUMN_CHARGE,
-  COLUMN_CHAIN,
-  COLUMN_CHAIN_AUTH,
-  COLUMN_JUNK
-};
-
-/* Opens the file, finds the number of atoms, and allocates arrays */
-/* Reads in and stores information from the file */
-static pdbxParser* create_pdbxParser(const char* filepath);
-
-/*Reads through the file and stores data */
-static int parseStructureFaster(molfile_atom_t * atoms, int * optflags, pdbxParser* parser);
-
-static int setCoordinatesFast(float* coords, pdbxParser* parser);
-
-static bool readRMSDBonds(molfile_atom_t * atoms, pdbxParser* parser);
-static bool readAngleBonds(molfile_atom_t * atoms, pdbxParser* parser);
-static bool readBonds(molfile_atom_t * atoms, pdbxParser* parser);
-
-/* Parse through file and return the total number of atoms */
-/* Will rewind the file to the start */
-/* Returns -1 if the number of atoms cannot be found */
-static int parseNumberAtoms(pdbxParser* parser);
-
-/* returns true if str starts with "_atom_site." */
-static inline bool isAtomSite(char * str);
-
-static inline bool isValidateRMSDBond(char * str);
-
-/* Assumes that str contains a single floating point number and */
-/* returns it as a float. NO ERROR CHECKING */
-/* Must be passed a null terminating string */
-/* Wrote specifically to parse strings returned from getNextWord */
-static float stringToFloat(char * str);
-
-/* Takes a string str and finds the next word starting from pos*/
-/* word must be allocated and suffiently large, does NO ERROR CHECKING */
-/* After returning, word will contain the next word and pos will be updated */
-/* to point to the current position in str */
-static void getNextWord(char * str, void * word, int& pos);
-
-/* Takes a string str and finds the next word starting from pos*/
-/* word must be allocated and suffiently large, does NO ERROR CHECKING */
-/* After returning, word will contain the next word and pos will be updated */
-/* to point to the current position in str */
-static void skipNextWord(char * str, void * word, int& pos);
-
-/* Returns a unique int id for an atom based on the chain and resid */
-static inline int getUniqueResID(char * chainstr, int resid);
-
-static void initCharToNum();
-
-#define WB_SIZE 1024
-
-#if 0 
-static const char atomSiteHeader[] =
-  "loop_\n"
-  "_atom_site.group_PDB\n"
-  "_atom_site.id\n"
-  "_atom_site.type_symbol\n"
-  "_atom_site.label_atom_id\n"
-  "_atom_site.label_alt_id\n"
-  "_atom_site.label_comp_id\n"
-  "_atom_site.label_asym_id\n"
-  "_atom_site.label_entity_id\n"
-  "_atom_site.label_seq_id\n"
-  "_atom_site.pdbx_PDB_ins_code\n"
-  "_atom_site.Cartn_x\n"
-  "_atom_site.Cartn_y\n"
-  "_atom_site.Cartn_z\n"
-  "_atom_site.occupancy\n"
-  "_atom_site.B_iso_or_equiv\n"
-  "_atom_site.Cartn_x_esd\n"
-  "_atom_site.Cartn_y_esd\n"
-  "_atom_site.Cartn_z_esd\n"
-  "_atom_site.occupancy_esd\n"
-  "_atom_site.B_iso_or_equiv_esd\n"
-  "_atom_site.pdbx_formal_charge\n"
-  "_atom_site.auth_seq_id\n"
-  "_atom_site.auth_comp_id\n"
-  "_atom_site.auth_asym_id\n"
-  "_atom_site.auth_atom_id\n"
-  "_atom_site.pdbx_PDB_model_num\n";
-#endif
-
-
-static const char atomSiteHeader[] =
-  "loop_\n"
-  "_atom_site.group_PDB\n"
-  "_atom_site.id\n"
-  "_atom_site.type_symbol\n"
-  "_atom_site.label_atom_id\n"
-  "_atom_site.label_alt_id\n"
-  "_atom_site.label_comp_id\n"
-  "_atom_site.label_asym_id\n"
-  "_atom_site.label_entity_id\n"
-  "_atom_site.label_seq_id\n"
-  "_atom_site.pdbx_PDB_ins_code\n"
-  "_atom_site.Cartn_x\n"
-  "_atom_site.Cartn_y\n"
-  "_atom_site.Cartn_z\n"
-  "_atom_site.occupancy\n"
-  "_atom_site.pdbx_formal_charge\n"
-  "_atom_site.auth_asym_id\n";
-
-
-typedef struct pdbxWriter {
-  FILE* fd;
-  char writeBuf[WB_SIZE];
-  char pdbName[256];
-  int bufferCount;
-  molfile_atom_t* atoms;
-  const float* coordinates;
-  int numatoms;
-} pdbxWriter;
-
-static void writeBuffer(pdbxWriter* writer);
-static void writeIntro(pdbxWriter* writer);
-static void write(const char* str, pdbxWriter* writer);
-static void writeAtomSite(pdbxWriter* writer);
-static void close(pdbxWriter* writer);
-static pdbxWriter* create_pdbxWriter(const char* filename, int numAtoms);
-static void addAtoms(const molfile_atom_t* atoms, int optflags, pdbxWriter* writer);
-static void addCoordinates(const float* coords, pdbxWriter* writer);
-static void writeFile(pdbxWriter* writer);
-
-// class implementation 
-
-static pdbxParser* create_pdbxParser(const char* filepath) {
-  pdbxParser* parser = new pdbxParser;
-  char buffer[BUFFER_SIZE];
-  int numberAtoms;
-  parser->xyz = NULL;
-  parser->hashMem = NULL;
-  parser->chain_auth = NULL;
-  parser->resid_auth = NULL;
-  parser->type_auth = NULL;
-  parser->error = false;
-  parser->bondsTo = NULL;
-  parser->bondsFrom = NULL;
-  parser->file = fopen(filepath, "r");
-  if (!parser->file) {
-    printf("pdbxplugin) cannot open file %s\n", filepath);
-    return NULL;
-  }
-  if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-    printf("pdbxplugin) cannot read file %s\n", filepath);
-    return NULL;
-  }
-
-  /* Find the number of atoms */
-  parser->natoms = parseNumberAtoms(parser);
-  numberAtoms = parser->natoms;
-  if (parser->natoms <= 0) {
-    printf("pdbxplugin) Could not get atom number\n");
-    return NULL;
-  }
-  initCharToNum();
-  parser->xyz = new float[numberAtoms*3];
-  parser->hashMem = new list_node[numberAtoms+1];
-  parser->chain_auth = new char[numberAtoms*CHAIN_SIZE];
-  parser->resid_auth = new int [numberAtoms];
-  parser->type_auth = new char[numberAtoms * TYPE_SIZE];
-  return parser;
-}
-
-void delete_pdbxParser(pdbxParser* parser) {
-  fclose(parser->file);
-  if (parser->xyz != NULL) {
-    delete [] parser->xyz;
-    parser->xyz = NULL;
-  }
-  if (parser->type_auth != NULL) {
-    delete [] parser->type_auth;
-    parser->type_auth = NULL;
-  }
-  if (parser->resid_auth != NULL) {
-    delete [] parser->resid_auth;
-    parser->resid_auth = NULL;
-  }
-  if (parser->hashMem != NULL) {
-    delete [] parser->hashMem;
-    parser->hashMem = NULL;
-  }
-  if (parser->chain_auth != NULL) {
-    delete [] parser->chain_auth;
-    parser->chain_auth = NULL;
-  }
-  if (parser->type_auth != NULL) {
-    inthash_destroy(&parser->bondHash);
-  }
-}
-
-static void skipNextWord(char * str, void * word, int& pos) {
-  /* Handle case if we start at end of line */
-  if (str[pos] == '\0' || str[pos] == '\n') {
-    return;
-  }
-  /* move forward until we hit non-whitespace */
-  while(str[pos] == ' ') {
-    ++pos;
-  }
-  /* increment pos until we hit a whitespace */
-  while (str[pos++] != ' ') {}
-}
-
-static void getNextWord(char * str, void * word, int& pos) {
-  char * w = (char*) word;
-  int wordpos = 0;
-  /* Handle case if we start at end of line */
-  if (str[pos] == '\0' || str[pos] == '\n') {
-    return;
-  }
-  /* move forward until we hit non-whitespace */
-  while(str[pos] == ' ') {
-    ++pos;
-  }
-  /* increment pos until we hit a whitespace */
-  while (str[pos] != ' ') {
-    w[wordpos++] = str[pos++];
-  }
-  w[wordpos] = '\0';
-  /* Increment pos to point to first char that has not been read */
-  ++pos;
-}
-
-static float stringToFloat(char * str) {
-  bool neg = (str[0] == '-');
-  unsigned int total = 0;
-  unsigned pos = neg ? 1 : 0;
-  unsigned int num = 0;
-  unsigned int denom = 1;
-  float retval;
-  /* calculate integer before the decimal */
-  while (str[pos] != '.') {
-    total = (total*10) + str[pos] - '0';
-    ++pos;
-  }
-  ++pos;
-  /* Find the fraction representing the decimal */
-  while (str[pos] != '\0') {
-    num = (num * 10) + str[pos] - '0';
-    denom *= 10;
-    ++pos;
-  }
-  retval = (float)total + (double)num/(double)denom;
-  if (neg)
-    retval *= -1;
-  return retval;
-}
-
-static int parseNumberAtoms(pdbxParser* parser) {
-  char buffer[BUFFER_SIZE];
-  char wordbuffer[64];
-  int numatoms = 0;
-  int i;
-  int tableSize = 0;
-
-  // skip past junk at start of file, stop when we get to atomSite data
-  while (NULL == strstr(buffer, "_atom_site.")) {
-    // if this is true then we couldnt find the numatoms
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file))
-      return -1;
-  }
-
-  while (!(NULL == strstr(buffer, "_atom_site."))) {
-    sscanf(buffer+11, "%s", wordbuffer); // table is used in parseStructure too
-    /* assign integer values to each column */
-    if (0 == strcmp(wordbuffer, "id")) {
-      parser->table[tableSize] = COLUMN_NUMBER;
-    } else if (0 == strcmp(wordbuffer, "type_symbol")) {
-      parser->table[tableSize] = COLUMN_NAME;
-    } else if (0 == strcmp(wordbuffer, "label_comp_id")) {
-      parser->table[tableSize] = COLUMN_RESNAME;
-    } else if (0 == strcmp(wordbuffer, "label_asym_id")) {
-      parser->table[tableSize] = COLUMN_CHAIN;
-    } else if (0 == strcmp(wordbuffer, "auth_asym_id")) {
-      parser->table[tableSize] = COLUMN_CHAIN_AUTH;
-    } else if (0 == strcmp(wordbuffer, "Cartn_x")) {
-      parser->table[tableSize] = COLUMN_X;
-    } else if (0 == strcmp(wordbuffer, "Cartn_y")) {
-      parser->table[tableSize] = COLUMN_Y;
-    } else if (0 == strcmp(wordbuffer, "Cartn_z")) {
-      parser->table[tableSize] = COLUMN_Z;
-    } else if (0 == strcmp(wordbuffer, "label_seq_id")) {
-      parser->table[tableSize] = COLUMN_RESID;
-    } else if (0 == strcmp(wordbuffer, "auth_seq_id")) {
-      parser->table[tableSize] = COLUMN_RESID_AUTH;
-    } else if (0 == strcmp(wordbuffer, "pdbx_PDB_ins_code")) {
-      parser->table[tableSize] = COLUMN_INSERTION;
-    } else if (0 == strcmp(wordbuffer, "B_iso_or_equiv")) {
-      parser->table[tableSize] = COLUMN_BFACTOR;
-    } else if (0 == strcmp(wordbuffer, "occupancy")) {
-      parser->table[tableSize] = COLUMN_OCCUPANCY;
-    } else if (0 == strcmp(wordbuffer, "label_atom_id")) {
-      parser->table[tableSize] = COLUMN_TYPE;
-    } else if (0 == strcmp(wordbuffer, "auth_atom_id")) {
-      parser->table[tableSize] = COLUMN_TYPE_AUTH;
-    } else if (0 == strcmp(wordbuffer, "pdbx_formal_charge")) {
-      parser->table[tableSize] = COLUMN_CHARGE;
-    } else {
-      parser->table[tableSize] = COLUMN_JUNK;
-    }
-
-    // if this is true then we couldnt find the numatoms
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file))
-      return -1;
-
-    tableSize++;
-  }
-
-  // increment numatoms until we get to the end of the file
-  while (buffer[0] != '#') {
-    // if this is true then we couldnt find the numatoms
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file))
-      return -1;
-    ++numatoms;
-  }
-
-  rewind(parser->file);
-  /* Cut off any junk columns from the end of table */
-
-  i = tableSize;
-  while(parser->table[--i] == COLUMN_JUNK){}
-  tableSize = i+1;
-  parser->tableSize = tableSize;
-
-  if (numatoms == 0) {
-    printf("pdbxplugin) Could not parse atom number from file\n");
-    return -1;
-  }
-
-  return numatoms;
-}
-
-
-static void initCharToNum() {
-  int i;
-  int j = 1;
-
-  for (i=0; i<128; i++)
-    charToNum[i] = -1;
-
-  i = 'A';
-  while (i <= 'Z')
-    charToNum[i++] = j++;
-  i = 'a';
-  while (i <= 'z')
-    charToNum[i++] = j++;
-  i = '0';
-  while (i <= '9')
-    charToNum[i++] = j++;
-}
-
-
-static inline int getUniqueResID(char * chainstr, int resid) {
-  int i, uid;
-  int length = strlen(chainstr);
-  // Assuming max length of chainstr is 3 chars
-  //Each char can be respresented by <= 6 bits since only a-z, A-Z, and 0-9 are valid values (62 possible values)
-  uid = 1 + charToNum[(int)chainstr[0]];
-  uid <<= 6;
-
-  if (length == 1) {
-    uid <<= 12;
-  } else if (length == 2) {
-    uid += charToNum[(int)chainstr[1]];
-    uid <<= 12;
-  } else if (length == 3) {
-    uid += charToNum[(int)chainstr[1]];
-    uid = (uid << 6) + charToNum[(int) chainstr[2]];
-    uid <<= 6;
-  }
-
-  // First 18 bits of uid dedicated to 3 letters of chainstr
-  uid <<= 12;
-  uid += (0xFFF & resid); //add 12 least significant bits of resid to fill the remaining 10 bits of uid
-
-  return uid;
-}
-
-
-
-#define ATOM_TYPE      0
-#define ATOM_RESNAME   1
-#define ATOM_INSERTION 2
-#define ATOM_CHAIN     3
-#define MAX_COLUMNS    64
-#define MAX_OPTIONAL_AUTH_FIELDS  2
-
-#define FLAG_CHAIN_LENGTH 0x01
-#define FLAG_CHARGE       0x02
-#define FLAG_INSERTION    0x04
-#define FLAG_BFACTOR      0x08
-#define FLAG_OCCUPANCY    0x10
-
-static int parseStructureFaster(molfile_atom_t * atoms, int * optflags, pdbxParser* parser) {
-  int i, count, atomdata, pos, idx, xyzcount, j;
-  char buffer[BUFFER_SIZE];
-  char namebuffer[8];
-  char occupancybuffer[16];
-  char bfactorbuffer[16];
-  char chargebuffer[16];
-  char residbuffer[8];
-  char residAuthbuffer[8];
-  char chainbuffer[16];
-  char trash[16];
-  char xbuffer[16];
-  char ybuffer[16];
-  char zbuffer[16];
-  void * pillars[MAX_COLUMNS];
-  molfile_atom_t * atom;
-  int badptecount = 0;
-  int chargecount = 0;
-  int occupancycount = 0;
-  int bfactorcount = 0;
-  char oldChain[8];
-  unsigned char parseFlags = 0;
-  chainbuffer[1] = '\0';
-  chainbuffer[2] = '\0';
-  int hashTemp;
-  int hashCount = 1;
-  int head;
-  int chainAuthIdx = MAX_COLUMNS-1, typeIdx = MAX_COLUMNS-1, resnameIdx = MAX_COLUMNS-1;
-  int insertionIdx = MAX_COLUMNS-1, typeAuthIdx = MAX_COLUMNS-1;
-#if (vmdplugin_ABIVERSION >= 20)
-  int chainIdx = MAX_COLUMNS-1;
-#endif
-  char * chainAuth = parser->chain_auth;
-  char * typeAuth = parser->type_auth;
-  int tableSize = parser->tableSize;
-  int* table = parser->table;
-  unsigned char doBonds = 0;
-
-  /* Initialize hash table used later when reading the special bonds */
-  inthash_init(&parser->bondHash, parser->natoms);
-
-  for (i=0; i<tableSize; i++) {
-    switch (table[i]) {
-      case COLUMN_NUMBER:
-        pillars[i] = trash;
-      break;
-      case COLUMN_NAME:
-        pillars[i] = namebuffer;
-      break;
-      case COLUMN_TYPE:
-        pillars[i] = atoms->type;
-        typeIdx = i;
-      break;
-      case COLUMN_TYPE_AUTH:
-        pillars[i] = typeAuth;
-        typeAuthIdx = i;
-      break;
-      case COLUMN_RESNAME:
-        pillars[i] = atoms->resname;
-        resnameIdx = i;
-      break;
-      case COLUMN_RESID:
-        pillars[i] = residbuffer;
-      break;
-      case COLUMN_RESID_AUTH:
-        pillars[i] = residAuthbuffer;
-        doBonds++;
-      break;
-      case COLUMN_INSERTION:
-        pillars[i] = atoms->insertion;
-        insertionIdx = i;
-      break;
-      case COLUMN_X:
-        pillars[i] = xbuffer;
-      break;
-      case COLUMN_Y:
-        pillars[i] = ybuffer;
-      break;
-      case COLUMN_Z:
-        pillars[i] = zbuffer;
-      break;
-      case COLUMN_OCCUPANCY:
-        pillars[i] = occupancybuffer;
-      break;
-      case COLUMN_BFACTOR:
-        pillars[i] = bfactorbuffer;
-      break;
-      case COLUMN_CHARGE:
-        pillars[i] = chargebuffer;
-      break;
-      case COLUMN_CHAIN:
-#if (vmdplugin_ABIVERSION < 20)
-        pillars[i] = chainbuffer;
-#else
-        pillars[i] = atoms->chain;
-        chainIdx = i;
-#endif
-      break;
-      case COLUMN_CHAIN_AUTH:
-        pillars[i] = chainAuth;
-        chainAuthIdx = i;
-        doBonds++;
-      break;
-      default:
-        pillars[i] = trash;
-      break;
-    }
-  }
-
-  /* If the two optional auth fields are not present, don't look for extra bonds */
-  if (doBonds != MAX_OPTIONAL_AUTH_FIELDS) {
-    doBonds = 0;
-  }
-
-  atomdata = 0;
-  /* Start parsing     */
-  /* Skip through junk */
-  while (!atomdata) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) failure while reading file\n");
-      parser->error = true;
-      return -1;
-    }
-    if (!(NULL == strstr(buffer, "_atom_site.")))
-      atomdata = 1;
-  }
-
-  /* Skip through the atomdata table declaration*/
-  while (atomdata) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) failure while reading file\n");
-      parser->error = true;
-      return -1;
-    }
-    if (NULL == strstr(buffer, "_atom_site."))
-      atomdata = 0;
-  }
-
-  count = 0;
-  atom = atoms;
-  do {
-    pos = 0;
-    for (i=0; i<tableSize; ++i) {
-      if (table[i] == COLUMN_JUNK) {
-        /* if we don't want this column, update pos to point to the next column */
-        skipNextWord(buffer, buffer, pos);
-      }
-      else {
-        /* will copy each column string into the atom struct */
-        /* or save the string if we need to convert it */
-        getNextWord(buffer, pillars[i], pos);
-      }
-    }
-    /* Coordinates must be saved until timestep is called */
-    xyzcount = count*3;
-    /*replacing atof with stringToFloat will increase performance */
-    parser->xyz[xyzcount] = atof(xbuffer);
-    parser->xyz[xyzcount+1] = atof(ybuffer);
-    parser->xyz[xyzcount+2] = atof(zbuffer);
-
-    atom->resid = atoi(residbuffer);
-    if (doBonds && residAuthbuffer[0] != '.' && residAuthbuffer[0] != '?') {
-      parser->resid_auth[count] = atoi(residAuthbuffer);
-
-      /* add atom to hash table */
-      hashTemp = getUniqueResID(chainAuth, parser->resid_auth[count]);
-
-      if (-1 != (head = inthash_insert(&parser->bondHash, hashTemp, hashCount))) {
-        /* key already exists, so we have to "add" a node to the linked list for this residue */
-        /* Since we can't change the pointer in the hash table, we insert the node at the second
-         * position in the list
-         */
-        parser->hashMem[hashCount].next = parser->hashMem[head].next;
-        parser->hashMem[head].next = hashCount;
-      }
-      /* "add" node to list */
-      parser->hashMem[hashCount++].index = count;
-    }
-
-    // XXX replace '?' or '.' insertion codes with a NUL char 
-    // indicating an empty insertion code.
-    if (atom->insertion[0] == '?' || atom->insertion[0] == '.') {
-      atom->insertion[0] = '\0';
-    }
-
-//TODO: figure out what this conditional should be
-#if (vmdplugin_ABIVERSION < 20)
-    /* check to see if the chain length is greater than 2 */
-    if (chainbuffer[2] != '\0' && chainbuffer[1] != '\0') {
-      chainbuffer[2] = '\0';
-      parseFlags |= FLAG_CHAIN_LENGTH;
-    }
-    atom->chain[0] = chainbuffer[0];
-    atom->chain[1] = chainbuffer[1];
-#endif
-
-    /* Assign these to the pdbx_data struct */
-    if (bfactorbuffer[0] != '.' && bfactorbuffer[0] != '.') {
-      atom->bfactor = atof(bfactorbuffer);
-      ++bfactorcount;
-      parseFlags |= FLAG_BFACTOR;
-    }
-    else
-      atom->bfactor = 0.0;
-
-    if (occupancybuffer[0] != '.' && occupancybuffer[0] != '?') {
-      atom->occupancy = atof(occupancybuffer);
-      ++occupancycount;
-      parseFlags |= FLAG_OCCUPANCY;
-    }
-    else 
-      atom->occupancy = 0.0;
-
-    if (chargebuffer[0] != '.' && chargebuffer[0] != '?') {
-      atom->charge = atof(chargebuffer);
-      ++chargecount;
-      parseFlags |= FLAG_CHARGE;
-    }
-    else
-      atom->charge = 0.0;
-
-    idx = get_pte_idx_from_string(namebuffer);
-
-    /* check for parenthesis in atom type */
-    if (atom->type[0] == '"') {
-      /* only save what is inside the parenthesis */
-      i = 1;
-      while (atom->type[i] != '"') {
-        atom->type[i-1] = atom->type[i];
-        ++i;
-      }
-      atom->type[i-1] = '\0';
-    }
-    /* atom->name and atom-> are the same */
-    strcpy(atom->name, atom->type);
-
-    /* Set periodic table values */
-    if (idx) {
-      atom->atomicnumber = idx;
-      atom->mass = get_pte_mass(idx);
-      atom->radius = get_pte_vdw_radius(idx);
-    }
-    else {
-      ++badptecount;
-    }
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) failure while reading file\n");
-      parser->error = true;
-      return -1;
-    }
-
-    ++count;
-    ++atom;
-    typeAuth += TYPE_SIZE;
-    if (doBonds) {
-      chainAuth += CHAIN_SIZE;
-      pillars[chainAuthIdx] = chainAuth;
-    }
-    pillars[typeAuthIdx] = typeAuth;
-    pillars[typeIdx] = atom->type;
-    pillars[resnameIdx] = atom->resname;
-    pillars[insertionIdx] = atom->insertion;
-#if (vmdplugin_ABIVERSION >= 20)
-    pillars[chainIdx] = atom->chain;
-#endif
-  } while (buffer[0] != '#'); //do until all the atoms have been read
-
-  /* after we finish parsing, set optflags */
-#if (vmdplugin_ABIVERSION < 20)
-  if (parseFlags & FLAG_CHAIN_LENGTH) {
-    printf("pdbxplugin) WARNING: This plugin ABI does not support chain names longer than two characters. Some chain names have been truncated.\n");
-  }
-#endif
-
-  if (badptecount == 0)
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS | MOLFILE_ATOMICNUMBER;
-
-  if (parseFlags & FLAG_CHARGE)
-    *optflags |= MOLFILE_CHARGE;
-
-  if (parseFlags & FLAG_BFACTOR)
-    *optflags |= MOLFILE_BFACTOR;
-
-  if (parseFlags & FLAG_OCCUPANCY)
-    *optflags |= MOLFILE_OCCUPANCY;
-
-
-  if (badptecount > 0) {
-    printf("pdbxplugin) encountered %d bad element indices!\n", badptecount);
-    return -1;
-  }
-
-  return 0;
-}
-
-static int setCoordinatesFast(float* coords, pdbxParser* parser) {
-  int i, j;
-  j = 0;
-  for(i=0; i<parser->natoms; i++) {
-    coords[0] = parser->xyz[j];
-    coords[1] = parser->xyz[j+1];
-    coords[2] = parser->xyz[j+2];
-    coords += 3;
-    j += 3;
-  }
-  return 0;
-}
-
-#define BOND_JUNK      0
-#define BOND_NAME_1    1
-#define BOND_CHAIN_1   2
-#define BOND_RESNAME_1 3
-#define BOND_RESID_1   4
-#define BOND_NAME_2    5
-#define BOND_CHAIN_2   6
-#define BOND_RESNAME_2 7
-#define BOND_RESID_2   8
-
-static bool readAngleBonds(molfile_atom_t * atoms, pdbxParser* parser) {
-  char buffer[BUFFER_SIZE];
-  int bondTable[32];
-  char* columns[32];
-  int bondTableSize = 0;
-  int bnum = 0;
-  int i, pos, j, k;
-  int* newBondsTo, *newBondsFrom;
-  fpos_t filePos;
-  char junk[16];
-  char modelNum[8];
-  char name1[8];
-  char wordbuffer[16];
-  char name2[8];
-  char chain1[8];
-  char chain2[8];
-  char resid1buffer[8];
-  char resid2buffer[8];
-  int resid1, resid2;
-  int uid1, uid2;
-  int aIdx1, aIdx2;
-  molfile_atom_t * atom;
-
-  /* skip through the file until we find the bond information */
-  do {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      return false;
-    }
-  } while (NULL == strstr(buffer,"_pdbx_validate_rmsd_angle."));
-
-  fgetpos(parser->file, &filePos);
-
-  //if (sscanf(  return if two words in one table definition line
-
-  /* Parse table header data */
-  while (NULL != strstr(buffer,"_pdbx_validate_rmsd_angle.")) {
-    sscanf(buffer+26, "%s", wordbuffer); // table is used in parseStructure too
-    /* assign integer values to each column */
-    if (0 == strcmp(wordbuffer, "auth_atom_id_1")) {
-      columns[bondTableSize] = (char*)name1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_1")) {
-      columns[bondTableSize] = (char*)chain1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_1")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_1")) {
-      columns[bondTableSize] = (char*)resid1buffer;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_atom_id_2")) {
-      columns[bondTableSize] = (char*)name2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_2")) {
-      columns[bondTableSize] = (char*)chain2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_2")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_2")) {
-      columns[bondTableSize] = (char*)resid2buffer;
-    }
-    else {
-      columns[bondTableSize] = (char*)junk;
-    }
-    ++bondTableSize;
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-
-  }
-
-  /* figure out how many bonds are being defined */
-  while (buffer[0] != '#') {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-    ++bnum;
-  }
-
-  int test = parser->nbonds + bnum;
-  if ((newBondsTo = (int*)realloc((void*)parser->bondsTo, (parser->nbonds + bnum) * sizeof(int))) == NULL)
-    return false;
-  if ((newBondsFrom = (int*)realloc((void*)parser->bondsFrom, (parser->nbonds + bnum) * sizeof(int))) == NULL)
-    return false;
-  parser->bondsTo = newBondsTo;
-  parser->bondsFrom = newBondsFrom;
-
-  /* Skip back to the start of the bond info */
-  fsetpos(parser->file, &filePos);
-  if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-    printf("pdbxplugin) could not read bond information.\n");
-    return false;
-  }
-  /* Skip through the header */
-  while (NULL != strstr(buffer,"_pdbx_validate_rmsd_angle.")) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-  }
-
-  bnum = 0;
-  while (buffer[0] != '#') {
-    pos = 0;
-    /* copy each column of the table into the appropriate columns index */
-    for (i=0; i<bondTableSize; ++i) {
-        getNextWord(buffer, columns[i], pos);
-    }
-    resid1 = atoi(resid1buffer);
-    resid2 = atoi(resid2buffer);
-    /* get unique res ID for hash table lookup */
-    uid1 = getUniqueResID(chain1, resid1);
-    uid2 = getUniqueResID(chain2, resid2);
-    k = 0;
-
-    /* find the atoms in the hash table */
-    if ( ((uid1 = inthash_lookup(&parser->bondHash, uid1)) != -1) && ((uid2 = inthash_lookup(&parser->bondHash, uid2)) != -1) ) {
-      // because the hashtable is residue specifc, loop through 
-      // all atoms in the residue to find the correct one
-      // Find atom 1 
-      do {
-        aIdx1 = parser->hashMem[uid1].index;
-        if (strcmp(name1, parser->type_auth + aIdx1 * TYPE_SIZE) == 0 && 
-            parser->resid_auth[aIdx1] == resid1 &&
-            strcmp(chain1, parser->chain_auth + aIdx1 * CHAIN_SIZE) == 0) {
-          k++;
-          break;
-        } else {
-          uid1 = parser->hashMem[uid1].next;
-        }
-      } while (uid1 != 0); //0 indicates end of "list"
-
-      // Find atom 2
-      do {
-        aIdx2 = parser->hashMem[uid2].index;
-        if (strcmp(name2, parser->type_auth + aIdx2 * TYPE_SIZE) == 0 && 
-            parser->resid_auth[aIdx2] == resid2 &&
-            strcmp(chain2, parser->chain_auth + aIdx2 * CHAIN_SIZE) == 0) {
-          k++;
-          break;
-        } else {
-          uid2 = parser->hashMem[uid2].next;
-        }
-      } while (uid2 != 0); // 0 indicates end of "list"
-
-      if (k == 2) {
-        parser->bondsFrom[parser->nbonds + bnum] = aIdx1+1;  // vmd doesn't use 0 based index for bond info?
-        parser->bondsTo[parser->nbonds + bnum] = aIdx2+1;
-        ++bnum;
-      }
-    }
-#ifdef PDBX_DEBUG
-    else {
-      printf("^^^^Could locate bond^^^^^, %s %d\n", chain1, resid1);
-      printf("Error finding atom ");
-      if (uid1 == 0)
-        printf("1 ");
-      if (uid2 == 0)
-        printf("2");
-      printf("\n");
-    }
-#endif
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read RMSD bond deviation information.\n");
-      return false;
-    }
-  }
-
-  parser->nbonds += bnum;
-#ifdef PDBX_DEBUG
-  printf("pdbxplugin) nbonds defined: %d\n", nbonds);
-#endif
-  return (bnum == 0) ? false : true;
-}
- 
-
-static bool readRMSDBonds(molfile_atom_t * atoms, pdbxParser* parser) {
-  char buffer[BUFFER_SIZE];
-  int bondTable[32];
-  char* columns[32];
-  int bondTableSize = 0;
-  int bnum = 0;
-  int i, pos, j, k;
-  fpos_t filePos;
-  char junk[16];
-  char modelNum[8];
-  char name1[8];
-  char wordbuffer[16];
-  char name2[8];
-  char chain1[8];
-  char chain2[8];
-  char resid1buffer[8];
-  char resid2buffer[8];
-  int resid1, resid2;
-  int uid1, uid2;
-  int aIdx1, aIdx2;
-  molfile_atom_t * atom;
-
-  /* skip through the file until we find the bond information */
-  do {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      parser->nbonds = 0;
-      return false;
-    }
-  } while (!isValidateRMSDBond(buffer));
-
-  fgetpos(parser->file, &filePos);
-
-  //if (sscanf(  return if two words in one table definition line
-
-  /* Parse table header data */
-  while (isValidateRMSDBond(buffer)) {
-    sscanf(buffer+25, "%s", wordbuffer); // table is used in parseStructure too
-    /* assign integer values to each column */
-    if (0 == strcmp(wordbuffer, "auth_atom_id_1")) {
-      columns[bondTableSize] = (char*)name1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_1")) {
-      columns[bondTableSize] = (char*)chain1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_1")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_1")) {
-      columns[bondTableSize] = (char*)resid1buffer;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_atom_id_2")) {
-      columns[bondTableSize] = (char*)name2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_2")) {
-      columns[bondTableSize] = (char*)chain2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_2")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_2")) {
-      columns[bondTableSize] = (char*)resid2buffer;
-    }
-    else {
-      columns[bondTableSize] = (char*)junk;
-    }
-    ++bondTableSize;
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-    
-  }
-
-  /* figure out how many bonds are being defined */
-  while (buffer[0] != '#') {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-    ++bnum;
-  }
-
-  parser->nbonds = bnum;
-  parser->bondsTo = (int*)malloc(bnum * sizeof(int));
-  parser->bondsFrom = (int*)malloc(bnum * sizeof(int));
-
-  /* Skip back to the start of the bond info */
-  fsetpos(parser->file, &filePos);
-  if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-    printf("pdbxplugin) could not read bond information.\n");
-    return false;
-  }
-  /* Skip through the header */
-  while (isValidateRMSDBond(buffer)) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-  }
-
-  bnum = 0;
-  while (buffer[0] != '#') {
-    pos = 0;
-    /* copy each column of the table into the appropriate columns index */
-    for (i=0; i<bondTableSize; ++i) {
-        getNextWord(buffer, columns[i], pos);
-    }
-    resid1 = atoi(resid1buffer);
-    resid2 = atoi(resid2buffer);
-    /* get unique res ID for hash table lookup */
-    uid1 = getUniqueResID(chain1, resid1);
-    uid2 = getUniqueResID(chain2, resid2);
-    k = 0;
-
-    /* find the atoms in the hash table */
-    if ( ((uid1 = inthash_lookup(&parser->bondHash, uid1)) != -1) && ((uid2 = inthash_lookup(&parser->bondHash, uid2)) != -1) ) {
-      /* because the hashtable is residue specifc, loop through all atoms in the residue to find the correct one */
-      /* Find atom 1 */
-      do {
-        aIdx1 = parser->hashMem[uid1].index;
-        if (strcmp(name1, parser->type_auth + aIdx1 * TYPE_SIZE) == 0 && parser->resid_auth[aIdx1] == resid1 &&
-            strcmp(chain1, parser->chain_auth + aIdx1 * CHAIN_SIZE) == 0){
-          k++;
-          break;
-        }
-        else
-          uid1 = parser->hashMem[uid1].next;
-      } while (uid1 != 0); //0 indicates end of "list"
-
-      /* find atom 2 */
-      do {
-        aIdx2 = parser->hashMem[uid2].index;
-        if (strcmp(name2, parser->type_auth + aIdx2 * TYPE_SIZE) == 0 && parser->resid_auth[aIdx2] == resid2 &&
-            strcmp(chain2, parser->chain_auth + aIdx2 * CHAIN_SIZE) == 0){
-          k++;
-          break;
-        }
-        else
-          uid2 = parser->hashMem[uid2].next;
-      } while (uid2 != 0); // 0 indicates end of "list"
-
-      if (k == 2) {
-        parser->bondsFrom[bnum] = aIdx1+1;  // vmd doesn't use 0 based index for bond info?
-        parser->bondsTo[bnum] = aIdx2+1;
-        ++bnum;
-      }
-    }
-#ifdef PDBX_DEBUG
-    else {
-      printf("^^^^Could locate bond^^^^^, %s %d\n", chain1, resid1);
-      printf("Error finding atom ");
-      if (uid1 == 0)
-        printf("1 ");
-      if (uid2 == 0)
-        printf("2");
-      printf("\n");
-    }
-#endif
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read RMSD bond deviation information.\n");
-      return false;
-    }
-  }
-  parser->nbonds = bnum;
-#ifdef PDBX_DEBUG
-  printf("pdbxplugin) nbonds defined: %d\n", nbonds);
-#endif
-  return (bnum > 0);
-}
-
-
-static bool readBonds(molfile_atom_t * atoms, pdbxParser* parser) {
-  bool retval = false;
-  retval |= readRMSDBonds(atoms, parser);
-  retval |= readAngleBonds(atoms, parser);
-  return retval;
-}
-
-
-static inline bool isValidateRMSDBond(char * str) {
-  /* return str[0-24] == "_pdbx_validate_rmsd_bond." */
-  return (str[0] == '_' && str[1] == 'p' && str[2] == 'd' && str[3] == 'b' &&
-          str[4] == 'x' && str[5] == '_' && str[6] == 'v' && str[7] == 'a' &&
-          str[8] == 'l' && str[9] == 'i' && str[10] == 'd' && str[11] == 'a' &&
-          str[12] == 't' && str[13] == 'e' && str[14] == '_' && str[15] == 'r' &&
-          str[16] == 'm' && str[17] == 's' && str[18] == 'd' && str[19] == '_' &&
-          str[20] == 'b' && str[21] == 'o' && str[22] == 'n' && str[23] == 'd' &&
-          str[24] == '.');
-}
-
-static inline bool isAtomSite(char * str) {
-  return (str[0]=='_' && str[1]=='a' && str[2]=='t' && str[3]=='o' && str[4]=='m' &&
-          str[5]=='_' && str[6]=='s' && str[7]=='i' && str[8]=='t' && str[9]=='e' &&
-          str[10]=='.');
-}
-
-/* start of pdbxWriter implementation */
-
-static pdbxWriter* create_pdbxWriter(const char* filename, int numAtoms) {
-  pdbxWriter* writer = new pdbxWriter;
-  int length = strlen(filename);
-  int start = 0;
-  int end = length;
-  int i;
-  writer->numatoms = numAtoms;
-  writer->bufferCount = 0;
-
-  writer->fd = fopen(filename, "w");
-  /* get name of pdb file */
-  for (i=0; i<length; ++i) {
-    if (filename[i] == '/' || filename[i] == '\\') {
-      if (i+1 < length)
-        start = i+1;
-    }
-    if (filename[i] == '.')
-      end = i;
-  }
-  strncpy(writer->pdbName, filename + start, end - start);
-  writer->pdbName[end-start] = '\0';
-  return writer;
-}
-
-static void addCoordinates(const float* coords, pdbxWriter* writer) {
-  writer->coordinates = coords;
-}
-
-static void addAtoms(const molfile_atom_t* atomlist, int optflags, pdbxWriter* writer) {
-  int i;
-  writer->atoms = new molfile_atom_t[writer->numatoms];
-  molfile_atom_t* atoms = writer->atoms;
-  
-  memcpy(atoms, atomlist, writer->numatoms * sizeof(molfile_atom_t));
-
-  /* If occ, bfactor, and insertion aren't given, we assign defaultvalues. */
-  if (!(optflags & MOLFILE_OCCUPANCY)) {
-    for (i=0; i<writer->numatoms; i++)
-      atoms[i].occupancy = 0.0f;
-  }
-  if (!(optflags & MOLFILE_BFACTOR)) {
-    for (i=0; i<writer->numatoms; i++)
-      atoms[i].bfactor= 0.0f;
-  }
-  if (!(optflags & MOLFILE_INSERTION)) {
-    for (i=0; i<writer->numatoms; i++) {
-      atoms[i].insertion[0] =' ';
-      atoms[i].insertion[1] ='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ALTLOC)) {
-    for (i=0; i<writer->numatoms; i++) {
-      atoms[i].altloc[0]=' ';
-      atoms[i].altloc[1]='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ATOMICNUMBER)) {
-    for (i=0; i<writer->numatoms; i++)
-      atoms[i].atomicnumber = 0;
-  }
-}
-
-static void writeAtomSite(pdbxWriter* writer) {
-  char lineBuffer[BUFFER_SIZE];
-  int i;
-  const float* x, *y, *z;
-  molfile_atom_t* atoms = writer->atoms;
-  x = writer->coordinates;
-  y = x+1;
-  z = x+2;
-
-  for (i=0; i<writer->numatoms; ++i) {
-    sprintf(lineBuffer,"ATOM %d %s %s . %s %s . %d ? %f %f %f %f %f %s\n",
-            i+1, atoms[i].name, atoms[i].type, atoms[i].resname, atoms[i].chain,
-            atoms[i].resid, *x, *y, *z, atoms[i].occupancy,
-            atoms[i].charge, atoms[i].chain);
-    x += 3;
-    y += 3;
-    z += 3;
-    write(lineBuffer, writer);
-  }
-}
-
-
-static void writeFile(pdbxWriter* writer) {
-  /* write PDBx header */
-  writeIntro(writer);
-  write(atomSiteHeader, writer);
-  writeAtomSite(writer);
-  write("#\n", writer);
-  close(writer);
-}
-
-static void writeIntro(pdbxWriter* writer) {
-  write("data_", writer);
-  write(writer->pdbName, writer);
-  write("\n", writer);
-}
-
-static void close(pdbxWriter* writer) {
-  writeBuffer(writer);
-  fclose(writer->fd);
-}
-
-static void write(const char* str, pdbxWriter* writer) {
-  int length = strlen(str);
-  int copy_size;
-  int num_copied = 0;
-
-  if (length + writer->bufferCount < WB_SIZE) {
-    memcpy(writer->writeBuf + writer->bufferCount, str, length);
-    writer->bufferCount += length;
-  }
-  else do {
-    copy_size = WB_SIZE - writer->bufferCount;
-    if (copy_size + num_copied > length) {
-      copy_size = length - num_copied;
-    }
-    memcpy(writer->writeBuf + writer->bufferCount, str + num_copied, copy_size);
-    writer->bufferCount += copy_size;
-    num_copied += copy_size;
-    if (writer->bufferCount == WB_SIZE) {
-      writeBuffer(writer);
-    }
-  } while (num_copied < length);
-}
-
-static void writeBuffer(pdbxWriter* writer) {
-  if (writer->bufferCount == 0)
-    return;
-  fwrite(writer->writeBuf, sizeof(char), writer->bufferCount, writer->fd);
-  writer->bufferCount = 0;
-}
-
-
-/*
- * API functions start here
- */
-
-typedef struct {
-  pdbxParser * parser;
-  pdbxWriter * writer;
-  int natoms;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-  int readTS;
-} pdbx_data;
-
-
-static void * open_pdbx_read(const char *filepath, const char *filetype,
-                             int *natoms) {
-  pdbx_data *data;
-  data = new pdbx_data;
-  data->readTS = 0;
-  data->parser = create_pdbxParser(filepath);
-  data->natoms = data->parser->natoms;
-  *natoms = data->natoms;
-  if (*natoms == 0) //If no atoms were found this is not a pdb file
-    return NULL;
-  if (data->parser->error)
-    return NULL;
-  return data;
-}
-
-static int read_pdbx_structure(void * mydata, int *optflags, molfile_atom_t *atoms) {
-  pdbx_data * data = (pdbx_data *)mydata;
-  *optflags = MOLFILE_NOOPTIONS;
-#if 0
-  // XXX the current pdbx code doesn't actually throw any exceptions so the try
-  //     block causes linkage problems on Android if it is used as-is.
-  try {
-    parseStructureFaster(atoms, optflags, data->parser);
-  } catch (...) {
-    printf("pdbxplugin) Error while trying to read file\n");
-    return MOLFILE_ERROR;
-  }
-#else
-  if (parseStructureFaster(atoms, optflags, data->parser)) {
-    printf("pdbxplugin) Error while trying to parse pdbx structure\n");
-    return MOLFILE_ERROR;
-  }
-#endif
-
-  printf("pdbxplugin) Starting to read bonds...\n");
-  readBonds(atoms, data->parser);
-  *optflags |= MOLFILE_BONDSSPECIAL;
-  return MOLFILE_SUCCESS;
-}
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                      float ** bondorder,int **bondtype,
-                      int *nbondtypes, char ***bondtypename) {
-  pdbx_data * data = (pdbx_data *)v;
-  if (data->parser->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-  } else {
-    *nbonds = data->parser->nbonds;
-    *fromptr = data->parser->bondsFrom;
-    *toptr = data->parser->bondsTo;
-  }
-  *bondorder = NULL;
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_pdbx_timestep(void * mydata, int natoms, molfile_timestep_t *ts) {
-  pdbx_data * data = (pdbx_data *)mydata;
-  if (data->readTS)
-    return MOLFILE_ERROR;
-  data->readTS = 1;
-  setCoordinatesFast(ts->coords, data->parser);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pdbx_read(void *v) {
-  pdbx_data * data = (pdbx_data *)v;
-  delete_pdbxParser(data->parser);
-  delete data;
-}
-
-static void* open_file_write(const char *path, const char *filetypye, int natoms) {
-  FILE* fd;
-  pdbx_data * data = new pdbx_data;
-  data->writer = create_pdbxWriter(path, natoms);
-  return data;
-}
-
-static int write_structure(void* v, int optflags, const molfile_atom_t *atoms) {
-  pdbx_data * data = (pdbx_data *)v;
-  addAtoms(atoms, optflags, data->writer);
-  return MOLFILE_SUCCESS;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t* ts) {
-  pdbx_data * data = (pdbx_data *)v;
-  addCoordinates(ts->coords, data->writer);
-  writeFile(data->writer);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_file_write(void* v) {
-  pdbx_data* data = (pdbx_data*)v;
-  delete data->writer;
-  delete data;
-}
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pdbx";
-  plugin.prettyname = "mmCIF/PDBX";
-  plugin.author = "Brendan McMorrow";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cif";
-  plugin.open_file_read = open_pdbx_read;
-  plugin.read_structure = read_pdbx_structure;
-  plugin.read_next_timestep = read_pdbx_timestep;
-  plugin.read_bonds = read_bonds;
-  plugin.open_file_write = open_file_write;
-  plugin.write_structure = write_structure;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  plugin.close_file_read = close_pdbx_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  pdbx_data *v;
-  int natoms, bnum, nbtypes;
-  float *border[1];
-  float *x, *y, *z;
-  int *btype[1];
-  char **btypenames[1];
-  int i, set;
-
-//  while (--argc) {
-    ++argv;
-
-  struct timeval  tot1, tot2;
-  gettimeofday(&tot1, NULL);
-    if (*argv != NULL)
-      v = (pdbx_data*)open_pdbx_read(*argv, "pdbx", &natoms);
-    else
-   //   v = (pdbx_data*)open_pdbx_read("/Users/Brendan/pdbx/3j3q.cif", "pdbx", &natoms);
-      v = (pdbx_data*)open_pdbx_read("/home/brendanbc1/Downloads/3j3q.cif", "pdbx", &natoms);
-    if (!v) {
-      fprintf(stderr, "main) open_pdbx_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "main) open_pdbx_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "main) number of atoms: %d\n", natoms);
-
-    set = 0;
-    molfile_atom_t * atoms = new molfile_atom_t[natoms];
-    if (MOLFILE_SUCCESS == read_pdbx_structure(v, &set, atoms)){
-      printf("xyz structure successfully read.\n");
-    } else {
-      fprintf(stderr, "main) error reading pdbx file\n");
-    }
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    if (!read_pdbx_timestep(v, natoms, &timestep)) {
-      fprintf(stderr, "main) open_pdbx_read succeeded for file %s\n", *argv);
-    } else {
-      fprintf(stderr, "main) Failed to read timestep\n");
-    }
-
-    gettimeofday(&tot2, NULL);
-    printf ("Total time to read file: %f seconds\n",
-           (double) (tot2.tv_usec - tot1.tv_usec) / 1000000 +
-           (double) (tot2.tv_sec - tot1.tv_sec));
-    close_pdbx_read(v);
-
-
-    printf("Writing file...\n");
-    v = (pdbx_data*)open_file_write("/home/brendanbc1/test.cif", 0, natoms);
-
-    //v = (pdbx_data*)open_file_write("/Users/Brendan/test.cif", 0, natoms);
-    printf("File opened for writing...\n");
-    //printf("%d\n", v->writer->numatoms);
-    write_structure(v, set, (const molfile_atom_t*)atoms);
-    printf("Structure information gathered...\n");
-    write_timestep(v, &timestep);
-    printf("File written...\n");
-    close_file_write(v);
-    printf("File closed.\n");
-    delete [] atoms;
-         /*
-    printf("Writing pdbx.txt\n");
-    x = timestep.coords; y = x+1;
-    z = x+2;
-    FILE *f;
-    f = fopen("pdbx.txt", "w");
-    for(i=0; i<natoms; i++) {
-      fprintf(f, "%i %d %s %s %s %f %f %f\n", atoms[i].atomicnumber, atoms[i].resid, atoms[i].chain, atoms[i].resname, atoms[i].type, *x,*y,*z);
-      //fprintf(stderr, "%i\t%s  %s\t%s  %s  %i  %f\t%f\t%f\t%f\t%f\t%f\n", i+1, atoms[i].name, atoms[i].type,
-        //      atoms[i].chain, atoms[i].resname, atoms[i].resid, *x, *y, *z, atoms[i].occupancy, atoms[i].bfactor, atoms[i].charge);
-      x+=3;
-      y+=3;
-      z+=3;
-    }
-    fclose(f);
-    printf("main) pdbx.txt written\n");
- // }
- */
-  return 0;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/periodic_table.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/periodic_table.h
deleted file mode 100644
index 36f9e5a902e77ba9a428ddb6b370484476c3145f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/periodic_table.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: periodic_table.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.12 $       $Date: 2009/01/21 17:45:41 $
- *
- ***************************************************************************/
-
-/*
- * periodic table of elements and helper functions to convert
- * ordinal numbers to labels and back.
- * all tables and functions are declared static, so that it
- * can be safely included by all plugins that may need it.
- *
- * 2002-2009 akohlmey@cmm.chem.upenn.edu, vmd@ks.uiuc.edu
- */
-
-#include <string.h>
-#include <ctype.h>
-
-/* periodic table of elements for translation of ordinal to atom type */
-static const char *pte_label[] = { 
-    "X",  "H",  "He", "Li", "Be", "B",  "C",  "N",  "O",  "F",  "Ne",
-    "Na", "Mg", "Al", "Si", "P" , "S",  "Cl", "Ar", "K",  "Ca", "Sc",
-    "Ti", "V",  "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", 
-    "As", "Se", "Br", "Kr", "Rb", "Sr", "Y",  "Zr", "Nb", "Mo", "Tc",
-    "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I",  "Xe",
-    "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb",
-    "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W",  "Re", "Os",
-    "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr",
-    "Ra", "Ac", "Th", "Pa", "U",  "Np", "Pu", "Am", "Cm", "Bk", "Cf",
-    "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt",
-    "Ds", "Rg"
-};
-static const int nr_pte_entries = sizeof(pte_label) / sizeof(char *);
-
-/* corresponding table of masses. */
-static const float pte_mass[] = { 
-    /* X  */ 0.00000, 1.00794, 4.00260, 6.941, 9.012182, 10.811,  
-    /* C  */ 12.0107, 14.0067, 15.9994, 18.9984032, 20.1797, 
-    /* Na */ 22.989770, 24.3050, 26.981538, 28.0855, 30.973761,
-    /* S  */ 32.065, 35.453, 39.948, 39.0983, 40.078, 44.955910,
-    /* Ti */ 47.867, 50.9415, 51.9961, 54.938049, 55.845, 58.9332,
-    /* Ni */ 58.6934, 63.546, 65.409, 69.723, 72.64, 74.92160, 
-    /* Se */ 78.96, 79.904, 83.798, 85.4678, 87.62, 88.90585, 
-    /* Zr */ 91.224, 92.90638, 95.94, 98.0, 101.07, 102.90550,
-    /* Pd */ 106.42, 107.8682, 112.411, 114.818, 118.710, 121.760, 
-    /* Te */ 127.60, 126.90447, 131.293, 132.90545, 137.327, 
-    /* La */ 138.9055, 140.116, 140.90765, 144.24, 145.0, 150.36,
-    /* Eu */ 151.964, 157.25, 158.92534, 162.500, 164.93032, 
-    /* Er */ 167.259, 168.93421, 173.04, 174.967, 178.49, 180.9479,
-    /* W  */ 183.84, 186.207, 190.23, 192.217, 195.078, 196.96655, 
-    /* Hg */ 200.59, 204.3833, 207.2, 208.98038, 209.0, 210.0, 222.0, 
-    /* Fr */ 223.0, 226.0, 227.0, 232.0381, 231.03588, 238.02891,
-    /* Np */ 237.0, 244.0, 243.0, 247.0, 247.0, 251.0, 252.0, 257.0,
-    /* Md */ 258.0, 259.0, 262.0, 261.0, 262.0, 266.0, 264.0, 269.0,
-    /* Mt */ 268.0, 271.0, 272.0
-};
-
-/*
- * corresponding table of VDW radii.
- * van der Waals radii are taken from A. Bondi, 
- * J. Phys. Chem., 68, 441 - 452, 1964, 
- * except the value for H, which is taken from R.S. Rowland & R. Taylor, 
- * J.Phys.Chem., 100, 7384 - 7391, 1996. Radii that are not available in 
- * either of these publications have RvdW = 2.00 Ã….
- * The radii for Ions (Na, K, Cl, Ca, Mg, and Cs are based on the CHARMM27 
- * Rmin/2 parameters for (SOD, POT, CLA, CAL, MG, CES) by default.
- */
-static const float pte_vdw_radius[] = { 
-    /* X  */ 1.5, 1.2, 1.4, 1.82, 2.0, 2.0,  
-    /* C  */ 1.7, 1.55, 1.52, 1.47, 1.54, 
-    /* Na */ 1.36, 1.18, 2.0, 2.1, 1.8,
-    /* S  */ 1.8, 2.27, 1.88, 1.76, 1.37, 2.0,
-    /* Ti */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Ni */ 1.63, 1.4, 1.39, 1.07, 2.0, 1.85,
-    /* Se */ 1.9, 1.85, 2.02, 2.0, 2.0, 2.0, 
-    /* Zr */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Pd */ 1.63, 1.72, 1.58, 1.93, 2.17, 2.0, 
-    /* Te */ 2.06, 1.98, 2.16, 2.1, 2.0,
-    /* La */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Eu */ 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Er */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* W  */ 2.0, 2.0, 2.0, 2.0, 1.72, 1.66,
-    /* Hg */ 1.55, 1.96, 2.02, 2.0, 2.0, 2.0, 2.0,
-    /* Fr */ 2.0, 2.0, 2.0, 2.0, 2.0, 1.86,
-    /* Np */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Md */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Mt */ 2.0, 2.0, 2.0
-};
-
-/* lookup functions */
-
-static const char *get_pte_label(const int idx)
-{
-    if ((idx < 1) || (idx >= nr_pte_entries)) return pte_label[0];
-
-    return pte_label[idx];
-}
-
-static float get_pte_mass(const int idx)
-{
-    if ((idx < 1) || (idx >= nr_pte_entries)) return pte_mass[0];
-
-    return pte_mass[idx];
-}
-
-static float get_pte_vdw_radius(const int idx)
-{
-    if ((idx < 1) || (idx >= nr_pte_entries)) return pte_vdw_radius[0];
-
-#if 1
-    /* Replace with Hydrogen radius with an "all-atom" radius */
-    if (idx == 1)
-      return 1.0;    /* H  */
-#else
-    /* Replace with old VMD atom radii values */
-    switch (idx) {
-      case  1: return 1.0;    /* H  */
-      case  6: return 1.5;    /* C  */
-      case  7: return 1.4;    /* N  */
-      case  8: return 1.3;    /* O  */
-      case  9: return 1.2;    /* F  */
-      case 15: return 1.5;    /* P  */
-      case 16: return 1.9;    /* S  */ 
-    }
-#endif
-
-    return pte_vdw_radius[idx];
-}
-
-static int get_pte_idx(const char *label)
-{
-    int i;
-    char atom[3];
-    
-    /* zap string */
-    atom[0] = (char) 0;
-    atom[1] = (char) 0;
-    atom[2] = (char) 0;
-    /* if we don't have a null-pointer, there must be at least two 
-     * chars, which is all we need. we convert to the capitalization 
-     * convention of the table above during assignment. */
-    if (label != NULL) {
-        atom[0] = (char) toupper((int) label[0]);
-        atom[1] = (char) tolower((int) label[1]);
-    }
-    /* discard numbers in atom label */
-    if (isdigit(atom[1])) atom[1] = (char) 0;
-    
-    for (i=0; i < nr_pte_entries; ++i) {
-        if ( (pte_label[i][0] == atom[0])
-             && (pte_label[i][1] == atom[1]) ) return i;
-    }
-    
-    return 0;
-}
-
-static int get_pte_idx_from_string(const char *label) {
-  int i, ind;
-  char atom[3];
-
-  if (label != NULL) {
-    /* zap string */
-    atom[0] = atom[1] = atom[2] = '\0';
-
-    for (ind=0,i=0; (ind<2) && (label[i]!='\0'); i++) {
-      if (label[i] != ' ') {
-        atom[ind] = toupper(label[i]);
-        ind++;
-      }
-    }
-
-    if (ind < 1)
-      return 0; /* no non-whitespace characters */
- 
-    for (i=0; i < nr_pte_entries; ++i) {
-      if ((toupper(pte_label[i][0]) == atom[0]) && (toupper(pte_label[i][1]) == atom[1])) 
-        return i;
-    }
-  }  
-
-  return 0;
-}
-
-#if 0
-#include <stdio.h>
-
-int main() {
-  int i;
-
-  printf("Periodic table check/dump\n");
-  printf("  Table contains data for %d elements\n", nr_pte_entries);
-  printf("   Mass table size check: %d\n", sizeof(pte_mass) / sizeof(float));
-  printf("    VDW table size check: %d\n", sizeof(pte_vdw_radius) / sizeof(float));
-  printf("\n");
-  printf("Symbol Num    Mass   rVDW\n");
-  for (i=0; i<nr_pte_entries; i++) {
-    printf("   %-2s  %3d  %6.2f  %4.2f\n",
-      get_pte_label(i), i, get_pte_mass(i), get_pte_vdw_radius(i));
-  } 
-  return 0;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/phiplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/phiplugin.C
deleted file mode 100644
index ffc7282aca64da52fca6e6655fc52578576ac6b4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/phiplugin.C
+++ /dev/null
@@ -1,261 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: phiplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.28 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * "Formatted ASCII '.big'" potential maps from Delphi
- *   This format is created by the 'ASCIIPHI' program which was available with
- *   Delphi V3:
- *     http://www.csb.yale.edu/userguides/datamanip/delphi/manual.html#ASCIIPHI
- *
- *   More info for this format can be found at:
- *     http://www.msg.ucsf.edu/local/programs/insightII/doc/life/insight2000.1/delphi/B_Utilities.html
- * 
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int ndata;
-  molfile_volumetric_t *vol;
-} phi_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *phigets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    fprintf(stderr, "phiplugin) Unexpected end-of-file.\n");
-    returnVal = NULL; 
-  }
-  else if (ferror(stream)) {
-    fprintf(stderr, "phiplugin) Error reading file.\n");
-    return NULL;
-  }
-  else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      fprintf(stderr, "phiplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static void *open_phi_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  phi_t *phi;
-  char inbuf[LINESIZE];
-
-  float scale, midX, midY, midZ;
-  float cellSize, iGrid = 0.0;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "phiplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Skip the header */
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-
-  /* Unit cell information is located at the *end* of the file. */
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  while (strncasecmp(inbuf, " end of phimap", 14) != 0) {
-    /* use integer division so trailing whitespace isn't included in the
-     * count */
-    iGrid += strlen(inbuf) / 4; 
-
-    if (phigets(inbuf, LINESIZE, fd) == NULL) {
-      return NULL;
-    }
-  } 
-
-  /* Find the cube-root of the number of datapoints (this will give the
-   * number of datapoints in each direction) and make sure it's an integer
-   */
-  cellSize = pow((double) iGrid, (double) 1.0/3.0);
-  if (fabs((double)(cellSize - floor(cellSize))) > 1e-8) {
-    return NULL;
-  }
-
-  /* Read the unit cell information */
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  sscanf(inbuf, " %f %f %f %f", &scale, &midX, &midY, &midZ);
-
-  /* Allocate and initialize the phi structure */
-  phi = new phi_t;
-  phi->fd = fd;
-  phi->vol = NULL;
-  phi->ndata = (int) iGrid;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  phi->nsets = 1; /* this file contains only one data set */
-
-  phi->vol = new molfile_volumetric_t[1];
-  strcpy(phi->vol[0].dataname, "PHIMAP Electron Density Map");
-
-  /* <midX, midY, midZ> is the middle point of the grid. */
-  phi->vol[0].origin[0] = -0.5*(cellSize+1.0) / scale + midX;
-  phi->vol[0].origin[1] = -0.5*(cellSize+1.0) / scale + midY;
-  phi->vol[0].origin[2] = -0.5*(cellSize+1.0) / scale + midZ;
-
-  phi->vol[0].xaxis[0] = cellSize / scale;
-  phi->vol[0].xaxis[1] = 0;
-  phi->vol[0].xaxis[2] = 0;
-
-  phi->vol[0].yaxis[0] = 0;
-  phi->vol[0].yaxis[1] = cellSize / scale;
-  phi->vol[0].yaxis[2] = 0;
-  
-  phi->vol[0].zaxis[0] = 0;
-  phi->vol[0].zaxis[1] = 0;
-  phi->vol[0].zaxis[2] = cellSize / scale;
-
-  phi->vol[0].xsize = (int) cellSize;
-  phi->vol[0].ysize = (int) cellSize;
-  phi->vol[0].zsize = (int) cellSize;
-
-  phi->vol[0].has_color = 0;
-
-  return phi;
-}
-
-static int read_phi_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  phi_t *phi = (phi_t *)v;
-  *nsets = phi->nsets; 
-  *metadata = phi->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_phi_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  phi_t *phi = (phi_t *)v;
-  float *cellIndex;
-  int value, ndata, count = 0;
-  FILE *fd = phi->fd;
-  char inbuf[LINESIZE], currNum[5], *currChar;
-
-  cellIndex = datablock;
-  ndata = phi->ndata;
-  memset(currNum, 0, 5);
-
-  /* Skip the header */
-  rewind(fd);
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return MOLFILE_ERROR;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return MOLFILE_ERROR;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return MOLFILE_ERROR;
-  }
-
-  /* Read the densities. Order for file is x fast, y medium, z slow */
-  while (count < ndata) {
-    if (phigets(inbuf, LINESIZE, fd) == NULL) {
-      return MOLFILE_ERROR;
-    }
-
-    for (currChar = inbuf; (*currChar != '\n') && (*currChar != '\0'); 
-         currChar += 4) {
-      strncpy(currNum, currChar, 4);
-      value = atoi(currNum);
-      /* Scale -- units are in kT/e (25.6mV, 0.593 kcal/mole at 25°C). */
-      *cellIndex = 0.01 * (value - 5000);
-      cellIndex++;
-      count++;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_phi_read(void *v) {
-  phi_t *phi = (phi_t *)v;
-
-  fclose(phi->fd);
-  if (phi->vol != NULL)
-    delete [] phi->vol; 
-  delete phi;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "delphibig";
-  plugin.prettyname = "Delphi 'Big' Formatted Potential Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "big";
-  plugin.open_file_read = open_phi_read;
-  plugin.read_volumetric_metadata = read_phi_metadata;
-  plugin.read_volumetric_data = read_phi_data;
-  plugin.close_file_read = close_phi_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pltplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pltplugin.C
deleted file mode 100644
index 27f45ac6a24caae84c329ff79488190c3230bfc7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pltplugin.C
+++ /dev/null
@@ -1,187 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pltplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * plt format electron density maps from gOpenMol.
- *
- * More info for format can be found at 
- * <http://www.csc.fi/gopenmol/developers/plt_format.phtml>
- * 
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int swap;
-  molfile_volumetric_t *vol;
-} plt_t;
-
-
-static void *open_plt_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  plt_t *plt;
-  int swap=0;
-  // File header data:
-  int intHeader[5];
-  float floatHeader[6];
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "pltplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // Integer header info: rank (always 3), surface type, z length, y length, 
-  // x length.
-  fread(intHeader, sizeof(int), 5, fd);
-  if (intHeader[0] != 3) {
-    // check if the bytes need to be swapped
-    swap4_aligned(intHeader, 5);
-    if (intHeader[0] == 3) 
-      swap = 1;
-    else {
-      fprintf(stderr, "pltplugin) Incorrect header.\n");
-      return NULL;
-    }
-  }
-
-  // Float header info: z min, z max, y min, y max, xmin, x max.
-  fread(floatHeader, sizeof(float), 6, fd);
-  if (swap)
-    swap4_aligned(floatHeader, 6);
-
-  // Allocate and initialize the plt structure
-  plt = new plt_t;
-  plt->fd = fd;
-  plt->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  plt->nsets = 1; // this file contains only one data set
-  plt->swap = swap;
-
-  plt->vol = new molfile_volumetric_t[1];
-  strcpy(plt->vol[0].dataname, "PLT Electron Density Map");
-
-  // Best guesses for unit cell information, as none is included in the plt
-  // file format.
-  plt->vol[0].origin[0] = floatHeader[4];
-  plt->vol[0].origin[1] = floatHeader[2];
-  plt->vol[0].origin[2] = floatHeader[0];
-
-  plt->vol[0].xaxis[0] = floatHeader[5] - floatHeader[4];
-  plt->vol[0].xaxis[1] = 0;
-  plt->vol[0].xaxis[2] = 0;
-
-  plt->vol[0].yaxis[0] = 0;
-  plt->vol[0].yaxis[1] = floatHeader[3] - floatHeader[2];
-  plt->vol[0].yaxis[2] = 0;
-  
-  plt->vol[0].zaxis[0] = 0;
-  plt->vol[0].zaxis[1] = 0;
-  plt->vol[0].zaxis[2] = floatHeader[1] - floatHeader[0];
-
-  plt->vol[0].xsize = intHeader[4];
-  plt->vol[0].ysize = intHeader[3];
-  plt->vol[0].zsize = intHeader[2];
-
-  plt->vol[0].has_color = 0;
-
-  return plt;
-}
-
-static int read_plt_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  plt_t *plt = (plt_t *)v;
-  *nsets = plt->nsets; 
-  *metadata = plt->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_plt_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  plt_t *plt = (plt_t *)v;
-  int swap, ndata;
-  FILE *fd = plt->fd;
-
-  swap = plt->swap;
-  ndata = plt->vol[0].xsize * plt->vol[0].ysize * plt->vol[0].zsize;
-
-  // Read the densities. Order for file is x fast, y medium, z slow
-  if ( fread(datablock, sizeof(float), ndata, fd) != ndata ) {
-    fprintf(stderr, "pltplugin) Error reading data, not enough values read.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (swap) 
-    swap4_aligned(datablock, ndata);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_plt_read(void *v) {
-  plt_t *plt = (plt_t *)v;
-
-  fclose(plt->fd);
-  if (plt->vol != NULL)
-    delete [] plt->vol; 
-  delete plt;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "plt";
-  plugin.prettyname = "gOpenmol plt";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "plt";
-  plugin.open_file_read = open_plt_read;
-  plugin.read_volumetric_metadata = read_plt_metadata;
-  plugin.read_volumetric_data = read_plt_data;
-  plugin.close_file_read = close_plt_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/plugintest.x b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/plugintest.x
deleted file mode 100755
index fefead8cbee590a12bd4fecef55c29ef00908bfc..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/plugintest.x and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ply.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ply.c
deleted file mode 100644
index 272d31af32a9fbadacd8901494c0065bfc4f7b25..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ply.c
+++ /dev/null
@@ -1,3316 +0,0 @@
-/*
-
-The interface routines for reading and writing PLY polygon files.
-
-Greg Turk
-
----------------------------------------------------------------
-
-A PLY file contains a single polygonal _object_.
-
-An object is composed of lists of _elements_.  Typical elements are
-vertices, faces, edges and materials.
-
-Each type of element for a given object has one or more _properties_
-associated with the element type.  For instance, a vertex element may
-have as properties the floating-point values x,y,z and the three unsigned
-chars representing red, green and blue.
-
------------------------------------------------------------------------
-
-Copyright (c) 1998 Georgia Institute of Technology.  All rights reserved.   
-  
-Permission to use, copy, modify and distribute this software and its   
-documentation for any purpose is hereby granted without fee, provided   
-that the above copyright notice and this permission notice appear in   
-all copies of this software and that you do not sell the software.   
-  
-THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,   
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY   
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   
-
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <ply.h>
-
-char *type_names[] = {  /* names of scalar types */
-"invalid",
-"int8", "int16", "int32", "uint8", "uint16", "uint32", "float32", "float64",
-};
-
-char *old_type_names[] = {  /* old names of types for backward compatability */
-"invalid",
-"char", "short", "int", "uchar", "ushort", "uint", "float", "double",
-};
-
-int ply_type_size[] = {
-  0, 1, 2, 4, 1, 2, 4, 4, 8
-};
-
-#define NO_OTHER_PROPS  -1
-
-#define DONT_STORE_PROP  0
-#define STORE_PROP       1
-
-#define OTHER_PROP       0
-#define NAMED_PROP       1
-
-/* returns 1 if strings are equal, 0 if not */
-int equal_strings(char *, char *);
-
-/* find an element in a plyfile's list */
-PlyElement *find_element(PlyFile *, char *);
-
-/* find a property in an element's list */
-PlyProperty *find_property(PlyElement *, char *, int *);
-
-/* write to a file the word describing a PLY file data type */
-void write_scalar_type (FILE *, int);
-
-/* read a line from a file and break it up into separate words */
-char **get_words(FILE *, int *, char **);
-
-/* write an item to a file */
-void write_binary_item(FILE *, int, unsigned int, double, int);
-void write_ascii_item(FILE *, int, unsigned int, double, int);
-
-/* add information to a PLY file descriptor */
-void add_element(PlyFile *, char **, int);
-void add_property(PlyFile *, char **, int);
-void add_comment(PlyFile *, char *);
-void add_obj_info(PlyFile *, char *);
-
-/* copy a property */
-void copy_property(PlyProperty *, PlyProperty *);
-
-/* store a value into where a pointer and a type specify */
-void store_item(char *, int, int, unsigned int, double);
-
-/* return the value of a stored item */
-void get_stored_item( void *, int, int *, unsigned int *, double *);
-
-/* return the value stored in an item, given ptr to it and its type */
-double get_item_value(char *, int);
-
-/* get binary or ascii item and store it according to ptr and type */
-void get_ascii_item(char *, int, int *, unsigned int *, double *);
-void get_binary_item(FILE *, int, int *, unsigned int *, double *);
-
-/* get a bunch of elements from a file */
-void ascii_get_element(PlyFile *, char *);
-void binary_get_element(PlyFile *, char *);
-
-/* memory allocation */
-static char *my_alloc(int, int, char *);
-
-
-/*************/
-/*  Writing  */
-/*************/
-
-
-/******************************************************************************
-Given a file pointer, get ready to write PLY data to the file.
-
-Entry:
-  fp         - the given file pointer
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-
-Exit:
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *ply_write(
-  FILE *fp,
-  int nelems,
-  char **elem_names,
-  int file_type
-)
-{
-  int i;
-  PlyFile *plyfile;
-  PlyElement *elem;
-
-  /* check for NULL file pointer */
-  if (fp == NULL)
-    return (NULL);
-
-  /* create a record for this object */
-
-  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
-  plyfile->file_type = file_type;
-  plyfile->num_comments = 0;
-  plyfile->num_obj_info = 0;
-  plyfile->num_elem_types = nelems;
-  plyfile->version = 1.0;
-  plyfile->fp = fp;
-  plyfile->other_elems = NULL;
-
-  /* tuck aside the names of the elements */
-
-  plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *) * nelems);
-  for (i = 0; i < nelems; i++) {
-    elem = (PlyElement *) myalloc (sizeof (PlyElement));
-    plyfile->elems[i] = elem;
-    elem->name = strdup (elem_names[i]);
-    elem->num = 0;
-    elem->nprops = 0;
-  }
-
-  /* return pointer to the file descriptor */
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Open a polygon file for writing.
-
-Entry:
-  filename   - name of file to read from
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-
-Exit:
-  returns a file identifier, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *open_for_writing_ply(
-  char *filename,
-  int nelems,
-  char **elem_names,
-  int file_type
-)
-{
-  int i;
-  PlyFile *plyfile;
-  PlyElement *elem;
-  char *name;
-  FILE *fp;
-
-  /* tack on the extension .ply, if necessary */
-
-  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
-  strcpy (name, filename);
-  if (strlen (name) < 4 ||
-      strcmp (name + strlen (name) - 4, ".ply") != 0)
-      strcat (name, ".ply");
-
-  /* open the file for writing */
-
-  fp = fopen (name, "w");
-  if (fp == NULL) {
-    return (NULL);
-  }
-
-  /* create the actual PlyFile structure */
-
-  plyfile = ply_write (fp, nelems, elem_names, file_type);
-  if (plyfile == NULL)
-    return (NULL);
-
-  /* return pointer to the file descriptor */
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Describe an element, including its properties and how many will be written
-to the file.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  nelems    - number of elements of this type to be written
-  nprops    - number of properties contained in the element
-  prop_list - list of properties
-******************************************************************************/
-
-void element_layout_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems,
-  int nprops,
-  PlyProperty *prop_list
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"element_layout_ply: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
-
-  elem->num = nelems;
-
-  /* copy the list of properties */
-
-  elem->nprops = nprops;
-  elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *) * nprops);
-  elem->store_prop = (char *) myalloc (sizeof (char) * nprops);
-
-  for (i = 0; i < nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    elem->props[i] = prop;
-    elem->store_prop[i] = NAMED_PROP;
-    copy_property (prop, &prop_list[i]);
-  }
-}
-
-
-/******************************************************************************
-Describe a property of an element.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  prop      - the new property
-******************************************************************************/
-
-void ply_describe_property(
-  PlyFile *plyfile,
-  char *elem_name,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *elem_prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr, "ply_describe_property: can't find element '%s'\n",
-            elem_name);
-    return;
-  }
-
-  /* create room for new property */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-    elem->store_prop = (char *) myalloc (sizeof (char));
-    elem->nprops = 1;
-  }
-  else {
-    elem->nprops++;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * elem->nprops);
-  }
-
-  /* copy the new property */
-
-  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-  elem->props[elem->nprops - 1] = elem_prop;
-  elem->store_prop[elem->nprops - 1] = NAMED_PROP;
-  copy_property (elem_prop, prop);
-}
-
-
-/******************************************************************************
-State how many of a given element will be written.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  nelems    - number of elements of this type to be written
-******************************************************************************/
-
-void element_count_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"element_count_ply: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
-
-  elem->num = nelems;
-}
-
-
-/******************************************************************************
-Signal that we've described everything a PLY file's header and that the
-header should be written to the file.
-
-Entry:
-  plyfile - file identifier
-******************************************************************************/
-
-void header_complete_ply(PlyFile *plyfile)
-{
-  int i,j;
-  FILE *fp = plyfile->fp;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  fprintf (fp, "ply\n");
-
-  switch (plyfile->file_type) {
-    case PLY_ASCII:
-      fprintf (fp, "format ascii 1.0\n");
-      break;
-    case PLY_BINARY_BE:
-      fprintf (fp, "format binary_big_endian 1.0\n");
-      break;
-    case PLY_BINARY_LE:
-      fprintf (fp, "format binary_little_endian 1.0\n");
-      break;
-    default:
-      fprintf (stderr, "ply_header_complete: bad file type = %d\n",
-               plyfile->file_type);
-      exit (-1);
-  }
-
-  /* write out the comments */
-
-  for (i = 0; i < plyfile->num_comments; i++)
-    fprintf (fp, "comment %s\n", plyfile->comments[i]);
-
-  /* write out object information */
-
-  for (i = 0; i < plyfile->num_obj_info; i++)
-    fprintf (fp, "obj_info %s\n", plyfile->obj_info[i]);
-
-  /* write out information about each element */
-
-  for (i = 0; i < plyfile->num_elem_types; i++) {
-
-    elem = plyfile->elems[i];
-    fprintf (fp, "element %s %d\n", elem->name, elem->num);
-
-    /* write out each property */
-    for (j = 0; j < elem->nprops; j++) {
-      prop = elem->props[j];
-      if (prop->is_list == PLY_LIST) {
-        fprintf (fp, "property list ");
-        write_scalar_type (fp, prop->count_external);
-        fprintf (fp, " ");
-        write_scalar_type (fp, prop->external_type);
-        fprintf (fp, " %s\n", prop->name);
-      }
-      else if (prop->is_list == PLY_STRING) {
-        fprintf (fp, "property string");
-        fprintf (fp, " %s\n", prop->name);
-      }
-      else {
-        fprintf (fp, "property ");
-        write_scalar_type (fp, prop->external_type);
-        fprintf (fp, " %s\n", prop->name);
-      }
-    }
-  }
-
-  fprintf (fp, "end_header\n");
-}
-
-
-/******************************************************************************
-Specify which elements are going to be written.  This should be called
-before a call to the routine ply_put_element().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element we're talking about
-******************************************************************************/
-
-void put_element_setup_ply(PlyFile *plyfile, char *elem_name)
-{
-  PlyElement *elem;
-
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr, "put_element_setup_ply: can't find element '%s'\n", elem_name);
-    exit (-1);
-  }
-
-  plyfile->which_elem = elem;
-}
-
-
-/******************************************************************************
-Write an element to the file.  This routine assumes that we're
-writing the type of element specified in the last call to the routine
-put_element_setup_ply().
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to the element
-******************************************************************************/
-
-void put_element_ply(PlyFile *plyfile, void *elem_ptr)
-{
-  int i,j,k;
-  FILE *fp = plyfile->fp;
-  PlyElement *elem;
-  PlyProperty *prop;
-  char *item;
-  char *elem_data;
-  char **item_ptr;
-  int list_count;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  char **other_ptr;
-
-  elem = plyfile->which_elem;
-  elem_data = (char *) elem_ptr;
-  other_ptr = (char **) (((char *) elem_ptr) + elem->other_offset);
-
-  /* write out either to an ascii or binary file */
-
-  if (plyfile->file_type == PLY_ASCII) {
-
-    /* write an ascii file */
-
-    /* write out each property of the element */
-    for (j = 0; j < elem->nprops; j++) {
-
-      prop = elem->props[j];
-
-      if (elem->store_prop[j] == OTHER_PROP)
-        elem_data = *other_ptr;
-      else
-        elem_data = (char *) elem_ptr;
-
-      if (prop->is_list == PLY_LIST) {  /* list */
-        item = elem_data + prop->count_offset;
-        get_stored_item ((void *) item, prop->count_internal,
-                         &int_val, &uint_val, &double_val);
-        write_ascii_item (fp, int_val, uint_val, double_val,
-                          prop->count_external);
-        list_count = uint_val;
-        item_ptr = (char **) (elem_data + prop->offset);
-        item = item_ptr[0];
-        item_size = ply_type_size[prop->internal_type];
-        for (k = 0; k < list_count; k++) {
-          get_stored_item ((void *) item, prop->internal_type,
-                           &int_val, &uint_val, &double_val);
-          write_ascii_item (fp, int_val, uint_val, double_val,
-                            prop->external_type);
-          item += item_size;
-        }
-      }
-      else if (prop->is_list == PLY_STRING) {  /* string */
-	char **str;
-        item = elem_data + prop->offset;
-	str = (char **) item;
-	fprintf (fp, "\"%s\"", *str);
-      }
-      else {                                  /* scalar */
-        item = elem_data + prop->offset;
-        get_stored_item ((void *) item, prop->internal_type,
-                         &int_val, &uint_val, &double_val);
-        write_ascii_item (fp, int_val, uint_val, double_val,
-                          prop->external_type);
-      }
-    }
-
-    fprintf (fp, "\n");
-  }
-  else {
-
-    /* write a binary file */
-
-    /* write out each property of the element */
-    for (j = 0; j < elem->nprops; j++) {
-      prop = elem->props[j];
-      if (elem->store_prop[j] == OTHER_PROP)
-        elem_data = *other_ptr;
-      else
-        elem_data = (char *) elem_ptr;
-      if (prop->is_list == PLY_LIST) {   /* list */
-        item = elem_data + prop->count_offset;
-        item_size = ply_type_size[prop->count_internal];
-        get_stored_item ((void *) item, prop->count_internal,
-                         &int_val, &uint_val, &double_val);
-        write_binary_item (fp, int_val, uint_val, double_val,
-                           prop->count_external);
-        list_count = uint_val;
-        item_ptr = (char **) (elem_data + prop->offset);
-        item = item_ptr[0];
-        item_size = ply_type_size[prop->internal_type];
-        for (k = 0; k < list_count; k++) {
-          get_stored_item ((void *) item, prop->internal_type,
-                           &int_val, &uint_val, &double_val);
-          write_binary_item (fp, int_val, uint_val, double_val,
-                             prop->external_type);
-          item += item_size;
-        }
-      }
-      else if (prop->is_list == PLY_STRING) {   /* string */
-	int len;
-	char **str;
-        item = elem_data + prop->offset;
-	str = (char **) item;
-
-	/* write the length */
-	len = strlen(*str) + 1;
-	fwrite (&len, sizeof(int), 1, fp);
-
-	/* write the string, including the null character */
-	fwrite (*str, len, 1, fp);
-      }
-      else {                   /* scalar */
-        item = elem_data + prop->offset;
-        item_size = ply_type_size[prop->internal_type];
-        get_stored_item ((void *) item, prop->internal_type,
-                         &int_val, &uint_val, &double_val);
-        write_binary_item (fp, int_val, uint_val, double_val,
-                           prop->external_type);
-      }
-    }
-
-  }
-}
-
-
-
-
-
-
-/*************/
-/*  Reading  */
-/*************/
-
-
-
-/******************************************************************************
-Given a file pointer, get ready to read PLY data from the file.
-
-Entry:
-  fp - the given file pointer
-
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *ply_read(FILE *fp, int *nelems, char ***elem_names)
-{
-  int i,j;
-  PlyFile *plyfile;
-  int nwords;
-  char **words;
-  int found_format = 0;
-  char **elist;
-  PlyElement *elem;
-  char *orig_line;
-
-  /* check for NULL file pointer */
-  if (fp == NULL)
-    return (NULL);
-
-  /* create record for this object */
-
-  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
-  plyfile->num_elem_types = 0;
-  plyfile->comments = NULL;
-  plyfile->num_comments = 0;
-  plyfile->obj_info = NULL;
-  plyfile->num_obj_info = 0;
-  plyfile->fp = fp;
-  plyfile->other_elems = NULL;
-  plyfile->rule_list = NULL;
-
-  /* read and parse the file's header */
-
-  words = get_words (plyfile->fp, &nwords, &orig_line);
-  if (!words || !equal_strings (words[0], "ply"))
-    return (NULL);
-
-  while (words) {
-
-    /* parse words */
-
-    if (equal_strings (words[0], "format")) {
-      if (nwords != 3)
-        return (NULL);
-      if (equal_strings (words[1], "ascii"))
-        plyfile->file_type = PLY_ASCII;
-      else if (equal_strings (words[1], "binary_big_endian"))
-        plyfile->file_type = PLY_BINARY_BE;
-      else if (equal_strings (words[1], "binary_little_endian"))
-        plyfile->file_type = PLY_BINARY_LE;
-      else
-        return (NULL);
-      plyfile->version = atof (words[2]);
-      found_format = 1;
-    }
-    else if (equal_strings (words[0], "element"))
-      add_element (plyfile, words, nwords);
-    else if (equal_strings (words[0], "property"))
-      add_property (plyfile, words, nwords);
-    else if (equal_strings (words[0], "comment"))
-      add_comment (plyfile, orig_line);
-    else if (equal_strings (words[0], "obj_info"))
-      add_obj_info (plyfile, orig_line);
-    else if (equal_strings (words[0], "end_header"))
-      break;
-
-    /* free up words space */
-    free (words);
-
-    words = get_words (plyfile->fp, &nwords, &orig_line);
-  }
-
-  /* create tags for each property of each element, to be used */
-  /* later to say whether or not to store each property for the user */
-
-  for (i = 0; i < plyfile->num_elem_types; i++) {
-    elem = plyfile->elems[i];
-    elem->store_prop = (char *) myalloc (sizeof (char) * elem->nprops);
-    for (j = 0; j < elem->nprops; j++)
-      elem->store_prop[j] = DONT_STORE_PROP;
-    elem->other_offset = NO_OTHER_PROPS; /* no "other" props by default */
-  }
-
-  /* set return values about the elements */
-
-  elist = (char **) myalloc (sizeof (char *) * plyfile->num_elem_types);
-  for (i = 0; i < plyfile->num_elem_types; i++)
-    elist[i] = strdup (plyfile->elems[i]->name);
-
-  *elem_names = elist;
-  *nelems = plyfile->num_elem_types;
-
-  /* return a pointer to the file's information */
-
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Open a polygon file for reading.
-
-Entry:
-  filename - name of file to read from
-
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-  version    - version number of PLY file
-  returns a file identifier, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *ply_open_for_reading(
-  char *filename,
-  int *nelems,
-  char ***elem_names,
-  int *file_type,
-  float *version
-)
-{
-  FILE *fp;
-  PlyFile *plyfile;
-  char *name;
-
-  /* tack on the extension .ply, if necessary */
-
-  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
-  strcpy (name, filename);
-  if (strlen (name) < 4 ||
-      strcmp (name + strlen (name) - 4, ".ply") != 0)
-      strcat (name, ".ply");
-
-  /* open the file for reading */
-
-  fp = fopen (name, "r");
-  if (fp == NULL)
-    return (NULL);
-
-  /* create the PlyFile data structure */
-
-  plyfile = ply_read (fp, nelems, elem_names);
-
-  /* determine the file type and version */
-
-  *file_type = plyfile->file_type;
-  *version = plyfile->version;
-
-  /* return a pointer to the file's information */
-
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Get information about a particular element.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element to get information about
-
-Exit:
-  nelems   - number of elements of this type in the file
-  nprops   - number of properties
-  returns a list of properties, or NULL if the file doesn't contain that elem
-******************************************************************************/
-
-PlyProperty **get_element_description_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int *nelems,
-  int *nprops
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-  PlyProperty **prop_list;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL)
-    return (NULL);
-
-  *nelems = elem->num;
-  *nprops = elem->nprops;
-
-  /* make a copy of the element's property list */
-  prop_list = (PlyProperty **) myalloc (sizeof (PlyProperty *) * elem->nprops);
-  for (i = 0; i < elem->nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, elem->props[i]);
-    prop_list[i] = prop;
-  }
-
-  /* return this duplicate property list */
-  return (prop_list);
-}
-
-
-/******************************************************************************
-Specify which properties of an element are to be returned.  This should be
-called before a call to the routine get_element_ply().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - which element we're talking about
-  nprops    - number of properties
-  prop_list - list of properties
-******************************************************************************/
-
-void get_element_setup_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nprops,
-  PlyProperty *prop_list
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-  int index;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  plyfile->which_elem = elem;
-
-  /* deposit the property information into the element's description */
-  for (i = 0; i < nprops; i++) {
-
-    /* look for actual property */
-    prop = find_property (elem, prop_list[i].name, &index);
-    if (prop == NULL) {
-      fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-               prop_list[i].name, elem_name);
-      continue;
-    }
-
-    /* store its description */
-    prop->internal_type = prop_list[i].internal_type;
-    prop->offset = prop_list[i].offset;
-    prop->count_internal = prop_list[i].count_internal;
-    prop->count_offset = prop_list[i].count_offset;
-
-    /* specify that the user wants this property */
-    elem->store_prop[index] = STORE_PROP;
-  }
-}
-
-
-/******************************************************************************
-Specify a property of an element that is to be returned.  This should be
-called (usually multiple times) before a call to the routine ply_get_element().
-This routine should be used in preference to the less flexible old routine
-called ply_get_element_setup().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - which element we're talking about
-  prop      - property to add to those that will be returned
-******************************************************************************/
-
-void ply_get_property(
-  PlyFile *plyfile,
-  char *elem_name,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *prop_ptr;
-  int index;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  plyfile->which_elem = elem;
-
-  /* deposit the property information into the element's description */
-
-  prop_ptr = find_property (elem, prop->name, &index);
-  if (prop_ptr == NULL) {
-    fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-             prop->name, elem_name);
-    return;
-  }
-  prop_ptr->internal_type  = prop->internal_type;
-  prop_ptr->offset         = prop->offset;
-  prop_ptr->count_internal = prop->count_internal;
-  prop_ptr->count_offset   = prop->count_offset;
-
-  /* specify that the user wants this property */
-  elem->store_prop[index] = STORE_PROP;
-}
-
-
-/******************************************************************************
-Read one element from the file.  This routine assumes that we're reading
-the type of element specified in the last call to the routine
-ply_get_element_setup().
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to location where the element information should be put
-******************************************************************************/
-
-void ply_get_element(PlyFile *plyfile, void *elem_ptr)
-{
-  if (plyfile->file_type == PLY_ASCII)
-    ascii_get_element (plyfile, (char *) elem_ptr);
-  else
-    binary_get_element (plyfile, (char *) elem_ptr);
-}
-
-
-/******************************************************************************
-Extract the comments from the header information of a PLY file.
-
-Entry:
-  plyfile - file identifier
-
-Exit:
-  num_comments - number of comments returned
-  returns a pointer to a list of comments
-******************************************************************************/
-
-char **get_comments_ply(PlyFile *plyfile, int *num_comments)
-{
-  *num_comments = plyfile->num_comments;
-  return (plyfile->comments);
-}
-
-
-/******************************************************************************
-Extract the object information (arbitrary text) from the header information
-of a PLY file.
-
-Entry:
-  plyfile - file identifier
-
-Exit:
-  num_obj_info - number of lines of text information returned
-  returns a pointer to a list of object info lines
-******************************************************************************/
-
-char **get_obj_info_ply(PlyFile *plyfile, int *num_obj_info)
-{
-  *num_obj_info = plyfile->num_obj_info;
-  return (plyfile->obj_info);
-}
-
-
-/******************************************************************************
-Make ready for "other" properties of an element-- those properties that
-the user has not explicitly asked for, but that are to be stashed away
-in a special structure to be carried along with the element's other
-information.
-
-Entry:
-  plyfile - file identifier
-  elem    - element for which we want to save away other properties
-******************************************************************************/
-
-void setup_other_props(PlyFile *plyfile, PlyElement *elem)
-{
-  int i;
-  PlyProperty *prop;
-  int size = 0;
-  int type_size;
-
-  /* Examine each property in decreasing order of size. */
-  /* We do this so that all data types will be aligned by */
-  /* word, half-word, or whatever within the structure. */
-
-  for (type_size = 8; type_size > 0; type_size /= 2) {
-
-    /* add up the space taken by each property, and save this information */
-    /* away in the property descriptor */
-
-    for (i = 0; i < elem->nprops; i++) {
-
-      /* don't bother with properties we've been asked to store explicitly */
-      if (elem->store_prop[i])
-        continue;
-
-      prop = elem->props[i];
-
-      /* internal types will be same as external */
-      prop->internal_type = prop->external_type;
-      prop->count_internal = prop->count_external;
-
-      /* list case */
-      if (prop->is_list == PLY_LIST) {
-
-        /* pointer to list */
-        if (type_size == sizeof (void *)) {
-          prop->offset = size;
-          size += sizeof (void *);    /* always use size of a pointer here */
-        }
-
-        /* count of number of list elements */
-        if (type_size == ply_type_size[prop->count_external]) {
-          prop->count_offset = size;
-          size += ply_type_size[prop->count_external];
-        }
-      }
-      /* string */
-      else if (prop->is_list == PLY_STRING) {
-        /* pointer to string */
-        if (type_size == sizeof (char *)) {
-          prop->offset = size;
-          size += sizeof (char *);
-        }
-      }
-      /* scalar */
-      else if (type_size == ply_type_size[prop->external_type]) {
-        prop->offset = size;
-        size += ply_type_size[prop->external_type];
-      }
-    }
-
-  }
-
-  /* save the size for the other_props structure */
-  elem->other_size = size;
-}
-
-
-/******************************************************************************
-Specify that we want the "other" properties of an element to be tucked
-away within the user's structure.
-
-Entry:
-  plyfile - file identifier
-  elem    - the element that we want to store other_props in
-  offset  - offset to where other_props will be stored inside user's structure
-
-Exit:
-  returns pointer to structure containing description of other_props
-******************************************************************************/
-
-static PlyOtherProp *get_other_properties(
-  PlyFile *plyfile,
-  PlyElement *elem,
-  int offset
-)
-{
-  int i;
-  PlyOtherProp *other;
-  PlyProperty *prop;
-  int nprops;
-
-  /* remember that this is the "current" element */
-  plyfile->which_elem = elem;
-
-  /* save the offset to where to store the other_props */
-  elem->other_offset = offset;
-
-  /* place the appropriate pointers, etc. in the element's property list */
-  setup_other_props (plyfile, elem);
-
-  /* create structure for describing other_props */
-  other = (PlyOtherProp *) myalloc (sizeof (PlyOtherProp));
-  other->name = strdup (elem->name);
-#if 0
-  if (elem->other_offset == NO_OTHER_PROPS) {
-    other->size = 0;
-    other->props = NULL;
-    other->nprops = 0;
-    return (other);
-  }
-#endif
-  other->size = elem->other_size;
-  other->props = (PlyProperty **) myalloc (sizeof(PlyProperty) * elem->nprops);
-  
-  /* save descriptions of each "other" property */
-  nprops = 0;
-  for (i = 0; i < elem->nprops; i++) {
-    if (elem->store_prop[i])
-      continue;
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, elem->props[i]);
-    other->props[nprops] = prop;
-    nprops++;
-  }
-  other->nprops = nprops;
-
-  /* set other_offset pointer appropriately if there are NO other properties */
-  if (other->nprops == 0) {
-    elem->other_offset = NO_OTHER_PROPS;
-  }
- 
-  /* return structure */
-  return (other);
-}
-
-
-/******************************************************************************
-Specify that we want the "other" properties of an element to be tucked
-away within the user's structure.  The user needn't be concerned for how
-these properties are stored.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that we want to store other_props in
-  offset    - offset to where other_props will be stored inside user's structure
-
-Exit:
-  returns pointer to structure containing description of other_props
-******************************************************************************/
-
-PlyOtherProp *ply_get_other_properties(
-  PlyFile *plyfile,
-  char *elem_name,
-  int offset
-)
-{
-  PlyElement *elem;
-  PlyOtherProp *other;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf (stderr, "ply_get_other_properties: Can't find element '%s'\n",
-             elem_name);
-    return (NULL);
-  }
-
-  other = get_other_properties (plyfile, elem, offset);
-  return (other);
-}
-
-
-
-
-/*************************/
-/*  Other Element Stuff  */
-/*************************/
-
-
-
-
-
-/******************************************************************************
-Grab all the data for the current element that a user does not want to
-explicitly read in.  Stores this in the PLY object's data structure.
-
-Entry:
-  plyfile - pointer to file
-
-Exit:
-  returns pointer to ALL the "other" element data for this PLY file
-******************************************************************************/
-
-PlyOtherElems *get_other_element_ply (PlyFile *plyfile)
-{
-  int i;
-  PlyElement *elem;
-  char *elem_name;
-  int elem_count;
-  PlyOtherElems *other_elems;
-  OtherElem *other;
-
-  elem = plyfile->which_elem;
-  elem_name = elem->name;
-  elem_count = elem->num;
-
-  /* create room for the new "other" element, initializing the */
-  /* other data structure if necessary */
-
-  if (plyfile->other_elems == NULL) {
-    plyfile->other_elems = (PlyOtherElems *) myalloc (sizeof (PlyOtherElems));
-    other_elems = plyfile->other_elems;
-    other_elems->other_list = (OtherElem *) myalloc (sizeof (OtherElem));
-    other = &(other_elems->other_list[0]);
-    other_elems->num_elems = 1;
-  }
-  else {
-    other_elems = plyfile->other_elems;
-    other_elems->other_list = (OtherElem *) realloc (other_elems->other_list,
-                              sizeof (OtherElem) * other_elems->num_elems + 1);
-    other = &(other_elems->other_list[other_elems->num_elems]);
-    other_elems->num_elems++;
-  }
-
-  /* count of element instances in file */
-  other->elem_count = elem_count;
-
-  /* save name of element */
-  other->elem_name = strdup (elem_name);
-
-  /* create a list to hold all the current elements */
-  other->other_data = (OtherData **)
-                  malloc (sizeof (OtherData *) * other->elem_count);
-
-  /* set up for getting elements */
-  other->other_props = ply_get_other_properties (plyfile, elem_name,
-                         offsetof(OtherData,other_props));
-
-  /* grab all these elements */
-  for (i = 0; i < other->elem_count; i++) {
-    /* grab and element from the file */
-    other->other_data[i] = (OtherData *) malloc (sizeof (OtherData));
-    ply_get_element (plyfile, (void *) other->other_data[i]);
-  }
-
-  /* return pointer to the other elements data */
-  return (other_elems);
-}
-
-
-/******************************************************************************
-Write out the "other" elements specified for this PLY file.
-
-Entry:
-  plyfile - pointer to PLY file to write out other elements for
-******************************************************************************/
-
-void put_other_elements_ply (PlyFile *plyfile)
-{
-  int i,j;
-  OtherElem *other;
-
-  /* make sure we have other elements to write */
-  if (plyfile->other_elems == NULL)
-    return;
-
-  /* write out the data for each "other" element */
-
-  for (i = 0; i < plyfile->other_elems->num_elems; i++) {
-
-    other = &(plyfile->other_elems->other_list[i]);
-    put_element_setup_ply (plyfile, other->elem_name);
-
-    /* write out each instance of the current element */
-    for (j = 0; j < other->elem_count; j++)
-      put_element_ply (plyfile, (void *) other->other_data[j]);
-  }
-}
-
-
-/******************************************************************************
-Free up storage used by an "other" elements data structure.
-
-Entry:
-  other_elems - data structure to free up
-******************************************************************************/
-
-void free_other_elements_ply (PlyOtherElems *other_elems)
-{
-
-}
-
-
-
-/*******************/
-/*  Miscellaneous  */
-/*******************/
-
-
-
-/******************************************************************************
-Close a PLY file.
-
-Entry:
-  plyfile - identifier of file to close
-******************************************************************************/
-
-void ply_close(PlyFile *plyfile)
-{
-  fclose (plyfile->fp);
-
-  /* free up memory associated with the PLY file */
-  free (plyfile);
-}
-
-
-/******************************************************************************
-Get version number and file type of a PlyFile.
-
-Entry:
-  ply - pointer to PLY file
-
-Exit:
-  version - version of the file
-  file_type - PLY_ASCII, PLY_BINARY_BE, or PLY_BINARY_LE
-******************************************************************************/
-
-void get_info_ply(PlyFile *ply, float *version, int *file_type)
-{
-  if (ply == NULL)
-    return;
-
-  *version = ply->version;
-  *file_type = ply->file_type;
-}
-
-
-/******************************************************************************
-Compare two strings.  Returns 1 if they are the same, 0 if not.
-******************************************************************************/
-
-int equal_strings(char *s1, char *s2)
-{
-  int i;
-
-  while (*s1 && *s2)
-    if (*s1++ != *s2++)
-      return (0);
-
-  if (*s1 != *s2)
-    return (0);
-  else
-    return (1);
-}
-
-
-/******************************************************************************
-Re-create the command line that was used to invoke this program.
-
-Entry:
-  argc - number of words in argv
-  argv - array of words in command line
-******************************************************************************/
-
-char *recreate_command_line (int argc, char *argv[])
-{
-  int i;
-  char *line;
-  int len = 0;
-
-  /* count total number of characters needed, including separating spaces */
-  for (i = 0; i < argc; i++)
-    len += strlen(argv[i]) + 1;
-
-  /* create empty line */
-  line = (char *) malloc (sizeof(char) * len);
-  line[0] = '\0';
-
-  /* repeatedly append argv */
-  for (i = 0; i < argc; i++) {
-    strcat (line, argv[i]);
-    if (i != argc - 1)
-      strcat (line, " ");
-  }
-
-  return (line);
-}
-
-
-/******************************************************************************
-Find an element from the element list of a given PLY object.
-
-Entry:
-  plyfile - file id for PLY file
-  element - name of element we're looking for
-
-Exit:
-  returns the element, or NULL if not found
-******************************************************************************/
-
-PlyElement *find_element(PlyFile *plyfile, char *element)
-{
-  int i;
-
-  for (i = 0; i < plyfile->num_elem_types; i++)
-    if (equal_strings (element, plyfile->elems[i]->name))
-      return (plyfile->elems[i]);
-
-  return (NULL);
-}
-
-
-/******************************************************************************
-Find a property in the list of properties of a given element.
-
-Entry:
-  elem      - pointer to element in which we want to find the property
-  prop_name - name of property to find
-
-Exit:
-  index - index to position in list
-  returns a pointer to the property, or NULL if not found
-******************************************************************************/
-
-PlyProperty *find_property(PlyElement *elem, char *prop_name, int *index)
-{
-  int i;
-
-  for (i = 0; i < elem->nprops; i++)
-    if (equal_strings (prop_name, elem->props[i]->name)) {
-      *index = i;
-      return (elem->props[i]);
-    }
-
-  *index = -1;
-  return (NULL);
-}
-
-
-/******************************************************************************
-Read an element from an ascii file.
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to element
-******************************************************************************/
-
-void ascii_get_element(PlyFile *plyfile, char *elem_ptr)
-{
-  int i,j,k;
-  PlyElement *elem;
-  PlyProperty *prop;
-  char **words;
-  int nwords;
-  int which_word;
-  FILE *fp = plyfile->fp;
-  char *elem_data,*item;
-  char *item_ptr;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  int list_count;
-  int store_it;
-  char **store_array;
-  char *orig_line;
-  char *other_data;
-  int other_flag;
-
-  /* the kind of element we're reading currently */
-  elem = plyfile->which_elem;
-
-  /* do we need to setup for other_props? */
-
-  if (elem->other_offset != NO_OTHER_PROPS) {
-    char **ptr;
-    other_flag = 1;
-    /* make room for other_props */
-    other_data = (char *) myalloc (elem->other_size);
-    /* store pointer in user's structure to the other_props */
-    ptr = (char **) (elem_ptr + elem->other_offset);
-    *ptr = other_data;
-  }
-  else
-    other_flag = 0;
-
-  /* read in the element */
-
-  words = get_words (plyfile->fp, &nwords, &orig_line);
-  if (words == NULL) {
-    fprintf (stderr, "ply_get_element: unexpected end of file\n");
-    exit (-1);
-  }
-
-  which_word = 0;
-
-  for (j = 0; j < elem->nprops; j++) {
-
-    prop = elem->props[j];
-    store_it = (elem->store_prop[j] | other_flag);
-
-    /* store either in the user's structure or in other_props */
-    if (elem->store_prop[j])
-      elem_data = elem_ptr;
-    else
-      elem_data = other_data;
-
-    if (prop->is_list == PLY_LIST) {       /* a list */
-
-      /* get and store the number of items in the list */
-      get_ascii_item (words[which_word++], prop->count_external,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->count_offset;
-        store_item(item, prop->count_internal, int_val, uint_val, double_val);
-      }
-
-      /* allocate space for an array of items and store a ptr to the array */
-      list_count = int_val;
-      item_size = ply_type_size[prop->internal_type];
-      store_array = (char **) (elem_data + prop->offset);
-
-      if (list_count == 0) {
-        if (store_it)
-          *store_array = NULL;
-      }
-      else {
-        if (store_it) {
-          item_ptr = (char *) myalloc (sizeof (char) * item_size * list_count);
-          item = item_ptr;
-          *store_array = item_ptr;
-        }
-
-        /* read items and store them into the array */
-        for (k = 0; k < list_count; k++) {
-          get_ascii_item (words[which_word++], prop->external_type,
-                          &int_val, &uint_val, &double_val);
-          if (store_it) {
-            store_item (item, prop->internal_type,
-                        int_val, uint_val, double_val);
-            item += item_size;
-          }
-        }
-      }
-
-    }
-    else if (prop->is_list == PLY_STRING) {   /* a string */
-      if (store_it) {
-	char *str;
-	char **str_ptr;
-	str = strdup (words[which_word++]);
-        item = elem_data + prop->offset;
-	str_ptr = (char **) item;
-	*str_ptr = str;
-      }
-      else {
-        which_word++;
-      }
-    }
-    else {                     /* a scalar */
-      get_ascii_item (words[which_word++], prop->external_type,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->offset;
-        store_item (item, prop->internal_type, int_val, uint_val, double_val);
-      }
-    }
-
-  }
-
-  free (words);
-}
-
-
-/******************************************************************************
-Read an element from a binary file.
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to an element
-******************************************************************************/
-
-void binary_get_element(PlyFile *plyfile, char *elem_ptr)
-{
-  int i,j,k;
-  PlyElement *elem;
-  PlyProperty *prop;
-  FILE *fp = plyfile->fp;
-  char *elem_data;
-  char *item;
-  char *item_ptr;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  int list_count;
-  int store_it;
-  char **store_array;
-  char *other_data;
-  int other_flag;
-
-  /* the kind of element we're reading currently */
-  elem = plyfile->which_elem;
-
-  /* do we need to setup for other_props? */
-
-  if (elem->other_offset != NO_OTHER_PROPS) {
-    char **ptr;
-    other_flag = 1;
-    /* make room for other_props */
-    other_data = (char *) myalloc (elem->other_size);
-    /* store pointer in user's structure to the other_props */
-    ptr = (char **) (elem_ptr + elem->other_offset);
-    *ptr = other_data;
-  }
-  else
-    other_flag = 0;
-
-  /* read in a number of elements */
-
-  for (j = 0; j < elem->nprops; j++) {
-
-    prop = elem->props[j];
-    store_it = (elem->store_prop[j] | other_flag);
-
-    /* store either in the user's structure or in other_props */
-    if (elem->store_prop[j])
-      elem_data = elem_ptr;
-    else
-      elem_data = other_data;
-
-    if (prop->is_list == PLY_LIST) {          /* list */
-
-      /* get and store the number of items in the list */
-      get_binary_item (fp, prop->count_external,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->count_offset;
-        store_item(item, prop->count_internal, int_val, uint_val, double_val);
-      }
-
-      /* allocate space for an array of items and store a ptr to the array */
-      list_count = int_val;
-      item_size = ply_type_size[prop->internal_type];
-      store_array = (char **) (elem_data + prop->offset);
-      if (list_count == 0) {
-        if (store_it)
-          *store_array = NULL;
-      }
-      else {
-        if (store_it) {
-          item_ptr = (char *) myalloc (sizeof (char) * item_size * list_count);
-          item = item_ptr;
-          *store_array = item_ptr;
-        }
-
-        /* read items and store them into the array */
-        for (k = 0; k < list_count; k++) {
-          get_binary_item (fp, prop->external_type,
-                          &int_val, &uint_val, &double_val);
-          if (store_it) {
-            store_item (item, prop->internal_type,
-                        int_val, uint_val, double_val);
-            item += item_size;
-          }
-        }
-      }
-
-    }
-    else if (prop->is_list == PLY_STRING) {     /* string */
-      int len;
-      char *str;
-      fread (&len, sizeof(int), 1, fp);
-      str = (char *) myalloc (len);
-      fread (str, len, 1, fp);
-      if (store_it) {
-	char **str_ptr;
-        item = elem_data + prop->offset;
-	str_ptr = (char **) item;
-	*str_ptr = str;
-      }
-    }
-    else {                                      /* scalar */
-      get_binary_item (fp, prop->external_type,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->offset;
-        store_item (item, prop->internal_type, int_val, uint_val, double_val);
-      }
-    }
-
-  }
-}
-
-
-/******************************************************************************
-Write to a file the word that represents a PLY data type.
-
-Entry:
-  fp   - file pointer
-  code - code for type
-******************************************************************************/
-
-void write_scalar_type (FILE *fp, int code)
-{
-  /* make sure this is a valid code */
-
-  if (code <= StartType || code >= EndType) {
-    fprintf (stderr, "write_scalar_type: bad data code = %d\n", code);
-    exit (-1);
-  }
-
-  /* write the code to a file */
-
-  fprintf (fp, "%s", type_names[code]);
-}
-
-
-/******************************************************************************
-Get a text line from a file and break it up into words.
-
-IMPORTANT: The calling routine should call "free" on the returned pointer once
-finished with it.
-
-Entry:
-  fp - file to read from
-
-Exit:
-  nwords    - number of words returned
-  orig_line - the original line of characters
-  returns a list of words from the line, or NULL if end-of-file
-******************************************************************************/
-
-char **get_words(FILE *fp, int *nwords, char **orig_line)
-{
-#define BIG_STRING 4096
-  int i,j;
-  static char str[BIG_STRING];
-  static char str_copy[BIG_STRING];
-  char **words;
-  int max_words = 10;
-  int num_words = 0;
-  char *ptr,*ptr2;
-  char *result;
-
-  words = (char **) myalloc (sizeof (char *) * max_words);
-
-  /* read in a line */
-  result = fgets (str, BIG_STRING, fp);
-  if (result == NULL) {
-    *nwords = 0;
-    *orig_line = NULL;
-    return (NULL);
-  }
-
-  /* convert line-feed and tabs into spaces */
-  /* (this guarentees that there will be a space before the */
-  /*  null character at the end of the string) */
-
-  str[BIG_STRING-2] = ' ';
-  str[BIG_STRING-1] = '\0';
-
-  for (ptr = str, ptr2 = str_copy; *ptr != '\0'; ptr++, ptr2++) {
-    *ptr2 = *ptr;
-    if (*ptr == '\t') {
-      *ptr = ' ';
-      *ptr2 = ' ';
-    }
-    else if (*ptr == '\n') {
-      *ptr = ' ';
-      *ptr2 = '\0';
-      break;
-    }
-  }
-
-  /* find the words in the line */
-
-  ptr = str;
-  while (*ptr != '\0') {
-
-    /* jump over leading spaces */
-    while (*ptr == ' ')
-      ptr++;
-
-    /* break if we reach the end */
-    if (*ptr == '\0')
-      break;
-
-    /* allocate more room for words if necessary */
-    if (num_words >= max_words) {
-      max_words += 10;
-      words = (char **) realloc (words, sizeof (char *) * max_words);
-    }
-
-    if (*ptr == '\"') {  /* a quote indidicates that we have a string */
-
-      /* skip over leading quote */
-      ptr++;
-
-      /* save pointer to beginning of word */
-      words[num_words++] = ptr;
-
-      /* find trailing quote or end of line */
-      while (*ptr != '\"' && *ptr != '\0')
-        ptr++;
-
-      /* replace quote with a null character to mark the end of the word */
-      /* if we are not already at the end of the line */
-      if (*ptr != '\0')
-	*ptr++ = '\0';
-    }
-    else {               /* non-string */
-
-      /* save pointer to beginning of word */
-      words[num_words++] = ptr;
-
-      /* jump over non-spaces */
-      while (*ptr != ' ')
-	ptr++;
-
-      /* place a null character here to mark the end of the word */
-      *ptr++ = '\0';
-    }
-  }
-
-  /* return the list of words */
-  *nwords = num_words;
-  *orig_line = str_copy;
-  return (words);
-}
-
-
-/******************************************************************************
-Return the value of an item, given a pointer to it and its type.
-
-Entry:
-  item - pointer to item
-  type - data type that "item" points to
-
-Exit:
-  returns a double-precision float that contains the value of the item
-******************************************************************************/
-
-double get_item_value(char *item, int type)
-{
-  unsigned char *puchar;
-  char *pchar;
-  short int *pshort;
-  unsigned short int *pushort;
-  int *pint;
-  unsigned int *puint;
-  float *pfloat;
-  double *pdouble;
-  int int_value;
-  unsigned int uint_value;
-  double double_value;
-
-  switch (type) {
-    case Int8:
-      pchar = (char *) item;
-      int_value = *pchar;
-      return ((double) int_value);
-    case Uint8:
-      puchar = (unsigned char *) item;
-      int_value = *puchar;
-      return ((double) int_value);
-    case Int16:
-      pshort = (short int *) item;
-      int_value = *pshort;
-      return ((double) int_value);
-    case Uint16:
-      pushort = (unsigned short int *) item;
-      int_value = *pushort;
-      return ((double) int_value);
-    case Int32:
-      pint = (int *) item;
-      int_value = *pint;
-      return ((double) int_value);
-    case Uint32:
-      puint = (unsigned int *) item;
-      uint_value = *puint;
-      return ((double) uint_value);
-    case Float32:
-      pfloat = (float *) item;
-      double_value = *pfloat;
-      return (double_value);
-    case Float64:
-      pdouble = (double *) item;
-      double_value = *pdouble;
-      return (double_value);
-    default:
-      fprintf (stderr, "get_item_value: bad type = %d\n", type);
-      exit (-1);
-  }
-
-  return (0.0);  /* never actually gets here */
-}
-
-
-/******************************************************************************
-Write out an item to a file as raw binary bytes.
-
-Entry:
-  fp         - file to write to
-  int_val    - integer version of item
-  uint_val   - unsigned integer version of item
-  double_val - double-precision float version of item
-  type       - data type to write out
-******************************************************************************/
-
-void write_binary_item(
-  FILE *fp,
-  int int_val,
-  unsigned int uint_val,
-  double double_val,
-  int type
-)
-{
-  unsigned char uchar_val;
-  char char_val;
-  unsigned short ushort_val;
-  short short_val;
-  float float_val;
-
-  switch (type) {
-    case Int8:
-      char_val = int_val;
-      fwrite (&char_val, 1, 1, fp);
-      break;
-    case Int16:
-      short_val = int_val;
-      fwrite (&short_val, 2, 1, fp);
-      break;
-    case Int32:
-      fwrite (&int_val, 4, 1, fp);
-      break;
-    case Uint8:
-      uchar_val = uint_val;
-      fwrite (&uchar_val, 1, 1, fp);
-      break;
-    case Uint16:
-      ushort_val = uint_val;
-      fwrite (&ushort_val, 2, 1, fp);
-      break;
-    case Uint32:
-      fwrite (&uint_val, 4, 1, fp);
-      break;
-    case Float32:
-      float_val = double_val;
-      fwrite (&float_val, 4, 1, fp);
-      break;
-    case Float64:
-      fwrite (&double_val, 8, 1, fp);
-      break;
-    default:
-      fprintf (stderr, "write_binary_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Write out an item to a file as ascii characters.
-
-Entry:
-  fp         - file to write to
-  int_val    - integer version of item
-  uint_val   - unsigned integer version of item
-  double_val - double-precision float version of item
-  type       - data type to write out
-******************************************************************************/
-
-void write_ascii_item(
-  FILE *fp,
-  int int_val,
-  unsigned int uint_val,
-  double double_val,
-  int type
-)
-{
-  switch (type) {
-    case Int8:
-    case Int16:
-    case Int32:
-      fprintf (fp, "%d ", int_val);
-      break;
-    case Uint8:
-    case Uint16:
-    case Uint32:
-      fprintf (fp, "%u ", uint_val);
-      break;
-    case Float32:
-    case Float64:
-      fprintf (fp, "%g ", double_val);
-      break;
-    default:
-      fprintf (stderr, "write_ascii_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Get the value of an item that is in memory, and place the result
-into an integer, an unsigned integer and a double.
-
-Entry:
-  ptr  - pointer to the item
-  type - data type supposedly in the item
-
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
-******************************************************************************/
-
-void get_stored_item(
-  void *ptr,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
-{
-  switch (type) {
-    case Int8:
-      *int_val = *((char *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint8:
-      *uint_val = *((unsigned char *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int16:
-      *int_val = *((short int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint16:
-      *uint_val = *((unsigned short int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int32:
-      *int_val = *((int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint32:
-      *uint_val = *((unsigned int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Float32:
-      *double_val = *((float *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    case Float64:
-      *double_val = *((double *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    default:
-      fprintf (stderr, "get_stored_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Get the value of an item from a binary file, and place the result
-into an integer, an unsigned integer and a double.
-
-Entry:
-  fp   - file to get item from
-  type - data type supposedly in the word
-
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
-******************************************************************************/
-
-void get_binary_item(
-  FILE *fp,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
-{
-  char c[8];
-  void *ptr;
-
-  ptr = (void *) c;
-
-  switch (type) {
-    case Int8:
-      fread (ptr, 1, 1, fp);
-      *int_val = *((char *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint8:
-      fread (ptr, 1, 1, fp);
-      *uint_val = *((unsigned char *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int16:
-      fread (ptr, 2, 1, fp);
-      *int_val = *((short int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint16:
-      fread (ptr, 2, 1, fp);
-      *uint_val = *((unsigned short int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int32:
-      fread (ptr, 4, 1, fp);
-      *int_val = *((int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint32:
-      fread (ptr, 4, 1, fp);
-      *uint_val = *((unsigned int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Float32:
-      fread (ptr, 4, 1, fp);
-      *double_val = *((float *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    case Float64:
-      fread (ptr, 8, 1, fp);
-      *double_val = *((double *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    default:
-      fprintf (stderr, "get_binary_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Extract the value of an item from an ascii word, and place the result
-into an integer, an unsigned integer and a double.
-
-Entry:
-  word - word to extract value from
-  type - data type supposedly in the word
-
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
-******************************************************************************/
-
-void get_ascii_item(
-  char *word,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
-{
-  switch (type) {
-    case Int8:
-    case Uint8:
-    case Int16:
-    case Uint16:
-    case Int32:
-      *int_val = atoi (word);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-
-    case Uint32:
-      *uint_val = strtoul (word, (char **) NULL, 10);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-
-    case Float32:
-    case Float64:
-      *double_val = atof (word);
-      *int_val = (int) *double_val;
-      *uint_val = (unsigned int) *double_val;
-      break;
-
-    default:
-      fprintf (stderr, "get_ascii_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Store a value into a place being pointed to, guided by a data type.
-
-Entry:
-  item       - place to store value
-  type       - data type
-  int_val    - integer version of value
-  uint_val   - unsigned integer version of value
-  double_val - double version of value
-
-Exit:
-  item - pointer to stored value
-******************************************************************************/
-
-void store_item (
-  char *item,
-  int type,
-  int int_val,
-  unsigned int uint_val,
-  double double_val
-)
-{
-  unsigned char *puchar;
-  short int *pshort;
-  unsigned short int *pushort;
-  int *pint;
-  unsigned int *puint;
-  float *pfloat;
-  double *pdouble;
-
-  switch (type) {
-    case Int8:
-      *item = int_val;
-      break;
-    case Uint8:
-      puchar = (unsigned char *) item;
-      *puchar = uint_val;
-      break;
-    case Int16:
-      pshort = (short *) item;
-      *pshort = int_val;
-      break;
-    case Uint16:
-      pushort = (unsigned short *) item;
-      *pushort = uint_val;
-      break;
-    case Int32:
-      pint = (int *) item;
-      *pint = int_val;
-      break;
-    case Uint32:
-      puint = (unsigned int *) item;
-      *puint = uint_val;
-      break;
-    case Float32:
-      pfloat = (float *) item;
-      *pfloat = double_val;
-      break;
-    case Float64:
-      pdouble = (double *) item;
-      *pdouble = double_val;
-      break;
-    default:
-      fprintf (stderr, "store_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Add an element to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  words   - list of words describing the element
-  nwords  - number of words in the list
-******************************************************************************/
-
-void add_element (PlyFile *plyfile, char **words, int nwords)
-{
-  PlyElement *elem;
-
-  /* create the new element */
-  elem = (PlyElement *) myalloc (sizeof (PlyElement));
-  elem->name = strdup (words[1]);
-  elem->num = atoi (words[2]);
-  elem->nprops = 0;
-
-  /* make room for new element in the object's list of elements */
-  if (plyfile->num_elem_types == 0)
-    plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *));
-  else
-    plyfile->elems = (PlyElement **) realloc (plyfile->elems,
-                     sizeof (PlyElement *) * (plyfile->num_elem_types + 1));
-
-  /* add the new element to the object's list */
-  plyfile->elems[plyfile->num_elem_types] = elem;
-  plyfile->num_elem_types++;
-}
-
-
-/******************************************************************************
-Return the type of a property, given the name of the property.
-
-Entry:
-  name - name of property type
-
-Exit:
-  returns integer code for property, or 0 if not found
-******************************************************************************/
-
-int get_prop_type(char *type_name)
-{
-  int i;
-
-  /* try to match the type name */
-  for (i = StartType + 1; i < EndType; i++)
-    if (equal_strings (type_name, type_names[i]))
-      return (i);
-
-  /* see if we can match an old type name */
-  for (i = StartType + 1; i < EndType; i++)
-    if (equal_strings (type_name, old_type_names[i]))
-      return (i);
-
-  /* if we get here, we didn't find the type */
-  return (0);
-}
-
-
-/******************************************************************************
-Add a property to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  words   - list of words describing the property
-  nwords  - number of words in the list
-******************************************************************************/
-
-void add_property (PlyFile *plyfile, char **words, int nwords)
-{
-  int prop_type;
-  int count_type;
-  PlyProperty *prop;
-  PlyElement *elem;
-
-  /* create the new property */
-
-  prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-
-  if (equal_strings (words[1], "list")) {          /* list */
-    prop->count_external = get_prop_type (words[2]);
-    prop->external_type = get_prop_type (words[3]);
-    prop->name = strdup (words[4]);
-    prop->is_list = PLY_LIST;
-  }
-  else if (equal_strings (words[1], "string")) {   /* string */
-    prop->count_external = Int8;
-    prop->external_type = Int8;
-    prop->name = strdup (words[2]);
-    prop->is_list = PLY_STRING;
-  }
-  else {                                           /* scalar */
-    prop->external_type = get_prop_type (words[1]);
-    prop->name = strdup (words[2]);
-    prop->is_list = PLY_SCALAR;
-  }
-
-  /* add this property to the list of properties of the current element */
-
-  elem = plyfile->elems[plyfile->num_elem_types - 1];
-
-  if (elem->nprops == 0)
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-  else
-    elem->props = (PlyProperty **) realloc (elem->props,
-                  sizeof (PlyProperty *) * (elem->nprops + 1));
-
-  elem->props[elem->nprops] = prop;
-  elem->nprops++;
-}
-
-
-/******************************************************************************
-Add a comment to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  line    - line containing comment
-******************************************************************************/
-
-void add_comment (PlyFile *plyfile, char *line)
-{
-  int i;
-
-  /* skip over "comment" and leading spaces and tabs */
-  i = 7;
-  while (line[i] == ' ' || line[i] == '\t')
-    i++;
-
-  append_comment_ply (plyfile, &line[i]);
-}
-
-
-/******************************************************************************
-Add a some object information to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  line    - line containing text info
-******************************************************************************/
-
-void add_obj_info (PlyFile *plyfile, char *line)
-{
-  int i;
-
-  /* skip over "obj_info" and leading spaces and tabs */
-  i = 8;
-  while (line[i] == ' ' || line[i] == '\t')
-    i++;
-
-  append_obj_info_ply (plyfile, &line[i]);
-}
-
-
-/******************************************************************************
-Copy a property.
-******************************************************************************/
-
-void copy_property(PlyProperty *dest, PlyProperty *src)
-{
-  dest->name = strdup (src->name);
-  dest->external_type = src->external_type;
-  dest->internal_type = src->internal_type;
-  dest->offset = src->offset;
-
-  dest->is_list = src->is_list;
-  dest->count_external = src->count_external;
-  dest->count_internal = src->count_internal;
-  dest->count_offset = src->count_offset;
-}
-
-
-/******************************************************************************
-Allocate some memory.
-
-Entry:
-  size  - amount of memory requested (in bytes)
-  lnum  - line number from which memory was requested
-  fname - file name from which memory was requested
-******************************************************************************/
-
-static char *my_alloc(int size, int lnum, char *fname)
-{
-  char *ptr;
-
-  ptr = (char *) malloc (size);
-
-  if (ptr == 0) {
-    fprintf(stderr, "Memory allocation bombed on line %d in %s\n", lnum, fname);
-  }
-
-  return (ptr);
-}
-
-
-/**** NEW STUFF ****/
-/**** NEW STUFF ****/
-/**** NEW STUFF ****/
-/**** NEW STUFF ****/
-
-
-
-/******************************************************************************
-Given a file pointer, get ready to read PLY data from the file.
-
-Entry:
-  fp - the given file pointer
-
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *read_ply(FILE *fp)
-{
-  PlyFile *ply;
-  int num_elems;
-  char **elem_names;
-
-  ply = ply_read (fp, &num_elems, &elem_names);
-
-  return (ply);
-}
-
-
-/******************************************************************************
-Given a file pointer, get ready to write PLY data to the file.
-
-Entry:
-  fp         - the given file pointer
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-
-Exit:
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *write_ply(
-  FILE *fp,
-  int nelems,
-  char **elem_names,
-  int file_type
-)
-{
-  PlyFile *ply;
-
-  ply = ply_write (fp, nelems, elem_names, file_type);
-
-  return (ply);
-}
-
-
-/******************************************************************************
-Return a list of the names of the elements in a particular PLY file.
-
-Entry:
-  ply - PLY file whose element name list we want
-
-Exit:
-  num_elems  - the number of element names in the list
-  returns the list of names
-******************************************************************************/
-
-char **get_element_list_ply(PlyFile *ply, int *num_elems)
-{
-  int i;
-  char **elist;
-
-  /* create the list of element names */
-
-  elist = (char **) myalloc (sizeof (char *) * ply->num_elem_types);
-  for (i = 0; i < ply->num_elem_types; i++)
-    elist[i] = strdup (ply->elems[i]->name);
-
-  /* return the number of elements and the list of element names */
-  *num_elems = ply->num_elem_types;
-  return (elist);
-}
-
-
-/******************************************************************************
-Append a comment to a PLY file.
-
-Entry:
-  ply     - file to append comment to
-  comment - the comment to append
-******************************************************************************/
-
-void append_comment_ply(PlyFile *ply, char *comment)
-{
-  /* (re)allocate space for new comment */
-  if (ply->num_comments == 0)
-    ply->comments = (char **) myalloc (sizeof (char *));
-  else
-    ply->comments = (char **) realloc (ply->comments,
-		     sizeof (char *) * (ply->num_comments + 1));
-
-  /* add comment to list */
-  ply->comments[ply->num_comments] = strdup (comment);
-  ply->num_comments++;
-}
-
-
-/******************************************************************************
-Copy the comments from one PLY file to another.
-
-Entry:
-  out_ply - destination file to copy comments to
-  in_ply  - the source of the comments
-******************************************************************************/
-
-void copy_comments_ply(PlyFile *out_ply, PlyFile *in_ply)
-{
-  int i;
-
-  for (i = 0; i < in_ply->num_comments; i++)
-    append_comment_ply (out_ply, in_ply->comments[i]);
-}
-
-
-/******************************************************************************
-Append object information (arbitrary text) to a PLY file.
-
-Entry:
-  ply      - file to append object info to
-  obj_info - the object info to append
-******************************************************************************/
-
-void append_obj_info_ply(PlyFile *ply, char *obj_info)
-{
-  /* (re)allocate space for new info */
-  if (ply->num_obj_info == 0)
-    ply->obj_info = (char **) myalloc (sizeof (char *));
-  else
-    ply->obj_info = (char **) realloc (ply->obj_info,
-		     sizeof (char *) * (ply->num_obj_info + 1));
-
-  /* add info to list */
-  ply->obj_info[ply->num_obj_info] = strdup (obj_info);
-  ply->num_obj_info++;
-}
-
-
-/******************************************************************************
-Copy the object information from one PLY file to another.
-
-Entry:
-  out_ply - destination file to copy object information to
-  in_ply  - the source of the object information
-******************************************************************************/
-
-void copy_obj_info_ply(PlyFile *out_ply, PlyFile *in_ply)
-{
-  int i;
-
-  for (i = 0; i < in_ply->num_obj_info; i++)
-    append_obj_info_ply (out_ply, in_ply->obj_info[i]);
-}
-
-
-/******************************************************************************
-Close a PLY file.
-
-Entry:
-  plyfile - identifier of file to close
-******************************************************************************/
-
-void close_ply(PlyFile *plyfile)
-{
-  fclose (plyfile->fp);
-}
-
-
-/******************************************************************************
-Free the memory used by a PLY file.
-
-Entry:
-  plyfile - identifier of file
-******************************************************************************/
-
-void free_ply(PlyFile *plyfile)
-{
-  /* free up memory associated with the PLY file */
-  free (plyfile);
-}
-
-
-/******************************************************************************
-Specify the index of the next element to be read in from a PLY file.
-
-Entry:
-  ply - file to read from
-  index - index of the element to be read
-
-Exit:
-  elem_count - the number of elements in the file
-  returns pointer to the name of this next element
-******************************************************************************/
-
-char *setup_element_read_ply (PlyFile *ply, int index, int *elem_count)
-{
-  PlyElement *elem;
-
-  if (index < 0 || index > ply->num_elem_types) {
-    fprintf (stderr, "Warning:  No element with index %d\n", index);
-    return (0);
-  }
-
-  elem = ply->elems[index];
-
-  /* set this to be the current element */
-  ply->which_elem = elem;
-
-  /* return the number of such elements in the file and the element's name */
-  *elem_count = elem->num;
-  return (elem->name);
-}
-
-
-/******************************************************************************
-Read one element from the file.  This routine assumes that we're reading
-the type of element specified in the last call to the routine
-setup_element_read_ply().
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to location where the element information should be put
-******************************************************************************/
-
-void get_element_ply (PlyFile *plyfile, void *elem_ptr)
-{
-  if (plyfile->file_type == PLY_ASCII)
-    ascii_get_element (plyfile, (char *) elem_ptr);
-  else
-    binary_get_element (plyfile, (char *) elem_ptr);
-}
-
-
-/******************************************************************************
-Specify one of several properties of the current element that is to be
-read from a file.  This should be called (usually multiple times) before a
-call to the routine get_element_ply().
-
-Entry:
-  plyfile - file identifier
-  prop    - property to add to those that will be returned
-******************************************************************************/
-
-void setup_property_ply(
-  PlyFile *plyfile,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *prop_ptr;
-  int index;
-
-  elem = plyfile->which_elem;
-
-  /* deposit the property information into the element's description */
-
-  prop_ptr = find_property (elem, prop->name, &index);
-  if (prop_ptr == NULL) {
-    fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-             prop->name, elem->name);
-    return;
-  }
-  prop_ptr->internal_type  = prop->internal_type;
-  prop_ptr->offset         = prop->offset;
-  prop_ptr->count_internal = prop->count_internal;
-  prop_ptr->count_offset   = prop->count_offset;
-
-  /* specify that the user wants this property */
-  elem->store_prop[index] = STORE_PROP;
-}
-
-
-/******************************************************************************
-Specify that we want the "other" properties of the current element to be tucked
-away within the user's structure.
-
-Entry:
-  plyfile - file identifier
-  offset  - offset to where other_props will be stored inside user's structure
-
-Exit:
-  returns pointer to structure containing description of other_props
-******************************************************************************/
-
-PlyOtherProp *get_other_properties_ply(
-  PlyFile *plyfile,
-  int offset
-)
-{
-  PlyOtherProp *other;
-
-  other = get_other_properties (plyfile, plyfile->which_elem, offset);
-  return (other);
-}
-
-
-/******************************************************************************
-Describe which element is to be written next and state how many of them will
-be written.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being described
-  nelems    - number of elements of this type to be written
-******************************************************************************/
-
-void describe_element_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"describe_element_ply: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
-
-  elem->num = nelems;
-
-  /* now this element is the current element */
-  plyfile->which_elem = elem;
-}
-
-
-/******************************************************************************
-Describe a property of an element.
-
-Entry:
-  plyfile   - file identifier
-  prop      - the new property
-******************************************************************************/
-
-void describe_property_ply(
-  PlyFile *plyfile,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *elem_prop;
-
-  elem = plyfile->which_elem;
-
-  /* create room for new property */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-    elem->store_prop = (char *) myalloc (sizeof (char));
-    elem->nprops = 1;
-  }
-  else {
-    elem->nprops++;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * elem->nprops);
-  }
-
-  /* copy the new property */
-
-  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-  elem->props[elem->nprops - 1] = elem_prop;
-  elem->store_prop[elem->nprops - 1] = NAMED_PROP;
-  copy_property (elem_prop, prop);
-}
-
-
-/******************************************************************************
-Describe what the "other" properties are that are to be stored, and where
-they are in an element.
-******************************************************************************/
-
-void describe_other_properties_ply(
-  PlyFile *plyfile,
-  PlyOtherProp *other,
-  int offset
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, other->name);
-  if (elem == NULL) {
-    fprintf(stderr, "describe_other_properties_ply: can't find element '%s'\n",
-            other->name);
-    return;
-  }
-
-  /* create room for other properties */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **)
-                  myalloc (sizeof (PlyProperty *) * other->nprops);
-    elem->store_prop = (char *) myalloc (sizeof (char) * other->nprops);
-    elem->nprops = 0;
-  }
-  else {
-    int newsize;
-    newsize = elem->nprops + other->nprops;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * newsize);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * newsize);
-  }
-
-  /* copy the other properties */
-
-  for (i = 0; i < other->nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, other->props[i]);
-    elem->props[elem->nprops] = prop;
-    elem->store_prop[elem->nprops] = OTHER_PROP;
-    elem->nprops++;
-  }
-
-  /* save other info about other properties */
-  elem->other_size = other->size;
-  elem->other_offset = offset;
-}
-
-
-/******************************************************************************
-Pass along a pointer to "other" elements that we want to save in a given
-PLY file.  These other elements were presumably read from another PLY file.
-
-Entry:
-  plyfile     - file pointer in which to store this other element info
-  other_elems - info about other elements that we want to store
-******************************************************************************/
-
-void describe_other_elements_ply (
-  PlyFile *plyfile,
-  PlyOtherElems *other_elems
-)
-{
-  int i;
-  OtherElem *other;
-
-  /* ignore this call if there is no other element */
-  if (other_elems == NULL)
-    return;
-
-  /* save pointer to this information */
-  plyfile->other_elems = other_elems;
-
-  /* describe the other properties of this element */
-
-  for (i = 0; i < other_elems->num_elems; i++) {
-    other = &(other_elems->other_list[i]);
-    element_count_ply (plyfile, other->elem_name, other->elem_count);
-    describe_other_properties_ply (plyfile, other->other_props,
-                                   offsetof(OtherData,other_props));
-  }
-}
-
-
-
-/**** Property Propagation Rules ****/
-
-
-typedef struct RuleName {
-  int code;
-  char *name;
-} RuleName;
-
-RuleName rule_name_list[] = {
-  AVERAGE_RULE, "avg",
-  RANDOM_RULE, "rnd",
-  MINIMUM_RULE, "max",
-  MAXIMUM_RULE, "min",
-  MAJORITY_RULE, "major",
-  SAME_RULE, "same",
-  -1, "end_marker",
-};
-
-
-
-/******************************************************************************
-Initialize the property propagation rules for an element.  Default is to
-use averaging (AVERAGE_RULE) for creating all new properties.
-
-Entry:
-  ply       - PLY object that this is for
-  elem_name - name of the element that we're making the rules for
-
-Exit:
-  returns pointer to the default rules
-******************************************************************************/
-
-PlyPropRules *init_rule_ply (PlyFile *ply, char *elem_name)
-{
-  int i,j;
-  PlyElement *elem;
-  PlyPropRules *rules;
-  PlyRuleList *list;
-  int found_prop;
-
-  elem = find_element (ply, elem_name);
-  if (elem == NULL) {
-    fprintf (stderr, "init_rule_ply: Can't find element '%s'\n", elem_name);
-    exit (-1);
-  }
-
-  rules = (PlyPropRules *) myalloc (sizeof (PlyPropRules));
-  rules->elem = elem;
-  rules->rule_list = (int *) myalloc (sizeof(int) * elem->nprops);
-  rules->max_props = 0;
-  rules->nprops = 0;
-
-  /* default is to use averaging rule */
-  for (i = 0; i < elem->nprops; i++)
-    rules->rule_list[i] = AVERAGE_RULE;
-
-  /* see if there are other rules we should use */
-
-  if (ply->rule_list == NULL)
-    return (rules);
-
-  /* try to match the element, property and rule name */
-
-  for (list = ply->rule_list; list != NULL; list = list->next) {
-
-    if (!equal_strings (list->element, elem->name))
-      continue;
-
-    found_prop = 0;
-
-    for (i = 0; i < elem->nprops; i++)
-      if (equal_strings (list->property, elem->props[i]->name)) {
-
-        found_prop = 1;
-
-        /* look for matching rule name */
-        for (j = 0; rule_name_list[j].code != -1; j++)
-          if (equal_strings (list->name, rule_name_list[j].name)) {
-            rules->rule_list[i] = rule_name_list[j].code;
-            break;
-          }
-      }
-
-    if (!found_prop) {
-      fprintf (stderr, "Can't find property '%s' for rule '%s'\n",
-               list->property, list->name);
-      continue;
-    }
-  }
-
-  return (rules);
-}
-
-
-/******************************************************************************
-Modify a property propagation rule.
-
-Entry:
-  rules - rules for the element
-  prop_name - name of the property whose rule we're modifying
-  rule_type - type of rule (MAXIMUM_RULE, MINIMUM_RULE, MAJORITY_RULE, etc.)
-******************************************************************************/
-
-void modify_rule_ply (PlyPropRules *rules, char *prop_name, int rule_type)
-{
-  int i;
-  PlyElement *elem = rules->elem;
-
-  /* find the property and modify its rule type */
-
-  for (i = 0; i < elem->nprops; i++)
-    if (equal_strings (elem->props[i]->name, prop_name)) {
-      rules->rule_list[i] = rule_type;
-      return;
-    }
-
-  /* we didn't find the property if we get here */
-  fprintf (stderr, "modify_rule_ply: Can't find property '%s'\n", prop_name);
-  exit (-1);
-}
-
-
-/******************************************************************************
-Begin to create a set of properties from a set of propagation rules.
-
-Entry:
-  ply   - PLY object whose rules we're preparing to use
-  rules - rules for the element
-******************************************************************************/
-
-void start_props_ply (PlyFile *ply, PlyPropRules *rules)
-{
-  int i;
-  int count;
-  PlyElement *elem = rules->elem;
-
-  /* save pointer to the rules in the PLY object */
-  ply->current_rules = rules;
-
-  /* get ready for new sets of properties to combine */
-  rules->nprops = 0;
-}
-
-
-/******************************************************************************
-Remember a set of properties and their weights for creating a new set of
-properties.
-
-Entry:
-  weight      - weights for this set of properties
-  other_props - the properties to use
-******************************************************************************/
-
-void weight_props_ply (PlyFile *ply, float weight, void *other_props)
-{
-  PlyPropRules *rules = ply->current_rules;
-
-  /* allocate space for properties and weights, if necessary */
-  if (rules->max_props == 0) {
-    rules->max_props = 6;
-    rules->props = (void **) myalloc (sizeof (void *) * rules->max_props);
-    rules->weights = (float *) myalloc (sizeof (float) * rules->max_props);
-  }
-  if (rules->nprops == rules->max_props) {
-    rules->max_props *= 2;
-    rules->props = (void **) realloc (rules->props,
-                   sizeof (void *) * rules->max_props);
-    rules->weights = (float *) realloc (rules->weights,
-                     sizeof (float) * rules->max_props);
-  }
-
-  /* remember these new properties and their weights */
-
-  rules->props[rules->nprops] = other_props;
-  rules->weights[rules->nprops] = weight;
-  rules->nprops++;
-}
-
-
-/******************************************************************************
-Return a pointer to a new set of properties that have been created using
-a specified set of property combination rules and a given collection of
-"other" properties.
-
-Exit:
-  returns a pointer to the new properties
-******************************************************************************/
-
-void *get_new_props_ply(PlyFile *ply)
-{
-  int i,j;
-  static double *vals;
-  static int max_vals = 0;
-  PlyPropRules *rules = ply->current_rules;
-  PlyElement *elem = rules->elem;
-  PlyProperty *prop;
-  char *data;
-  char *new_data;
-  void *ptr;
-  int offset;
-  int type;
-  double double_val;
-  int int_val;
-  unsigned int uint_val;
-  int random_pick;
-
-  /* return NULL if we've got no "other" properties */
-  if (elem->other_size == 0) {
-    return (NULL);
-  }
-
-  /* create room for combined other properties */
-  new_data = (char *) myalloc (sizeof (char) * elem->other_size);
-
-  /* make sure there is enough room to store values we're to combine */
-
-  if (max_vals == 0) {
-    max_vals = rules->nprops;
-    vals = (double *) myalloc (sizeof (double) * rules->nprops);
-  }
-  if (rules->nprops >= max_vals) {
-    max_vals = rules->nprops;
-    vals = (double *) realloc (vals, sizeof (double) * rules->nprops);
-  }
-
-  /* in case we need a random choice */
-#if defined(_MSC_VER)
-  random_pick = 0;
-#else
-  random_pick = (int) floor (rules->nprops * drand48());
-#endif
-  /* calculate the combination for each "other" property of the element */
-
-  for (i = 0; i < elem->nprops; i++) {
-
-    /* don't bother with properties we've been asked to store explicitly */
-    if (elem->store_prop[i])
-      continue;
-
-    prop = elem->props[i];
-    offset = prop->offset;
-    type = prop->external_type;
-
-    /* collect together all the values we're to combine */
-
-    for (j = 0; j < rules->nprops; j++) {
-      data = (char *) rules->props[j];
-      ptr = (void *) (data + offset);
-      get_stored_item ((void *) ptr, type, &int_val, &uint_val, &double_val);
-      vals[j] = double_val;
-    }
-
-    /* calculate the combined value */
-
-    switch (rules->rule_list[i]) {
-      case AVERAGE_RULE: {
-	double sum = 0;
-	double weight_sum = 0;
-	for (j = 0; j < rules->nprops; j++) {
-	  sum += vals[j] * rules->weights[j];
-	  weight_sum += rules->weights[j];
-	}
-	double_val = sum / weight_sum;
-        break;
-      }
-      case MINIMUM_RULE: {
-	double_val = vals[0];
-	for (j = 1; j < rules->nprops; j++)
-	  if (double_val > vals[j])
-	    double_val = vals[j];
-        break;
-      }
-      case MAXIMUM_RULE: {
-	double_val = vals[0];
-	for (j = 1; j < rules->nprops; j++)
-	  if (double_val < vals[j])
-	    double_val = vals[j];
-        break;
-      }
-      case RANDOM_RULE: {
-	double_val = vals[random_pick];
-        break;
-      }
-      case SAME_RULE: {
-	double_val = vals[0];
-	for (j = 1; j < rules->nprops; j++)
-	  if (double_val != vals[j]) {
-	    fprintf (stderr,
-    "get_new_props_ply: Error combining properties that should be the same.\n");
-            exit (-1);
-	  }
-        break;
-      }
-      default:
-        fprintf (stderr, "get_new_props_ply: Bad rule = %d\n",
-	         rules->rule_list[i]);
-	exit (-1);
-    }
-
-    /* store the combined value */
-
-    int_val = (int) double_val;
-    uint_val = (unsigned int) double_val;
-    ptr = (void *) (new_data + offset);
-    store_item ((char *) ptr, type, int_val, uint_val, double_val);
-  }
-
-  return ((void *) new_data);
-}
-
-
-/******************************************************************************
-Set the list of user-specified property combination rules.
-******************************************************************************/
-
-void set_prop_rules_ply (PlyFile *ply, PlyRuleList *prop_rules)
-{
-  ply->rule_list = prop_rules;
-}
-
-
-/******************************************************************************
-Append a property rule to a growing list of user-specified rules.
-
-Entry:
-  rule_list - current rule list
-  name      - name of property combination rule
-  property  - "element.property" says which property the rule affects
-
-Exit:
-  returns pointer to the new rule list
-******************************************************************************/
-
-PlyRuleList *append_prop_rule (
-  PlyRuleList *rule_list,
-  char *name,
-  char *property
-)
-{
-  PlyRuleList *rule;
-  PlyRuleList *rule_ptr;
-  char *str,*str2;
-  char *ptr;
-
-  /* find . */
-  str = strdup (property);
-  for (ptr = str; *ptr != '\0' && *ptr != '.'; ptr++) ;
-
-  /* split string at . */
-  if (*ptr == '.') {
-    *ptr = '\0';
-    str2 = ptr + 1;
-  }
-  else {
-    fprintf (stderr, "Can't find property '%s' for rule '%s'\n",
-             property, name);
-    return (rule_list);
-  }
-
-  rule = (PlyRuleList *) malloc (sizeof (PlyRuleList));
-  rule->name = name;
-  rule->element = str;
-  rule->property = str2;
-  rule->next = NULL;
-
-  /* either start rule list or append to it */
-
-  if (rule_list == NULL)
-    rule_list = rule;
-  else {                      /* append new rule to current list */
-    rule_ptr = rule_list;
-    while (rule_ptr->next != NULL)
-      rule_ptr = rule_ptr->next;
-    rule_ptr->next = rule;
-  }
-
-  /* return pointer to list */
-
-  return (rule_list);
-}
-
-
-/******************************************************************************
-See if a name matches the name of any property combination rules.
-
-Entry:
-  name - name of rule we're trying to match
-
-Exit:
-  returns 1 if we find a match, 0 if not
-******************************************************************************/
-
-int matches_rule_name (char *name)
-{
-  int i;
-
-  for (i = 0; rule_name_list[i].code != -1; i++)
-    if (equal_strings (rule_name_list[i].name, name))
-      return (1);
-
-  return (0);
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ply.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ply.h
deleted file mode 100644
index 127844caf2c77a6a55e11eda128d02ae7baf33f9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/ply.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
-
-Header for PLY polygon files.
-
-- Greg Turk
-
-A PLY file contains a single polygonal _object_.
-
-An object is composed of lists of _elements_.  Typical elements are
-vertices, faces, edges and materials.
-
-Each type of element for a given object has one or more _properties_
-associated with the element type.  For instance, a vertex element may
-have as properties three floating-point values x,y,z and three unsigned
-chars for red, green and blue.
-
------------------------------------------------------------------------
-
-Copyright (c) 1998 Georgia Institute of Technology.  All rights reserved.   
-  
-Permission to use, copy, modify and distribute this software and its   
-documentation for any purpose is hereby granted without fee, provided   
-that the above copyright notice and this permission notice appear in   
-all copies of this software and that you do not sell the software.   
-  
-THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,   
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY   
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   
-
-*/
-
-#ifndef __PLY_H__
-#define __PLY_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stddef.h>
-
-#define PLY_ASCII      1        /* ascii PLY file */
-#define PLY_BINARY_BE  2        /* binary PLY file, big endian */
-#define PLY_BINARY_LE  3        /* binary PLY file, little endian */
-
-#define PLY_OKAY    0           /* ply routine worked okay */
-#define PLY_ERROR  -1           /* error in ply routine */
-
-/* scalar data types supported by PLY format */
-
-#define StartType  0
-#define Int8       1
-#define Int16      2
-#define Int32      3
-#define Uint8      4
-#define Uint16     5
-#define Uint32     6
-#define Float32    7
-#define Float64    8
-#define EndType    9
-
-#define  PLY_SCALAR  0
-#define  PLY_LIST    1
-#define  PLY_STRING  2
-
-
-typedef struct PlyProperty {    /* description of a property */
-
-  char *name;                   /* property name */
-  int external_type;            /* file's data type */
-  int internal_type;            /* program's data type */
-  int offset;                   /* offset bytes of prop in a struct */
-
-  int is_list;                  /* 0 = scalar, 1 = list, 2 = char string */
-  int count_external;           /* file's count type */
-  int count_internal;           /* program's count type */
-  int count_offset;             /* offset byte for list count */
-
-} PlyProperty;
-
-typedef struct PlyElement {     /* description of an element */
-  char *name;                   /* element name */
-  int num;                      /* number of elements in this object */
-  int size;                     /* size of element (bytes) or -1 if variable */
-  int nprops;                   /* number of properties for this element */
-  PlyProperty **props;          /* list of properties in the file */
-  char *store_prop;             /* flags: property wanted by user? */
-  int other_offset;             /* offset to un-asked-for props, or -1 if none*/
-  int other_size;               /* size of other_props structure */
-} PlyElement;
-
-typedef struct PlyOtherProp {   /* describes other properties in an element */
-  char *name;                   /* element name */
-  int size;                     /* size of other_props */
-  int nprops;                   /* number of properties in other_props */
-  PlyProperty **props;          /* list of properties in other_props */
-} PlyOtherProp;
-
-typedef struct OtherData { /* for storing other_props for an other element */
-  void *other_props;
-} OtherData;
-
-typedef struct OtherElem {     /* data for one "other" element */
-  char *elem_name;             /* names of other elements */
-  int elem_count;              /* count of instances of each element */
-  OtherData **other_data;      /* actual property data for the elements */
-  PlyOtherProp *other_props;   /* description of the property data */
-} OtherElem;
-
-typedef struct PlyOtherElems {  /* "other" elements, not interpreted by user */
-  int num_elems;                /* number of other elements */
-  OtherElem *other_list;        /* list of data for other elements */
-} PlyOtherElems;
-
-#define AVERAGE_RULE  1
-#define MAJORITY_RULE 2
-#define MINIMUM_RULE  3
-#define MAXIMUM_RULE  4
-#define SAME_RULE     5
-#define RANDOM_RULE   6
-
-typedef struct PlyPropRules {   /* rules for combining "other" properties */
-  PlyElement *elem;      /* element whose rules we are making */
-  int *rule_list;        /* types of rules (AVERAGE_PLY, MAJORITY_PLY, etc.) */
-  int nprops;            /* number of properties we're combining so far */
-  int max_props;         /* maximum number of properties we have room for now */
-  void **props;          /* list of properties we're combining */
-  float *weights;        /* list of weights of the properties */
-} PlyPropRules;
-
-typedef struct PlyRuleList {
-  char *name;                  /* name of the rule */
-  char *element;               /* name of element that rule applies to */
-  char *property;              /* name of property that rule applies to */
-  struct PlyRuleList *next;    /* pointer for linked list of rules */
-} PlyRuleList;
-
-typedef struct PlyFile {        /* description of PLY file */
-  FILE *fp;                     /* file pointer */
-  int file_type;                /* ascii or binary */
-  float version;                /* version number of file */
-  int num_elem_types;           /* number of element types of object */
-  PlyElement **elems;           /* list of elements */
-  int num_comments;             /* number of comments */
-  char **comments;              /* list of comments */
-  int num_obj_info;             /* number of items of object information */
-  char **obj_info;              /* list of object info items */
-  PlyElement *which_elem;       /* element we're currently reading or writing */
-  PlyOtherElems *other_elems;   /* "other" elements from a PLY file */
-  PlyPropRules *current_rules;  /* current propagation rules */
-  PlyRuleList *rule_list;       /* rule list from user */
-} PlyFile;
-
-/* memory allocation */
-/*
-extern char *my_alloc();
-*/
-#define myalloc(mem_size) my_alloc((mem_size), __LINE__, __FILE__)
-
-
-/* old routines */
-
-#if 0
-extern PlyFile *ply_write(FILE *, int, char **, int);
-extern PlyFile *ply_read(FILE *, int *, char ***);
-extern PlyFile *ply_open_for_reading( char *, int *, char ***, int *, float *);
-extern void ply_close(PlyFile *);
-extern PlyOtherProp *ply_get_other_properties(PlyFile *, char *, int);
-#endif
-
-extern void ply_describe_property(PlyFile *, char *, PlyProperty *);
-extern void ply_get_property(PlyFile *, char *, PlyProperty *);
-extern void ply_get_element(PlyFile *, void *);
-
-
-/*** delcaration of routines ***/
-
-PlyOtherElems *get_other_element_ply (PlyFile *);
-
-PlyFile *read_ply(FILE *);
-PlyFile *write_ply(FILE *, int, char **, int);
-extern PlyFile *open_for_writing_ply(char *, int, char **, int);
-void close_ply(PlyFile *);
-void free_ply(PlyFile *);
-
-void get_info_ply(PlyFile *, float *, int *);
-void free_other_elements_ply (PlyOtherElems *);
-
-void append_comment_ply(PlyFile *, char *);
-void append_obj_info_ply(PlyFile *, char *);
-void copy_comments_ply(PlyFile *, PlyFile *);
-void copy_obj_info_ply(PlyFile *, PlyFile *);
-char **get_comments_ply(PlyFile *, int *);
-char **get_obj_info_ply(PlyFile *, int *);
-
-char **get_element_list_ply(PlyFile *, int *);
-void setup_property_ply(PlyFile *, PlyProperty *);
-void get_element_ply (PlyFile *, void *);
-char *setup_element_read_ply (PlyFile *, int, int *);
-PlyOtherProp *get_other_properties_ply(PlyFile *, int);
-
-void element_count_ply(PlyFile *, char *, int);
-void describe_element_ply(PlyFile *, char *, int);
-void describe_property_ply(PlyFile *, PlyProperty *);
-void describe_other_properties_ply(PlyFile *, PlyOtherProp *, int);
-void describe_other_elements_ply ( PlyFile *, PlyOtherElems *);
-void get_element_setup_ply(PlyFile *, char *, int, PlyProperty *);
-PlyProperty **get_element_description_ply(PlyFile *, char *, int*, int*);
-void element_layout_ply(PlyFile *, char *, int, int, PlyProperty *);
-
-void header_complete_ply(PlyFile *);
-void put_element_setup_ply(PlyFile *, char *);
-void put_element_ply(PlyFile *, void *);
-void put_other_elements_ply(PlyFile *);
-
-PlyPropRules *init_rule_ply (PlyFile *, char *);
-void modify_rule_ply (PlyPropRules *, char *, int);
-void start_props_ply (PlyFile *, PlyPropRules *);
-void weight_props_ply (PlyFile *, float, void *);
-void *get_new_props_ply(PlyFile *);
-void set_prop_rules_ply (PlyFile *, PlyRuleList *);
-PlyRuleList *append_prop_rule (PlyRuleList *, char *, char *);
-int matches_rule_name (char *);
-
-int equal_strings(char *, char *);
-char *recreate_command_line (int, char *argv[]);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !__PLY_H__ */
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/plyplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/plyplugin.C
deleted file mode 100644
index 7736d2d3520ccde08ece211d0f4bf9a65a544d8e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/plyplugin.C
+++ /dev/null
@@ -1,308 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: plyplugin.C,v $
- *      $Author: johns $       $:  $             $State: Exp $
- *      $Revision: 1.8 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-#include "ply.h"
-#include "ply.c"
-
-/* vertex and face definitions for a polygonal object */
-
-typedef struct Vertex {
-  float x,y,z;
-  float r,g,b;
-  float nx,ny,nz;
-  void *other_props;       /* other properties */
-} Vertex;
-
-typedef struct Face {
-  unsigned char nverts;    /* number of vertex indices in list */
-  int *verts;              /* vertex index list */
-  void *other_props;       /* other properties */
-} Face;
-
-char *elem_names[] = { /* list of the elements in the object */
-  "vertex", "face"
-};
-
-PlyProperty vert_props[] = { /* list of property information for a vertex */
-  {"x", Float32, Float32, offsetof(Vertex,x), 0, 0, 0, 0},
-  {"y", Float32, Float32, offsetof(Vertex,y), 0, 0, 0, 0},
-  {"z", Float32, Float32, offsetof(Vertex,z), 0, 0, 0, 0},
-  {"r", Float32, Float32, offsetof(Vertex,r), 0, 0, 0, 0},
-  {"g", Float32, Float32, offsetof(Vertex,g), 0, 0, 0, 0},
-  {"b", Float32, Float32, offsetof(Vertex,b), 0, 0, 0, 0},
-  {"nx", Float32, Float32, offsetof(Vertex,nx), 0, 0, 0, 0},
-  {"ny", Float32, Float32, offsetof(Vertex,ny), 0, 0, 0, 0},
-  {"nz", Float32, Float32, offsetof(Vertex,nz), 0, 0, 0, 0},
-};
-
-PlyProperty face_props[] = { /* list of property information for a face */
-  {"vertex_indices", Int32, Int32, offsetof(Face,verts),
-   1, Uint8, Uint8, offsetof(Face,nverts)},
-  {"vertex_index", Int32, Int32, offsetof(Face,verts),
-   1, Uint8, Uint8, offsetof(Face,nverts)},
-};
-
-
-
-/// plugin data handle
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-
-  int per_vertex_color;
-  int has_normals;
-} ply_t;
-
-
-static void *open_file_read(const char *filepath, const char *filetype,
-                            int *natoms) {
-  FILE *fd;
-  ply_t *ply;
-  
-  printf("plyplugin) Opening PLY file '%s'\n", filepath);
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-  ply = new ply_t;
-  ply->fd = fd;
-  ply->graphics = NULL;
-  *natoms = 0;
-  return ply;
-}
-
-
-static int read_rawgraphics(void *v, int *nelem, 
-                            const molfile_graphics_t **data) {
-  ply_t *ply = (ply_t *)v;
-  ply->per_vertex_color = 0;
-  ply->has_normals = 0;
-
-  int i=0;
-  int nverts=0;
-  int nfaces=0;
-  char *elem_name=NULL;
-  Vertex **vlist=NULL;
-  Face **flist=NULL;
-  PlyOtherProp *vert_other=NULL;
-  PlyOtherProp *face_other=NULL;
-
-  printf("plyplugin) Reading PLY file header...\n");
-  PlyFile *in_ply = read_ply(ply->fd);
-
-  printf("plyplugin) Processing PLY contents...\n");
-  printf("plyplugin) num_elem_types: %d\n", in_ply->num_elem_types);  
-
-  for (i=0; i<in_ply->num_elem_types; i++) {
-    int elem_count = 0;
-
-    /* prepare to read the i'th list of elements */
-    elem_name = setup_element_read_ply (in_ply, i, &elem_count);
-
-    if (equal_strings ("vertex", elem_name)) {
-      int j=0;
-      nverts = elem_count;
-      printf("plyplugin) reading %d vertex elements...\n", nverts);
-
-      /* create a vertex list to hold all the vertices */
-      vlist = (Vertex **) calloc (1, sizeof(Vertex *)*nverts);
-
-      /* set up for getting vertex elements */
-      setup_property_ply(in_ply, &vert_props[0]);
-      setup_property_ply(in_ply, &vert_props[1]);
-      setup_property_ply(in_ply, &vert_props[2]);
-
-      for (j=0; j<in_ply->elems[i]->nprops; j++) {
-        PlyProperty *prop;
-        prop = in_ply->elems[i]->props[j];
-        if (equal_strings ("r", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[3]);
-          ply->per_vertex_color = 1;
-        }
-        if (equal_strings ("g", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[4]);
-          ply->per_vertex_color = 1;
-        }
-        if (equal_strings ("b", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[5]);
-          ply->per_vertex_color = 1;
-        }
-        if (equal_strings ("nx", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[6]);
-          ply->has_normals = 1;
-        }
-        if (equal_strings ("ny", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[7]);
-          ply->has_normals = 1;
-        }
-        if (equal_strings ("nz", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[8]);
-          ply->has_normals = 1;
-        }
-      }
-
-      vert_other = get_other_properties_ply(in_ply,
-                                            offsetof(Vertex,other_props));
-
-      /* grab all the vertex elements */
-      for (j=0; j<nverts; j++) {
-        vlist[j] = (Vertex *) calloc(1, sizeof(Vertex));
-        vlist[j]->r = 1;
-        vlist[j]->g = 1;
-        vlist[j]->b = 1;
-        get_element_ply (in_ply, (void *) vlist[j]);
-      }
-
-    } else if (equal_strings ("face", elem_name)) {
-      int j=0;
-      nfaces = elem_count;
-      printf("plyplugin) reading %d face elements...\n", nfaces);
-
-      /* create a list to hold all the face elements */
-      flist = (Face **) calloc(1, sizeof(Face *)*nfaces);
-
-      /* set up for getting face elements */
-      for (j=0; j<in_ply->elems[i]->nprops; j++) {
-        PlyProperty *prop;
-        prop = in_ply->elems[i]->props[j];
-        if (equal_strings ("vertex_indices", prop->name)) {
-          setup_property_ply(in_ply, &face_props[0]);
-        }
-        if (equal_strings ("vertex_index", prop->name)) {
-          setup_property_ply(in_ply, &face_props[1]);
-        }
-      }
-
-      face_other = get_other_properties_ply (in_ply,
-                                             offsetof(Face,other_props));
-
-      /* grab all the face elements */
-      for (j=0; j<nfaces; j++) {
-        flist[j] = (Face *) calloc(1, sizeof(Face));
-        get_element_ply(in_ply, (void *) flist[j]);
-      }
-    } else {
-      printf("plyplugin) reading other elements...\n");
-      get_other_element_ply(in_ply);
-    } 
-  }
-
-  printf("plyplugin) freeing PLY structures\n");
-  free_ply(in_ply);
-  in_ply = NULL;
-
-  printf("plyplugin) generating %d graphics primitives...\n", nfaces); 
-  ply->graphics = new molfile_graphics_t[2*nfaces];
-  int vert1, vert2, vert3;
-
-  for (i=0; i<nfaces; i++) {
-    if (flist[i]->nverts != 3) {
-      printf("plyplugin) Found non-triangle facet, aborting.\n");
-      return MOLFILE_ERROR;
-    }
-    vert1 = flist[i]->verts[0];
-    vert2 = flist[i]->verts[1];
-    vert3 = flist[i]->verts[2];
-
-    if (vert1 <      0  || vert2 <      0  || vert3 <       0 ||
-        vert1 >= nverts || vert2 >= nverts || vert3 >= nverts) {
-      printf("plyplugin) Error, out-of-range vertex index, aborting.\n"); 
-      return MOLFILE_ERROR;
-    }
-
-    ply->graphics[i].type = MOLFILE_TRIANGLE;
-    float *tridata =  ply->graphics[i].data;
-    tridata[0] = vlist[vert1]->x;
-    tridata[1] = vlist[vert1]->y;
-    tridata[2] = vlist[vert1]->z;
-    tridata[3] = vlist[vert2]->x;
-    tridata[4] = vlist[vert2]->y;
-    tridata[5] = vlist[vert2]->z;
-    tridata[6] = vlist[vert3]->x;
-    tridata[7] = vlist[vert3]->y;
-    tridata[8] = vlist[vert3]->z;
-  } 
-
-  *nelem = nfaces;
-  *data = ply->graphics;
-
-  printf("plyplugin) freeing ply face list\n");
-  for (i=0; i<nfaces; i++) {
-    free(flist[i]);
-  }
-  memset(flist, 0, sizeof(Face *)*nfaces);
-  free(flist);
-  flist = NULL;
-
-  printf("plyplugin) freeing ply vertex list\n");
-  for (i=0; i<nverts; i++) {
-    free(vlist[i]);
-  }
-  memset(vlist, 0, sizeof(float *)*nverts);
-  free(vlist);
-  vlist=NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  ply_t *ply = (ply_t *)v;
-  // close_ply(in_ply);
-  fclose(ply->fd);
-  
-  delete [] ply->graphics;
-  delete ply;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "ply";
-  plugin.prettyname = "PLY";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "ply";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pqrplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pqrplugin.c
deleted file mode 100644
index e9064732f784666a52fe3f6954788d3ae64640db..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/pqrplugin.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pqrplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.21 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * PQR is be a space-delimited variant of the PDB format, with atom radius
- * and charge information replacing the B-factor and occupancy columns, and
- * containing only ATOM records.
- *
- * Most of this code is lifted from pdbplugin and readpdb.h
- */
-
-#include "molfile_plugin.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define PQR_RECORD_LENGTH 80
-
-/*  record type defines */
-enum {PQR_REMARK, PQR_ATOM, PQR_UNKNOWN, PQR_END, PQR_EOF, PQR_ERROR, PQR_CRYST1};
-
-/* 
- * read the next record from the specified pqr file, and put the string
- * found in the given string pointer (the caller must provide adequate (81
- * chars) buffer space); return the type of record found
- */
-static int read_pqr_record(FILE *f, char *retStr) {
-
-  char inbuf[PQR_RECORD_LENGTH+2];
-  int recType = PQR_UNKNOWN;
- 
-  /* XXX This PQR record reading code breaks with files that use
-   * Mac or DOS style line breaks with ctrl-M characters.  We need
-   * to replace the use of fgets() and comparisons against \n with
-   * code that properly handles the other cases.
-   */
- 
-  /*  read the next line  */
-  if(inbuf != fgets(inbuf, PQR_RECORD_LENGTH+1, f)) {
-    retStr[0] = '\0';
-    if (feof(f)) {
-      recType = PQR_EOF;
-    }
-    else {
-      recType = PQR_ERROR;
-    }
-  } 
-  else {
-    /*  remove the newline character, if there is one */
-    if(inbuf[strlen(inbuf)-1] == '\n')
-      inbuf[strlen(inbuf)-1] = '\0';
-
-    if (!strncmp(inbuf, "ATOM ",  5) || !strncmp(inbuf, "HETATM", 6)) {
-      /* Note that by only comparing 5 chars for "ATOM " rather than 6,     */
-      /* we allow PQR files containing > 99,999 atoms generated by AMBER    */
-      /* to load which would otherwise fail.  Not needed for HETATM since   */
-      /* those aren't going to show up in files produced for/by MD engines. */
-      strcpy(retStr,inbuf);
-      recType = PQR_ATOM;
-    } else if (!strncmp(inbuf, "CRYST1", 6)) {
-      recType = PQR_CRYST1;
-      strcpy(retStr,inbuf);
-    } else if (!strncmp(inbuf, "END", 3)) {
-      strcpy(retStr,inbuf);
-      recType = PQR_END;
-    } else {
-      retStr[0] = '\0';
-      recType = PQR_UNKNOWN;
-    }
-  }
-
-  /* read the '\r', if there was one */
-  {
-    int ch = fgetc(f);
-    if (ch != '\r') {
-      ungetc(ch, f);
-    }
-  }
-  
-  return recType;
-}
-
-/* Extract the alpha/beta/gamma a/b/c unit cell info from a CRYST1 record */
-static void get_pqr_cryst1(const char *record, 
-                           float *alpha, float *beta, float *gamma, 
-                           float *a, float *b, float *c) {
-  char tmp[PQR_RECORD_LENGTH+3]; /* space for line + cr + lf + NUL */
-  char ch, *s;
-  memset(tmp, 0, sizeof(tmp));
-  strncpy(tmp, record, PQR_RECORD_LENGTH);
-
-  s = tmp+6 ;          ch = tmp[15]; tmp[15] = 0;
-  *a = (float) atof(s);
-  s = tmp+15; *s = ch; ch = tmp[24]; tmp[24] = 0;
-  *b = (float) atof(s);
-  s = tmp+24; *s = ch; ch = tmp[33]; tmp[33] = 0;
-  *c = (float) atof(s);
-  s = tmp+33; *s = ch; ch = tmp[40]; tmp[40] = 0;
-  *alpha = (float) atof(s);
-  s = tmp+40; *s = ch; ch = tmp[47]; tmp[47] = 0;
-  *beta = (float) atof(s);
-  s = tmp+47; *s = ch; ch = tmp[54]; tmp[54] = 0;
-  *gamma = (float) atof(s);
-}
-
-/*
- * Read the fields in an ATOM line. Return 0 on success, nonzero otherwise.
- */
-static int get_pqr_fields(char *record, char *name, char *resname, char *chain,
-    char *segname, char *resid,
-    float *x, float *y, float *z, float *charge, float *radius) {
-
-  /*
-   * PQR files are like pdb files, but not quite.  They're fixed format
-   * for the the identifier data up to resid, but after that it's free-format
-   * for the floating point data.
-   */
-  strncpy(name, record+12, 4);    name[4] = 0;
-  strncpy(resname, record+17, 4); resname[4] = 0;
-  strncpy(chain, record+21, 1);   chain[1] = 0;
-  strncpy(resid, record+22, 4);   resid[4] = 0;
-  /* XXX what to do about the segid? */
-  segname[0] = 0;
-
-  if (sscanf(record+30, "%f%f%f%f%f", x, y, z, charge, radius) != 5) {
-    return 1;
-  }
-  /* success */
-  return 0;
-}
-
-/*
- * Read the coordinates in an ATOM line. Return 0 on success, nonzero otherwise.
- */
-static int get_pqr_coordinates(char *record, float *x, float *y, float *z) {
-  /* skip over the fixed format part and only parse the coordinates */
-  if (sscanf(record+30, "%f%f%f", x, y, z) != 3) {
-    return 1;
-  } 
-  return 0;
-}
-
-/*
- * Return a default radius for the given atom.
- */
-static float get_atom_radius(molfile_atom_t *atom) {
-  char *name, *type;
-  name = atom->name;
-  type = atom->type;
-
-  /* XXX - yeah, this needs to be fixed */
-  return 1.0;
-}
-
-/*
- * Append a PQR ATOM record to the given file.
- */
-static int write_pqr_atom(FILE *fd, int index, const molfile_atom_t *atom, 
-                   float x, float y, float z) {
-  int rc;
-
-  rc = fprintf(fd, "ATOM  %5d %-4s %s %5d    %8.3f %8.3f %8.3f %.3f %.3f\n",
-               index, atom->name, atom->resname, atom->resid, 
-               x, y, z, atom->charge, atom->radius);
-
-  return (rc > 0);
-}
-
-
-/*
- * API functions start here
- */
-
-typedef struct {
-  FILE *fd;
-  int natoms;
-  molfile_atom_t *atomlist;
-} pqrdata;
-
-static void *open_pqr_read(const char *filepath, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  pqrdata *pqr;
-  char pqr_record[PQR_RECORD_LENGTH+2];
-  int record_type;
-
-  fd = fopen(filepath, "r");
-  if (!fd) 
-    return NULL;
-  pqr = (pqrdata *)malloc(sizeof(pqrdata));
-  pqr->fd = fd;
-
-  *natoms=0;
-  do {
-    record_type = read_pqr_record(pqr->fd, pqr_record);
-    if (record_type == PQR_ATOM) {
-      *natoms += 1;
-    } else if (record_type == PQR_ERROR) {
-      printf("pqrplugin) Error reading file after opening.\n");
-      free(pqr);
-      return NULL;
-    }
-  } while ((record_type != PQR_EOF) && (record_type != PQR_END));
-
-  /* If no atoms were found, this is probably not a PQR file! */
-  if (!*natoms) {
-    printf("pqrplugin) file '%s' contains no atoms.\n", filepath);
-    free(pqr);
-    return NULL;
-  }
-
-  rewind(pqr->fd);
-  pqr->natoms = *natoms;
-  return pqr; 
-}
-
-/* 
- * Read atom structure, but not coordinate information.
- */
-static int read_pqr_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) { 
-  pqrdata *pqr = (pqrdata *)mydata;
-  molfile_atom_t *atom;
-  char pqr_record[PQR_RECORD_LENGTH + 1];
-  int i, record_type;
-  char ridstr[8];
-  float newpos;
-  long fpos = ftell(pqr->fd);
- 
-  *optflags = MOLFILE_CHARGE | MOLFILE_RADIUS;
-
-  i = 0;
-  do {
-    record_type = read_pqr_record(pqr->fd, pqr_record);
-    if (((record_type == PQR_EOF) || (record_type == PQR_END)) 
-        && (i < pqr->natoms)) {
-      printf("pqrplugin) unexpected end-of-file while reading structure.\n");
-printf("XXX: %d of %d \n", i, pqr->natoms);
-      return MOLFILE_ERROR;
-    } else if (record_type == PQR_ERROR) {
-      printf("pqrplugin) error reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    } else if (record_type == PQR_ATOM) {
-      if (i >= pqr->natoms) {
-        printf("pqrplugin) too many atoms.\n");
-        return MOLFILE_ERROR;
-      }
-      atom = atoms+i;
-      get_pqr_fields(pqr_record, atom->name, atom->resname, atom->chain, 
-          atom->segid, ridstr,
-          &newpos, &newpos, &newpos, &atom->charge, &atom->radius);
-      atom->resid = atoi(ridstr);
-      strcpy(atom->type, atom->name);
-      i++;
-    }
-  } while((record_type != PQR_EOF) && (record_type != PQR_END));
-
-  fseek(pqr->fd, fpos, SEEK_SET);
-
-  return MOLFILE_SUCCESS;
-}
-
-/* 
- * Read atom coordinates. PQR files contain only a single "timestep".
- */
-static int read_pqr_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pqrdata *pqr = (pqrdata *)v;
-  char pqr_record[PQR_RECORD_LENGTH+2];
-  int record_type, i;
-  float *x, *y, *z;
-
-  if (pqr->natoms == 0) 
-    return MOLFILE_ERROR; /* EOF */
-
-  if (ts != NULL) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = NULL;
-  }
-
-  i = 0;
-  do {
-    record_type = read_pqr_record(pqr->fd, pqr_record);
-    if (((record_type == PQR_EOF) || (record_type == PQR_END)) 
-        && (i < pqr->natoms)) {
-      if (i == 0) {
-        /* don't emit an error if there're no more timesteps */
-        return MOLFILE_EOF;
-      } else {
-        printf("pqrplugin) unexpected end-of-file while reading timestep.\n");
-        return MOLFILE_ERROR;
-      }
-    } else if (record_type == PQR_ERROR) {
-      printf("pqrplugin) error reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    } else if (record_type == PQR_CRYST1) {
-      if (ts) {
-        get_pqr_cryst1(pqr_record, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    } else if (record_type == PQR_ATOM) {
-      /* just get the coordinates, and store them */
-      if (ts != NULL) {
-        get_pqr_coordinates(pqr_record, x, y, z);
-        x += 3;
-        y += 3;
-        z += 3;
-      } 
-      i++;
-    }
-  } while(i < pqr->natoms);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pqr_read(void *v) { 
-  pqrdata *pqr = (pqrdata *)v;
-  if (pqr->fd) {
-    fclose(pqr->fd);
-    pqr->fd = 0;
-  }
-  free(pqr);
-}
-
-static void *open_pqr_write(const char *path, const char *filetype, 
-    int natoms) {
-  FILE *fd;
-  pqrdata *pqr;
-  fd = fopen(path, "w");
-  if (!fd) {
-    printf("pqrplugin) unable to open file %s for writing\n", path);
-    return NULL;
-  }
-
-  pqr = (pqrdata *)malloc(sizeof(pqrdata));
-  pqr->fd = fd;
-  pqr->natoms = natoms; 
-  pqr->atomlist = NULL;
-  return pqr;
-}
- 
-static int write_pqr_structure(void *v, int optflags, 
-    const molfile_atom_t *atoms) {
-  int i;
-  pqrdata *pqr = (pqrdata *)v;
-  int natoms = pqr->natoms;
-  pqr->atomlist = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-
-  memcpy(pqr->atomlist, atoms, natoms*sizeof(molfile_atom_t));
-
-  /* If charge and radius aren't given, we assign defaultvalues. */
-  if (!(optflags & MOLFILE_CHARGE)) {
-    printf("pqrplugin) Warning no atom charges available, assigning zero\n");
-    for (i=0; i<natoms; i++) pqr->atomlist[i].charge = 0.0f;
-  }
-  if (!(optflags & MOLFILE_RADIUS)) {
-    printf("pqrplugin) Warning no atom radii available, assigning radii of 1.0\n");
-    for (i=0; i<natoms; i++) pqr->atomlist[i].radius = 
-      get_atom_radius(&(pqr->atomlist[i]));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void write_pqr_cryst1(FILE *fd, const molfile_timestep_t *ts) {
-  fprintf(fd, "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f P 1           1\n", 
-    ts->A, ts->B, ts->C, ts->alpha, ts->beta, ts->gamma);
-}
-
-static int write_pqr_timestep(void *v, const molfile_timestep_t *ts) {
-  pqrdata *pqr = (pqrdata *)v; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-
-  if (pqr->natoms == 0)
-    return MOLFILE_SUCCESS;
-
-  write_pqr_cryst1(pqr->fd, ts);
-  atom = pqr->atomlist;
-  pos = ts->coords;
-  for (i=0; i<pqr->natoms; i++) {
-    if (!write_pqr_atom(pqr->fd, i+1, atom, pos[0], pos[1], pos[2])) {
-      printf("pqrplugin) error writing atom %d; file may be incomplete.\n", i+1);
-      return MOLFILE_ERROR;
-    }
-    atom++;
-    pos += 3;
-  }
-
-  fprintf(pqr->fd, "END\n");
-
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_pqr_write(void *v) {
-  pqrdata *pqr = (pqrdata *)v; 
-  fclose(pqr->fd);
-  free(pqr->atomlist);
-  free(pqr);
-}
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pqr";
-  plugin.prettyname = "PQR";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "pqr";
-  plugin.open_file_read = open_pqr_read;
-  plugin.read_structure = read_pqr_structure;
-  plugin.read_next_timestep = read_pqr_timestep;
-  plugin.close_file_read = close_pqr_read;
-  plugin.open_file_write = open_pqr_write;
-  plugin.write_structure = write_pqr_structure;
-  plugin.write_timestep = write_pqr_timestep;
-  plugin.close_file_write = close_pqr_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/psfplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/psfplugin.c
deleted file mode 100644
index 012a161fdcb68126dd6313364533f860210dc986..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/psfplugin.c
+++ /dev/null
@@ -1,1113 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: psfplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.83 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include "molfile_plugin.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "fortread.h"
-
-#define PSF_RECORD_LENGTH 256  /* extended to handle Charmm CMAP/CHEQ/DRUDE */
-
-typedef struct {
-  FILE *fp;
-  int numatoms;
-  int namdfmt;     /* NAMD-specific PSF file                                */
-  int charmmfmt;   /* whether psf was written in charmm format              */
-  int charmmcmap;  /* cross-term maps                                       */
-  int charmmcheq;  /* stuff used by charmm for polarizable force fields     */
-  int charmmext;   /* flag used by charmm for IOFOrmat EXTEnded             */
-  int charmmdrude; /* flag used by charmm for Drude polarizable force field */
-  int nbonds;
-  int *from, *to;
-  int numangles, *angles;
-  int numdihedrals, *dihedrals;
-  int numimpropers, *impropers;
-  int numcterms, *cterms;
-} psfdata;
-
-
-/* Formatted reads:
- *
- * copy at most 'maxlen' characters from source to target allowing overflow.
- *
- * leading white space up to 'len' is skipped over but counts towards 'maxlen'.
- * the copy stops at first whitspace or a '\0'.
- * unlike strncpy(3) the result will always be \0 terminated.
- *
- * intended for copying (short) strings from formatted fortran
- * i/o files that must not contain whitespace (e.g. residue names,
- * atom name/types etc. in .pdb, .psf and alike.).
- *
- * returns number of bytes of overflow.
- */
-static int strnwscpy_shift(char *target, const char *source,
-                           const int len, const int maxlen) {
-  int i, c;
-
-  for (i=0, c=0; i<maxlen; ++i) {
-    if (*source == '\0' || (c > 0 && *source == ' ') || (c == 0 && i == len)) {
-      break;
-    }
-
-    if (*source == ' ') {
-      source++;
-    } else {
-      *target++ = *source++;
-      c++;
-    }
-  }
-  *target = '\0';
-  return ( i > len ? i - len : 0 );
-}
-
-/* atoi() replacement
- *
- * reads int with field width fw handling various overflow cases to
- * support both " %7d %7d" and "%8d%8d" writers up to 100M atoms.
- *
- */
-
-static int atoifw(char **ptr, int fw) {
-  char *op = *ptr;
-  int ival = 0;
-  int iws = 0;
-  char tmpc;
-
-  sscanf(op, "%d%n", &ival, &iws);
-  if ( iws == fw ) { /* "12345678 123..." or " 1234567 123..." */
-    *ptr += iws;
-  } else if ( iws < fw ) { /* left justified? */
-    while ( iws < fw && op[iws] == ' ' ) ++iws;
-    *ptr += iws;
-  } else if ( iws < 2*fw ) { /* " 12345678 123..." */
-    *ptr += iws;
-  } else { /* " 123456712345678" or "1234567812345678" */
-    tmpc = op[fw];  op[fw] = '\0';
-    ival = atoi(op);
-    op[fw] = tmpc;
-    *ptr += fw;
-  }
-  return ival;
-}
-
-
-/* Read in the next atom info into the given storage areas; this assumes
-   that file has already been moved to the beginning of the atom records.
-   Returns the serial number of the atom. If there is an error, returns -1.*/
-static int get_psf_atom(FILE *f, char *name, char *atype, char *resname,
-                        char *segname, int *resid, char *insertion, float *q, float *m, 
-                        int namdfmt, int charmmext, int charmmdrude) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  int num;
-
-  if (inbuf != fgets(inbuf, PSF_RECORD_LENGTH+1, f)) {
-    return(-1); /* failed to read in an atom */
-  }
-
-  if (strlen(inbuf) < 50) {
-    fprintf(stderr, "Line too short in psf file: \n%s\n", inbuf);
-    return -1;
-  }
-
-  num = atoi(inbuf); /* atom index */
-
-  if (namdfmt == 1) {
-    int cnt, rcnt;
-    char residstr[12], trash;
-    cnt = sscanf(inbuf, "%d %7s %10s %7s %7s %7s %f %f",
-                 &num, segname, residstr, resname, name, atype, q, m);
-    insertion[0] = ' ';  insertion[1] = '\0';
-    rcnt = sscanf(residstr, "%d%c%c", resid, insertion, &trash);
-    if (cnt != 8 || rcnt < 1 || rcnt > 2) {
-      printf("psfplugin) Failed to parse atom line in NAMD PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-  } else if (charmmdrude == 1 || charmmext == 1) {
-    int xplorshift;
-    /* CHARMM PSF format is (if DRUDE or (?) CHEQ are enabled):
-     *  '(I10,1X,A8,1X,A8,1X,A8,1X,A8,1X,I4,1X,2G14.6,I8,2G14.6)'
-     */
-    if ( inbuf[10] != ' ' ||
-         inbuf[19] != ' ' ||
-         inbuf[28] != ' ' ||
-         inbuf[37] != ' ' ||
-         inbuf[46] != ' ' ) {
-      printf("psfplugin) Failed to parse atom line in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-
-    strnwscpy(segname, inbuf+11, 7);
-    strnwscpy(resname, inbuf+29, 7);
-    strnwscpy(name, inbuf+38, 7);
-
-    xplorshift = 0;
-    strnwscpy(atype, inbuf+47, 4);
-    if ( ! isdigit(atype[0]) ) {
-      strnwscpy(atype, inbuf+47, 6);
-      xplorshift = 2;
-    }
-
-    if ( inbuf[51+xplorshift] != ' ' ) {
-      printf("psfplugin) Failed to parse atom line in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    
-    insertion[0] = ' ';  insertion[1] = '\0';
-    sscanf(inbuf+20, "%d%c", resid, insertion);
-    *q = (float) atof(inbuf+52+xplorshift);
-    *m = (float) atof(inbuf+66+xplorshift);
-    // data we don't currently read:
-    // if (charmmdrude == 1) {
-    //   *imove = atoi(inbuf+80+xplorshift);
-    //   *alphadp = atof(inbuf+88+xplorshift);
-    //   *tholei = atof(inbuf+102+xplorshift);
-    // }
-  } else {
-    /* CHARMM PSF format is 
-     *  '(I8,1X,A4,1X,A4,1X,A4,1X,A4,1X,I4,1X,2G14.6,I8)'
-     */
-    const char *rdbuf = inbuf;
-    char intbuf[16];
-
-    intbuf[0] = '\0';
-    rdbuf += strnwscpy_shift(intbuf, rdbuf, 8, 10);
-    if ( rdbuf[8] != ' ' ) {
-      printf("psfplugin) Failed to parse atom index in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(segname, rdbuf+9, 4, 7);
-    if ( rdbuf[13] != ' ' ) {
-      printf("psfplugin) Failed to parse segname in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    intbuf[0] = '\0';
-    rdbuf += strnwscpy_shift(intbuf, rdbuf+14, 4, 8);
-    insertion[0] = ' ';  insertion[1] = '\0';
-    sscanf(intbuf, "%d%c", resid, insertion);
-    if ( rdbuf[18] != ' ' ) {
-      printf("psfplugin) Failed to parse resid in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(resname, rdbuf+19, 4, 7);
-    if ( rdbuf[23] != ' ' ) {
-      printf("psfplugin) Failed to parse resname in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(name, rdbuf+24, 4, 7);
-    if ( rdbuf[28] != ' ' ) {
-      printf("psfplugin) Failed to parse atom name in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(atype, rdbuf+29, 4, 7);
-    if ( rdbuf[33] != ' ' ) {
-      printf("psfplugin) Failed to parse atom type in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    *q = (float) atof(rdbuf+34);
-    *m = (float) atof(rdbuf+48);
-  }
-
-#if 0
-  /* if this is a Charmm31 PSF file, there may be two extra */
-  /* columns containing polarizable force field data.       */
-  if (psf->charmmcheq) {
-    /* do something to read in these columns here */
-  }
-#endif
-
-  return num;
-}
-
-
-/*
- * Read in the beginning of the bond/angle/dihed/etc information,
- * but don't read in the data itself.  Returns the number of the record type
- * for the molecule.  If error, returns (-1). 
- */
-static int psf_start_block(FILE *file, const char *blockname) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  int nrec = -1;
-  
-  /* check if we had a parse error earlier, which is indicated
-     by the file descriptor set to NULL */
-  if (!file)
-    return -1;
-
-  /* keep reading the next line until a line with blockname appears */
-  do {
-    if(inbuf != fgets(inbuf, PSF_RECORD_LENGTH+1, file)) {
-      /* EOF encountered with no blockname line found ==> error, return (-1) */
-      return -1;
-    }
-    if(strlen(inbuf) > 0 && strstr(inbuf, blockname))
-      nrec = atoi(inbuf);
-  } while (nrec == -1);
-
-  return nrec;
-}
-
-
-/* Read in the bond info into the given integer arrays, one for 'from' and
-   one for 'to' atoms; remember that .psf files use 1-based indices,
-   not 0-based.  Returns 1 if all nbond bonds found; 0 otherwise.  */
-static int psf_get_bonds(FILE *f, int nbond, int fromAtom[], int toAtom[], int charmmext, int namdfmt) {
-  char *bondptr=NULL;
-  int fw = charmmext ? 10 : 8;
-  char inbuf[PSF_RECORD_LENGTH+2];
-  int i=0;
-  size_t minlinesize;
-  int rc=0;
-
-  while (i < nbond) {
-    if (namdfmt) {
-      // NAMD assumes a space-delimited variant of the PSF file format
-      int cnt = fscanf(f, "%d %d", &fromAtom[i], &toAtom[i]);
-      if (cnt < 2) {
-        fprintf(stderr, "Bonds line too short in NAMD psf file.\n");
-        break;
-      }
-    } else {
-      if ((i % 4) == 0) {
-        /* must read next line */
-        if (!fgets(inbuf, PSF_RECORD_LENGTH+2, f)) {
-          /* early EOF encountered */
-          break;
-        }
-
-        /* Check that there is enough space in the line we are about to read */
-        if (nbond-i >= 4) {
-          minlinesize = 2*fw*4; 
-        } else {
-          minlinesize = 2*fw*(nbond-i); 
-        }
-
-        if (strlen(inbuf) < minlinesize) {
-          fprintf(stderr, "Bonds line too short in psf file: \n%s\n", inbuf);
-          break;
-        }
-        bondptr = inbuf;
-      }
-
-      if ((fromAtom[i] = atoifw(&bondptr,fw)) < 1) {
-        printf("psfplugin) ERROR: Bond %d references atom with index < 1!\n", i);
-        rc=-1;
-        break;
-      }
-  
-      if ((toAtom[i] = atoifw(&bondptr,fw)) < 1) {
-        printf("psfplugin) ERROR: Bond %d references atom with index < 1!\n", i);
-        rc=-1;
-        break;
-      }
-    }
-
-    i++;
-  }
-
-  if (rc == -1) {
-    printf("psfplugin) ERROR: skipping bond info due to bad atom indices\n");
-  } else if (i != nbond) {
-    printf("psfplugin) ERROR: unable to read the specified number of bonds!\n");
-    printf("psfplugin) Expected %d bonds but only read %d\n", nbond, i);
-  }
-
-  return (i == nbond);
-}
-
-
-/*
- * API functions
- */
-
-static void *open_psf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fp;
-  char inbuf[PSF_RECORD_LENGTH*8+2];
-  psfdata *psf;
-  const char *progname = "Charmm";
-  
-  /* Open the .psf file and skip past the remarks to the first data section.
-   * Returns the file pointer, or NULL if error.  Also puts the number of
-   * atoms in the molecule into the given integer.  
-   */
-  if (!path)
-    return NULL;
-
-  if ((fp = fopen(path, "r")) == NULL) {
-    fprintf(stderr, "Couldn't open psf file %s\n", path);
-    return NULL;
-  }
-
-  *natoms = MOLFILE_NUMATOMS_NONE; /* initialize to none */
-
-  psf = (psfdata *) malloc(sizeof(psfdata));
-  memset(psf, 0, sizeof(psfdata));
-  psf->fp = fp;
-  psf->namdfmt = 0;   /* off unless we discover otherwise */
-  psf->charmmfmt = 0; /* off unless we discover otherwise */
-  psf->charmmext = 0; /* off unless we discover otherwise */
-
-  /* read lines until a line with NATOM and without REMARKS appears    */
-  do {
-    /* be prepared for long lines from CNS remarks */
-    if (inbuf != fgets(inbuf, PSF_RECORD_LENGTH*8+1, fp)) {
-      /* EOF encountered with no NATOM line found ==> error, return null */
-      *natoms = MOLFILE_NUMATOMS_NONE;
-      fclose(fp);
-      free(psf);
-      return NULL;
-    }
-
-    if (strlen(inbuf) > 0) {
-      if (!strstr(inbuf, "REMARKS")) {
-        if (strstr(inbuf, "PSF")) {
-          if (strstr(inbuf, "NAMD")) {
-            psf->namdfmt = 1;      
-          }
-          if (strstr(inbuf, "EXT")) {
-            psf->charmmfmt = 1; 
-            psf->charmmext = 1;      
-          }
-          if (strstr(inbuf, "CHEQ")) {
-            psf->charmmfmt = 1; 
-            psf->charmmcheq = 1;      
-          }
-          if (strstr(inbuf, "CMAP")) {
-            psf->charmmfmt = 1; 
-            psf->charmmcmap = 1;      
-          }
-          if (strstr(inbuf, "DRUDE")) {
-            psf->charmmfmt = 1; 
-            psf->charmmdrude = 1;      
-          }
-        } else if (strstr(inbuf, "NATOM")) {
-          *natoms = atoi(inbuf);
-        }
-      } 
-    }
-  } while (*natoms == MOLFILE_NUMATOMS_NONE);
-
-  if (psf->namdfmt) {
-    progname = "NAMD";
-  } else {
-    progname = "Charmm";
-  }
-  if (psf->charmmcheq || psf->charmmcmap) {
-    printf("psfplugin) Detected a %s PSF file\n", progname);
-  }
-  if (psf->charmmext) {
-    printf("psfplugin) Detected a %s PSF EXTEnded file\n", progname);
-  }
-  if (psf->charmmdrude) {
-    printf("psfplugin) Detected a %s Drude polarizable force field file\n", progname);
-    printf("psfplugin) WARNING: Support for Drude FF is currently experimental\n");
-  }
-
-  psf->numatoms = *natoms;
-
-  return psf;
-}
-
-static int read_psf(void *v, int *optflags, molfile_atom_t *atoms) {
-  psfdata *psf = (psfdata *)v;
-  int i;
-  
-  /* we read in the optional mass and charge data */
-  *optflags = MOLFILE_INSERTION | MOLFILE_MASS | MOLFILE_CHARGE;
-
-  for (i=0; i<psf->numatoms; i++) {
-    molfile_atom_t *atom = atoms+i; 
-    if (get_psf_atom(psf->fp, atom->name, atom->type, 
-                     atom->resname, atom->segid,
-                     &atom->resid, atom->insertion, &atom->charge, &atom->mass, 
-                     psf->namdfmt, psf->charmmext, psf->charmmdrude) < 0) {
-      fprintf(stderr, "couldn't read atom %d\n", i);
-      fclose(psf->fp);
-      psf->fp = NULL;
-      return MOLFILE_ERROR;
-    }
-    atom->chain[0] = atom->segid[0];
-    atom->chain[1] = '\0';
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                      float **bondorder, int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  psfdata *psf = (psfdata *)v;
-
-  *nbonds = psf_start_block(psf->fp, "NBOND"); /* get bond count */
-
-  if (*nbonds > 0) {
-    psf->from = (int *) malloc(*nbonds*sizeof(int));
-    psf->to = (int *) malloc(*nbonds*sizeof(int));
-
-    if (!psf_get_bonds(psf->fp, *nbonds, psf->from, psf->to, 
-                       psf->charmmext, psf->namdfmt)) {
-      fclose(psf->fp);
-      psf->fp = NULL;
-      return MOLFILE_ERROR;
-    }
-    *fromptr = psf->from;
-    *toptr = psf->to;
-    *bondorder = NULL; /* PSF files don't provide bond order or type information */
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  } else {
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorder = NULL; /* PSF files don't provide bond order or type information */
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-    printf("psfplugin) WARNING: no bonds defined in PSF file.\n");
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int psf_get_angles(FILE *f, int n, int *angles, int charmmext) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  char *bondptr = NULL;
-  int fw = charmmext ? 10 : 8;
-  int i=0;
-  while (i<n) {
-    if((i % 3) == 0) {
-      /* must read next line */
-      if(!fgets(inbuf,PSF_RECORD_LENGTH+2,f)) {
-        /* early EOF encountered */
-        break;
-      }
-      bondptr = inbuf;
-    }
-    if((angles[3*i] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((angles[3*i+1] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((angles[3*i+2] = atoifw(&bondptr,fw)) < 1)
-      break;
-    i++;
-  }
-
-  return (i != n);
-}
-
-
-static int psf_get_dihedrals_impropers(FILE *f, int n, int *dihedrals, int charmmext) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  char *bondptr = NULL;
-  int fw = charmmext ? 10 : 8;
-  int i=0;
-  while (i<n) {
-    if((i % 2) == 0) {
-      /* must read next line */
-      if(!fgets(inbuf,PSF_RECORD_LENGTH+2,f)) {
-        /* early EOF encountered */
-        break;
-      }
-      bondptr = inbuf;
-    }
-    if((dihedrals[4*i] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((dihedrals[4*i+1] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((dihedrals[4*i+2] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((dihedrals[4*i+3] = atoifw(&bondptr,fw)) < 1)
-      break;
-    i++;
-  }
-
-  return (i != n);
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int read_angles(void *v, int *numangles, int **angles, 
-                       int **angletypes, int *numangletypes, 
-                       char ***angletypenames, int *numdihedrals,
-                       int **dihedrals, int **dihedraltypes, 
-                       int *numdihedraltypes, char ***dihedraltypenames,
-                       int *numimpropers, int **impropers, 
-                       int **impropertypes, int *numimpropertypes, 
-                       char ***impropertypenames, int *numcterms, 
-                       int **cterms, int *ctermcols, int *ctermrows) {
-  psfdata *psf = (psfdata *)v;
-
-  /* initialize data to zero */
-  *numangles         = 0;
-  *angles            = NULL;
-  *angletypes        = NULL;
-  *numangletypes     = 0;
-  *angletypenames    = NULL;
-  *numdihedrals      = 0;
-  *dihedrals         = NULL;
-  *dihedraltypes     = NULL;
-  *numdihedraltypes  = 0;
-  *dihedraltypenames = NULL;
-  *numimpropers      = 0;
-  *impropers         = NULL;
-  *impropertypes     = NULL;
-  *numimpropertypes  = 0;
-  *impropertypenames = NULL;
-  *numcterms         = 0;
-  *cterms            = NULL;
-  *ctermrows         = 0;
-  *ctermcols         = 0;
-
-  psf->numangles    = psf_start_block(psf->fp, "NTHETA"); /* get angle count */
-  if (psf->numangles > 0) {
-    psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-    psf_get_angles(psf->fp, psf->numangles, psf->angles, psf->charmmext);
-  } else {
-    printf("psfplugin) WARNING: no angles defined in PSF file.\n");
-  }
- 
-  psf->numdihedrals = psf_start_block(psf->fp, "NPHI");   /* get dihed count */
-  if (psf->numdihedrals > 0) {
-    psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numdihedrals, psf->dihedrals, psf->charmmext);
-  } else {
-    printf("psfplugin) WARNING: no dihedrals defined in PSF file.\n");
-  }
- 
-  psf->numimpropers = psf_start_block(psf->fp, "NIMPHI"); /* get imprp count */
-  if (psf->numimpropers > 0) {
-    psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numimpropers, psf->impropers, psf->charmmext);
-  } else {
-    printf("psfplugin) WARNING: no impropers defined in PSF file.\n");
-  }
-
-  psf->numcterms = psf_start_block(psf->fp, "NCRTERM"); /* get cmap count */
-  if (psf->numcterms > 0) {
-    psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-
-    /* same format as dihedrals, but double the number of terms */
-    psf_get_dihedrals_impropers(psf->fp, psf->numcterms * 2, psf->cterms, psf->charmmext);
-  } else {
-    printf("psfplugin) no cross-terms defined in PSF file.\n");
-  }
-
-  *numangles = psf->numangles;
-  *angles = psf->angles;
-
-  *numdihedrals = psf->numdihedrals;
-  *dihedrals = psf->dihedrals;
-
-  *numimpropers = psf->numimpropers;
-  *impropers = psf->impropers;
-
-  *numcterms = psf->numcterms;
-  *cterms = psf->cterms;
-
-  *ctermcols = 0;
-  *ctermrows = 0;
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_angles(void *v,
-               int *numangles,    int **angles,    double **angleforces,
-               int *numdihedrals, int **dihedrals, double **dihedralforces,
-               int *numimpropers, int **impropers, double **improperforces,
-               int *numcterms,    int **cterms,
-               int *ctermcols,    int *ctermrows,  double **ctermforces) {
-  psfdata *psf = (psfdata *)v;
-
-  psf->numangles    = psf_start_block(psf->fp, "NTHETA"); /* get angle count */
-  if (psf->numangles > 0) {
-    psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-    psf_get_angles(psf->fp, psf->numangles, psf->angles);
-  } else {
-    printf("psfplugin) WARNING: no angles defined in PSF file.\n");
-  }
- 
-  psf->numdihedrals = psf_start_block(psf->fp, "NPHI");   /* get dihed count */
-  if (psf->numdihedrals > 0) {
-    psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numdihedrals, psf->dihedrals);
-  } else {
-    printf("psfplugin) WARNING: no dihedrals defined in PSF file.\n");
-  }
- 
-  psf->numimpropers = psf_start_block(psf->fp, "NIMPHI"); /* get imprp count */
-  if (psf->numimpropers > 0) {
-    psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numimpropers, psf->impropers);
-  } else {
-    printf("psfplugin) WARNING: no impropers defined in PSF file.\n");
-  }
-
-  psf->numcterms = psf_start_block(psf->fp, "NCRTERM"); /* get cmap count */
-  if (psf->numcterms > 0) {
-    psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-
-    /* same format as dihedrals, but double the number of terms */
-    psf_get_dihedrals_impropers(psf->fp, psf->numcterms * 2, psf->cterms);
-  } else {
-    printf("psfplugin) no cross-terms defined in PSF file.\n");
-  }
-
-  *numangles = psf->numangles;
-  *angles = psf->angles;
-  *angleforces = NULL;
-
-  *numdihedrals = psf->numdihedrals;
-  *dihedrals = psf->dihedrals;
-  *dihedralforces = NULL;
-
-  *numimpropers = psf->numimpropers;
-  *impropers = psf->impropers;
-  *improperforces = NULL;
-
-  *numcterms = psf->numcterms;
-  *cterms = psf->cterms;
-
-  *ctermcols = 0;
-  *ctermrows = 0;
-  *ctermforces = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static void close_psf_read(void *mydata) {
-  psfdata *psf = (psfdata *)mydata;
-  if (psf) {
-    if (psf->fp != NULL) 
-      fclose(psf->fp);
-
-    /* free bond data */
-    if (psf->from != NULL) 
-      free(psf->from);
-    if (psf->to != NULL) 
-      free(psf->to);
-
-    /* free angle data */
-    if (psf->angles != NULL)
-      free(psf->angles);
-    if (psf->dihedrals != NULL)
-      free(psf->dihedrals);
-    if (psf->impropers != NULL)
-      free(psf->impropers);
-
-    /* free cross-term data */
-    if (psf->cterms != NULL)
-      free(psf->cterms);
-
-    free(psf);
-  }
-}  
-
-
-static void *open_psf_write(const char *path, const char *filetype,
-    int natoms) {
-  FILE *fp;
-  psfdata *psf;
-
-  fp = fopen(path, "w");
-  if (!fp) {
-    fprintf(stderr, "Unable to open file %s for writing\n", path);
-    return NULL;
-  }
-  psf = (psfdata *) malloc(sizeof(psfdata));
-  memset(psf, 0, sizeof(psfdata));
-  psf->fp = fp; 
-  psf->numatoms = natoms;
-  psf->namdfmt = 0;     /* initialize to off for now */
-  psf->charmmfmt = 0;   /* initialize to off for now */
-  psf->charmmext = 0;   /* off unless we discover we need it */
-  psf->charmmcmap = 0;  /* off unless we discover we need it */
-  psf->charmmcheq = 0;  /* off unless we discover we need it */
-  psf->charmmdrude = 0; /* off unless we discover we need it */
-  psf->nbonds = 0;
-  psf->to = NULL;
-  psf->from = NULL;
-  return psf;
-}
-
-static int write_psf_structure(void *v, int optflags,
-                               const molfile_atom_t *atoms) {
-  psfdata *psf = (psfdata *)v;
-  const molfile_atom_t *atom;
-  int i, fullrows;
-  int xplorfmt = 0;
-
-  for (i=0; i<psf->numatoms; i++) {
-    if ( ! isdigit(atoms[i].type[0]) ) xplorfmt = 1;
-  }
-
-  /* determine if we must write out an EXT formatted PSF file */
-  /* check the field width of the PSF atom records            */
-  if (psf->namdfmt == 0) {
-    int fw = xplorfmt ? 6 : 4;
-    for (i=0; i<psf->numatoms; i++) {
-      if (strlen(atoms[i].type) > fw) {
-        psf->namdfmt = 1;   /* force output to NAMD PSF variant because */
-                            /* the atom types are too long              */
-      }
-    }
-  }
-  if (psf->namdfmt) {
-    psf->charmmext = 0; /* using space-delimited format anyway */
-  } else {
-    if (psf->numatoms > 9999999) { /* allow space-delimited readers */
-      psf->charmmext = 1; /* force output to EXTended PSF format      */
-    }
-    if (psf->charmmext == 0) {
-      for (i=0; i<psf->numatoms; i++) {
-        if (strlen(atoms[i].name) > 4) {
-          psf->charmmext = 1; /* force output to EXTended PSF format      */
-        }
-        if (xplorfmt && strlen(atoms[i].type) > 4) {
-          psf->charmmext = 1; /* force output to EXTended PSF format      */
-        }
-      }
-    }
-  }
-  if (psf->namdfmt == 1) {
-    printf("psfplugin) Structure requires space-delimited NAMD PSF format\n");
-  } else if (psf->charmmext == 1) {
-    printf("psfplugin) Structure requires EXTended PSF format\n");
-  }
-
-  /* check to see if we'll be writing cross-term maps */
-  if (psf->numcterms > 0) {
-    psf->charmmcmap = 1;
-  }
-
-  /* write out the PSF header */
-  fprintf(psf->fp, "PSF");
-  if (psf->namdfmt == 1) 
-    fprintf(psf->fp, " NAMD");
-  if (psf->charmmext == 1)
-    fprintf(psf->fp, " EXT");
-  if (psf->charmmcmap == 1)
-    fprintf(psf->fp, " CMAP");
-  fprintf(psf->fp, "\n\n%8d !NTITLE\n", 1);
-
-  if (psf->charmmfmt) {
-    fprintf(psf->fp," REMARKS %s\n","VMD-generated Charmm PSF structure file");
-
-    printf("psfplugin) WARNING: Charmm format PSF file is incomplete, atom type ID\n");
-    printf("psfplugin)          codes have been emitted as '0'. \n");
-  } else {
-    fprintf(psf->fp," REMARKS %s\n","VMD-generated NAMD/X-Plor PSF structure file");
-  }
-  fprintf(psf->fp, "\n");
-
-  /* write out total number of atoms */
-  fprintf(psf->fp, "%8d !NATOM\n", psf->numatoms);
-
-  /* write out all of the atom records */
-  for (i=0; i<psf->numatoms; i++) {
-    const char *atomname; 
-    atom = &atoms[i];
-    atomname = atom->name;
-
-    /* skip any leading space characters given to us by VMD */ 
-    while (*atomname == ' ')
-      atomname++;
-
-    if (psf->charmmext) {
-      fprintf(psf->fp, xplorfmt ? 
-                       "%10d %-8s %-8d %-8s %-8s %-6s %10.6f    %10.4f  %10d\n"
-                     : "%10d %-8s %-8d %-8s %-8s %-4s %10.6f    %10.4f  %10d\n",
-              i+1, atom->segid, atom->resid, atom->resname,
-              atomname, atom->type, atom->charge, atom->mass, 0);
-    } else if (psf->charmmfmt) {
-      /* XXX replace hard-coded 0 with proper atom type ID code */
-      fprintf(psf->fp, "%8d %-4s %-4d %-4s %-4s %4d %10.6f    %10.4f  %10d\n",
-              i+1, atom->segid, atom->resid, atom->resname,
-              atomname, /* atom->typeid */ 0, atom->charge, atom->mass, 0);
-    } else {
-      fprintf(psf->fp, "%8d %-4s %-4d %-4s %-4s %-4s %10.6f    %10.4f  %10d\n",
-              i+1, atom->segid, atom->resid, atom->resname,
-              atomname, atom->type, atom->charge, atom->mass, 0);
-    }
-  } 
-  fprintf(psf->fp, "\n");
-
-  /* write out bonds if we have bond information */
-  /* XXX Note: We are generating bond records the same way for both the  */
-  /*           normal and EXT format PSF files, which seems odd, but was */
-  /*           seemingly validated by the CHARMM 31 test files I have.   */
-  if (psf->nbonds > 0 && psf->from != NULL && psf->to != NULL) {
-    fprintf(psf->fp, "%8d !NBOND: bonds\n", psf->nbonds);
-    for (i=0; i<psf->nbonds; i++) {
-      if (psf->namdfmt)
-        fprintf(psf->fp, " %7d %7d", psf->from[i], psf->to[i]);
-      else if (psf->charmmext)
-        fprintf(psf->fp, "%10d%10d", psf->from[i], psf->to[i]);
-      else
-        fprintf(psf->fp, "%8d%8d", psf->from[i], psf->to[i]);
-
-      if ((i % 4) == 3) 
-        fprintf(psf->fp, "\n");
-    }
-    if ((i % 4) != 0) 
-      fprintf(psf->fp, "\n");
-    fprintf(psf->fp, "\n");
-  } else {
-    fprintf(psf->fp, "%8d !NBOND: bonds\n", 0);
-    fprintf(psf->fp, "\n\n");
-  }
-
-  if (psf->numangles == 0 && psf->numdihedrals == 0 && psf->numimpropers == 0 && psf->numcterms == 0) {
-    printf("psfplugin) WARNING: PSF file is incomplete, no angles, dihedrals,\n");
-    printf("psfplugin)          impropers, or cross-terms will be written. \n");
-
-    fprintf(psf->fp, "%8d !NTHETA: angles\n\n\n", 0);
-    fprintf(psf->fp, "%8d !NPHI: dihedrals\n\n\n", 0);
-    fprintf(psf->fp, "%8d !NIMPHI: impropers\n\n\n", 0);
-  } else {
-    int i, numinline;
-
-    printf("psfplugin) Writing angles/dihedrals/impropers...\n");
-
-    fprintf(psf->fp, "%8d !NTHETA: angles\n", psf->numangles);
-    for (numinline=0,i=0; i<psf->numangles; i++) {
-      if ( numinline == 3 ) { fprintf(psf->fp, "\n");  numinline = 0; }
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d" : " %7d %7d %7d", 
-              psf->angles[i*3], psf->angles[i*3+1], psf->angles[i*3+2]);
-      numinline++;
-    }
-    fprintf(psf->fp, "\n\n");
-
-    fprintf(psf->fp, "%8d !NPHI: dihedrals\n", psf->numdihedrals);
-    for (numinline=0,i=0; i<psf->numdihedrals; i++) {
-      if ( numinline == 2 ) { fprintf(psf->fp, "\n");  numinline = 0; }
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d" : " %7d %7d %7d %7d", 
-              psf->dihedrals[i*4], psf->dihedrals[i*4+1], 
-              psf->dihedrals[i*4+2], psf->dihedrals[i*4+3]);
-      numinline++;
-    }
-    fprintf(psf->fp, "\n\n");
-
-    fprintf(psf->fp, "%8d !NIMPHI: impropers\n", psf->numimpropers);
-    for (numinline=0,i=0; i<psf->numimpropers; i++) {
-      if ( numinline == 2 ) { fprintf(psf->fp, "\n");  numinline = 0; }
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d" : " %7d %7d %7d %7d",
-              psf->impropers[i*4  ], psf->impropers[i*4+1], 
-              psf->impropers[i*4+2], psf->impropers[i*4+3]);
-      numinline++;
-    }
-    fprintf(psf->fp, "\n\n");
-  }
-
-
-  /*
-   * write out empty donor/acceptor records since we don't
-   * presently make use of this information 
-   */
-  fprintf(psf->fp, "%8d !NDON: donors\n\n\n", 0);
-  fprintf(psf->fp, "%8d !NACC: acceptors\n\n\n", 0);
-  fprintf(psf->fp, "%8d !NNB\n\n", 0);
-
-  /* Pad with zeros, one for every atom */
-  fullrows = psf->numatoms/8;
-  for (i=0; i<fullrows; ++i)
-    fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d%10d%10d%10d%10d\n" :
-                     "%8d%8d%8d%8d%8d%8d%8d%8d\n", 0, 0, 0, 0, 0, 0, 0, 0);
-  for (i=psf->numatoms - fullrows*8; i; --i)
-    fprintf(psf->fp, psf->charmmext ? "%10d" : "%8d", 0);
-  fprintf(psf->fp, "\n\n");
-  fprintf(psf->fp, psf->charmmext ? "%8d %7d !NGRP\n%10d%10d%10d\n\n" :
-                   "%8d %7d !NGRP\n%8d%8d%8d\n\n", 1, 0, 0, 0, 0);
-
-
-  /* write out cross-terms */
-  if (psf->numcterms > 0) {
-    fprintf(psf->fp, "%8d !NCRTERM: cross-terms\n", psf->numcterms);
-    for (i=0; i<psf->numcterms; i++) {
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d%10d%10d%10d%10d\n" :
-                       " %7d %7d %7d %7d %7d %7d %7d %7d\n",
-              psf->cterms[i*8  ], psf->cterms[i*8+1], 
-              psf->cterms[i*8+2], psf->cterms[i*8+3],
-              psf->cterms[i*8+4], psf->cterms[i*8+5],
-              psf->cterms[i*8+6], psf->cterms[i*8+7]);
-    }
-    fprintf(psf->fp, "\n\n");
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int write_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                       float *bondorderptr, int *bondtype, 
-                       int nbondtypes, char **bondtypename) {
-  psfdata *psf = (psfdata *)v;
-
-  /* save info until we actually write out the structure file */
-  psf->nbonds = nbonds;
-  psf->from = (int *) malloc(nbonds * sizeof(int));
-  memcpy(psf->from, fromptr, nbonds * sizeof(int));
-  psf->to = (int *) malloc(nbonds * sizeof(int));
-  memcpy(psf->to, toptr, nbonds * sizeof(int));
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int write_angles(void * v, int numangles, const int *angles,
-                        const int *angletypes, int numangletypes,
-                        const char **angletypenames, int numdihedrals, 
-                        const int *dihedrals, const int *dihedraltype,
-                        int numdihedraltypes, const char **dihedraltypenames,
-                        int numimpropers, const int *impropers, 
-                        const int *impropertypes, int numimpropertypes, 
-                        const char **impropertypenames, int numcterms, 
-                        const int *cterms, int ctermcols, int ctermrows) {
-  psfdata *psf = (psfdata *)v;
-
-  /* save info until we actually write out the structure file */
-  psf->numangles = numangles;
-  psf->numdihedrals = numdihedrals;
-  psf->numimpropers = numimpropers;
-  psf->numcterms = numcterms;
-
-  psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-  memcpy(psf->angles, angles, 3*psf->numangles*sizeof(int));
-
-  psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-  memcpy(psf->dihedrals, dihedrals, 4*psf->numdihedrals*sizeof(int));
-
-  psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-  memcpy(psf->impropers, impropers, 4*psf->numimpropers*sizeof(int));
-
-  psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-  memcpy(psf->cterms, cterms, 8*psf->numcterms*sizeof(int));
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int write_angles(void * v,
-        int numangles,    const int *angles,    const double *angleforces,
-        int numdihedrals, const int *dihedrals, const double *dihedralforces,
-        int numimpropers, const int *impropers, const double *improperforces,
-        int numcterms,   const int *cterms,
-        int ctermcols, int ctermrows, const double *ctermforces) {
-  psfdata *psf = (psfdata *)v;
-
-  /* save info until we actually write out the structure file */
-  psf->numangles = numangles;
-  psf->numdihedrals = numdihedrals;
-  psf->numimpropers = numimpropers;
-  psf->numcterms = numcterms;
-
-  psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-  memcpy(psf->angles, angles, 3*psf->numangles*sizeof(int));
-
-  psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-  memcpy(psf->dihedrals, dihedrals, 4*psf->numdihedrals*sizeof(int));
-
-  psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-  memcpy(psf->impropers, impropers, 4*psf->numimpropers*sizeof(int));
-
-  psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-  memcpy(psf->cterms, cterms, 8*psf->numcterms*sizeof(int));
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static void close_psf_write(void *v) {
-  psfdata *psf = (psfdata *)v;
-  fclose(psf->fp);
-
-  /* free bonds if we have them */
-  if (psf->from != NULL) 
-    free(psf->from);
-  if (psf->to != NULL) 
-    free(psf->to);
-
-  /* free angles if we have them */
-  if (psf->angles)
-    free(psf->angles);
-  if (psf->dihedrals)
-    free(psf->dihedrals);
-  if (psf->impropers)
-    free(psf->impropers);
-
-  /* free cross-terms if we have them */
-  if (psf->cterms)
-    free(psf->cterms);
-
-  free(psf);
-}
-
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "psf";
-  plugin.prettyname = "CHARMM,NAMD,XPLOR PSF";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "psf";
-  plugin.open_file_read = open_psf_read;
-  plugin.read_structure = read_psf;
-  plugin.read_bonds = read_bonds;
-#if vmdplugin_ABIVERSION > 9
-  plugin.read_angles = read_angles;
-#endif
-  plugin.close_file_read = close_psf_read;
-  plugin.open_file_write = open_psf_write;
-  plugin.write_structure = write_psf_structure;
-  plugin.close_file_write = close_psf_write;
-  plugin.write_bonds = write_bonds;
-#if vmdplugin_ABIVERSION > 9
-  plugin.write_angles = write_angles;
-#endif
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/qmplugin.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/qmplugin.h
deleted file mode 100644
index 86daebe30f34004c17a9d325971ac458aae74cf8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/qmplugin.h
+++ /dev/null
@@ -1,1116 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: qmplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-/*******************************************************************
- * 
- *  Data structures and utility functions for plugins
- *  reading logfiles from QM packages.
- *  
- ******************************************************************/
-
-#ifndef QMPLUGIN_H
-#define QMPLUGIN_H
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <math.h>
-#include "molfile_plugin.h"
-
-
-#define FALSE 0
-#define TRUE  1
-
-#define NONE  0
-
-/* macros for shell types */
-#define UNK_SHELL -666
-#define SPD_SHELL   -11
-#define SP_SHELL    -10
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL -2
-#define SP_P_SHELL -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-#define I_SHELL 6
-
-#define SPIN_ALPHA  0
-#define SPIN_BETA   1
-
-/* XXX the following macros should better be in molfileplugin.h
- * since the same macros must be defined in VMD too. */
-
-
-/* macros defining type of CI method (CITYP in GAMESS) */
-#define CI_UNKNOWN -1
-#define CI_NONE     0
-#define CI_CIS      1
-#define CI_ALDET    2
-#define CI_ORMAS    3
-#define CI_GUGA     4
-#define CI_FSOCI    5
-#define CI_GENCI    6
-
-/* Basis set definition for a primitive */
-typedef struct {
-  float exponent;
-  float contraction_coeff;
-} prim_t;
-
-/* Basis set definition for a shell */
-typedef struct {
-  int numprims;      /* number of primitives in this shell */
-  int type;          /* S, P, D, F, ...
-                      * just for convenience when retrieving info */
-  int wave_offset;   /* index into wave_function array */
-  prim_t *prim;      /* array of primitives */
-} shell_t;
-
-/* Basis set definition for an atom */
-typedef struct {
-  char name[11];  /* atom name or type */
-  int atomicnum;  /* atomic number (nuclear charge) */
-  int numshells;  /* number of shells for this atom */
-  shell_t *shell; /* array of shells */
-} basis_atom_t;
-
-
-/* Atoms */
-typedef struct 
-{
-  char type [11]; /* atom name or type */
-
-  int atomicnum;  /* atomic number (nuclear charge) */
-
-  float x,y,z;    /* coordinates of atom */
-} qm_atom_t;
-
-
-/* Wave function */
-typedef struct {
-  int   type;           /**< CANONICAL, LOCALIZED, OTHER */
-  int   spin;           /**< 0 for alpha, 1 for beta */
-  int   exci;           /**< 0 for ground state, 1,2,3,... for excited states */
-  int   mult;           /**< spin multiplicity of the electronic state */
-  char info[MOLFILE_BUFSIZ]; /**< string for additional type info */
-
-  int   num_orbitals;   /**< number of orbitals that was really 
-                         *   present in the output for this step */
-  int   num_coeffs;     /**< number of coefficients per orbital  */
-  int   has_orben;      /**< flag for orbital energies    */
-  int   has_occup;      /**< flag for orbital occupancies */
-  double energy;        /**< total energy for this state */
-  float *wave_coeffs;   /**< expansion coefficients for wavefunction in the
-                         *   form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */
-  float *orb_energies;    /**< array of orbital energies*/
-  float *orb_occupancies; /**< array of orbital occupancies */
-} qm_wavefunction_t;
-
-
-/* Timestep specific data.
- * (Note that atoms are treated separately) */
-typedef struct {
-  qm_wavefunction_t *wave;
-  int     numwave;          /* number of wavefunctions for this ts */
-  float  *gradient;         /* energy gradient for each atom */
-  int     num_scfiter;      /* number of SCF iterations */
-
-  double *scfenergies;      /* scfenergies per trajectory point */
-
-  /* arrays with atom charges */
-  double *mulliken_charges; /* per-atom Mulliken charges */
-  double *lowdin_charges;   /* per-atom Lowdin charges */
-  double *esp_charges;      /* per-atom ESP charges */
-  int   have_mulliken; 
-  int   have_lowdin; 
-  int   have_esp; 
-} qm_timestep_t;
-
-
-/* Main QM plugin data structure */
-typedef struct 
-{
-  /* File format specific data.
-   * This pointer must be cast to the according type by the plugin.
-   * Typically, this will be a struct containing various data that
-   * are needed by different functions during the file parsing process
-   * and cannot be sent through the molfile_plugin QM interface since 
-   * the underlying data types are specific to the file format being
-   * read. */
-  void *format_specific_data; 
-
-  FILE *file;       /* the file we are reading */
-
-
-  /******************************************************
-   * calculation metadata (input data)
-   *****************************************************/
-
-  int numatoms;     /* number of atoms in structure */
-  int runtype;      /* type of calculation 
-                     * (ENERGY, OPTIMIZE, GRADIENT, ...) */
-  int scftype;      /* UHF, RHF, ROHF, ... */
-  int dfttype;      /* NONE, B3LYP, ...,   */
-  int citype;       /* NONE, GUGA, ...     */
-
-  int mplevel;      /* Moller-Plesset perturbation level */
-
-  char gbasis[10];  /* GBASIS of GAMESS run */
-
-  char basis_string[BUFSIZ]; /* basis name as "nice" string */
-
-  char runtitle[BUFSIZ];  /* title of gamess run */
-
-  char geometry[BUFSIZ];  /* either UNIQUE, CART or ZMP/ZMTMPC */
-  char guess[BUFSIZ];     /* type of guess method used */
-
-  char version_string[BUFSIZ]; /* GAMESS version used for run */
-
-
-  int  nproc;          /* Number processors used */
-  char memory[256];    /* Amount of memory used, e.g. 1Gb */
-
-  int totalcharge;     /* Total charge of the system */
-  int multiplicity;    /* Multiplicity of the system */
-  int num_electrons;   /* Number of electrons */
-
-  char pointgroup[BUFSIZ]; /* Symmetry point group */
-  int naxis;
-  int order;               /* Order of highest axis */
-
-  int mcscf_num_core;  /* Number of MCSCF core orbitals 
-                        * (determines # valid orb energies
-                        * for MCSCF natural orbitals) */
-
-  int max_opt_steps;   /* Max. number of geom. opt. steps */
-  float opt_tol;       /* gradient convergence tolerance,
-                        * in Hartree/Bohr. */
-
-
-  /*********************************************************
-   * Basis set data
-   *********************************************************/
-
-  /* this array of floats stores the contraction coefficients
-   * and exponents for the basis functions:
-   * { exp(1), c-coeff(1), exp(2), c-coeff(2), .... }
-   * This holds also for double-zeta basis functions with
-   * exp(i) = exp(j) and c-coeff(i) != c-coeff(j). */
-  float *basis;
-
-  /* hierarchical basis set structures for each atom */
-  basis_atom_t *basis_set;
-
-  /* number of uncontracted basis functions in basis array */
-  int num_basis_funcs;
-
-  /* number of atoms listed in basis set */
-  int num_basis_atoms;
-
-  /* atomic number per atom in basis set */
-  int *atomicnum_per_basisatom;
-
-  /* number of shells per atom in basis set */
-  int *num_shells_per_atom;
-
-  /* the total number of atomic shells */
-  int num_shells;
-
-  /* number of primitives in shell i */
-  int *num_prim_per_shell;
-
-  /* type of each shell */
-  int *shell_types; 
-
-  /* number of occupied spin A and B orbitals */
-  int num_occupied_A;
-  int num_occupied_B;
-
-  /* Max. size of the wave_function array per orbital.
-   * I.e. this is also the number of contracted
-   * cartesian gaussian basis functions or the size
-   * of the secular equation.
-   * While the actual # of MOs present can be different
-   * for each frame, this is the maximum number of 
-   * possible occupied and virtual orbitals. */
-  int wavef_size;
-
-  /* Array of length 3*num_wave_f containing the exponents 
-   * describing the cartesian components of the angular momentum. 
-   * E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}. */
-  int *angular_momentum;
-
-  /* Highest shell occuring in basis set */
-  int max_shell;
-
-
-  /******************************************************
-   * normal modes
-   *****************************************************/
-
-  int have_normal_modes; /* TRUE/FALSE flag indicating if we
-                          * could properly read normal modes,
-                          * wavenumbers and intensities. */
-
-  int  nimag;          /* Number of imaginary frequencies */
-  int *imag_modes;     /* List of imaginary modes */
-
-  float *wavenumbers;  /* rotational and translational DoF 
-                        * are included, but can be removed due
-                        * to their zero frequencies */
-  float *intensities;  /* Intensities of spectral lines */
-
-  float *normal_modes; /* the normal modes themselves */
-
-
-  /******************************************************
-   * internal coordinate stuff
-   *****************************************************/
-
-  int have_internals;  /* TRUE/FALSE flag indicating if we
-                        * have internal coordinates */
-
-  int have_cart_hessian; /* TRUE/FALSE flag indicating if we
-                          * have a cartesian Hessian matrix */
-
-  int have_int_hessian;  /* TRUE/FALSE flag indicating if we
-                          * have a Hessian matrix in internal
-                          * coordinates */
-
-  int nintcoords;    /* Number of internal coordinates */
-  int nbonds;        /* Number of bonds */
-  int nangles;       /* Number of angles */
-  int ndiheds;       /* Number of dihedrals */
-  int nimprops;      /* Number of impropers */
-
-  int *bonds;        /* bond list (atom tuples) */
-  int *angles;       /* angle list (atom triples) */
-  int *dihedrals;    /* dihedral list (atom quadrupels) */
-  int *impropers;    /* improper list (atom quadrupels) */
-
-  double *internal_coordinates; /* value of internal coordinates */ 
-  
-  /* XXX GAMESS */
-  /* the order of force constants has to match the internal
-   * coordinates in *bonds, *angles, *dihedrals */
-
-  double *bond_force_const;     /* force constant for bonds */
-  double *angle_force_const;    /* force constant for angles */
-  double *dihedral_force_const; /* force constant for dihedrals */
-  double *improper_force_const; /* force constant for impropers */
-
-  /*******************************************************
-   * Hessian matrices
-   *******************************************************/
-
-  double *carthessian;  /* Hessian matrix in cartesian coordinates,
-                         * dimension (3*numatoms)*(3*numatoms),
-                         * single array of floats 
-                         * (row(1),row(2),...,row(numatoms))
-                         */
-
-  double *inthessian;  /* Hessian matrix in internal coordinates,
-                        * dimension nintcoords*nintcoords,
-                        * single array of floats 
-                        * (row(1),row(2),...,row(nintcoords))
-                        */
-
-  /*******************************************************
-   * Trajectory related data
-   *******************************************************/
-
-  /* per timestep data like wavefunctions and scf iterations */
-  qm_timestep_t *qm_timestep;
-
-  /* array of atoms for the current timestep */
-  qm_atom_t *atoms;
-
-  /* flag to tell if SCF cycle and the geometry search converged.
-   * XXX should distinguish between SCF and geometry convergence
-   * in separate flags */
-  int status;
-
-  /* number of trajectory frames: */
-  int num_frames;       /* total # frames */
-  int num_frames_read;  /* # frames read in so far */
-  int num_frames_sent;  /* # frames read sent to VMD so far */
-
-  /* flag to indicate wether we are done with reading frames */
-  int trajectory_done;
-
-  /* file positions of the beginning of each trajectory frame */
-  long *filepos_array;
-
-  /* file position indicator for the beginning of final section 
-   * printed after the last trajectory frame */
-  long end_of_traj;
-
-} qmdata_t;
-
-
-/* #######################################################
- *
- * Function declarations
- *
- * ####################################################### */
-
-/* Expand a set of symmetry unique atoms by creating images of
- * the atoms so that we have the full coordinate set. */
-static int symmetry_expand(qm_atom_t **atoms, int numunique, int natoms, 
-                            char *pg, int naxis);
-
-/* Skip n lines at a time */
-static void eatline(FILE * fd, int n);
-
-/* Advance to the next non-white line */
-static void eatwhitelines(FILE *fd);
-
-/* Trim leading whitespaces from string */
-static char* trimleft(char *);
-
-/* Trim trailing whitespaces from string */
-static char* trimright(char *);
-
-/* Return 1 if the string consists of whitespace only */
-static int iswhiteline(char *s);
-
-/* Convert a string to upper case */
-static char *strtoupper(char *s);
-
-
-/* Place file pointer AFTER the line containing one of
- * the keystrings. */
-static int pass_keyline(FILE *file, const char *keystring,
-			const char *keystring2);
-
-/* Place file pointer AT THE BEGINNING of the line containing 
- * a keystring. The keystrings are specified as a list of
- * const char* function arguments. The last argument must be 
- * NULL in order to terminate the list. */
-static int goto_keyline(FILE *file, ...);
-
-/* Check wether keystring1 occurs before keystring2 and
- * jumps back to beginning of search */
-static int have_keyline(FILE *file, const char *keystring1,
-                        const char *keystring2);
-
-
-/* Print the current line but don't advance the file pointer. */
-static void thisline(FILE *file);
-
-/* Print next nonempty, nonwhite line but do not advance
- * the file pointer. */
-static void whereami(FILE *file);
-
-
-
-/* #######################################################
- *
- * Function definitions
- *
- * ####################################################### */
-
-
-/*********************************************************
- *
- * Allocates and initiates qmdata_t structure.
- *
- *********************************************************/
-static qmdata_t* init_qmdata() {
-  /* allocate memory for main data structure */
-  qmdata_t *data = (qmdata_t *) calloc(1, sizeof(qmdata_t));
-  if (data == NULL)
-    return NULL;
-
-  data->runtype = NONE;
-  data->scftype = NONE;
-  data->dfttype = NONE;
-  data->citype  = NONE;
-  data->status = MOLFILE_QMSTATUS_UNKNOWN;
-  data->trajectory_done   = FALSE;
-  data->have_internals    = FALSE;
-  data->have_int_hessian  = FALSE;
-  data->have_cart_hessian = FALSE;
-  data->have_normal_modes = FALSE;
-
-  /* initialize some of the character arrays */
-  memset(data->basis_string,0,sizeof(data->basis_string));
-  memset(data->version_string,0,sizeof(data->version_string));
-  memset(data->memory,0,sizeof(data->memory));
-
-  return data;
-}
-
-
-/*********************************************************
- *
- * functions to manipulate the wavefunction array 
- * in qm_timestep_t.
- *
- *********************************************************/
-
-/* Increase wavefunction array in ts by one. */
-static qm_wavefunction_t* add_wavefunction(qm_timestep_t *ts) {
-  if (ts->numwave) {
-    /* Add a new wavefunction */
-    ts->wave = (qm_wavefunction_t *)realloc(ts->wave,
-                        (ts->numwave+1)*sizeof(qm_wavefunction_t));
-    memset(&ts->wave[ts->numwave], 0, sizeof(qm_wavefunction_t));
-    ts->numwave++;
-  } else {
-    /* We have no wavefunction for this timestep so create one */
-    ts->wave = (qm_wavefunction_t *)calloc(1, sizeof(qm_wavefunction_t));
-    ts->numwave = 1;
-  }
-
-  return &ts->wave[ts->numwave-1];
-}
-
-
-/* Replace the n-th wavefunction in ts with the last
- * one and decrease the array length by one. */
-static void replace_wavefunction(qm_timestep_t *ts, int n) {
-  if (ts->numwave>=2 && n>=0 && n<ts->numwave-1) {
-    qm_wavefunction_t *w1, *w2;
-    w2 = &ts->wave[n];
-    w1 = &ts->wave[ts->numwave-1];
-    free(w2->wave_coeffs);
-    free(w2->orb_energies);
-    free(w2->orb_occupancies);
-    memcpy(w2, w1, sizeof(qm_wavefunction_t));
-    ts->wave = (qm_wavefunction_t *) realloc(ts->wave,
-                   (ts->numwave-1)*sizeof(qm_wavefunction_t));
-    ts->numwave--;
-  }
-}
-
-
-/* Delete the last wavefunction in ts */
-static void del_wavefunction(qm_timestep_t *ts) {
-  if (ts->numwave) {
-    qm_wavefunction_t *w;
-    w = &ts->wave[ts->numwave-1];
-    free(w->wave_coeffs);
-    free(w->orb_energies);
-    free(w->orb_occupancies);
-    ts->numwave--;
-    ts->wave = (qm_wavefunction_t *)realloc(ts->wave,
-                        ts->numwave*sizeof(qm_wavefunction_t));    
-  }
-}
-
-/* Translate angular momentum string representation into
- * a triplet angular momentum exponents for X, Y, Z.
- * Angular momentum strings are a more human readable way
- * to specify the order of coefficients for wavefunctions.
- * So if the order of coefficients for D-shells implied
- * in the QM file is xx, yy, zz, xy, xz, yz then you can
- * use subsequent calls to this function in order to 
- * translate the strings into the more obscure but machine
- * friendly angular momentum exponents required by the 
- * molfile_plugin interface.
- *
- * Example translations:
- * S   --> {0 0 0}
- * X   --> {1 0 0}
- * Y   --> {0 1 0}
- * Z   --> {0 0 1}
- * XX  --> {2 0 0}
- * XY  --> {1 1 0}
- * YYZ --> {0 2 1}
- */
-static void angular_momentum_expon(int  *ang_mom_expon,
-                                   char *ang_mom_str) {
-  int i;
-  int xexp=0, yexp=0, zexp=0;
-
-  for (i=0; i<strlen(ang_mom_str); i++) {
-    switch (toupper(ang_mom_str[i])) {
-    case 'X':
-      xexp++;
-      break;
-    case 'Y':
-      yexp++;
-      break;
-    case 'Z':
-      zexp++;
-      break;
-    }
-  }
-  ang_mom_expon[0] = xexp;
-  ang_mom_expon[1] = yexp;
-  ang_mom_expon[2] = zexp;
-}
-
-/******************************************************
- *
- * matrix and vector functions
- *
- ******************************************************/
-
-/* Degree-to-Radians and Radians-to-Degrees Conversion macros */
-#define VMD_PI      3.14159265358979323846
-#define DEGTORAD(a)     (a*VMD_PI/180.0)
-#define RADTODEG(a)     (a*180.0/VMD_PI)
-
-/* clears the matrix (resets it to identity) */
-static void identity(float mat[16]) {
-  memset(mat, 0, 16*sizeof(float));
-  mat[0]=1.0f;
-  mat[5]=1.0f;
-  mat[10]=1.0f;
-  mat[15]=1.0f;
-}
-
-
-/* Print a matrix for debugging purpose */
-static void print_matrix4(const float mat[16]) {
-  int i, j;
-  for (i=0; i<4; i++) {
-    for (j=0; j<4; j++) {
-      printf("%f ", mat[4*j+i]);
-    }
-    printf("\n");
-  }
-  printf("\n");
-}
-
-
-/* premultiply the matrix by the given matrix */
-static void multmatrix(const float *m1, float m2[16]) {
-  int i, j;
-  float tmp[4];
-
-  for (j=0; j<4; j++) {
-    tmp[0] = m2[j];
-    tmp[1] = m2[4+j];
-    tmp[2] = m2[8+j]; 
-    tmp[3] = m2[12+j];
-    for (i=0; i<4; i++) {
-      m2[4*i+j] = m1[4*i]*tmp[0] + m1[4*i+1]*tmp[1] +
-        m1[4*i+2]*tmp[2] + m1[4*i+3]*tmp[3]; 
-    }
-  } 
-}
-
-
-/* performs a rotation around an axis (char == 'x', 'y', or 'z')
- * angle is in degrees */
-static void rot(float a, char axis, float mat[16]) {
-  double angle;
-  float m[16];
-  identity(m);			/* create identity matrix */
-
-  angle = (double)DEGTORAD(a);
-
-  if (axis == 'x') {
-    m[0]  = 1.f;
-    m[5]  = (float)cos(angle);
-    m[10] = m[5];
-    m[6]  = (float)sin(angle);
-    m[9]  = -m[6];
-  } else if (axis == 'y') {
-    m[0]  = (float)cos(angle);
-    m[5]  = 1.f;
-    m[10] = m[0];
-    m[2]  = (float) -sin(angle);
-    m[8]  = -m[2];
-  } else if (axis == 'z') {
-    m[0]  = (float)cos(angle);
-    m[5]  = m[0];
-    m[10] = 1.f;
-    m[1]  = (float)sin(angle);
-    m[4]  = -m[1];
-  }
-
-  multmatrix(m, mat);
-}
-
-
-/* scale a matrix */
-static void scale(float s, float m[16]) {
-  float t[16];
-  identity(t);		/* create identity matrix */
-  t[0]  = s;
-  t[5]  = s;
-  t[10] = s;
-  multmatrix(t, m);
-}
-
-
-/* reflect through mirror plane */
-static void mirror(char axis, float m[16]) {
-  scale(-1.f, m);
-  rot(180, axis, m);
-}
-
-
-/* multiplies a 3D point (first arg) by the Matrix, returns in second arg */
-static void multpoint3d(const float *mat, const float opoint[3], float npoint[3]) {
-  float tmp[3];
-  float itmp3 = 1.0f / (opoint[0]*mat[3] + opoint[1]*mat[7] +
-                        opoint[2]*mat[11] + mat[15]);
-  tmp[0] = itmp3*opoint[0];
-  tmp[1] = itmp3*opoint[1];
-  tmp[2] = itmp3*opoint[2];
-  npoint[0]=tmp[0]*mat[0] + tmp[1]*mat[4] + tmp[2]*mat[ 8] + itmp3*mat[12];
-  npoint[1]=tmp[0]*mat[1] + tmp[1]*mat[5] + tmp[2]*mat[ 9] + itmp3*mat[13];
-  npoint[2]=tmp[0]*mat[2] + tmp[1]*mat[6] + tmp[2]*mat[10] + itmp3*mat[14];
-}
-
-
-/* subtract 3rd vector from 2nd and put into 1st
- * in other words, a = b - c  */
-static void qm_vec_sub(float *a, const float *b, const float *c) {
-  a[0]=b[0]-c[0];
-  a[1]=b[1]-c[1];
-  a[2]=b[2]-c[2];
-}
-
-
-/* length of vector */
-static float norm(const float *vect) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  return sqrt(vect[0]*vect[0] + vect[1]*vect[1] + vect[2]*vect[2]);
-#else
-  return sqrtf(vect[0]*vect[0] + vect[1]*vect[1] + vect[2]*vect[2]);
-#endif
-}
-
-
-/******************************************************
- *
- * Symmetry
- *
- ******************************************************/
-
-/* Expand a set of symmetry unique atoms by creating images of
- * the atoms so that we have the full coordinate set.
- * The atom array, the number of unique atoms, the total 
- * number of atoms, the pointgroup string and the order of
- * the highest axis mut be provided. The atoms array will be resized
- * and extended with the image atoms accordingly. */
-static int symmetry_expand(qm_atom_t **atoms, int numunique, int natoms, 
-                            char *pg, int naxis) {
-  int i, j;
-  float *unique, *image, *expanded;
-  int *indexmap;
-  int numexp;
-  float m[16];
-
-  printf("gamessplugin) Expanding %d coordinates for pointgroup %s, naxis=%d\n",
-         numunique, pg, naxis);
-
-  unique = calloc(3*numunique, sizeof(float));
-  image  = calloc(3*numunique, sizeof(float));
-  indexmap = calloc(numunique, sizeof(int));
-  for (i=0; i<numunique; i++) {
-    unique[3*i  ] = (*atoms)[i].x;
-    unique[3*i+1] = (*atoms)[i].y;
-    unique[3*i+2] = (*atoms)[i].z;
-    indexmap[i] = i;
-/*     printf("unique[%d]={%f %f %f}\n", i, unique[3*i], */
-/*            unique[3*i+1],unique[3*i+2]); */
-  }
-
-  /* Define the generating symmetry operations. */
-  /* XXX this is just a start, 
-   *     many molecules with higher symmetries will need 
-   *     two generating operations, e.g. a rotation and a
-   *     reflection. */
-  identity(m);
-  if (!strcmp(pg, "CI")) {
-    scale(-1.f, m);
-  }
-  else if (!strcmp(pg, "CS")) {
-    mirror('y', m);
-  }
-  else if (!strcmp(pg, "CN")) {
-    rot(360.f/naxis, 'z', m);
-  }
-  else if (!strcmp(pg, "CNV")) {
-    rot(360.f/naxis, 'z', m);
-  }
-  else if (!strcmp(pg, "CNH")) {
-    rot(360.f/naxis, 'z', m);
-  }
-  else if (!strcmp(pg, "DNH")) {
-    rot(360.f/naxis, 'z', m);
-  }
-
-  for (i=0; i<numunique; i++) {
-    multpoint3d(m, &unique[3*i], &image[3*i]);
-/*     printf("image[%d]={%f %f %f}\n", i, image[3*i  ], */
-/*            image[3*i+1], image[3*i+2]); */
-  }
-
-  expanded = calloc(3*numunique, sizeof(float));
-  memcpy(expanded, unique, 3*numunique* sizeof(float));
-  numexp=numunique;
-  for (i=0; i<numunique; i++) {
-    int found = 0;
-    for (j=0; j<numunique; j++) {
-      float d[3];
-      qm_vec_sub(d, &image[3*i], &unique[3*j]);
-      /* printf("%d,%d norm(d)=%f\n", i, j, norm(d)); */
-      if (norm(d)<0.001) {
-        found = 1;
-        break;
-      }
-    }
-
-    if (!found) {
-      expanded = realloc((float*)expanded, 3*(numexp+1)*sizeof(float));
-      indexmap = realloc((int*)indexmap, (numexp+1)*sizeof(int));
-      expanded[3*numexp  ] = image[3*i  ];
-      expanded[3*numexp+1] = image[3*i+1];
-      expanded[3*numexp+2] = image[3*i+2];
-      indexmap[numexp] = i;
-      numexp++;
-    }
-  }
-
-/*   for (i=0; i<numexp; i++) { */
-/*     printf("expanded[%d]={%f %f %f}\n", i, expanded[3*i], */
-/*            expanded[3*i+1], expanded[3*i+2]); */
-/*   } */
-
-  free(unique);
-  free(image);
-
-  if (natoms && numexp!=natoms) {
-    printf("gamessplugin) Couldn't expand symmetry unique atoms.\n");
-    free(expanded);
-    free(indexmap);
-    return FALSE;
-  }
-
-  /* XXX handling the natoms==0 case is futile unless we return 
-   *     the new number of atoms, so that the caller knows how
-   *     many atoms there are. */
-  if (!natoms)
-    *atoms = calloc(numexp, sizeof(qm_atom_t));
-  else 
-    *atoms = realloc((qm_atom_t*)(*atoms), numexp*sizeof(qm_atom_t));
-
-  for (i=numunique; i<numexp; i++) {
-    (*atoms)[i].x = expanded[3*i  ];
-    (*atoms)[i].y = expanded[3*i+1];
-    (*atoms)[i].z = expanded[3*i+2];
-    (*atoms)[i].atomicnum = (*atoms)[indexmap[i]].atomicnum;
-    strncpy((*atoms)[i].type, (*atoms)[indexmap[i]].type, 10);
-  }
-
-  free(expanded);
-  free(indexmap);
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * string functions and other parsing helpers
- *
- ******************************************************/
-
-/* skip n lines at a time */
-static void eatline(FILE * fd, int n)
-{
-  int i;
-  for (i=0; i<n; i++) {
-    char readbuf[1025];
-    fgets(readbuf, 1024, fd);
-  }
-}
-
-
-/* Skip all following consecutive white lines. */
-static void eatwhitelines(FILE *file) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(file);
-  while (fgets(buffer, sizeof(buffer), file)) {
-    if (strlen(trimright(buffer))) {
-      fseek(file, filepos, SEEK_SET);
-      break;
-    }
-    filepos = ftell(file);
-  }
-}
-
-
-/* Returns a pointer to the first non-whitespace
- * character in a string.
- * The input string s must be null-terminated. 
- */
-static char* trimleft(char* the_string)
-{
-  char *new_string = the_string;
-  while ( (*new_string=='\n' || *new_string==' ' || *new_string=='\t') && 
-	  (*new_string != '\0'))
-  {
-    new_string++;
-  }
-
-  return new_string;
-}
-
-
-/* Places a NULL character after the last non-whitespace
- * character in a string and returns the pointer to the
- * beginning of the string. 
- * The input string s must be null-terminated.
- */
-static char* trimright(char* s)
-{
-  int i;
-  for (i=strlen(s)-1; i>=0; i--) {
-    if (!isspace(s[i])) break;
-  }
-  s[i+1] = '\0';
-
-  return s;
-}
-
-
-/* Return 1 if the string contains only whitespace. */
-static int iswhiteline(char *s) {
-  return (!strlen(trimleft(s)));
-}
-
-
-/* Convert a string to upper case */
-static char *strtoupper(char *s) {
-  int i;
-  int sz = strlen(s);
-
-  if (s != NULL) {
-    for(i=0; i<sz; i++)
-      s[i] = toupper(s[i]);
-  }
-
-  return s;
-}
-
-
-
-/* Places file pointer AFTER the line containing one of the
- * keystrings. If keystring2 is NULL then it will be ignored. */
-static int pass_keyline(FILE *file, const char *keystring,
-        const char *keystring2) {
-  char buffer[BUFSIZ];
-  char *line;
-  int found = 0;
-  long filepos;
-  filepos = ftell(file);
-
-  do {
-    if (!fgets(buffer, sizeof(buffer), file)) {
-      fseek(file, filepos, SEEK_SET);
-      return 0;
-    }
-    line = trimleft(buffer);
-    if (strstr(line, keystring)) {
-      found = 1;
-      break;
-    }
-    else if (keystring2 && strstr(line, keystring2)) {
-      found = 2;
-      break;
-    }
-  } while (1);
-    
-  if (!found) {
-    fseek(file, filepos, SEEK_SET);
-  }
-
-  return found;
-}
-
-
-/* Advances the file pointer until the first appearance
- * of a line containing one of the given keystrings.
- * The keystrings are specified as a list of const char*
- * function arguments. The last argument must be NULL
- * signifying the end of the keystring argument list.
- * Returns the 1-based index of the keystring from the
- * argument list for which a match was found.
- * The file pointer will be placed AT THE BEGINNING of
- * the line containing the matched keystring.
- * If no keystring was found before EOF then the file
- * is rewound to the position where the search started
- * and 0 is returned.
- */
-static int goto_keyline(FILE *file, ...) {
-  char buffer[BUFSIZ];
-  const char *keystring;
-  int found=0, loop=1;
-  long filepos, curline;
-  va_list argptr;
-  filepos = ftell(file);
-
-  /* loop over lines */
-  while (loop) {
-    int narg = 0;
-    curline = ftell(file);
-    if (!fgets(buffer, sizeof(buffer), file)) {
-      fseek(file, filepos, SEEK_SET);
-
-      return 0;
-    }
-
-    /* loop over the list of search strings */
-    va_start(argptr, file);
-    while ((keystring = va_arg(argptr, const char*)) != NULL) {
-      /* search for keystring in line buffer */
-      if (strstr(buffer, keystring)) {
-        found = narg+1;
-        /* rewind to beginning of current line */
-        fseek(file, curline, SEEK_SET);
-        loop = 0;
-        break;
-      }
-      narg++;
-    }
-    va_end (argptr);
-  };
-    
-  if (!found) {
-    /* no match, rewind to beginning of search */
-    fseek(file, filepos, SEEK_SET);
-  }
-
-  return found;
-}
-
-/* Check wether keystring1 occurs before keystring2 and
- * jumps back to beginning of search */
-static int have_keyline(FILE *file, const char *keystring1,
-        const char *keystring2) {
-  int found;
-  long filepos;
-  filepos = ftell(file);
-
-  found = pass_keyline(file, keystring1, keystring2);
-
-  fseek(file, filepos, SEEK_SET);
-  return found;
-}
-
-
-/* Some MOLDEN files use Fortran-style notation where 'D' is used instead of 
- * 'E' as exponential character. 
- * If you pass this function a C string that contains floating point numbers
- * in Fortran-style scientific notation, it will find the "D" characters
- * that correspond to just the floating point numbers and fix them by
- * changing them to "E".  Once converted, one should be able to
- * call scanf() on the string to parse it normally.  The code modifies
- * the string in-place, which should work well for the molden plugin. */
-
-static int fpexpftoc(char *ftocstr) {
-  int convcnt = 0;
-  int len = strlen(ftocstr);
-
-  // Compute string length, minus three chars, since any floating point 
-  // number in scientific notation is going to have at least a "-" or "+",
-  // and one or more integer digits following the "E" or "D" character for
-  // exponent notation.
-  int lenm2 = len - 2;
-
-  // Replace "D" exponential characters with "E", so we can parse with 
-  // ANSI stdio routines.
-  // Our loop starts at the second character in the string since the shortest
-  // possible FP number in scientific notation would be "1D+01" or something
-  // similar.
-  int i;
-  for (i=1; i<lenm2; i++) {
-    // Check for a 'D' character.  If we find one, then we look to see that the
-    // preceding character is numeric, that the following character is +/-,
-    // and that the character following +/- is also numeric.  If all of the
-    // necessary conditions are true then we replace the 'D' with an 'E'.
-    // The strict checking should allow us to safely convert entire strings
-    // of characters where there are also integers, and other kinds of strings
-    // on the same line.
-    if (ftocstr[i] == 'D' &&
-        ((ftocstr[i+1] == '-') || (ftocstr[i+1] == '+')) &&
-        ((ftocstr[i-1] >= '0') && (ftocstr[i-1] <= '9')) &&
-        ((ftocstr[i+2] >= '0') && (ftocstr[i+2] <= '9'))) {
-      ftocstr[i] = 'E';
-      convcnt++;
-    }
-  }
-
-  return convcnt;
-}
-
-
-
-
-/*****************************************************
- *
- *   Debugging functions
- *
- *****************************************************/
-
-/* Print the current line in the format
- * "HERE) <contents of line>".
- * Doesn't advance the file pointer.
- */
-static void thisline(FILE *file) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(file);
-  if (!fgets(buffer, sizeof(buffer), file)) {
-    if (feof(file)) printf("HERE) EOF\n");
-    else printf("HERE) ????\n");
-    return;
-  }
-  printf("HERE) %s\n", buffer);
-  fseek(file, filepos, SEEK_SET);
-}
-
-
-/* Print all lines up to and including the next line that contains
- * non-whitespace characters. The file pointer will be restored to
- * its previous position. 
- * Output format: "HERE) <contents of line>".
- * If the end of file has been reached print "HERE) EOF".
- */
-static void whereami(FILE *file) {
-  char buffer[BUFSIZ];
-  char *line;
-  long filepos;
-  filepos = ftell(file);
-  do {
-    if (!fgets(buffer, sizeof(buffer), file)) {
-      if (feof(file)) printf("HERE) EOF\n");
-      else printf("HERE) ????\n");
-      return;
-    }
-    line = trimleft(buffer);
-    printf("HERE) %s\n", buffer);
-  } while (!strlen(line));
-
-  fseek(file, filepos, SEEK_SET);
-}
-
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/raster3dplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/raster3dplugin.C
deleted file mode 100644
index f4c1d9bf32d9d9621504c2718c59989e71d28af0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/raster3dplugin.C
+++ /dev/null
@@ -1,519 +0,0 @@
-
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} handle_t;
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  handle_t *handle;
-  
-  fd = fopen(filepath, "rt");
-  if (!fd) 
-    return NULL;
-  handle = new handle_t;
-  handle->fd = fd;
-  handle->graphics = NULL;
-  *natoms = 0;
-  return handle;
-}
-
-static void next_elem(int &n, int &max, molfile_graphics_t *& graphics) {
-  ++n;
-  if (n == max) {
-    max *= 2;
-    graphics = (molfile_graphics_t *)realloc(graphics, max*sizeof(molfile_graphics_t));
-  }
-}
-
-// gets a line of text from the file, ignoring comments
-static int get_line(int &line, char *buf, int len, FILE *f) {
-   do {
-      line++;
-      if (!fgets(buf, len - 1, f)) return 0;
-   } while (buf[0] == '#');
-   return 1;
-}
-
-
-
-
-/* 
- * Raster3D read_rawgraphics() entrypoint
- *
- * TODO
- *
- * 1. doesn't properly render capped cylinders
- * 2. needs to handle object types 15, 19, 9 (affects coordinate system);
- *    needs to first understand VMD's coordinate system.
- * 3. doesn't properly handle object type 8 (material definitions)
- * 4. doesn't properly handle object type 14 (quadrics)
- * 5. doesn't properly support file indirection (using '@')
- * 6. doesn't differentiate between round-ended cylinders (obj 3)
- *    and flat-ended cylinders (obj 5)
- * 7. doesn't handle planes
- * 8. doesn't support text (object types 10-12)
- * 9. doesn't handle depth cueing and transformations in global
- *    properties (object 16)
- */
-
-////  The header contains a lot of information which I ignore
-// TITLE (80 chars)
-// NTX, NTY (number of tiles -- ignored)
-// NPX, NPY (number of points per tile -- ignored)
-// SCHEME (antialiasing scheme -- ignored)
-// BKGND (background color -- ignored)
-// SHADOW (T/F -- ignored)
-// IPHONG (phong power -- ignored)
-// STRAIT (secondary light source -- ignored)
-// AMBIEN (ambient illumination -- ignored)
-// SPECLR ignored
-// EYEPOS ignored
-// SOURCE ignored
-// TMAT 4x4 matrix used to view the system
-// object mode (1 == triangle, 2 == spheres, or 3 ==  mixed)
-// INFMTS  --  FORTRAN input field specifications
-//   for input format specifiers 1/6, 2, and 3/5
-//   triangle(1) or plane(6) (x1,y1,z1)-(x2,y2,z2)-(x3,y3,z3) (r,g,b)
-//   sphere(2)      (x,y,z) r (r,g,b)
-//   cylinder(3,5)  (x1,y1,z1) R1 - (x2,y2,z2) R2(is ignored) (r,g,b)
-//                      except if one radius is 0, a cone is made
-//   I ignore these lines and just read them in as "%f"
-static int read_rawgraphics(void *v, int *nelem, const molfile_graphics_t **gdata) {
-  int count, i;
-  char buffer[200];
-  float mat[16];
-  FILE *infile = NULL;
-  int futureVersion = 0;
-  int line = 0;
-
-  handle_t *handle = (handle_t *)v;
-  infile = handle->fd;
-
-  int maxelem = 10;
-  int n = 0;
-  molfile_graphics_t *graphics = (molfile_graphics_t *) calloc(1, maxelem*sizeof(molfile_graphics_t));
-
-  // XXX This should probably be in open_file_read
-  if (!get_line(line, buffer, 199, infile)) {
-    fprintf(stderr, "raster3dplugin) Error reading file header (line %d)\n", 
-            line);
-    return MOLFILE_ERROR;
-  }
-
-  // tell the user info about the file
-  for (i = strlen(buffer) - 1; i >= 0 &&
-       (buffer[i] == 10 || buffer[i] == 13); i--) buffer[i] = 0;
-  printf("raster3dplugin) scene title: '%s'\n", buffer);
-
-  // The next 11 lines of text contain more header information
-  // about lighting, anti aliasing, image size, etc. This can be
-  // ignored.
-  for (count = 0; count < 11; count++) {
-    if (!get_line(line, buffer, 199, infile)) {
-      fprintf(stderr, 
-              "raster3dplugin) error reading file header (line %d)\n", line);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  // Now I have to get the matrix.  This is made nasty since
-  // there could be extra text after the first four numbers on a line
-  // as in: 1 0 0 0 This is an extra comment
-  for (i=0; i<4; i++) {
-    get_line(line, buffer, 199, infile);  // read the whole line into a string
-    if (sscanf(buffer, "%f %f %f %f",
-               &mat[4*i], &mat[4*i+1], &mat[4*i+2], &mat[4*i+3])<4) {
-      fprintf(stderr, "raster3dplugin) invalid format in file (line %d)\n",
-              line);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  get_line(line, buffer, 199, infile);
-  if (sscanf(buffer, "%d", &i) < 1) {
-    fprintf(stderr, 
-            "raster3dplugin) error reading object input mode (line %d)\n", 
-            line);
-    return MOLFILE_ERROR;
-  }
-
-  if (i != 3) {
-     fprintf(stderr, 
-         "raster3dplugin) the specified file is in an unsupported format\n");
-     fprintf(stderr, 
-         "(object input mode %d). Aborting.\n", i);
-     return MOLFILE_ERROR;
-  }
-
-  float data[15];
-  float normals[15];
-  float tricolors[9];
-  float color[9];
-
-  // INFMT/INFMTS input specifiers; these can specifiy Fortran formatted
-  // input formats, but are usually "*" meaning free-format input. We
-  // give a warning if it's not free-format.
-  for (count = 0; count < 3; count++) {
-    get_line(line, buffer, 199, infile);
-    if (buffer[0] != '*') 
-      break;
-  }
-  if (count < 3) {  
-    fprintf(stderr, "raster3dplugin) Warning: this file contains input in a nonstandard\n");
-    fprintf(stderr, "Fortran format. This is generally not supported, and the read may fail.\n");
-  }
-  count = 0;
-
-  while (!feof(infile) && !ferror(infile)) {
-    int objtype = -1;
-
-    if (!get_line(line, buffer, 199, infile)) 
-      continue;
-
-    if (sscanf(buffer, "%d", &objtype) != 1) {
-      fprintf(stderr, "raster3dplugin) bad data in file (line %d)\n", line);
-      return MOLFILE_ERROR;
-    }
-
-    switch(objtype) {
-      case 1: // triangle
-        char buffer2[200];
-        int have_normals;
-        int have_tricolors;
-        long fpos;
-
-        have_normals = 0;
-        have_tricolors = 0;
-
-        get_line(line, buffer, 127, infile);
-        if (feof(infile)) {
-          //msgErr << "Raster3D input: error reading triangle data (line "
-          //<< line << ")" << sendmsg;
-          return MOLFILE_ERROR;
-        }
-
-        if (sscanf(buffer, "%f %f %f %f %f %f %f %f %f %f %f %f",
-                   data  , data+1, data+2, data+3, data+4, data+5,
-                   data+6, data+7, data+8, data+9, data+10, data+11) < 12) { 
-          //msgErr << "Raster3D input: bad triangle data in file (line "
-          //<< line << "). Will try to continue." << sendmsg;
-          continue;
-        }
-
-        while (!feof(infile) && !ferror(infile)) {
-          fpos = ftell(infile);
-          if (!get_line(line, buffer2, 199, infile)) {
-            fseek(infile, fpos, SEEK_SET);
-            break;
-          }
-
-          if (sscanf(buffer2, "%d", &objtype) != 1) {
-            //msgErr << "Raster3D input: bad data in file (line " << line
-            //<< "). Aborting." << sendmsg;
-            return MOLFILE_ERROR;
-          }
-
-          switch (objtype) {
-            case 7: // explicit normals
-              if (!get_line(line, buffer2, 199, infile)) {
-                //msgErr << "Raster3D input: read error in file (line " << line
-                //<< "). Aborting." << sendmsg;
-                return MOLFILE_ERROR;
-              }
-
-              if (sscanf(buffer2, "%f %f %f %f %f %f %f %f %f",
-                         normals  , normals+1, normals+2,
-                         normals+3, normals+4, normals+5,
-                         normals+6, normals+7, normals+8 ) < 9) { 
-                //msgErr << "Raster3D input: error reading triangle normals (line "
-                //<< line << "). Will try to continue." << sendmsg;
-                continue;
-              }
-
-              have_normals = 1;
-              break;
-
-            case 17: // colors at vertices of a tri-color
-              if (!get_line(line, buffer2, 199, infile)) {
-                //msgErr << "Raster3D input: read error in file (line " << line
-                //<< "). Aborting." << sendmsg;
-                return MOLFILE_ERROR;
-              }
-
-              if (sscanf(buffer2, "%f %f %f %f %f %f %f %f %f",
-                         tricolors,  tricolors+ 1, tricolors + 2,
-                         tricolors + 3, tricolors + 4, tricolors + 5,
-                         tricolors + 6, tricolors + 7, tricolors + 8) < 9) {
-                //msgErr << "Raster3D input: error reading vertex colors (line "
-                //<< line << "). Will try to continue." << sendmsg;
-                continue;
-              }
-
-              have_tricolors = 1;
-              break;
-
-            default:
-              fseek(infile, fpos, SEEK_SET);
-              fpos = 0;
-              break;
-
-          }
-
-          if (!fpos) 
-            break;
-        }
-
-        if (ferror(infile)) {
-          //msgErr << "Raster3D input: read error in file (line "
-          //<< line << "). Aborting." << sendmsg;
-          return MOLFILE_ERROR;
-        }
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = sqrt(data[9]);
-        graphics[n].data[1] = sqrt(data[10]);
-        graphics[n].data[2] = sqrt(data[11]);
-        next_elem(n, maxelem, graphics);
-
-        if (have_tricolors) {
-          for (int qq=0; qq<9; qq++) color[qq] = sqrt(tricolors[qq]);
-        }
-
-        if (!have_normals && !have_tricolors) {
-          graphics[n].type = MOLFILE_TRIANGLE;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-        } else if (have_normals && !have_tricolors) {
-          graphics[n].type = MOLFILE_TRINORM;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_NORMS;
-          memcpy(graphics[n].data, normals, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-        } else if (have_tricolors && !have_normals) {
-#if 0
-          float tmp1[3], tmp2[3], tmp3[3];
-          int j;
-          for (j = 0; j < 3; j++) {
-            tmp1[j] = data[3 + j] - data[j];
-            tmp2[j] = data[6 + j] - data[3 + j];
-          }
-          cross_prod(tmp3, tmp1, tmp2);
-          vec_normalize(tmp3);
-          triclr.putdata(data, data+3, data+6,
-                         tmp3, tmp3, tmp3,
-                         colorIndices[0], colorIndices[1], colorIndices[2], 
-                         cmdList);
-#else
-          // XXX Take the average of the color
-          graphics[n].type = MOLFILE_COLOR;
-          graphics[n].data[0] = (color[0]+color[3]+color[6])/3.0f;
-          graphics[n].data[1] = (color[1]+color[4]+color[7])/3.0f;
-          graphics[n].data[2] = (color[2]+color[5]+color[8])/3.0f;
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_TRIANGLE;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-#endif
-        } else {
-#if 0
-          triclr.putdata(data, data+3, data+6,
-                         normals, normals+3, normals+6,
-                         colorIndices[0], colorIndices[1], colorIndices[2], 
-                         cmdList);
-#else
-          graphics[n].type = MOLFILE_TRICOLOR;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_NORMS;
-          memcpy(graphics[n].data, normals, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_COLOR;
-          memcpy(graphics[n].data, color, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-#endif
-       }
-       break;
-
-     case 2: // sphere
-       if (!get_line(line, buffer, 199, infile)) {
-         //msgErr << "Raster3D input: error reading sphere data (line "
-         //<< line << ")" << sendmsg;
-         return MOLFILE_ERROR;
-       }
-
-       if (sscanf(buffer, "%f %f %f %f %f %f %f",
-                  data, data + 1, data + 2, data + 3,
-                  data + 4, data + 5, data + 6) != 7) {
-         //msgErr << "Raster3D input: bad sphere data in file (line "
-         //<< line << "). Will try to continue." << sendmsg;
-         continue;
-       }
-       graphics[n].type = MOLFILE_COLOR;
-       color[0] = sqrt(data[4]);
-       color[1] = sqrt(data[5]);
-       color[2] = sqrt(data[6]);
-       memcpy(graphics[n].data, color, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-       graphics[n].type = MOLFILE_SPHERE;
-       graphics[n].size = data[3];
-       graphics[n].style = 12; // XXX hard-coded resolution
-       memcpy(graphics[n].data, data, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-       break;
-
-     case 3: // rounded cylinder
-     case 5: // flat cylinder
-       if (!get_line(line, buffer, 199, infile)) {
-         //msgErr << "Raster3D input: error reading cylinder data (line "
-         //<< line << ")" << sendmsg;
-         return MOLFILE_ERROR;
-       }
-
-       if (sscanf(buffer, "%f %f %f %f %f %f %f %f %f %f %f",
-                  data, data + 1, data + 2, data + 3, data + 4,
-                  data + 5, data + 6, data + 7, data + 8, data + 9,
-                  data + 10) != 11) {
-         //msgErr << "Raster3D input: bad cylinder data (line "
-         //<< line << "). Will try to continue." << sendmsg;
-         continue;
-       }
-       graphics[n].type = MOLFILE_COLOR;
-       color[0] = sqrt(data[8]);
-       color[1] = sqrt(data[9]);
-       color[2] = sqrt(data[10]);
-       memcpy(graphics[n].data, color, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-       graphics[n].type = MOLFILE_CYLINDER;
-       graphics[n].size = data[3];
-       graphics[n].style = 12; // XXX hard-coded resolution
-       memcpy(graphics[n].data, data, 3*sizeof(float));
-       memcpy(graphics[n].data+3, data+4, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-
-       // cap with spheres for object 3
-       if (objtype == 3) {
-         graphics[n].type = MOLFILE_SPHERE;
-         graphics[n].size = data[3];
-         graphics[n].style = 12; // XXX hard-coded resolution
-         memcpy(graphics[n].data, data, 3*sizeof(float));
-         next_elem(n, maxelem, graphics);
-         graphics[n].type = MOLFILE_SPHERE;
-         graphics[n].size = data[3];
-         graphics[n].style = 12; // XXX hard-coded resolution
-         memcpy(graphics[n].data, data+4, 3*sizeof(float));
-         next_elem(n, maxelem, graphics);
-       }
-       break;
-
-     case 9:
-       break;
-
-     case 6: case 8: case 10: case 11: case 12: case 13: case 15: case 19:
-       // Ignore the next line
-       get_line(line, buffer, 199, infile);
-       break;
-
-     case 7:
-       //msgErr << "Raster3D input: encountered unexpected object 7 (triangle ";
-       //msgErr << "vertex normals) (line " << line;
-       //msgErr << "). Will try to continue." << sendmsg;
-       break;
-
-     case 17:
-       //msgErr << "Raster3D input: encountered unexpected object 17 (triangle " << sendmsg;
-       //msgErr << "vertex colors) (line " << line << "). Will try to continue." << sendmsg;
-       break;
-
-     case 0:  // Raster3D 'force EOF' -- checked later
-       break;
-
-     // We encountered an object that is not recognized.
-     // Need to warn the user. Future version of R3d perhaps?
-     default:
-       if (!futureVersion) {
-         //msgErr << "Raster3D input: encountered unknown object type #"
-         //<< objtype << sendmsg;
-         //msgErr << " (line " << line << "). Future version of Raster3D maybe?"
-         //<< " Will try to continue." << sendmsg;
-         futureVersion = 1;
-       }
-       break;
-
-    } // end of switch
-
-    // If this is a Raster3d "force EOF" object, break
-    if (objtype == 0) 
-      break;
-  } // end of while
-
-  if (ferror(infile)) {
-    //msgErr << "Raster3D input: read error while reading input file (line "
-    //<< line << "). Aborting." << sendmsg;
-    return MOLFILE_ERROR;
-  }
-
-  // normal exit
-  *nelem = n;
-  handle->graphics = graphics;
-  *gdata = graphics;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  handle_t *handle = (handle_t *)v;
-  fclose(handle->fd);
-  handle->fd = NULL;
-  free(handle->graphics);
-  handle->graphics = NULL;
-  delete handle;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "raster3d";
-  plugin.prettyname = "Raster3d Scene File";
-  plugin.author = "Justin Gullingsrud";
-  plugin.majorv = 0;
-  plugin.minorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "r3d";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/readpdb.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/readpdb.h
deleted file mode 100644
index d3c8798e15bedf71c18eeedb64474fd611badce2..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/readpdb.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: readpdb.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.43 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#ifndef READ_PDB_H
-#define READ_PDB_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define PDB_RECORD_LENGTH   80   /* actual record size */
-#define PDB_BUFFER_LENGTH   83   /* size need to buffer + CR, LF, and NUL */
-
-#define VMDUSECONECTRECORDS 1
-
-/*  record type defines */
-enum {
-  PDB_HEADER, PDB_REMARK, PDB_ATOM, PDB_CONECT, PDB_UNKNOWN, PDB_END, PDB_EOF, PDB_CRYST1
-};
-
-/* read the next record from the specified pdb file, and put the string found
-   in the given string pointer (the caller must provide adequate (81 chars)
-   buffer space); return the type of record found
-*/
-static int read_pdb_record(FILE *f, char *retStr) {
-  int ch;
-  char inbuf[PDB_BUFFER_LENGTH]; /* space for line + cr + lf + NUL */
-  int recType = PDB_UNKNOWN;
- 
-  /* XXX This PDB record reading code breaks with files that use
-   * Mac or DOS style line breaks with ctrl-M characters.  We need
-   * to replace the use of fgets() and comparisons against \n with
-   * code that properly handles the other cases.
-   */
- 
-  /* read the next line, including any ending cr/lf char */
-  if (inbuf != fgets(inbuf, PDB_RECORD_LENGTH + 2, f)) {
-    retStr[0] = '\0';
-    recType = PDB_EOF;
-  } else {
-#if 0
-    /* XXX disabled this code since \n chars are desirable in remarks */
-    /* and to make the behavior consistent with webpdbplugin          */
-
-    /* remove the newline character, if there is one */
-    if (inbuf[strlen(inbuf)-1] == '\n')
-      inbuf[strlen(inbuf)-1] = '\0';
-#endif
-
-    /* atom records are the most common */
-    if (!strncmp(inbuf, "ATOM ",  5) || !strncmp(inbuf, "HETATM", 6)) {
-      /* Note that by only comparing 5 chars for "ATOM " rather than 6,     */
-      /* we allow PDB files containing > 99,999 atoms generated by AMBER    */
-      /* to load which would otherwise fail.  Not needed for HETATM since   */
-      /* those aren't going to show up in files produced for/by MD engines. */
-      recType = PDB_ATOM;
-    } else if (!strncmp(inbuf, "CONECT", 6)) {
-      recType = PDB_CONECT;
-    } else if (!strncmp(inbuf, "REMARK", 6)) {
-      recType = PDB_REMARK;
-    } else if (!strncmp(inbuf, "CRYST1", 6)) {
-      recType = PDB_CRYST1;
-    } else if (!strncmp(inbuf, "HEADER", 6)) {
-      recType = PDB_HEADER;
-    } else if (!strncmp(inbuf, "END", 3)) {  /* very permissive */
-      /* XXX we treat any "ENDxxx" record as an end, to simplify testing */
-      /*     since we don't remove trailing '\n' chars                   */
-
-      /* the only two legal END records are "END   " and "ENDMDL" */
-      recType = PDB_END;
-    } 
-
-#if 0
-    /* XXX disable record type checking for now */
-    if (recType == PDB_ATOM || 
-        recType == PDB_CONECT || 
-        recType == PDB_REMARK || 
-        recType == PDB_HEADER || 
-        recType == PDB_CRYST1) {
-      strcpy(retStr, inbuf);
-    } else {
-      retStr[0] = '\0';
-    }
-#else
-    strcpy(retStr, inbuf);
-#endif
-  }
-
-  /* read the '\r', if there was one */
-  ch = fgetc(f);
-  if (ch != '\r')
-    ungetc(ch, f);
-  
-  return recType;
-}
-
-
-/* Extract the alpha/beta/gamma a/b/c unit cell info from a CRYST1 record */
-static void get_pdb_cryst1(const char *record, 
-                           float *alpha, float *beta, float *gamma, 
-                           float *a, float *b, float *c) {
-  char tmp[PDB_RECORD_LENGTH+3]; /* space for line + cr + lf + NUL */
-  char ch, *s;
-  memset(tmp, 0, sizeof(tmp));
-  strncpy(tmp, record, PDB_RECORD_LENGTH);
-
-  s = tmp+6 ;          ch = tmp[15]; tmp[15] = 0;
-  *a = (float) atof(s);
-  s = tmp+15; *s = ch; ch = tmp[24]; tmp[24] = 0;
-  *b = (float) atof(s);
-  s = tmp+24; *s = ch; ch = tmp[33]; tmp[33] = 0;
-  *c = (float) atof(s);
-  s = tmp+33; *s = ch; ch = tmp[40]; tmp[40] = 0;
-  *alpha = (float) atof(s);
-  s = tmp+40; *s = ch; ch = tmp[47]; tmp[47] = 0;
-  *beta = (float) atof(s);
-  s = tmp+47; *s = ch; ch = tmp[54]; tmp[54] = 0;
-  *gamma = (float) atof(s);
-}
-
-
-/* Extract the x,y,z coords, occupancy, and beta from an ATOM record */
-static void get_pdb_coordinates(const char *record, 
-                                float *x, float *y, float *z,
-                                float *occup, float *beta) {
-  char numstr[50]; /* store all fields in one array to save memset calls */
-  memset(numstr, 0, sizeof(numstr));
-
-  if (x != NULL) {
-    strncpy(numstr, record + 30, 8);
-    *x = (float) atof(numstr);
-  }
-
-  if (y != NULL) {
-    strncpy(numstr+10, record + 38, 8);
-    *y = (float) atof(numstr+10);
-  }
-
-  if (z != NULL) {
-    strncpy(numstr+20, record + 46, 8);
-    *z = (float) atof(numstr+20);
-  }
-
-  if (occup != NULL) {
-    strncpy(numstr+30, record + 54, 6);
-    *occup = (float) atof(numstr+30);
-  }
-
-  if (beta != NULL) {
-    strncpy(numstr+40, record + 60, 6);
-    *beta = (float) atof(numstr+40);
-  }
-}
-
-
-/* remove leading and trailing spaces from PDB fields */
-static void adjust_pdb_field_string(char *field) {
-  int i, len;
-
-  len = strlen(field);
-  while (len > 0 && field[len-1] == ' ') {
-    field[len-1] = '\0';
-    len--;
-  }
-
-  while (len > 0 && field[0] == ' ') {
-    for (i=0; i < len; i++)
-      field[i] = field[i+1];
-    len--;
-  }
-}
-
-static void get_pdb_header(const char *record, char *pdbcode, char *date,
-                           char *classification) {
-  if (date != NULL) {
-    strncpy(date, record + 50, 9);
-    date[9] = '\0';
-  }
-
-  if (classification != NULL) {
-    strncpy(classification, record + 10, 40);
-    classification[40] = '\0';
-  }
-
-  if (pdbcode != NULL) {
-    strncpy(pdbcode, record + 62, 4);
-    pdbcode[4] = '\0';
-    adjust_pdb_field_string(pdbcode); /* remove spaces from accession code */
-  }
-}
-
-
-static void get_pdb_conect(const char *record, int natoms, int *idxmap,
-                           int *maxbnum, int *nbonds, int **from, int **to) {
-  int bondto[11], numbonds, i;
-
-  int reclen = strlen(record);
-  for (numbonds=0, i=0; i<11; i++) {
-    char bondstr[6];
-    const int fieldwidth = 5;
-    int start = 6 + i*fieldwidth;
-    int end = start + fieldwidth;
-
-    if (end >= reclen)
-      break;
-
-    memcpy(bondstr, record + start, fieldwidth);
-    bondstr[5] = '\0';
-    if (sscanf(bondstr, "%d", &bondto[numbonds]) < 0)
-      break;
-    numbonds++; 
-  }
-
-  for (i=0; i<numbonds; i++) {
-    /* only add one bond per pair, PDBs list them redundantly */ 
-    if (bondto[i] > bondto[0]) {
-      int newnbonds = *nbonds + 1; /* add a new bond */
-
-      /* allocate more bondlist space if necessary */
-      if (newnbonds >= *maxbnum) {
-        int newmax;
-        int *newfromlist, *newtolist;
-        newmax = (newnbonds + 11) * 1.25;
-
-        newfromlist = (int *) realloc(*from, newmax * sizeof(int));
-        newtolist = (int *) realloc(*to, newmax * sizeof(int));
-
-        if (newfromlist != NULL || newtolist != NULL) {
-          *maxbnum = newmax;
-          *from = newfromlist;
-          *to = newtolist;
-        } else {
-          printf("readpdb) failed to allocate memory for bondlists\n");
-          return; /* abort */
-        }
-      }
-
-      *nbonds = newnbonds;
-      (*from)[newnbonds-1] = idxmap[bondto[0]] + 1;
-      (*to)[newnbonds-1] = idxmap[bondto[i]] + 1;
-    }
-  }
-}
-
-/* ATOM field format according to PDB standard v2.2
-  COLUMNS        DATA TYPE       FIELD         DEFINITION
----------------------------------------------------------------------------------
- 1 -  6        Record name     "ATOM  "
- 7 - 11        Integer         serial        Atom serial number.
-13 - 16        Atom            name          Atom name.
-17             Character       altLoc        Alternate location indicator.
-18 - 20        Residue name    resName       Residue name.
-22             Character       chainID       Chain identifier.
-23 - 26        Integer         resSeq        Residue sequence number.
-27             AChar           iCode         Code for insertion of residues.
-31 - 38        Real(8.3)       x             Orthogonal coordinates for X in Angstroms.
-39 - 46        Real(8.3)       y             Orthogonal coordinates for Y in Angstroms.
-47 - 54        Real(8.3)       z             Orthogonal coordinates for Z in Angstroms.
-55 - 60        Real(6.2)       occupancy     Occupancy.
-61 - 66        Real(6.2)       tempFactor    Temperature factor.
-73 - 76        LString(4)      segID         Segment identifier, left-justified.
-77 - 78        LString(2)      element       Element symbol, right-justified.
-79 - 80        LString(2)      charge        Charge on the atom.
- */
-
-/* Break a pdb ATOM record into its fields.  The user must provide the
-   necessary space to store the atom name, residue name, and segment name.
-   Character strings will be null-terminated.
-*/
-static void get_pdb_fields(const char *record, int reclength, int *serial,
-                           char *name, char *resname, char *chain, 
-                           char *segname, char *resid, char *insertion, 
-                           char *altloc, char *elementsymbol,
-                           float *x, float *y, float *z, 
-                           float *occup, float *beta) {
-  char serialbuf[6];
-
-  /* get atom serial number */
-  strncpy(serialbuf, record + 6, 5);
-  serialbuf[5] = '\0';
-  *serial = 0;
-  sscanf(serialbuf, "%5d", serial);
-  
-  /* get atom name */
-  strncpy(name, record + 12, 4);
-  name[4] = '\0';
-  adjust_pdb_field_string(name); /* remove spaces from the name */
-
-  /* get alternate location identifier */
-  strncpy(altloc, record + 16, 1);
-  altloc[1] = '\0';
-
-  /* get residue name */
-  strncpy(resname, record + 17, 4);
-  resname[4] = '\0';
-  adjust_pdb_field_string(resname); /* remove spaces from the resname */
-
-  /* get chain name */
-  chain[0] = record[21];
-  chain[1] = '\0';
-
-  /* get residue id number */
-  strncpy(resid, record + 22, 4);
-  resid[4] = '\0';
-  adjust_pdb_field_string(resid); /* remove spaces from the resid */
-
-  /* get the insertion code */
-  insertion[0] = record[26];
-  insertion[1] = '\0';
-
-  /* get x, y, and z coordinates */
-  get_pdb_coordinates(record, x, y, z, occup, beta);
-
-  /* get segment name */
-  if (reclength >= 73) {
-    strncpy(segname, record + 72, 4);
-    segname[4] = '\0';
-    adjust_pdb_field_string(segname); /* remove spaces from the segname */
-  } else {
-    segname[0] = '\0';
-  }
-
-  /* get the atomic element symbol */
-  if (reclength >= 77) {
-    strncpy(elementsymbol, record + 76, 2);
-    elementsymbol[2] = '\0';
-  } else {
-    elementsymbol[0] = '\0';
-  }
-}  
-
-
-/* Write PDB data to given file descriptor; return success. */
-static int write_raw_pdb_record(FILE *fd, const char *recordname,
-    int index,const char *atomname, const char *resname,int resid, 
-    const char *insertion, const char *altloc, const char *elementsymbol,
-    float x, float y, float z, float occ, float beta, 
-    const char *chain, const char *segname) {
-  int rc;
-  char indexbuf[32];
-  char residbuf[32];
-  char segnamebuf[5];
-  char resnamebuf[5];
-  char altlocchar;
-
-  /* XXX                                                          */
-  /* if the atom or residue indices exceed the legal PDB spec, we */
-  /* start emitting asterisks or hexadecimal strings rather than  */
-  /* aborting.  This is not really legal, but is an accepted hack */
-  /* among various other programs that deal with large PDB files  */
-  /* If we run out of hexadecimal indices, then we just print     */
-  /* asterisks.                                                   */
-  if (index < 100000) {
-    sprintf(indexbuf, "%5d", index);
-  } else if (index < 1048576) {
-    sprintf(indexbuf, "%05x", index);
-  } else {
-    sprintf(indexbuf, "*****");
-  }
-
-  if (resid < 10000) {
-    sprintf(residbuf, "%4d", resid);
-  } else if (resid < 65536) {
-    sprintf(residbuf, "%04x", resid);
-  } else { 
-    sprintf(residbuf, "****");
-  }
-
-  altlocchar = altloc[0];
-  if (altlocchar == '\0') {
-    altlocchar = ' ';
-  }
-
-  /* make sure the segname or resname do not overflow the format */ 
-  strncpy(segnamebuf,segname,4);
-  segnamebuf[4] = '\0';
-  strncpy(resnamebuf,resname,4);
-  resnamebuf[4] = '\0';
-
- 
-  rc = fprintf(fd,
-         "%-6s%5s %4s%c%-4s%c%4s%c   %8.3f%8.3f%8.3f%6.2f%6.2f      %-4s%2s\n",
-         recordname, indexbuf, atomname, altlocchar, resnamebuf, chain[0], 
-         residbuf, insertion[0], x, y, z, occ, beta, segnamebuf, elementsymbol);
-
-  return (rc > 0);
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/rst7plugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/rst7plugin.c
deleted file mode 100644
index ebe0bce69688dd46230fd1fff463e7f6f3077079..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/rst7plugin.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: rst7plugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.20 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "vmdconio.h"
-
-typedef struct {
-  FILE *file;
-  int has_box;
-  int has_vels;
-  int numatoms;
-  int count;
-  int rstfile;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-} rstdata;
-
-static void *open_rst_read(const char *filename, const char *filetype,int *natoms) {
-  FILE *fd;
-  rstdata *data;
-  int numats=0,i,j,point2,kkk=1; 
-  char title[82], *field;
-  char line[82];
-  float x, y, z,a=0.0,b=0.0,c=0.0;
-  double  timesteprst;
-
-  /* Amber 7'coord' restart files have a second introduction line with 
-   * possibly 2 entries only check for one now...
-   * they include three 90.00 ter cards at the end
-   * need to fix this, real crd files have atom record but no timestep and no
-   * velocity info...arggggg
-   */
-  fd = fopen(filename, "rb");
-  if (!fd) 
-    return NULL; /* failure */
-
-  data = (rstdata *)malloc(sizeof(rstdata));
-  memset(data, 0, sizeof(rstdata));
-#if vmdplugin_ABIVERSION > 10
-  data->ts_meta.count = -1;
-  data->ts_meta.has_velocities = 0;
-#endif
-
-  fgets(title, 82, fd);
-  vmdcon_printf(VMDCON_INFO, "rst7plugin) Title: %s\n",title);
-
-  fgets(line, 82, fd);
-  while (kkk==1) {
-    /* try to read first field */
-    field = strtok(line, " \t");
-    if (field==NULL) {                
-      continue; /* no fields at all on this line */
-    }
-    numats = atoi(field);
-
-    /* try to read second field will be null if not there */
-    field = strtok(NULL, " \t");
-    if (field==NULL) {
-      kkk=0;
-      vmdcon_printf(VMDCON_INFO, "rst7plugin) This file has no velocity info.\n");
-      data->has_vels=0;
-    } else {
-      timesteprst = strtod(field, NULL);
-      vmdcon_printf(VMDCON_INFO, "rst7plugin) This file contains velocity info.\n");
-      data->has_vels=1;
-#if vmdplugin_ABIVERSION > 10
-      data->ts_meta.has_velocities = 1;
-#endif
-      kkk=0;
-    }
-  }
-
-  point2=ftell(fd);
-  data->file = fd;
-  vmdcon_printf(VMDCON_INFO, "rst7plugin) The Restartcrd has %d atoms.\n",numats);
-
-  /* skip over coordinate data */
-  for (i=0; i<numats; i++) {
-    j = fscanf(fd, "%f%f%f", &x, &y, &z);
-  }
-
-  /* skip over velocity data, if present */
-  if (data->has_vels) {
-    for (i=0; i<numats; i++) {
-      j = fscanf(fd, "%f%f%f", &x, &y, &z);
-    }
-  }
-  
-  j = fscanf(fd, "%f%f%f%f%f%f", &x, &y, &z,&a,&b,&c);
-  if (j != EOF) {
-    vmdcon_printf(VMDCON_INFO, "rst7plugin) This restartcrd file has box info.\n");
-    data->has_box=1;
-    vmdcon_printf(VMDCON_INFO, "rst7plugin) Box Dimensions are %f %f %f %f %f %f\n",x,y,z,a,b,c);
-  }
-
-  *natoms=numats;
-  data->numatoms=numats;
-  data->rstfile=1;
-  fseek(fd,point2,SEEK_SET);
-
-  return data;
-}
-
-#if vmdplugin_ABIVERSION > 10
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  rstdata *data = (rstdata *)mydata;
-  
-  meta->count = -1;
-  meta->has_velocities = data->ts_meta.has_velocities;
-  if (meta->has_velocities) {
-    vmdcon_printf(VMDCON_INFO,
-                  "rst7plugin) Importing velocities from restart file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static int read_rst_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  rstdata *rst= (rstdata *)mydata;
-  int i, j;
-  float x, y, z, a, b, c;
-  
-  /* check for rst and first read through already taken place */
-  if(rst->count==1 && rst->rstfile==1) 
-    return MOLFILE_ERROR; 
-
-  ts->A = ts->B = ts->C = 0.0f;
-  ts->alpha = ts->beta = ts->gamma = 90.0f;
-  
-  for (i=0; i<rst->numatoms; i++)  {
-    /* changed to i=1 BB */
-    j = fscanf(rst->file, "%f%f%f", &x, &y, &z);
-    if (j == EOF) {
-      return MOLFILE_ERROR;
-    } else if (j <= 0) {
-      vmdcon_printf(VMDCON_ERROR, "rst7plugin) Problem reading CRD file\n");
-      return MOLFILE_ERROR;
-    }
-    ts->coords[3*i] = x;
-    ts->coords[3*i+1] = y;
-    ts->coords[3*i+2] = z;
-  }
-
-  if (rst->has_vels) {
-    /* Read in optional velocity data.  Units are Angstroms per 1/20.455ps. */
-    for (i=0; i<rst->numatoms; i++)  {
-      j = fscanf(rst->file, "%f%f%f", &x, &y, &z);
-      if (j == EOF) {
-        return MOLFILE_ERROR;
-      } else if (j <= 0) {
-        vmdcon_printf(VMDCON_ERROR, "rst7plugin) Problem reading velocities\n");
-        return MOLFILE_ERROR;
-      }
-#if vmdplugin_ABIVERSION > 10
-      if (ts->velocities != NULL) {
-        ts->velocities[3*i] = x;
-        ts->velocities[3*i+1] = y;
-        ts->velocities[3*i+2] = z;
-      }
-#endif
-    }
-  }
- 
-  if (rst->has_box) {
-    j = fscanf(rst->file, "%f%f%f%f%f%f", &x, &y, &z, &a, &b, &c);
-    if (j == EOF) {
-      vmdcon_printf(VMDCON_ERROR, "rst7plugin) Problem reading box data\n");
-      return MOLFILE_ERROR;
-    }
-    ts->A = x;
-    ts->B = y;
-    ts->C = z;
-    ts->alpha = a;
-    ts->beta = b;
-    ts->gamma = c;
-  }
-  rst->count++;
-  /* printf("rst->count: %d\n",rst->count); */
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_rst_read(void *mydata) {
-  rstdata *rst= (rstdata *)mydata;
-  fclose(rst->file);
-  free(rst);
-}
-
-static void *open_rst_write(const char *path, const char *filetype, int natoms) {
-  char title[82];
-  rstdata *rst;
-  FILE *fd;
-  int len;
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    vmdcon_printf(VMDCON_ERROR, "rst7plugin) Could not open file %s for writing\n", path);
-    return NULL;
-  }
-  /* write out fixed length fortran style string */
-  sprintf(title, "TITLE : Created by VMD with %d atoms",natoms);
-  len = strlen(title);
-  memset(title+len,(int)' ',82-len);
-  title[80] = '\n';
-  title[81] = '\0';
-  fputs(title,fd);
-
-  rst = (rstdata *)malloc(sizeof(rstdata));
-  rst->file = fd;
-  rst->numatoms = natoms;
-  rst->has_box = 1;
-  return rst;
-}
-  
-static int write_rst_timestep(void *v, const molfile_timestep_t *ts) {
-  rstdata *rst = (rstdata *)v;
-  int i;
-  const int ndata = rst->numatoms * 3;
-
-#if vmdplugin_ABIVERSION > 10
-  if (ts->velocities != NULL) {
-    fprintf(rst->file, "%10d %13.7g\n", rst->numatoms, ts->physical_time);
-  } else
-#endif
-    fprintf(rst->file, "%10d\n", rst->numatoms);
-
-  for (i=0; i<ndata; i++) {
-    fprintf(rst->file, "%12.7f", ts->coords[i]);
-    if ((i+1) % 6 == 0) fprintf(rst->file, "\n"); 
-  }
-  if (ndata % 6 != 0) fprintf(rst->file,"\n");
-
-#if vmdplugin_ABIVERSION > 10
-  if (ts->velocities != NULL) {
-    for (i=0; i<ndata; i++) {
-      fprintf(rst->file, "%12.7f", ts->velocities[i]);
-      if ((i+1) % 6 == 0) fprintf(rst->file, "\n"); 
-    }
-    if (ndata % 6 != 0) fprintf(rst->file,"\n");
-  }
-#endif
-
-  fprintf (rst->file, "%12.7f%12.7f%12.7f%12.7f%12.7f%12.7f\n",
-           ts->A, ts->B, ts->C, ts->alpha, ts->beta, ts->gamma);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_rst_write(void *v) {
-  rstdata *rst = (rstdata *)v;
-  fclose(rst->file);
-  free(rst);
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(){
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "rst7";
-  plugin.prettyname = "AMBER7 Restart";
-  plugin.author = "Brian Bennion, Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "rst7";
-  plugin.open_file_read = open_rst_read;
-  plugin.read_next_timestep = read_rst_timestep;
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata = read_timestep_metadata;
-#endif
-  plugin.close_file_read = close_rst_read;
-  plugin.open_file_write = open_rst_write;
-  plugin.write_timestep = write_rst_timestep;
-  plugin.close_file_write = close_rst_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(){ return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/situsplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/situsplugin.C
deleted file mode 100644
index 3f19278bf8d0d832e7857d0ebb384d14509ba351..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/situsplugin.C
+++ /dev/null
@@ -1,379 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: situsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Situs EM map file reader
- *   map is a cubic lattice
- *   all data is stored in plain ASCII for convenience
- *
- * Format of the file is:
- *   voxel size in Angstroms
- *   coordinates of first voxel
- *   integer X/Y/Z counts
- *   voxels follow in X fastest, Y next fastest, Z slowest
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define MIN(X,Y) (((X)<(Y))? (X) : (Y))
-#define MAX(X,Y) (((X)>(Y))? (X) : (Y))
-
-#define TOLERANCE 1e-4
-
-#ifndef NAN //not a number
-  const float NAN = sqrtf(-1.f); //need some kind of portable NAN definition
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} situs_t;
-
-
-static void *open_situs_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  situs_t *situs;
-  float scale;
-  int xsize, ysize, zsize;
-  float orig[3]; 
-  
-  fd = fopen(filepath, "r");
-  if (!fd) {
-    printf("situsplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* get the scale */
-  if (fscanf(fd, "%f", &scale) != 1) {;
-    printf("situsplugin) Error reading voxel scale.\n");
-    return NULL;
-  }
-
-  if (fscanf(fd, "%f %f %f", orig, orig+1, orig+2) != 3) {
-    printf("situsplugin) Error reading grid origin.\n");
-    return NULL;
-  }
-
-  /* get the number of grid points */
-  if (fscanf(fd, "%d %d %d", &xsize, &ysize, &zsize) != 3) {
-    printf("situsplugin) Error reading grid dimensions.\n");
-    return NULL;
-  }
-
-  /* allocate and initialize the situs structure */
-  situs = new situs_t;
-  situs->fd = fd;
-  situs->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  situs->nsets = 1; /* this file contains only one data set */
-
-  situs->vol = new molfile_volumetric_t[1];
-  strcpy(situs->vol[0].dataname, "Situs map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    situs->vol[0].origin[i] = orig[i];
-    situs->vol[0].xaxis[i] = 0.0;
-    situs->vol[0].yaxis[i] = 0.0;
-    situs->vol[0].zaxis[i] = 0.0;
-  }
-  situs->vol[0].xaxis[0] = scale * (xsize-1);
-  situs->vol[0].yaxis[1] = scale * (ysize-1);
-  situs->vol[0].zaxis[2] = scale * (zsize-1);
-
-  situs->vol[0].xsize = xsize;
-  situs->vol[0].ysize = ysize;
-  situs->vol[0].zsize = zsize;
-
-  situs->vol[0].has_color = 0; /* Situs maps contain no color information. */
-
-  return situs;
-}
-
-static int read_situs_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  situs_t *situs = (situs_t *)v;
-  *nsets = situs->nsets; 
-  *metadata = situs->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_situs_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  situs_t *situs = (situs_t *)v;
-  FILE *fd = situs->fd;
-  int xsize, ysize, zsize, xysize, count, total;
-
-  xsize = situs->vol[0].xsize;
-  ysize = situs->vol[0].ysize;
-  zsize = situs->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  /* Read the values from the file */
-  for (count=0; count<total; count++) {
-    if (fscanf(fd, "%f", datablock + count) != 1) {
-      printf("situsplugin) Failed reading situs map data\n");
-      return MOLFILE_ERROR;
-    }
-  }   
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_situs_read(void *v) {
-  situs_t *situs = (situs_t *)v;
-  
-  fclose(situs->fd);
-  if (situs->vol != NULL)
-    delete [] situs->vol; 
-  delete situs;
-}
-
-static void *open_situs_write(const char *filepath, const char *filetype, int natoms) {
-
-  FILE *fd = fopen(filepath, "w");
-  if (!fd) {
-    fprintf(stderr, "situsplugin) Could not open path '%s' for writing.\n",
-      filepath);
-  }
-  return fd;
-}
-
-static void close_situs_write(void *v) {
-  if (v) {
-    fclose((FILE *)v);
-  }
-}
-
-/* The Situs format requires the same grid spacing in all directions.
- * The following code allows us to re-sample the map so that we can 
- * write a Situs file when the uniform grid spacing requirement is not met.
- * */
-
-/// return voxel, after safely clamping index to valid range
-float situs_voxel_value_safe(int x, int y, int z, const int xsize, const int ysize, const int zsize, const float *data) {
-  int xx, yy, zz; 
-  xx = (x > 0) ? ((x < xsize) ? x : xsize-1) : 0;
-  yy = (y > 0) ? ((y < ysize) ? y : ysize-1) : 0;
-  zz = (z > 0) ? ((z < zsize) ? z : zsize-1) : 0;
-  int index = zz*xsize*ysize + yy*xsize + xx;
-  return data[index];
-}
-
-/// return interpolated value from 8 nearest neighbor voxels
-float situs_voxel_value_interpolate(float xv, float yv, float zv, const int xsize, const int ysize, const int zsize, const float *data) {
-  int x = (int) xv;
-  int y = (int) yv;
-  int z = (int) zv;
-  // fractional offset
-  float xf = xv - x;
-  float yf = yv - y;
-  float zf = zv - z;
-  float xlerps[4];
-  float ylerps[2];
-  float tmp;
-
-  tmp = situs_voxel_value_safe(x, y, z, xsize, ysize, zsize, data);
-  xlerps[0] = tmp + xf*(situs_voxel_value_safe(x+1, y, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = situs_voxel_value_safe(x, y+1, z, xsize, ysize, zsize, data);
-  xlerps[1] = tmp + xf*(situs_voxel_value_safe(x+1, y+1, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = situs_voxel_value_safe(x, y, z+1, xsize, ysize, zsize, data);
-  xlerps[2] = tmp + xf*(situs_voxel_value_safe(x+1, y, z+1, xsize, ysize, zsize, data) - tmp);
-
-  tmp = situs_voxel_value_safe(x, y+1, z+1, xsize, ysize, zsize, data);
-  xlerps[3] = tmp + xf*(situs_voxel_value_safe(x+1, y+1, z+1, xsize, ysize, zsize, data) - tmp);
-
-  ylerps[0] = xlerps[0] + yf*(xlerps[1] - xlerps[0]);
-  ylerps[1] = xlerps[2] + yf*(xlerps[3] - xlerps[2]);
-
-  return ylerps[0] + zf*(ylerps[1] - ylerps[0]);
-}
-
-/// return interpolated value of voxel, based on atomic coords.
-/// XXX need to account for non-orthog. cells
-float situs_voxel_value_interpolate_from_coord(float xpos, float ypos, float zpos, const float *origin, const float *xdelta, const float *ydelta, const float *zdelta, const int xsize, const int ysize, const int zsize, float *data) {
-  xpos = (xpos-origin[0])/xdelta[0];
-  ypos = (ypos-origin[1])/ydelta[1];
-  zpos = (zpos-origin[2])/zdelta[2];
-  int gx = (int) xpos; // XXX this is wrong for non-orthog cells.
-  int gy = (int) ypos;
-  int gz = (int) zpos;
-  if (gx < 0 || gx >= xsize) return NAN;
-  if (gy < 0 || gy >= ysize) return NAN;
-  if (gz < 0 || gz >= zsize) return NAN;
-    
-  return situs_voxel_value_interpolate(xpos, ypos, zpos, xsize, ysize, zsize, data);
-
-}
-
-static int write_situs_data(void *v, molfile_volumetric_t *metadata, float *datablock, float *colorblock) {
-
-  FILE *fd = (FILE *)v;
-  const int xsize = metadata->xsize;
-  const int ysize = metadata->ysize;
-  const int zsize = metadata->zsize;
-  const int xysize = xsize * ysize;
-
-  float xaxis[3], yaxis[3], zaxis[3];
-  float xdelta[3], ydelta[3], zdelta[3];
-  float origin[3];
-
-  int i, j, k;
-
-  for (i=0; i<3; i++) {
-    origin[i] = metadata->origin[i];
-    xaxis[i] = metadata->xaxis[i];
-    yaxis[i] = metadata->yaxis[i];
-    zaxis[i] = metadata->zaxis[i];
-    xdelta[i] = xaxis[i]/(xsize - 1);
-    ydelta[i] = yaxis[i]/(ysize - 1);
-    zdelta[i] = zaxis[i]/(zsize - 1);
-  }
-
-  /* Situs format requires an orthogonal cell */
-  if (fabs(xaxis[1]) > TOLERANCE || fabs(xaxis[2]) > TOLERANCE ||
-      fabs(yaxis[0]) > TOLERANCE || fabs(yaxis[2]) > TOLERANCE ||
-      fabs(zaxis[0]) > TOLERANCE || fabs(zaxis[1]) > TOLERANCE) {
-    fprintf(stderr, "situsplugin) Could not write situs file: this format requires an orthogonal cell.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* Situs format requires the same grid spacing in all dimensions */
-  float xres = xdelta[0]*xdelta[0] + xdelta[1]*xdelta[1] + xdelta[2]*xdelta[2];
-  float yres = ydelta[0]*ydelta[0] + ydelta[1]*ydelta[1] + ydelta[2]*ydelta[2];
-  float zres = zdelta[0]*zdelta[0] + zdelta[1]*zdelta[1] + zdelta[2]*zdelta[2];
-  if ( (fabs(xres-yres) > TOLERANCE) || (fabs(xres-zres) > TOLERANCE) ) {
-
-    //fprintf(stderr, "situsplugin) Could not write situs file: this format requires the same grid spacing in all dimensions.\n");
-    //return MOLFILE_ERROR;
-    
-    fprintf(stderr, "situsplugin) Warning: This format requires the same grid spacing in all dimensions. The map will be re-sampled to meet this requirement. The resulting cell may be slightly smaller than the original one.\n");
-
-    // Use the smallest grid spacing for the re-sampled map
-    float new_delta = MIN(xdelta[0], ydelta[1]);
-    new_delta = MIN(new_delta, zdelta[2]);
-
-    // Calculate the map dimensions for the new grid spacing 
-    int new_xsize = int(xaxis[0]/new_delta);
-    int new_ysize = int(yaxis[1]/new_delta);
-    int new_zsize = int(zaxis[2]/new_delta);
-    int new_xysize = new_xsize * new_ysize;
-    int new_size = new_xsize * new_ysize * new_zsize;
-
-    // Resample map
-    float *new_data = (float *)malloc(3*new_size*sizeof(float));
-    for (i=0; i<new_xsize; i++) {
-      float xpos = origin[0] + i*new_delta;
-      for (j=0; j<new_ysize; j++) {
-        float ypos = origin[1] + j*new_delta;
-        for (k=0; k<new_zsize; k++) {
-          float zpos = origin[2] + k*new_delta;
-          new_data[i + j*new_xsize + k*new_xysize] = situs_voxel_value_interpolate_from_coord(xpos, ypos, zpos, origin, xdelta, ydelta, zdelta, xsize, ysize, zsize, datablock);
-        }
-      }
-    }
-
-    /* Write a situs header */
-    fprintf(fd, "%g %g %g %g %d %d %d\n\n", new_delta, origin[0], origin[1], origin[2], new_xsize, new_ysize, new_zsize);
-  
-    /* Write the main data array */
-    int numentries = 1;
-    for (k=0; k<new_zsize; k++) {
-      for (j=0; j<new_ysize; j++) {
-        for (i=0; i<new_xsize; i++) {
-          fprintf(fd, "%g ", new_data[i + j*new_xsize + k*new_xysize]);
-          if (numentries % 10 == 0) fprintf(fd, "\n");
-          numentries++;
-        }
-      }
-    }
-
-    free(new_data);
-
-  } else {
-  
-    /* Write a situs header */
-    fprintf(fd, "%g %g %g %g %d %d %d\n\n", xdelta[0], origin[0], origin[1], origin[2], xsize, ysize, zsize);
-  
-    /* Write the main data array */
-    int numentries = 1;
-    for (k=0; k<zsize; k++) {
-      for (j=0; j<ysize; j++) {
-        for (i=0; i<xsize; i++) {
-          fprintf(fd, "%g ", datablock[i + j*xsize + k*xysize]);
-          if (numentries % 10 == 0) fprintf(fd, "\n");
-          numentries++;
-        }
-      }
-    }
-
-  }
-
-  fflush(fd);
-  return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "situs";
-  plugin.prettyname = "Situs Density Map";
-  plugin.author = "John Stone, Leonardo Trabuco";
-  plugin.majorv = 1;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "sit,situs";
-  plugin.open_file_read = open_situs_read;
-  plugin.read_volumetric_metadata = read_situs_metadata;
-  plugin.read_volumetric_data = read_situs_data;
-  plugin.close_file_read = close_situs_read;
-#if vmdplugin_ABIVERSION > 9
-  plugin.open_file_write = open_situs_write;
-  plugin.write_volumetric_data = write_situs_data;
-  plugin.close_file_write = close_situs_write;
-#endif
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/spiderplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/spiderplugin.C
deleted file mode 100644
index 830cccace4b00d65e2c40eed95b45478c187dc15..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/spiderplugin.C
+++ /dev/null
@@ -1,328 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: spiderplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.17 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * SPIDER volumetric image datasets
- *   http://www.wadsworth.org/spider_doc/spider/docs/image_doc.html
- *
- * TODO:
- *  - Add code to determine axis scaling factors, axis angles, offsets, etc
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-#include "endianswap.h"
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-  int byteswap;
-  int nslice;
-  int nrow;
-  int nlabel;
-  int iform;
-  int imami;
-  float fmax;
-  float fmin;
-  float av;
-  float sig;
-  int nsam;
-  int headrec;
-  int iangle;
-  float phi;
-  float theta;
-  float gamma;
-  float xoffset;
-  float yoffset;
-  float zoffset;
-  float scale;
-  int headbyt;
-  int reclen;
-  int nstack;
-  int inuse;
-  int maxim; 
-} spider_t;
-
-
-static void *open_spider_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  spider_t *vol;
-  int total;
-
-  /* file header buffer union */ 
-  union buffer {
-    float fbuf[256];  
-    char  cbuf[1024];
-  } h;
- 
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "spiderplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* allocate and initialize the spider structure */
-  vol = new spider_t;
-  vol->fd = fd;
-  vol->vol = NULL;
-  vol->byteswap = 0;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  vol->nsets = 1; /* this file contains only one data set */
-
-  vol->vol = new molfile_volumetric_t[1];
-  strcpy(vol->vol[0].dataname, "SPIDER map");
-
-  // read SPIDER file header
-  if (fread(&h.cbuf, 1024, 1, fd) < 1) {
-    printf("spiderplugin) failed to read file header\n");
-    return NULL; 
-  } 
-
-  // perform sanity checks on header values to see if we 
-  // need to do byte swapping, or abort.
-  vol->nslice   = (h.fbuf[0] < 0) ? -h.fbuf[0] : h.fbuf[0];
-  vol->nrow     = h.fbuf[1];
-  vol->nsam     = h.fbuf[11];
-  total = vol->nslice * vol->nrow * vol->nsam;
-
-  if (total <= 0 || 
-      vol->nsam   <= 0 || vol->nsam   > 100000 ||
-      vol->nrow   <= 0 || vol->nrow   > 100000 ||
-      vol->nslice <= 0 || vol->nslice > 100000) { 
-
-    printf("spiderplugin) Non-native endianness or unusual file detected\n");
-
-    // byte swap the entire header in hopes of making sense of this gibberish
-    vol->byteswap = 1;
-    swap4_aligned(&h.fbuf, 256);
-
-    vol->nslice   = (h.fbuf[0] < 0) ? -h.fbuf[0] : h.fbuf[0];
-    vol->nrow     = h.fbuf[1];
-    vol->nsam     = h.fbuf[11];
-    total = vol->nslice * vol->nrow * vol->nsam;
-
-    // check to see if we still have gibberish or not, bail out if we do.
-    if (total <= 0 || 
-      vol->nsam   <= 0 || vol->nsam   > 100000 ||
-      vol->nrow   <= 0 || vol->nrow   > 100000 ||
-      vol->nslice <= 0 || vol->nslice > 100000) { 
-      printf("spiderplugin) bad header values in file fail sanity checks\n");
-      delete [] vol->vol;
-      delete vol;
-      return NULL;
-    }
-  }
-  if (vol->byteswap) {
-    printf("spiderplugin) Enabling byte swapping\n");
-  }
-
-  vol->nlabel   = h.fbuf[3];
-  vol->iform    = h.fbuf[4];
-  vol->imami    = h.fbuf[5];
-  vol->fmax     = h.fbuf[6];
-  vol->fmin     = h.fbuf[7];
-  vol->av       = h.fbuf[8];
-  vol->sig      = h.fbuf[9];
-  vol->headrec  = h.fbuf[12];
-  vol->iangle   = h.fbuf[13];
-  vol->phi      = h.fbuf[14];
-  vol->theta    = h.fbuf[15];
-  vol->gamma    = h.fbuf[16];
-  vol->xoffset  = h.fbuf[17];
-  vol->yoffset  = h.fbuf[18];
-  vol->zoffset  = h.fbuf[19];
-  vol->scale    = h.fbuf[20];
-  vol->headbyt  = h.fbuf[21];
-  vol->reclen   = h.fbuf[22];
-  vol->nstack   = h.fbuf[23];
-  vol->inuse    = h.fbuf[24];
-  vol->maxim    = h.fbuf[25];
-
-printf("spider  nslice: %d\n", vol->nslice);
-printf("spider    nrow: %d\n", vol->nrow);
-printf("spider    nsam: %d\n", vol->nsam);
-printf("spider   iform: %d\n", vol->iform);
-printf("spider   scale: %f\n", vol->scale);
-printf("spider xoffset: %f\n", vol->xoffset);
-printf("spider yoffset: %f\n", vol->yoffset);
-printf("spider zoffset: %f\n", vol->zoffset);
-printf("spider     phi: %f\n", vol->phi);
-printf("spider   theta: %f\n", vol->theta);
-printf("spider   gamma: %f\n", vol->gamma);
-
-  /* correct bad headbyt and reclen SPIDER files */
-  if (vol->iform < 4 && (vol->reclen < (vol->nsam * 4)))
-    vol->reclen = vol->nsam * 4; 
-
-  int headrec = 1024 / vol->reclen;
-  if (vol->reclen < 1024 && (1024 % (vol->reclen)) != 0)
-     headrec++;
-  int headbyt = headrec * vol->reclen;
- 
-  if (vol->iform < 4 && (vol->headbyt < headbyt))
-    vol->headbyt = headbyt;
-
-printf("spider headbyt: %d\n", vol->headbyt);
-
-  /* seek to data offset */
-  fseek(fd, vol->headbyt, SEEK_SET);
-
-  /* SPIDER files contain no color information */
-  vol->vol[0].has_color = 0;
-
-  vol->vol[0].xsize = vol->nsam;
-  vol->vol[0].ysize = vol->nrow;
-  vol->vol[0].zsize = vol->nslice;
-
-  /* Set the unit cell origin and basis vectors */
-  float vz[3] = {0.0, 0.0, 0.0};
-  memcpy(vol->vol[0].xaxis, &vz, sizeof(vz));
-  memcpy(vol->vol[0].yaxis, &vz, sizeof(vz));
-  memcpy(vol->vol[0].zaxis, &vz, sizeof(vz));
-
-  /* the scale value may be zero, if so, just reset to 1.0 */
-  float vscale = vol->scale;
-  if (vscale == 0.0) 
-    vscale = 1.0;
-
-  /* the data is stored in y/x/-z order and coordinate handedness  */
-  /* we should probably rewrite the loader loop to shuffle x/y     */
-  /* so that future conversions to other formats don't leave it in */
-  /* an unusual packing order.  For now this works however         */
-
-  float xlen = vscale * (vol->vol[0].ysize-1);
-  float ylen = vscale * (vol->vol[0].xsize-1);
-  float zlen = vscale * (vol->vol[0].zsize-1);
-
-  vol->vol[0].xaxis[1] =  xlen;
-  vol->vol[0].yaxis[0] =  ylen;
-  vol->vol[0].zaxis[2] = -zlen;
-
-  vol->vol[0].origin[0] = vol->yoffset - (0.5 * ylen);
-  vol->vol[0].origin[1] = vol->xoffset - (0.5 * xlen);
-  vol->vol[0].origin[2] = vol->zoffset + (0.5 * zlen);
-
-printf("spider final offset: (%f, %f, %f)\n",
-  vol->vol[0].origin[0], vol->vol[0].origin[1], vol->vol[0].origin[2]);
-
-printf("spider final axes:\n");
-printf("  X (%f, %f, %f)\n",
-  vol->vol[0].xaxis[0], 
-  vol->vol[0].xaxis[1], 
-  vol->vol[0].xaxis[2]);
-
-printf("  Y (%f, %f, %f)\n",
-  vol->vol[0].yaxis[0], 
-  vol->vol[0].yaxis[1], 
-  vol->vol[0].yaxis[2]);
-
-printf("  Z (%f, %f, %f)\n",
-  vol->vol[0].zaxis[0], 
-  vol->vol[0].zaxis[1], 
-  vol->vol[0].zaxis[2]);
-
-  return vol;
-}
-
-static int read_spider_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  spider_t *vol = (spider_t *)v;
-  *nsets = vol->nsets;
-  *metadata = vol->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_spider_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  spider_t *vol = (spider_t *)v;
-  FILE *fd = vol->fd;
-  int xsize, ysize, zsize, xysize, total;
-
-  xsize = vol->vol[0].xsize;
-  ysize = vol->vol[0].ysize;
-  zsize = vol->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  // Read the values from the file
-  fread(datablock, total * sizeof(float), 1, fd);
-
-  // perform byte swapping if necessary
-  if (vol->byteswap) 
-    swap4_aligned(datablock, total);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_spider_read(void *v) {
-  spider_t *vol = (spider_t *)v;
-  
-  fclose(vol->fd);
-  if (vol->vol != NULL)
-    delete [] vol->vol; 
-  delete vol;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "spider";
-  plugin.prettyname = "SPIDER Density Map";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "spi,spider";
-  plugin.open_file_read = open_spider_read;
-  plugin.read_volumetric_metadata = read_spider_metadata;
-  plugin.read_volumetric_data = read_spider_data;
-  plugin.close_file_read = close_spider_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/stlplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/stlplugin.C
deleted file mode 100644
index 36b91b2138945f9bd198bf4977561b802c437829..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/stlplugin.C
+++ /dev/null
@@ -1,260 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: stlplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  STL files are used by most Automatic Fabricators (3D printers). Only 
- *  triangles are used to represent the geometry. 
- *
- *  ASCII STL files follow the following format. Files are case insensitive
- *  and whitespace is ignored.
- *
- *  solid name                ("name" is an arbitrary label for the solid)
- *  facet normal ni nj nk     (<n> is a unit normal of the triangle)
- *  outer loop
- *  vertex v1x v1y v1z        (<v1> is the first vertex)
- *  vertex v2x v2y v2z        (vertices are given in anti-clockwise order)
- *  vertex v3x v3y v3z        (vertices are given as floating-point values)
- *  endloop                   (there is no space in the label "endloop")
- *  endfacet                  (likewise)
- *  ...                       (additional facets are given as above)
- *  endsolid name             (this ends the stl file, same name as above)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct graphics_list {
-  molfile_graphics_t gItem;
-  struct graphics_list *next;
-} molfile_graphics_list;
-
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} stl_t;
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  stl_t *stl;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "stlplugin) Error opening file.\n");
-    return NULL;
-  }
-  stl = new stl_t;
-  stl->fd = fd;
-  stl->graphics = NULL;
-  *natoms = 0;
-  return stl;
-}
-
-static int read_rawgraphics(void *v, int *nelem, 
-    const molfile_graphics_t **data) {
-    molfile_graphics_list *gListPtr=NULL, *tmpPtr=NULL;
-    int i=0, ntriangles=0;
-    int error=0;
-    stl_t *stl = (stl_t *)v;
-    FILE *infile = stl->fd;
-    char line[81], keyWord[81];
-
-    // Check your head(er)
-    // "solid name"
-    fgets(line, 80, infile);
-    sscanf(line, " %s", keyWord);
-    if (strcasecmp(keyWord, "solid") != 0) {
-      fprintf(stderr, "stlplugin) error: expected \"solid\".\n");
-      error = 1;
-    }
-
-    // "facet normal ni nj nk"
-    fgets(line, 80, infile);
-    sscanf(line, " %s", keyWord);
-    if (strcasecmp(keyWord, "facet") != 0) {
-      fprintf(stderr, "stlplugin) error: expected \"facet\".\n");
-      error = 1;
-    } else {
-      gListPtr = new molfile_graphics_list;
-      gListPtr->next = NULL;
-      gListPtr->gItem.type = MOLFILE_TRIANGLE;
-      ntriangles++;
-      tmpPtr = gListPtr;
-    }
-
-    while ( !feof(infile) && (error == 0) ) {
-      // "outer loop"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "outer") != 0) {
-        fprintf(stderr, "stlplugin) error: expected \"outer\".\n");
-        error = 1;
-        break;
-      } else {
-        i = 0;
-      }
-        
-      // "vertex vx, vy, vz"
-      while (i < 9) {
-        fgets(line, 80, infile);
-        sscanf(line, " %s", keyWord);
-        if (strcasecmp(keyWord, "vertex") != 0) {
-          fprintf(stderr, "stlplugin) error: expected \"vertex\".\n");
-          error = 1;
-          break; 
-        } else {
-          float t1=0.0f, t2=0.0f, t3=0.0f;
-          if ( sscanf(line, " %*s %f %f %f", &t1, &t2, &t3) == 3 ) {
-            tmpPtr->gItem.data[i++] = t1;
-            tmpPtr->gItem.data[i++] = t2;
-            tmpPtr->gItem.data[i++] = t3;
-          } else {
-            fprintf(stderr, "stlplugin) error: not enough vertices.\n");
-            error = 1;
-            break;
-          }
-        }
-      }
-      if (error != 0) break;
-
-      // "endloop"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "endloop") != 0) {
-        fprintf(stderr, "stlplugin) error: expected \"endloop\".\n");
-        error = 1;
-        break;
-      }
-      
-      // "endfacet"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "endfacet") != 0) {
-        fprintf(stderr, "stlplugin) error: expected \"endfacet\".\n");
-        error = 1;
-        break;
-      }
-
-      // "endsolid" or "facet normal ni nj nk"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "endsolid") == 0) {
-        break;
-      }
-
-      if (strcasecmp(keyWord, "facet") == 0) {
-        // Create a new list item and initialize it.
-        tmpPtr->next = new molfile_graphics_list;
-        tmpPtr = tmpPtr->next;
-        tmpPtr->next = NULL;
-        tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-        ntriangles++;
-      } else {
-        fprintf(stderr, 
-                "stlplugin) error: expected \"facet\" or \"endsolid\".\n");
-        error = 1;
-        break;
-      }
-
-      // file error
-      if(ferror(infile)) {
-        fprintf(stderr, "stlplugin) error: problem reading file\n");
-        error = 1;
-        break;
-      }
-    }
-
-
-    // If an error occurred, free the linked list and return MOLFILE_ERROR
-    if (error != 0) {
-      while (gListPtr != NULL) {
-        tmpPtr = gListPtr->next;
-        delete gListPtr;
-        gListPtr = tmpPtr;
-      }
-      return MOLFILE_ERROR;
-    }
-
-    // Create the array of molfile_graphics_t, and copy the data from the
-    // linked list into it, deleting the list as you go.
-    stl->graphics = new molfile_graphics_t[ntriangles];
-    i = 0;
-    while (gListPtr != NULL) {
-      stl->graphics[i] = gListPtr->gItem;
-      tmpPtr = gListPtr->next;
-      delete gListPtr;
-      gListPtr = tmpPtr;
-      i++;
-    }
-
-    *nelem = ntriangles;
-    *data = stl->graphics;
-
-    return MOLFILE_SUCCESS;
-}
-
-static void close_file_read(void *v) {
-  stl_t *stl = (stl_t *)v;
-  fclose(stl->fd);
-  if (stl->graphics != NULL)
-    delete [] stl->graphics;
-  delete stl;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "stl";
-  plugin.prettyname = "STL Stereolithography Triangle Mesh";
-  plugin.author = "Eamon Caddigan";
-  plugin.minorv = 0;
-  plugin.majorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "stl";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/tinkerplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/tinkerplugin.c
deleted file mode 100644
index 1ebd4eeccf5d4a170f41e8da2bd3f6bfdf5df55b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/tinkerplugin.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: tinkerplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
- /*
-  * The .arc file is the one coming straight out of tinker.
-  * Many frames, looks like a regular tinker, except that in the last columns
-  * after x, y and z it has :
-  * 
-  * atom type (not important for viz)
-  * 
-  * and then info in a Z-matrix form
-  * 
-  * atom to which you are bonded, atom to which you are 'angled' and atom to
-  * which you are 'torsioned'.
-  * 
-  */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  char *file_name;
-  molfile_atom_t *atomlist;
-} tinkerdata;
- 
-static void *open_tinker_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  tinkerdata *data;
-  int i;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  data = (tinkerdata *)malloc(sizeof(tinkerdata));
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* First line is the number of atoms, followed by other stuff */
-  i = fscanf(data->file, "%d", natoms);
-  if (i < 1) {
-    fprintf(stderr, "\n\nread) ERROR: tinker file '%s' should have the number of atoms in the first line.\n", filename);
-    return NULL;
-  }
-  data->numatoms=*natoms;
-
-  while (getc(fd) != '\n'); /* skip rest of this line */
- 
-  return data;
-}
-
-static int read_tinker_structure(void *mydata, int *optflags, 
-                                 molfile_atom_t *atoms) {
-  int i, j, atomid;
-  char *k;
-  float coord;
-  molfile_atom_t *atom;
-  tinkerdata *data = (tinkerdata *)mydata;
-
-  *optflags = MOLFILE_NOOPTIONS;
-
-  for (i=0; i<data->numatoms; i++) {
-    char buffer[1024], fbuffer[1024];
-    int atomtypeindex=0;
-    k = fgets(fbuffer, 1024, data->file);
-    atom = atoms + i;
-    j=sscanf(fbuffer, "%d %s %f %f %f %d", &atomid, buffer, &coord, &coord, &coord, &atomtypeindex);
-    if (k == NULL) {
-      fprintf(stderr, "tinker structure) missing atom(s) in file '%s'\n", data->file_name);
-      fprintf(stderr, "tinker structure) expecting '%d' atoms, found only '%d'\n", data->numatoms, i+1);
-      return MOLFILE_ERROR;
-    } else if (j < 5) {
-      fprintf(stderr, "tinker structure) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->file_name, i+1);
-      return MOLFILE_ERROR;
-    }
-
-    strncpy(atom->name, buffer, sizeof(atom->name));
-#if 0
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-#else
-    sprintf(atom->type, "%d", atomtypeindex);
-#endif
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_tinker_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j, atomid;
-  char atom_name[1024], fbuffer[1024], *k;
-  float x, y, z;
-  
-  tinkerdata *data = (tinkerdata *)mydata;
-  
-  /* skip over the first line */
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-
-  /* read the coordinates */
-  for (i=0; i<natoms; i++) {
-    k = fgets(fbuffer, 1024, data->file);
-
-    /* Read in atom type, X, Y, Z, skipping any remaining data fields */
-    j = sscanf(fbuffer, "%d %s %f %f %f", &atomid, atom_name, &x, &y, &z);
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 5) {
-      fprintf(stderr, "tinker timestep) missing type or coordinate(s) in file '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (j >= 5) {
-      if (ts != NULL) { 
-        /* only save coords if we're given a timestep pointer, */
-        /* otherwise assume that VMD wants us to skip past it. */
-        ts->coords[3*i  ] = x;
-        ts->coords[3*i+1] = y;
-        ts->coords[3*i+2] = z;
-      }
-    } else {
-      break;
-    }
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_tinker_read(void *mydata) {
-  tinkerdata *data = (tinkerdata *)mydata;
-  fclose(data->file);
-  free(data->file_name);
-  free(data);
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "tinker";
-  plugin.prettyname = "Tinker";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "arc";
-  plugin.open_file_read = open_tinker_read;
-  plugin.read_structure = read_tinker_structure;
-  plugin.read_next_timestep = read_tinker_timestep;
-  plugin.close_file_read = close_tinker_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_tinker_read(*argv, "tinker", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_tinker_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_tinker_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_tinker_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_tinker_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/tngplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/tngplugin.C
deleted file mode 100644
index 996533aa0162cb8eb269a3d73e98ac328cf70de1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/tngplugin.C
+++ /dev/null
@@ -1,629 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: tngplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2015/10/12 03:00:46 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   VMD plugin to allow reading and writing of Gromacs TNG trajectories.
- *   This software and the TNG library are made available under the
- *   BSD license.  For details, see the license information associated
- *   with the Gromacs TNG library that this code depends on at:
- *     http://www.gromacs.org/
- *
- *   The TNG trajectory format is described in this publication:
- *     "An efficient and extensible format, library, and API for
- *     binary trajectory data from molecular simulations"
- *     Journal of Computational Chemistry 2013, DOI: 10.1002/jcc.23495
- *     http://onlinelibrary.wiley.com/doi/10.1002/jcc.23495/abstract
- *
- *   The TNG git repo is the master location for the sources, though
- *   the standard git SSL checks have to be disabled to access it:
- *      env GIT_SSL_NO_VERIFY=1 git clone https://gerrit.gromacs.org/tng
- *
- *   This version of the TNG plugin requires version 1.7.4 or greater
- *   of the TNG library.
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <tng/tng_io.h>
-#include "molfile_plugin.h"
-
-#define TNG_PLUGIN_MAJOR_VERSION 1
-#define TNG_PLUGIN_MINOR_VERSION 0
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-typedef struct {
-  tng_trajectory_t tng_traj;
-  int natoms;
-  int step;
-//   int stride_length;
-  int64_t n_frames;
-  int coord_exponential;
-//   int64_t n_frames_per_frame_set;
-  double time_per_frame;
-  int has_velocities;
-} tngdata;
-
-static void convert_tng_box_shape_to_vmd(float *box_shape, float *vmd_box)
-{
-    float A, B, C;
-
-    A = sqrt(box_shape[0]*box_shape[0] +
-             box_shape[1]*box_shape[1] +
-             box_shape[2]*box_shape[2]);
-    B = sqrt(box_shape[3]*box_shape[3] +
-             box_shape[4]*box_shape[4] +
-             box_shape[5]*box_shape[5]);
-    C = sqrt(box_shape[6]*box_shape[6] +
-             box_shape[7]*box_shape[7] +
-             box_shape[8]*box_shape[8]);
-
-    if ((A<=0) || (B<=0) || (C<=0))
-    {
-        vmd_box[0] = vmd_box[1] = vmd_box[2] = 0;
-        vmd_box[3] = vmd_box[4] = vmd_box[5] = 90;
-    }
-    else
-    {
-        vmd_box[0] = A;
-        vmd_box[1] = B;
-        vmd_box[2] = C;
-        vmd_box[3] = acos( (box_shape[3]*box_shape[6]+
-                            box_shape[4]*box_shape[7]+
-                            box_shape[5]*box_shape[8])/(B*C) ) * 90.0/M_PI_2;
-        vmd_box[4] = acos( (box_shape[0]*box_shape[6]+
-                            box_shape[1]*box_shape[7]+
-                            box_shape[2]*box_shape[8])/(A*C) ) * 90.0/M_PI_2;
-        vmd_box[5] = acos( (box_shape[0]*box_shape[3]+
-                            box_shape[1]*box_shape[4]+
-                            box_shape[2]*box_shape[5])/(A*B) ) * 90.0/M_PI_2;
-    }
-}
-
-static void convert_vmd_box_shape_to_tng(const molfile_timestep_t *ts, float *box_shape)
-{
-//     const float sa = sin((double)ts->alpha/180.0*M_PI);
-    const float ca = cos((double)ts->alpha/180.0*M_PI);
-    const float cb = cos((double)ts->beta/180.0*M_PI);
-    const float cg = cos((double)ts->gamma/180.0*M_PI);
-    const float sg = sin((double)ts->gamma/180.0*M_PI);
-
-    box_shape[0] = ts->A;
-    box_shape[1] = 0.0;
-    box_shape[2] = 0.0;
-    box_shape[3] = ts->B*cg; // ts->B*ca when writing trr?!
-    box_shape[4] = ts->B*sg; // ts->B*sa when writing trr?!
-    box_shape[5] = 0.0;
-    box_shape[6] = ts->C*cb;
-    box_shape[7] = ts->C*(ca - cb*cg)/sg;
-    box_shape[8] = ts->C*sqrt((double)(1.0 + 2.0*ca*cb*cg
-                                       - ca*ca - cb*cb - cg*cg)/(1.0 - cg*cg));
-}
-
-static void *open_tng_read(const char *filename, const char*,
-                           int *natoms)
-{
-    tngdata *tng;
-    tng_function_status stat;
-    int64_t n, exp;
-
-    tng = new tngdata;
-
-    stat = tng_util_trajectory_open(filename, 'r', &tng->tng_traj);
-    if(stat != TNG_SUCCESS)
-    {
-        fprintf(stderr, "tngplugin) Cannot open file '%s'\n", filename);
-        return NULL;
-    }
-
-    tng_num_particles_get(tng->tng_traj, &n);
-    *natoms = (int)n;
-    tng->natoms = (int)n;
-    tng->step = 0;
-    tng_num_frames_get(tng->tng_traj, &n);
-    tng->n_frames = n;
-    tng->has_velocities = 0;
-
-    tng_distance_unit_exponential_get(tng->tng_traj, &exp);
-    tng->coord_exponential = (int) exp;
-
-
-    return tng;
-}
-
-static int read_tng_structure(void *v, int *optflags,
-                               molfile_atom_t *atoms)
-{
-    tngdata *tng = (tngdata *)v;
-    char long_name[16], short_name[2];
-    int64_t id;
-
-    *optflags = MOLFILE_NOOPTIONS;
-    for(int i = 0; i < tng->natoms; i++)
-    {
-        molfile_atom_t *atom = atoms+i;
-        tng_atom_name_of_particle_nr_get(tng->tng_traj, i, long_name, 16);
-        strcpy(atom->name, long_name);
-        tng_atom_type_of_particle_nr_get(tng->tng_traj, i, long_name, 16);
-        strcpy(atom->type, long_name);
-        tng_residue_name_of_particle_nr_get(tng->tng_traj, i, long_name, 16);
-        strcpy(atom->resname, long_name);
-        tng_global_residue_id_of_particle_nr_get(tng->tng_traj, i, &id);
-        atom->resid = (int)id;
-//         fprintf(stderr, "resid: %d\n", (int)id);
-        tng_chain_name_of_particle_nr_get(tng->tng_traj, i, short_name, 2);
-        strcpy(atom->chain, short_name);
-        atom->segid[0] = '\0';
-    }
-//     fprintf(stderr, "Structure opened\n");
-    return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int read_tng_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                          float **bondorderptr, int **bondtypeptr,
-                          int *nbondtypes, char ***bondtypename)
-#else
-static int read_tng_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                          float **bondorderptr)
-#endif
-{
-    int64_t *from_atoms = 0, *to_atoms = 0, bond_cnt, i;
-    tng_function_status stat;
-
-    tngdata *tng = (tngdata *)v;
-
-    stat = tng_molsystem_bonds_get(tng->tng_traj, &bond_cnt, &from_atoms,
-                                   &to_atoms);
-    if(stat != TNG_SUCCESS)
-    {
-        return MOLFILE_ERROR;
-    }
-
-    if(bond_cnt <= 0)
-    {
-        fprintf(stderr, "tngplugin) No bonds found in molsystem\n");
-        *nbonds = 0;
-        *fromptr = 0;
-        *toptr = 0;
-        return MOLFILE_SUCCESS;
-    }
-
-    /* Convert from int64_t to int. The fact that VMD and TNG use different
-     * int types can lead to problems if there are very many atoms and/or
-     * bonds */
-    *nbonds = (int) bond_cnt;
-    *fromptr = (int *)malloc((*nbonds) * sizeof(int));
-    *toptr = (int *)malloc((*nbonds) * sizeof(int));
-    *bondorderptr = 0;
-
-#if vmdplugin_ABIVERSION > 14
-    *bondtypeptr = 0;
-    *nbondtypes = 0;
-    *bondtypename = 0;
-#endif
-
-    for(i = 0; i < *nbonds; i++)
-    {
-        (*fromptr)[i] = (int)from_atoms[i] + 1;
-        (*toptr)[i] = (int)to_atoms[i] + 1;
-//         fprintf(stderr, "Adding bond from %d to %d\n", (*fromptr)[i], (*toptr)[i]);
-    }
-
-    return MOLFILE_SUCCESS;
-}
-
-static void convert_to_float(void *from, float *to, const float fact, const int natoms, const int nvalues, const char datatype)
-{
-    int i, j;
-
-    switch(datatype)
-    {
-    case TNG_FLOAT_DATA:
-        if(fact == 1)
-        {
-            memcpy(to, from, nvalues * sizeof(float) * natoms);
-        }
-        else
-        {
-            for(i = 0; i < natoms; i++)
-            {
-                for(j = 0; j < nvalues; j++)
-                {
-                    to[i*3+j] = (float)((float *)from)[i*3+j] * fact;
-                }
-            }
-        }
-        break;
-    case TNG_INT_DATA:
-        for(i = 0; i < natoms; i++)
-        {
-            for(j = 0; j < nvalues; j++)
-            {
-                to[i*3+j] = (float)((int64_t *)from)[i*3+j] * fact;
-            }
-        }
-        break;
-    case TNG_DOUBLE_DATA:
-        for(i = 0; i < natoms; i++)
-        {
-            for(j = 0; j < nvalues; j++)
-            {
-                to[i*3+j] = (float)((double *)from)[i*3+j] * fact;
-            }
-        }
-        break;
-    default:
-        fprintf(stderr, "tngplugin) Cannot cast data\n");
-    }
-    return;
-}
-
-static int read_tng_timestep(void *v, int natoms, molfile_timestep_t *ts)
-{
-    /* The pointers that will be allocated by the TNG must be NULL before allocation. */
-    void *values = 0;
-    char datatype;
-    float box_shape[9], vmd_box[6];
-    float fact = 1;
-    int64_t frame, n, temp, temp2;
-    tng_function_status stat;
-    tngdata *tng = (tngdata *)v;
-
-    if(!ts)
-    {
-        return MOLFILE_ERROR;
-    }
-
-//     fprintf(stderr, "Reading framestep from TNG\n");
-
-    stat = tng_util_particle_data_next_frame_read(tng->tng_traj, TNG_TRAJ_POSITIONS, &values,
-                                                  &datatype, &frame, &ts->physical_time);
-    if(stat != TNG_SUCCESS)
-    {
-        return MOLFILE_ERROR;
-    }
-//     fprintf(stderr, "tngplugin) Timestep %d (%f), frame %d (%d), %d atoms\n",
-//             tng->step, ts->physical_time, (int)frame, (int)tng->n_frames, natoms);
-
-    /* TODO: Here it would be possible to add reading of the energy and pressure
-     * measurements supported in VMD if they are present in the TNG file */
-    tng_num_particles_get(tng->tng_traj, &n);
-    if(n != natoms)
-    {
-        fprintf(stderr, "tngplugin) Timestep in file contains wrong number of atoms\n");
-        fprintf(stderr, "tngplugin) Found %d, expected %d\n", (int)n, natoms);
-        return MOLFILE_ERROR;
-    }
-
-    if(tng->coord_exponential != -10)
-    {
-        fact = pow(10.0, tng->coord_exponential + 10);
-    }
-
-    convert_to_float(values, ts->coords, fact, natoms, 3, datatype);
-
-    if(ts->velocities)
-    {
-//         fprintf(stderr, "tngplugin) Reading velocities\n");
-        stat = tng_particle_data_vector_interval_get(tng->tng_traj, TNG_TRAJ_VELOCITIES, frame,
-                                                     frame, TNG_USE_HASH, &values,
-                                                     &n, &temp, &temp2, &datatype);
-        if(stat == TNG_CRITICAL)
-        {
-            return MOLFILE_ERROR;
-        }
-        if(stat == TNG_SUCCESS)
-        {
-            convert_to_float(values, ts->velocities, fact, natoms, 3, datatype);
-        }
-    }
-
-    stat = tng_data_vector_interval_get(tng->tng_traj, TNG_TRAJ_BOX_SHAPE,
-                                        frame, frame, TNG_USE_HASH, &values,
-                                        &temp, &temp2, &datatype);
-    if(stat == TNG_CRITICAL)
-    {
-        return MOLFILE_ERROR;
-    }
-    if(stat == TNG_SUCCESS)
-    {
-        convert_to_float(values, box_shape, fact, 1, 9, datatype);
-
-        convert_tng_box_shape_to_vmd(box_shape, vmd_box);
-        if(ts)
-        {
-            ts->A = vmd_box[0];
-            ts->B = vmd_box[1];
-            ts->C = vmd_box[2];
-            ts->alpha = vmd_box[3];
-            ts->beta = vmd_box[4];
-            ts->gamma = vmd_box[5];
-        }
-    }
-
-    ++tng->step;
-    if(values)
-    {
-        free(values);
-    }
-
-    return MOLFILE_SUCCESS;
-}
-
-static int read_timestep_metadata(void *v, molfile_timestep_metadata_t *metadata)
-{
-    tng_function_status stat;
-    tngdata *tng = (tngdata *)v;
-
-    /* Check only once if there are velocities in the file at all. */
-    if(tng->has_velocities == 0)
-    {
-        stat = tng_frame_set_read_current_only_data_from_block_id(tng->tng_traj, TNG_SKIP_HASH, TNG_TRAJ_VELOCITIES);
-
-        if(stat == TNG_CRITICAL)
-        {
-            metadata->has_velocities = 0;
-            return MOLFILE_ERROR;
-        }
-        else if(stat == TNG_SUCCESS)
-        {
-            fprintf(stderr, "tngplugin) Trajectory contains velocities\n");
-            tng->has_velocities = 1;
-        }
-        else
-        {
-            fprintf(stderr, "tngplugin) Trajectory does not contain velocities\n");
-            tng->has_velocities = -1;
-        }
-    }
-    if(tng->has_velocities == 1)
-    {
-        metadata->has_velocities = 1;
-    }
-    else
-    {
-        metadata->has_velocities = 0;
-    }
-
-    return MOLFILE_SUCCESS;
-}
-
-static void close_tng(void *v)
-{
-    tngdata *tng = (tngdata *)v;
-    tng_util_trajectory_close(&tng->tng_traj);
-    delete tng;
-}
-
-static void *open_tng_write(const char *filename, const char*,
-                            int natoms)
-{
-    tngdata *tng;
-    tng_function_status stat;
-//     int64_t n, exp;
-
-    tng = new tngdata;
-
-    stat = tng_util_trajectory_open(filename, 'w', &tng->tng_traj);
-    if(stat != TNG_SUCCESS)
-    {
-        fprintf(stderr, "tngplugin) Cannot open file '%s'\n", filename);
-        return NULL;
-    }
-
-    tng->natoms = natoms;
-    tng->step = 0;
-    tng->coord_exponential = -10;
-    tng_distance_unit_exponential_set(tng->tng_traj, -10);
-
-    tng->time_per_frame = -1;
-
-    return tng;
-}
-
-static int write_tng_structure(void *v, int optflags, const molfile_atom_t *atoms)
-{
-    /* VMD atoms do not contain molecule information, which
-     * complicates TNG writing a bit. */
-    tng_molecule_t tng_mol = 0;
-    tng_chain_t tng_chain = 0;
-    tng_residue_t tng_residue = 0;
-    tng_atom_t tng_atom;
-    int prev_resid = -1;
-    char new_chain_name[4] = "X_A";
-
-    tngdata *tng = (tngdata *)v;
-
-    /* A dummy molecule must be added. All atoms will be added to it. */
-    if(tng_molecule_find(tng->tng_traj, "MOL", -1, &tng_mol) != TNG_SUCCESS)
-    {
-        tng_molecule_add(tng->tng_traj, "MOL", &tng_mol);
-    }
-
-    for(int i = 0; i < tng->natoms; i++)
-    {
-        if(tng_chain == 0)
-        {
-            if(tng_molecule_chain_find(tng->tng_traj, tng_mol, atoms[i].chain, -1, &tng_chain) !=
-                TNG_SUCCESS)
-            {
-                tng_molecule_chain_add(tng->tng_traj, tng_mol, atoms[i].chain, &tng_chain);
-            }
-        }
-        else if(tng_residue != 0)
-        {
-            if(prev_resid >= 0)
-            {
-                if(prev_resid > atoms[i].resid)
-                {
-                    new_chain_name[0] = atoms[i].chain[0];
-                    ++new_chain_name[2];
-                    tng_molecule_chain_add(tng->tng_traj, tng_mol, new_chain_name, &tng_chain);
-                }
-            }
-        }
-//         fprintf(stderr, "tngplugin) Looking for residue: %s, %d\n", atoms[i].resname, atoms[i].resid);
-        if (tng_chain_residue_find(tng->tng_traj, tng_chain, atoms[i].resname,
-                                   atoms[i].resid, &tng_residue) != TNG_SUCCESS)
-        {
-            tng_chain_residue_w_id_add(tng->tng_traj, tng_chain, atoms[i].resname,
-                                       atoms[i].resid, &tng_residue);
-            prev_resid = atoms[i].resid;
-        }
-        tng_residue_atom_add(tng->tng_traj, tng_residue, atoms[i].name, atoms[i].type, &tng_atom);
-    }
-    tng_molecule_cnt_set(tng->tng_traj, tng_mol, 1);
-
-    return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int write_tng_bonds(void *v, int nbonds, int *from, int *to,
-                          float *bondorder, int *bondtype,
-                          int nbondtypes, char **bondtypename)
-#else
-static int write_tng_bonds(void *v, int nbonds, int *from, int *to,
-                          float *bondorder)
-#endif
-{
-    tng_molecule_t tng_mol;
-    tng_bond_t tng_bond;
-    int i;
-
-    if(nbonds == 0)
-    {
-        return MOLFILE_SUCCESS;
-    }
-
-    tngdata *tng = (tngdata *)v;
-
-    /* A dummy molecule must be added. All atoms will be added to it. */
-    if(tng_molecule_find(tng->tng_traj, "MOL", -1, &tng_mol) != TNG_SUCCESS)
-    {
-        tng_molecule_add(tng->tng_traj, "MOL", &tng_mol);
-    }
-
-    for (i = 0; i < nbonds; i++)
-    {
-        if(tng_molecule_bond_add(tng->tng_traj, tng_mol, from[i]-1, to[i]-1, &tng_bond) != TNG_SUCCESS)
-        {
-            fprintf(stderr, "tngplugin) Error adding bond %d (from %d to %d).\n", i, from[i], to[i]);
-            return MOLFILE_ERROR;
-        }
-    }
-    return MOLFILE_SUCCESS;
-}
-
-static int write_tng_timestep(void *v, const molfile_timestep_t *ts)
-{
-    float box_shape[9];
-    tngdata *tng = (tngdata *)v;
-
-    /* If there are fewer particles in the TNG mol system (write_tng_structure
-     * has not already been performed) compensate by creating implicit particles,
-     * which will not have full atom information. */
-    tng_implicit_num_particles_set(tng->tng_traj, tng->natoms);
-
-    if(!ts)
-    {
-        return MOLFILE_ERROR;
-    }
-
-    convert_vmd_box_shape_to_tng(ts, box_shape);
-    if(tng->step == 1 && ts->physical_time != 0)
-    {
-        tng->time_per_frame = ts->physical_time;
-        tng_time_per_frame_set(tng->tng_traj, tng->time_per_frame);
-    }
-    if(tng->time_per_frame < 0)
-    {
-//         fprintf(stderr, "tngplugin) Writing frame without time stamp\n");
-        tng_util_box_shape_write(tng->tng_traj, tng->step, box_shape);
-        tng_util_pos_write(tng->tng_traj, tng->step, ts->coords);
-    }
-    else
-    {
-//         fprintf(stderr, "tngplugin) Writing frame with time stamp\n");
-        tng_util_box_shape_with_time_write(tng->tng_traj, tng->step, ts->physical_time,
-                                           box_shape);
-        tng_util_pos_with_time_write(tng->tng_traj, tng->step, ts->physical_time,
-                                     ts->coords);
-    }
-    if(tng->step == 0)
-    {
-        tng_util_pos_write_interval_set(tng->tng_traj, 1);
-        tng_util_box_shape_write_interval_set(tng->tng_traj, 1);
-    }
-    if(ts->velocities)
-    {
-//         fprintf(stderr, "tngplugin) Writing TNG velocities\n");
-        if(tng->time_per_frame < 0)
-        {
-            tng_util_vel_write(tng->tng_traj, tng->step, ts->velocities);
-        }
-        else
-        {
-            tng_util_vel_with_time_write(tng->tng_traj, tng->step, ts->physical_time,
-                                         ts->velocities);
-        }
-        if(tng->step == 0)
-        {
-            tng_util_vel_write_interval_set(tng->tng_traj, 1);
-        }
-    }
-
-    tng->step++;
-
-    return MOLFILE_SUCCESS;
-}
-
-static molfile_plugin_t tng_plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  // TNG plugin init
-  memset(&tng_plugin, 0, sizeof(molfile_plugin_t));
-  tng_plugin.abiversion = vmdplugin_ABIVERSION;
-  tng_plugin.type = MOLFILE_PLUGIN_TYPE;
-  tng_plugin.name = "tng";
-  tng_plugin.prettyname = "TNG: Trajectory Next Generation (testing)";
-  tng_plugin.author = "Magnus Lundborg";
-  tng_plugin.majorv = TNG_PLUGIN_MAJOR_VERSION;
-  tng_plugin.minorv = TNG_PLUGIN_MINOR_VERSION;
-  tng_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  tng_plugin.filename_extension = "tng";
-  tng_plugin.open_file_read = open_tng_read;
-  tng_plugin.read_structure = read_tng_structure;
-  tng_plugin.read_bonds = read_tng_bonds;
-  tng_plugin.read_next_timestep = read_tng_timestep;
-  tng_plugin.close_file_read = close_tng;
-  tng_plugin.open_file_write = open_tng_write;
-  tng_plugin.write_structure = write_tng_structure;
-  tng_plugin.write_timestep = write_tng_timestep;
-  tng_plugin.close_file_write = close_tng;
-  tng_plugin.write_bonds = write_tng_bonds;
-  tng_plugin.read_timestep_metadata = read_timestep_metadata;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&tng_plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/uhbdplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/uhbdplugin.C
deleted file mode 100644
index c1b97f9f63fd2c3c94fcfd0eb73e190a6799b5a2..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/uhbdplugin.C
+++ /dev/null
@@ -1,346 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: uhbdplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * Plugin by Alexander Spaar for reading UHBD grid files
- * UHBD related docs:
- *   http://adrik.bchs.uh.edu/uhbd.html
- *   http://adrik.bchs.uh.edu/uhbd/
- *   http://mccammon.ucsd.edu/uhbd.html
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-  float scale;  // 0 for ascii files, otherwise signals binary and provides
-                // scale factor for written data.
-  int doswap;   // true if byteswapping needed
-} uhbd_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *uhbdgets(char *s, int n, FILE *stream, const char *msg) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    printf("%s", msg);
-    printf("uhbdplugin) Unexpected end-of-file.\n");
-    return NULL;
-  } else if (ferror(stream)) {
-    printf("%s", msg);
-    printf("uhbdplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      printf("%s", msg);
-      printf("uhbdplugin) Encountered EOF or error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-static void *open_uhbd_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  uhbd_t *uhbd;
-  char inbuf[LINESIZE];
-  int xsize, ysize, zsize;
-  float orig[3], ra, o[3], s[3]; //xdelta[3], ydelta[3], zdelta[3];
-  int headersize = 0; // for binary format
-  int doswap = 0; // true if byteswapping needed
-  float scale=0;    // scale parameter in binary uhbd files
-  
-  if ((fd = fopen(filepath, "rb")) == NULL) {
-    printf("uhbdplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // check if the first part of file is a binary 160, which would indicate
-  // that this is a binary rather than ascii UHBD file.
-  fread(&headersize, sizeof(int), 1, fd);
-  if (headersize == 160) {
-    printf("uhbdplugin) Detected binary .grd file in native endian\n");
-    doswap = 0;
-  } else {
-    swap4_unaligned(&headersize, 1);
-    if (headersize == 160) {
-      printf("uhbdplugin) Detected binary .grd file in opposite endian\n");
-      doswap = 1;
-    } else {
-      headersize = 0;
-    }
-  }
-  if (headersize == 160) {
-    int iparams[8];
-    float fparams[4];
-    // we're doing binary
-    // read in the entire header, plus the trailing header size
-    char buf[164];
-    if (fread(buf, 1, 160, fd) != 160) {
-      fprintf(stderr, "uhbdplugin) Error: incomplete header in .grd file.\n");
-      fclose(fd);
-      return NULL;
-    }
-    // format of header is 72 character title, followed by:
-    // scale dum2 grdflag, idum2 km one km im jm km h ox oy oz
-    // The first two and last four parameters are floats, the rest ints.
-    memcpy(&scale,  buf + 72, sizeof(float));
-    memcpy(iparams, buf + 72 + 8, 32);
-    memcpy(fparams, buf + 72 + 40, 16);
-    if (doswap) {
-      swap4_unaligned(&scale, 1);
-      swap4_unaligned(iparams, 8);
-      swap4_unaligned(fparams, 4);
-    }
-    xsize = iparams[5];
-    ysize = iparams[6];
-    zsize = iparams[7];
-    ra = fparams[0];
-    orig[0] = fparams[1];
-    orig[1] = fparams[2];
-    orig[2] = fparams[3];
-
-  } else {
-    rewind(fd);
-    // Read the header
-    if (uhbdgets(inbuf, LINESIZE, fd, 
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-  
-    /* get grid dimensions, spacing and origin */
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while getting grid dimensions\n") == NULL) {
-      return NULL;
-    }
-    if (sscanf(inbuf, "%d %d %d %e %e %e %e", &xsize, &ysize, &zsize, &ra, orig, orig+1, orig+2)  != 7) {
-      printf("uhbdplugin) Error reading grid dimensions, spacing and origin.\n");
-      return NULL;
-    }
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-  }
-
-  /* allocate and initialize the uhbd structure */
-  uhbd = new uhbd_t;
-  uhbd->fd = fd;
-  uhbd->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  uhbd->nsets = 1; /* this file contains only one data set */
-  uhbd->scale = scale; // set by binary files only
-  uhbd->doswap = doswap;
-
-  uhbd->vol = new molfile_volumetric_t[1];
-  strcpy(uhbd->vol[0].dataname, 
-      headersize ? "UHBD binary Electron Density Map"
-                 : "UHBD ascii Electron Density Map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    uhbd->vol[0].origin[i] = orig[i] + ra;
-    o[i] = uhbd->vol[0].origin[i];
-  }
-
-  uhbd->vol[0].xaxis[0] = ra * (xsize-1);
-  uhbd->vol[0].xaxis[1] = 0;
-  uhbd->vol[0].xaxis[2] = 0;
-
-  uhbd->vol[0].yaxis[0] = 0;
-  uhbd->vol[0].yaxis[1] = ra * (ysize-1);
-  uhbd->vol[0].yaxis[2] = 0;
-
-  uhbd->vol[0].zaxis[0] = 0;
-  uhbd->vol[0].zaxis[1] = 0;
-  uhbd->vol[0].zaxis[2] = ra * (zsize-1);
-
-  s[0] = uhbd->vol[0].xaxis[0];
-  s[1] = uhbd->vol[0].yaxis[1];
-  s[2] = uhbd->vol[0].zaxis[2];
-
-  uhbd->vol[0].xsize = xsize;
-  uhbd->vol[0].ysize = ysize;
-  uhbd->vol[0].zsize = zsize;
-
-  /* UHBD files contain no color information. */
-  uhbd->vol[0].has_color = 0;
-
-  return uhbd;
-}
-
-static int read_uhbd_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  uhbd_t *uhbd = (uhbd_t *)v;
-  *nsets = uhbd->nsets; 
-  *metadata = uhbd->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_uhbd_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  uhbd_t *uhbd = (uhbd_t *)v;
-  FILE *fd = uhbd->fd;
-  char inbuf[LINESIZE];
-  float grid[6];
-  int z, xsize, ysize, zsize, xysize, count, count2, total, i;
-
-  xsize = uhbd->vol[0].xsize;
-  ysize = uhbd->vol[0].ysize;
-  zsize = uhbd->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  if (uhbd->scale) {
-    int headerblock[6];
-    // The binary data is written one z-slice at a time.  First, a 
-    // block of three ints indicating which slice is next, of the form
-    // kk, im, jm, where kk is the on-based slice index, and im and jm
-    // are the x and y dimensions.  We just read past them and also read the
-    // start of the next block, which is the actual data.
-    for (z=0; z<zsize; z++) {
-      if (fread(headerblock, sizeof(int), 6, fd) != 6) {
-        fprintf(stderr, "uhbdplugin) Error reading header block in binary uhbd file\n");
-        return MOLFILE_ERROR;
-      }
-      // TODO: some sanity checks on the header block.
-      if (fread(datablock + z*xysize, sizeof(float), xysize, fd) != xysize) {
-        fprintf(stderr, "uhbdplugin) Error reading data block in binary uhbd file\n");
-        return MOLFILE_ERROR;
-      }
-      // read the trailing block delimiter
-      fseek(fd, 4, SEEK_CUR);
-    }
-    if (uhbd->doswap) {
-      swap4_aligned(datablock, total);
-    }
-    return MOLFILE_SUCCESS;
-  }
-
-  /* Read the values from the file */
-  for (z = 0; z < zsize; z++) {
-    // read header
-    if (uhbdgets(inbuf, LINESIZE, fd, 
-        "uhbdplugin) error while getting density plane indices\n") == NULL)
-      return MOLFILE_ERROR;
-
-    // read data
-    for (count = 0; count < xysize/6; count++) {
-      if (uhbdgets(inbuf, LINESIZE, fd,
-          "uhbdplugin) error while getting density values\n") == NULL)
-        return MOLFILE_ERROR;
-
-      if (sscanf(inbuf, "%e %e %e %e %e %e", &grid[0], &grid[1], &grid[2], &grid[3], &grid[4], &grid[5]) != 6) {
-        printf("uhbdplugin) Error reading grid data.\n");
-        return MOLFILE_ERROR;
-      }
-    
-      for (i = 0; i < 6; i++) { 
-        datablock[i + count*6 + z*xysize] = grid[i];
-      }
-    }
-
-    if ((xysize%6) != 0) {
-      if (uhbdgets(inbuf, LINESIZE, fd, 
-          "uhbdplugin) error reading data elements modulo 6\n") == NULL)
-        return MOLFILE_ERROR;
-
-      count2 = sscanf(inbuf, "%e %e %e %e %e %e", &grid[0], &grid[1], &grid[2], &grid[3], &grid[4], &grid[5]);
-      if (count2 != (xysize%6)) {
-        printf("uhbdplugin) Error: incorrect number of data points.\n");
-        return MOLFILE_ERROR;
-      }
-
-      for (i = 0; i < count2; i++) {
-        datablock[i + (count+1)*6 + z*xysize] = grid[i];
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_uhbd_read(void *v) {
-  uhbd_t *uhbd = (uhbd_t *)v;
-  
-  fclose(uhbd->fd);
-  if (uhbd->vol != NULL)
-    delete [] uhbd->vol; 
-  delete uhbd;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "uhbd";
-  plugin.prettyname = "UHBD Grid";
-  plugin.author = "Alexander Spaar, Justin Gullingsrud";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "uhbdgrd,grd";
-  plugin.open_file_read = open_uhbd_read;
-  plugin.read_volumetric_metadata = read_uhbd_metadata;
-  plugin.read_volumetric_data = read_uhbd_data;
-  plugin.close_file_read = close_uhbd_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/unit_conversion.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/unit_conversion.h
deleted file mode 100644
index 953fe7ce7b0d82d85194a5b2f9fd531ddb91d1ab..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/unit_conversion.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: unit_conversion.h,v $
- *      $Author: akohlmey $       $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $       $Date: 2009/06/26 01:13:39 $
- *
- ***************************************************************************/
-/******************************************************************
- * 
- * unit conversion factors.
- *  
- ******************************************************************/
-
-
-#ifndef UNIT_CONVERSION_H
-#define UNIT_CONVERSION_H
-
-/* 
- * units according to CODATA 2006 
- * Version 5.1, http://physics.nist.gov/constants
- */
-/* convert Bohr to Angstrom */
-#define BOHR_TO_ANGS 0.529177210859
-#define ANGS_TO_BOHR 1.88972612478289694072
-
-
-/* convert Hartree into kcal/mol */
-#define HARTREE_TO_KCAL 627.5094706142
-
-/* convert Hartree into eV */
-#define HARTREE_TO_EV    27.211383860484776
-
-#endif /* UNIT_CONVERSION */
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vasp5xdatcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vasp5xdatcarplugin.c
deleted file mode 100644
index 60865b98771b8257dd03db7ac0a4899a2c110f84..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vasp5xdatcarplugin.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vasp5xdatcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -fPIC -I. -I$VMDBASEDIR/plugins/include -c vasp5xdatcarplugin.c
- *  ld -shared -o vasp5xdatcarplugin.so vasp5xdatcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vasp5xdatcarplugin.c
- *  c++ -bundle -o vasp5xdatcarplugin.so vasp5xdatcarplugin.o
- *
- *  Install
- *  copy vasp5xdatcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vasp5xdatcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP5 is assumed in default */
-  data->version = 5;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Ignore rest of header up to the line with atom numbers */
-  for (i = 0; i < 5; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  /* Read title line */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Read the number of atoms per atom type */
-  data->numatoms = 0;
-  fgets(lineptr, LINESIZE, data->file);
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-    
-    if (n <= 0) break;
-    
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP5 XDATCAR read) ERROR: file '%s' does not have list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vasp5xdatcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar = NULL;
-  int atomcount, i;
-  char lineptr[LINESIZE], potcarfile[1000], *cp;
-  float lc;
- 
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  strcpy(potcarfile, data->filename);
-  cp = strstr(potcarfile, "XDATCAR");
-
-  if (cp) {
-    strcpy(cp, "POTCAR");
-    potcar = fopen(potcarfile, "r");
-  }
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise try the title line instead.
-   */
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    int idx, j;
-    char const *label;
-    float mass, radius;
-
-    if (potcar) {
-       char atomtype[5] = "X";
-       /* Obtain atom types from POTCAR file */
-       if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4[^_. 0-9]", atomtype);
-       idx = get_pte_idx(atomtype);
-       /* Skip lines in potcar file until next element */
-       while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    } else {
-       /* Try to obtain atom types from title line */
-       char const *token = (i == 0 ? strtok(data->titleline, " ") : strtok(NULL, " "));
-       idx = get_pte_idx(token);
-    }
-
-    label = get_pte_label(idx);
-    mass = get_pte_mass(idx);
-    radius = get_pte_vdw_radius(idx);
-    for (j = 0; j < data->eachatom[i]; ++j, ++atomcount) {
-      molfile_atom_t *const atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP5 XDATCAR read) ERROR: file '%s' doesn't seem to have list of atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  for (i = 0; i < 2; ++i) fgets(lineptr, LINESIZE, data->file);
-  sscanf(lineptr, "%f", &lc);
-   fprintf(stderr, "%f\n", lc);
-
-  for (i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-  vasp_buildrotmat(data);
-
- /* Ignore header until X,Y,Z-coordinates */
- for (i = 0; i < 3; ++i) fgets(lineptr, LINESIZE, data->file);
-
- /* Check whether all coordinates are present in the file */
- for (i = 0; i < data->numatoms; ++i) {
-   float coord;
-   fgets(lineptr, LINESIZE, data->file);
-   if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) {
-     fprintf(stderr, "\n\nVASP5 XDATCAR read) ERROR: structure is missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-     return MOLFILE_ERROR;
-   }
- }
-
- rewind(data->file);
-
- /* Ignore header until X,Y,Z-coordinates */
- for (i = 0; i < 8; ++i) fgets(lineptr, LINESIZE, data->file);
-
- return MOLFILE_SUCCESS;
-}
-
-
-static int read_vasp5xdatcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  int i;
-  char lineptr[LINESIZE];
-  
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  /* Save coords only if we're given a timestep pointer,
-   * otherwise assume that VMD wants us to skip past it.
-   */
-  if (!ts || !data) return MOLFILE_EOF;
-
-  for (i = 0; i < data->numatoms; ++i) {
-    float x, y, z, rotx, roty, rotz;
-    fgets(lineptr, LINESIZE, data->file);
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) {
-      fprintf(stderr, "VASP5 XDATCAR read) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-      return MOLFILE_EOF;
-    }
-
-    rotx = x*data->cell[0][0]+y*data->cell[1][0]+z*data->cell[2][0];
-    roty = x*data->cell[0][1]+y*data->cell[1][1]+z*data->cell[2][1];
-    rotz = x*data->cell[0][2]+y*data->cell[1][2]+z*data->cell[2][2];
-
-    ts->coords[3*i  ] = data->rotmat[0][0]*rotx+data->rotmat[0][1]*roty+data->rotmat[0][2]*rotz;
-    ts->coords[3*i+1] = data->rotmat[1][0]*rotx+data->rotmat[1][1]*roty+data->rotmat[1][2]*rotz;
-    ts->coords[3*i+2] = data->rotmat[2][0]*rotx+data->rotmat[2][1]*roty+data->rotmat[2][2]*rotz;
-  }
-
-  vasp_timestep_unitcell(ts, data);
-
-  /* VMD keeps calling for a next timestep, until we reach End-Of-File here */
-  if (fgets(lineptr, LINESIZE, data->file) == NULL) return MOLFILE_EOF;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vasp5xdatcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "VASP_XDATCAR5";
-  plugin.prettyname = "VASP_XDATCAR5";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "VASP_XDATCAR5";
-  plugin.open_file_read = open_vasp5xdatcar_read;
-  plugin.read_structure = read_vasp5xdatcar_structure;
-  plugin.read_next_timestep = read_vasp5xdatcar_timestep;
-  plugin.close_file_read = close_vasp5xdatcar_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspchgcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspchgcarplugin.c
deleted file mode 100644
index e656ca88a70f92c8ec8398ac9f552025bd3f94bf..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspchgcarplugin.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspchgcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.13 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspchgcarplugin.c
- *  ld -shared -o vaspchgcarplugin.so vaspchgcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspchgcarplugin.c
- *  c++ -bundle -o vaspchgcarplugin.so vaspchgcarplugin.o
- *
- *  Install
- *  copy vaspchgcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-
-
-static void *open_vaspchgcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  float lc;
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Read system title */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Read lattice constant */
-  fgets(lineptr, LINESIZE, data->file);
-  lc = atof(strtok(lineptr, " "));
-
-  /* Read unit cell lattice vectors and multiply by lattice constant */
-  for(i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-
-  /* Build rotation matrix */
-  vasp_buildrotmat(data);
-
-  /* Count number of atoms */
-  fgets(lineptr, LINESIZE, data->file);
-  data->numatoms = 0;
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, data->file);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: file '%s' does not contain list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  /* Skip lines up to the grid numbers */
-  for (i = 0; i < data->numatoms + 2; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-
-static int read_vaspchgcar_metadata(void *mydata, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int gridx, gridy, gridz, i;
-  char const spintext[4][20] = { "spin up+down", "spin up-down", "spin up", "spin down" };
-
-  /* Verify that input is OK */
-  if (!data || !nvolsets || !metadata) return MOLFILE_ERROR;
-
-  /* Read the grid size */
-  fgets(lineptr, LINESIZE, data->file);
-  if (3 != sscanf(lineptr, "%d %d %d", &gridx, &gridy, &gridz)) {
-     fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: file '%s' does not contain grid dimensions.\n", data->filename);
-     return MOLFILE_ERROR;
-  }
-
-  fprintf(stderr, "\n\nVASP CHGCAR read) found grid data block...\n");
-
-  /* Initialize the volume set list with 4 entries:
-   * spin up+down : always present
-   * spin up-down / spin up /spin down : only there for spin-polarized calculations
-   *                (the latter remain empty for non-spin-polarized calculations)
-   */
-  data->nvolsets = 4;
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-     fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: Cannot allocate space for volume data.\n");
-     return MOLFILE_ERROR;
-  }
-
-  for (i = 0; i < data->nvolsets; ++i) {
-    molfile_volumetric_t *const set = &(data->vol[i]); /* get a handle to the current volume set meta data */
-    int k;
-
-    set->has_color = 0;
-
-    /* put volume data name */
-    sprintf(set->dataname, "Charge density (%s)", spintext[i]);
-
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-    set->xsize = gridx + 1;
-    set->ysize = gridy + 1;
-    set->zsize = gridz + 1;
-
-    /* Rotate unit cell vectors */
-    for (k = 0; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->cell[0][0]
-		+ data->rotmat[k][1] * data->cell[0][1]
-		+ data->rotmat[k][2] * data->cell[0][2];
-      
-      set->yaxis[k] = data->rotmat[k][0] * data->cell[1][0] 
-		+ data->rotmat[k][1] * data->cell[1][1]
-		+ data->rotmat[k][2] * data->cell[1][2];
-      
-      set->zaxis[k] = data->rotmat[k][0] * data->cell[2][0] 
-		+ data->rotmat[k][1] * data->cell[2][1]
-		+ data->rotmat[k][2] * data->cell[2][2];
-    }
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_vaspchgcar_data(void *mydata, int set, float *datablock, float *colorblock)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int chargedensity, error, iset, n;
-  float volume;
-
-  /* Verify that input is OK */
-  if (!data || !datablock) return MOLFILE_ERROR;
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  if (strstr(data->filename, "LOCPOT") == NULL && strstr(data->filename, "ELFCAR") == NULL) {
-    chargedensity = 1;
-    fprintf(stderr, "\nVASP CHGCAR read) Charge density is assumed. Each value will be divided by unit cell volume.\n");
-  } else {
-    if (set == 1) {
-      fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: ELF or local potential do not include spin difference information.\n");
-      return MOLFILE_ERROR;
-    }
-    chargedensity = 0;
-    fprintf(stderr, "\nVASP CHGCAR read) ELF or local potential is assumed.\n");
-  }
-
-  volume = fabs(
-            data->cell[0][0]*(data->cell[1][1]*data->cell[2][2]-data->cell[1][2]*data->cell[2][1])
-	  + data->cell[0][1]*(data->cell[1][2]*data->cell[2][0]-data->cell[1][0]*data->cell[2][2])
-	  + data->cell[0][2]*(data->cell[1][0]*data->cell[2][1]-data->cell[2][0]*data->cell[1][1])
-               );
-
-  /* Set file pointer to beginning of file and then skip header up to density data */
-  rewind(data->file);
-  for (n = 0; n < data->numatoms + data->version + 5; ++n) fgets(lineptr, LINESIZE, data->file);
-
-  for(error = iset = 0; iset <= set && iset < 2 && !error; ++iset) {
-    char const *dataname = data->vol[iset].dataname;
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-    int const numberOfDatapoints = (xsize - 1) * (ysize - 1) * (zsize - 1);
-    int ix, iy, iz;
-
-    fprintf(stderr, "\nVASP CHGCAR read) Patience! Reading volume set %d (%d points): %s\n", iset + 1, numberOfDatapoints, dataname);
-
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          float value;
-	  if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else {
-	    if (1 != fscanf(data->file, "%f", &value)) return MOLFILE_ERROR;
-	    if (chargedensity) value /= volume;
-	  }
-
-	  /* for set == 2: spin-up   = 0.5 * set0 + 0.5 * set1
-	   * for set == 3: spin-down = 0.5 * set0 - 0.5 * set1 */
-	  if (iset == set) datablock[n] = value;
-	  else if (set >= 2 && iset == 0) datablock[n] = 0.5 * value;
-	  else if (set == 2 && iset == 1) datablock[n] += 0.5 * value;
-	  else if (set == 3 && iset == 1) datablock[n] -= 0.5 * value;
-        }
-      }
-    }
-
-    /* Skip paw-augmentation part 
-     * augmentation parts are found only in CHGCAR not in PARCHG
-     * I have no good idea for that */
-    for (iy = 0; iy < data->numatoms; ++iy) {
-      int numaug;
-      if (1 != fscanf(data->file, "%*s %*s %*d %d", &numaug)) error = 1;
-      
-      for (ix = 0; ix < numaug && !error; ++ix) {
-	float val;
-	if (1 != fscanf(data->file, "%f", &val)) error = 2;
-      }
-      fgets(lineptr, LINESIZE, data->file);
-    }
-
-    /* After the charge density data there are floating numbers (times of atoms)
-     * and a line with three grid integers, all of which should be skipped. */
-    if(iset==0){
-      for (iy = 0; iy < data->numatoms; ++iy) {
-	float val;
-	if (1 != fscanf(data->file, "%f", &val)) error = 2;
-      }
-      for (iy = 0; iy < 3; ++iy) {
-	int ival;
-	if (1 != fscanf(data->file, "%d", &ival)) error = 2;
-      }
-    }
-
-    fprintf(stderr, "\nVASP CHGCAR read) %s finished.\n", dataname);
-  }
-
-  if (error) fprintf(stderr, "\nVASP CHGCAR read) PAW-augmentation part is incomplete, but it is ignored anyway.\n");
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspchgcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "CHGCAR";
-  plugin.prettyname = "VASP_CHGCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "CHGCAR";
-  plugin.open_file_read = open_vaspchgcar_read;
-  plugin.close_file_read = close_vaspchgcar_read;
-  plugin.read_volumetric_metadata = read_vaspchgcar_metadata;
-  plugin.read_volumetric_data = read_vaspchgcar_data;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspoutcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspoutcarplugin.c
deleted file mode 100644
index ea4a7d9604c63a5bcf952c9b6b076dc70fb9c953..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspoutcarplugin.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspoutcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspoutcarplugin.c
- *  ld -shared -o vaspoutcarplugin.so vaspoutcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspoutcarplugin.c
- *  c++ -bundle -o vaspoutcarplugin.so vaspoutcarplugin.o
- *
- *  Install
- *  copy vaspoutcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspoutcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-  
-  data->filename = strdup(filename);
-
-  /* Catch total number of atoms */
-  data->numatoms = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && data->numatoms == 0) {
-   if (strstr(lineptr, "NIONS =") != NULL) {
-      sscanf(lineptr, " %*[ a-zA-Z] = %*d %*[ a-zA-Z] = %d", &data->numatoms);
-      break;
-    }
-  }
-
-  if (data->numatoms <= 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does not contain the number of atoms.\n", filename);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-
-  /* Catch the lattice vectors */
-  while (fgets(lineptr, LINESIZE, data->file)) {
-     if (strstr(lineptr, "direct lattice vectors") != NULL) {
-       int i;
-       for (i = 0; i < 3; ++i) {
-	 fgets(lineptr, LINESIZE, data->file);
-	 if (3 != sscanf(lineptr, "%f %f %f", &data->cell[i][0], &data->cell[i][1], &data->cell[i][2])) {
-           vasp_plugindata_free(data);
-           fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does not contain lattice vectors.\n", filename);
-           return NULL;
-	 }
-       }
-       break;
-     }
-  }
-  vasp_buildrotmat(data);
-
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vaspoutcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar;
-  char lineptr[LINESIZE], potcarfile[1000];
-  float atommass[MAXATOMTYPES];
-  int atomcount, typecount, i;
-
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS;
-
-  typecount = 0;
-  atomcount = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && atomcount < data->numatoms) {
-    if (strstr(lineptr, "POMASS") != NULL) sscanf(lineptr, " POMASS = %f;", &atommass[typecount++]);
-
-    if (strstr(lineptr, "ions per type =") != NULL) {
-      char const *token = strtok(lineptr, "=");
-      for (i = 0; i < typecount; ++i) {
-        token = strtok(NULL, " ");
-        atomcount += data->eachatom[i] = atoi(token);
-      }
-    }
-  }
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does not have number of each atom.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise try to find similar mass in periodic table.
-   */
-  if (strstr(potcarfile, "OUTCAR")) {
-    strcpy(potcarfile, data->filename);
-    strcpy(strstr(potcarfile, "OUTCAR"), "POTCAR");
-    potcar = fopen(potcarfile, "r");
-  } else {
-    potcar = NULL;
-  }
-
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    char const *label;
-    float mass, radius;
-    int k, idx = 0;
-
-    if (potcar) {
-      /* Obtain atom types from POTCAR file */
-      char atomtype[5] = "X";
-      if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4[^_. 0-9]", atomtype);
-      idx = get_pte_idx(atomtype);
-
-      /* Skip lines in potcar file until next element */
-      while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    }
-    
-    if (idx == 0) {
-        /* Try to find atom type by browsing through periodic table */
-        idx = sizeof(pte_mass)/sizeof(pte_mass[0]);
-	do idx--;
-	while (idx > 0 && fabs(get_pte_mass(idx) - atommass[i]) > 0.01);
-    }
-
-    label = get_pte_label(idx);
-    mass = (idx ? get_pte_mass(idx) : atommass[i]);
-    radius = get_pte_vdw_radius(idx);
-    for (k = 0; k < data->eachatom[i]; ++k, ++atomcount) {
-      molfile_atom_t *atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does contain list of atom names.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  atomcount = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && atomcount == 0) {
-    if (strstr(lineptr, "position of ions in cartesian coordinates") != NULL) {
-      for (i = 0; i < data->numatoms; ++i, ++atomcount) {
-	float coord;
-        fgets(lineptr, LINESIZE, data->file);
-        if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) {
-	  fprintf(stderr, "\n\nVASP OUTCAR read) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-	  return MOLFILE_ERROR;
-	}
-      }
-    }
-  }
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does contain list of atom names.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
- 
-  rewind(data->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspoutcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int atomcount;
-
-  /* Save coords only if we're given a timestep pointer,
-   * otherwise assume that VMD wants us to skip past it.
-   */
-  if (!data || !ts) return MOLFILE_EOF;
-
-  atomcount = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && atomcount == 0) {
-    if (strstr(lineptr, "TOTAL-FORCE") != NULL) {
-      int i;
-      fgets(lineptr, LINESIZE, data->file);
-      for (i = 0; i < data->numatoms; ++i, ++atomcount) {
-	float x, y, z;
-	fgets(lineptr, LINESIZE, data->file);
-	if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) return MOLFILE_EOF;
-      
-	ts->coords[3*i  ] = data->rotmat[0][0]*x+data->rotmat[0][1]*y+data->rotmat[0][2]*z;
-	ts->coords[3*i+1] = data->rotmat[1][0]*x+data->rotmat[1][1]*y+data->rotmat[1][2]*z;
-	ts->coords[3*i+2] = data->rotmat[2][0]*x+data->rotmat[2][1]*y+data->rotmat[2][2]*z;
-      }
-    }
-  }
-  if (atomcount != data->numatoms) return MOLFILE_EOF;
-
-  vasp_timestep_unitcell(ts, data);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspoutcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "OUTCAR";
-  plugin.prettyname = "VASP_OUTCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "OUTCAR";
-  plugin.open_file_read = open_vaspoutcar_read;
-  plugin.read_structure = read_vaspoutcar_structure;
-  plugin.read_next_timestep = read_vaspoutcar_timestep;
-  plugin.close_file_read = close_vaspoutcar_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspparchgplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspparchgplugin.c
deleted file mode 100644
index f8b061ccc43ba7f5bdd4d36c904b2827f09429ac..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspparchgplugin.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspparchgplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.2 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspparchgplugin.c
- *  ld -shared -o vaspparchgplugin.so vaspparchgplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspparchgplugin.c
- *  c++ -bundle -o vaspparchgplugin.so vaspparchgplugin.o
- *
- *  Install
- *  copy vaspparchgplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-
-
-static void *open_vaspparchg_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  float lc;
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Read system title */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Read lattice constant */
-  fgets(lineptr, LINESIZE, data->file);
-  lc = atof(strtok(lineptr, " "));
-
-  /* Read unit cell lattice vectors and multiply by lattice constant */
-  for(i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-
-  /* Build rotation matrix */
-  vasp_buildrotmat(data);
-
-  /* Count number of atoms */
-  fgets(lineptr, LINESIZE, data->file);
-  data->numatoms = 0;
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, data->file);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP PARCHG read) ERROR: file '%s' does not contain list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  /* Skip lines up to the grid numbers */
-  for (i = 0; i < data->numatoms + 2; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-
-static int read_vaspparchg_metadata(void *mydata, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int gridx, gridy, gridz, i;
-  char const spintext[4][20] = { "spin up+down", "spin up-down", "spin up", "spin down" };
-
-  /* Verify that input is OK */
-  if (!data || !nvolsets || !metadata) return MOLFILE_ERROR;
-
-  /* Read the grid size */
-  fgets(lineptr, LINESIZE, data->file);
-  if (3 != sscanf(lineptr, "%d %d %d", &gridx, &gridy, &gridz)) {
-     fprintf(stderr, "\n\nVASP PARCHG read) ERROR: file '%s' does not contain grid dimensions.\n", data->filename);
-     return MOLFILE_ERROR;
-  }
-
-  fprintf(stderr, "\n\nVASP PARCHG read) found grid data block...\n");
-
-  /* Initialize the volume set list with 4 entries:
-   * spin up+down : always present
-   * spin up-down / spin up /spin down : only there for spin-polarized calculations
-   *                (the latter remain empty for non-spin-polarized calculations)
-   */
-  data->nvolsets = 4;
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-     fprintf(stderr, "\n\nVASP PARCHG read) ERROR: Cannot allocate space for volume data.\n");
-     return MOLFILE_ERROR;
-  }
-
-  for (i = 0; i < data->nvolsets; ++i) {
-    molfile_volumetric_t *const set = &(data->vol[i]); /* get a handle to the current volume set meta data */
-    int k;
-
-    set->has_color = 0;
-
-    /* put volume data name */
-    sprintf(set->dataname, "Charge density (%s)", spintext[i]);
-
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-    set->xsize = gridx + 1;
-    set->ysize = gridy + 1;
-    set->zsize = gridz + 1;
-
-    /* Rotate unit cell vectors */
-    for (k = 0; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->cell[0][0]
-		+ data->rotmat[k][1] * data->cell[0][1]
-		+ data->rotmat[k][2] * data->cell[0][2];
-      
-      set->yaxis[k] = data->rotmat[k][0] * data->cell[1][0] 
-		+ data->rotmat[k][1] * data->cell[1][1]
-		+ data->rotmat[k][2] * data->cell[1][2];
-      
-      set->zaxis[k] = data->rotmat[k][0] * data->cell[2][0] 
-		+ data->rotmat[k][1] * data->cell[2][1]
-		+ data->rotmat[k][2] * data->cell[2][2];
-    }
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspparchg_data(void *mydata, int set, float *datablock, float *colorblock)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int chargedensity, error, iset, n;
-  float volume;
-
-  /* Verify that input is OK */
-  if (!data || !datablock) return MOLFILE_ERROR;
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  if (strstr(data->filename, "LOCPOT") == NULL && strstr(data->filename, "ELFCAR") == NULL) {
-    chargedensity = 1;
-    fprintf(stderr, "\nVASP PARCHG read) Charge density is assumed. Each value will be divided by unit cell volume.\n");
-  } else {
-    if (set == 1) {
-      fprintf(stderr, "\n\nVASP PARCHG read) ERROR: ELF or local potential do not include spin difference information.\n");
-      return MOLFILE_ERROR;
-    }
-    chargedensity = 0;
-    fprintf(stderr, "\nVASP PARCHG read) ELF or local potential is assumed.\n");
-  }
-
-  volume = fabs(
-            data->cell[0][0]*(data->cell[1][1]*data->cell[2][2]-data->cell[1][2]*data->cell[2][1])
-	  + data->cell[0][1]*(data->cell[1][2]*data->cell[2][0]-data->cell[1][0]*data->cell[2][2])
-	  + data->cell[0][2]*(data->cell[1][0]*data->cell[2][1]-data->cell[2][0]*data->cell[1][1])
-               );
-
-  /* Set file pointer to beginning of file and then skip header up to density data */
-  rewind(data->file);
-  for (n = 0; n < data->numatoms + data->version + 5; ++n) fgets(lineptr, LINESIZE, data->file);
-
-  for(error = iset = 0; iset <= set && iset < 2 && !error; ++iset) {
-    char const *dataname = data->vol[iset].dataname;
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-    int const numberOfDatapoints = (xsize - 1) * (ysize - 1) * (zsize - 1);
-    int ix, iy, iz;
-
-    fprintf(stderr, "\nVASP PARCHG read) Patience! Reading volume set %d (%d points): %s\n", iset + 1, numberOfDatapoints, dataname);
-
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          float value;
-	  if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else {
-	    if (1 != fscanf(data->file, "%f", &value)) return MOLFILE_ERROR;
-	    if (chargedensity) value /= volume;
-	  }
-
-	  /* for set == 2: spin-up   = 0.5 * set0 + 0.5 * set1
-	   * for set == 3: spin-down = 0.5 * set0 - 0.5 * set1 */
-	  if (iset == set) datablock[n] = value;
-	  else if (set >= 2 && iset == 0) datablock[n] = 0.5 * value;
-	  else if (set == 2 && iset == 1) datablock[n] += 0.5 * value;
-	  else if (set == 3 && iset == 1) datablock[n] -= 0.5 * value;
-        }
-      }
-    }
-
-    if(iset == 0){
-      for (iy = 0; iy < 3; ++iy) {
-	int ival;
-	if (1 != fscanf(data->file, "%d", &ival)) error = 2;
-      }
-    }
-
-    fprintf(stderr, "\nVASP PARCHG read) %s finished.\n", dataname);
-  }
-
-  if (error) fprintf(stderr, "\nVASP PARCHG read) PAW-augmentation part is incomplete, but it is ignored anyway.\n");
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspparchg_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "PARCHG";
-  plugin.prettyname = "VASP_PARCHG";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "PARCHG";
-  plugin.open_file_read = open_vaspparchg_read;
-  plugin.close_file_read = close_vaspparchg_read;
-  plugin.read_volumetric_metadata = read_vaspparchg_metadata;
-  plugin.read_volumetric_data = read_vaspparchg_data;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspplugin.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspplugin.h
deleted file mode 100644
index eaa1aa2ee1a2b4f04225216389d078091dc208a1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspplugin.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.5 $       $Date: 2009/06/22 19:45:49 $
- *
- ***************************************************************************/
-
-
-#ifndef _VASPPLUGIN_H_
-#define _VASPPLUGIN_H_
-
-#include <stdio.h>
-#include <math.h>
-#include "molfile_plugin.h"
-
-#define LINESIZE 1024
-#define MAXATOMTYPES 100
-
-#ifndef M_PI
-#define M_PI           3.14159265358979323846
-#endif
-
-typedef struct {
-  FILE *file;
-  char *filename;
-  char *titleline;              /* Comment line provides system information */
-  int version;                  /* VASP version control */
-  int numatoms;                 /* total number of atoms */
-  int eachatom[MAXATOMTYPES];   /* number of atoms per atom type */
-  molfile_atom_t *atomlist;
-
-  float cell[3][3];             /* lattice vectors of the unit cell */
-  float rotmat[3][3];           /* rotation matrix, stored for periodic display hack */
-
-  /* volumetric variables for charge density data */
-  int nvolsets;                 /* number of volumetric datasets */
-  molfile_volumetric_t *vol;    /* volume set metadata */
-} vasp_plugindata_t;
-
-
-/* allocate memory for plugin data and NULLify the pointers */
-static vasp_plugindata_t *vasp_plugindata_malloc()
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)malloc(sizeof(vasp_plugindata_t));
-
-  if (!data) {
-    fprintf(stderr, "\n\nVASP plugin) ERROR: cannot allocate memory for plugin data.\n");
-    return NULL;
-  }
-
-  data->file = NULL;
-  data->filename = NULL;
-  data->titleline = NULL;
-  data->atomlist = NULL;
-  data->vol = NULL;
-
-  return data;
-}
-
-
-/* free up the plugin data */
-static void vasp_plugindata_free(vasp_plugindata_t *data)
-{
-  if (!data) return;
-
-  if (data->file) fclose(data->file);
-  if (data->filename) free(data->filename);
-  if (data->titleline) free(data->titleline);
-  if (data->atomlist) free(data->atomlist);
-  if (data->vol) free(data->vol);
-  free(data);
-  data = NULL;
-}
-
-
-/* calculate and store rotation matrix to realign everything later. */
-static void vasp_buildrotmat(vasp_plugindata_t *data)
-{
-  float const *const a = data->cell[0];
-  float const *const b = data->cell[1];
-
-  /* rotate first around y and z to align a along the x-axis... */
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  /* ...then rotate around x to put b into the xy-plane. */
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  data->rotmat[0][0] =  cph*cth;
-  data->rotmat[0][1] =  cph*sth;
-  data->rotmat[0][2] =  sph;
-  data->rotmat[1][0] = -sth*cps - sph*cth*sps;
-  data->rotmat[1][1] =  cth*cps - sph*sth*sps;
-  data->rotmat[1][2] =  cph*sps; 
-  data->rotmat[2][0] =  sth*sps - sph*cth*cps;
-  data->rotmat[2][1] = -cth*sps - sph*sth*cps; 
-  data->rotmat[2][2] =  cph*cps;
-}
-
-
-static void vasp_timestep_unitcell(molfile_timestep_t *ts, vasp_plugindata_t *data)
-{
-  if (!ts || !data) return;
-
-  ts->A = sqrt(data->cell[0][0]*data->cell[0][0]+data->cell[0][1]*data->cell[0][1]+data->cell[0][2]*data->cell[0][2]);
-  ts->B = sqrt(data->cell[1][0]*data->cell[1][0]+data->cell[1][1]*data->cell[1][1]+data->cell[1][2]*data->cell[1][2]);
-  ts->C = sqrt(data->cell[2][0]*data->cell[2][0]+data->cell[2][1]*data->cell[2][1]+data->cell[2][2]*data->cell[2][2]);
-
-  ts->gamma = acos((data->cell[0][0]*data->cell[1][0]+data->cell[0][1]*data->cell[1][1]+data->cell[0][2]*data->cell[1][2])/(ts->A*ts->B))*180.0/M_PI;
-  ts->beta  = acos((data->cell[0][0]*data->cell[2][0]+data->cell[0][1]*data->cell[2][1]+data->cell[0][2]*data->cell[2][2])/(ts->A*ts->C))*180.0/M_PI;
-  ts->alpha = acos((data->cell[1][0]*data->cell[2][0]+data->cell[1][1]*data->cell[2][1]+data->cell[1][2]*data->cell[2][2])/(ts->B*ts->C))*180.0/M_PI;
-}
-
-#endif /* _VASPPLUGIN_H_ */
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspposcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspposcarplugin.c
deleted file mode 100644
index e501942ab784b5aefe014e6566cbf67b482c750c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspposcarplugin.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspposcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspposcarplugin.c
- *  ld -shared -o vaspposcarplugin.so vaspposcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspposcarplugin.c
- *  c++ -bundle -o vaspposcarplugin.so vaspposcarplugin.o
- *
- *  Install
- *  copy vaspposcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspposcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Read title line */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Ignore rest of header up to the line with atom numbers */
-  for (i = 0; i < 5; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  /* Read the number of atoms per atom type */
-  data->numatoms = 0;
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, data->file);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP POSCAR read) ERROR: file '%s' does not have list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vaspposcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar = NULL;
-  int atomcount, i;
-  char lineptr[LINESIZE], potcarfile[1000], *cp;
- 
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  /* This plugin can read both POSCAR and CONTCAR files */
-  strcpy(potcarfile, data->filename);
-  cp = strstr(potcarfile, "POSCAR");
-  if (!cp) cp = strstr(potcarfile, "CONTCAR");
-
-  if (cp) {
-    strcpy(cp, "POTCAR");
-    potcar = fopen(potcarfile, "r");
-  }
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise try the title line instead.
-   */
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    int idx, j;
-    char const *label;
-    float mass, radius;
-
-    if (potcar) {
-       char atomtype[5] = "X";
-       /* Obtain atom types from POTCAR file */
-       if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4[^_. 0-9]", atomtype);
-       idx = get_pte_idx(atomtype);
-       /* Skip lines in potcar file until next element */
-       while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    } else {
-       /* Try to obtain atom types from title line */
-       char const *token = (i == 0 ? strtok(data->titleline, " ") : strtok(NULL, " "));
-       idx = get_pte_idx(token);
-    }
-
-    label = get_pte_label(idx);
-    mass = get_pte_mass(idx);
-    radius = get_pte_vdw_radius(idx);
-    for (j = 0; j < data->eachatom[i]; ++j, ++atomcount) {
-      molfile_atom_t *const atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP POSCAR read) ERROR: file '%s' doesn't seem to have list of atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
- /* Ignore header until X,Y,Z-coordinates */
- for (i = 0; i < data->version + 3; ++i) fgets(lineptr, LINESIZE, data->file);
-
- /* Ignore selective tag-line, starting with either 's' or 'S'. */
- if (tolower(lineptr[0]) == 's') fgets(lineptr, LINESIZE, data->file);
-
- /* Check whether all coordinates are present in the file */
- for (i = 0; i < data->numatoms; ++i) {
-   float coord;
-   fgets(lineptr, LINESIZE, data->file);
-   if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) {
-     fprintf(stderr, "\n\nVASP POSCAR read) ERROR: structure is missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-     return MOLFILE_ERROR;
-   }
- }
-
- rewind(data->file);
-
- return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspposcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  int i, direct;
-  char lineptr[LINESIZE];
-  float lc;
-  
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  /* Save coords only if we're given a timestep pointer,
-   * otherwise assume that VMD wants us to skip past it.
-   */
-  if (!ts || !data) return MOLFILE_EOF;
-
-  /* VMD keeps calling for a next timestep, until we reach End-Of-File here */
-  if (fgets(lineptr, LINESIZE, data->file) == NULL) return MOLFILE_EOF;
-
-  fgets(lineptr, LINESIZE, data->file);
-  sscanf(lineptr, "%f", &lc);
-
-  for (i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-  vasp_buildrotmat(data);
-
-  /* Skip numbers of atom types */
-  for (i = 0; i < data->version - 2; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  /* Skip selective tag-line, starting with 's' or 'S'. */
-  if (tolower(lineptr[0]) == 's') fgets(lineptr, LINESIZE, data->file);
-
-  /* Detect direct coordinates tag, starting with 'd' or 'D'. */
-  direct = (tolower(lineptr[0]) == 'd' ? 1 : 0);
-
-  for (i = 0; i < data->numatoms; ++i) {
-    float x, y, z, rotx, roty, rotz;
-    fgets(lineptr, LINESIZE, data->file);
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) {
-      fprintf(stderr, "VASP POSCAR read) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-      return MOLFILE_EOF;
-    }
-
-    if (direct) {
-       rotx = x*data->cell[0][0]+y*data->cell[1][0]+z*data->cell[2][0];
-       roty = x*data->cell[0][1]+y*data->cell[1][1]+z*data->cell[2][1];
-       rotz = x*data->cell[0][2]+y*data->cell[1][2]+z*data->cell[2][2];
-    } else {
-       rotx = x*lc;
-       roty = y*lc;
-       rotz = z*lc;
-    }
-    ts->coords[3*i  ] = data->rotmat[0][0]*rotx+data->rotmat[0][1]*roty+data->rotmat[0][2]*rotz;
-    ts->coords[3*i+1] = data->rotmat[1][0]*rotx+data->rotmat[1][1]*roty+data->rotmat[1][2]*rotz;
-    ts->coords[3*i+2] = data->rotmat[2][0]*rotx+data->rotmat[2][1]*roty+data->rotmat[2][2]*rotz;
-  }
-
-  vasp_timestep_unitcell(ts, data);
-
-  /* POSCAR type files have only one single timestep.
-   * Therefore proceed till end of file after reading the coordinates.
-   */
-  fseek(data->file, 0, SEEK_END);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspposcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  vasp_plugindata_free(data);
-}
-
-
-static void *open_vaspposcar_write(const char *filename, const char *filetype, int natoms)
-{
-  vasp_plugindata_t *data;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  data->file = fopen(filename, "w");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "VASP POSCAR write) ERROR: Unable to open vaspposcar file '%s' for writing\n", filename);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-  data->numatoms = natoms;
-
-  return data;
-}
-
-
-static int write_vaspposcar_structure(void *mydata, int optflags, const molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  if (!data || !atoms) return MOLFILE_ERROR;
-
-  data->atomlist = (molfile_atom_t *)malloc(data->numatoms*sizeof(molfile_atom_t));
-  if (!data->atomlist) return MOLFILE_ERROR;
-
-  memcpy(data->atomlist, atoms, data->numatoms*sizeof(molfile_atom_t));
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_vaspposcar_timestep(void *mydata, const molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata; 
-  molfile_atom_t const *atom;
-  int i, maxtype, eachatom[MAXATOMTYPES];
-  float x1, x2, y2, x3, y3, z3;
-  char tmptype[LINESIZE] = "";
-
-  if (!data || !ts) {
-    fprintf(stderr, "VASP POSCAR write) ERROR: Wrong input for writing POSCAR file\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* restore unit cell information in Cartesian */
-  x1 = ts->A;
-  x2 = ts->B*cos(ts->gamma*M_PI/180.0);
-  y2 = ts->B*sin(ts->gamma*M_PI/180.0);
-  x3 = ts->C*cos(ts->beta*M_PI/180.0);
-  y3 = (ts->B*ts->C*cos(ts->alpha*M_PI/180.0)-x2*x3)/y2;
-  z3 = sqrt(ts->C*ts->C - x3*x3 - y3*y3);
-
-  maxtype = -1;
-  atom = data->atomlist;
-  for (i = 0; i < data->numatoms && maxtype < MAXATOMTYPES - 1; ++i, ++atom) {
-    if (strcmp(tmptype, atom->type) != 0) {
-      fprintf(data->file, "%-2s  ", atom->type);
-      eachatom[++maxtype] = 0;
-    }
-    eachatom[maxtype]++;
-    strncpy(tmptype, atom->type, sizeof(atom->type));
-  }
-
-  fprintf(data->file, "\n%20.12f\n", 1.0);  
-  fprintf(data->file, "%20.12f  %20.12f  %20.12f\n", x1, 0.0, 0.0);
-  fprintf(data->file, "%20.12f  %20.12f  %20.12f\n", x2, y2,  0.0);
-  fprintf(data->file, "%20.12f  %20.12f  %20.12f\n", x3, y3,  z3);
-
-  for (i = 0; i <= maxtype; ++i) fprintf(data->file, " %d ", eachatom[i]);
-
-  fprintf(data->file, "\nDirect\n");
-
-  for (i = 0; i < data->numatoms; ++i) {
-    float const *pos = ts->coords + 3*i;
-    /* in direct coordinate */
-    fprintf(data->file, "%20.12f %20.12f %20.12f \n", pos[0]/x1, -x2*pos[0]/(x1*y2) + pos[1]/y2, (-y2*x3+x2*y3)*pos[0]/(x1*y2*z3) - y3*pos[1]/(y2*z3) + pos[2]/z3);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspposcar_write(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "POSCAR";
-  plugin.prettyname = "VASP_POSCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "POSCAR";
-  plugin.open_file_read = open_vaspposcar_read;
-  plugin.read_structure = read_vaspposcar_structure;
-  plugin.read_next_timestep = read_vaspposcar_timestep;
-  plugin.close_file_read = close_vaspposcar_read;
-  plugin.open_file_write = open_vaspposcar_write;
-  plugin.write_structure = write_vaspposcar_structure;
-  plugin.write_timestep = write_vaspposcar_timestep;
-  plugin.close_file_write = close_vaspposcar_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspxdatcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspxdatcarplugin.c
deleted file mode 100644
index 4c218e7160a6ea00b8ef8b15014cf510a291482f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspxdatcarplugin.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspxdatcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.10 $       $Date: 2014/10/10 14:41:02 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  gcc -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxdatcarplugin.c
- *  ld -shared -o vaspxdatcarplugin.so vaspxdatcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxdatcarplugin.c
- *  c++ -bundle -o vaspxdatcarplugin.so vaspxdatcarplugin.o
- *
- *  Install
- *  copy vaspxdatcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspxdatcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  FILE *poscar;
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE], poscarfile[1000];
-  float lc;
-  int i;
-  
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  /* Use POSCAR or CONTCAR file for cell data and number of atoms */
-  if (strstr(filename, "XDATCAR") == NULL) {
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: file name '%s' does not contain 'XDATCAR'.\n", filename);
-    return NULL;
-  }
-  strcpy(poscarfile, filename);
-  strcpy(strstr(poscarfile, "XDATCAR"), "POSCAR");
-  poscar = fopen(poscarfile, "r");
-  if (!poscar) {
-    strcpy(poscarfile, filename);
-    strcpy(strstr(poscarfile, "XDATCAR"), "CONTCAR");
-    poscar = fopen(poscarfile, "r");
-    if (!poscar) {
-      fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: corresponding POSCAR or CONTCAR file not found.\n");
-      return NULL;
-    }
-  }
-  fprintf(stderr, "\n\nVASP XDATCAR read) determining lattice vectors and number of atoms from file '%s'.\n", poscarfile);
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  fgets(lineptr, LINESIZE, poscar);
-  data->titleline = strdup(lineptr);
-
-  fgets(lineptr, LINESIZE, poscar);
-  lc = atof(strtok(lineptr, " "));
-  
-  for (i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, poscar);
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) {
-      vasp_plugindata_free(data);
-      fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: POSCAR file '%s' does not have lattice vectors.\n", poscarfile);
-      return NULL;
-    }
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-  vasp_buildrotmat(data);
-
-  /* Read the number of atoms per atom type */
-  data->numatoms = 0;
-  fgets(lineptr, LINESIZE, poscar);
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, poscar);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  fclose(poscar);
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: POSCAR file '%s' does not have the list of atom numbers.\n", poscarfile);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-
-static int read_vaspxdatcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar;
-  char lineptr[LINESIZE], potcarfile[1000];
-  int atomcount, i;
-
-  /* Verify that input is OK */
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise, try the title line instead.
-   */
-  strcpy(potcarfile, data->filename);
-  strcpy(strstr(potcarfile, "XDATCAR"), "POTCAR");
-  potcar = fopen(potcarfile, "r");
-  if (potcar) fprintf(stderr, "\n\nVASP XDATCAR read) using file '%s' for determining atom types.\n", potcarfile);
-
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    int j;
-    int idx;
-    char const *label;
-    float mass, radius;
-
-    if (potcar) {
-       /* Obtain atom types from POTCAR file */
-       char atomtype[5] = "X";
-       if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4s", atomtype);
-       idx = get_pte_idx(atomtype);
-
-       /* Skip lines in potcar file until next element */
-       while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    } else {
-       /* Try to obtain atom types from title line */
-       char const *token = (i == 0 ? strtok(data->titleline, " ") : strtok(NULL, " "));
-       idx = get_pte_idx(token);
-    }
-
-    label = get_pte_label(idx);
-    mass = get_pte_mass(idx);
-    radius = get_pte_vdw_radius(idx);
-    for (j = 0; j < data->eachatom[i]; ++j, ++atomcount) {
-      molfile_atom_t *const atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    /* This can generally not happen; if it happens, there's a bug in the for-loop(i) above */
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: problem occurred when setting the atom types.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* Ignore header until X,Y,Z-coordinates */
-  for (i = 0; i < 4; ++i) fgets(lineptr, LINESIZE, data->file);
-
- /* Determine VASP4 and VASP5 */
-  if (tolower(lineptr[0]) == 'd'){
-    data->version = 5;
-    fgets(lineptr, LINESIZE, data->file);
-  }
-  else {
-      data->version = 4;
-      for (i = 0; i < 2; ++i)  fgets(lineptr, LINESIZE, data->file);
-    }
-
-  /* Check whether all coordinates are present in the file */
-  for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-    float coord;
-    if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) break;
-  }
-  if (i != data->numatoms) {
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: file '%s' does not contain all coordinates of the atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  /* Set file pointer to the line of the atoms' coordinates */
-  rewind(data->file);
-  for (i = 0; i < 10 - data->version; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspxdatcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int i;
-
-  /* only save coords if we're given a timestep pointer, */
-  /* otherwise assume that VMD wants us to skip past it. */
-  if (!data || !ts) return MOLFILE_EOF;
-
-  for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-    float x, y, z, rotx, roty, rotz;
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) break;
-
-    rotx = x*data->cell[0][0] + y*data->cell[1][0] + z*data->cell[2][0];
-    roty = x*data->cell[0][1] + y*data->cell[1][1] + z*data->cell[2][1];
-    rotz = x*data->cell[0][2] + y*data->cell[1][2] + z*data->cell[2][2];
-
-    ts->coords[3*i  ] = data->rotmat[0][0]*rotx + data->rotmat[0][1]*roty + data->rotmat[0][2]*rotz;
-    ts->coords[3*i+1] = data->rotmat[1][0]*rotx + data->rotmat[1][1]*roty + data->rotmat[1][2]*rotz;
-    ts->coords[3*i+2] = data->rotmat[2][0]*rotx + data->rotmat[2][1]*roty + data->rotmat[2][2]*rotz;
-  }
-  if (i != data->numatoms) return MOLFILE_EOF;
-
-  /* Skip the empty line after coordinates */
-  fgets(lineptr, LINESIZE, data->file);
-
-  vasp_timestep_unitcell(ts, data);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspxdatcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "XDATCAR";
-  plugin.prettyname = "VASP_XDATCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "XDATCAR";
-  plugin.open_file_read = open_vaspxdatcar_read;
-  plugin.read_structure = read_vaspxdatcar_structure;
-  plugin.read_next_timestep = read_vaspxdatcar_timestep;
-  plugin.close_file_read = close_vaspxdatcar_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspxmlplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspxmlplugin.c
deleted file mode 100644
index ed4dedd9d390e58eca13bade6b30a4c30f860385..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vaspxmlplugin.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspxmlplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $       $Date: 2016/11/06 17:43:13 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxmlplugin.c
- *  ld -shared -o vaspxmlplugin.so vaspxmlplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxmlplugin.c
- *  c++ -bundle -o vaspxmlplugin.so vaspxmlplugin.o
- *
- *  Install
- *  copy vaspxmlplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
- /* Be aware that the XML file has 2 extra frames in addition to the
-  * ionic time steps. There is a 'initial position' frame, then the
-  * frames of each time step, and in the end once again a 'final position'
-  * frame. Hence, the xml file will load two frames more than the ones
-  * in XDATCAR or OUTCAR; the first two and last two are thus identical.
-  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspxml_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  int cellcoords, finished;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Scan xml file */
-  data->numatoms = cellcoords = finished = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && !finished) {
-
-    if (strstr(lineptr, "SYSTEM") != NULL && data->titleline == NULL) {
-       /* Extract title line */
-       char *begin = strstr(lineptr, ">") + 1;
-       char *end = strstr(lineptr, "</i>");
-       if (end) *end = '\0';
-       if (begin) data->titleline = strdup(begin);
-
-    } else if (strstr(lineptr, "atominfo") != NULL && data->numatoms == 0) {
-       /* Extract number of atoms */
-       fgets(lineptr, LINESIZE, data->file);
-       sscanf(lineptr, " <atoms> %d </atoms>", &data->numatoms);
-
-    } else if (strstr(lineptr, "crystal") != NULL && cellcoords == 0) {
-       /* Extract lattice vectors */
-       int i;
-       fgets(lineptr, LINESIZE, data->file);
-       for (i = 0; i < 3 && fgets(lineptr, LINESIZE, data->file); ++i) cellcoords += sscanf(lineptr, " <v> %f %f %f </v>", &data->cell[i][0], &data->cell[i][1], &data->cell[i][2]);
-    }
-
-    finished = data->titleline != NULL && data->numatoms != 0 && cellcoords != 0;
-  }
-
-  if (data->numatoms <= 0) {
-     vasp_plugindata_free(data);
-     fprintf(stderr, "\n\nVASP xml read) ERROR: file '%s' does not contain the number of atoms.\n", filename);
-     return NULL;
-  }
-
-  if (cellcoords != 9) {
-     vasp_plugindata_free(data);
-     fprintf(stderr, "\n\nVASP xml read) ERROR: file '%s' does not contain lattice vectors.\n", filename);
-     return NULL;
-  }
-
-  vasp_buildrotmat(data);
-
-  *natoms = data->numatoms;
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vaspxml_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  int atomcount, coordscount, finished;
-  char lineptr[LINESIZE];
-
-  /* Verify that input is OK */
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  /* Scan xml file */
-  atomcount = coordscount = finished = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && !finished) {
-
-    /* Extract atom types */
-    if (strstr(lineptr, "atomtype") != NULL && atomcount == 0) {
-      int i;
-      fgets(lineptr, LINESIZE, data->file);
-      for (i = 0; i < data->numatoms; ++i, ++atomcount) {
-        molfile_atom_t *atom = &(atoms[i]);
-        char atomtype[5];
-        int idx;
-        fgets(lineptr, LINESIZE, data->file);
-	if (1 != sscanf(lineptr, " <rc><c> %4s </c>", atomtype)) break;
-
-        idx = get_pte_idx(atomtype);
-
-        /* Required settings */
-        strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-        strncpy(atom->type, atom->name, sizeof(atom->type));
-	atom->resname[0] = '\0';
-        atom->resid = 1;
-        atom->segid[0]  ='\0';
-        atom->chain[0] = '\0';
-
-        /* Optional flags (as defined in *optflags) */
-        atom->mass = get_pte_mass(idx);
-        atom->radius = get_pte_vdw_radius(idx);
-        atom->atomicnumber = idx;
-      }
-
-    /* Verify presence of coordinates for all atoms */
-    } else if (strstr(lineptr, "positions") != NULL && coordscount == 0) {
-        int i;
-        for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-           float x, y, z;
-	   if (3 != sscanf(lineptr, " <v> %f %f %f <\v>", &x, &y, &z)) break;
-        }
-	coordscount = 3 * i;
-    }
-
-    finished = atomcount != 0 && coordscount != 0;
-  }
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP xml read) ERROR: file '%s' does not have list of atom names.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  if (coordscount != 3 * data->numatoms) {
-    fprintf(stderr, "\n\nVASP xml read)  file '%s' does not contain coordinates of all atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  rewind(data->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspxml_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-
-  /* only save coords if we're given a timestep pointer, */
-  /* otherwise assume that VMD wants us to skip past it. */
-  if (!data || !ts) return MOLFILE_EOF;
-
-  /* Scan xml file */
-  while (fgets(lineptr, LINESIZE, data->file)) {
-
-    /* Extract coordinates of all atoms */
-    if (strstr(lineptr, "positions") != NULL) {
-      int i;
-      for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-        float x, y, z, rotx, roty, rotz;
-	if (3 != sscanf(lineptr, " <v> %f %f %f </v>", &x, &y, &z)) return MOLFILE_EOF;
-
-        rotx = x*data->cell[0][0] + y*data->cell[1][0] + z*data->cell[2][0];
-        roty = x*data->cell[0][1] + y*data->cell[1][1] + z*data->cell[2][1];
-        rotz = x*data->cell[0][2] + y*data->cell[1][2] + z*data->cell[2][2];
-
-        ts->coords[3*i  ] = data->rotmat[0][0]*rotx + data->rotmat[0][1]*roty + data->rotmat[0][2]*rotz;
-        ts->coords[3*i+1] = data->rotmat[1][0]*rotx + data->rotmat[1][1]*roty + data->rotmat[1][2]*rotz;
-        ts->coords[3*i+2] = data->rotmat[2][0]*rotx + data->rotmat[2][1]*roty + data->rotmat[2][2]*rotz;
-      }
-      vasp_timestep_unitcell(ts, data);
-      return MOLFILE_SUCCESS;
-    }
-  }
-
-  return MOLFILE_EOF;
-}
-
-
-static void close_vaspxml_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xml";
-  plugin.prettyname = "VASP_xml";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "xml";
-  plugin.open_file_read = open_vaspxml_read;
-  plugin.read_structure = read_vaspxml_structure;
-  plugin.read_next_timestep = read_vaspxml_timestep;
-  plugin.close_file_read = close_vaspxml_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vmddir.h b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vmddir.h
deleted file mode 100644
index f6b10d278179623ffbf4aec8ab3d9b775552fb3c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vmddir.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vmddir.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.12 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#include <windows.h>
-
-typedef struct {
-  HANDLE h;
-  WIN32_FIND_DATA fd;
-} VMDDIR;
-
-#else
-#include <dirent.h>
-
-typedef struct {
-  DIR * d;
-} VMDDIR;
-#endif
-
-
-
-static VMDDIR * vmd_opendir(const char *);
-static char * vmd_readdir(VMDDIR *);
-static void vmd_closedir(VMDDIR *);
-static int vmd_file_is_executable(const char * filename);
-
-
-#define VMD_FILENAME_MAX 1024
-
-#if defined(_MSC_VER) || defined(__MINGW32__) 
-
-/* Windows version */
-
-static VMDDIR * vmd_opendir(const char * filename) {
-  VMDDIR * d;
-  char dirname[VMD_FILENAME_MAX];
-
-  strcpy(dirname, filename);
-  strcat(dirname, "\\*");
-  d = (VMDDIR *) malloc(sizeof(VMDDIR));
-  if (d != NULL) {
-#if _MSC_VER < 1400 || !(defined(UNICODE) || defined(_UNICODE))
-    d->h = FindFirstFile(dirname, &(d->fd));
-#else
-    wchar_t szBuff[VMD_FILENAME_MAX];
-    swprintf(szBuff, L"%p", dirname);
-    d->h = FindFirstFile(szBuff, &(d->fd));
-#endif
-    if (d->h == ((HANDLE)(-1))) {
-      free(d);
-      return NULL;
-    }
-  }
-  return d;
-}
-
-static char * vmd_readdir(VMDDIR * d) {
-  if (FindNextFile(d->h, &(d->fd))) {
-#if _MSC_VER < 1400 || !(defined(UNICODE) || defined(_UNICODE))
-    return d->fd.cFileName;
-#else
-    int len = wcslen(d->fd.cFileName);
-    char* ascii = new char[len + 1];
-    wcstombs(ascii, d->fd.cFileName, len);
-    return ascii;
-#endif
-  }
-  return NULL;     
-}
-
-static void vmd_closedir(VMDDIR * d) {
-  if (d->h != NULL) {
-    FindClose(d->h);
-  }
-  free(d);
-}
-
-
-static int vmd_file_is_executable(const char * filename) {
-  FILE * fp;
-  if ((fp=fopen(filename, "rb")) != NULL) {
-    fclose(fp);
-    return 1;
-  }
-
-  return 0;
-} 
-
-#else
-
-/* Unix version */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-static VMDDIR * vmd_opendir(const char * filename) {
-  VMDDIR * d;
-
-  d = (VMDDIR *) malloc(sizeof(VMDDIR));
-  if (d != NULL) {
-    d->d = opendir(filename);
-    if (d->d == NULL) {
-      free(d);
-      return NULL;
-    }
-  }
-
-  return d;
-}
-
-static char * vmd_readdir(VMDDIR * d) {
-  struct dirent * p;
-  if ((p = readdir(d->d)) != NULL) {
-    return p->d_name;
-  }
-
-  return NULL;     
-}
-
-static void vmd_closedir(VMDDIR * d) {
-  if (d->d != NULL) {
-    closedir(d->d);
-  }
-  free(d);
-}
-
-
-static int vmd_file_is_executable(const char * filename) {
-  struct stat buf;
-  if (!stat(filename, &buf)) {
-    if (buf.st_mode & S_IXUSR || 
-        buf.st_mode & S_IXGRP ||
-        buf.st_mode & S_IXOTH) {
-      return 1;
-    }
-  }
-  return 0;
-} 
-
-#endif
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vtfplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vtfplugin.c
deleted file mode 100644
index 58c1f6d405b203f653a691ef33e8d3ad96ac9b24..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vtfplugin.c
+++ /dev/null
@@ -1,1356 +0,0 @@
-/* VTF plugin by Olaf Lenz <olaf@lenz.name> and Henri Menke */
-/* $Id: vtfplugin.c,v 1.18 2014/02/04 17:00:35 johns Exp $ */
-
-/*
-VMD file reader plugin for:
-- VTF structure format (VSF)
-- VTF coordinate format (VCF)
-- VTF trajectory format (VTF)
-
-This code has two main entry points. The functions used in
-VMDPLUGIN_init() are the entry points for the VMD plugin API, while
-the function vtf_parse_userdata is the entry point when the plugin is
-called from the Tcl module "vtftools.tcl" to allow reading in userdata
-into Tcl data structures.
-*/
-#ifdef _MSC_VER
-/* Turn off annoying Windows warnings. */
-#define _CRT_SECURE_NO_WARNINGS
-#define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-#include <molfile_plugin.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <ctype.h>
-#include <string.h>
-
-#ifdef _USE_TCL
-#include <tcl.h>
-#endif
-#ifdef _USE_ZLIB
-#include <zlib.h>
-#define VTFFILE gzFile
-#define fopen gzopen
-#define feof gzeof
-#define fgets(buf,size,file) gzgets(file,buf,size)
-#define fclose gzclose
-#else
-#define VTFFILE FILE*
-#endif
-
-#ifdef _MSC_VER
-#define strdup _strdup
-#endif
-
-#define VERSION_MAJOR 2
-#define VERSION_MINOR 4
-
-/* TODO:
-- volumetric/graphics format
-- file write support
-*/
-
-/***************************************************
- * Data structures
- ***************************************************/
-/* Default atom. 
-   Used by vtf_parse_atom to initialize new atoms. */
-static molfile_atom_t default_atom;
-char* default_userdata;
-const char *molid;
-const char* userdata_varname;
-#ifdef _USE_TCL
-Tcl_Interp *tcl_interp;
-#endif
-
-#define VTF_MOLFILE 0
-#define VTF_USERDATA 1
-
-/* Plugin data structure to communciate data between the functions. */
-typedef struct {
-  /* opened file */
-  VTFFILE file;
-  /* return code */
-  int return_code;
-  /* read mode */
-  int read_mode;
-
-  /* STRUCTURE DATA (used by read_structure) */
-  /* atom info */
-  int natoms;
-  molfile_atom_t *atoms;
-  int optflags;
-
-  /* bond info */
-  int nbonds;
-  int *from;
-  int *to;
-
-  /* TIMESTEP DATA (used by read_next_timestep) */
-  unsigned int timestep;
-  /* reading mode for the next timestep */
-  int timestep_mode;
-  /* last timestep data */
-  float A, B, C, alpha, beta, gamma;
-  float *coords;
-} vtf_data;
-
-/* constants for timestep_mode */
-#define TIMESTEP_INDEXED 0
-#define TIMESTEP_ORDERED 1
-#define TIMESTEP_VCFSTART 2
-
-/* global variable: contains the line number of the file */
-static int vtf_lineno = 0;
-
-#ifdef _USE_TCL
-/* Make the atom userdata available to Tcl. */
-void vtf_set_atom_userdata(const int aid, const char* userdata) {
-  static char array_index[255];
-  if (userdata == NULL) return;
-  sprintf(array_index, "%s.atom.%d", molid, aid);
-  Tcl_SetVar2(tcl_interp, userdata_varname, array_index, userdata, 0);
-}
-
-/* Make the timestep userdata available to Tcl. */
-void vtf_set_timestep_userdata(const unsigned int timestep,
-                               const char* userdata) {
-  static char array_index[255];
-  if (userdata == NULL || strlen(userdata) == 0) return;
-  sprintf(array_index, "%s.step%d", molid, timestep);
-  Tcl_SetVar2(tcl_interp, userdata_varname, array_index, userdata, 0);
-}
-
-/* Make the coordinate userdata available to Tcl. */
-void vtf_set_coordinate_userdata(const unsigned int timestep, 
-                                 const int aid, 
-                                 const char* userdata) {
-  static char array_index[255];
-  if (userdata == NULL || strlen(userdata) == 0) return;
-  sprintf(array_index, "%s.step%d.%d", molid, timestep, aid);
-  Tcl_SetVar2(tcl_interp, userdata_varname, array_index, userdata, 0);
-}
-#endif
-
-/***************************************************
- * Print an error message.
- ***************************************************/
-static void vtf_error(const char *msg, const char *line) {
-  char message[255];
-  sprintf(message, "vtfplugin:%d: error: %s: \"%s\"\n",    
-          vtf_lineno, msg, line);
-
-/* #if vmdplugin_ABIVERSION > 13 */
-/*   if (cons_fputs) */
-/*     cons_fputs(VMDCON_ERROR, message); */
-/*   else */
-/* #else */
-  printf("%s", message);
-/* #endif */
-}
-
-/***************************************************
- * Free malloced memory, checking for NULL
- ***************************************************/
-static void sfree(void* ptr) {
-  if (ptr != NULL) free(ptr);
-}
-
-/***************************************************
- * Read a line
- ***************************************************/
-
-/* Read a whole line from the file. 
-   The line may have arbitrary length and continuation lines ending
-   with '\' are heeded.
-   The function will return a pointer to a buffer or NULL if an
-   error occured or eof occurs while no characters have been read.
-   The function will set the global variable lineno.
-*/
-static char *vtf_getline(VTFFILE file) {
-  static char *buffer = NULL;
-  static int buffer_size = 0;
-  char *s;   /* pointer to the place where the line will be read to */
-  int bytes_left;              /* the number of bytes that are left */
-  int l;
-
-  if (buffer == NULL) {
-    buffer_size = 255;
-    buffer = malloc(buffer_size);
-    /* TODO: error handling */
-  }
-
-  /* Point s to the beginning of buffer. */
-  s = buffer;
-  bytes_left = buffer_size;
-
-  if (feof(file)) {
-    sfree(buffer);
-    buffer = NULL;
-    return NULL;
-  }
-  do {
-    /* read a line */
-    if (fgets(s, bytes_left, file) == NULL) {
-      sfree(buffer);
-      buffer = NULL;
-      return NULL;
-    }
-
-    vtf_lineno++;
-
-    /* if we reached eof, finish */
-    if (feof(file)) break;
-
-    /* pos of the last char */
-    l = strlen(s) - 1;
-    if (l >= 0 && ( s[l] == '\n' || s[l] == '\r')) {
-      l--;
-      /* remove all line endings */
-      while (l >= 0 && (s[l] == '\n' || s[l] == '\r')) l--;
-      /* overwrite the first line ending char */
-      s[l+1] = '\0';
-      /* check the previous char, whether it is '\' */
-      if (l >= 0 && s[l] == '\\') {
-        /* last char before is continuation char */
-        /* position s to the continuation char */
-        bytes_left -= l+1;
-        s += l+1;
-      } else 
-        /* otherwise, the line is complete */
-        break;
-    } else {
-      /* last char is not a newline */
-      /* enlarge the buffer */
-      buffer_size += 255;
-      buffer = realloc(buffer, buffer_size);
-      /* TODO: error handling */
-      /* reposition s */
-      l = strlen(buffer);
-      s = buffer + l;
-      bytes_left += buffer_size - l;
-      vtf_lineno--;
-    }
-  } while (1);
-
-  /* now check the whole string */
-  s = buffer;
-  
-  /* skip all leading whitespace */
-  while (isspace(s[0])) s++;
-
-  /* ignore comment lines */
-  if (s[0] == '#') return vtf_getline(file);
-
-  l = strlen(s);
-
-  /* handle empty lines */
-  if (l == 0) {
-    if (feof(file)) {
-      sfree(buffer);
-      buffer = NULL;
-      return NULL;
-    }
-    else return vtf_getline(file);
-  }
-
-  return s;
-}
-
-/***************************************************
- * Parse ATOM
- ***************************************************/
-/* Create new atoms so that after the call max_aid atoms are there */
-static void vtf_create_atoms_as_needed(int max_aid, vtf_data *d) {
-  /* create new atoms as needed */
-  if (d->natoms < max_aid+1) {
-    int aid;
-      /* fill up with default atoms */
-      d->atoms = realloc(d->atoms, (max_aid+1)*sizeof(molfile_atom_t));
-      for (aid = d->natoms; aid <= max_aid; aid++)
-        d->atoms[aid] = default_atom;
-      d->natoms = max_aid+1;
-#ifdef _USE_TCL
-    if (d->read_mode != VTF_MOLFILE) {
-      /* fill up with default userdata */
-      for (aid = d->natoms; aid <= max_aid; aid++)
-        vtf_set_atom_userdata(aid, default_userdata);
-    }
-#endif
-  }
-}
-
-/* Parse the aid specifier.
-   Return an integer list of the aids that need to be modifed. The
-   list is terminated by -1. If the list is NULL, an error occured. If
-   the list is empty (i.e. it only contains -1), the default atom is
-   to be modified.
- */
-static int *vtf_parse_aid_specifier(char *s, vtf_data *d) {
-  int n;
-  unsigned int aid, from, to, offset;
-  unsigned int size = 0;
-  int *aid_list = NULL;
-
-  if (s[0] == 'd') {
-    /* DEFAULT */
-    /* if the specifier is "default", just leave the list empty! */
-#ifdef DEBUG
-    printf("%s", "\tdefine default atom\n");
-#endif
-  } else {
-    /* otherwise parse the aid specifier */
-    while (1) {
-      from = d->natoms;
-
-      if (sscanf(s, " %u:%u%n", &from, &to, &n) == 2) {
-        /* RANGE */
-        if (from > to) { 
-          vtf_error("bad range specifier (from > to):", s); 
-          sfree(aid_list);
-          return NULL;
-        }
-        vtf_create_atoms_as_needed(to, d);
-        /* add the range to the aid list */
-        offset = size;
-        size += to-from+1;
-        aid_list = realloc(aid_list, size*sizeof(int));
-        for (aid = from; aid <= to; aid++) {
-          aid_list[offset] = aid;
-          offset++;
-        }
-
-      } else if (sscanf(s, " %u%n", &to, &n) == 1) {
-        /* SINGLE AID */
-        vtf_create_atoms_as_needed(to, d);
-        /* add the aid to the aid_list */
-        size += 1;
-        aid_list = realloc(aid_list, size*sizeof(int));
-        aid_list[size - 1] = to;
-
-      } else {
-        /* ERROR */
-        vtf_error("bad aid specifier", s);
-        sfree(aid_list);
-        return NULL;
-      }
-
-      /* advance s */
-      s += n;
-
-      /* if there is no more to parse, break */
-      if (s[0] == '\0') break;
-
-      /* otherwise the next char should be a ',' */
-      if (s[0] != ',') {
-        vtf_error("bad aid specifier", s);
-        sfree(aid_list);
-        return NULL;
-      }
-      /* skip the ',' */
-      s++;
-    };
-  }
-
-  /* Terminate the list with -1 */
-  aid_list = realloc(aid_list, (size+1)*sizeof(int));
-  aid_list[size] = -1;
-  return aid_list;
-}
-
-/* Parse atom data from line. 
-   Return MOLFILE_SUCCESS, if data was sucessfully parsed, 
-   MOLFILE_ERROR if an error occured. */
-static int vtf_parse_atom(char *line, vtf_data *d) {
-  static molfile_atom_t atom;
-  static char keyword[255];
-  static char msg[255];
-  static char aid_specifier[255];
-  int n;
-  char *s;
-  int rest_is_userdata;
-  int *aid_list = NULL;
-
-  atom = default_atom;
-  s = line;
-
-#ifdef DEBUG
-  printf("\tatom record\n");
-  printf("line: %s\n", s);
-#endif
-
-  /* HANDLE THE AID SPECIFIER */
-
-  /* save the aid specifier */
-  if (sscanf(s, " %255s%n", aid_specifier, &n) < 1) {
-    vtf_error("atom specifier is missing", line);
-    return MOLFILE_ERROR;
-  }
-  s += n;
-
-  aid_list = vtf_parse_aid_specifier(aid_specifier, d);
-  if (aid_list == NULL) return MOLFILE_ERROR;
-
-  /* A -1 in the aid_list denotes the end of the list */
-#define AIDLOOP(assignment)                                             \
-  {                                                                     \
-    int *aid_ptr;                                                       \
-    for (aid_ptr = aid_list; *aid_ptr != -1; aid_ptr++) {               \
-      int aid = *aid_ptr;                                               \
-      molfile_atom_t *cur_atom = &d->atoms[aid];                        \
-      assignment;                                                       \
-    }                                                                   \
-  }
-  
-  /* handle the keywords */
-  rest_is_userdata = 0;
-  while (sscanf(s, " %255s%n", keyword, &n) == 1) {
-    s += n;
-#ifdef DEBUG
-    printf("keyword: \"%s\" rest: \"%s\"\n", keyword, s);
-#endif
-    switch (tolower(keyword[0])) {
-    case 'n': {
-      /* name */
-      if (sscanf(s, " %16s%n", atom.name, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->name, atom.name));
-      } else {
-        vtf_error("could not get name in atom record", line);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 't': {
-      /* type */
-      if (sscanf(s, " %16s%n", atom.type, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->type, atom.type));
-      } else {
-        vtf_error("could not get type in atom record", line);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'r': {
-      /* resname, resid, radius */
-      if (strlen(keyword) == 1 || 
-          strncmp(keyword, "rad", 3) == 0) { 
-        /* radius */
-        if (sscanf(s, " %f%n", &atom.radius, &n) == 1) {
-          AIDLOOP(cur_atom->radius = atom.radius);
-        } else {
-          vtf_error("could not get radius in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_RADIUS;
-      } else if (strcmp(keyword, "resid") == 0) {
-        /* resid */
-        if (sscanf(s, " %d%n", &atom.resid, &n) == 1) {
-          AIDLOOP(cur_atom->resid = atom.resid);
-        } else {
-          vtf_error("could not get resid in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-      } else if (strcmp(keyword, "res") == 0 || 
-                 strcmp(keyword, "resname") == 0) {
-        /* resname */
-        if (sscanf(s, " %8s%n", atom.resname, &n) == 1) {
-          AIDLOOP(strcpy(cur_atom->resname, atom.resname));
-        } else {
-          vtf_error("could not get resname in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-      } else {
-        strcpy(msg, "unrecognized keyword in atom record: ");
-        strncat(msg, keyword, 200);
-        vtf_error(msg, line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 's': {
-      /* segid */
-      if (sscanf(s, " %8s%n", atom.segid, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->segid, atom.segid));
-      } else {
-        vtf_error("could not get segid in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'i': {
-      /* insertion */
-      if (sscanf(s, " %2s%n", atom.insertion, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->insertion, atom.insertion));
-      } else {
-        vtf_error("could not get insertion in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_INSERTION;
-      s += n;
-      break;
-    }
-    case 'c': {
-      /* chain, charge */
-      if (strlen(keyword) == 1 || 
-          strcmp(keyword, "chain") == 0) {
-        if (sscanf(s, " %2s%n", atom.chain, &n) == 1) {
-          AIDLOOP(strcpy(cur_atom->chain, atom.chain));
-          s += n;
-          break;
-        } else {
-          vtf_error("could not get chain in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-      }
-    } /* if "chain" is not recognized, continue with next case */
-    case 'q': {
-      /* q and charge */
-      if (strlen(keyword) == 1 ||
-          strcmp(keyword, "charge") == 0) {
-        if (sscanf(s, " %f%n", &atom.charge, &n) == 1) {
-          AIDLOOP(cur_atom->charge = atom.charge);
-        } else {
-          vtf_error("could not get charge in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_CHARGE;
-      } else {
-        strcpy(msg, "unrecognized keyword in atom record: ");
-        strncat(msg, keyword, 200);
-        vtf_error(msg, line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'a': {
-      /* altloc, atomicnumber */
-      if (strlen(keyword)== 1 || 
-          strcmp(keyword, "atomicnumber") == 0) {
-        if (sscanf(s, " %d%n", &atom.atomicnumber, &n) == 1) {
-          AIDLOOP(cur_atom->atomicnumber = atom.atomicnumber);
-        } else {
-          vtf_error("could not get atomicnumber in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_ATOMICNUMBER;
-      } else if (strcmp(keyword, "altloc")) {
-        if (sscanf(s, " %2s%n", atom.altloc, &n) == 1) {
-          AIDLOOP(strcpy(cur_atom->altloc, atom.altloc));
-        } else {
-          vtf_error("could not get altloc in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_ALTLOC;
-      } else { 
-        strcpy(msg, "unrecognized keyword in atom record: ");
-        strncat(msg, keyword, 200);
-        vtf_error(msg, line);
-          sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'o': {
-      /* occupancy */
-      if (sscanf(s, " %f%n", &atom.occupancy, &n) == 1) {
-        AIDLOOP(cur_atom->occupancy = atom.occupancy);
-      } else {
-        vtf_error("could not get occupancy in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_OCCUPANCY;
-      s += n;
-      break;
-    }
-    case 'b': {
-      /* bfactor */
-      if (sscanf(s, " %f%n", &atom.bfactor, &n) == 1) {
-        AIDLOOP(cur_atom->bfactor = atom.bfactor);
-      } else {
-        vtf_error("could not get bfactor in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_BFACTOR;
-      s += n;
-      break;
-    }
-    case 'm': {
-      /* mass */
-      if (sscanf(s, " %f%n", &atom.mass, &n) == 1) {
-        AIDLOOP(cur_atom->mass = atom.mass);
-      } else {
-        vtf_error("could not get mass in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_MASS;
-      s += n;
-      break;
-    }
-    case 'u': {
-      /* userdata: the rest of the line is user data */
-      rest_is_userdata = 1;
-#ifdef _USE_TCL
-      if (d->read_mode != VTF_MOLFILE) {
-        AIDLOOP(vtf_set_atom_userdata(aid, s));
-      }
-#endif
-      break;
-    }
-    default: { 
-      /* unrecognized */
-      strcpy(msg, "unrecognized keyword in atom record: ");
-      strncat(msg, keyword, 200);
-      vtf_error(msg, line);
-      sfree(aid_list);
-      return MOLFILE_ERROR;
-    }
-    }
-    if (rest_is_userdata) break;
-  }
-
-  /* if the aid_list is empty, modify the default atom */
-  if (*aid_list == -1) {
-      default_atom = atom;
-      if (d->read_mode != VTF_MOLFILE) {
-        sfree(default_userdata);
-        default_userdata = strdup(s);
-      }
-  }
-
-  sfree(aid_list);
-
-#ifdef DEBUG
-  printf("\tparsed keywords\n");
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-/***************************************************
- * Parse BOND
- ***************************************************/
-/* Parse bond data from line.  Called by vtf_parse_structure(). Return
-   MOLFILE_SUCCESS, if data was sucessfully parsed, MOLFILE_ERROR if
-   an error occured. */
-static int vtf_parse_bond(char *line, vtf_data *d) {
-  char *s;
-  int n;
-  unsigned int from, to, aid, bid;
-
-  s = line;
-
-  while (1) {
-    if (sscanf(s, " %u::%u%n", &from, &to, &n) == 2) {
-      /* chain specifier */
-      if (from > to) {
-        vtf_error("bad chain specifier (from > to):", s); 
-        return MOLFILE_ERROR;
-      }
-      bid = d->nbonds;
-      d->nbonds += to-from;
-      d->from = realloc(d->from, d->nbonds*sizeof(int));
-      d->to = realloc(d->to, d->nbonds*sizeof(int));
-      /* TODO: error handling */
-      for (aid = from; aid < to; aid++) {
-        /*printf("creating bond from %d to %d\n", aid, aid+1);*/
-        d->from[bid] = aid+1;
-        d->to[bid] = aid+2;
-        bid++;
-      }
-    } else if (sscanf(s, " %u:%u%n", &from, &to, &n) == 2) {
-      /* single bond specifier */
-      d->nbonds += 1;
-      d->from = realloc(d->from, d->nbonds*sizeof(int));
-      d->to = realloc(d->to, d->nbonds*sizeof(int));
-      /* TODO: error handling */
-      d->from[d->nbonds-1] = from+1;
-      d->to[d->nbonds-1] = to+1;
-    } else {
-      vtf_error("bad bond specifier", s);
-      return MOLFILE_ERROR;
-    }
-
-    s += n;
-    
-    /* if there is no more to parse, break */
-    if (strlen(s) == 0) break;
-    
-    /* otherwise the next char should be a ',' */
-    if (s[0] != ',') {
-      vtf_error("bad bond specifier in line", line);
-      return MOLFILE_ERROR;
-    }
-    /* skip the ',' */
-    s++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***************************************************
- * Parse PBC
- ***************************************************/
-/* Parse periodic boundary condition data from line. Called by
-   vtf_parse_structure().  Return MOLFILE_SUCCESS, if data was
-   sucessfully parsed, MOLFILE_ERROR if an error occured. */
-static int vtf_parse_pbc(char *line, vtf_data *d) {
-  char *s;
-  int n = 0;
-
-  if (sscanf(line, " %f %f %f%n", &d->A, &d->B, &d->C, &n) < 3) {
-    s = line;
-    vtf_error("Couldn't parse unit cell dimensions", s);
-    return MOLFILE_ERROR;
-  }
-  s = line + n;
-
-  n = sscanf(s, " %f %f %f", &d->alpha, &d->beta, &d->gamma);
-  if (n > 0 && n < 3) {
-    vtf_error("Couldn't parse unit cell angles", line);
-    return MOLFILE_ERROR;
-  }
-  return MOLFILE_SUCCESS;
-} 
-
-/* Parse timestep command from line. Called by vtf_parse_structure().
-   Return MOLFILE_SUCCESS, if it was sucessfully parsed, MOLFILE_ERROR
-   if an error occured. */
-static int vtf_parse_timestep(char *line, vtf_data *d) {
-  while (strlen(line) > 0 && isspace(line[0])) line++;
-  if (strlen(line) == 0) {
-    d->timestep_mode = TIMESTEP_ORDERED;
-  } else {
-    switch (tolower(line[0])) {
-    case 'o': { d->timestep_mode = TIMESTEP_ORDERED; break; }
-    case 'i': { d->timestep_mode = TIMESTEP_INDEXED; break; }
-    default: {
-      vtf_error("bad timestep line", line);
-      return MOLFILE_ERROR;
-    }
-    }
-  }
-  return MOLFILE_SUCCESS;
-}
-
-/* Called by _vtf_open_file_read() to parse the structure data. */
-static void vtf_parse_structure(vtf_data *d) {
-  char *line;                   /* next line in the file */
-  char s[255];
-  int n;
-  
-  /* initialize the default atom */
-  strcpy(default_atom.name, "X");
-  strcpy(default_atom.type, "X");
-  strcpy(default_atom.resname, "X");
-  default_atom.resid = 0;
-  strcpy(default_atom.segid, "");
-  strcpy(default_atom.chain, "");
-
-  strcpy(default_atom.altloc, "");
-  strcpy(default_atom.insertion, "");
-  default_atom.occupancy = 1.0;
-  default_atom.bfactor = 1.0;
-  default_atom.mass = 1.0;
-  default_atom.charge = 0.0;
-  default_atom.radius = 1.0;
-
-  default_userdata = NULL;
-
-  do {
-    line = vtf_getline(d->file);
-    if (line == NULL) break;
-#ifdef DEBUG
-    printf("parsing line %d: \"%s\"\n", vtf_lineno, line);
-#endif
-    switch (tolower(line[0])) {
-      /* ATOM RECORD */
-    case 'a': {
-      /* Remove the "atom" keyword" */
-     sscanf(line, " %255s%n", s, &n);
-      line += n;
-    }
-    case '0':
-    case '1':
-    case '2':
-    case '3':
-    case '4':
-    case '5':
-    case '6':
-    case '7':
-    case '8':
-    case '9':   
-    case 'd': { 
-      /* parse atom */
-      d->return_code = vtf_parse_atom(line, d);
-      break; 
-    }
-
-      /* BOND RECORD */
-    case 'b': {
-      /* Remove the "bond" keyword" */
-      sscanf(line, " %255s%n", s, &n);
-      line += n;
-      d->return_code = vtf_parse_bond(line, d);
-      break;
-    }
-
-      /* PBC/UNITCELL RECORD */
-    case 'u':
-    case 'p': {
-      /* Remove the "pbc"/"unitcell" keyword */
-      sscanf(line, " %255s%n", s, &n);
-      line += n;
-      d->return_code = vtf_parse_pbc(line, d);
-      break;
-    }
-
-      /* TIMESTEP RECORD*/
-    case 'c': 
-    case 't': {
-      /* Remove the "timestep" or "coordinates" keyword */
-      sscanf(line, " %255s%n", s, &n);
-      line += n;
-    }
-    case 'i': 
-    case 'o': { 
-      d->return_code = vtf_parse_timestep(line, d);
-      line = NULL; /* indicate the end of the structure block */
-      break; 
-    }
-
-      /* UNKNOWN RECORD */
-    default: {
-      vtf_error("unknown line type", line);
-      d->return_code = MOLFILE_ERROR;
-      break;
-    }
-    }
-  } while (line != NULL && 
-           d->return_code == MOLFILE_SUCCESS);
-
-  /* test if structure data was parsed */
-  if (d->read_mode == VTF_MOLFILE &&
-      d->atoms == NULL && 
-      d->return_code == MOLFILE_SUCCESS) {
-    d->return_code = MOLFILE_NOSTRUCTUREDATA;
-  }
-
-  /* test whether another error has occured */
-  if (errno != 0) {
-    perror("vtfplugin");
-    d->return_code = MOLFILE_ERROR;
-  }
-
-  sfree(default_userdata);
-}
-
-/***************************************************
- * Open file and parse structure info
- ***************************************************/
-/* Opens the file for reading.  To determine the number of atoms in
-   the file, it is necessary to parse the structure information,
-   anyway. Therefore, this function will parse the structure data and
-   save the information in the plugin's data structure.
-
-   The read_mode defines whether the file is read from VMD via the
-   plugin API (VTF_MOLFILE) to read structure and timestep data, or
-   via the vtftools to read userdata (VTF_USERDATA).
-
-   The function vtf_open_file_read() that is actually called by the
-   molfile reader plugin is defined below this function.
-*/
-static vtf_data *
-_vtf_open_file_read(const char *filepath, 
-                    const char *filetype, 
-                    int *natoms,
-                    int read_mode) {
-  vtf_data *d;
-
-  /* printf("Loading file %s\n  of type %s using vtfplugin v%i.%i.\n", 
-     filepath, filetype, VERSION_MAJOR, VERSION_MINOR); */
-
-  /* initialize the data structure */
-  d = malloc(sizeof(vtf_data));
-  
-  errno = 0;
-
-  d->return_code = MOLFILE_SUCCESS;
-  d->read_mode = read_mode;
-
-  /* initialize structure data */
-  d->optflags = MOLFILE_NOOPTIONS;
-  d->natoms = 0;
-  d->atoms = NULL;
-  d->nbonds = 0;
-  d->from = NULL;
-  d->to = NULL;
-
-  /* initialize timestep data */
-  d->timestep = 0;
-  d->timestep_mode = TIMESTEP_ORDERED;
-  d->coords = NULL;
-  d->A = 0.0;
-  d->B = 0.0;
-  d->C = 0.0;
-  d->alpha = 90.0;
-  d->beta = 90.0;
-  d->gamma = 90.0;
-
-  /* Open the file */
-  d->file = fopen(filepath, "rb");
-  if (d->file == NULL) {
-    /* Could not open file */
-    char msg[255];
-    sprintf(msg, "vtfplugin: %s", filepath);
-    perror(msg);
-    sfree(d);
-    return NULL;
-  }
-
-  if (strcmp(filetype, "vcf") == 0) {
-    d->timestep_mode = TIMESTEP_VCFSTART;
-    d->natoms = MOLFILE_NUMATOMS_UNKNOWN;
-    *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-    d->return_code = MOLFILE_NOSTRUCTUREDATA;
-  } else {
-    vtf_parse_structure(d);
-    
-    if (d->return_code != MOLFILE_SUCCESS) {
-      /* close the file */
-      fclose(d->file);
-
-      /* free the data */
-      sfree(d->atoms);
-      sfree(d->coords);
-      sfree(d->from);
-      sfree(d->to);
-      sfree(d);
-      return NULL;
-    }
-   
-    *natoms = d->natoms;
-  }
-
-  return d;
-}
-
-/* This is the function actually called by the molfile reader plugin */
-static void *
-vtf_open_file_read(const char *filepath, 
-                   const char *filetype, 
-                   int *natoms) {
-  return _vtf_open_file_read(filepath, filetype, natoms, VTF_MOLFILE);
-}
-
-/* */
-static void vtf_close_file_read(void *data) {
-  vtf_data *d;
-
-  if (data == NULL) return;
-  d = (vtf_data*)data;
-
-  /* printf("Finished reading file.\n"); */
-
-  /* close the file */
-  fclose(d->file);
-
-  /* free the data */
-  sfree(d->coords);
-  sfree(d->from);
-  sfree(d->to);
-  sfree(d);
-}
-
-/* Read the next timestep from the file and store what has been read
-   into the ts datastructure. */
-static int vtf_read_next_timestep(void *data, 
-                                  int natoms, 
-                                  molfile_timestep_t *ts) {
-  vtf_data *d;
-  char *line;
-  static char s[255];
-  float x,y,z;
-  unsigned int aid;
-  int n;
-
-  if (data == NULL) {
-    vtf_error("Internal error: data==NULL in vtf_read_next_timestep", 0);
-    return MOLFILE_ERROR;
-  }
-
-  if (natoms <= 0) {
-    vtf_error("Internal error: natoms <= 0 in vtf_read_next_timestep", 0);
-    return MOLFILE_ERROR;
-  }
-
-  errno = 0;
-
-  d = (vtf_data*)data;
-
-  aid = 0;
-
-  if (feof(d->file)) return MOLFILE_EOF;
-
-  if (d->coords == NULL) {
-    /* initialize coords */
-    d->coords = malloc(natoms*3*sizeof(float));
-    /* TODO: error handling */
-    for (n = 0; n < natoms*3; n++)
-      d->coords[n] = 0.0;
-  } 
-  
-  /* read in the data, until the next timestep or EOF is reached */
-  do {
-    line = vtf_getline(d->file);
-
-    if (line == NULL) {
-      if (errno != 0) {
-        perror("vtfplugin");
-        return MOLFILE_ERROR;
-      }
-      break;
-    } 
-
-    /* At the beginning of a vcf file, skip a timestep line */
-    if (d->timestep_mode == TIMESTEP_VCFSTART) {
-      switch (tolower(line[0])) {
-      case 'c': 
-      case 't':
-        /* Remove the "timestep" or "coordinates" keyword */
-        sscanf(line, " %255s%n", s, &n);
-        line += n;
-      case 'i': 
-      case 'o': 
-        if (vtf_parse_timestep(line, d) != MOLFILE_SUCCESS)
-          return MOLFILE_ERROR;
-        line = vtf_getline(d->file);
-        break;
-      default:
-        /* if this is already a coordinate line, expect an ordered block */
-        d->timestep_mode = TIMESTEP_ORDERED;
-      }
-    }
-
-    /* parse timestep data */
-    if (d->timestep_mode == TIMESTEP_ORDERED 
-        && sscanf(line, " %f %f %f%n", &x, &y, &z, &n) == 3) {
-      if (aid < (unsigned int)natoms) {
-        d->coords[aid*3] = x;
-        d->coords[aid*3+1] = y;
-        d->coords[aid*3+2] = z;
-#ifdef _USE_TCL
-        if (d->read_mode == VTF_USERDATA) {
-          /* the rest of the line is userdata */
-          line += n;
-          vtf_set_coordinate_userdata(d->timestep, aid, line);
-        }
-#endif
-        aid++;
-      } else {
-        vtf_error("too many atom coordinates in ordered timestep block", line);
-        return MOLFILE_ERROR;
-      }
-    } else if (d->timestep_mode == TIMESTEP_INDEXED 
-               && sscanf(line, " %u %f %f %f%n", 
-                         &aid, &x, &y, &z, &n) == 4) {
-      if (aid < (unsigned int)natoms) {
-        d->coords[aid*3] = x;
-        d->coords[aid*3+1] = y;
-        d->coords[aid*3+2] = z;
-#ifdef _USE_TCL
-        if (d->read_mode == VTF_USERDATA) {
-          /* the rest of the line is userdata */
-          line += n;
-          vtf_set_coordinate_userdata(d->timestep, aid, line);
-        }
-#endif
-      } else {
-        vtf_error("atom id too large in indexed timestep block", line);
-        return MOLFILE_ERROR;
-      }
-    } else switch (tolower(line[0])) {
-        /* PBC/UNITCELL RECORD */
-      case 'u':
-      case 'p': {
-        /* Remove the "pbc"/"unitcell" keyword */
-        sscanf(line, " %255s%n", s, &n);
-        line += n;
-        if (vtf_parse_pbc(line, d) != MOLFILE_SUCCESS) 
-          return MOLFILE_ERROR;
-        break;
-      }
-
-        /* USER DATA RECORD */
-      case 'd': {
-        /* Remove the "data" keyword */
-        sscanf(line, " %255s%n", s, &n);
-#ifdef _USE_TCL
-        if (d->read_mode == VTF_USERDATA) {
-          line += n;
-          vtf_set_timestep_userdata(d->timestep, line);
-        }
-#endif
-        break;
-      }
-        
-        /* TIMESTEP RECORD */
-      case 'c': 
-      case 't': {
-        /* Remove the "timestep" or "coordinates" keyword */
-        sscanf(line, " %255s%n", s, &n);
-        line += n;
-      }
-      case 'i': 
-      case 'o': { 
-        if (vtf_parse_timestep(line, d) != MOLFILE_SUCCESS)
-          return MOLFILE_ERROR;
-        line = NULL; /* indicate end of this timestep */
-        d->timestep++;
-        break;
-      }
-        
-      default: { 
-        if (d->timestep_mode == TIMESTEP_INDEXED)
-          vtf_error("unknown line in indexed timestep block", line);
-        else
-          vtf_error("unknown line in ordered timestep block", line);
-        return MOLFILE_ERROR;
-      }
-      }
-
-    if (line == NULL) break;
-  } while (1);
-
-  if (ts != NULL) {
-    /* copy the ts data */
-    ts->A = d->A;
-    ts->B = d->B;
-    ts->C = d->C;
-    ts->alpha = d->alpha;
-    ts->beta = d->beta;
-    ts->gamma = d->gamma;
-    memcpy(ts->coords, d->coords, natoms*3*sizeof(float));
-    ts->velocities = NULL;
-    ts->physical_time = 0.0;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-/***************************************************
- * Copy the info collected in vtf_open_file_read
- ***************************************************/
-static int vtf_read_structure(void *data, 
-                              int *optflags, 
-                              molfile_atom_t *atoms) {
-  vtf_data *d;
-  d = (vtf_data*)data;
-
-  if (d->return_code != MOLFILE_SUCCESS) 
-    return d->return_code;
-
-  if (d->natoms > 0) {
-    /* copy the data parsed in vtf_open_file_read() */
-    memcpy(atoms, d->atoms, d->natoms*sizeof(molfile_atom_t));
-    /* free the data parsed in vtf_open_file_read() */
-    sfree(d->atoms);
-    d->atoms = NULL;
-  }
-
-  *optflags = d->optflags;
-
-  return MOLFILE_SUCCESS;
-}
-
-static int vtf_read_bonds(void *data, 
-                          int *nbonds, 
-                          int **from, 
-                          int **to,
-                          float **bondorder, 
-                          int **bondtype, 
-                          int *nbondtypes, 
-                          char ***bondtypename) {
-  vtf_data *d;
-  if (!data) {
-    vtf_error("Internal error: data==NULL in vtf_read_bonds", 0);
-    return MOLFILE_ERROR;
-  }
-
-  d = (vtf_data*)data;
-
-  *nbonds = d->nbonds;
-  *from = d->from;
-  *to = d->to;
-  *bondorder = NULL;
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***************************************************/
-/* MOLFILE READER PLUGIN PART */
-/***************************************************/
-static molfile_plugin_t vsfplugin;
-static molfile_plugin_t vtfplugin;
-static molfile_plugin_t vcfplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&vsfplugin, 0, sizeof(molfile_plugin_t));
-  vsfplugin.abiversion = vmdplugin_ABIVERSION;
-  vsfplugin.type = MOLFILE_PLUGIN_TYPE;
-  vsfplugin.name = "vsf";
-  vsfplugin.author = "Olaf Lenz";
-  vsfplugin.majorv = VERSION_MAJOR;
-  vsfplugin.minorv = VERSION_MINOR;
-  vsfplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vsfplugin.filename_extension = "vsf";
-  vsfplugin.open_file_read = vtf_open_file_read;
-  vsfplugin.read_structure = vtf_read_structure;
-  vsfplugin.read_bonds = vtf_read_bonds;
-  /* plugin.read_next_timestep = vtf_read_next_timestep; */
-  vsfplugin.close_file_read = vtf_close_file_read;
-#if vmdplugin_ABIVERSION >= 9
-  vsfplugin.prettyname = "VTF structure format";
-#endif
-
-  memset(&vcfplugin, 0, sizeof(molfile_plugin_t));
-  vcfplugin.abiversion = vmdplugin_ABIVERSION;
-  vcfplugin.type = MOLFILE_PLUGIN_TYPE;
-  vcfplugin.name = "vcf";
-  vcfplugin.author = "Olaf Lenz";
-  vcfplugin.majorv = VERSION_MAJOR;
-  vcfplugin.minorv = VERSION_MINOR;
-  vcfplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vcfplugin.filename_extension = "vcf";
-  vcfplugin.open_file_read = vtf_open_file_read;
-  vcfplugin.read_next_timestep = vtf_read_next_timestep;
-  vcfplugin.close_file_read = vtf_close_file_read;
-#if vmdplugin_ABIVERSION >= 9
-  vcfplugin.prettyname = "VTF coordinate format";
-#endif
-
-  memset(&vtfplugin, 0, sizeof(molfile_plugin_t));
-  vtfplugin.abiversion = vmdplugin_ABIVERSION;
-  vtfplugin.type = MOLFILE_PLUGIN_TYPE;
-  vtfplugin.name = "vtf";
-  vtfplugin.author = "Olaf Lenz";
-  vtfplugin.majorv = VERSION_MAJOR;
-  vtfplugin.minorv = VERSION_MINOR;
-  vtfplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vtfplugin.filename_extension = "vtf";
-  vtfplugin.open_file_read = vtf_open_file_read;
-  vtfplugin.read_structure = vtf_read_structure;
-  vtfplugin.read_bonds = vtf_read_bonds;
-  vtfplugin.read_next_timestep = vtf_read_next_timestep;
-  vtfplugin.close_file_read = vtf_close_file_read;
-#if vmdplugin_ABIVERSION >= 9
-  vtfplugin.prettyname = "VTF trajectory format";
-#endif
-
-  /*printf("Loaded VTF/VSF/VCF plugins v%i.%i.\n", VERSION_MAJOR, VERSION_MINOR); */
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&vsfplugin);
-  (*cb)(v, (vmdplugin_t *)&vcfplugin);
-  (*cb)(v, (vmdplugin_t *)&vtfplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-#ifdef _USE_TCL
-/***************************************************/
-/* VTFTOOLS USERDATA PART */
-/***************************************************/
-static int vtf_parse_userdata(ClientData clientData, 
-                              Tcl_Interp *interp, 
-                              int argc, 
-                              const char *argv[]) {
-  /* Usage: vtf_parse_userdata path type */
-  int natoms;
-  const char *file, *type;
-  vtf_data *d;
-  char result[255];
-  int rc;
-
-  if (argc != 5) {
-    sprintf(result, "wrong # args: should be \"%s fileName fileType varName molId\"", argv[0]);
-    Tcl_SetResult(interp, result, TCL_VOLATILE);
-    return TCL_ERROR;
-  }
-
-  file = argv[1];
-  type = argv[2];
-  userdata_varname = argv[3];
-  molid = argv[4];
-  tcl_interp = interp;
-  
-  d = _vtf_open_file_read(file, type, &natoms, VTF_USERDATA);
-  if (d == NULL) {
-    sprintf(result, "%s: an error occured while reading the structure", argv[0]);
-    Tcl_SetResult(interp, result, TCL_VOLATILE);
-    return TCL_ERROR;
-  }
-  
-  do {
-    rc = vtf_read_next_timestep(d, d->natoms, NULL);
-  } while (rc == MOLFILE_SUCCESS);
-
-  sprintf(result, "%s: Read %d atoms and %d timesteps.", 
-          argv[0], d->natoms, d->timestep);
-  Tcl_SetResult(interp, result, TCL_VOLATILE);
-  vtf_close_file_read(d);
-  return TCL_OK;
-}
-
-int Vtfplugin_Init(Tcl_Interp *interp) {
-  char version_string[20];
-
-  /* Set up for stubs. */
-  if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
-    Tcl_SetResult(interp, "Tcl_InitStubs failed", TCL_STATIC);
-    return TCL_ERROR;
-  }
-
-  sprintf(version_string, "%d.%d", VERSION_MAJOR, VERSION_MINOR);
-  if (Tcl_PkgProvide(interp, "vtfplugin", version_string) == TCL_ERROR) {
-    return TCL_ERROR;
-  }
-
-  /* Create the Tcl command. */
-  Tcl_CreateCommand(interp, 
-                    "vtf_parse_userdata", vtf_parse_userdata, 
-                    NULL, NULL);
-  return TCL_OK;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vtkplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vtkplugin.C
deleted file mode 100644
index ad644f980d500b318814ab674530fe78bed46698..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/vtkplugin.C
+++ /dev/null
@@ -1,445 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 2007-2011 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vtkplugin.C,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.5 $      $Date: 2015/10/26 22:14:45 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Plugin for reading uniform grids and vector fields written 
- *   in the VTK ASCII format
- ***************************************************************************/
-
-//
-// Prototype file reader developed using VTK refs and a couple samples:
-//   http://www.vtk.org/Wiki/VTK/Tutorials/3DDataTypes
-//   http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf
-//
-
-// This parser currently expects the data to be formatted like this:
-// # vtk DataFile Version X.0
-// titletext
-// ASCII
-// DATASET STRUCTURED_POINTS
-// DIMENSIONS XXX YYY ZZZ
-// SPACING XX YY ZZ
-// ORIGIN XX YY XX
-// POINT_DATA n
-//
-// And either a field like this:
-// FIELD fieldname numarrays
-// arrayname0 numcomponents numtuples datatype
-// val0 val1 ...
-//
-// Or a list of vectors like this:
-// VECTORS dataname datatype
-// val0 val1 ...
-//
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-#include "largefiles.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define LINESIZE 2040
-
-typedef struct {
-  FILE *fd;
-  char title[257]; /// spec says 256 chars max w/ newline termination
-  int nsets;
-  molfile_volumetric_t *vol;
-  int isBinary; 
-} vtk_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *vtkgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    printf("vtkplugin) Unexpected end-of-file.\n");
-    return NULL;
-  } else if (ferror(stream)) {
-    printf("vtkplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      printf("vtkplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static int vtkgetstrcmp(char *s, int n, FILE *stream, const char *cmpstr) {
-  char *str = vtkgets(s, n, stream);
-  int rc = strncmp(cmpstr, str, strlen(cmpstr));
-  if (rc) {
-    printf("vtkplugin) found '%s', expected '%s'\n", str, cmpstr);
-  }
-  return rc;
-}
-   
-
-static void *open_vtk_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  vtk_t *vtk;
-  char inbuf[LINESIZE];
-  int xsize, ysize, zsize;
-  float orig[3], xdelta[3], ydelta[3], zdelta[3];
- 
-  memset(orig, 0, sizeof(orig));
-  memset(xdelta, 0, sizeof(xdelta));
-  memset(ydelta, 0, sizeof(ydelta));
-  memset(zdelta, 0, sizeof(zdelta));
- 
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    printf("vtkplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // allocate and initialize the vtk structure
-  vtk = new vtk_t;
-  memset(vtk, 0, sizeof(vtk_t));
-  vtk->fd = fd;
-  vtk->vol = NULL;
-  vtk->isBinary = 0;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  vtk->nsets = 1; /* this file contains only one data set */
-
-  /* skip comments */
-  do {
-    if (vtkgets(inbuf, LINESIZE, fd) == NULL) 
-      return NULL;
-  } while (inbuf[0] == '#');
-
-  // read VTK title line 
-  printf("vtkplugin) Dataset title: '%s'\n", inbuf);
-  strncpy(vtk->title, inbuf, sizeof(vtk->title) - 1);
-  vtk->title[256]='\0'; // force-terminate potentially truncated title string
-
-  if (vtkgetstrcmp(inbuf, LINESIZE, fd, "ASCII")) return NULL;
-  if (vtkgetstrcmp(inbuf, LINESIZE, fd, "DATASET STRUCTURED_POINTS")) return NULL;
-
-  // get the grid dimensions
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  if (sscanf(inbuf, "DIMENSIONS %d %d %d", &xsize, &ysize, &zsize) != 3) {
-    printf("vtkplugin) Error reading grid dimensions!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get the grid spacing
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  if (sscanf(inbuf, "SPACING %e %e %e", xdelta, ydelta+1, zdelta+2) != 3) {
-    printf("vtkplugin) Error reading cell dimensions!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get the grid origin
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  if (sscanf(inbuf, "ORIGIN %e %e %e", orig, orig+1, orig+2) != 3) {
-    printf("vtkplugin) Error reading grid origin!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get number of grid points
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  int numgridpoints = 0;
-  if (sscanf(inbuf, "POINT_DATA %d", &numgridpoints) != 1) {
-    printf("vtkplugin) Error reading grid point counts!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get field or vector list depending on file format variant we have
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-
-  char tmp[256];
-  sscanf(inbuf, "%s", tmp);
-  if (!strcmp(tmp, "FIELD")) {
-    char fieldname[256];
-    int numarrays=0;
-    sscanf(inbuf, "FIELD %s %d", fieldname, &numarrays);
-    printf("vtkplugin) FIELD: name '%s', %d arrays\n", fieldname, numarrays);
-
-    // eat the array name for field zero
-    if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-      delete vtk;
-      return NULL;
-    }
-  } else if (!strcmp(tmp, "VECTORS")) {
-    // prepare to eat vectors
-    char fieldname[256];
-    int numvecs=0;
-    sscanf(inbuf, "VECTORS %s %d", fieldname, &numvecs);
-    printf("vtkplugin) VECTORS: name '%s', %d arrays\n", fieldname, numvecs);
-  } else {
-    printf("vtkplugin) Unrecognized file structure, aborting!:\n");
-    printf("vtkplugin) line contents: '%s'\n", inbuf);
-    delete vtk;
-    return NULL;
-  } 
-
-  vtk->vol = new molfile_volumetric_t[1];
-  memset(vtk->vol, 0, sizeof(molfile_volumetric_t));
-  strcpy(vtk->vol[0].dataname, "VTK volumetric map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    vtk->vol[0].origin[i] = orig[i];
-    vtk->vol[0].xaxis[i] = xdelta[i] * ((xsize-1 > 0) ? (xsize-1) : 1);
-    vtk->vol[0].yaxis[i] = ydelta[i] * ((ysize-1 > 0) ? (ysize-1) : 1);
-    vtk->vol[0].zaxis[i] = zdelta[i] * ((zsize-1 > 0) ? (zsize-1) : 1);
-  }
-
-  vtk->vol[0].xsize = xsize;
-  vtk->vol[0].ysize = ysize;
-  vtk->vol[0].zsize = zsize;
-
-#if vmdplugin_ABIVERSION > 16
-  vtk->vol[0].has_scalar = 1;
-  vtk->vol[0].has_gradient = 1;
-  vtk->vol[0].has_variance = 0;
-#endif
-  vtk->vol[0].has_color = 0; // no color data
-
-  return vtk;
-}
-
-
-static int read_vtk_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  vtk_t *vtk = (vtk_t *)v;
-  *nsets = vtk->nsets; 
-  *metadata = vtk->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vtk_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  vtk_t *vtk = (vtk_t *)v;
-  FILE *fd = vtk->fd;
-  int x, y, z, xsize, ysize, zsize, xysize, total;
-
-  if (vtk->isBinary)
-    return MOLFILE_ERROR;
-
-  xsize = vtk->vol[0].xsize;
-  ysize = vtk->vol[0].ysize;
-  zsize = vtk->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  double scalemag = 1.0;
-  const char *userscalefactor=getenv("VMDVTKPLUGINSCALEVOXELMAG");
-  if (userscalefactor) {
-    scalemag = atof(userscalefactor);
-    if (scalemag != 0.0) {
-      printf("vtkplugin) Applying user scaling factor to voxel scalar/gradient values: %g\n", scalemag); 
-    } else {
-      printf("vtkplugin) Warning: ignoring user scaling factor due to parse error or zero-value\n"); 
-    }
-  } else {
-    printf("vtkplugin) No user scaling factor set, using scale factor 1.0.\n");
-  }
-
-  float maxmag = 0.0f;
-  strcpy(vtk->vol[0].dataname, "volgradient");
-  for (z=0; z<zsize; z++) {
-    for (y=0; y<ysize; y++) {
-      for (x=0; x<xsize; x++) {
-        double vx, vy, vz;
-        fscanf(fd, "%lf %lf %lf", &vx, &vy, &vz);
-
-#if 1
-        // XXX hack to allow user override of voxel magnitude
-        // during loading...
-        vx *= scalemag;
-        vy *= scalemag;
-        vz *= scalemag;
-#endif
-
-        // compute scalar magnitude from vector field
-        double mag = sqrt(vx*vx + vy*vy + vz*vz);
-
-        int addr = z*xsize*ysize + y*xsize + x;
-        datablock[addr] = mag;
-
-        if (mag > maxmag)
-          maxmag = mag;
-      }
-    }
-  }
-  printf("vtkplugin) maxmag: %g\n", maxmag);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-#if vmdplugin_ABIVERSION > 16
-
-static int read_vtk_data_ex(void *v, molfile_volumetric_readwrite_t *p) {
-  vtk_t *vtk = (vtk_t *)v;
-  FILE *fd = vtk->fd;
-  int x, y, z, xsize, ysize, zsize, xysize, total;
-
-  if (vtk->isBinary)
-    return MOLFILE_ERROR;
-
-  if (!p->scalar || !p->gradient) 
-    return MOLFILE_ERROR;
-
-  xsize = vtk->vol[0].xsize;
-  ysize = vtk->vol[0].ysize;
-  zsize = vtk->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  double scalemag = 1.0;
-  const char *userscalefactor=getenv("VMDVTKPLUGINSCALEVOXELMAG");
-  if (userscalefactor) {
-    scalemag = atof(userscalefactor);
-    if (scalemag != 0.0) {
-      printf("vtkplugin) Applying user scaling factor to voxel scalar/gradient values: %g\n", scalemag); 
-    } else {
-      printf("vtkplugin) Warning: ignoring user scaling factor due to parse error or zero-value\n"); 
-    }
-  } else {
-    printf("vtkplugin) No user scaling factor set, using scale factor 1.0.\n");
-  }
-
-  float maxmag = 0.0f;
-  strcpy(vtk->vol[0].dataname, "volgradient");
-  for (z=0; z<zsize; z++) {
-    for (y=0; y<ysize; y++) {
-      for (x=0; x<xsize; x++) {
-        double vx, vy, vz;
-        fscanf(fd, "%lf %lf %lf", &vx, &vy, &vz);
-
-#if 1
-        // XXX hack to allow user override of voxel magnitude
-        // during loading...
-        vx *= scalemag;
-        vy *= scalemag;
-        vz *= scalemag;
-#endif
-
-        // compute scalar magnitude from vector field
-        double mag = sqrt(vx*vx + vy*vy + vz*vz);
-
-        int addr = z*xsize*ysize + y*xsize + x;
-        p->scalar[addr] = mag;
-
-        if (mag > maxmag)
-          maxmag = mag;
-
-        // assign vector field to gradient map
-        // index into vector field of 3-component vectors
-        int addr3 = addr *= 3;
-        p->gradient[addr3    ] = vx;
-        p->gradient[addr3 + 1] = vy;
-        p->gradient[addr3 + 2] = vz;
-      }
-    }
-  }
-  printf("vtkplugin) maxmag: %g\n", maxmag);
-
-  return MOLFILE_SUCCESS;
-}
-
-#endif
-
-
-static void close_vtk_read(void *v) {
-  vtk_t *vtk = (vtk_t *)v;
-  
-  fclose(vtk->fd);
-  if (vtk->vol != NULL)
-    delete [] vtk->vol; 
-  delete vtk;
-}
-
-
-//
-// Initialization stuff here
-//
-static molfile_plugin_t vtkplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&vtkplugin, 0, sizeof(molfile_plugin_t));
-  vtkplugin.abiversion = vmdplugin_ABIVERSION;
-  vtkplugin.type = MOLFILE_PLUGIN_TYPE;
-  vtkplugin.name = "vtk";
-  vtkplugin.prettyname = "VTK grid reader";
-  vtkplugin.author = "John Stone";
-  vtkplugin.majorv = 0;
-  vtkplugin.minorv = 2;
-  vtkplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vtkplugin.filename_extension = "vtk";
-  vtkplugin.open_file_read = open_vtk_read;
-  vtkplugin.read_volumetric_metadata = read_vtk_metadata;
-  vtkplugin.read_volumetric_data = read_vtk_data;
-#if vmdplugin_ABIVERSION > 16
-  vtkplugin.read_volumetric_data_ex = read_vtk_data_ex;
-#endif
-  vtkplugin.close_file_read = close_vtk_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&vtkplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/webpdbplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/webpdbplugin.c
deleted file mode 100644
index b0b7963bf7600114154492ba0f180ddcbf356964..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/webpdbplugin.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: webpdbplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.54 $       $Date: 2016/11/28 05:01:55 $
- *
- ***************************************************************************/
-
-#include <tcl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "readpdb.h"
-#include "periodic_table.h"
-
-/*
- * Load pdb from the RCSB
- * Uses Tcl
- */
-
-/*
- * Need my own read_pdb_record because the one in readpdb takes a FILE*.
- * This one will be better anyway since I don't recopy the string ;-)
- * Read the given pdb string.  On returning, pos will point to the start of
- * the next read. 
- */ 
-static int my_read_pdb_record(const char *pdb, char **pos) {
-  int recType = PDB_UNKNOWN;
-  char *nlpos;  /* newline position */
-
-  nlpos = strchr(pdb, '\n'); /* XXX segv occurs on x86_64 linux */
-                             /* loading '1epw' or '1sft'        */ 
-
-  if (!nlpos) {
-    return PDB_EOF;
-  } 
-
-  /* set the next position to the first char after the newline */
-  *pos = nlpos + 1;
-
-  /* atom records are the most common */
-  if (!strncmp(pdb, "ATOM ",  5) || !strncmp(pdb, "HETATM", 6)) {
-    /* Note that by only comparing 5 chars for "ATOM " rather than 6,     */
-    /* we allow PDB files containing > 99,999 atoms generated by AMBER    */
-    /* to load which would otherwise fail.  Not needed for HETATM since   */
-    /* those aren't going to show up in files produced for/by MD engines. */
-    recType = PDB_ATOM;
-  } else if (!strncmp(pdb, "REMARK", 6)) {
-    recType = PDB_REMARK;
-  } else if (!strncmp(pdb, "CRYST1", 6)) {
-    recType = PDB_CRYST1;
-  } else if (!strncmp(pdb, "HEADER", 6)) {
-    recType = PDB_HEADER;
-  } else if (!strncmp(pdb, "END", 3)) {  /* very permissive */
-    /* XXX we treat any "ENDxxx" record as an end, to simplify testing */
-    /*     since we don't remove trailing '\n' chars                   */
-
-    /* the only two legal END records are "END   " and "ENDMDL" */
-    recType = PDB_END;
-  } 
-
-  return recType;
-}
-
- 
-typedef struct {
-  char *pdbstr; 
-  char *pos;
-  int natoms;
-  molfile_metadata_t *meta;
-  int nconect;
-  int nbonds, maxbnum;
-  int *from, *to, *idxmap;
-} pdbdata;
-
-
-static void *pdb_read(char *pdbstr, int *natoms) {
-  pdbdata *pdb;
-  int indx, nconect;
-  char *pos = pdbstr;
-  char *next;
-
-  if (!pdbstr) return NULL;
-
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->meta = (molfile_metadata_t *) malloc(sizeof(molfile_metadata_t));
-  memset(pdb->meta, 0, sizeof(molfile_metadata_t));
-
-  pdb->meta->remarklen = 0;
-  pdb->meta->remarks = NULL;
-
-  *natoms=0;
-  nconect=0;
-  do {
-    indx = my_read_pdb_record(pos, &next);
-    if (indx == PDB_ATOM) {
-      *natoms += 1;
-    } else if (indx == PDB_CONECT) {
-      nconect++;
-    } else if (indx == PDB_HEADER) {
-      get_pdb_header(pos, pdb->meta->accession, pdb->meta->date, NULL);
-      if (strlen(pdb->meta->accession) > 0)
-        strcpy(pdb->meta->database, "PDB");
-    } else if (indx == PDB_REMARK || indx == PDB_UNKNOWN) {
-      int len = next - pos;
-      int newlen = len + pdb->meta->remarklen;
-
-      char *newstr=realloc(pdb->meta->remarks, newlen + 1);
-      if (newstr != NULL) {
-        pdb->meta->remarks = newstr;
-        pdb->meta->remarks[pdb->meta->remarklen] = '\0';
-        memcpy(pdb->meta->remarks + pdb->meta->remarklen, pos, len);
-        pdb->meta->remarks[newlen] = '\0';
-        pdb->meta->remarklen = newlen;
-      }
-    }
-
-    pos = next;
-  } while (indx != PDB_END && indx != PDB_EOF);
-
-  pdb->pdbstr = pdbstr;
-  pdb->pos =    pdbstr;
-
-  pdb->natoms = *natoms;
-  pdb->nconect = nconect;
-  pdb->nbonds = 0;
-  pdb->maxbnum = 0;
-  pdb->from = NULL;
-  pdb->to = NULL;
-  pdb->idxmap = NULL;
-
-#if defined(VMDUSECONECTRECORDS)
-  /* allocate atom index translation table if we have 99,999 atoms or less */
-  /* and we have conect records to process                                 */
-  if (pdb->natoms < 100000 && pdb->nconect > 0) {
-    pdb->idxmap = (int *) malloc(100000 * sizeof(int));
-    memset(pdb->idxmap, 0, 100000 * sizeof(int));
-  }
-#endif
-
-  return pdb;
-}
-
-static const char *rcsbmsg[] = {
-  "  The PDB is supported by RCSB, the NSF, US PHS, NIH, NCRP, NIGMS, NLM,",
-  "and US DoE, who are not liable for the data.  PDB files shall not be",
-  "sold.  See ftp://ftp.rcsb.org/advisory.doc for full details."
-};
-
-static int show_msg = 1;
-
-static void *open_file_read(const char *filename, const char *filetype,
-    int *natoms) {
-
-  Tcl_Interp *interp;
-  char url[300];
-  char cmd[300]; 
-  char *pdbfile;
-  const char *result;
-  void *v;
-
-  /*
-   * Create and initialize the interpreter
-   */
-  interp = Tcl_CreateInterp();
-  if (!interp) {
-    fprintf(stderr, "Could not create new Tcl Interp\n");
-    return NULL; 
-  }
-  if (Tcl_Init(interp) != TCL_OK) {
-    fprintf(stderr, "Warning, could not create initialize Tcl Interp\n");
-  }
-  if (!Tcl_PkgRequire(interp, (char *)"http", (char *)"2.0", 0)) {
-    fprintf(stderr, "Could not load http package\n");
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  }
-
-  if (strlen(filename) != 4) {
-    fprintf(stderr, "PDB code %s is invalid; PDB accession codes have four letters.\n", filename);
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  }
-
-  if (show_msg) {
-    int i;
-    show_msg = 0;
-    for (i=0; i<3; i++) printf("%s\n", rcsbmsg[i]);
-  }
-
-  /* Adapted to new PDB website layout, changed on 1/1/2006 */
-  sprintf(url, "http://www.rcsb.org/pdb/downloadFile.do?fileFormat=pdb&compression=NO&structureId=%s",filename);
-  sprintf(cmd, "set token [::http::geturl \"%s\"]", url);
-  if (Tcl_Eval(interp, cmd) != TCL_OK) {
-    fprintf(stderr, "Error loading PDB: %s\n", Tcl_GetStringResult(interp));
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  } 
-  sprintf(cmd, "upvar #0 $token state");
-  Tcl_Eval(interp, cmd); 
-  
-  result = Tcl_GetVar2(interp, (char *)"state", "body", TCL_GLOBAL_ONLY); 
-  if (!result) {
-    fprintf(stderr, "Error loading PDB: %s\n", Tcl_GetStringResult(interp));
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  } 
-  pdbfile = strdup(result);
-  Tcl_DeleteInterp(interp);
-
-  /* XXX this code needs updating still */
-  /* pdbfile will be free'd by close_pdb() */
-  v = pdb_read(pdbfile, natoms); 
-  return v;
-}
-   
-static int read_pdb_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) {
-
-  pdbdata *pdb = (pdbdata *)mydata;
-  char *pos = pdb->pdbstr;
-  char *next;
-  int i, rectype, atomserial, pteidx;
-  char ridstr[8];
-  char elementsymbol[3];
-  molfile_atom_t *atom;
-  int badptecount = 0;
-  elementsymbol[2]=0;
-
-  *optflags = MOLFILE_INSERTION | MOLFILE_OCCUPANCY | MOLFILE_BFACTOR | 
-              MOLFILE_ALTLOC | MOLFILE_ATOMICNUMBER | MOLFILE_BONDSSPECIAL;
-
-  i=0; /* Count atoms */
-  do {
-    rectype = my_read_pdb_record(pos, &next);
-    switch (rectype) {
-    case PDB_ATOM:
-      atom = atoms+i;
-      get_pdb_fields(pos, next-pos, &atomserial,
-          atom->name, atom->resname, atom->chain, atom->segid, 
-          ridstr, atom->insertion, atom->altloc, elementsymbol,
-          NULL, NULL, NULL, &atom->occupancy, &atom->bfactor);
-
-      if (pdb->idxmap != NULL && atomserial < 100000) {
-        pdb->idxmap[atomserial] = i; /* record new serial number translation */
-      }
-
-      atom->resid = atoi(ridstr);
-
-      /* determine atomic number from the element symbol */
-      pteidx = get_pte_idx_from_string(elementsymbol);
-      atom->atomicnumber = pteidx;
-      if (pteidx != 0) {
-        atom->mass = get_pte_mass(pteidx);
-        atom->radius = get_pte_vdw_radius(pteidx);
-      } else {
-        badptecount++; /* unrecognized element */
-      }
-
-      strcpy(atom->type, atom->name);
-      i++;
-      break;
-
-    case PDB_CONECT:
-      /* only read CONECT records for structures where we know they can */
-      /* be valid for all of the atoms in the structure                 */
-      if (pdb->idxmap != NULL) {
-        char cbuf[PDB_BUFFER_LENGTH];
-        int len = next-pos;
-
-        if (len > PDB_BUFFER_LENGTH) 
-          len = PDB_BUFFER_LENGTH;
-        strncpy(cbuf, pos, len);
-        get_pdb_conect(cbuf, pdb->natoms, pdb->idxmap,
-                       &pdb->maxbnum, &pdb->nbonds, &pdb->from, &pdb->to);
-      }
-      break;
-
-    default:
-      /* other record types are ignored in the structure callback */
-      /* and are dealt with in the timestep callback or elsewhere */
-      break;
-    }
-    pos = next;
-  } while (rectype != PDB_END && rectype != PDB_EOF);
-
-  /* if all atoms are recognized, set the mass and radius flags too,  */
-  /* otherwise let VMD guess these for itself using it's own methods  */
-  if (badptecount == 0) {
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                      float **bondorder, int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  pdbdata *pdb = (pdbdata *)v;
- 
-  *nbonds = 0;
-  *fromptr = NULL;
-  *toptr = NULL;
-  *bondorder = NULL; /* PDB files don't have bond order information */
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-/* The newest plugin API allows us to return CONECT records as
- * additional bonds above and beyond what the distance search returns.
- * Without that feature, we otherwise have to check completeness and
- * ignore them if they don't look to be fully specified for this molecule */
-#if !defined(MOLFILE_BONDSSPECIAL)
-  if (pdb->natoms >= 100000) {
-    printf("webpdbplugin) Warning: more than 99,999 atoms, ignored CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (((float) pdb->nconect / (float) pdb->natoms) <= 0.85) {
-    printf("webpdbplugin) Warning: Probable incomplete bond structure specified,\n");
-    printf("webpdbplugin)          ignoring CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (pdb->nconect == 0) {
-    return MOLFILE_SUCCESS;
-  }
-#endif
-
-  *nbonds = pdb->nbonds;
-  *fromptr = pdb->from;
-  *toptr = pdb->to;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v;
-  char *pos = pdb->pos;
-  char *next;
-  float *x, *y, *z;
-  float occup, bfac;
-  int indx, i = 0;
-
-  if (ts) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = 0;
-  }
-  do {
-    indx = my_read_pdb_record(pos, &next);
-    if((indx == PDB_END || indx == PDB_EOF) && (i < pdb->natoms)) {
-      return MOLFILE_ERROR;
-    } else if(indx == PDB_ATOM) {
-      if(i++ >= pdb->natoms) {
-        break;
-      }
-      /* just get the coordinates, and store them */
-      if (ts) {
-        get_pdb_coordinates(pos, x, y, z, &occup, &bfac);
-        x += 3;
-        y += 3;
-        z += 3;
-      }
-    } else if (indx == PDB_CRYST1) {
-      if (ts) {
-        get_pdb_cryst1(pos, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    }
-    pos = next;
-  } while(!(indx == PDB_END || indx == PDB_EOF));
-  pdb->pos = pos;
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pdb_read(void *v) {
-  pdbdata *pdb = (pdbdata *)v;
-  if (!pdb) return;
-  free(pdb->pdbstr);
-  if (pdb->idxmap != NULL)
-    free(pdb->idxmap);
-  if (pdb->meta->remarks != NULL)
-    free(pdb->meta->remarks);
-  if (pdb->meta != NULL)
-    free(pdb->meta);
-  free(pdb);
-}
-
-
-static int read_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  pdbdata *pdb = (pdbdata *)v;
-  *metadata = pdb->meta;
-  return MOLFILE_SUCCESS;
-}
-
-/* 
- * Registration stuff
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "webpdb";
-  plugin.prettyname = "Web PDB Download";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 16;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "";
-  plugin.open_file_read = open_file_read;
-  plugin.read_structure = read_pdb_structure;
-  plugin.read_bonds = read_bonds;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_pdb_read;
-  plugin.read_molecule_metadata = read_molecule_metadata;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_WEBPDB_PLUGIN
-
-int main(int argc, char *argv[]) {
-  char *file;
-  if (argc < 2) {
-    fprintf(stderr, "Usage: %s <pdbcode>\n", argv[0]);
-    return -1;
-  }
-  file = (char *)open_file_read(argv[1], "webpdb",  NULL);
-  printf("%s\n", file);
-  free(file);
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xbgfplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xbgfplugin.C
deleted file mode 100644
index 4d49a0841d7d063ef8fa010bafac32ba4f77f3de..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xbgfplugin.C
+++ /dev/null
@@ -1,706 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: xbgfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:55 $
- *
- ***************************************************************************/
-
-#include "molfile_plugin.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-#define MAXBONDS 16
-
-typedef struct {
-  FILE *file;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-  int natoms, nbonds, optflags, coords_read;
-  int *from, *to;
-  float *bondorder;
-} xbgfdata;
-
-
-// Open the file and create the xbgf struct used to pass data to the other
-// functions.
-static void *open_xbgf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  xbgfdata *bgf;
-  char line[LINESIZE]; 
-  int nbonds, optflags;
-  int numat=0;
-  nbonds=0;
-  int nbline; //Number of bonds in current line
-
-  // Allocate and initialize the bgf structure
-  bgf = (xbgfdata *) malloc(sizeof(xbgfdata));
-  memset(bgf, 0, sizeof(xbgfdata));
-
-  bgf->meta = (molfile_metadata_t *) malloc(sizeof(molfile_metadata_t));
-  memset(bgf->meta, 0, sizeof(molfile_metadata_t));
-
-  bgf->meta->remarklen = 0;
-  bgf->meta->remarks = NULL;
-
-  if ((fd = fopen(path, "r")) == NULL)
-    return NULL;
-
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      printf("xbgfplugin) Improperly terminated bgf file\n");
-      return NULL;
-    }
-
-    if ((strncmp(line, "ATOM", 4) == 0) || (strncmp(line, "HETATM", 6)==0)) 
-      numat++;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      nbline=(strlen(line)-1)/6; 
-      nbline -= 2;
-      nbonds += nbline;
-    }
-
-    // Read the remarks
-    if (strncmp(line, "REMARK", 4)==0 || strncmp(line, "LEWIS", 4)==0 || 
-        strncmp(line, "VDW", 3)==0) {
-      int len=strlen(line);
-      int newlen = len + bgf->meta->remarklen;
-      char *newstr=(char*) realloc(bgf->meta->remarks, newlen + 1);
-      if (newstr != NULL) {
-        bgf->meta->remarks = newstr;
-        bgf->meta->remarks[bgf->meta->remarklen] = '\0';
-        memcpy(bgf->meta->remarks + bgf->meta->remarklen, line, len);
-        bgf->meta->remarks[newlen] = '\0';
-        bgf->meta->remarklen = newlen;
-      }
-    }
-
-    optflags = MOLFILE_INSERTION | MOLFILE_CHARGE | MOLFILE_BFACTOR | MOLFILE_OCCUPANCY | MOLFILE_ATOMICNUMBER;
-  } while ( strncmp(line, "END", 3) );
-    
-  *natoms = numat;
-  rewind(fd);
-
-  bgf->file = fd;
-  bgf->natoms = *natoms;
-  bgf->nbonds = nbonds;
-
-  bgf->optflags = optflags;
-  bgf->coords_read = 0;
-  bgf->from = NULL;
-  bgf->to = NULL;
-  bgf->bondorder = NULL;
-                                                                                
-  return bgf;
-}
-
-
-static void adjust_xbgf_field_string(char *field) {
-  int i, len;
-
-  len = strlen(field);
-  while (len > 0 && field[len-1] == ' ') {
-    field[len-1] = '\0';
-    len--;
-  }
-
-  while (len > 0 && field[0] == ' ') {
-    for (i=0; i < len; i++)
-      field[i] = field[i+1];
-    len--;
-  }
-}
-
-static void get_xbgf_coordinates(const char *record, 
-                                float *x, float *y, float *z) {
-  char numstr[50]; /* store all fields in one array to save memset calls */
-  memset(numstr, 0, sizeof(numstr));
-  if (x != NULL) {
-    strncpy(numstr, record + 32, 10);
-    *x = (float) atof(numstr);
-  }
-
-  if (y != NULL) {
-    strncpy(numstr+10, record + 42, 10);
-    *y = (float) atof(numstr+10);
-  }
-
-  if (z != NULL) {
-    strncpy(numstr+20, record + 52, 10);
-    *z = (float) atof(numstr+20);
-  }
-}
-
-
-static void get_xbgf_fields(const char *record, char *name, char *resname, 
-                           char *chain, char* segname, float *occupancy, 
-                           float *bfactor, int *elementindex,
-                           int *resid, char *type, float *charge,
-                           float *x, float *y, float *z, char* insert) {
-  char tempresid[6];
-  char tempcharge[8];
-  char tempbeta[7];
-  char tempocc[7];
-  char tempelem[4];
-  strcpy(insert, " ");
-
-  /* get atom name */
-  strncpy(name, record + 14, 5);
-  name[5] = '\0';
-  adjust_xbgf_field_string(name); /* remove spaces from the name */
-
-  /* get residue name */
-  strncpy(resname, record + 20, 4);
-  resname[4] = '\0';
-  adjust_xbgf_field_string(resname); /* remove spaces from the resname */
-
-  /* set segname */
-  strncpy(segname, record + 101, 4);
-  segname[4]='\0';
-  adjust_xbgf_field_string(segname); /* remove spaces from the segname */
-
-  /* get chain name */
-  chain[0] = record[25];
-  chain[1] = '\0';
-
-  /* get residue id number */
-  strncpy(tempresid, record + 27, 5);
-  tempresid[5] = '\0';
-  adjust_xbgf_field_string(tempresid); /* remove spaces from the resid */
-  *resid=atoi(tempresid);
-
-  /* get force field type */
-  strncpy(type, record+63, 5);
-  type[5]='\0';
-  adjust_xbgf_field_string(type); /* remove spaces */
-
-  /* get charge*/
-  strncpy(tempcharge, record + 74, 7);
-  tempcharge[7] = '\0';
-  adjust_xbgf_field_string(tempcharge); /* remove spaces from the charge */
-  *charge=atof(tempcharge);
-
-  /* Get B factor, occupancy, and element */
-  strncpy(tempbeta, record + 83, 6);
-  tempbeta[6] = '\0';
-  adjust_xbgf_field_string(tempbeta); /* remove spaces from the beta field */
-  *bfactor=atof(tempbeta);
-  
-  strncpy(tempocc, record + 90, 6);
-  tempocc[6] = '\0';
-  adjust_xbgf_field_string(tempocc); /* remove spaces from the occupancy field */
-  *occupancy=atof(tempocc);
-  
-  strncpy(tempelem, record + 97, 3);
-  tempelem[3] = '\0';
-  adjust_xbgf_field_string(tempelem); /* remove spaces from the element */
-  *elementindex=atoi(tempelem);
-
-  /* get x, y, and z coordinates */
-  get_xbgf_coordinates(record, x, y, z);
-}  
-
-
-// Read atom information, but not coordinates.
-static int read_xbgf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  char line[LINESIZE]; 
-  molfile_atom_t *atom;
-  int natoms=0;
-
-  //optflags = MOLFILE_INSERTION | MOLFILE_CHARGE | MOLFILE_BFACTOR | MOLFILE_OCCUPANCY | MOLFILE_ATOMICNUMBER;
-  *optflags = bgf->optflags;
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) FORMAT ATOM record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) Error occurred reading atom record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(line, "ATOM", 4) && strncmp(line, "HETATM", 6)) continue;
-    atom=atoms+natoms;
-    natoms++;
-    get_xbgf_fields(line, atom->name, atom->resname, atom->chain, atom->segid, 
-                   &atom->occupancy, &atom->bfactor, &atom->atomicnumber, 
-                   &atom->resid, atom->type, &atom->charge, 
-                   NULL, NULL, NULL, atom->insertion);
-  } while (strncmp(line, "END", 3));
-
-  bgf->natoms = natoms;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-// Read atom coordinates
-static int read_xbgf_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  char line[LINESIZE];
-  int i;
-  float x, y, z;
-
-  // Since the file is rewound when coordinates are read, EOF shouldn't
-  // happen. Instead, use a flag to indicate that the single timestep has
-  // been read
-  if (bgf->coords_read) {
-    return MOLFILE_EOF;
-  }
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) No FORMAT ATOM record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  for (i = 0; i < bgf->natoms; i++) {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) Error occurred reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-    // skip comments and blank lines
-    if (strncmp(line,"ATOM",4)!=0 && strncmp(line,"HETATM",6)!=0) continue;
-
-    get_xbgf_coordinates(line, &x, &y, &z);
-
-    if (ts) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-  bgf->coords_read = 1;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void *open_xbgf_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  xbgfdata *data;
-
-  if ((fd = fopen(filename, "w")) == NULL) { 
-    printf("xbgfplugin) Error, unable to open xbgf file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (xbgfdata *) malloc(sizeof(xbgfdata));
-  memset(data, 0, sizeof(xbgfdata));
-  data->natoms = natoms;
-  data->file = fd;
-  data->nbonds = 0;
-  return data;
-}
-
-
-static int write_xbgf_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  fflush(stdout);
-  xbgfdata *data = (xbgfdata *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->natoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->natoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_xbgf_bonds_aux(void *v, int *nbonds, int **fromptr, int **toptr, float **bondorderptr) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  char line[LINESIZE]; 
-  char nextline[LINESIZE]; 
-  if (bgf->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL;
-    return MOLFILE_SUCCESS;
-  }
-
-  // Find and read the BOND record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) No bond record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT CONECT", 13) != 0 );
-
-  // Read the bonds
-  int j; //From atom
-  int k; //To atom
-  bool conline=false; //true if line after the conect line is an order line
-  char currbond[7]="xxxxxx"; //Stores current bond field
-  char currcon[7]="xxxxxx"; //Stores current ORDER field
-  char* bondptr; //pointer to current position in bond line
-  char* conptr; //pointer to current position in order line
-  int bonds[MAXBONDS]; //Stores bonds of current atom
-  float orders[MAXBONDS]; //Stores bond orders of current atom
-  int numbonds; //Stores number of bonds of current atom
-  int numords; //Stores number of bond order records of current atom
-  float bo; //current bond order
-  int i=0; //Number of the current bond
-  int numfields=0; //number of fields in the current line
-  fgets(line, LINESIZE, bgf->file);
-  while (1) {
-    // bondptr=NULL;
-    //conptr=NULL;
-    conline=false;
-    if (strncmp(line,"END",3)==0)
-      break;
-
-    fgets(nextline, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) Error occurred reading bond record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(nextline,"ORDER",5)==0) 
-      conline=true;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      numfields=(strlen(line)-1)/6;
-      bondptr=&line[0];
-      numfields--;
-      bondptr += 6;
-      numbonds=0;
-      numords=0;
-      strncpy(currbond,bondptr,6);
-      j=atoi(currbond);
-      numfields--;
-      bondptr += 6;
-
-      while ((numfields > 0) && (numbonds <= MAXBONDS)) {
-        strncpy(currbond,bondptr,6);
-        numfields--;
-        bondptr += 6;
-        bonds[numbonds]=atoi(currbond);
-        numbonds++;
-      }
-
-      if (conline) {
-        numfields=(strlen(line)-1)/6;
-        conptr=&nextline[0];
-        numfields -= 2;
-        conptr += 12;
-        numords=0;
-        while ((numfields > 0) && (numords < numbonds)) {
-          strncpy(currcon,conptr,6);
-          numfields--;
-          conptr+=6;
-          bo=atof(currcon);
-          orders[numords]=bo;
-          numords++;
-        }
-      }
-
-      for (int l=0;l<numbonds;l++) {
-        k=bonds[l];
-        if (j<k) {
-          bgf->from[i]=j;
-          bgf->to[i]=k;
-          if (conline) {
-            bgf->bondorder[i]=orders[l];
-          } else {
-            bgf->bondorder[i]=1.0;
-          }
-          i++;
-        }
-      }
-        
-      if (conline) {
-        fgets(line, LINESIZE, bgf->file);
-      } else {
-        strncpy(line,nextline,LINESIZE);
-      }
-    } else {
-      strncpy(line,nextline,LINESIZE);
-    }
-  }
-
-  *nbonds = i;
-  *fromptr = bgf->from;
-  *toptr = bgf->to;
-  *bondorderptr = bgf->bondorder; // not implemented yet
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_xbgf_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                           float **bondorderptr, int **bondtype,
-                           int *nbondtypes, char ***bondtypename) {
-  xbgfdata *bgf = (xbgfdata *)v;
-
-  /* now read bond data */
-  *nbonds=bgf->nbonds;
-  if (bgf->nbonds > 0) {
-    bgf->from = (int *) malloc(*nbonds*sizeof(int));
-    bgf->to = (int *) malloc(*nbonds*sizeof(int));
-    bgf->bondorder = (float *) malloc(*nbonds*sizeof(float));
-
-    if ((read_xbgf_bonds_aux(bgf, nbonds, &(bgf->from), &(bgf->to), &(bgf->bondorder))) != MOLFILE_SUCCESS) {
-      fclose(bgf->file);
-      bgf->file = NULL;
-      return MOLFILE_ERROR;
-    }
-    *fromptr = bgf->from;
-    *toptr = bgf->to;
-    *bondorderptr = bgf->bondorder; // not implemented yet
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  } else {
-    printf("xbgfplugin) WARNING: no bonds defined in xbgf file.\n");
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL;
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_xbgf_timestep(void *mydata, const molfile_timestep_t *ts) {
-  fflush(stdout);
-  xbgfdata *data = (xbgfdata *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-
-  //print header block
-  fprintf(data->file, "BIOGRF  332\n");
-  fprintf(data->file, "REMARK NATOM %4i\n", data->natoms);
-  fprintf(data->file, "FORCEFIELD DREIDING\n");
-  fprintf(data->file, "FORMAT ATOM   (a6,1x,i6,1x,a5,1x,a4,1x,a1,1x,i5,3f10.5,1x,a5,i3,i2,1x,f8.5,1x,f6.3,1x,f6.3,1x,i3,1x,a4)\n");
-
-  //print atoms block
-  atom = data->atomlist;
-  pos = ts->coords;
-  int numbonds=0;
-  int lp=0;
-  for (i = 0; i < data->natoms; i++) {
-    fprintf(data->file, "%-6s %6i %5s %4s %1s %5i%10.5f%10.5f%10.5f %-5s%3i%2i %8.5f %6.3f %6.3f %3i %4s\n", "ATOM", i+1, atom->name, atom->resname, atom->chain, atom->resid, pos[0], pos[1], pos[2], atom->type, numbonds, lp, atom->charge, atom->bfactor, atom->occupancy, atom->atomicnumber, atom->segid);
-    ++atom; 
-    pos += 3;
-  }
-
-  //write the connectivity data
-  fprintf(data->file,"FORMAT CONECT (a6,14i6) \nFORMAT ORDER (a6,i6,13f6.3)\n");
-    
-  //iterate through the bond arrays and write them all
-  int* bonds=(int *)malloc((data->natoms+1) * sizeof(int) * MAXBONDS);
-  float* orders=(float *)malloc((data->natoms+1)*sizeof(float) * MAXBONDS);
-  int* numcons=(int *)malloc((data->natoms+1)*sizeof(int));
-  for (i=0;i<data->natoms+1;i++) {
-    numcons[i]=0;
-  }
-
-  int j,k; //indices for atoms being bonded
-  float o; //bond order
-  for (i=0;i<data->nbonds;i++) {
-    j=data->from[i];
-    k=data->to[i];
-
-    if (data->bondorder != NULL)
-      o=data->bondorder[i];
-    else 
-      o=1.0f;
-
-    numcons[j]++;
-    numcons[k]++;
-    if (numcons[j]>MAXBONDS) {
-      printf("xbgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[j]--;
-      numcons[k]--;
-      continue;
-    }
-       
-    if (numcons[k]>MAXBONDS) {
-      printf("xbgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[k]--;
-      numcons[j]--;
-      continue;
-    }
-    bonds[6*j+numcons[j]-1]=k;
-    bonds[6*k+numcons[k]-1]=j;
-    orders[6*j+numcons[j]-1]=o;
-    orders[6*k+numcons[k]-1]=o;
-  }
-
-  for (i=1;i<=data->natoms;i++) {
-    fprintf(data->file,"CONECT%6i",i);
-    for (j=0;j<numcons[i];j++) {
-      fprintf(data->file,"%6i",bonds[6*i+j]);
-    }
-    fprintf(data->file,"\nORDER %6i",i);
-    for (j=0;j<numcons[i];j++) {
-      fprintf(data->file,"%6.3f",orders[6*i+j]);
-    }
-    fprintf(data->file,"\n");
-  }
-
-  if (bonds != NULL) {
-    free(bonds);
-    bonds = NULL;
-  }
-  if (orders != NULL) {
-    free(orders);
-    orders = NULL;
-  }
-  if (numcons != NULL) {
-    free(numcons);
-    numcons = NULL;
-  }
-
-  fprintf(data->file,"END\n");
-  return MOLFILE_SUCCESS;
-}
-
-static int write_xbgf_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                            float *bondorderptr,  int *bondtype, 
-                            int nbondtypes, char **bondtypename) {
-  xbgfdata *data = (xbgfdata *)v;
-  data->from = (int*) malloc (nbonds * sizeof(int));
-  data->to = (int*) malloc (nbonds * sizeof(int));
-  data->nbonds = nbonds;
-  fflush(stdout);
-
-
-  //set the pointers for use later
-  for (int i=0;i<nbonds;i++) {
-    data->from[i]=fromptr[i];
-    data->to[i]=toptr[i];
-  }
-
-  if (bondorderptr != NULL) {
-    data->bondorder = (float*) malloc (nbonds * sizeof(float));
-    for (int i=0;i<nbonds;i++) {
-      data->bondorder[i]=bondorderptr[i];
-    }
-  }
-
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_xbgf_write(void *mydata) {
-  xbgfdata *data = (xbgfdata *)mydata;
-  if (data) {
-    fclose(data->file);
-
-    if (data->atomlist != NULL) free(data->atomlist);
-    data->atomlist = NULL;
-    if (data->from != NULL) free(data->from);
-    data->from = NULL;
-    if (data->to != NULL) free(data->to);
-    data->to = NULL;
-    if (data->bondorder != NULL) free(data->bondorder);
-    data->bondorder = NULL;
-    free(data);
-  }
-}
-
-//
-// Free the memory used by the bgf structure
-static void close_xbgf_read(void *v) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  if (bgf) {
-    if (bgf->file) fclose(bgf->file);
-    if (bgf->from != NULL) free(bgf->from);
-    if (bgf->to != NULL)   free(bgf->to);
-    if (bgf->bondorder != NULL) free(bgf->bondorder);
-
-    if (bgf->meta->remarks != NULL)
-      free(bgf->meta->remarks);
-    if (bgf->meta != NULL) 
-      free(bgf->meta);
-    free(bgf);
-  }
-  bgf=NULL;
-}
-
-
-static int read_xbgf_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  xbgfdata *bgf = (xbgfdata *)v; 
-  *metadata = bgf->meta;
-  return MOLFILE_SUCCESS;
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xbgf";
-  plugin.prettyname = "Internal Paratool Format";
-  plugin.author = "Peter Freddolino ";
-  plugin.majorv = 0;
-  plugin.minorv = 13;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "xbgf";
-  plugin.open_file_read = open_xbgf_read;
-  plugin.read_structure = read_xbgf_structure;
-  plugin.read_bonds = read_xbgf_bonds;
-  plugin.read_next_timestep = read_xbgf_timestep;
-  plugin.close_file_read = close_xbgf_read;
-  plugin.open_file_write = open_xbgf_write;
-  plugin.write_structure = write_xbgf_structure;
-  plugin.write_timestep = write_xbgf_timestep;
-  plugin.close_file_write = close_xbgf_write;
-  plugin.read_molecule_metadata = read_xbgf_molecule_metadata;
-  plugin.write_bonds = write_xbgf_bonds;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xsfplugin.C b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xsfplugin.C
deleted file mode 100644
index e3fdf220621a33d8ee79291d0bfdac80c4f0d8d8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xsfplugin.C
+++ /dev/null
@@ -1,1023 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: xsfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.20 $       $Date: 2016/11/09 17:53:21 $
- *
- ***************************************************************************/
-
-//
-// Molefile plugin for xsf/axsf format files as created by the 
-// Quantum Espresso software package (http://www.quantum-espresso.org) 
-// a.k.a. PWScf (http://www.pwscf.org/) and XCrySDen (http://www.xcrysden.org/
-//
-// a file format description is available at:
-// http://www.xcrysden.org/doc/XSF.html
-//
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#include "periodic_table.h"
-
-static const char *xsf_symtab[] = {
-  "(unknown keyword)", "#",
-  "BEGIN_INFO", "END_INFO",
-  "BEGIN_BLOCK_DATAGRID_2D", "END_BLOCK_DATAGRID_2D",
-  "BEGIN_DATAGRID_2D", "END_DATAGRID_2D",
-  "BEGIN_BLOCK_DATAGRID_3D", "END_BLOCK_DATAGRID_3D",
-  "BEGIN_DATAGRID_3D", "END_DATAGRID_3D",
-  "BEGIN_BLOCK_BANDGRID_3D", "END_BLOCK_BANDGRID_3D",
-  "ATOMS", "ANIMSTEPS", "BAND",
-  "MOLECULE", "POLYMER", "SLAB", "CRYSTAL",
-  "PRIMVEC", "CONVVEC", "PRIMCOORD", "CONVCOORD"
-};
-
-
-typedef enum {
-  xsf_UNKNOWN = 0,  xsf_COMMENT,
-  xsf_BEGINFO,      xsf_ENDINFO, 
-  xsf_BEG_2D_BLOCK, xsf_END_2D_BLOCK,
-  xsf_BEG_2D_DATA,  xsf_END_2D_DATA,
-  xsf_BEG_3D_BLOCK, xsf_END_3D_BLOCK,
-  xsf_BEG_3D_DATA,  xsf_END_3D_DATA,
-  xsf_BEG_3D_BAND,  xsf_END_3D_BAND,
-  xsf_ATOMS, xsf_ANIMSTEPS, xsf_BAND,
-  xsf_MOLECULE, xsf_POLYMER, xsf_SLAB, xsf_CRYSTAL,
-  xsf_PRIMVEC, xsf_CONVVEC, xsf_PRIMCOORD, xsf_CONVCOORD,
-  xsf_NR_KEYWORDS
-} xsf_keyword_t;
-
-
-// list of known alternatives to the keywords above
-// last entry has to be an xsf_UNKNOWN.
-static const struct {
-  const char *name;
-  xsf_keyword_t kw;
-}  xsf_aliases[] = {
-  { "DATAGRID_2D", xsf_BEG_2D_DATA },
-  { "DATAGRID_3D", xsf_BEG_3D_DATA },
-  { "BEGIN_BLOCK_DATAGRID2D", xsf_BEG_2D_BLOCK },
-  { "BEGIN_BLOCK_DATAGRID3D", xsf_BEG_3D_BLOCK },
-  { "END_BLOCK_DATAGRID2D", xsf_END_2D_BLOCK },
-  { "END_BLOCK_DATAGRID3D", xsf_END_3D_BLOCK },
-  { NULL,          xsf_UNKNOWN     }
-};
-
-
-static xsf_keyword_t lookup_keyword(const char* word) {
-  int i, j;
-  
-  if (word == 0) return xsf_UNKNOWN;
-  
-  // find start of word.
-  j=0;
-  for (i=0; i < (int)strlen(word); ++i) {
-    j=i;
-    if (!isspace(word[i])) 
-      break;
-  }
-  
-  for (i=1; i < xsf_NR_KEYWORDS; ++i) {
-    if (0 == strncmp(word + j, xsf_symtab[i], strlen(xsf_symtab[i])))
-      return (xsf_keyword_t) i;
-  }
-
-  // check for known aliases/alternatives
-  for (i=0; xsf_aliases[i].kw != xsf_UNKNOWN; ++i) {
-    const char *name = xsf_aliases[i].name;
-
-    if (0 == strncmp(word + j, name, strlen(name)))
-      return xsf_aliases[i].kw;
-  }
-
-  return xsf_UNKNOWN;
-}
-
-
-
-// A format-independent structure to hold unit cell data
-typedef struct {
-  float A, B, C, alpha, beta, gamma, cell[3][3];
-} xsf_box;
-
-typedef struct {
-  FILE *fd;                     // file descriptor
-  int nvolsets;                 // number of volumetric datasets
-  int numatoms;                 // number of atoms
-  int animsteps;                // for comparison.
-  int numsteps;                 // number of coordinate sets.
-  bool coord;                   // has coordinate data
-  char *file_name;              // original filename 
-  xsf_keyword_t pbctype;        // type of periodicity (none/polymer/slab/crystal)
-  molfile_volumetric_t *vol;    // volume set metadata 
-  int numvolmeta;               // number of entries in *vol
-  float origin[3];              // origin, stored for periodic display hack 
-  float rotmat[3][3];           // rotation matrix, stored for periodic display hack
-  float invmat[3][3];           // reciprocal cell matrix (for PBC wrapping).
-  xsf_box box;                  // unit cell dimensions (for VMD).
-} xsf_t;
-
-
-// Converts box basis vectors to A, B, C, alpha, beta, and gamma.  
-// Stores values in xsf_box struct, which should be allocated before calling
-// this function.
-static int xsf_readbox(xsf_box *box, float *x, float *y, float *z) {
-  float A, B, C;
-  int i;
-
-  if (!box) {
-    return 1;
-  }
-
-  // provide defaults
-  box->A = 10.0;
-  box->B = 10.0;
-  box->C = 10.0;
-  box->alpha = 90.0;
-  box->beta  = 90.0;
-  box->gamma = 90.0;
-
-  // A, B, C are the lengths of the x, y, z vectors, respectively
-  A = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] );
-  B = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] );
-  C = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] );
-  if ((A<=0) || (B<=0) || (C<=0)) {
-    return 1;
-  }
-  box->A = A;
-  box->B = B;
-  box->C = C;
-
-  // gamma, beta, alpha are the angles between the x & y, x & z, y & z
-  // vectors, respectively
-  box->gamma = acos( (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])/(A*B) ) * 90.0/M_PI_2;
-  box->beta = acos( (x[0]*z[0]+x[1]*z[1]+x[2]*z[2])/(A*C) ) * 90.0/M_PI_2;
-  box->alpha = acos( (y[0]*z[0]+y[1]*z[1]+y[2]*z[2])/(B*C) ) * 90.0/M_PI_2; 
-
-  // copy original cell vectors for PBC wrapping.
-  for (i=0; i<3; ++i) {
-    box->cell[i][0] = x[i];
-    box->cell[i][1] = y[i];
-    box->cell[i][2] = z[i];
-  }
-  
-  return 0;
-}
-
-
-// calculate and store rotation matrix to realign everything later.
-static void xsf_buildrotmat(xsf_t *xsf, float *a, float *b) {
-  // we rotate first around y and z to align a along the x-axis...
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  // ...then we rotate around x to put b into the xy-plane.
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  const double r[3][3] = { 
-    {               cph*cth,                cph*sth,      sph},
-    {-sth*cps - sph*cth*sps,  cth*cps - sph*sth*sps,  cph*sps},
-    { sth*sps - sph*cth*cps, -cth*sps - sph*sth*cps,  cph*cps}
-  };
-
-  for (int i=0; i<3; ++i) {
-    for (int j=0; j<3; ++j) {
-      xsf->rotmat[i][j] = r[i][j];
-    }
-  }
-}
-
-
-static void xsf_buildinvmat(xsf_t *xsf, float *a, float *b, float *c) {
-  float det, id;
-  
-  det = a[0]*b[1]*c[2] + b[0]*c[1]*a[2] + c[0]*a[1]*b[2] 
-        - a[0]*c[1]*b[2] - b[0]*a[1]*c[2] - c[0]*b[1]*a[2];
-  
-  id = 1.0 / det;
-  xsf->invmat[0][0] = id * ( b[1]*c[2]-b[2]*c[1] );
-  xsf->invmat[1][0] = id * ( a[2]*c[1]-a[1]*c[2] );
-  xsf->invmat[2][0] = id * ( a[1]*b[2]-a[2]*b[1] );
-  xsf->invmat[0][1] = id * ( b[2]*c[0]-b[0]*c[2] );
-  xsf->invmat[1][1] = id * ( a[0]*c[2]-a[2]*c[0] );
-  xsf->invmat[2][1] = id * ( a[2]*b[0]-a[0]*b[2] );
-  xsf->invmat[0][2] = id * ( b[0]*c[1]-b[1]*c[0] );
-  xsf->invmat[1][2] = id * ( a[1]*c[0]-a[0]*c[1] );
-  xsf->invmat[2][2] = id * ( a[0]*b[1]-a[1]*b[0] );
-}
-
-
-// read a line and forget the data
-static void eatline(FILE *fd) {
-  char readbuf[1025];
-  fgets(readbuf, 1024, fd);    // go on to next line
-}  
-
-
-static bool xsf_read_cell(FILE *fd, float *a, float *b, float *c) {
-  return (9 == fscanf(fd, "%f%f%f%f%f%f%f%f%f", 
-                      &a[0],&a[1],&a[2],
-                      &b[0],&b[1],&b[2],
-                      &c[0],&c[1],&c[2]));
-}
-
-// forward declaration for cleanup handling...
-static void close_xsf_read(void *v);
-
-static void *open_xsf_read(const char *filepath, const char *filetype,
-                           int *natoms) {
-  FILE *fd;
-  xsf_t *xsf;
-  int i,j;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-
-  xsf = new xsf_t;
-  xsf->fd = fd;
-  xsf->vol = NULL;
-  xsf->numvolmeta = 0;
-  xsf->coord = false;
-  xsf->nvolsets = 0;
-  xsf->numatoms = 0;
-  xsf->numsteps = 0;
-  xsf->file_name = strdup(filepath);
-  // this will disable pbc wrapping of coordinates by default
-  xsf->pbctype = xsf_MOLECULE; 
-
-  // initialize origin and rotmat to sensible defaults.
-  for (i=0; i<3; ++i) {
-    for (j=0; j<3; ++j) {
-      xsf->rotmat[i][j] = 0.0;
-    }
-  }
-  for (i=0; i<3; ++i) {
-    xsf->origin[i] = 0.0;
-    xsf->rotmat[i][i] = 1.0;
-  }
-
-  // since there can be all kinds of data in the file, 
-  // we start by scanning through the whole file and analyse
-  // the available info.
-  char readbuf[256]; // line buffer
-  xsf_keyword_t kw;
-
-  // we loop until can't read anymore.
-  do {
-    if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-
-    again:
-    kw = lookup_keyword(readbuf);
-#ifdef TEST_PLUGIN
-    fprintf(stderr, "keyword: %d / %s", kw, readbuf);
-#endif          
-    
-    switch (kw) {
-      case xsf_ANIMSTEPS:
-#ifdef TEST_PLUGIN
-      {
-        int n;
-        if (1 == sscanf(readbuf, "%*s%d", &n)) {
-          fprintf(stderr, "ANIMSTEPS: found %d steps\n", n);
-        }
-      }
-#endif          
-      break;
-        
-      case xsf_ATOMS: // no specification for the number of atoms, so we
-                      // try to figure them out
-        ++xsf->numsteps;
-        if (xsf->numatoms == 0) { // count atoms only, if we don't know how many
-          while (fgets(readbuf, 256, xsf->fd)) {
-            float x,y,z;
-            // the coordinate lines are <index> <x> <y> <z> with optional forces.
-            if (3 == sscanf(readbuf, "%*s%f%f%f", &x, &y, &z)) {
-              ++xsf->numatoms;
-            } else {
-              // we've most likely read the next keyword. reparse buffer.
-              goto again;
-              break;
-            }
-          }
-#ifdef TEST_PLUGIN
-          fprintf(stderr, "ATOMS: found %d atoms\n", xsf->numatoms);
-#endif          
-        } else { // skip over the lines
-          int n;
-          for (n=0; n < xsf->numatoms; ++n) eatline(xsf->fd);
-        }
-        break;
-        
-      case xsf_PRIMCOORD: // number of atoms is in the next line
-        if (fgets(readbuf, 256, xsf->fd)) {
-          int mol, mult;
-          
-          if (xsf->numatoms == 0) {
-            if (2 == sscanf(readbuf, "%d%d", &mol, &mult)) {
-              xsf->numatoms = mol * mult;
-            } else {
-              xsf->numatoms = mol;
-            }
-          }
-          // skip over atom coordinates
-          int n;
-          for (n=0; n < xsf->numatoms; ++n) eatline(xsf->fd);
-          ++xsf->numsteps; 
-
-#ifdef TEST_PLUGIN
-          fprintf(stderr, "PRIMCOORD: found %d atoms\n", xsf->numatoms);
-#endif          
-        }
-        break;
-        
-      case xsf_CONVCOORD: // number of atoms is in the next line
-        if (fgets(readbuf, 256, xsf->fd)) {
-          int mol, mult, num;
-          
-          num = 0;
-          if (2 == sscanf(readbuf, "%d%d", &mol, &mult)) {
-            num = mol * mult;
-          }
-          
-          // skip over atom coordinates
-          int n;
-          for (n=0; n < num; ++n) eatline(xsf->fd);
-#ifdef TEST_PLUGIN
-          fprintf(stderr, "CONVCOORD: ignoring %d atoms\n", num);
-#endif          
-        }
-        break;
-
-      case xsf_PRIMVEC: // store primitive cell info for rotation of the volumetric data grid vectors
-      {
-        float a[3], b[3], c[3];
-        
-        if (xsf_read_cell(xsf->fd, a, b, c)) {
-          xsf_buildrotmat(xsf, a, b);
-        } else {
-          fprintf(stderr, "xsfplugin) WARNING: error reading unit cell. ignoring unit cell info.\n");
-        }
-      }
-      break;
-      
-      case xsf_CONVVEC: // ignore conventional cells.
-      {
-        int n;
-        for (n=0; n < 3; ++n)
-          eatline(xsf->fd);
-      }
-      break;
-
-      case xsf_BEG_3D_BLOCK: // analyse number of 3d-data sets
-        // ordinarily the parsing of the metadata would be done in read_xsf_metadata()
-        // but since we have to move through the whole file to count its contents,
-        // it is faster to parse it here and just pass the data later.
-
-        if (xsf->vol == NULL) { // initialize the volume set list with 32 entries
-          xsf->numvolmeta = 32;
-          xsf->vol = new molfile_volumetric_t[xsf->numvolmeta];
-        }
-        
-        // next line is title, then check for data blocks
-        fgets(readbuf, 256, xsf->fd);
-        printf("xsfplugin) found grid data block: %s", readbuf);
-
-        do { // loop until we reach the end of the whole block 
-             // or run out of data.
-          if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-          switch (lookup_keyword(readbuf)) {
-            case xsf_BEG_3D_DATA: // fallthrough
-            {
-              int n;
-              molfile_volumetric_t *set;
-              float a[3], b[3], c[3];
-              float orig[3];
-              ++xsf->nvolsets;
-
-              // double the size of the cache for metainfo, if needed
-              if (xsf->nvolsets > xsf->numvolmeta) {
-                molfile_volumetric_t *ptr = xsf->vol;
-                xsf->vol = new molfile_volumetric_t[2 * xsf->numvolmeta];
-                memcpy((void *)xsf->vol, (void *)ptr, xsf->numvolmeta*sizeof(molfile_volumetric_t));
-                xsf->numvolmeta *= 2;
-                delete[] ptr;
-              }
-
-              // get a handle to the current volume set meta data
-              set = &(xsf->vol[xsf->nvolsets - 1]);
-              set->has_color = 0;
-
-              // the begin mark is also the title of the data set.
-              // we need the exact name to later find the start of the data set.
-              strncpy(set->dataname, readbuf, 255);
-              
-              // next is the number of grid points, the origin and
-              // the spanning vectors of the data block
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%d%d%d", &(set->xsize), &(set->ysize), &(set->zsize));
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &orig[0], &orig[1], &orig[2]);
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &a[0], &a[1], &a[2]);
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &b[0], &b[1], &b[2]);
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &c[0], &c[1], &c[2]);
-              
-              // we need to fix up the size of the data points, since xsf file 
-              // store the data points at the borders on both sides.
-              -- set->xsize; -- set->ysize; -- set->zsize;
-
-              // store the realigned axes.
-              for (n=0; n<3; ++n) {
-                set->origin[n] = xsf->rotmat[n][0] * orig[0] 
-                  + xsf->rotmat[n][1] * orig[1] + xsf->rotmat[n][2] * orig[2];
-
-                set->xaxis[n] = xsf->rotmat[n][0] * a[0] 
-                  + xsf->rotmat[n][1] * a[1] + xsf->rotmat[n][2] * a[2];
-                
-                set->yaxis[n] = xsf->rotmat[n][0] * b[0] 
-                  + xsf->rotmat[n][1] * b[1] + xsf->rotmat[n][2] * b[2];
-    
-                set->zaxis[n] = xsf->rotmat[n][0] * c[0] 
-                  + xsf->rotmat[n][1] * c[1] + xsf->rotmat[n][2] * c[2];
-              }
-
-              do { // loop until we reach the end of the data set
-                fgets(readbuf, 256, xsf->fd);
-              } while (xsf_END_3D_DATA != lookup_keyword(readbuf));
-
-              /*   as of VMD version 1.8.3, volumetric data points are 
-               *   expected to represent the center of a grid box. xsf format 
-               *   volumetric data represents the value at the edges of the 
-               *   grid boxes, so we need to shift the internal origin by half 
-               *   a grid box diagonal to have the data at the correct position 
-               *   This will need to be changed again when the plugin interface
-               *   is updated to explicitly allow point/face-centered data sets.
-               */
-              set->origin[0] -= 0.5 * ( set->xaxis[0] / (double) set->xsize
-                                        + set->yaxis[0] / (double) set->ysize
-                                        + set->zaxis[0] / (double) set->zsize);
-              set->origin[1] -= 0.5 * ( set->xaxis[1] / (double) set->xsize
-                                        + set->yaxis[1] / (double) set->ysize
-                                        + set->zaxis[1] / (double) set->zsize);
-              set->origin[2] -= 0.5 * ( set->xaxis[2] / (double) set->xsize
-                                        + set->yaxis[2] / (double) set->ysize
-                                        + set->zaxis[2] / (double) set->zsize);
-            }
-            break;
-
-            default:
-              break;
-          }
-        } while (xsf_END_3D_BLOCK != lookup_keyword(readbuf));
-        
-#ifdef TEST_PLUGIN
-        fprintf(stderr, "found %d volumetric data sets\n", xsf->nvolsets);
-#endif          
-        break;
-
-      case xsf_BEG_2D_BLOCK:
-        do { // skip over data
-          fgets(readbuf, 256, xsf->fd);
-        } while (xsf_END_2D_BLOCK != lookup_keyword(readbuf));
-        break;
-        
-        // periodicity encoding. needed for coordinate wrapping.
-      case xsf_MOLECULE: // fallthrough
-      case xsf_SLAB:     // fallthrough
-      case xsf_POLYMER:  // fallthrough
-      case xsf_CRYSTAL:
-        xsf->pbctype = kw;
-        break;
-
-      case xsf_COMMENT:  // fallthrough
-      case xsf_UNKNOWN:  // fallthrough
-      default:                  // ignore everything unknown
-        break;
-        
-    }
-  } while (! (feof(xsf->fd) || ferror(xsf->fd)));
-#ifdef TEST_PLUGIN
-  fprintf(stderr, "total of %d coordinate sets\n", xsf->numsteps);
-#endif
-  rewind(xsf->fd);
-  *natoms = xsf->numatoms;
-  return xsf;
-}
-
-  
-static int read_xsf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  int i;
-  xsf_t *xsf = (xsf_t *)v;
-
-  // return immediately if there is no structure in this file.
-  if (xsf->numatoms < 1) return MOLFILE_SUCCESS;
-
-  
-  // go to beginning of file and find first set of coordinates
-  rewind(xsf->fd);
-
-  // we loop until we have found, read and parsed the first 
-  // set of atomic coordinates. we only accept ATOMS and PRIMCOORD
-  // sections. if we happen to find a PRIMVEC section, too, we use
-  // that to set the default for animations.
-  char readbuf[1024]; // line buffer
-  do {
-    if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-
-    switch (lookup_keyword(readbuf)) {
-
-      case xsf_PRIMCOORD: // number of atoms is in the next line. skip.
-        eatline(xsf->fd);
-        // fallthrough
-      case xsf_ATOMS: // no specification for the number of atoms, 
-                      // we can use the same parser for both sections.
-
-        /* we set atom mass and VDW radius from the PTE. */
-        *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS;
-
-        for(i=0; i<xsf->numatoms; ++i) {
-          int j;
-          char *k;
-          float coord;
-          molfile_atom_t *atom;
-
-          char buffer[1024];
-          k = fgets(readbuf, 1024, xsf->fd);
-          atom = atoms + i;
-          j=sscanf(readbuf, "%s %f %f %f", buffer, &coord, &coord, &coord);
-          if (k == NULL) {
-            fprintf(stderr, "xsfplugin) structure missing atom(s) in file '%s'\n",xsf->file_name);
-            fprintf(stderr, "xsfplugin) expecting '%d' atoms, found only '%d'\n",xsf->numatoms,i+1);
-            return MOLFILE_ERROR;
-          } else if (j < 4) {
-            fprintf(stderr, "xsfplugin) missing type or coordinate(s) in file '%s' for atom '%d'\n",
-                    xsf->file_name, i+1);
-            return MOLFILE_ERROR;
-          }
-
-          /* handle the case if the first item is an ordinal number 
-           * from the PTE */
-          if (isdigit(buffer[0])) {
-            int idx;
-            idx = atoi(buffer);
-            strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-            atom->atomicnumber = idx;
-            atom->mass = get_pte_mass(idx);
-            atom->radius = get_pte_vdw_radius(idx);
-          } else {
-            int idx;
-            strncpy(atom->name, buffer, sizeof(atom->name));
-            idx = get_pte_idx(buffer);
-            atom->atomicnumber = idx;
-            atom->mass = get_pte_mass(idx);
-            atom->radius = get_pte_vdw_radius(idx);
-          }
-          strncpy(atom->type, atom->name, sizeof(atom->type));
-          atom->resname[0] = '\0';
-          atom->resid = 1;
-          atom->chain[0] = '\0';
-          atom->segid[0] = '\0';
-#ifdef TEST_PLUGIN
-          fprintf(stderr,"xsfplugin) atom %4d: %s  / mass= %f\n", i, atom->name, atom->mass);
-#endif
-        }
-        
-        // ok. done. rewind once more and get the hell out of here.
-        rewind(xsf->fd);
-        return MOLFILE_SUCCESS;
-        break;
-        
-        // read primitive cell info.
-      case xsf_PRIMVEC: 
-      {
-        float a[3], b[3], c[3];
-
-        if (xsf_read_cell(xsf->fd, a, b, c)) { // ignore unit cell info,if we cannot parse it.
-          xsf_readbox(&(xsf->box), a, b, c);
-          xsf_buildrotmat(xsf, a, b);
-          // print warning, if the rotation will be significant:
-          if ((fabs((double) a[1]) + fabs((double) a[2]) + fabs((double) b[2]))
-              > 0.001) {
-            fprintf(stderr, "xsfplugin) WARNING: Coordinates will be rotated to comply \n"
-                    "xsfplugin) with VMD's conventions for periodic display...\n");
-          }
-          xsf_buildinvmat(xsf, a, b, c);
-
-#if defined(TEST_PLUGIN)
-        printf("cell vectors:\n");
-        printf("<a>: %12.8f %12.8f %12.8f\n", a[0], a[1], a[2]);
-        printf("<b>: %12.8f %12.8f %12.8f\n", b[0], b[1], b[2]);
-        printf("<c>: %12.8f %12.8f %12.8f\n", c[0], c[1], c[2]);
-        printf("cell dimensions:\n");
-        printf("a= %12.8f   b= %12.8f   c= %12.8f\n", xsf->box.A, xsf->box.B, xsf->box.C);
-        printf("alpha= %6.2f  beta= %6.2f  gamma= %6.2f\n", xsf->box.alpha, xsf->box.beta, xsf->box.gamma);
-        printf("reciprocal cell vectors:\n");
-        printf("i: %12.8f %12.8f %12.8f\n", xsf->invmat[0][0], xsf->invmat[0][1], xsf->invmat[0][2]);
-        printf("k: %12.8f %12.8f %12.8f\n", xsf->invmat[1][0], xsf->invmat[1][1], xsf->invmat[1][2]);
-        printf("l: %12.8f %12.8f %12.8f\n", xsf->invmat[2][0], xsf->invmat[2][1], xsf->invmat[2][2]);
-        printf("cell rotation matrix:\n");
-        printf("x: %12.8f %12.8f %12.8f\n", xsf->rotmat[0][0], xsf->rotmat[0][1], xsf->rotmat[0][2]);
-        printf("y: %12.8f %12.8f %12.8f\n", xsf->rotmat[1][0], xsf->rotmat[1][1], xsf->rotmat[1][2]);
-        printf("z: %12.8f %12.8f %12.8f\n", xsf->rotmat[2][0], xsf->rotmat[2][1], xsf->rotmat[2][2]);
-#endif
-        }
-      }
-      break;
-
-      default:                  // ignore everything unknown
-        break;
-    }
-  } while (! (feof(xsf->fd) || ferror(xsf->fd)));
-
-  // if we reach this point, some error must have happened.
-  return MOLFILE_ERROR;
-
-}
-
-
-static int read_xsf_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  int i;
-  
-  xsf_t *xsf = (xsf_t *)v;
-
-  // we loop until we have found, read and parsed the next.
-  // set of atomic coordinates. we only accept ATOMS and PRIMCOORD
-  // sections. if we happen to find a PRIMVEC section, too, we use
-  // that to reset the cell parameters.
-
-  char readbuf[1024]; // line buffer
-  do {
-    if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-
-    switch (lookup_keyword(readbuf)) {
-
-      case xsf_PRIMCOORD: // number of atoms is in the next line. skip.
-        eatline(xsf->fd);
-        // fallthrough
-      case xsf_ATOMS: // no specification for the number of atoms, 
-                      // we can use the same parser for both sections.
-
-        for(i=0; i<natoms; ++i) {
-          int j, n;
-          char *k, buffer[1024];
-          float x, y, z;
-          
-          k = fgets(readbuf, 1024, xsf->fd);
-          j=sscanf(readbuf, "%s %f %f %f", buffer, &x, &y, &z);
-
-          if (k == NULL) {
-            return MOLFILE_ERROR;
-          } else if (j < 4) {
-            fprintf(stderr, "xsfplugin) missing type or coordinate(s) in file '%s' for atom '%d'\n",
-                    xsf->file_name, i+1);
-            return MOLFILE_ERROR;
-          } else if (j>=3) {
-            if (ts != NULL) { 
-              // Only save coords if we're given a timestep pointer, 
-              // otherwise assume that VMD wants us to skip past it.
-              float xf, yf, zf;
-              
-              // apply periodic boundary conditions.
-#ifdef TEST_PLUGIN
-                  printf("wrap PBC: before: %12.6f %12.6f %12.6f\n", x, y, z);
-#endif                  
-              switch(xsf->pbctype) {
-                case xsf_CRYSTAL:
-                  xf = xsf->invmat[0][0] * x + xsf->invmat[0][1] * y + xsf->invmat[0][2] * z;
-                  xf = xf - floor((double)xf);
-                  yf = xsf->invmat[1][0] * x + xsf->invmat[1][1] * y + xsf->invmat[1][2] * z;
-                  yf = yf - floor((double)yf);
-                  zf = xsf->invmat[2][0] * x + xsf->invmat[2][1] * y + xsf->invmat[2][2] * z;
-                  zf = zf - floor((double)zf);
-                  x = xsf->box.cell[0][0] * xf + xsf->box.cell[0][1] * yf + xsf->box.cell[0][2] * zf;
-                  y = xsf->box.cell[1][0] * xf + xsf->box.cell[1][1] * yf + xsf->box.cell[1][2] * zf;
-                  z = xsf->box.cell[2][0] * xf + xsf->box.cell[2][1] * yf + xsf->box.cell[2][2] * zf;
-                  break;
-
-                case xsf_SLAB:
-                  xf = xsf->invmat[0][0] * x + xsf->invmat[0][1] * y + xsf->invmat[0][2] * z;
-                  xf = xf - floor((double)xf);
-                  yf = xsf->invmat[1][0] * x + xsf->invmat[1][1] * y + xsf->invmat[1][2] * z;
-                  yf = yf - floor((double)yf);
-                  zf = xsf->invmat[2][0] * x + xsf->invmat[2][1] * y + xsf->invmat[2][2] * z;
-                  x = xsf->box.cell[0][0] * xf + xsf->box.cell[0][1] * yf + xsf->box.cell[0][2] * zf;
-                  y = xsf->box.cell[1][0] * xf + xsf->box.cell[1][1] * yf + xsf->box.cell[1][2] * zf;
-                  z = xsf->box.cell[2][0] * xf + xsf->box.cell[2][1] * yf + xsf->box.cell[2][2] * zf;
-                  break;
-                  
-                case xsf_POLYMER:
-                  xf = xsf->invmat[0][0] * x + xsf->invmat[0][1] * y + xsf->invmat[0][2] * z;
-                  xf = xf - floor((double)xf);
-                  yf = xsf->invmat[1][0] * x + xsf->invmat[1][1] * y + xsf->invmat[1][2] * z;
-                  zf = xsf->invmat[2][0] * x + xsf->invmat[2][1] * y + xsf->invmat[2][2] * z;
-                  x = xsf->box.cell[0][0] * xf + xsf->box.cell[0][1] * yf + xsf->box.cell[0][2] * zf;
-                  y = xsf->box.cell[1][0] * xf + xsf->box.cell[1][1] * yf + xsf->box.cell[1][2] * zf;
-                  z = xsf->box.cell[2][0] * xf + xsf->box.cell[2][1] * yf + xsf->box.cell[2][2] * zf;
-                  break;
-                  
-                case xsf_MOLECULE:
-                  xf = x;
-                  yf = y;
-                  zf = z;
-                  break;
-                  
-                default:
-                  break;
-              }
-              
-#ifdef TEST_PLUGIN
-                  printf("wrap PBC: fract:  %12.6f %12.6f %12.6f\n", xf, yf, zf);
-                  printf("wrap PBC: after: %12.6f %12.6f %12.6f\n", x, y, z);
-#endif                  
-
-              // In order to make the periodic display work, we need to
-              // rotate the coordinates around the origin by the stored
-              // rotation matrix. for xsf files the origin is not explicitely
-              // so far, but since it is already initialized to (0,0,0) it
-              // does no harm, to leave it in here.
-              x -= xsf->origin[0];
-              y -= xsf->origin[1];
-              z -= xsf->origin[2];
-        
-              for (n=0; n<3; ++n) {
-                ts->coords[3*i + n] = (xsf->origin[n] + xsf->rotmat[n][0] * x
-                                       + xsf->rotmat[n][1] * y + xsf->rotmat[n][2] * z);
-              }
-            }
-          } else {
-            break;
-          }
-        }
-        // (re-)set unitcell dimensions
-        if (ts != NULL) { 
-          ts->A = xsf->box.A;
-          ts->B = xsf->box.B;
-          ts->C = xsf->box.C;
-          ts->alpha = xsf->box.alpha;
-          ts->beta  = xsf->box.beta;
-          ts->gamma = xsf->box.gamma;
-        }
-  
-        return MOLFILE_SUCCESS;
-        break;
-        
-        // read and update primitive cell info.
-      case xsf_PRIMVEC: 
-      {
-        float a[3], b[3], c[3];
-        
-        if (xsf_read_cell(xsf->fd, a, b, c)) {
-          xsf_readbox(&(xsf->box), a,b,c);
-          xsf_buildrotmat(xsf, a, b);
-          // print warning, if the rotation will be significant:
-          if ((fabs((double) a[1]) + fabs((double) a[2]) + fabs((double) b[2]))
-              > 0.001) {
-            fprintf(stderr, "xsfplugin) WARNING: Coordinates will be rotated to comply \n"
-                    "xsfplugin) with VMD's conventions for periodic display...\n");
-          }
-          xsf_buildinvmat(xsf, a, b, c);
-
-#if defined(TEST_PLUGIN)
-        printf("new cell vectors:\n");
-        printf("<a>: %12.8f %12.8f %12.8f\n", a[0], a[1], a[2]);
-        printf("<b>: %12.8f %12.8f %12.8f\n", b[0], b[1], b[2]);
-        printf("<c>: %12.8f %12.8f %12.8f\n", c[0], c[1], c[2]);
-        printf("new cell dimensions:\n");
-        printf("a= %12.8f   b= %12.8f   c= %12.8f\n", xsf->box.A, xsf->box.B, xsf->box.C);
-        printf("alpha= %6.2f  beta= %6.2f  gamma= %6.2f\n", xsf->box.alpha, xsf->box.beta, xsf->box.gamma);
-        printf("new reciprocal cell vectors:\n");
-        printf("i: %12.8f %12.8f %12.8f\n", xsf->invmat[0][0], xsf->invmat[0][1], xsf->invmat[0][2]);
-        printf("k: %12.8f %12.8f %12.8f\n", xsf->invmat[1][0], xsf->invmat[1][1], xsf->invmat[1][2]);
-        printf("l: %12.8f %12.8f %12.8f\n", xsf->invmat[2][0], xsf->invmat[2][1], xsf->invmat[2][2]);
-        printf("new cell rotation matrix:\n");
-        printf("x: %12.8f %12.8f %12.8f\n", xsf->rotmat[0][0], xsf->rotmat[0][1], xsf->rotmat[0][2]);
-        printf("y: %12.8f %12.8f %12.8f\n", xsf->rotmat[1][0], xsf->rotmat[1][1], xsf->rotmat[1][2]);
-        printf("z: %12.8f %12.8f %12.8f\n", xsf->rotmat[2][0], xsf->rotmat[2][1], xsf->rotmat[2][2]);
-#endif
-        }
-      }
-      break;
-
-      default:                  // ignore everything unknown
-        break;
-    }
-  } while (! (feof(xsf->fd) || ferror(xsf->fd)));
-
-  // if we reach this point, some error must have happened.
-  return MOLFILE_ERROR;
-}
-
-static int read_xsf_metadata(void *v, int *nvolsets, 
-  molfile_volumetric_t **metadata) {
-  xsf_t *xsf = (xsf_t *)v;
-  *nvolsets = xsf->nvolsets; 
-  *metadata = xsf->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_xsf_data(void *v, int set, float *datablock, float *colorblock) {
-  xsf_t *xsf = (xsf_t *)v;
-  const char *block = xsf->vol[set].dataname;
-  
-  fprintf(stderr, "xsfplugin) trying to read xsf data set %d: %s\n", set, block);
-  
-  int xsize = xsf->vol[set].xsize; 
-  int ysize = xsf->vol[set].ysize;
-  int zsize = xsf->vol[set].zsize;
-  int x, y, z;
-  int n;
-  char readbuf[1024];
-  float dummy;
-  
-  // find data set ...
-  rewind(xsf->fd);
-  do {
-    if (NULL == fgets(readbuf, 1024, xsf->fd)) return MOLFILE_ERROR;
-  } while (strncmp(readbuf, block, 1024));
-  // ... and skip five more lines to get to the beginning of the data
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  
-  // read in the data values
-  // XSF data grids include the points at the border on both sides,
-  // so we have to read and skip over those on one of them.
-  n = 0;
-  for (z=0; z<zsize+1; z++) {
-    for (y=0; y<ysize+1; y++) {
-      for (x=0; x<xsize+1; x++) {
-        if ((x>=xsize) || (y>=ysize) || (z>=zsize)) { 
-          if (fscanf(xsf->fd, "%f", &dummy) != 1) return MOLFILE_ERROR;
-        } else {
-          if (fscanf(xsf->fd, "%f", &datablock[n]) != 1) return MOLFILE_ERROR;
-          ++n;
-        }
-      }
-    }
-  }
-  rewind(xsf->fd);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_xsf_read(void *v) {
-  xsf_t *xsf = (xsf_t *)v;
-
-  fclose(xsf->fd);
-  if (xsf->vol) {
-    delete[] xsf->vol; 
-  }
-  free(xsf->file_name);
-  delete xsf;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xsf";
-  plugin.prettyname = "(Animated) XCrySDen Structure File";
-  plugin.author = "Axel Kohlmeyer, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 10;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "axsf,xsf";
-  plugin.open_file_read = open_xsf_read;
-  plugin.read_structure = read_xsf_structure;
-  plugin.read_next_timestep =read_xsf_timestep;
-  plugin.close_file_read = close_xsf_read;
-  plugin.read_volumetric_metadata = read_xsf_metadata;
-  plugin.read_volumetric_data = read_xsf_data;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms, optflags;
-  void *v;
-  int i, nvolsets, set;
-  molfile_volumetric_t * meta;
-
-
-  printf("got index: %d\n", lookup_keyword("	 ATOMS  "));
-  
-  while (--argc) {
-    ++argv;
-    v = open_xsf_read(*argv, "xsf", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_xsf_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_xsf_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "input contains %d atoms\n", natoms);
-
-    molfile_atom_t atoms[natoms];
-    
-    // try reading the structure info
-    i = read_xsf_structure(v, &optflags, atoms);
-    if (i) {
-      fprintf(stderr, "read_xsf_structure failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "read_xsf_structure succeeded for file %s\n", *argv);
-
-    // try loading the EDM metadata now
-    if (read_xsf_metadata(v, &nvolsets, &meta)) {
-      return 1; // failed to load xsf file
-    }
-    fprintf(stderr, "read_xsf_metadata succeeded for file %s\n", *argv);
-
-    for (set=0; set<nvolsets; set++) {
-      printf("Loading volume set: %d\n", set);   
-      
-      int elements = meta[set].xsize * meta[set].ysize * meta[set].zsize;
-      printf("   Grid Elements: %d\n", elements);
-      printf(" Grid dimensions: X: %d Y: %d Z: %d\n", 
-             meta[set].xsize, meta[set].ysize, meta[set].zsize);
-
-      float * voldata = (float *) malloc(sizeof(float) * elements);
-      float * coldata = NULL;
-
-      if (meta[set].has_color) {
-        coldata = (float *) malloc(sizeof(float) * elements * 3);
-      }
-
-      // try loading the data sets now
-      if (read_xsf_data(v, set, voldata, coldata)) {
-        return 1; // failed to load xsf file
-      }
-
-      printf("First 6 elements:\n   ");
-      for (i=0; i<6; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-
-      printf("Last 6 elements:\n   ");
-      for (i=elements - 6; i<elements; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-    }
-
-    molfile_timestep_t ts;
-    ts.coords = new float[3*natoms];
-    
-    if (read_xsf_timestep(v, natoms, &ts)) {
-      printf("read_xsf_timestep 0: failed\n");
-    } else {
-      printf("read_xsf_timestep 0: success\n");
-    }
-    
-    if (read_xsf_timestep(v, natoms, &ts)) {
-      printf("read_xsf_timestep 1: failed\n");
-    } else {
-      printf("read_xsf_timestep 1: success\n");
-    }
-    
-    close_xsf_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xyzplugin.c b/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xyzplugin.c
deleted file mode 100644
index adc0b74ab6fb6f67b5f67d44c4a6dc18eb1099c5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins-clang/molfile_plugin/src/xyzplugin.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: xyzplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.37 $       $Date: 2016/11/28 05:01:55 $
- *
- ***************************************************************************/
-
-/*
- *  XMol XYZ molecule file format:
- *    XYZ files are a simple molecule file format suitable for output
- *    by homegrown software since they are very minimalistic.  They don't
- *    even include bonding information.
- *
- *  [ N                       ] # of atoms, required by this xyz reader plugin
- *  [ molecule name           ] name of molecule (can be blank)
- *  atom1 x y z [optional data] atom name followed by xyz coords 
- *  atom2 x y z [ ...         ] and (optionally) other data.
- *  ...                         instead of atom name the atom number in 
- *  atomN x y z [ ...         ] the PTE can be given.
- *  ...
- *
- *  Note that this plugin currently ignores everything following the z 
- *  coordinate (the optional data fields).
- *
- *  Sample input file for XMol:
- *  3
- *  Water Molecule - XYZ Format
- *  O      .000000     .000000     .114079
- *  H      .000000     .780362    -.456316
- *  H      .000000    -.780362    -.456316
- *                      
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#include "periodic_table.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  char *file_name;
-  molfile_atom_t *atomlist;
-} xyzdata;
- 
-static void *open_xyz_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  xyzdata *data;
-  int i;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  data = (xyzdata *)malloc(sizeof(xyzdata));
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* First line is the number of atoms   */
-  i = fscanf(data->file, "%d", natoms);
-  if (i < 1) {
-    fprintf(stderr, "\n\nread) ERROR: xyz file '%s' should have the number of atoms in the first line.\n", filename);
-    return NULL;
-  }
-  data->numatoms=*natoms;
-
-  rewind(fd);
-
-  return data;
-}
-
-static int read_xyz_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  int i, j;
-  char *k;
-  float coord;
-  molfile_atom_t *atom;
-  xyzdata *data = (xyzdata *)mydata;
-  char buffer[1024], fbuffer[1024];
-
-  /* skip over the first two lines */
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-
-  /* we set atom mass and VDW radius from the PTE. */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS; 
-
-  for(i=0; i<data->numatoms; i++) {
-    k = fgets(fbuffer, 1024, data->file);
-    atom = atoms + i;
-    j=sscanf(fbuffer, "%s %f %f %f", buffer, &coord, &coord, &coord);
-    if (k == NULL) {
-      fprintf(stderr, "xyz structure) missing atom(s) in file '%s'\n", data->file_name);
-      fprintf(stderr, "xyz structure) expecting '%d' atoms, found only '%d'\n", data->numatoms, i);
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "xyz structure) missing type or coordinate(s) in file '%s' for atom '%d'\n",
-          data->file_name, i+1);
-      return MOLFILE_ERROR;
-    }
-
-    /* handle the case if the first item is an ordinal number 
-     * from the PTE */
-    if (isdigit(buffer[0])) {
-      int idx;
-      idx = atoi(buffer);
-      strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-      atom->atomicnumber = idx;
-      atom->mass = get_pte_mass(idx);
-      atom->radius = get_pte_vdw_radius(idx);
-    } else {
-      int idx;
-      strncpy(atom->name, buffer, sizeof(atom->name));
-      idx = get_pte_idx(buffer);
-      atom->atomicnumber = idx;
-      atom->mass = get_pte_mass(idx);
-      atom->radius = get_pte_vdw_radius(idx);
-    }
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    /* skip to the end of line */
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_xyz_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j;
-  char atom_name[1024], fbuffer[1024], *k;
-  float x, y, z;
-  
-  xyzdata *data = (xyzdata *)mydata;
-  
-  /* skip over the first two lines */
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-
-  /* read the coordinates */
-  for (i=0; i<natoms; i++) {
-    k = fgets(fbuffer, 1024, data->file);
-
-    /* Read in atom type, X, Y, Z, skipping any remaining data fields */
-    j = sscanf(fbuffer, "%s %f %f %f", atom_name, &x, &y, &z);
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "xyz timestep) missing type or coordinate(s) in file '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (j >= 4) {
-      if (ts != NULL) { 
-        /* only save coords if we're given a timestep pointer, */
-        /* otherwise assume that VMD wants us to skip past it. */
-        ts->coords[3*i  ] = x;
-        ts->coords[3*i+1] = y;
-        ts->coords[3*i+2] = z;
-      }
-    } else {
-      break;
-    }
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_xyz_read(void *mydata) {
-  xyzdata *data = (xyzdata *)mydata;
-  fclose(data->file);
-  free(data->file_name);
-  free(data);
-}
-
-
-static void *open_xyz_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  xyzdata *data;
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    fprintf(stderr, "Error) Unable to open xyz file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (xyzdata *)malloc(sizeof(xyzdata));
-  data->numatoms = natoms;
-  data->file = fd;
-  data->file_name = strdup(filename);
-  return data;
-}
-
-static int write_xyz_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  xyzdata *data = (xyzdata *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->numatoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->numatoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-static int write_xyz_timestep(void *mydata, const molfile_timestep_t *ts) {
-  xyzdata *data = (xyzdata *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  const char  *label;
-  int i;
-
-  fprintf(data->file, "%d\n", data->numatoms);
-  fprintf(data->file, " generated by VMD\n");
-  
-  atom = data->atomlist;
-  pos = ts->coords;
-  
-  for (i = 0; i < data->numatoms; ++i) {
-    if (atom->atomicnumber > 0) {
-       label=pte_label[atom->atomicnumber];
-    } else {
-       label=atom->name;
-    }
-    fprintf(data->file, " %-2s %15.6f %15.6f %15.6f\n", 
-            label, pos[0], pos[1], pos[2]);
-    ++atom; 
-    pos += 3;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_xyz_write(void *mydata) {
-  xyzdata *data = (xyzdata *)mydata;
-  fclose(data->file);
-  free(data->atomlist);
-  free(data->file_name);
-  free(data);
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xyz";
-  plugin.prettyname = "XYZ";
-  plugin.author = "Mauricio Carrillo Tripp, John E. Stone, Axel Kohlmeyer";
-  plugin.majorv = 1;
-  plugin.minorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "xyz,xmol";
-  plugin.open_file_read = open_xyz_read;
-  plugin.read_structure = read_xyz_structure;
-  plugin.read_next_timestep = read_xyz_timestep;
-  plugin.close_file_read = close_xyz_read;
-  plugin.open_file_write = open_xyz_write;
-  plugin.write_structure = write_xyz_structure;
-  plugin.write_timestep = write_xyz_timestep;
-  plugin.close_file_write = close_xyz_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_xyz_read(*argv, "xyz", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_xyz_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_xyz_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_xyz_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_xyz_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/LICENSE b/pymolfile/molfile/vmd_molfile_plugins/LICENSE
deleted file mode 100644
index 9032b635eee892ca4e414f17d0434d89f0e4bc1e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/LICENSE
+++ /dev/null
@@ -1,58 +0,0 @@
-
-With the exception of specifically marked plugins or source files
-which have different license terms due to inclusion of source code
-or data under different restrictions, the software contained
-within the VMD plugin tree is subject to the UIUC Open Source license 
-which is included below the explicitly listed exceptions below:
-
-Specifically listed exceptions: 
-  hesstrans -- Includes the "newmat10B" free C++ matrix library by
-               Robert Davies (robert@statsresearch.co.nz)
-  intersurf -- See Intersurf INRIA license text
-     pmepot -- NAMD License
-     psfgen -- NAMD License
-      stamp -- See STAMP license
-   vmdtkcon -- See TkCon license
-
-   Prof. A. MacKerell's CHARMM Empirical Force Fields -- 
-     (excerpts included with plugins: 
-      'autoionize', 'membrane', 'readcharmmtop', 'readcharmmpar', 'solvate')
-     http://www.pharmacy.umaryland.edu/faculty/amackere/force_fields.htm   
-
-------------------------------------------------------------------------------
-
-University of Illinois Open Source License
-Copyright 2006 Theoretical and Computational Biophysics Group, 
-All rights reserved.
-
-Developed by:		Theoretical and Computational Biophysics Group
-			University of Illinois at Urbana-Champaign
-			http://www.ks.uiuc.edu/
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the Software), to deal with 
-the Software without restriction, including without limitation the rights to 
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
-of the Software, and to permit persons to whom the Software is furnished to 
-do so, subject to the following conditions:
-
-Redistributions of source code must retain the above copyright notice, 
-this list of conditions and the following disclaimers.
-
-Redistributions in binary form must reproduce the above copyright notice, 
-this list of conditions and the following disclaimers in the documentation 
-and/or other materials provided with the distribution.
-
-Neither the names of Theoretical and Computational Biophysics Group, 
-University of Illinois at Urbana-Champaign, nor the names of its contributors 
-may be used to endorse or promote products derived from this Software without 
-specific prior written permission.
-
-THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
-OTHER DEALINGS WITH THE SOFTWARE.
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/Make-arch b/pymolfile/molfile/vmd_molfile_plugins/Make-arch
deleted file mode 100755
index c97290cebd0c343b6f5b2d7cf46456c0b37bff42..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/Make-arch
+++ /dev/null
@@ -1,764 +0,0 @@
-##
-## Per-architecture plugin compilation rules 
-## Copyright 2002, Board of Trustees of the University of Illinois
-## Theoretical Biophysics Group
-##
-
-make-arch-help:
-	@echo "Type 'make arch' where arch is one of the platforms listed below:"
-	@echo "--------------------------------------"
-	@echo " AIX4"
-	@echo " AIX5"
-	@echo " AIX5_64"
-	@echo " AIX6_64"
-	@echo " BLUEGENEQ"
-	@echo " BLUEWATERS"
-	@echo " CRAY_XC"
-	@echo " CRAY_XK"
-	@echo " FREEBSD"
-	@echo " FREEBSDAMD64"
-	@echo " HPUX11"
-	@echo " IRIX6"
-	@echo " IRIX6_64"
-	@echo " LINUX"
-	@echo " LINUXALPHA"
-	@echo " LINUXAMD64"
-	@echo " LINUXPPC"
-	@echo " LINUXPPC64"
-	@echo " LINUXIA64"
-	@echo " MACOSX"
-	@echo " MACOSXX86"
-	@echo " MACOSXX86_64"
-	@echo " MACOSXX86_64GCC"
-	@echo " MACOSXX86_64GCCTNG"
-	@echo " NETBSD"
-	@echo " OPENPOWER"
-	@echo " SOLARIS2"
-	@echo " SOLARIS2_64"
-	@echo " SOLARISX86"
-	@echo " SOLARISX86_64"
-	@echo " SUMMIT"
-	@echo " TRU64"
-	@echo " T3E"
-	@echo " WIN32"
-	@echo " WIN32-debug"
-	@echo " WIN64"
-	@echo "--------------------------------------"
-	@echo "Type 'make clean' to clean the compilation area"
-	@echo "Type 'make arch OPT=myopt' to specfy additional options."
-	@echo "Options include: "
-	@echo "  TCLINC: Include path for Tcl"
-	@echo "  TCLLIB: Library path for Tcl"
-
-##
-## Android specific configuration items
-##
-ANDROIDBINS = /Projects/collaboratory/kvandivo/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin
-ANDROIDINCS = -DANDROID -I/home/kvandivo/Proj/ndk/sources/cxx-stl/stlport/stlport -I/home/kvandivo/Proj/ndk/sources/cxx-stl/system/include -I/home/kvandivo/Proj/ndk/platforms/android-14/arch-arm/usr/include 
-ANDROIDABI = arm-linux-androideabi-
-ANDROIDLIBS = -L/home/kvandivo/Proj/ndk/platforms/android-14/arch-arm/usr/lib
-ANDROIDSYSROOT = --sysroot=/home/kvandivo/Proj/ndk/platforms/android-14/arch-arm
-
-AIX4:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX4" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -qarch=com -qtune=pwr3" \
-	"CXXFLAGS = -w -qstrict -Q -qarch=com -qtune=pwr3" \
-	"LDFLAGS = -qarch=com -qtune=pwr3" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -qarch=com -qtune=pwr3"
-
-AIX5:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX5" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -qarch=com -qtune=pwr5" \
-	"CXXFLAGS = -w -qstrict -Q -qarch=com -qtune=pwr5" \
-	"LDFLAGS = -qarch=com -qtune=pwr5" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -qarch=com -qtune=pwr5"
-
-AIX5_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX5_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -q64 -qarch=com -qtune=pwr5" \
-	"CXXFLAGS = -w -qstrict -Q -q64 -qarch=com -qtune=pwr5" \
-	"LDFLAGS = -q64 -qarch=com -qtune=pwr5" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar -X64" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -q64 -qarch=com -qtune=pwr5"
-
-AIX6_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = AIX6_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = xlc" \
-	"CXX = xlC" \
-	"DEF = -D" \
-	"CCFLAGS = -w -qinlglue -q64 -qarch=com -qtune=pwr5" \
-	"CXXFLAGS = -w -qstrict -Q -q64 -qarch=com -qtune=pwr5" \
-	"LDFLAGS = -q64 -qarch=com -qtune=pwr5" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar -X64" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -bM:SRE -bnoentry -bexpall -lm -q64 -qarch=com -qtune=pwr5"
-
-ANDROIDARMV7A:
-	$(MAKE) staticlibs \
-	"ARCH = ANDROIDARMV7A" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = $(ANDROIDBINS)/$(ANDROIDABI)gcc" \
-	"CXX = $(ANDROIDBINS)/$(ANDROIDABI)g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC -Wall -Wno-psabi -MMD -MP -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv7-a -msoft-float -mfpu=vfp -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstac $(ANDROIDINCS)" \
-	"CXXFLAGS = -O2 -fPIC -Wall -Wno-psabi -MMD -MP -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv7-a -msoft-float -mfpu=vfp -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstac $(ANDROIDINCS)" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = echo"
-
-BLUEGENEQ:
-	$(MAKE) staticlibs \
-	"ARCH = BGQ" \
-	"COPTO = -qpic -o " \
-	"LOPTO = -qpic -c -o " \
-	"CC = bgxlc_r" \
-	"CXX = bgxlC_r" \
-	"DEF = -D" \
-	"CCFLAGS = -w " \
-	"CXXFLAGS = -w " \
-	"LDFLAGS = -q64 -qarch=qp -qtune=qp" \
-	"TCLLDFLAGS = -ltcl8.4" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar " \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = xlC -lm -q64 -qarch=qp -qtune=qp"
-
-BLUEWATERS:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = BLUEWATERS" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-CRAY_XC:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = CRAY_XC" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-CRAY_XK:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = CRAY_XK" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-	
-HPUX11:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = HPUX11" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc" \
-	"CXX = aCC" \
-	"DEF = -D" \
-	"CCFLAGS = +O2 +DAportable -Ae +z" \
-	"CXXFLAGS = +O2 +DAportable +z" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = ld -b"
-
-IRIX6:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = IRIX6" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -n32 -mips3 -KPIC" \
-	"CXX = CC -n32 -mips3 -KPIC" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fullwarn" \
-	"CXXFLAGS = -O2 -fullwarn" \
-	"LDFLAGS = -n32 -mips3" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -shared"
- 
-IRIX6_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = IRIX6_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -64 -mips4 -KPIC" \
-	"CXX = CC -64 -mips4 -KPIC" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fullwarn" \
-	"CXXFLAGS = -O2 -fullwarn" \
-	"LDFLAGS = -64 -mips4" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -shared -64 -mips4"
- 
-FREEBSD:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = FREEBSD" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -Wall -I/usr/local/include/tcl8.5" \
-	"CXXFLAGS = -O2 -Wall" \
-	"TCLLDFLAGS = -L/usr/local/lib -ltcl85" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-FREEBSDAMD64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = FREEBSD" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -Wall -I/usr/local/include/tcl8.5" \
-	"CXXFLAGS = -m64 -O2 -Wall" \
-	"TCLLDFLAGS = -L/usr/local/lib -ltcl85" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUX:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUX" \
-	"COPTO = -fPIC -m32 -o " \
-	"LOPTO = -fPIC -m32 -lstdc++ -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m32 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m32 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-	
-LINUXALPHA:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXALPHA" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = ccc" \
-	"CXX = cxx" \
-	"DEF = -D" \
-	"CCFLAGS = -O4 -arch host -tune host" \
-	"CXXFLAGS = -O4 -arch host -tune host" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXAMD64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXAMD64" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -lstdc++ -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXCARMA:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXCARMA" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O3 -fPIC -Wall -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3-d16 -ffast-math -fno-strict-aliasing" \
-	"CXXFLAGS = -O3 -fPIC -Wall -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3-d16 -ffast-math -fno-strict-aliasing" \
-	"TCLLDFLAGS = -ltcl8.6 -lz -ldl -lpthread" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-	
-LINUXPPC:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXPPC" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -lstdc++ -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC -Wall" \
-	"CXXFLAGS = -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXPPC64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXPPC64" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-LINUXIA64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXIA64" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC -Wall" \
-	"CXXFLAGS = -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -shared"
-
-LINUXIA64-icc:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = LINUXIA64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = icc" \
-	"CXX = icpc" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -fPIC" \
-	"CXXFLAGS = -O2 -fPIC" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = icc -shared"
-	
-MACOSX:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSX" \
-	"COPTO = -fPIC -o " \
-	"LOPTO = -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -framework Tcl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = c++ -bundle" \
-	"TCLSHLD = c++ -dynamiclib"
-
-MACOSXX86:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSXX86" \
-	"COPTO = -m32 -fPIC -o " \
-	"LOPTO = -m32 -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -m32 -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -m32 -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -framework Tcl" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = c++ -bundle" \
-	"TCLSHLD = c++ -dynamiclib"
-
-MACOSXX86_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSXX86_64" \
-	"COPTO = -m64 -fPIC -o " \
-	"LOPTO = -m64 -fPIC -o " \
-	"CC = cc" \
-	"CXX = c++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"NETCDFLIB = -L/usr/local/lib " \
-	"NETCDFINC = -I/usr/local/include " \
-        "TNGLDFLAGS = -ltng_io"
-        "TNGLIB = -L../lib"
-        "TNGINC = -I../lib"
-        "EXPATLDFLAGS = -lexpat"
-        "EXPATLIB = -L/usr/lib"
-        "EXPATINC = -I/usr/include"
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = c++ -bundle" \
-	"TCLSHLD = c++ -dynamiclib"
-
-MACOSXX86_64GCC:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSXX86_64GCC" \
-	"COPTO = -m64 -fPIC -o " \
-	"LOPTO = -m64 -fPIC -o " \
-	"CC = gcc-7" \
-	"CXX = g++-7" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"NETCDFLIB = -L/usr/local/Cellar/netcdf/4.4.1.1_6/lib " \
-	"NETCDFINC = -I/usr/local/Cellar/netcdf/4.4.1.1_6/include " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = g++-7 -shared" \
-	"TCLSHLD = g++-7 -dynamiclib"
-
-MACOSXX86_64GCCTNG:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = MACOSXX86_64GCC" \
-	"COPTO = -m64 -fPIC -o " \
-	"LOPTO = -m64 -fPIC -o " \
-	"CC = gcc-7" \
-	"CXX = g++-7" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"CXXFLAGS = -m64 -Os -Wall -fPIC -dynamic" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"NETCDFLIB = -L/usr/local/Cellar/netcdf/4.4.1.1_6/lib " \
-	"NETCDFINC = -I/usr/local/Cellar/netcdf/4.4.1.1_6/include " \
-        "TNGLDFLAGS = -ltng_io" \
-        "TNGLIB = -L/Users/bonat/TNG/tng/build/lib" \
-        "TNGINC = -I/Users/bonat/TNG/tng/include" \
-        "EXPATLDFLAGS = -lexpat" \
-        "EXPATLIB = -L/usr/local/Cellar/expat/2.2.4/lib" \
-        "EXPATINC = -I/usr/local/Cellar/expat/2.2.4/include" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = ranlib" \
-	"LIBTOOL = libtool -dynamic" \
-	"SHLD = g++-7 -shared" \
-	"TCLSHLD = g++-7 -dynamiclib"
-
-NETBSD:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = NETBSD" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -O2 -Wall -ansi" \
-	"CXXFLAGS = -O2 -Wall" \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-OPENPOWER:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = OPENPOWER" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-SOLARIS2:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARIS2" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -mt -fast -xarch=v8plusa" \
-	"CXX = CC -mt -fast -xarch=v8plusa" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -mt -fast -xarch=v8plusa -G"
-
-SOLARIS2_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARIS2_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -D__EXTENSIONS__ -fast -mt -xarch=v9a" \
-	"CXX = CC -D__EXTENSIONS__ -fast -mt -xarch=v9a" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"NETCDFLDFLAGS = -lnetcdf -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -D__EXTENSIONS__ -xarch=v9a -G"
-
-SOLARISX86:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARISX86" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -mt -fast -xarch=native" \
-	"CXX = CC -mt -fast -xarch=native" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -mt -fast -xarch=native -G"
-
-SOLARISX86_64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SOLARISX86_64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc -D__EXTENSIONS__ -fast -mt -xarch=native64" \
-	"CXX = CC -D__EXTENSIONS__ -fast -mt -xarch=native64" \
-	"DEF = -D" \
- 	"CCFLAGS = -KPIC " \
- 	"CXXFLAGS = -KPIC " \
-	"TCLLDFLAGS = -ltcl8.5 -lsocket -lnsl -ldl" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = cc -D__EXTENSIONS__ -xarch=native64 -G"
-
-SUMMIT:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = SUMMIT" \
-	"COPTO = -fPIC -m64 -o " \
-	"LOPTO = -fPIC -m64 -o " \
-	"CC = gcc" \
-	"CXX = g++" \
-	"DEF = -D" \
-	"CCFLAGS = -m64 -O2 -fPIC -Wall" \
-	"CXXFLAGS = -m64 -O2 -fPIC -Wall" \
-	"TCLLDFLAGS = -ltcl8.5 -ldl" \
-	"NETCDFLDFLAGS = " \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLD = gcc -shared"
-
-T3E:
-	$(MAKE) staticlibs \
-	"ARCH = T3E" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc" \
-	"CXX = CC" \
-	"DEF = -D" \
-	"CCFLAGS = -O2" \
-	"CXXFLAGS = -O2" \
-	"LDFLAGS = " \
-	"TCLLDFLAGS = -ltcl8.5" \
-	"NETCDFLDFLAGS = -lnetcdf" \
-	"AR = ar" \
-	"NM = nm" \
-	"RANLIB = touch" \
-	"SHLD = echo"
-
-TRU64:
-	$(MAKE) dynlibs staticlibs bins \
-	"ARCH = TRU64" \
-	"COPTO = -o " \
-	"LOPTO = -o " \
-	"CC = cc" \
-	"CXX = cxx" \
-	"DEF = -D" \
- 	"CCFLAGS = -fast" \
- 	"CXXFLAGS = -fast" \
-	"TCLLDFLAGS = -ltcl8.5 -lm" \
-	"NETCDFLDFLAGS = -lnetcdf " \
-	"AR = ar" \
-	"NM = nm -B" \
-	"RANLIB = touch" \
-	"SHLD = ld -shared"
-
-WIN32:
-	$(MAKE) dynlibs win32staticlibs win32bins \
-	"ARCH = WIN32" \
-	"COPTO = /Fo" \
-	"LOPTO = /OUT:" \
-	"CC = cl.exe /nologo /MT /DWIN32" \
-	"CXX = cl.exe /nologo /MT /TP /DWIN32" \
-	"DEF = /D" \
-	"CCFLAGS = /O2 /G5" \
-	"CXXFLAGS = /O2 /G5" \
-	"TCLLDFLAGS = tcl85.lib" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLDFLAGS = /D\"VMDPLUGIN_EXPORTS\"" \
-	"SHLD = link /DLL /nologo /incremental:no \
-		kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
-		advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
-		odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib /OPT:REF"
-
-WIN32-debug:
-	$(MAKE) dynlibs win32staticlibs win32bins \
-	"ARCH = WIN32-debug" \
-	"COPTO = /Fo" \
-	"LOPTO = /OUT:" \
-	"CC = cl.exe /nologo /MTd /DWIN32" \
-	"CXX = cl.exe /nologo /MTd /TP /DWIN32" \
-	"DEF = /D" \
-	"CCFLAGS = /ZI /Od /G5 /D\"_DEBUG\"" \
-	"CXXFLAGS = /ZI /Od /G5 /D\"_DEBUG\"" \
-	"TCLLDFLAGS = tcl85.lib" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLDFLAGS = /D\"VMDPLUGIN_EXPORTS\"" \
-	"SHLD = link /DLL /nologo /incremental:no /debug /warn:4 \
-		kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
-		advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
-		odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib /OPT:REF"
-
-
-WIN64:
-	$(MAKE) dynlibs win32staticlibs win32bins \
-	"ARCH = WIN64" \
-	"COPTO = /Fo" \
-	"LOPTO = /OUT:" \
-	"CC = cl.exe /nologo /MT /DWIN64" \
-	"CXX = cl.exe /nologo /MT /TP /DWIN64" \
-	"DEF = /D" \
-	"CCFLAGS =  /EHsc /Wp64 /wd4996 /O2 /D\"_CRT_SECURE_NO_DEPRECATE\"" \
-	"CXXFLAGS = /EHsc /Wp64 /wd4996 /O2 /D\"_CRT_SECURE_NO_DEPRECATE\"" \
-	"TCLLDFLAGS = tcl85.lib" \
-	"AR = ar" \
-	"NM = nm -p" \
-	"RANLIB = touch" \
-	"SHLDFLAGS = /D\"VMDPLUGIN_EXPORTS\"" \
-	"SHLD = link /DLL /nologo /incremental:no \
-		kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
-		advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
-		odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib /MACHINE:X64 /OPT:REF"
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/Makefile b/pymolfile/molfile/vmd_molfile_plugins/Makefile
deleted file mode 100755
index 51e8810378822ba340c39309f0e23069f9393e2e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/Makefile
+++ /dev/null
@@ -1,82 +0,0 @@
-##
-## Plugin compilation and distribution rules
-## Copyright 2002-2011, Board of Trustees of the University of Illinois
-## Theoretical and Computational Biophysics Group
-##
-## $Id: Makefile,v 1.141 2016/07/13 19:24:24 johns Exp $
-## 
-.SILENT:
-
-default: make-arch-help
-
-world:
-	@echo "Building all supported targets..."
-	csh -f build.csh
-
-# These plugins were, at one time, kept in a separate multiseq CVS tree and 
-# need to be periodically synced up with the main VMD plugin CVS when updated.
-# They are listed separately here to make this distinction more transparent.
-#MSEQBUILDDIRS = blast clustalw libbiokit \
-                multiseq multiseqdialog phylotree \
-                psipred seqdata seqedit stamp
-
-# When building from the independent multiseq tree, we'll use an empty list
-# since the dependency will be dealt with manually.
-MSEQBUILDDIRS = 
-
-# The Intersurf plugin is compiled manually and should only be
-# listed if the binaries are up-to-date for the target platform(s)
-#INTERSURF = intersurf
-INTERSURF = 
-
-# List of plugins to build
-#   Note: molfile plugins must be first since some of the 
-#         other plugins directly depend on them
-BUILDDIRS = \
-  $(MSEQBUILDDIRS) \
-  $(INTERSURF)
-
-INCLUDEDIR = include
-PLUGINHEADERS = vmdplugin.h molfile_plugin.h vmdconio.h
-
-distrib: 
-	@echo "Populating distribution directory with compiled plugins"
-	-mkdir -p $(PLUGINDIR)/include
-	for header in $(PLUGINHEADERS); do cp -p $(INCLUDEDIR)/$$header $(PLUGINDIR)/include || exit 1 ; done
-	for dir in molfile_plugin $(BUILDDIRS); do cd $$dir && $(MAKE) distrib && cd .. || exit 1 ; done
-
-include Make-arch
-
-molfilelibs:
-	cd molfile_plugin; $(MAKE) dynlibs && cd .. || exit 1
-	cd molfile_plugin; $(MAKE) staticlibs && cd .. || exit 1
-
-win32molfilelibs:
-	cd molfile_plugin; $(MAKE) dynlibs && cd .. || exit 1
-	cd molfile_plugin; $(MAKE) win32staticlibs && cd .. || exit 1
-
-dynlibs: molfilelibs
-	for dir in $(BUILDDIRS); do cd $$dir && $(MAKE) dynlibs && cd .. || exit 1 ; done
-
-staticlibs: molfilelibs
-	for dir in $(BUILDDIRS); do cd $$dir && $(MAKE) staticlibs && cd .. || exit 1 ; done
-
-win32staticlibs: win32molfilelibs
-	for dir in $(BUILDDIRS); do cd $$dir && $(MAKE) win32staticlibs && cd .. || exit 1 ; done
-
-bins:
-	for dir in molfile_plugin $(BUILDDIRS); do cd $$dir && $(MAKE) bins && cd .. || exit 1 ; done
-
-win32bins:
-	for dir in molfile_plugin $(BUILDDIRS); do cd $$dir && $(MAKE) win32bins && cd .. || exit 1 ; done
-
-clean:
-	find compile \( -name \*.o -o -name \*.a -o -name \*.so -o -name \*.exp -o -name \*.lib -o -name \*.h \) -print | xargs rm -f
-	find compile \( -name lib_\* \) -print | xargs rm -rf
-	rm -f log.*
-	rm -f molfile_plugin/so_locations
-
-checkperms:
-	@echo "Looking for bad file permissions..."
-	find . ! -perm +004
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/README b/pymolfile/molfile/vmd_molfile_plugins/README
deleted file mode 100644
index 57d5187ce476e3844ae89fe645f9e974c6ed2eb8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/README
+++ /dev/null
@@ -1,43 +0,0 @@
-VMD Plugin README
------------------
-  This directory is the root of the plugin directory for VMD.  
-VMD plugins are designed to add new functionality and support for new types
-of files or external programs without compiling that functionality into the
-main body of VMD's code.  Most plugins take the form of a shared library 
-(files named xxx.so or xxx.dll) which can be detected by VMD and loaded at 
-run time.  The plugin and the application communicate through a well-defined 
-API, which makes the plugin more reusable by avoiding direct coupling to 
-VMD's internal data structures.  Similarly, plugins can be upgraded at
-any time, independent of VMD itself.
-
-For additional information on compiling the plugins and building VMD,
-please read the web-based plugin documentation here:
-  http://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/
-
-Plugin directory structure
---------------------------
-/_plugin: 
-  Directories that end in _plugin are plugin source repositories.  All 
-plugins of a given type (i.e., which use the same API) should be placed in the
-corresponding directory.  Each plugin directory contains the following 
-subdirectories:
- - src: source code for all plugins of that type;
- - msvc: Microsoft Visual Studio project files for each plugin;
- - doc: documentation for each plugin.
-The plugin directory also contains a Makefile for compiling all the plugins.
-The Makefile currently is for a gcc target only.
-
-/compile:
-  Contains compiled binary plugins, both static and dynamic, as well as
-related header files, etc. 
-
-/include: 
-  This directory contains the VMD plugin API header files, including
-vmdplugin.h (the base-level plugin header) as well as headers for other plugin
-types.  Alternatively, these files may be linked from the VMD source tree.
-
-/msvc: 
-  Contains a Microsoft Visual Studio workspace file for compiling all
-the plugins for the Win32 platform.
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin-s.o
deleted file mode 100644
index 3696aa6820c5729f168be577bd1222b283ce1e59..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin.o
deleted file mode 100644
index b3b639bbc9ff99b16ec142c7220bb408012ad1ab..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin.so
deleted file mode 100755
index 56f3fca1f968f864d0b3ec59a695414a0e96c3fe..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/abinitplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin-s.o
deleted file mode 100644
index a9a143127d128c9917ce853ca557cc68ce35521d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin.o
deleted file mode 100644
index ffca8a26019d274e58e723f56ff64cb66b22bf7b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin.so
deleted file mode 100755
index 76cb3a3597601ce599b1d163d86e35bce4807962..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/avsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin-s.o
deleted file mode 100644
index 6d009f2e08e6560e00a73b44027112d47bc07c37..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin.o
deleted file mode 100644
index 820d6c9d04bf82e7ca01208c54d762e149d0d206..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin.so
deleted file mode 100755
index 31b47b2b2b27590a909e7ca87a56357480a2a5da..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/babelplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin-s.o
deleted file mode 100644
index d85bfc37eb91ce2d1098de78d0396b962fdfb33d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin.o
deleted file mode 100644
index 2086f831b247bf32e5f579609d7f4cd16df5bbaf..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin.so
deleted file mode 100755
index 81a2fc5341c3b3770f1cd8d07e6dcbb95c744078..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/basissetplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin-s.o
deleted file mode 100644
index 9f006bd8825d2ad6343a33e584873333ae9e3530..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin.o
deleted file mode 100644
index 5a93ec10a10e2c4de75b285d17c57a3d2f43fd02..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin.so
deleted file mode 100755
index cf708117692ee11290603b48beac34b5091ee273..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/bgfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin-s.o
deleted file mode 100644
index 27316a43109438496382cfb6627d5c750f5aa688..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin.o
deleted file mode 100644
index 1d570dd9b68bebd6546f37b703505322f49035f9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin.so
deleted file mode 100755
index e2327306236279d0e09fc8ccdb66901b140a1537..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/binposplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin-s.o
deleted file mode 100644
index 6eece18a56fcf5b73146c4a9414de40ebfd385db..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin.o
deleted file mode 100644
index 63fe8791978eca5ec6dd195b1553db47e27d1198..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin.so
deleted file mode 100755
index f0c0b48ddeccf4b2e030b093a331613c990beb6b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/biomoccaplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin-s.o
deleted file mode 100644
index 44de9df2b9a0bb9b4625ed66b77dcfcf745fab41..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin.o
deleted file mode 100644
index ccf61362b21fe4b7037a02ed18dbda99fd973ee7..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin.so
deleted file mode 100755
index 86ab1565666a0020279b037229cb4154d15900a9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/brixplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin-s.o
deleted file mode 100644
index cf31d1ddfa75920cec8e309adfba07a936ec4174..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin.o
deleted file mode 100644
index 7b064eedb54498718bee1fbc4f8093ae7901df40..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin.so
deleted file mode 100755
index cb0943a216f86fb32196a63a84b055270eb12a92..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/carplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin-s.o
deleted file mode 100644
index 0df7aaac03cc9b533e2b03a2c0b91cc73d771b2a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin.o
deleted file mode 100644
index edbee58f62e80f2eb7c9185bd109a02e4a405688..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin.so
deleted file mode 100755
index b6a3babcbafbabed848ef2dc41d7bbd3f65d17eb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/ccp4plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin-s.o
deleted file mode 100644
index 44831c06eb0777f78e87cb02ed248a71641af985..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin.o
deleted file mode 100644
index b3b248d111cf787bfbff897c500a66b035ad1d25..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin.so
deleted file mode 100755
index ebeade6eacae7c8afa4e81b118bca97db21c2769..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/corplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin-s.o
deleted file mode 100644
index cd348bf5ff444981c3a8a97dc1e182d77fa65072..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin.o
deleted file mode 100644
index 1cba63a531251c56a0615e6c5ef3666298a8baba..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin.so
deleted file mode 100755
index 3b1e9ed4a95b6a8542e220671d98a54c87083147..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cpmdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin-s.o
deleted file mode 100644
index a710b2c2930a6371224605f24c07fd894d17aad7..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin.o
deleted file mode 100644
index 63d28403865b9dcd9726e42823a9c551d10ecf83..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin.so
deleted file mode 100755
index c2fadb3650360d751953e9597229caa3a1882142..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/crdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin-s.o
deleted file mode 100644
index d4b54f2246353a16d2c1c2ae5765d55414a00dce..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin.o
deleted file mode 100644
index bd0b1fce6883197887b6e6de55ae52e4421e97aa..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin.so
deleted file mode 100755
index d99a12f00f7d54aba7188d65f8d9b6c9ac9034a9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/cubeplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin-s.o
deleted file mode 100644
index a14623b41571283b770223be46949590f4832e9e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin.o
deleted file mode 100644
index 45e3010fe905609248589a67e6b6fff9d7784054..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin.so
deleted file mode 100755
index d77ef33a16d20c26e56eef0d8bc71c1976403619..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dcdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin-s.o
deleted file mode 100644
index 398adaac720764d02a43717fbc5ea0bbdcb804f5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin.o
deleted file mode 100644
index 6862feda6ba5ff5460625fc798608f569e471040..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin.so
deleted file mode 100755
index c864d708bbff8a055ecda14d3b18a4cee368879c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dlpolyplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin-s.o
deleted file mode 100644
index 63ecd8e72c7f64748d15c9f5dd5270fbd3f8ea3a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin.o
deleted file mode 100644
index d073fb6bd50608b52ff58b78f9a10a3fe0e60c33..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin.so
deleted file mode 100755
index 14fd8bf467d80a3a1d034287d8e086fd21583c9a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dsn6plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin-s.o
deleted file mode 100644
index 75decb57bcd5c5e435525561b58e28a5ce98263e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin.o
deleted file mode 100644
index e2bd33b6847f6f09883ec4b39a144c79eee15ab3..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin.so
deleted file mode 100755
index 5e06d1876882e5c3a29ed63e29c0ba4ce60237f5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dtrplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin-s.o
deleted file mode 100644
index 1e1e61ab0e231062511beef3692e297108033839..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin.o
deleted file mode 100644
index dd9385413d5cd2f07cc36846245f1931b12e91d6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin.so
deleted file mode 100755
index c20cc2defa4910afadb6f5c817887259c0e1eec4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/dxplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin-s.o
deleted file mode 100644
index 1f38920e854fce145e9c57efafbdc37f56bf27c1..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin.o
deleted file mode 100644
index b608b7b22a6c4d8114efc9eb0dd5908397a5dd8c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin.so
deleted file mode 100755
index b698d7e39e073173521be5a612cb735a42d0f350..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/edmplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin-s.o
deleted file mode 100644
index cd9b28f428f4fa161ac025c346b4e96a52878056..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin.o
deleted file mode 100644
index 080205b13d40d1963a01ae34c0ed0f0d1b49b8d9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin.so
deleted file mode 100755
index 7634de3c23094ef3c731e8f1e9b9804223f13d9d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/fs4plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin-s.o
deleted file mode 100644
index dad7181a8d257cd34a50dedafe755493eb54edfb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin.o
deleted file mode 100644
index b44a49a734222de59c5ec29d4dce0c78466c8c30..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin.so
deleted file mode 100755
index fc3dac8bf458adc76ffb602c1d26383a97453fa9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gamessplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin-s.o
deleted file mode 100644
index e9d1b3d513e33ee1d21bc1df27891b2588db9cbc..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin.o
deleted file mode 100644
index 3f8c56375230fd307021964d1f2eb01db80b7e48..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin.so
deleted file mode 100755
index 59410af69309a6305f4345338b1fa90ede88ec90..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/graspplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin-s.o
deleted file mode 100644
index 6bf33b9c3c1c6e4da9f0e04f02909bea30b632ad..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin.o
deleted file mode 100644
index 660eb808e0fe221d0ff7358794ee9fee8c530b08..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin.so
deleted file mode 100755
index cefaae2c172562aad819a5cc364dfbb0ca911c47..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/grdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin-s.o
deleted file mode 100644
index 3643fe396ca9928ebede7337440cb5d663faf767..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin.o
deleted file mode 100644
index 24415b4b97869795c278eeeca160447adb9306c9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin.so
deleted file mode 100755
index 34d2f415d31dd254c2a3f36beb48fbf8cc047e86..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gridplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin-s.o
deleted file mode 100644
index 40a500025d48b3251b046723ccda2e83cacbb42c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin.o
deleted file mode 100644
index ae0a25244640648e9fa3441765c96515f03ea032..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin.so
deleted file mode 100755
index 5691eb5482676417ce9d7daf5fd0507b311a4ad6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/gromacsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin-s.o
deleted file mode 100644
index 02dcbe695b7e0d5252e37da16906c1f931355049..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin.o
deleted file mode 100644
index 32eab9e2adb7b19e7ee1fbbd099a0c8c636f2b3d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin.so
deleted file mode 100755
index 30d75a56dde6c660f76000ab2215e61a76cec856..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/hoomdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin-s.o
deleted file mode 100644
index 8cf877dda9f546b1cc1246ad5aefe0ca48667f73..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin.o
deleted file mode 100644
index 25f9b2e8a3f70388ea9fa1df6ceb1f8d20bed460..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin.so
deleted file mode 100755
index a117f4cf36f6c87ccde0d57ec21df5b8b8fdf27a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/jsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin-s.o
deleted file mode 100644
index 8679e30cc166fb2be5736e2092f6286c4f33c1ef..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin.o
deleted file mode 100644
index 202bda33ee6a5a2c7083b71522e2308ca7eaca8d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin.so
deleted file mode 100755
index cf1bd29e4a5114f137c14ab8732f2837f506762c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/lammpsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/libmolfile_plugin.a b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/libmolfile_plugin.a
deleted file mode 100644
index 6a17ae70af1c744919f0a25af3a4babee72011ed..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/libmolfile_plugin.a and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/libmolfile_plugin.h b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/libmolfile_plugin.h
deleted file mode 100644
index 8c25b6dac3da210c2d5f0bf89ce255cd828be693..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/libmolfile_plugin.h
+++ /dev/null
@@ -1,427 +0,0 @@
-#ifndef LIBMOLFILE_PLUGIN_H
-#define LIBMOLFILE_PLUGIN_H
-#include "vmdplugin.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int molfile_abinitplugin_init(void);
-extern int molfile_abinitplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_abinitplugin_fini(void);
-extern int molfile_avsplugin_init(void);
-extern int molfile_avsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_avsplugin_fini(void);
-extern int molfile_babelplugin_init(void);
-extern int molfile_babelplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_babelplugin_fini(void);
-extern int molfile_basissetplugin_init(void);
-extern int molfile_basissetplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_basissetplugin_fini(void);
-extern int molfile_bgfplugin_init(void);
-extern int molfile_bgfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_bgfplugin_fini(void);
-extern int molfile_binposplugin_init(void);
-extern int molfile_binposplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_binposplugin_fini(void);
-extern int molfile_biomoccaplugin_init(void);
-extern int molfile_biomoccaplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_biomoccaplugin_fini(void);
-extern int molfile_brixplugin_init(void);
-extern int molfile_brixplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_brixplugin_fini(void);
-extern int molfile_carplugin_init(void);
-extern int molfile_carplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_carplugin_fini(void);
-extern int molfile_ccp4plugin_init(void);
-extern int molfile_ccp4plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_ccp4plugin_fini(void);
-extern int molfile_corplugin_init(void);
-extern int molfile_corplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_corplugin_fini(void);
-extern int molfile_cpmdplugin_init(void);
-extern int molfile_cpmdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_cpmdplugin_fini(void);
-extern int molfile_crdplugin_init(void);
-extern int molfile_crdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_crdplugin_fini(void);
-extern int molfile_cubeplugin_init(void);
-extern int molfile_cubeplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_cubeplugin_fini(void);
-extern int molfile_dcdplugin_init(void);
-extern int molfile_dcdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dcdplugin_fini(void);
-extern int molfile_dlpolyplugin_init(void);
-extern int molfile_dlpolyplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dlpolyplugin_fini(void);
-extern int molfile_dsn6plugin_init(void);
-extern int molfile_dsn6plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dsn6plugin_fini(void);
-extern int molfile_dxplugin_init(void);
-extern int molfile_dxplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dxplugin_fini(void);
-extern int molfile_edmplugin_init(void);
-extern int molfile_edmplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_edmplugin_fini(void);
-extern int molfile_fs4plugin_init(void);
-extern int molfile_fs4plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_fs4plugin_fini(void);
-extern int molfile_gamessplugin_init(void);
-extern int molfile_gamessplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_gamessplugin_fini(void);
-extern int molfile_graspplugin_init(void);
-extern int molfile_graspplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_graspplugin_fini(void);
-extern int molfile_grdplugin_init(void);
-extern int molfile_grdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_grdplugin_fini(void);
-extern int molfile_gridplugin_init(void);
-extern int molfile_gridplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_gridplugin_fini(void);
-extern int molfile_gromacsplugin_init(void);
-extern int molfile_gromacsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_gromacsplugin_fini(void);
-extern int molfile_jsplugin_init(void);
-extern int molfile_jsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_jsplugin_fini(void);
-extern int molfile_lammpsplugin_init(void);
-extern int molfile_lammpsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_lammpsplugin_fini(void);
-extern int molfile_mapplugin_init(void);
-extern int molfile_mapplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_mapplugin_fini(void);
-extern int molfile_mdfplugin_init(void);
-extern int molfile_mdfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_mdfplugin_fini(void);
-extern int molfile_mol2plugin_init(void);
-extern int molfile_mol2plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_mol2plugin_fini(void);
-extern int molfile_moldenplugin_init(void);
-extern int molfile_moldenplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_moldenplugin_fini(void);
-extern int molfile_molemeshplugin_init(void);
-extern int molfile_molemeshplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_molemeshplugin_fini(void);
-extern int molfile_msmsplugin_init(void);
-extern int molfile_msmsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_msmsplugin_fini(void);
-extern int molfile_namdbinplugin_init(void);
-extern int molfile_namdbinplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_namdbinplugin_fini(void);
-extern int molfile_offplugin_init(void);
-extern int molfile_offplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_offplugin_fini(void);
-extern int molfile_parm7plugin_init(void);
-extern int molfile_parm7plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_parm7plugin_fini(void);
-extern int molfile_parmplugin_init(void);
-extern int molfile_parmplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_parmplugin_fini(void);
-extern int molfile_pbeqplugin_init(void);
-extern int molfile_pbeqplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pbeqplugin_fini(void);
-extern int molfile_pdbplugin_init(void);
-extern int molfile_pdbplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pdbplugin_fini(void);
-extern int molfile_pdbxplugin_init(void);
-extern int molfile_pdbxplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pdbxplugin_fini(void);
-extern int molfile_phiplugin_init(void);
-extern int molfile_phiplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_phiplugin_fini(void);
-extern int molfile_pltplugin_init(void);
-extern int molfile_pltplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pltplugin_fini(void);
-extern int molfile_plyplugin_init(void);
-extern int molfile_plyplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_plyplugin_fini(void);
-extern int molfile_pqrplugin_init(void);
-extern int molfile_pqrplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_pqrplugin_fini(void);
-extern int molfile_psfplugin_init(void);
-extern int molfile_psfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_psfplugin_fini(void);
-extern int molfile_raster3dplugin_init(void);
-extern int molfile_raster3dplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_raster3dplugin_fini(void);
-extern int molfile_rst7plugin_init(void);
-extern int molfile_rst7plugin_register(void *, vmdplugin_register_cb);
-extern int molfile_rst7plugin_fini(void);
-extern int molfile_situsplugin_init(void);
-extern int molfile_situsplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_situsplugin_fini(void);
-extern int molfile_spiderplugin_init(void);
-extern int molfile_spiderplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_spiderplugin_fini(void);
-extern int molfile_stlplugin_init(void);
-extern int molfile_stlplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_stlplugin_fini(void);
-extern int molfile_tinkerplugin_init(void);
-extern int molfile_tinkerplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_tinkerplugin_fini(void);
-extern int molfile_uhbdplugin_init(void);
-extern int molfile_uhbdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_uhbdplugin_fini(void);
-extern int molfile_vaspchgcarplugin_init(void);
-extern int molfile_vaspchgcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspchgcarplugin_fini(void);
-extern int molfile_vaspoutcarplugin_init(void);
-extern int molfile_vaspoutcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspoutcarplugin_fini(void);
-extern int molfile_vaspparchgplugin_init(void);
-extern int molfile_vaspparchgplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspparchgplugin_fini(void);
-extern int molfile_vaspposcarplugin_init(void);
-extern int molfile_vaspposcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspposcarplugin_fini(void);
-extern int molfile_vasp5xdatcarplugin_init(void);
-extern int molfile_vasp5xdatcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vasp5xdatcarplugin_fini(void);
-extern int molfile_vaspxdatcarplugin_init(void);
-extern int molfile_vaspxdatcarplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspxdatcarplugin_fini(void);
-extern int molfile_vaspxmlplugin_init(void);
-extern int molfile_vaspxmlplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vaspxmlplugin_fini(void);
-extern int molfile_vtkplugin_init(void);
-extern int molfile_vtkplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_vtkplugin_fini(void);
-extern int molfile_xbgfplugin_init(void);
-extern int molfile_xbgfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_xbgfplugin_fini(void);
-extern int molfile_xsfplugin_init(void);
-extern int molfile_xsfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_xsfplugin_fini(void);
-extern int molfile_xyzplugin_init(void);
-extern int molfile_xyzplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_xyzplugin_fini(void);
-extern int molfile_dtrplugin_init(void);
-extern int molfile_dtrplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_dtrplugin_fini(void);
-extern int molfile_maeffplugin_init(void);
-extern int molfile_maeffplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_maeffplugin_fini(void);
-extern int molfile_netcdfplugin_init(void);
-extern int molfile_netcdfplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_netcdfplugin_fini(void);
-extern int molfile_hoomdplugin_init(void);
-extern int molfile_hoomdplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_hoomdplugin_fini(void);
-extern int molfile_tngplugin_init(void);
-extern int molfile_tngplugin_register(void *, vmdplugin_register_cb);
-extern int molfile_tngplugin_fini(void);
-
-#define MOLFILE_INIT_ALL \
-    molfile_abinitplugin_init(); \
-    molfile_avsplugin_init(); \
-    molfile_babelplugin_init(); \
-    molfile_basissetplugin_init(); \
-    molfile_bgfplugin_init(); \
-    molfile_binposplugin_init(); \
-    molfile_biomoccaplugin_init(); \
-    molfile_brixplugin_init(); \
-    molfile_carplugin_init(); \
-    molfile_ccp4plugin_init(); \
-    molfile_corplugin_init(); \
-    molfile_cpmdplugin_init(); \
-    molfile_crdplugin_init(); \
-    molfile_cubeplugin_init(); \
-    molfile_dcdplugin_init(); \
-    molfile_dlpolyplugin_init(); \
-    molfile_dsn6plugin_init(); \
-    molfile_dxplugin_init(); \
-    molfile_edmplugin_init(); \
-    molfile_fs4plugin_init(); \
-    molfile_gamessplugin_init(); \
-    molfile_graspplugin_init(); \
-    molfile_grdplugin_init(); \
-    molfile_gridplugin_init(); \
-    molfile_gromacsplugin_init(); \
-    molfile_jsplugin_init(); \
-    molfile_lammpsplugin_init(); \
-    molfile_mapplugin_init(); \
-    molfile_mdfplugin_init(); \
-    molfile_mol2plugin_init(); \
-    molfile_moldenplugin_init(); \
-    molfile_molemeshplugin_init(); \
-    molfile_msmsplugin_init(); \
-    molfile_namdbinplugin_init(); \
-    molfile_offplugin_init(); \
-    molfile_parm7plugin_init(); \
-    molfile_parmplugin_init(); \
-    molfile_pbeqplugin_init(); \
-    molfile_pdbplugin_init(); \
-    molfile_pdbxplugin_init(); \
-    molfile_phiplugin_init(); \
-    molfile_pltplugin_init(); \
-    molfile_plyplugin_init(); \
-    molfile_pqrplugin_init(); \
-    molfile_psfplugin_init(); \
-    molfile_raster3dplugin_init(); \
-    molfile_rst7plugin_init(); \
-    molfile_situsplugin_init(); \
-    molfile_spiderplugin_init(); \
-    molfile_stlplugin_init(); \
-    molfile_tinkerplugin_init(); \
-    molfile_uhbdplugin_init(); \
-    molfile_vaspchgcarplugin_init(); \
-    molfile_vaspoutcarplugin_init(); \
-    molfile_vaspparchgplugin_init(); \
-    molfile_vaspposcarplugin_init(); \
-    molfile_vasp5xdatcarplugin_init(); \
-    molfile_vaspxdatcarplugin_init(); \
-    molfile_vaspxmlplugin_init(); \
-    molfile_vtkplugin_init(); \
-    molfile_xbgfplugin_init(); \
-    molfile_xsfplugin_init(); \
-    molfile_xyzplugin_init(); \
-    molfile_dtrplugin_init(); \
-    molfile_maeffplugin_init(); \
-    molfile_netcdfplugin_init(); \
-    molfile_hoomdplugin_init(); \
-    molfile_tngplugin_init(); \
-
-#define MOLFILE_REGISTER_ALL(v, cb) \
-    molfile_abinitplugin_register(v, cb); \
-    molfile_avsplugin_register(v, cb); \
-    molfile_babelplugin_register(v, cb); \
-    molfile_basissetplugin_register(v, cb); \
-    molfile_bgfplugin_register(v, cb); \
-    molfile_binposplugin_register(v, cb); \
-    molfile_biomoccaplugin_register(v, cb); \
-    molfile_brixplugin_register(v, cb); \
-    molfile_carplugin_register(v, cb); \
-    molfile_ccp4plugin_register(v, cb); \
-    molfile_corplugin_register(v, cb); \
-    molfile_cpmdplugin_register(v, cb); \
-    molfile_crdplugin_register(v, cb); \
-    molfile_cubeplugin_register(v, cb); \
-    molfile_dcdplugin_register(v, cb); \
-    molfile_dlpolyplugin_register(v, cb); \
-    molfile_dsn6plugin_register(v, cb); \
-    molfile_dxplugin_register(v, cb); \
-    molfile_edmplugin_register(v, cb); \
-    molfile_fs4plugin_register(v, cb); \
-    molfile_gamessplugin_register(v, cb); \
-    molfile_graspplugin_register(v, cb); \
-    molfile_grdplugin_register(v, cb); \
-    molfile_gridplugin_register(v, cb); \
-    molfile_gromacsplugin_register(v, cb); \
-    molfile_jsplugin_register(v, cb); \
-    molfile_lammpsplugin_register(v, cb); \
-    molfile_mapplugin_register(v, cb); \
-    molfile_mdfplugin_register(v, cb); \
-    molfile_mol2plugin_register(v, cb); \
-    molfile_moldenplugin_register(v, cb); \
-    molfile_molemeshplugin_register(v, cb); \
-    molfile_msmsplugin_register(v, cb); \
-    molfile_namdbinplugin_register(v, cb); \
-    molfile_offplugin_register(v, cb); \
-    molfile_parm7plugin_register(v, cb); \
-    molfile_parmplugin_register(v, cb); \
-    molfile_pbeqplugin_register(v, cb); \
-    molfile_pdbplugin_register(v, cb); \
-    molfile_pdbxplugin_register(v, cb); \
-    molfile_phiplugin_register(v, cb); \
-    molfile_pltplugin_register(v, cb); \
-    molfile_plyplugin_register(v, cb); \
-    molfile_pqrplugin_register(v, cb); \
-    molfile_psfplugin_register(v, cb); \
-    molfile_raster3dplugin_register(v, cb); \
-    molfile_rst7plugin_register(v, cb); \
-    molfile_situsplugin_register(v, cb); \
-    molfile_spiderplugin_register(v, cb); \
-    molfile_stlplugin_register(v, cb); \
-    molfile_tinkerplugin_register(v, cb); \
-    molfile_uhbdplugin_register(v, cb); \
-    molfile_vaspchgcarplugin_register(v, cb); \
-    molfile_vaspoutcarplugin_register(v, cb); \
-    molfile_vaspparchgplugin_register(v, cb); \
-    molfile_vaspposcarplugin_register(v, cb); \
-    molfile_vasp5xdatcarplugin_register(v, cb); \
-    molfile_vaspxdatcarplugin_register(v, cb); \
-    molfile_vaspxmlplugin_register(v, cb); \
-    molfile_vtkplugin_register(v, cb); \
-    molfile_xbgfplugin_register(v, cb); \
-    molfile_xsfplugin_register(v, cb); \
-    molfile_xyzplugin_register(v, cb); \
-    molfile_dtrplugin_register(v, cb); \
-    molfile_maeffplugin_register(v, cb); \
-    molfile_netcdfplugin_register(v, cb); \
-    molfile_hoomdplugin_register(v, cb); \
-    molfile_tngplugin_register(v, cb); \
-
-#define MOLFILE_FINI_ALL \
-    molfile_abinitplugin_fini(); \
-    molfile_avsplugin_fini(); \
-    molfile_babelplugin_fini(); \
-    molfile_basissetplugin_fini(); \
-    molfile_bgfplugin_fini(); \
-    molfile_binposplugin_fini(); \
-    molfile_biomoccaplugin_fini(); \
-    molfile_brixplugin_fini(); \
-    molfile_carplugin_fini(); \
-    molfile_ccp4plugin_fini(); \
-    molfile_corplugin_fini(); \
-    molfile_cpmdplugin_fini(); \
-    molfile_crdplugin_fini(); \
-    molfile_cubeplugin_fini(); \
-    molfile_dcdplugin_fini(); \
-    molfile_dlpolyplugin_fini(); \
-    molfile_dsn6plugin_fini(); \
-    molfile_dxplugin_fini(); \
-    molfile_edmplugin_fini(); \
-    molfile_fs4plugin_fini(); \
-    molfile_gamessplugin_fini(); \
-    molfile_graspplugin_fini(); \
-    molfile_grdplugin_fini(); \
-    molfile_gridplugin_fini(); \
-    molfile_gromacsplugin_fini(); \
-    molfile_jsplugin_fini(); \
-    molfile_lammpsplugin_fini(); \
-    molfile_mapplugin_fini(); \
-    molfile_mdfplugin_fini(); \
-    molfile_mol2plugin_fini(); \
-    molfile_moldenplugin_fini(); \
-    molfile_molemeshplugin_fini(); \
-    molfile_msmsplugin_fini(); \
-    molfile_namdbinplugin_fini(); \
-    molfile_offplugin_fini(); \
-    molfile_parm7plugin_fini(); \
-    molfile_parmplugin_fini(); \
-    molfile_pbeqplugin_fini(); \
-    molfile_pdbplugin_fini(); \
-    molfile_pdbxplugin_fini(); \
-    molfile_phiplugin_fini(); \
-    molfile_pltplugin_fini(); \
-    molfile_plyplugin_fini(); \
-    molfile_pqrplugin_fini(); \
-    molfile_psfplugin_fini(); \
-    molfile_raster3dplugin_fini(); \
-    molfile_rst7plugin_fini(); \
-    molfile_situsplugin_fini(); \
-    molfile_spiderplugin_fini(); \
-    molfile_stlplugin_fini(); \
-    molfile_tinkerplugin_fini(); \
-    molfile_uhbdplugin_fini(); \
-    molfile_vaspchgcarplugin_fini(); \
-    molfile_vaspoutcarplugin_fini(); \
-    molfile_vaspparchgplugin_fini(); \
-    molfile_vaspposcarplugin_fini(); \
-    molfile_vasp5xdatcarplugin_fini(); \
-    molfile_vaspxdatcarplugin_fini(); \
-    molfile_vaspxmlplugin_fini(); \
-    molfile_vtkplugin_fini(); \
-    molfile_xbgfplugin_fini(); \
-    molfile_xsfplugin_fini(); \
-    molfile_xyzplugin_fini(); \
-    molfile_dtrplugin_fini(); \
-    molfile_maeffplugin_fini(); \
-    molfile_netcdfplugin_fini(); \
-    molfile_hoomdplugin_fini(); \
-    molfile_tngplugin_fini(); \
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin-s.o
deleted file mode 100644
index 08de0136e25e4aad3e20512c4326afd4061cda8e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin.o
deleted file mode 100644
index 761fe847cb434a063dd47fd941d736d075bc7844..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin.so
deleted file mode 100755
index 35376c708924ae6efe049c61c8dd5e55c9518f49..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/maeffplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin-s.o
deleted file mode 100644
index 99f2029c54fcb684bd34e52baaf00ef52595a4a2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin.o
deleted file mode 100644
index 4424341bf89554ee83e54e29a4266a7102ff371f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin.so
deleted file mode 100755
index 996d7800ce51227693730d9c0b34605500bd7a6d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mapplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin-s.o
deleted file mode 100644
index e66b045b551d65f706e063688cd5603a889bee14..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin.o
deleted file mode 100644
index 793afe98aaee988c10de74cb2d178959d56904f9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin.so
deleted file mode 100755
index 2e1349b94cdb93bd372b8ca551b8f449d62c0fd2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mdfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin-s.o
deleted file mode 100644
index 7d3a47a509eb81e8710c720fadf16176cd81c4be..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin.o
deleted file mode 100644
index 438325f6564cbbd76c44aee53822307f9e73e51d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin.so
deleted file mode 100755
index 4a457bddb0ffa4684bf95c0f41b6580e6c0fb132..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/mol2plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin-s.o
deleted file mode 100644
index e900bf95845719ec2e1015e14500f2b7cf34a874..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin.o
deleted file mode 100644
index ce25edb378ad4ad27ba116575979aeaa3e179057..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin.so
deleted file mode 100755
index 4e35ecd6346b79534113bba53bdc9030dcdc46e4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/moldenplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin-s.o
deleted file mode 100644
index ddfebc71b2c96fbd8ead4a2984e531af77bcab21..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin.o
deleted file mode 100644
index 4a24c3bb56b036dc23662c80d4a1cf1f283809b9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin.so
deleted file mode 100755
index 53cde9baa2e4e400648b0c04cae37f27620b6eed..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/molemeshplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin-s.o
deleted file mode 100644
index 90a219886b8819af12fb28ac67dcca9078495682..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin.o
deleted file mode 100644
index cc77e5f260ebdcfe814a79f9d58e727915a8ad49..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin.so
deleted file mode 100755
index 6e3c6a9d59b4c5918290c916f785124246005630..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/msmsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin-s.o
deleted file mode 100644
index 3d1e4a895565d346e00bd82d1f62c5ab82e6b804..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin.o
deleted file mode 100644
index 3122dcd552efa1c40feb36f93ed1af5079891ae5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin.so
deleted file mode 100755
index 8f28b0d3155fe854379781119587b8f830a2247e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/namdbinplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin-s.o
deleted file mode 100644
index c3340da0f1a5a6269ded02d4b4fb8071d704beed..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin.o
deleted file mode 100644
index aa1fefdde2649a2d7071772520cc3932cdb4e9a9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin.so
deleted file mode 100755
index 8fb1bdadc7ae060da1c9dd6884e4d13d7db91d83..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/netcdfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin-s.o
deleted file mode 100644
index d2a3ba5f7ebc59f2f6763d4cefcb297fe65be535..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin.o
deleted file mode 100644
index 83ca134a56ea0123764372871318dcce5a9808fe..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin.so
deleted file mode 100755
index dd51b0cfabe91f100e943d6cdc9750dbbd3b448b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/offplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin-s.o
deleted file mode 100644
index 86892dbf65feda198dae692bd09488c0ab6150b6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin.o
deleted file mode 100644
index 0cbd615b9995276fefcfd231baf9c3874d685c84..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin.so
deleted file mode 100755
index dd8cb85f8b8b11657986a2a9075f75114717e653..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parm7plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin-s.o
deleted file mode 100644
index dfa16732dd9edd38c09bb1bd455a2d99a05d3820..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin.o
deleted file mode 100644
index 0f35edd7fafcaef3f1997077241ecb4eb318dd37..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin.so
deleted file mode 100755
index 36ba8a0c6c8c294f5302e6798f025ac398483438..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/parmplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin-s.o
deleted file mode 100644
index 3008f2c5ec13a49b8ea8e87c37312c09d7111e38..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin.o
deleted file mode 100644
index 0c2e69c8875ef1f75c1c74d90f50f44d434bb681..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin.so
deleted file mode 100755
index 41df0bb613c9ed1b2b1be580bb20db5b22c8909e..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pbeqplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin-s.o
deleted file mode 100644
index 8e043d2a58ef33f3dc70834fea3769ef314259a2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin.o
deleted file mode 100644
index f7824cfaff5f1ba11f384ffdb4036db41fb7dc16..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin.so
deleted file mode 100755
index fea476eebc8b0681adba1a114730b46b2364af6b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin-s.o
deleted file mode 100644
index 34abeeb38ca9ee7cc5cf88c8a4cbb3bd60737487..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin.o
deleted file mode 100644
index f7d755adcc44996e38d30d71ac617bf59ff3a7f0..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin.so
deleted file mode 100755
index 255dd00380b5827303271a2a9dfe8eed8797cc5b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pdbxplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin-s.o
deleted file mode 100644
index c79b7a841d1e52238140829a258f64dde78e07c6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin.o
deleted file mode 100644
index 8cf9b04cd8f9bfa9ade6c8c2f9730411eda46d2c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin.so
deleted file mode 100755
index f63eff3d12ceccd34f6444ef01959e1acc2a21b4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/phiplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin-s.o
deleted file mode 100644
index a73e1a21bb0abab16af7fc78a7e9d5ee97c0c852..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin.o
deleted file mode 100644
index 874e1273d957401b974e8c0defb4b188fdcbdba0..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin.so
deleted file mode 100755
index 68b00b99ea1d60e388498a14a82f3776a6e41a53..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pltplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin-s.o
deleted file mode 100644
index 2f0e8dca0ad0ca228a2753fca4e5be7e600508fa..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin.o
deleted file mode 100644
index 45294389168c32ae9e715ff2d44207571d54d412..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin.so
deleted file mode 100755
index 087ef9d705f1a5371337264bb7e4eff0e601c900..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/plyplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin-s.o
deleted file mode 100644
index 40decdede8a80c7279d7eb08ea2e9a3701a15298..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin.o
deleted file mode 100644
index bc5814d64c8937d020889302a614e48e2171523a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin.so
deleted file mode 100755
index 9c851250001d1f4bc4241ed581219b490bde1865..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/pqrplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin-s.o
deleted file mode 100644
index 13f415d0b14ad28bbba7a824f62f6d8284e7484a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin.o
deleted file mode 100644
index f7ea05fdd6fdd8442b68535938e62bdf4f1d826c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin.so
deleted file mode 100755
index 5ea52557cfc719145e0505735757bd51d233bcdf..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/psfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin-s.o
deleted file mode 100644
index f6ffb21035739a4a77281902328aa94818a0dcd2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin.o
deleted file mode 100644
index f99f2b331af902f475dcbdcaab7cdeeaef837680..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin.so
deleted file mode 100755
index 37a8a6dd8005346499bf18073f7f6306e26315d4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/raster3dplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin-s.o
deleted file mode 100644
index e8b1b0b5777b88b5c0f85be16ee7366f7c7f102d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin.o
deleted file mode 100644
index a004a558c18e42c7b3242c4164c1ebdcfbfe065b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin.so
deleted file mode 100755
index aef126ce4176917bd5a76b70f470837f573c39fb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/rst7plugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin-s.o
deleted file mode 100644
index 90f23ce999f75cc087c49cf2a097639985f2e890..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin.o
deleted file mode 100644
index 669f42b050a5b68ad0427f5958b76f2b88060b59..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin.so
deleted file mode 100755
index de9af937f8cd8be3fa8359bdecaff51802f73d92..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/situsplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin-s.o
deleted file mode 100644
index 86306e878bb356378c48285419abf7e6bc909e4b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin.o
deleted file mode 100644
index 567a3bdcedf46e4812145a1410ab14466a48dc20..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin.so
deleted file mode 100755
index 2b1531ceea244bd4e641a935dd10e80e696ef9de..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/spiderplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin-s.o
deleted file mode 100644
index 78fbf6304bbc4c3526b2482126ab5e2419d6b822..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin.o
deleted file mode 100644
index 99fa1ff6765097f64c2f67d5213bc15bb2a1c9e6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin.so
deleted file mode 100755
index d3d39d7e9c0a3a9dba6a05b74d6e5227bfcceff3..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/stlplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin-s.o
deleted file mode 100644
index e06cfd4e9240108597513f79d41f36431959d86b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin.o
deleted file mode 100644
index 2382ef2a6643148a15b47241a509d4d29258e0c9..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin.so
deleted file mode 100755
index 90e2ef350b3d57c3268d7bff60bd21aebc17255f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tinkerplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin-s.o
deleted file mode 100644
index 726261002f304e578717594280d2f8a5c5746995..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin.o
deleted file mode 100644
index d9db5f9d3e7fd3d5e0c357d4ca1b63d6c73b78ae..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin.so
deleted file mode 100755
index 5e35447d790c7ccc92a3a7d31cc7d45e4e63f764..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/tngplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin-s.o
deleted file mode 100644
index 65d4060ef13dce8efc75c34780af4e28dbeaba0d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin.o
deleted file mode 100644
index 03e2fc08e81c7ffe384328d4afb52ce349933469..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin.so
deleted file mode 100755
index 474559a79efea6fda4665d6890437a536691f434..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/uhbdplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin-s.o
deleted file mode 100644
index b5e8da06e078e71a54552b04d4be4d2becee97b6..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin.o
deleted file mode 100644
index e94b6be7e2906d39b2b6bf7945f4f869b1361bdd..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin.so
deleted file mode 100755
index 944fb3f821c54521694dc68e10bb708af95a3e59..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vasp5xdatcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin-s.o
deleted file mode 100644
index 55b359fbadc0eace8f5a8064f3f02dc84c0266b4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin.o
deleted file mode 100644
index e85605985ddf2287dbccc9b9602fd2e2d2028a70..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin.so
deleted file mode 100755
index 2e0cae82903fa6a07708c62366d51c8c48b9f588..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspchgcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin-s.o
deleted file mode 100644
index 5428982dbdad3cb37612f43d4ddd05ac68404479..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin.o
deleted file mode 100644
index f2ba3c19dda238b753f9ae696d453daec5d89abb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin.so
deleted file mode 100755
index e2918ebe475055dc43ad79df5cddb4cfb1466a9a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspoutcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin-s.o
deleted file mode 100644
index ddd4cd070f1fd9e5847fb8e6c4cb4cd291aeaf87..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin.o
deleted file mode 100644
index 083e44871c8feef1d47c3261710b9a739d83d676..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin.so
deleted file mode 100755
index fbdd1f8ecdfd5aaba388ca4c7eb7b278e17c5382..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspparchgplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin-s.o
deleted file mode 100644
index 67bcb28d370b11602cc2e0a90b225f366b4e701a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin.o
deleted file mode 100644
index 212e0a0e1a83fe16a20ef0fa6eaad802b838bda5..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin.so
deleted file mode 100755
index be992fa03eabcf728fb926985019862adfca8424..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspposcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin-s.o
deleted file mode 100644
index feca567b34d449038745d9f2435d61ab6f22f83c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin.o
deleted file mode 100644
index c5414d5ed1e747bf9ce8f1229541728f21f63528..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin.so
deleted file mode 100755
index 14fcb90ea8f25506e72b6ba68a000610dbe9eab8..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxdatcarplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin-s.o
deleted file mode 100644
index de1a1cf247c02183986adeb1cce32cefb6abd6eb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin.o
deleted file mode 100644
index 61a74d7b977e0c5a31934b8a9426e7fc87601470..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin.so
deleted file mode 100755
index b4695413dbf0ef2007c920e970d40b4e9d7f5f61..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vaspxmlplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin-s.o
deleted file mode 100644
index 2984942b9194f147669b73a5a282e70684eecaa2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin.o
deleted file mode 100644
index 64cd3f2eb3a401edea9d8e7e6d7bf0f62f88cf4b..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin.so
deleted file mode 100755
index 0dfd1c762dbdc0db91f9a8579ca2e8f5fb32d3c2..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/vtkplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin-s.o
deleted file mode 100644
index 326a86f38dd9e6a93523dc34be676c9ecf537abb..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin.o
deleted file mode 100644
index acb83e02539f8550d47882ab7474b91655d6d63f..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin.so
deleted file mode 100755
index 3b5eb7c9be5681819241b43f7ac48b2a01d8a741..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xbgfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin-s.o
deleted file mode 100644
index 1db01f9dd6233df43c23b8107eb0d75b0ec846e7..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin.o
deleted file mode 100644
index e5eb0e026d6f5059f7e9d03cfa88ebe1a979caf4..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin.so
deleted file mode 100755
index 61a6a91926f005b27ccaff9f7b1df8d20e86a71a..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xsfplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin-s.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin-s.o
deleted file mode 100644
index 29c31833d5eafb9a2ee5a4498febd47d4d91b523..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin-s.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin.o b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin.o
deleted file mode 100644
index 1ffe8e5db48b6a3d7b9775168807e9e0cd68f746..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin.o and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin.so b/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin.so
deleted file mode 100755
index 16bde7d26dc53cc020925c234a4761758c2eed3d..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/compile/lib_MACOSXX86_64GCC/molfile/xyzplugin.so and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/create_static_header.sh b/pymolfile/molfile/vmd_molfile_plugins/create_static_header.sh
deleted file mode 100755
index 459701651f3a40863ab8656e0059eee21b762dd7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/create_static_header.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-# Script for creating header file for static libraries
-
-libname=$1
-shift
-prefix=$1
-shift
-target=$1
-shift
-plugins=$*
-
-#
-# boilerplate header
-#
-echo "#ifndef LIB${libname}_PLUGIN_H" >> $target
-echo "#define LIB${libname}_PLUGIN_H" >> $target
-
-#
-# include the generic vmd plugin header
-#
-echo "#include \"vmdplugin.h\"" >> $target
-echo "" >> $target
-
-#
-# all plugin API's are extern "C".
-#
-echo "#ifdef __cplusplus" >> $target
-echo "extern \"C\" {" >> $target
-echo "#endif" >> $target
-echo "" >> $target
-
-#
-# Function declarations
-#
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "extern int ${prefix}_${p}_init(void);" >> $target
-  echo "extern int ${prefix}_${p}_register(void *, vmdplugin_register_cb);" >> $target
-  echo "extern int ${prefix}_${p}_fini(void);" >> $target
-done
-echo "" >> $target
-
-# macros for init, register, fini
-echo "#define ${libname}_INIT_ALL \\" >> $target
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "    ${prefix}_${p}_init(); \\" >> $target
-done
-echo "" >> $target
-
-echo "#define ${libname}_REGISTER_ALL(v, cb) \\" >> $target
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "    ${prefix}_${p}_register(v, cb); \\" >> $target
-done
-echo "" >> $target
-
-echo "#define ${libname}_FINI_ALL \\" >> $target
-for p in $plugins
-do
-##  XXX not legal in standard Bourne shell, so we do it in the Makefile now
-##  name=${p%%.so}
-  echo "    ${prefix}_${p}_fini(); \\" >> $target
-done
-echo "" >> $target
-
-#
-# wrap it up
-#
-echo "#ifdef __cplusplus" >> $target
-echo "}" >> $target
-echo "#endif" >> $target
-echo "#endif" >> $target
diff --git a/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Entries
deleted file mode 100644
index f6167d7cd0bd8276919a0c93d64277aa886a8fd8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Entries
+++ /dev/null
@@ -1,5 +0,0 @@
-/import_graphics_plugin.h/1.5/Fri Sep 21 19:43:10 2007//
-/vmdconio.h/1.4/Sun Oct 11 22:36:27 2015//
-/vmdplugin.h/1.33/Thu Oct 29 05:10:54 2015//
-/molfile_plugin.h/1.108/Fri Feb 26 03:17:01 2016//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Repository
deleted file mode 100644
index 5532d96ba52478c2594be1c6cf75840ad026d0a8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/include
diff --git a/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/include/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins/include/import_graphics_plugin.h b/pymolfile/molfile/vmd_molfile_plugins/include/import_graphics_plugin.h
deleted file mode 100644
index 78ead23942fae14a3aa1882eb2d66901c902a352..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/include/import_graphics_plugin.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2006 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: import_graphics_plugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.5 $       $Date: 2006/04/25 21:32:05 $
- *
- ***************************************************************************/
-
-#ifndef IMPORT_GRAPHICS_PLUGIN_H
-#define IMPORT_GRAPHICS_PLUGIN_H
-
-/* 
- * API for C extensions to define a way to import low-level graphics primitives 
- */ 
-
-#include "vmdplugin.h"
-
-/*
- * Define a common plugin type to be used when registering the plugin.
- */
-#define IMPORT_GRAPHICS_PLUGIN_TYPE "import graphics"
-
-typedef enum {
-	IMPORT_GRAPHICS_LINE_SOLID, IMPORT_GRAPHICS_LINE_DASHED
-} import_graphics_linestyle_t;
-
-/* 
- * Application-provided callbacks for specifying graphics primitives.  
- * Items must be maintained in order by the application for the purpose of 
- * coloring; see below.
- */
-typedef struct {
-
-  /*
-   * Draw a point at the specified location in 3-D space.
-   */
-  int (* add_point)(void *, const float *x);
-  int (* add_triangle)(void *, const float *x1, const float *x2, const float *x3);
-  int (* add_trinorm)(void *, const float *x1, const float *x2, const float *x3,
-		 const float *n1, const float *n2, const float *n3);
-  int (* add_line)(void *, const float *x, const float *y, int line_style, 
-		  int width); 
-  int (* add_cylinder)(void *, const float *x, const float *y, float radius,
-		  int resolution, int filled);
-  int (* add_sphere)(void *, const float *x, float rad, int resolution);
-  int (* add_text)(void *, const float *x, const char *text, float size);
-  /*
-   * Color to use for subsequent primitives.  If primitives are added before
-   * any call to use_color, the application is free to do whatever it likes.
-   */
-  int (* use_color)(void *, float r, float g, float b);
-
-  /*
-   * Indicate whether the set of primitives is to be lit or not.  Either all
-   * or none of the primitives will be lit.
-   */ 
-  int (* use_materials)(void *, int yes_no);
-} import_graphics_cb_t;
-
-
-/*
- * Main file reader API begins here.  Any function in this struct may be NULL
- * if not implemented by the plugin; the application checks this to determine
- * what functionality is present in the plugin. 
- */ 
-typedef struct {
-  /*
-   * Required header
-   */
-  vmdplugin_HEAD
-
-  /*
-   * Filename extension for this file type.  May be NULL if no filename 
-   * extension exists and/or is known.
-   */
-  const char *filename_extension;
-
-  /* 
-   * Try to open the file for reading.  Return an opaque handle, or NULL on
-   * failure. filetype should be the name under which this plugin was 
-   * registered; this is provided so that plugins can provide the same 
-   * function pointer * to handle multiple file types.
-   */
-  void *(* open_file_read)(const char *filepath, const char *filetype); 
-  
-  /*
-   * Read data and return it to the application in the supplied
-   * callbacks.  The first void * is an opaque application handle which 
-   * should be passed to all the callbacks in import_cb_t.  The second 
-   * void * is the plugin handle returned by open_file_read.  
-   */
-  int (* read_data)(void *, void *mydata, import_graphics_cb_t *);
-
-  /* 
-   * Close the file and release all data.  The handle cannot be reused.
-   */
-  void (* close_file_read)(void *);
-
-} import_graphics_plugin_t;
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/include/molfile_plugin.h b/pymolfile/molfile/vmd_molfile_plugins/include/molfile_plugin.h
deleted file mode 100644
index 714b06539fb061dd73b3575fdf68e881508c91ec..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/include/molfile_plugin.h
+++ /dev/null
@@ -1,903 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2006 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: molfile_plugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.108 $       $Date: 2016/02/26 03:17:01 $
- *
- ***************************************************************************/
-
-/** @file 
- * API for C extensions to define a way to load structure, coordinate,
- * trajectory, and volumetric data files  
- */ 
-
-#ifndef MOL_FILE_PLUGIN_H
-#define MOL_FILE_PLUGIN_H
-
-#include "vmdplugin.h"
-
-#if defined(DESRES_READ_TIMESTEP2)
-/* includes needed for large integer types used for frame counts */
-#include <sys/types.h>
-typedef ssize_t molfile_ssize_t;      /**< for frame counts */
-#endif
-
-/**
- * Define a common plugin type to be used when registering the plugin.
- */
-#define MOLFILE_PLUGIN_TYPE "mol file reader"
-
-/**
- * File converter plugins use the same API  but register under a different
- * type so that regular file readers can have priority.
- */
-#define MOLFILE_CONVERTER_PLUGIN_TYPE "mol file converter"
-
-/* File plugin symbolic constants for better code readability */
-#define MOLFILE_SUCCESS           0   /**< succeeded in reading file      */
-#define MOLFILE_EOF              -1   /**< end of file                    */
-#define MOLFILE_ERROR            -1   /**< error reading/opening a file   */
-#define MOLFILE_NOSTRUCTUREDATA  -2   /**< no structure data in this file */
-
-#define MOLFILE_NUMATOMS_UNKNOWN -1   /**< unknown number of atoms       */
-#define MOLFILE_NUMATOMS_NONE     0   /**< no atoms in this file type    */
-
-/**
- * Maximum string size macro
- */
-#define MOLFILE_BUFSIZ           81   /**< maximum chars in string data  */
-#define MOLFILE_BIGBUFSIZ        4096 /**< maximum chars in long strings */
-
-#define MOLFILE_MAXWAVEPERTS     25   /**< maximum number of wavefunctions
-                                       *   per timestep */
-
-/**
- * Hard-coded direct-I/O page size constants for use by both VMD
- * and the plugins that want to use direct, unbuffered I/O for high
- * performance with SSDs etc.  We use two constants to define the 
- * range of hardware page sizes that we can support, so that we can 
- * add support for larger 8KB or 16KB page sizes in the future 
- * as they become more prevalent in high-end storage systems.
- *
- * At present, VMD uses a hard-coded 4KB page size to reduce memory
- * fragmentation, but these constants will make it easier to enable the
- * use of larger page sizes in the future if it becomes necessary.
- */
-#define MOLFILE_DIRECTIO_MIN_BLOCK_SIZE 4096
-#define MOLFILE_DIRECTIO_MAX_BLOCK_SIZE 4096
-
-
-/**
- * File level comments, origin information, and annotations.
- */
-typedef struct {
-  char database[81];   /**< database of origin, if any        */
-  char accession[81];  /**< database accession code, if any   */
-  char date[81];       /**< date/time stamp for this data     */
-  char title[81];      /**< brief title for this data         */
-  int remarklen;       /**< length of remarks string          */
-  char *remarks;       /**< free-form remarks about data      */
-} molfile_metadata_t;
-
-
-/* 
- * Struct for specifying atoms in a molecular structure.  The first 
- * six components are required, the rest are optional and their presence is 
- * indicating by setting the corresponding bit in optsflag.  When omitted,
- * the application (for read_structure) or plugin (for write_structure) 
- * must be able to supply default values if the missing parameters are 
- * part of its internal data structure.
- * Note that it is not possible to specify coordinates with this structure.
- * This is intentional; all coordinate I/O is done with the read_timestep and 
- * write_timestep functions. 
- */
-
-/**
- * Per-atom attributes and information.
- */
-typedef struct {
-  /* these fields absolutely must be set or initialized to empty */
-  char name[16];      /**< required atom name string             */
-  char type[16];      /**< required atom type string             */
-  char resname[8];    /**< required residue name string          */
-  int resid;          /**< required integer residue ID           */
-  char segid[8];      /**< required segment name string, or ""   */
-#if 0 && vmdplugin_ABIVERSION > 17
-  /* The new PDB file formats allows for much larger structures, */
-  /* which can therefore require longer chain ID strings.  The   */
-  /* new PDBx/mmCIF file formats do not have length limits on    */
-  /* fields, so PDB chains could be arbitrarily long strings     */
-  /* in such files.  At present, we know we need at least 3-char */
-  /* chains for existing PDBx/mmCIF files.                       */
-  char chain[4];      /**< required chain name, or ""            */
-#else
-  char chain[2];      /**< required chain name, or ""            */
-#endif
-  /* rest are optional; use optflags to specify what's present   */
-  char altloc[2];     /**< optional PDB alternate location code  */
-  char insertion[2];  /**< optional PDB insertion code           */
-  float occupancy;    /**< optional occupancy value              */
-  float bfactor;      /**< optional B-factor value               */
-  float mass;         /**< optional mass value                   */
-  float charge;       /**< optional charge value                 */
-  float radius;       /**< optional radius value                 */
-  int atomicnumber;   /**< optional element atomic number        */
-
-#if 0
-  char complex[16];
-  char assembly[16];
-  int qmregion;
-  int qmregionlink;
-  int qmlayer;
-  int qmlayerlink;
-  int qmfrag;
-  int qmfraglink;
-  string qmecp;
-  int qmadapt;
-  int qmect;          /**< boolean */
-  int qmparam;
-  int autoparam;
-#endif
-
-#if defined(DESRES_CTNUMBER)
-  int ctnumber;       /**< mae ct block, 0-based, including meta */
-#endif
-} molfile_atom_t;
-
-/*@{*/
-/** Plugin optional data field availability flag */
-#define MOLFILE_NOOPTIONS     0x0000 /**< no optional data                 */
-#define MOLFILE_INSERTION     0x0001 /**< insertion codes provided         */
-#define MOLFILE_OCCUPANCY     0x0002 /**< occupancy data provided          */
-#define MOLFILE_BFACTOR       0x0004 /**< B-factor data provided           */
-#define MOLFILE_MASS          0x0008 /**< Atomic mass provided             */
-#define MOLFILE_CHARGE        0x0010 /**< Atomic charge provided           */
-#define MOLFILE_RADIUS        0x0020 /**< Atomic VDW radius provided       */
-#define MOLFILE_ALTLOC        0x0040 /**< Multiple conformations present   */
-#define MOLFILE_ATOMICNUMBER  0x0080 /**< Atomic element number provided   */
-#define MOLFILE_BONDSSPECIAL  0x0100 /**< Only non-standard bonds provided */
-#if defined(DESRES_CTNUMBER)
-#define MOLFILE_CTNUMBER      0x0200 /**< ctnumber provided */
-#endif
-#define MOLFILE_BADOPTIONS    0xFFFFFFFF /**< Detect badly behaved plugins */
-                              
-/*@}*/
-
-/*@{*/
-/** Flags indicating availability of optional data fields
- *  for QM timesteps
- */
-#define MOLFILE_QMTS_NOOPTIONS     0x0000 /**< no optional data               */
-#define MOLFILE_QMTS_GRADIENT      0x0001 /**< energy gradients provided      */
-#define MOLFILE_QMTS_SCFITER       0x0002
-/*@}*/
-
-typedef struct molfile_timestep_metadata {
-  unsigned int count;                  /**< total # timesteps; -1 if unknown */
-  unsigned int avg_bytes_per_timestep; /** bytes per timestep                */
-  int has_velocities;                  /**< if timesteps have velocities     */
-} molfile_timestep_metadata_t;
-
-/*
- * Per-timestep atom coordinates and periodic cell information
- */ 
-typedef struct {
-  float *coords;        /**< coordinates of all atoms, arranged xyzxyzxyz   */
-  float *velocities;    /**< space for velocities of all atoms; same layout */
-                        /**< NULL unless has_velocities is set              */
-
-  /*@{*/   
-  /**
-   * Unit cell specification of the form A, B, C, alpha, beta, gamma.
-   * notes: A, B, C are side lengths of the unit cell
-   * alpha = angle between b and c
-   *  beta = angle between a and c
-   * gamma = angle between a and b
-   */ 
-  float A, B, C, alpha, beta, gamma; 
-  /*@}*/   
-
-  double physical_time; /**< physical time point associated with this frame */
-
-#if defined(DESRES_READ_TIMESTEP2)
-  /* HACK to support generic trajectory information */
-  double total_energy;
-  double potential_energy;
-  double kinetic_energy;
-  double extended_energy;
-  double force_energy;
-  double total_pressure;
-#endif
-
-} molfile_timestep_t;
-
-
-/**
- * Metadata for volumetric datasets, read initially and used for subsequent
- * memory allocations and file loading.  
- */
-typedef struct {
-  char dataname[256];   /**< name of volumetric data set                    */
-  float origin[3];      /**< origin: origin of volume (x=0, y=0, z=0 corner */
-
-  /*
-   * x/y/z axis:
-   * These the three cell sides, providing both direction and length
-   * (not unit vectors) for the x, y, and z axes.  In the simplest
-   * case, these would be <size,0,0> <0,size,0> and <0,0,size) for 
-   * an orthogonal cubic volume set.  For other cell shapes these
-   * axes can be oriented non-orthogonally, and the parallelpiped
-   * may have different side lengths, not just a cube/rhombus.
-   */
-  float xaxis[3];       /**< direction (and length) for X axis              */ 
-  float yaxis[3];       /**< direction (and length) for Y axis              */
-  float zaxis[3];       /**< direction (and length) for Z axis              */
-
-  /*
-   * x/y/z size: 
-   * Number of grid cells along each axis.  This is _not_ the
-   * physical size of the box, this is the number of voxels in each
-   * direction, independent of the shape of the volume set. 
-   */
-  int xsize;            /**< number of grid cells along the X axis           */
-  int ysize;            /**< number of grid cells along the Y axis           */
-  int zsize;            /**< number of grid cells along the Z axis           */
-
-#if vmdplugin_ABIVERSION > 16
-  int has_scalar;       /**< flag indicating presence of scalar volume       */
-  int has_gradient;     /**< flag indicating presence of vector volume       */
-  int has_variance;     /**< flag indicating presence of variance map        */
-#endif
-  int has_color;        /**< flag indicating presence of voxel color data    */
-} molfile_volumetric_t;
-
-
-#if vmdplugin_ABIVERSION > 16
-/**
- * Volumetric dataset read/write structure with both flag/parameter sets
- * and VMD-allocated pointers for fields to be used by the plugin.
- */
-typedef struct {
-  int setidx;           /**< volumetric dataset index to load/save */
-  float *scalar;        /**< scalar density/potential field data   */
-  float *gradient;      /**< gradient vector field                 */
-  float *variance;      /**< variance map indicating signal/noise  */
-  float *rgb3f;         /**< RGB floating point color texture map  */
-  unsigned char *rgb3u; /**< RGB unsigned byte color texture map   */
-} molfile_volumetric_readwrite_t;
-#endif
-
-
-/**************************************************************
- **************************************************************
- ****                                                      ****
- ****          Data structures for QM files                ****
- ****                                                      ****
- **************************************************************
- **************************************************************/
-
-/* macros for the convergence status of a QM calculation. */
-#define MOLFILE_QMSTATUS_UNKNOWN       -1 /* don't know yet */
-#define MOLFILE_QMSTATUS_OPT_CONV       0 /* optimization converged */
-#define MOLFILE_QMSTATUS_SCF_NOT_CONV   1 /* SCF convergence failed */
-#define MOLFILE_QMSTATUS_OPT_NOT_CONV   2 /* optimization not converged */
-#define MOLFILE_QMSTATUS_FILE_TRUNCATED 3 /* file was truncated */
-
-/* macros describing the SCF method (SCFTYP in GAMESS) */
-#define MOLFILE_SCFTYPE_UNKNOWN -1 /* no info about the method  */
-#define MOLFILE_SCFTYPE_NONE     0 /* calculation didn't make use of SCF */
-#define MOLFILE_SCFTYPE_RHF      1 /* restricted Hartree-Fock   */
-#define MOLFILE_SCFTYPE_UHF      2 /* unrestricted Hartree-Fock */
-#define MOLFILE_SCFTYPE_ROHF     3 /* restricted open-shell Hartree-Fock */
-#define MOLFILE_SCFTYPE_GVB      4 /* generalized valence bond orbitals  */
-#define MOLFILE_SCFTYPE_MCSCF    5 /* multi-configuration SCF   */
-#define MOLFILE_SCFTYPE_FF       6 /* classical force-field based sim.   */
-
-/* macros describing the type of calculation (RUNTYP in GAMESS) */
-#define MOLFILE_RUNTYPE_UNKNOWN    0  /* single point run */
-#define MOLFILE_RUNTYPE_ENERGY     1  /* single point run */
-#define MOLFILE_RUNTYPE_OPTIMIZE   2  /* geometry optimization */
-#define MOLFILE_RUNTYPE_SADPOINT   3  /* saddle point search */
-#define MOLFILE_RUNTYPE_HESSIAN    4  /* Hessian/frequency calculation */
-#define MOLFILE_RUNTYPE_SURFACE    5  /* potential surface scan */
-#define MOLFILE_RUNTYPE_GRADIENT   6  /* energy gradient calculation */
-#define MOLFILE_RUNTYPE_MEX        7  /* minimum energy crossing */
-#define MOLFILE_RUNTYPE_DYNAMICS   8  /* Any type of molecular dynamics
-                                       * e.g. Born-Oppenheimer, Car-Parinello,
-                                       * or classical MD */
-#define MOLFILE_RUNTYPE_PROPERTIES 9  /* Properties were calculated from a
-                                       * wavefunction that was read from file */
-
-
-/**
- * Sizes of various QM-related, timestep independent data arrays
- * which must be allocated by the caller (VMD) so that the plugin
- * can fill in the arrays with data.
- */
-typedef struct {
-  /* hessian data */
-  int nimag;                    /**< number of imaginary modes */
-  int nintcoords;               /**< number internal coordinates */
-  int ncart;                    /**< number cartesian coordinates */
-
-  /* orbital/basisset data */
-  int num_basis_funcs;          /**< number of uncontracted basis functions in basis array */
-  int num_basis_atoms;          /**< number of atoms in basis set */
-  int num_shells;               /**< total number of atomic shells */
-  int wavef_size;               /**< size of the wavefunction
-                                 *   i.e. size of secular eq. or
-                                 *   # of cartesian contracted
-                                 *   gaussian basis functions */
-
-  /* everything else */
-  int have_sysinfo;
-  int have_carthessian;         /**< hessian in cartesian coords available  */
-  int have_inthessian;          /**< hessian in internal coords available  */
-  int have_normalmodes;         /**< normal modes available  */
-} molfile_qm_metadata_t;
-
-
-/**
- * QM run info. Parameters that stay unchanged during a single file.
- */ 
-typedef struct {
-  int nproc;             /**< number of processors used. */
-  int memory;            /**< amount of memory used in Mbyte. */ 
-  int runtype;           /**< flag indicating the calculation method. */
-  int scftype;           /**< SCF type: RHF, UHF, ROHF, GVB or MCSCF wfn. */
-  int status;            /**< indicates wether SCF and geometry optimization
-                          *   have converged properly. */
-  int num_electrons;     /**< number of electrons.    XXX: can be fractional in some DFT codes */
-  int totalcharge;       /**< total charge of system. XXX: can be fractional in some DFT codes */
-  int num_occupied_A;    /**< number of occupied alpha orbitals */
-  int num_occupied_B;    /**< number of occupied beta orbitals */
-
-  double *nuc_charge;    /**< array(natom) containing the nuclear charge of atom i */
-
-  char basis_string[MOLFILE_BUFSIZ];    /**< basis name as "nice" string. */
-  char runtitle[MOLFILE_BIGBUFSIZ];     /**< title of run.                */
-  char geometry[MOLFILE_BUFSIZ];        /**< type of provided geometry,   XXX: remove?
-                                         * e.g. UNIQUE, ZMT, CART, ...    */
-  char version_string[MOLFILE_BUFSIZ];  /**< QM code version information. */
-} molfile_qm_sysinfo_t;
-
-
-/**
- * Data for QM basis set
- */
-typedef struct {
-  int *num_shells_per_atom; /**< number of shells per atom */
-  int *num_prim_per_shell;  /**< number of shell primitives shell */
-
-  float *basis;             /**< contraction coeffients and exponents for
-                             *   the basis functions in the form
-                             *   {exp(1), c-coeff(1), exp(2), c-coeff(2), ...};
-                             *   array size = 2*num_basis_funcs
-                             *   The basis must NOT be normalized. */
-  int *atomic_number;       /**< atomic numbers (chem. element) of atoms in basis set */
-  int *angular_momentum;    /**< 3 ints per wave function coefficient do describe the 
-                             *   cartesian components of the angular momentum.
-                             *   E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}. 
-                             */
-  int *shell_types;         /**< type for each shell in basis */
-} molfile_qm_basis_t;
-
-
-/**
- * Data from QM Hessian/normal mode runs
- *
- * A noteworthy comment from one of Axel's emails:
- * The molfile_qm_hessian_t, I'd rename to molfile_hessian_t (one
- * can do vibrational analysis without QM) and would make this a
- * completely separate entity. This could then be also used to
- * read in data from, say, principal component analysis or normal
- * mode analysis and VMD could contain code to either project a
- * trajectory on the contained eigenvectors or animate them and
- * so on. There is a bunch of possible applications...
- */
-typedef struct {
-  double *carthessian;  /**< hessian matrix in cartesian coordinates (ncart)*(ncart)
-                         *   as a single array of doubles (row(1), ...,row(natoms)) */
-  int    *imag_modes;   /**< list(nimag) of imaginary modes */
-  double *inthessian;   /**< hessian matrix in internal coordinates
-                         *   (nintcoords*nintcoords) as a single array of
-                         *   doubles (row(1), ...,row(nintcoords)) */
-  float *wavenumbers;   /**< array(ncart) of wavenumbers of normal modes */
-  float *intensities;   /**< array(ncart) of intensities of normal modes */
-  float *normalmodes;   /**< matrix(ncart*ncart) of normal modes  */
-} molfile_qm_hessian_t;
-
-
-/**
- * QM related information that is timestep independent
- */
-typedef struct {
-  molfile_qm_sysinfo_t run;             /* system info  */
-  molfile_qm_basis_t   basis;           /* basis set info */
-  molfile_qm_hessian_t hess;            /* hessian info */
-} molfile_qm_t;
-
-
-
-/**
- *  Enumeration of all of the wavefunction types that can be read
- *  from QM file reader plugins.
- *
- *  CANON    = canonical (i.e diagonalized) wavefunction
- *  GEMINAL  = GVB-ROHF geminal pairs
- *  MCSCFNAT = Multi-Configuration SCF natural orbitals
- *  MCSCFOPT = Multi-Configuration SCF optimized orbitals
- *  CINATUR  = Configuration-Interaction natural orbitals
- *  BOYS     = Boys localization
- *  RUEDEN   = Ruedenberg localization
- *  PIPEK    = Pipek-Mezey population localization
- *
- *  NBO related localizations:
- *  --------------------------
- *  NAO      = Natural Atomic Orbitals
- *  PNAO     = pre-orthogonal NAOs
- *  NBO      = Natural Bond Orbitals
- *  PNBO     = pre-orthogonal NBOs
- *  NHO      = Natural Hybrid Orbitals
- *  PNHO     = pre-orthogonal NHOs
- *  NLMO     = Natural Localized Molecular Orbitals
- *  PNLMO    = pre-orthogonal NLMOs
- *
- *  UNKNOWN  = Use this for any type not listed here
- *             You can use the string field for description
- */
-enum molfile_qm_wavefunc_type {
-  MOLFILE_WAVE_CANON,    MOLFILE_WAVE_GEMINAL,
-  MOLFILE_WAVE_MCSCFNAT, MOLFILE_WAVE_MCSCFOPT,
-  MOLFILE_WAVE_CINATUR,
-  MOLFILE_WAVE_PIPEK,  MOLFILE_WAVE_BOYS, MOLFILE_WAVE_RUEDEN,
-  MOLFILE_WAVE_NAO,    MOLFILE_WAVE_PNAO, MOLFILE_WAVE_NHO, 
-  MOLFILE_WAVE_PNHO,   MOLFILE_WAVE_NBO,  MOLFILE_WAVE_PNBO, 
-  MOLFILE_WAVE_PNLMO,  MOLFILE_WAVE_NLMO, MOLFILE_WAVE_MOAO, 
-  MOLFILE_WAVE_NATO,   MOLFILE_WAVE_UNKNOWN
-};
-
-
-/**
- *  Enumeration of all of the supported QM related charge
- *  types
- */
-enum molfile_qm_charge_type {
-  MOLFILE_QMCHARGE_UNKNOWN,
-  MOLFILE_QMCHARGE_MULLIKEN, MOLFILE_QMCHARGE_LOWDIN,
-  MOLFILE_QMCHARGE_ESP, MOLFILE_QMCHARGE_NPA
-};
-
-
-
-/**
- * Sizes of various QM-related, per-timestep data arrays
- * which must be allocated by the caller (VMD) so that the plugin
- * can fill in the arrays with data.
- */
-typedef struct molfile_qm_timestep_metadata {
-  unsigned int count;                  /**< total # timesteps; -1 if unknown */
-  unsigned int avg_bytes_per_timestep; /**< bytes per timestep                */
-  int has_gradient;                    /**< if timestep contains gradient    */
-  int num_scfiter;                     /**< # scf iterations for this ts     */
-  int num_orbitals_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< # orbitals for each wavefunction */
-  int has_orben_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital energy flags */
-  int has_occup_per_wavef[MOLFILE_MAXWAVEPERTS]; /**< orbital occupancy flags */
-  int num_wavef ;                      /**< # wavefunctions in this ts     */
-  int wavef_size;                      /**< size of one wavefunction 
-                                        *   (# of gaussian basis fctns)    */
-  int num_charge_sets;                 /**< # of charge values per atom */
-} molfile_qm_timestep_metadata_t;
-
-
-/**
- * QM wavefunction
- */
-typedef struct {
-  int   type;               /**< MOLFILE_WAVE_CANON, MOLFILE_WAVE_MCSCFNAT, ... */
-  int   spin;               /**< 1 for alpha, -1 for beta */
-  int   excitation;         /**< 0 for ground state, 1,2,3,... for excited states */
-  int   multiplicity;       /**< spin multiplicity of the state, zero if unknown */
-  char info[MOLFILE_BUFSIZ]; /**< string for additional type info */
-
-  double energy;            /**< energy of the electronic state.
-                             *   i.e. HF-SCF energy, CI state energy,
-                             *   MCSCF energy, etc. */
-
-  float *wave_coeffs;       /**< expansion coefficients for wavefunction in the
-                             *   form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */
-  float *orbital_energies;  /**< list of orbital energies for wavefunction */
-  float *occupancies;       /**< orbital occupancies */
-  int   *orbital_ids;       /**< orbital ID numbers; If NULL then VMD will
-                             *   assume 1,2,3,...num_orbs.     */
-} molfile_qm_wavefunction_t;
-
-
-/**
- * QM per trajectory timestep info
- * Note that each timestep can contain multiple wavefunctions.
- */
-typedef struct {
-  molfile_qm_wavefunction_t *wave; /**< array of wavefunction objects */
-  float  *gradient;         /**< force on each atom (=gradient of energy) */
-
-  double *scfenergies;      /**< energies from the SCF cycles */
-  double *charges;          /**< per-atom charges */
-  int    *charge_types;     /**< type of each charge set */
-} molfile_qm_timestep_t;
-
-
-/**************************************************************
- **************************************************************/
-
-
-
-
-/**
- *  Enumeration of all of the supported graphics objects that can be read
- *  from graphics file reader plugins.
- */
-enum molfile_graphics_type {
-  MOLFILE_POINT,  MOLFILE_TRIANGLE, MOLFILE_TRINORM, MOLFILE_NORMS, 
-  MOLFILE_LINE,   MOLFILE_CYLINDER, MOLFILE_CAPCYL,  MOLFILE_CONE,    
-  MOLFILE_SPHERE, MOLFILE_TEXT,     MOLFILE_COLOR,   MOLFILE_TRICOLOR
-};
-
-/**
- *  Individual graphics object/element data
- */ 
-typedef struct {
-  int type;             /* One of molfile_graphics_type */
-  int style;            /* A general style parameter    */
-  float size;           /* A general size parameter     */
-  float data[9];        /* All data for the element     */
-} molfile_graphics_t;
-
-
-/*
- * Types for raw graphics elements stored in files.  Data for each type
- * should be stored by the plugin as follows:
-
-type        data                                     style       size
-----        ----                                     -----       ----
-point       x, y, z                                              pixel size
-triangle    x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-trinorm     x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-            the next array element must be NORMS
-tricolor    x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-            the next array elements must be NORMS
-            the following element must be COLOR, with three RGB triples
-norms       x1,y1,z1,x2,y2,z2,x3,y3,z3                 
-line        x1,y1,z1,x2,y2,z2                        0=solid     pixel width
-                                                     1=stippled
-cylinder    x1,y1,z1,x2,y2,z2                        resolution  radius
-capcyl      x1,y1,z1,x2,y2,z2                        resolution  radius
-sphere      x1,y1,z1                                 resolution  radius
-text        x, y, z, up to 24 bytes of text                      pixel size
-color       r, g, b
-*/
-
-
-/**
- * Main file reader API.  Any function in this struct may be NULL
- * if not implemented by the plugin; the application checks this to determine
- * what functionality is present in the plugin. 
- */ 
-typedef struct {
-  /**
-   * Required header 
-   */
-  vmdplugin_HEAD
-
-  /**
-   * Filename extension for this file type.  May be NULL if no filename 
-   * extension exists and/or is known.  For file types that match several
-   * common extensions, list them in a comma separated list such as:
-   *  "pdb,ent,foo,bar,baz,ban"
-   * The comma separated list will be expanded when filename extension matching
-   * is performed.  If multiple plugins solicit the same filename extensions,
-   * the one that lists the extension earliest in its list is selected. In the 
-   * case of a "tie", the first one tried/checked "wins".
-   */
-  const char *filename_extension;
-
-  /**
-   * Try to open the file for reading.  Return an opaque handle, or NULL on
-   * failure. Set the number of atoms; if the number of atoms cannot be 
-   * determined, set natoms to MOLFILE_NUMATOMS_UNKNOWN. 
-   * Filetype should be the name under which this plugin was registered;
-   * this is provided so that plugins can provide the same function pointer
-   * to handle multiple file types.
-   */
-  void *(* open_file_read)(const char *filepath, const char *filetype, 
-      int *natoms);
-  
-  /**
-   * Read molecular structure from the given file handle.  atoms is allocated
-   * by the caller and points to space for natoms.
-   * On success, place atom information in the passed-in pointer.  
-   * optflags specifies which optional fields in the atoms will be set by
-   * the plugin.
-   */
-  int (*read_structure)(void *, int *optflags, molfile_atom_t *atoms);
-
-  /**
-   * Read bond information for the molecule.  On success the arrays from
-   * and to should point to the (one-based) indices of bonded atoms.
-   * Each unique bond should be specified only once, so file formats that list
-   * bonds twice will need post-processing before the results are returned to
-   * the caller.
-   * If the plugin provides bond information, but the file loaded doesn't 
-   * actually contain any bond info, the nbonds parameter should be
-   * set to 0 and from/to should be set to NULL to indicate that no bond
-   * information was actually present, and automatic bond search should be
-   * performed.  
-   *
-   * If the plugin provides bond order information, the bondorder array
-   * will contain the bond order for each from/to pair.  If not, the bondorder
-   * pointer should be set to NULL, in which case the caller will provide a 
-   * default bond order value of 1.0.
-   *
-   * If the plugin provides bond type information, the bondtype array
-   * will contain the bond type index for each from/to pair. These numbers
-   * are consecutive integers starting from 0.
-   * the bondtypenames list, contains the corresponding names, if available,
-   * as a NULL string terminated list. nbondtypes is provided for convenience
-   * and consistency checking.
-   *
-   * These arrays must be freed by the plugin in the close_file_read function.
-   * This function can be called only after read_structure().  
-   * Return MOLFILE_SUCCESS if no errors occur. 
-   */
-  int (*read_bonds)(void *, int *nbonds, int **from, int **to, float **bondorder, 
-                    int **bondtype, int *nbondtypes, char ***bondtypename);
-
-  /**
-   * XXX this function will be augmented and possibly superceded by a 
-   *     new QM-capable version named read_timestep(), when finished.
-   *
-   * Read the next timestep from the file.  Return MOLFILE_SUCCESS, or 
-   * MOLFILE_EOF on EOF.  If the molfile_timestep_t argument is NULL, then 
-   * the frame should be skipped.  Otherwise, the application must prepare 
-   * molfile_timestep_t by allocating space in coords for the corresponding 
-   * number of coordinates.  
-   * The natoms parameter exists because some coordinate file formats 
-   * (like CRD) cannot determine for themselves how many atoms are in a 
-   * timestep; the app must therefore obtain this information elsewhere
-   * and provide it to the plugin.
-   */
-  int (* read_next_timestep)(void *, int natoms, molfile_timestep_t *);
-
-  /**
-   * Close the file and release all data.  The handle cannot be reused.
-   */
-  void (* close_file_read)(void *);
-   
-  /**
-   * Open a coordinate file for writing using the given header information.
-   * Return an opaque handle, or NULL on failure.  The application must
-   * specify the number of atoms to be written. 
-   * filetype should be the name under which this plugin was registered.
-   */
-  void *(* open_file_write)(const char *filepath, const char *filetype, 
-      int natoms);
-  
-  /**
-   * Write structure information.  Return success.
-   */
-  int (* write_structure)(void *, int optflags, const molfile_atom_t *atoms);
-
-  /**
-   * Write a timestep to the coordinate file.  Return MOLFILE_SUCCESS if no
-   * errors occur.  If the file contains structure information in each 
-   * timestep (like a multi-entry PDB), it will have to cache the information 
-   * from the initial calls from write_structure.
-   */
-  int (* write_timestep)(void *, const molfile_timestep_t *);
-  
-  /**
-   * Close the file and release all data.  The handle cannot be reused.
-   */
-  void (* close_file_write)(void *);
-
-  /**
-   * Retrieve metadata pertaining to volumetric datasets in this file.
-   * Set nsets to the number of volumetric data sets, and set *metadata
-   * to point to an array of molfile_volumetric_t.  The array is owned by
-   * the plugin and should be freed by close_file_read().  The application
-   * may call this function any number of times.
-   */
-  int (* read_volumetric_metadata)(void *, int *nsets, 
-        molfile_volumetric_t **metadata);
-
-  /** 
-   * Read the specified volumetric data set into the space pointed to by 
-   * datablock.  The set is specified with a zero-based index.  The space 
-   * allocated for the datablock must be equal to
-   * xsize * ysize * zsize.  No space will be allocated for colorblock 
-   * unless has_color is nonzero; in that case, colorblock should be
-   * filled in with three RGB floats per datapoint.
-   */
-  int (* read_volumetric_data)(void *, int set, float *datablock, 
-        float *colorblock);
-#if vmdplugin_ABIVERSION > 16
-  int (* read_volumetric_data_ex)(void *, molfile_volumetric_readwrite_t *v);
-#endif
-
-  /**
-   * Read raw graphics data stored in this file.   Return the number of data
-   * elements and the data itself as an array of molfile_graphics_t in the 
-   * pointer provided by the application.  The plugin is responsible for 
-   * freeing the data when the file is closed.
-   */
-  int (* read_rawgraphics)(void *, int *nelem, const molfile_graphics_t **data);
-
-  /**
-   * Read molecule metadata such as what database (if any) this file/data
-   * came from, what the accession code for the database is, textual remarks
-   * and other notes pertaining to the contained structure/trajectory/volume
-   * and anything else that's informative at the whole file level.
-   */ 
-  int (* read_molecule_metadata)(void *, molfile_metadata_t **metadata);
-  
-  /**
-   * Write bond information for the molecule.  The arrays from
-   * and to point to the (one-based) indices of bonded atoms.
-   * Each unique bond will be specified only once by the caller. 
-   * File formats that list bonds twice will need to emit both the 
-   * from/to and to/from versions of each.
-   * This function must be called before write_structure().  
-   *
-   * Like the read_bonds() routine, the bondorder pointer is set to NULL
-   * if the caller doesn't have such information, in which case the 
-   * plugin should assume a bond order of 1.0 if the file format requires
-   * bond order information.
-   *
-   * Support for bond types follows the bondorder rules. bondtype is
-   * an integer array of the size nbonds that contains the bond type
-   * index (consecutive integers starting from 0) and bondtypenames
-   * contain the corresponding strings, in case the naming/numbering
-   * scheme is different from the index numbers.
-   * if the pointers are set to NULL, then this information is not available.
-   * bondtypenames can only be used of bondtypes is also given.
-   * Return MOLFILE_SUCCESS if no errors occur. 
-   */
-  int (* write_bonds)(void *, int nbonds, int *from, int *to, float *bondorder, 
-                     int *bondtype, int nbondtypes, char **bondtypename);
-
-  /**
-   * Write the specified volumetric data set into the space pointed to by 
-   * datablock.  The * allocated for the datablock must be equal to
-   * xsize * ysize * zsize.  No space will be allocated for colorblock 
-   * unless has_color is nonzero; in that case, colorblock should be
-   * filled in with three RGB floats per datapoint.
-   */
-  int (* write_volumetric_data)(void *, molfile_volumetric_t *metadata,
-                                float *datablock, float *colorblock);
-#if vmdplugin_ABIVERSION > 16
-  int (* write_volumetric_data_ex)(void *, molfile_volumetric_t *metadata,
-                                   molfile_volumetric_readwrite_t *v);
-#endif
-
-  /** 
-   * Read in Angles, Dihedrals, Impropers, and Cross Terms and optionally types.
-   * (Cross terms pertain to the CHARMM/NAMD CMAP feature) 
-   */
-  int (* read_angles)(void *handle, int *numangles, int **angles, int **angletypes,
-                      int *numangletypes, char ***angletypenames, int *numdihedrals,
-                      int **dihedrals, int **dihedraltypes, int *numdihedraltypes,
-                      char ***dihedraltypenames, int *numimpropers, int **impropers,        
-                      int **impropertypes, int *numimpropertypes, char ***impropertypenames,
-                      int *numcterms, int **cterms, int *ctermcols, int *ctermrows);
-
-  /** 
-   * Write out Angles, Dihedrals, Impropers, and Cross Terms
-   * (Cross terms pertain to the CHARMM/NAMD CMAP feature) 
-   */
-  int (* write_angles)(void *handle, int numangles, const int *angles, const int *angletypes,
-                       int numangletypes, const char **angletypenames, int numdihedrals,
-                       const int *dihedrals, const int *dihedraltypes, int numdihedraltypes,
-                       const char **dihedraltypenames, int numimpropers, 
-                       const int *impropers, const int *impropertypes, int numimpropertypes,
-                       const char **impropertypenames, int numcterms,  const int *cterms, 
-                       int ctermcols, int ctermrows);
-
-
-  /**
-   * Retrieve metadata pertaining to timestep independent
-   * QM datasets in this file.
-   *
-   * The metadata are the sizes of the QM related data structure
-   * arrays that will be populated by the plugin when 
-   * read_qm_rundata() is called. Since the allocation of these
-   * arrays is done by VMD rather than the plugin, VMD needs to
-   * know the sizes beforehand. Consequently read_qm_metadata()
-   * has to be called before read_qm_rundata().
-   */
-  int (* read_qm_metadata)(void *, molfile_qm_metadata_t *metadata);
-
-
-  /**
-   * Read timestep independent QM data.
-   *
-   * Typical data that are defined only once per trajectory are
-   * general info about the calculation (such as the used method), 
-   * the basis set and normal modes.
-   * The data structures to be populated must have been allocated
-   * before by VMD according to sizes obtained through
-   * read_qm_metadata().
-   */
-  int (* read_qm_rundata)(void *, molfile_qm_t *qmdata);
-
-
-  /**
-   * Read the next timestep from the file.  Return MOLFILE_SUCCESS, or 
-   * MOLFILE_EOF on EOF.  If the molfile_timestep_t or molfile_qm_metadata_t
-   * arguments are NULL, then the coordinate or qm data should be skipped.  
-   * Otherwise, the application must prepare molfile_timestep_t and 
-   * molfile_qm_timestep_t by allocating space for the corresponding 
-   * number of coordinates, orbital wavefunction coefficients, etc.
-   * Since it is common for users to want to load only the final timestep 
-   * data from a QM run, the application may provide any combination of
-   * valid, or NULL pointers for the molfile_timestep_t and 
-   * molfile_qm_timestep_t parameters, depending on what information the
-   * user is interested in.
-   * The natoms and qm metadata parameters exist because some file formats 
-   * cannot determine for themselves how many atoms etc are in a 
-   * timestep; the app must therefore obtain this information elsewhere
-   * and provide it to the plugin.
-   */
-  int (* read_timestep)(void *, int natoms, molfile_timestep_t *,
-                        molfile_qm_metadata_t *, molfile_qm_timestep_t *);
-
-  int (* read_timestep_metadata)(void *, molfile_timestep_metadata_t *);
-  int (* read_qm_timestep_metadata)(void *, molfile_qm_timestep_metadata_t *);
-
-#if defined(DESRES_READ_TIMESTEP2)
-  /**
-    * Read a specified timestep!
-    */
-  int (* read_timestep2)(void *, molfile_ssize_t index, molfile_timestep_t *);
-
-  /**
-    * write up to count times beginning at index start into the given
-    * space.  Return the number read, or -1 on error.
-    */
-  molfile_ssize_t (* read_times)( void *,
-                                  molfile_ssize_t start,
-                                  molfile_ssize_t count,
-                                  double * times );
-#endif
-
-  /**
-   *  Console output, READ-ONLY function pointer.
-   *  Function pointer that plugins can use for printing to the host
-   *  application's text console.  This provides a clean way for plugins
-   *  to send message strings back to the calling application, giving the
-   *  caller the ability to prioritize, buffer, and redirect console messages
-   *  to an appropriate output channel, window, etc.  This enables the use of
-   *  graphical consoles like TkCon without losing console output from plugins.
-   *  If the function pointer is NULL, no console output service is provided
-   *  by the calling application, and the output should default to stdout
-   *  stream.  If the function pointer is non-NULL, all output will be
-   *  subsequently dealt with by the calling application.
-   *
-   *  XXX this should really be put into a separate block of
-   *      application-provided read-only function pointers for any
-   *      application-provided services
-   */
-  int (* cons_fputs)(const int, const char*);
-
-} molfile_plugin_t;
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/include/vmdconio.h b/pymolfile/molfile/vmd_molfile_plugins/include/vmdconio.h
deleted file mode 100644
index 740c48d8f581b9a4914f08d0df26f4e7726017e7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/include/vmdconio.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 2009 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vmdconio.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.4 $       $Date: 2015/10/11 22:36:27 $
- *
- ***************************************************************************/
-
-/** @file
- * APIs for console output management.  The calling application may 
- * optionally provide callback routines for console output that direct 
- * output to GUI consoles and other places besides stdout.
- */
-
-#ifndef VMDCON_PLUGIN_H
-#define VMDCON_PLUGIN_H
-
-/* this has to correspond to vmdconsole.h */
-#define VMDCON_ALL       0      /**< "print all messages" log level   */
-#define VMDCON_INFO      1      /**< informational messages log level */
-#define VMDCON_WARN      2      /**< warning messages" log level      */
-#define VMDCON_ERROR     3      /**< error messages log level         */
-#define VMDCON_ALWAYS    4      /**< print always log level           */
-#define VMDCON_LOG       5      /**< store only in syslog log level   */
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* set default */
-#if !defined(THISPLUGIN)
-#define THISPLUGIN plugin
-#endif
-
-/* forward declaration */
-static molfile_plugin_t THISPLUGIN;
-
-/* 
- * Emulate printf. unfortunately, we cannot rely on 
- * snprintf being available, so we have to write to
- * a very large buffer and then free it. :-( 
- */
-static int vmdcon_printf(int lvl, const char *fmt, ...) {
-  va_list ap;
-  char *buf;
-  int len;
-
-  /* expand formatted output into a single string */
-  buf = (char *)malloc(MOLFILE_BIGBUFSIZ);
-  va_start(ap, fmt);
-  len = vsprintf(buf, fmt, ap);
-
-  /* 
-   * Check result. we may get a segfault, but if not
-   * let the user know that he/she is in trouble. 
-   */
-  if (len >= MOLFILE_BIGBUFSIZ) {
-    fprintf(stderr,"WARNING! buffer overflow in vmdcon_printf. %d vs %d.\n",
-            len, MOLFILE_BIGBUFSIZ);
-    free(buf);
-#if 0
-    errno=ERANGE; /* this is inherently thread-unsafe */
-#endif
-    return -1;
-  }
-
-  /* 
-   * write to registered console output function.
-   * fall back to stdout, if vmdcon not available. 
-   */
-  if (THISPLUGIN.cons_fputs) {
-    (*THISPLUGIN.cons_fputs)(lvl, buf);
-  } else {
-    fputs(buf, stdout);
-  }
-  free(buf);
-  return 0;    
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* VMDCON_PLUGIN_H */
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/include/vmdplugin.h b/pymolfile/molfile/vmd_molfile_plugins/include/vmdplugin.h
deleted file mode 100644
index bbbc53c9bbfd9980028a7fff6ece2d06cfa08127..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/include/vmdplugin.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2006 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vmdplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.33 $       $Date: 2015/10/29 05:10:54 $
- *
- ***************************************************************************/
-
-/** @file
- * This header must be included by every VMD plugin library.  It defines the
- * API for every plugin so that VMD can organize the plugins it finds.  
- */
-
-#ifndef VMD_PLUGIN_H
-#define VMD_PLUGIN_H
-
-
-/* 
- * Preprocessor tricks to make it easier for us to redefine the names of
- * functions when building static plugins.
- */
-#if !defined(VMDPLUGIN)
-/** 
-  * macro defining VMDPLUGIN if it hasn't already been set to the name of 
-  * a static plugin that is being compiled.  This is the catch-all case.
-  */
-#define VMDPLUGIN vmdplugin
-#endif
-/** concatenation macro, joins args x and y together as a single string */
-#define xcat(x, y) cat(x, y)
-/** concatenation macro, joins args x and y together as a single string */
-#define cat(x, y) x ## y 
-
-/*
- *  macros to correctly define plugin function names depending on whether 
- *  the plugin is being compiled for static linkage or dynamic loading. 
- *  When compiled for static linkage, each plugin needs to have unique
- *  function names for all of its entry points.  When compiled for dynamic
- *  loading, the plugins must name their entry points consistently so that
- *  the plugin loading mechanism can find the register, register_tcl, init,
- *  and fini routines via dlopen() or similar operating system interfaces.
- */
-/*@{*/
-/** Macro names entry points correctly for static linkage or dynamic loading */
-#define VMDPLUGIN_register     xcat(VMDPLUGIN, _register)
-#define VMDPLUGIN_register_tcl xcat(VMDPLUGIN, _register_tcl)
-#define VMDPLUGIN_init         xcat(VMDPLUGIN, _init)
-#define VMDPLUGIN_fini         xcat(VMDPLUGIN, _fini)
-/*@}*/
-
-
-/** "WIN32" is defined on both WIN32 and WIN64 platforms... */
-#if (defined(WIN32)) 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#if !defined(STATIC_PLUGIN)
-#if defined(VMDPLUGIN_EXPORTS)
-/** 
- *  Only define DllMain for plugins, not in VMD or in statically linked plugins
- *  VMDPLUGIN_EXPORTS is only defined when compiling dynamically loaded plugins
- */
-BOOL APIENTRY DllMain( HANDLE hModule,
-                       DWORD ul_reason_for_call,
-                       LPVOID lpReserved
-                     )
-{
-  return TRUE;
-}
-
-#define VMDPLUGIN_API __declspec(dllexport)
-#else
-#define VMDPLUGIN_API __declspec(dllimport)
-#endif /* VMDPLUGIN_EXPORTS */
-#else  /* ! STATIC_PLUGIN */
-#define VMDPLUGIN_API
-#endif /* ! STATIC_PLUGIN */
-#else
-/** If we're not compiling on Windows, then this macro is defined empty */
-#define VMDPLUGIN_API 
-#endif
-
-/** define plugin linkage correctly for both C and C++ based plugins */
-#ifdef __cplusplus
-#define VMDPLUGIN_EXTERN extern "C" VMDPLUGIN_API
-#else
-#define VMDPLUGIN_EXTERN extern VMDPLUGIN_API
-#endif  /* __cplusplus */
-
-/* 
- * Plugin API functions start here 
- */
-
-
-/** 
- * Init routine: called the first time the library is loaded by the 
- * application and before any other API functions are referenced.
- * Return 0 on success.
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_init(void);
-
-/**
- * Macro for creating a struct header used in all plugin structures.
- * 
- * This header should be placed at the top of every plugin API definition 
- * so that it can be treated as a subtype of the base plugin type.
- *
- * abiversion: Defines the ABI for the base plugin type (not for other plugins)
- * type: A string descriptor of the plugin type.
- * name: A name for the plugin.
- * author: A string identifier, possibly including newlines.
- * Major and minor version.  
- * is_reentrant: Whether this library can be run concurrently with itself.
- */
-#define vmdplugin_HEAD \
-  int abiversion; \
-  const char *type; \
-  const char *name; \
-  const char *prettyname; \
-  const char *author; \
-  int majorv; \
-  int minorv; \
-  int is_reentrant; 
-
-/** 
-  * Typedef for generic plugin header, individual plugins can
-  * make their own structures as long as the header info remains 
-  * the same as the generic plugin header, most easily done by 
-  * using the vmdplugin_HEAD macro.
-  */
-typedef struct {
-  vmdplugin_HEAD
-} vmdplugin_t;
-
-/**
- * Use this macro to initialize the abiversion member of each plugin
- */
-#define vmdplugin_ABIVERSION  17
-
-/*@{*/
-/** Use this macro to indicate a plugin's thread-safety at registration time */
-#define VMDPLUGIN_THREADUNSAFE 0
-#define VMDPLUGIN_THREADSAFE   1
-/*@}*/
-
-/*@{*/
-/** Error return code for use in the plugin registration and init functions */
-#define VMDPLUGIN_SUCCESS      0
-#define VMDPLUGIN_ERROR       -1
-/*@}*/
-
-/** 
- * Function pointer typedef for register callback functions
- */
-typedef int (*vmdplugin_register_cb)(void *, vmdplugin_t *);
-
-/**
- * Allow the library to register plugins with the application.
- * The callback should be called using the passed-in void pointer, which
- * should not be interpreted in any way by the library.  Each vmdplugin_t
- * pointer passed to the application should point to statically-allocated
- * or heap-allocated memory and should never be later modified by the plugin.
- * Applications must be permitted to retain only a copy of the the plugin
- * pointer, without making any deep copy of the items in the struct.
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_register(void *, vmdplugin_register_cb);
-
-/**
- * Allow the library to register Tcl extensions.  
- * This API is optional; if found by dlopen, it will be called after first
- * calling init and register.  
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_register_tcl(void *, void *tcl_interp, 
-    vmdplugin_register_cb);
-
-/**
- * The Fini method is called when the application will no longer use 
- * any plugins in the library.  
- */
-VMDPLUGIN_EXTERN int VMDPLUGIN_fini(void);
-
-#endif   /* VMD_PLUGIN_H */
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Entries
deleted file mode 100644
index a016e062d486da9a444105b5e41722882999cf90..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Entries
+++ /dev/null
@@ -1,6 +0,0 @@
-D/doc////
-D/msvc////
-D/src////
-D/f77////
-/LICENSE/1.1/Thu Nov  6 21:15:38 2003//
-/Makefile/1.126/Tue Dec 15 21:12:07 2015//
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Repository
deleted file mode 100644
index 89b4780c5e329d247e2caabb66773256a797a8fc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/LICENSE b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/LICENSE
deleted file mode 100644
index 1a92efa01157bd599b2668a6d9f751f548ad2719..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/LICENSE
+++ /dev/null
@@ -1,35 +0,0 @@
-University of Illinois Open Source License
-Copyright 2003 Theoretical and Computational Biophysics Group, 
-All rights reserved.
-
-Developed by:		Theoretical and Computational Biophysics Group
-			University of Illinois at Urbana-Champaign
-			http://www.ks.uiuc.edu/
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the Software), to deal with 
-the Software without restriction, including without limitation the rights to 
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
-of the Software, and to permit persons to whom the Software is furnished to 
-do so, subject to the following conditions:
-
-Redistributions of source code must retain the above copyright notice, 
-this list of conditions and the following disclaimers.
-
-Redistributions in binary form must reproduce the above copyright notice, 
-this list of conditions and the following disclaimers in the documentation 
-and/or other materials provided with the distribution.
-
-Neither the names of Theoretical and Computational Biophysics Group, 
-University of Illinois at Urbana-Champaign, nor the names of its contributors 
-may be used to endorse or promote products derived from this Software without 
-specific prior written permission.
-
-THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
-OTHER DEALINGS WITH THE SOFTWARE.
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile
deleted file mode 100644
index 2c856687048bd7d7eb13b369564089b8d40c8a43..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile
+++ /dev/null
@@ -1,969 +0,0 @@
-# Makefile for molecule file readers
-# $Id: Makefile,v 1.126 2015/12/15 21:12:07 johns Exp $
-
-.SILENT:
-
-.SUFFIXES:
-
-PLUGINAPI = molfile_plugin.h vmdplugin.h vmdconio.h
-COMPILEDIR = ../compile
-ARCHDIR=${COMPILEDIR}/lib_${ARCH}/molfile
-
-SRCDIR = src
-INCDIR = -I../include -I${SRCDIR}
-
-VPATH = src ../include ${ARCHDIR}
-
-SCCFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-SCXXFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-
-#
-# Rules
-#
-
-STATICPLUGINS = abinitplugin avsplugin babelplugin basissetplugin bgfplugin binposplugin biomoccaplugin brixplugin carplugin ccp4plugin corplugin cpmdplugin crdplugin cubeplugin dcdplugin dlpolyplugin dsn6plugin dxplugin edmplugin fs4plugin gamessplugin graspplugin grdplugin gridplugin gromacsplugin jsplugin lammpsplugin mapplugin mdfplugin mol2plugin moldenplugin molemeshplugin msmsplugin namdbinplugin offplugin parm7plugin parmplugin pbeqplugin pdbplugin pdbxplugin phiplugin pltplugin plyplugin pqrplugin psfplugin raster3dplugin rst7plugin situsplugin spiderplugin stlplugin tinkerplugin uhbdplugin vaspchgcarplugin vaspoutcarplugin vaspparchgplugin vaspposcarplugin vasp5xdatcarplugin vaspxdatcarplugin vaspxmlplugin vtkplugin xbgfplugin xsfplugin xyzplugin
-
-PLUGINS = abinitplugin.so avsplugin.so babelplugin.so basissetplugin.so bgfplugin.so binposplugin.so biomoccaplugin.so brixplugin.so carplugin.so ccp4plugin.so corplugin.so cpmdplugin.so crdplugin.so cubeplugin.so dcdplugin.so dlpolyplugin.so dsn6plugin.so dxplugin.so edmplugin.so fs4plugin.so gamessplugin.so graspplugin.so grdplugin.so gridplugin.so gromacsplugin.so jsplugin.so lammpsplugin.so mapplugin.so mdfplugin.so mol2plugin.so moldenplugin.so molemeshplugin.so msmsplugin.so namdbinplugin.so offplugin.so parm7plugin.so parmplugin.so pbeqplugin.so pdbplugin.so pdbxplugin.so phiplugin.so pltplugin.so plyplugin.so pqrplugin.so psfplugin.so raster3dplugin.so rst7plugin.so situsplugin.so spiderplugin.so stlplugin.so tinkerplugin.so uhbdplugin.so vaspchgcarplugin.so vaspoutcarplugin.so vaspparchgplugin.so vaspposcarplugin.so vasp5xdatcarplugin.so vaspxdatcarplugin.so vaspxmlplugin.so vtkplugin.so xbgfplugin.so xsfplugin.so xyzplugin.so
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-STATICPLUGINS += dtrplugin maeffplugin
-PLUGINS       += dtrplugin.so maeffplugin.so
-endif
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-# XXX We can safetly assume that VMD is compiled against Tcl, so there is
-#     no need to check if the Tcl libs are static or dynamic here.
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-STATICPLUGINS += vtfplugin webpdbplugin
-PLUGINS       += vtfplugin.so webpdbplugin.so
-endif
-endif
-endif
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-# Only add the NetCDF plugin as a static plugin if we compiled against
-# a static libnetcdf.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += netcdfplugin
-endif
-PLUGINS       += netcdfplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-# Only add the HOOMD plugin as a static plugin if we compiled against
-# a static libexpat.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += hoomdplugin
-endif
-PLUGINS       += hoomdplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional sqlite-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef SQLITELIB
-ifdef SQLITEINC
-ifdef SQLITELDFLAGS
-ifndef SQLITEDYNAMIC
-# Only add the dmsplugin as a static plugin if we compiled against
-# a static sqlite.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += dmsplugin
-endif
-PLUGINS       += dmsplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ifndef TNGDYNAMIC
-STATICPLUGINS += tngplugin
-endif
-PLUGINS       += tngplugin.so
-endif
-endif
-endif
-
-
-# list of all optional plugins for use by distrib target
-OPTPLUGINS = dmsplugin.so hoomdplugin.so netcdfplugin.so tngplugin.so vtfplugin.so webpdbplugin.so 
-
-STATICS = libmolfile_plugin.a libmolfile_plugin.h
-ifeq ($(ARCH),$(filter $(ARCH),MACOSX MAXOSXX86 MACOSXX86_64))
-SODYNLIB = libmolfile_plugin.dylib
-endif
-WIN32STATICS = libmolfile_plugin.lib libmolfile_plugin.h
-DISTFILES = $(PLUGINS) $(OPTPLUGINS) $(STATICS) $(WIN32STATICS)
-
-bins:
-win32bins:
-dynlibs: ${ARCHDIR} mesg $(PLUGINS)
-ifeq ($(ARCH),$(filter $(ARCH),MACOSX MAXOSXX86 MACOSXX86_64))
-staticlibs: ${ARCHDIR} $(STATICS) $(SODYNLIB)
-else
-staticlibs: ${ARCHDIR} $(STATICS)
-endif
-win32staticlibs: ${ARCHDIR} $(WIN32STATICS)
-
-distrib:
-	@echo "Copying molfile plugins to $(PLUGINDIR) destination area"
-	for file in $(DISTFILES) ; do \
-		echo "    $$file ..."; \
-		for localname in `find ../compile -name $$file -print`; do \
-			pluginname=`echo $$localname | sed s/..\\\/compile\\\/lib_// `; \
-			dir=`dirname $(PLUGINDIR)/$$pluginname`; \
-			mkdir -p $$dir; \
-			cp -p $$localname $(PLUGINDIR)/$$pluginname; \
-		done; \
-	done;
-
-mesg:
-	@echo "Building Molecule File Reader plugins"
-
-
-#
-# plugin library rules
-#
-
-abinitplugin.so: ${ARCHDIR}/abinitplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-avsplugin.so: ${ARCHDIR}/avsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-babelplugin.so: ${ARCHDIR}/babelplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-basissetplugin.so: ${ARCHDIR}/basissetplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-bgfplugin.so: ${ARCHDIR}/bgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-binposplugin.so: ${ARCHDIR}/binposplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-biomoccaplugin.so: ${ARCHDIR}/biomoccaplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-brixplugin.so: ${ARCHDIR}/brixplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-carplugin.so: ${ARCHDIR}/carplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-ccp4plugin.so: ${ARCHDIR}/ccp4plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-corplugin.so: ${ARCHDIR}/corplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cpmdplugin.so: ${ARCHDIR}/cpmdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-crdplugin.so: ${ARCHDIR}/crdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cubeplugin.so: ${ARCHDIR}/cubeplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dcdplugin.so: ${ARCHDIR}/dcdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dlpolyplugin.so: ${ARCHDIR}/dlpolyplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dsn6plugin.so: ${ARCHDIR}/dsn6plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dxplugin.so: ${ARCHDIR}/dxplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-edmplugin.so: ${ARCHDIR}/edmplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-fs4plugin.so: ${ARCHDIR}/fs4plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gamessplugin.so: ${ARCHDIR}/gamessplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-graspplugin.so: ${ARCHDIR}/graspplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-grdplugin.so: ${ARCHDIR}/grdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gridplugin.so: ${ARCHDIR}/gridplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gromacsplugin.so: ${ARCHDIR}/gromacsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-jsplugin.so: ${ARCHDIR}/jsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-lammpsplugin.so: ${ARCHDIR}/lammpsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mapplugin.so: ${ARCHDIR}/mapplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mdfplugin.so: ${ARCHDIR}/mdfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mol2plugin.so: ${ARCHDIR}/mol2plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-moldenplugin.so: ${ARCHDIR}/moldenplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-molemeshplugin.so: ${ARCHDIR}/molemeshplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-msmsplugin.so: ${ARCHDIR}/msmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-namdbinplugin.so: ${ARCHDIR}/namdbinplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-offplugin.so: ${ARCHDIR}/offplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parm7plugin.so: ${ARCHDIR}/parm7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parmplugin.so: ${ARCHDIR}/parmplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pbeqplugin.so: ${ARCHDIR}/pbeqplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pdbplugin.so: ${ARCHDIR}/pdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pdbxplugin.so: ${ARCHDIR}/pdbxplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-phiplugin.so: ${ARCHDIR}/phiplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pltplugin.so: ${ARCHDIR}/pltplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-plyplugin.so: ${ARCHDIR}/plyplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pqrplugin.so: ${ARCHDIR}/pqrplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-psfplugin.so: ${ARCHDIR}/psfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-raster3dplugin.so: ${ARCHDIR}/raster3dplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-rst7plugin.so: ${ARCHDIR}/rst7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-situsplugin.so: ${ARCHDIR}/situsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-spiderplugin.so: ${ARCHDIR}/spiderplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-stlplugin.so: ${ARCHDIR}/stlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tinkerplugin.so: ${ARCHDIR}/tinkerplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-uhbdplugin.so: ${ARCHDIR}/uhbdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspchgcarplugin.so: ${ARCHDIR}/vaspchgcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspoutcarplugin.so: ${ARCHDIR}/vaspoutcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspparchgplugin.so: ${ARCHDIR}/vaspparchgplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspposcarplugin.so: ${ARCHDIR}/vaspposcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vasp5xdatcarplugin.so: ${ARCHDIR}/vasp5xdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxdatcarplugin.so: ${ARCHDIR}/vaspxdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxmlplugin.so: ${ARCHDIR}/vaspxmlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vtkplugin.so: ${ARCHDIR}/vtkplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xbgfplugin.so: ${ARCHDIR}/xbgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xsfplugin.so: ${ARCHDIR}/xsfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xyzplugin.so: ${ARCHDIR}/xyzplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-cpmdlogplugin.so: ${ARCHDIR}/cpmdlogplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gaussianplugin.so: ${ARCHDIR}/gaussianplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-hoomdplugin.so: ${ARCHDIR}/hoomdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(EXPATLIB) $(EXPATLDFLAGS) $(LDFLAGS)
-
-netcdfplugin.so: ${ARCHDIR}/netcdfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(NETCDFLIB) $(NETCDFLDFLAGS) $(LDFLAGS)
-
-vtfplugin.so: ${ARCHDIR}/vtfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-webpdbplugin.so: ${ARCHDIR}/webpdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-dmsplugin.so: ${ARCHDIR}/dmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(SQLITELIB) $(SQLITELDFLAGS) $(LDFLAGS)
-
-dtrplugin.so: ${ARCHDIR}/dtrplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-maeffplugin.so: ${ARCHDIR}/maeffplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tngplugin.so: ${ARCHDIR}/tngplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TNGLIB) $(TNGLDFLAGS) $(LDFLAGS)
-
-
-#
-# object files
-#
-${ARCHDIR}/abinitplugin.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin.o: avsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin.o: bgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin.o: binposplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin.o: biomoccaplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin.o: brixplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin.o: carplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin.o: ccp4plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin.o: corplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin.o: crdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin.o: dcdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin.o: dlpolyplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin.o: dsn6plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin.o: dxplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin.o: edmplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin.o: fs4plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin.o: graspplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin.o: grdplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin.o: gridplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin.o: jsplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin.o: mapplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin.o: mdfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin.o: mol2plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin.o: molemeshplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin.o: msmsplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin.o: namdbinplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin.o: offplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin.o: parm7plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin.o: parmplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin.o: pbeqplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbxplugin.o: pdbxplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin.o: phiplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin.o: pltplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/plyplugin.o: plyplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin.o: pqrplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin.o: psfplugin.c fortread.h ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin.o: raster3dplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin.o: rst7plugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin.o: situsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin.o: spiderplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin.o: stlplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin.o: tinkerplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin.o: uhbdplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/hoomdplugin.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(EXPATINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin.o: netcdfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(NETCDFINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin.o: vtfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vtkplugin.o: vtkplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin.o: xbgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin.o: gaussianplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/dmsplugin.o: dmsplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(SQLITEINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin.o: dtrplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin.o: maeffplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${CXXFLAGS} $(SHLDFLAGS) $(TNGINC) $(INCDIR) -c $< $(COPTO)$@
-
-
-
-#
-# archive rules
-#
-ARCHIVEOBJS = ${ARCHDIR}/abinitplugin-s.o ${ARCHDIR}/avsplugin-s.o ${ARCHDIR}/babelplugin-s.o ${ARCHDIR}/basissetplugin-s.o ${ARCHDIR}/bgfplugin-s.o ${ARCHDIR}/binposplugin-s.o ${ARCHDIR}/biomoccaplugin-s.o ${ARCHDIR}/brixplugin-s.o ${ARCHDIR}/carplugin-s.o ${ARCHDIR}/ccp4plugin-s.o ${ARCHDIR}/corplugin-s.o ${ARCHDIR}/cpmdplugin-s.o ${ARCHDIR}/crdplugin-s.o ${ARCHDIR}/cubeplugin-s.o ${ARCHDIR}/dcdplugin-s.o ${ARCHDIR}/dlpolyplugin-s.o ${ARCHDIR}/dsn6plugin-s.o ${ARCHDIR}/dxplugin-s.o ${ARCHDIR}/edmplugin-s.o ${ARCHDIR}/fs4plugin-s.o ${ARCHDIR}/gamessplugin-s.o ${ARCHDIR}/graspplugin-s.o ${ARCHDIR}/grdplugin-s.o ${ARCHDIR}/gridplugin-s.o ${ARCHDIR}/gromacsplugin-s.o ${ARCHDIR}/jsplugin-s.o ${ARCHDIR}/lammpsplugin-s.o ${ARCHDIR}/mapplugin-s.o ${ARCHDIR}/mdfplugin-s.o ${ARCHDIR}/mol2plugin-s.o ${ARCHDIR}/moldenplugin-s.o ${ARCHDIR}/molemeshplugin-s.o ${ARCHDIR}/msmsplugin-s.o ${ARCHDIR}/namdbinplugin-s.o ${ARCHDIR}/offplugin-s.o ${ARCHDIR}/parm7plugin-s.o ${ARCHDIR}/parmplugin-s.o ${ARCHDIR}/pbeqplugin-s.o ${ARCHDIR}/pdbplugin-s.o ${ARCHDIR}/pdbxplugin-s.o ${ARCHDIR}/phiplugin-s.o ${ARCHDIR}/pltplugin-s.o ${ARCHDIR}/plyplugin-s.o ${ARCHDIR}/pqrplugin-s.o ${ARCHDIR}/psfplugin-s.o ${ARCHDIR}/raster3dplugin-s.o ${ARCHDIR}/rst7plugin-s.o ${ARCHDIR}/situsplugin-s.o ${ARCHDIR}/spiderplugin-s.o ${ARCHDIR}/stlplugin-s.o ${ARCHDIR}/tinkerplugin-s.o ${ARCHDIR}/uhbdplugin-s.o ${ARCHDIR}/vaspchgcarplugin-s.o ${ARCHDIR}/vaspoutcarplugin-s.o ${ARCHDIR}/vaspparchgplugin-s.o ${ARCHDIR}/vaspposcarplugin-s.o ${ARCHDIR}/vasp5xdatcarplugin-s.o ${ARCHDIR}/vaspxdatcarplugin-s.o ${ARCHDIR}/vaspxmlplugin-s.o ${ARCHDIR}/vtkplugin-s.o ${ARCHDIR}/xbgfplugin-s.o ${ARCHDIR}/xsfplugin-s.o ${ARCHDIR}/xyzplugin-s.o
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-ARCHIVEOBJS += ${ARCHDIR}/dtrplugin-s.o ${ARCHDIR}/maeffplugin-s.o
-endif
-
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/vtfplugin-s.o ${ARCHDIR}/webpdbplugin-s.o
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/netcdfplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/hoomdplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/tngplugin-s.o
-endif
-endif
-endif
-
-
-ifeq ($(ARCH),$(filter $(ARCH),MACOSX MAXOSXX86 MACOSXX86_64))
-libmolfile_plugin.dylib: ${ARCHIVEOBJS} libmolfile_plugin.h
-	rm -f ${ARCHDIR}/$@
-	$(CXX) -dynamiclib ${INCDIR} ${ARCHDIR}/libmolfile_plugin.a -I${ARCHDIR}/libmolfile_plugin.h -o ${ARCHDIR}/$@ ${ARCHIVEOBJS}
-endif
-
-libmolfile_plugin.a: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	$(AR) cr ${ARCHDIR}/$@ ${ARCHIVEOBJS} 
-	$(RANLIB) ${ARCHDIR}/$@
-
-libmolfile_plugin.lib: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	lib /OUT:${ARCHDIR}/$@ ${ARCHIVEOBJS}
-
-libmolfile_plugin.h: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@
-	touch ${ARCHDIR}/$@
-	../create_static_header.sh MOLFILE molfile ${ARCHDIR}/$@ ${STATICPLUGINS}
-
-#
-# object files suitable for static linking
-#
-${ARCHDIR}/abinitplugin-s.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_abinitplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin-s.o: avsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_avsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin-s.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_babelplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin-s.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_basissetplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin-s.o: bgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_bgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin-s.o: binposplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_binposplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin-s.o: biomoccaplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_biomoccaplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin-s.o: brixplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_brixplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin-s.o: carplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_carplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin-s.o: ccp4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_ccp4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin-s.o: corplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_corplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin-s.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin-s.o: crdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_crdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin-s.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cubeplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin-s.o: dcdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dcdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin-s.o: dlpolyplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dlpolyplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin-s.o: dsn6plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dsn6plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin-s.o: dxplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dxplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin-s.o: edmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_edmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin-s.o: fs4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_fs4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin-s.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gamessplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin-s.o: graspplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_graspplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin-s.o: grdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_grdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin-s.o: gridplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gridplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin-s.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gromacsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin-s.o: jsplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_jsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin-s.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_lammpsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin-s.o: mapplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mapplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin-s.o: mdfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin-s.o: mol2plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mol2plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin-s.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_moldenplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin-s.o: molemeshplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_molemeshplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin-s.o: msmsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_msmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin-s.o: namdbinplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_namdbinplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin-s.o: offplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_offplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin-s.o: parm7plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parm7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin-s.o: parmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin-s.o: pbeqplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pbeqplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin-s.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbxplugin-s.o: pdbxplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pdbxplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin-s.o: phiplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_phiplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin-s.o: pltplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pltplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/plyplugin-s.o: plyplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_plyplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin-s.o: pqrplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pqrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin-s.o: psfplugin.c fortread.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_psfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin-s.o: raster3dplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_raster3dplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin-s.o: rst7plugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_rst7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin-s.o: situsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_situsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin-s.o: spiderplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_spiderplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin-s.o: stlplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_stlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin-s.o: tinkerplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tinkerplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin-s.o: uhbdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_uhbdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin-s.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspchgcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin-s.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspoutcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin-s.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspparchgplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin-s.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspposcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin-s.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vasp5xdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin-s.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin-s.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxmlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vtkplugin-s.o: vtkplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vtkplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin-s.o: xbgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xbgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin-s.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xsfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin-s.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xyzplugin" -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin-s.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdlogplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin-s.o: gaussianplugin.c ${PLUGINAPI}  gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gaussianplugin" -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/hoomdplugin-s.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(EXPATINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_hoomdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin-s.o: netcdfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(NETCDFINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_netcdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin-s.o: vtfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_vtfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin-s.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_webpdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dmsplugin-s.o: dmsplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(SQLITEINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin-s.o: dtrplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dtrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin-s.o: maeffplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_maeffplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin-s.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(TNGINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tngplugin" -c $< $(COPTO)$@
-
-
-${ARCHDIR} :
-	mkdir -p ${ARCHDIR}
-
-clean:
-	find ${COMPILEDIR} \( -name *.o -o -name *.a -o -name *.so -o -name *.dll \) -print | xargs rm -f
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile.orig b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile.orig
deleted file mode 100644
index 2eb41a3ddc90114a2e3932d0c9a38192b17dcee9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile.orig
+++ /dev/null
@@ -1,929 +0,0 @@
-# Makefile for molecule file readers
-# $Id: Makefile,v 1.123 2014/12/05 22:02:00 johns Exp $
-
-.SILENT:
-
-.SUFFIXES:
-
-PLUGINAPI = molfile_plugin.h vmdplugin.h vmdconio.h
-COMPILEDIR = ../compile
-ARCHDIR=${COMPILEDIR}/lib_${ARCH}/molfile
-
-SRCDIR = src
-INCDIR = -I../include -I${SRCDIR}
-
-VPATH = src ../include ${ARCHDIR}
-
-SCCFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-SCXXFLAGS = $(CCFLAGS) $(DEF)"STATIC_PLUGIN"
-
-#
-# Rules
-#
-
-STATICPLUGINS = abinitplugin avsplugin babelplugin basissetplugin bgfplugin binposplugin biomoccaplugin brixplugin carplugin ccp4plugin corplugin cpmdplugin crdplugin cubeplugin dcdplugin dlpolyplugin dsn6plugin dxplugin edmplugin fs4plugin gamessplugin graspplugin grdplugin gridplugin gromacsplugin jsplugin lammpsplugin mapplugin mdfplugin mol2plugin moldenplugin molemeshplugin msmsplugin namdbinplugin offplugin parm7plugin parmplugin pbeqplugin pdbplugin phiplugin pltplugin pqrplugin psfplugin raster3dplugin rst7plugin situsplugin spiderplugin stlplugin tinkerplugin uhbdplugin vaspchgcarplugin vaspoutcarplugin vaspparchgplugin vaspposcarplugin vasp5xdatcarplugin vaspxdatcarplugin vaspxmlplugin xbgfplugin xsfplugin xyzplugin
-
-PLUGINS = abinitplugin.so avsplugin.so babelplugin.so basissetplugin.so bgfplugin.so binposplugin.so biomoccaplugin.so brixplugin.so carplugin.so ccp4plugin.so corplugin.so cpmdplugin.so crdplugin.so cubeplugin.so dcdplugin.so dlpolyplugin.so dsn6plugin.so dxplugin.so edmplugin.so fs4plugin.so gamessplugin.so graspplugin.so grdplugin.so gridplugin.so gromacsplugin.so jsplugin.so lammpsplugin.so mapplugin.so mdfplugin.so mol2plugin.so moldenplugin.so molemeshplugin.so msmsplugin.so namdbinplugin.so offplugin.so parm7plugin.so parmplugin.so pbeqplugin.so pdbplugin.so phiplugin.so pltplugin.so pqrplugin.so psfplugin.so raster3dplugin.so rst7plugin.so situsplugin.so spiderplugin.so stlplugin.so tinkerplugin.so uhbdplugin.so vaspchgcarplugin.so vaspoutcarplugin.so vaspparchgplugin.so vaspposcarplugin.so vasp5xdatcarplugin.so vaspxdatcarplugin.so vaspxmlplugin.so xbgfplugin.so xsfplugin.so xyzplugin.so
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-STATICPLUGINS += dtrplugin maeffplugin
-PLUGINS       += dtrplugin.so maeffplugin.so
-endif
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-# XXX We can safetly assume that VMD is compiled against Tcl, so there is
-#     no need to check if the Tcl libs are static or dynamic here.
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-STATICPLUGINS += vtfplugin webpdbplugin
-PLUGINS       += vtfplugin.so webpdbplugin.so
-endif
-endif
-endif
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-# Only add the NetCDF plugin as a static plugin if we compiled against
-# a static libnetcdf.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += netcdfplugin
-endif
-PLUGINS       += netcdfplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-# Only add the HOOMD plugin as a static plugin if we compiled against
-# a static libexpat.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += hoomdplugin
-endif
-PLUGINS       += hoomdplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional sqlite-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef SQLITELIB
-ifdef SQLITEINC
-ifdef SQLITELDFLAGS
-ifndef SQLITEDYNAMIC
-# Only add the dmsplugin as a static plugin if we compiled against
-# a static sqlite.a, as VMD itself will also have to be linked against
-# the same static library for this to work.  In the case of a dynamic 
-# library, we can get by linking only the plugin itself, and either
-# assuming it is installed already on the target OS, or included in the 
-# VMD redistributables.
-STATICPLUGINS += dmsplugin
-endif
-PLUGINS       += dmsplugin.so
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ifndef TNGDYNAMIC
-STATICPLUGINS += tngplugin
-endif
-PLUGINS       += tngplugin.so
-endif
-endif
-endif
-
-
-# list of all optional plugins for use by distrib target
-OPTPLUGINS = dmsplugin.so hoomdplugin.so netcdfplugin.so tngplugin.so vtfplugin.so webpdbplugin.so 
-
-STATICS = libmolfile_plugin.a libmolfile_plugin.h
-WIN32STATICS = libmolfile_plugin.lib libmolfile_plugin.h
-DISTFILES = $(PLUGINS) $(OPTPLUGINS) $(STATICS) $(WIN32STATICS)
-
-bins:
-win32bins:
-dynlibs: ${ARCHDIR} mesg $(PLUGINS)
-staticlibs: ${ARCHDIR} $(STATICS) 
-win32staticlibs: ${ARCHDIR} $(WIN32STATICS)
-
-distrib:
-	@echo "Copying molfile plugins to $(PLUGINDIR) destination area"
-	for file in $(DISTFILES) ; do \
-		echo "    $$file ..."; \
-		for localname in `find ../compile -name $$file -print`; do \
-			pluginname=`echo $$localname | sed s/..\\\/compile\\\/lib_// `; \
-			dir=`dirname $(PLUGINDIR)/$$pluginname`; \
-			mkdir -p $$dir; \
-			cp -p $$localname $(PLUGINDIR)/$$pluginname; \
-		done; \
-	done;
-
-mesg:
-	@echo "Building Molecule File Reader plugins"
-
-
-#
-# plugin library rules
-#
-
-abinitplugin.so: ${ARCHDIR}/abinitplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-avsplugin.so: ${ARCHDIR}/avsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-babelplugin.so: ${ARCHDIR}/babelplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-basissetplugin.so: ${ARCHDIR}/basissetplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-bgfplugin.so: ${ARCHDIR}/bgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-binposplugin.so: ${ARCHDIR}/binposplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-biomoccaplugin.so: ${ARCHDIR}/biomoccaplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-brixplugin.so: ${ARCHDIR}/brixplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-carplugin.so: ${ARCHDIR}/carplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-ccp4plugin.so: ${ARCHDIR}/ccp4plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-corplugin.so: ${ARCHDIR}/corplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cpmdplugin.so: ${ARCHDIR}/cpmdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-crdplugin.so: ${ARCHDIR}/crdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-cubeplugin.so: ${ARCHDIR}/cubeplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dcdplugin.so: ${ARCHDIR}/dcdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dlpolyplugin.so: ${ARCHDIR}/dlpolyplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dsn6plugin.so: ${ARCHDIR}/dsn6plugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-dxplugin.so: ${ARCHDIR}/dxplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-edmplugin.so: ${ARCHDIR}/edmplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-fs4plugin.so: ${ARCHDIR}/fs4plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gamessplugin.so: ${ARCHDIR}/gamessplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-graspplugin.so: ${ARCHDIR}/graspplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-grdplugin.so: ${ARCHDIR}/grdplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gridplugin.so: ${ARCHDIR}/gridplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gromacsplugin.so: ${ARCHDIR}/gromacsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-jsplugin.so: ${ARCHDIR}/jsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-lammpsplugin.so: ${ARCHDIR}/lammpsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mapplugin.so: ${ARCHDIR}/mapplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mdfplugin.so: ${ARCHDIR}/mdfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-mol2plugin.so: ${ARCHDIR}/mol2plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-moldenplugin.so: ${ARCHDIR}/moldenplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-molemeshplugin.so: ${ARCHDIR}/molemeshplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-msmsplugin.so: ${ARCHDIR}/msmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-namdbinplugin.so: ${ARCHDIR}/namdbinplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-offplugin.so: ${ARCHDIR}/offplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parm7plugin.so: ${ARCHDIR}/parm7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-parmplugin.so: ${ARCHDIR}/parmplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pbeqplugin.so: ${ARCHDIR}/pbeqplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pdbplugin.so: ${ARCHDIR}/pdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-phiplugin.so: ${ARCHDIR}/phiplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pltplugin.so: ${ARCHDIR}/pltplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-pqrplugin.so: ${ARCHDIR}/pqrplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-psfplugin.so: ${ARCHDIR}/psfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-raster3dplugin.so: ${ARCHDIR}/raster3dplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-rst7plugin.so: ${ARCHDIR}/rst7plugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-situsplugin.so: ${ARCHDIR}/situsplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-spiderplugin.so: ${ARCHDIR}/spiderplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-stlplugin.so: ${ARCHDIR}/stlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tinkerplugin.so: ${ARCHDIR}/tinkerplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-uhbdplugin.so: ${ARCHDIR}/uhbdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspchgcarplugin.so: ${ARCHDIR}/vaspchgcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspoutcarplugin.so: ${ARCHDIR}/vaspoutcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspparchgplugin.so: ${ARCHDIR}/vaspparchgplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspposcarplugin.so: ${ARCHDIR}/vaspposcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vasp5xdatcarplugin.so: ${ARCHDIR}/vasp5xdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxdatcarplugin.so: ${ARCHDIR}/vaspxdatcarplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-vaspxmlplugin.so: ${ARCHDIR}/vaspxmlplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xbgfplugin.so: ${ARCHDIR}/xbgfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xsfplugin.so: ${ARCHDIR}/xsfplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-xyzplugin.so: ${ARCHDIR}/xyzplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-cpmdlogplugin.so: ${ARCHDIR}/cpmdlogplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-gaussianplugin.so: ${ARCHDIR}/gaussianplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-hoomdplugin.so: ${ARCHDIR}/hoomdplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(EXPATLIB) $(EXPATLDFLAGS) $(LDFLAGS)
-
-netcdfplugin.so: ${ARCHDIR}/netcdfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(NETCDFLIB) $(NETCDFLDFLAGS) $(LDFLAGS)
-
-vtfplugin.so: ${ARCHDIR}/vtfplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-webpdbplugin.so: ${ARCHDIR}/webpdbplugin.o 
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TCLLIB) $(TCLLDFLAGS) $(LDFLAGS)
-
-dmsplugin.so: ${ARCHDIR}/dmsplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(SQLITELIB) $(SQLITELDFLAGS) $(LDFLAGS)
-
-dtrplugin.so: ${ARCHDIR}/dtrplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-maeffplugin.so: ${ARCHDIR}/maeffplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(LDFLAGS)
-
-tngplugin.so: ${ARCHDIR}/tngplugin.o
-	$(SHLD) $(LOPTO)${ARCHDIR}/$@ $? $(TNGLIB) $(TNGLDFLAGS) $(LDFLAGS)
-
-
-#
-# object files
-#
-${ARCHDIR}/abinitplugin.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin.o: avsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin.o: bgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin.o: binposplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin.o: biomoccaplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin.o: brixplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin.o: carplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin.o: ccp4plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin.o: corplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin.o: crdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin.o: dcdplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin.o: dlpolyplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin.o: dsn6plugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin.o: dxplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin.o: edmplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin.o: fs4plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin.o: graspplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin.o: grdplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin.o: gridplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin.o: jsplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin.o: mapplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin.o: mdfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin.o: mol2plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin.o: molemeshplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin.o: msmsplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin.o: namdbinplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin.o: offplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin.o: parm7plugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin.o: parmplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin.o: pbeqplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin.o: phiplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin.o: pltplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin.o: pqrplugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin.o: psfplugin.c fortread.h ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin.o: raster3dplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin.o: rst7plugin.c ${PLUGINAPI} 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin.o: situsplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin.o: spiderplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin.o: stlplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin.o: tinkerplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin.o: uhbdplugin.C ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/hoomdplugin.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(EXPATINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin.o: netcdfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(NETCDFINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin.o: vtfplugin.c ${PLUGINAPI}
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(TCLINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin.o: xbgfplugin.C ${PLUGINAPI} 
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin.o: gaussianplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	$(CC) $(CCFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/dmsplugin.o: dmsplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(SQLITEINC) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin.o: dtrplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin.o: maeffplugin.cxx ${PLUGINAPI}
-	$(CXX) $(CXXFLAGS) $(SHLDFLAGS) $(INCDIR) -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${CXXFLAGS} $(SHLDFLAGS) $(TNGINC) $(INCDIR) -c $< $(COPTO)$@
-
-
-
-#
-# archive rules
-#
-ARCHIVEOBJS = ${ARCHDIR}/abinitplugin-s.o ${ARCHDIR}/avsplugin-s.o ${ARCHDIR}/babelplugin-s.o ${ARCHDIR}/basissetplugin-s.o ${ARCHDIR}/bgfplugin-s.o ${ARCHDIR}/binposplugin-s.o ${ARCHDIR}/biomoccaplugin-s.o ${ARCHDIR}/brixplugin-s.o ${ARCHDIR}/carplugin-s.o ${ARCHDIR}/ccp4plugin-s.o ${ARCHDIR}/corplugin-s.o ${ARCHDIR}/cpmdplugin-s.o ${ARCHDIR}/crdplugin-s.o ${ARCHDIR}/cubeplugin-s.o ${ARCHDIR}/dcdplugin-s.o ${ARCHDIR}/dlpolyplugin-s.o ${ARCHDIR}/dsn6plugin-s.o ${ARCHDIR}/dxplugin-s.o ${ARCHDIR}/edmplugin-s.o ${ARCHDIR}/fs4plugin-s.o ${ARCHDIR}/gamessplugin-s.o ${ARCHDIR}/graspplugin-s.o ${ARCHDIR}/grdplugin-s.o ${ARCHDIR}/gridplugin-s.o ${ARCHDIR}/gromacsplugin-s.o ${ARCHDIR}/jsplugin-s.o ${ARCHDIR}/lammpsplugin-s.o ${ARCHDIR}/mapplugin-s.o ${ARCHDIR}/mdfplugin-s.o ${ARCHDIR}/mol2plugin-s.o ${ARCHDIR}/moldenplugin-s.o ${ARCHDIR}/molemeshplugin-s.o ${ARCHDIR}/msmsplugin-s.o ${ARCHDIR}/namdbinplugin-s.o ${ARCHDIR}/offplugin-s.o ${ARCHDIR}/parm7plugin-s.o ${ARCHDIR}/parmplugin-s.o ${ARCHDIR}/pbeqplugin-s.o ${ARCHDIR}/pdbplugin-s.o ${ARCHDIR}/phiplugin-s.o ${ARCHDIR}/pltplugin-s.o ${ARCHDIR}/pqrplugin-s.o ${ARCHDIR}/psfplugin-s.o ${ARCHDIR}/raster3dplugin-s.o ${ARCHDIR}/rst7plugin-s.o ${ARCHDIR}/situsplugin-s.o ${ARCHDIR}/spiderplugin-s.o ${ARCHDIR}/stlplugin-s.o ${ARCHDIR}/tinkerplugin-s.o ${ARCHDIR}/uhbdplugin-s.o ${ARCHDIR}/vaspchgcarplugin-s.o ${ARCHDIR}/vaspoutcarplugin-s.o ${ARCHDIR}/vaspparchgplugin-s.o ${ARCHDIR}/vaspposcarplugin-s.o ${ARCHDIR}/vasp5xdatcarplugin-s.o ${ARCHDIR}/vaspxdatcarplugin-s.o ${ARCHDIR}/vaspxmlplugin-s.o ${ARCHDIR}/xbgfplugin-s.o ${ARCHDIR}/xsfplugin-s.o ${ARCHDIR}/xyzplugin-s.o
-
-
-#
-# Check to see if we're building on Android or not. If not, we 
-# include some plugins that don't currently compile cleanly using 
-# the Android NDK cross-development toolchain for Linux.
-# XXX non-portable GNU make syntax used here...
-#
-ifneq ($(ARCH),ANDROIDARMV7A)
-ARCHIVEOBJS += ${ARCHDIR}/dtrplugin-s.o ${ARCHDIR}/maeffplugin-s.o
-endif
-
-
-#
-# Check to see if we should build the Tcl-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TCLLIB
-ifdef TCLINC
-ifdef TCLLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/vtfplugin-s.o ${ARCHDIR}/webpdbplugin-s.o
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional NetCDF-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef NETCDFLIB
-ifdef NETCDFINC
-ifdef NETCDFLDFLAGS
-ifndef NETCDFDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/netcdfplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build the optional expat-based plugins
-# XXX non-portable GNU make syntax used here...
-#
-ifdef EXPATLIB
-ifdef EXPATINC
-ifdef EXPATLDFLAGS
-ifndef EXPATDYNAMIC
-ARCHIVEOBJS += ${ARCHDIR}/hoomdplugin-s.o
-endif
-endif
-endif
-endif
-
-
-#
-# Check to see if we should build plugins that use the Gromacs TNG library
-# XXX non-portable GNU make syntax used here...
-#
-ifdef TNGLIB
-ifdef TNGINC
-ifdef TNGLDFLAGS
-ARCHIVEOBJS += ${ARCHDIR}/tngplugin-s.o
-endif
-endif
-endif
-
-
-libmolfile_plugin.a: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	$(AR) cr ${ARCHDIR}/$@ ${ARCHIVEOBJS} 
-	$(RANLIB) ${ARCHDIR}/$@
-
-libmolfile_plugin.lib: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@ 
-	lib /OUT:${ARCHDIR}/$@ ${ARCHIVEOBJS}
-
-libmolfile_plugin.h: ${ARCHIVEOBJS}
-	rm -f ${ARCHDIR}/$@
-	touch ${ARCHDIR}/$@
-	../create_static_header.sh MOLFILE molfile ${ARCHDIR}/$@ ${STATICPLUGINS}
-
-#
-# object files suitable for static linking
-#
-${ARCHDIR}/abinitplugin-s.o: abinitplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_abinitplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/avsplugin-s.o: avsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_avsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/babelplugin-s.o: babelplugin.c readpdb.h vmddir.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_babelplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/basissetplugin-s.o: basissetplugin.c ${PLUGINAPI} qmplugin.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_basissetplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/bgfplugin-s.o: bgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_bgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/binposplugin-s.o: binposplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_binposplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/biomoccaplugin-s.o: biomoccaplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_biomoccaplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/brixplugin-s.o: brixplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_brixplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/carplugin-s.o: carplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_carplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/ccp4plugin-s.o: ccp4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_ccp4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/corplugin-s.o: corplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_corplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cpmdplugin-s.o: cpmdplugin.c ${PLUGINAPI} unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/crdplugin-s.o: crdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_crdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/cubeplugin-s.o: cubeplugin.C ${PLUGINAPI} periodic_table.h unit_conversion.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cubeplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dcdplugin-s.o: dcdplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dcdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dlpolyplugin-s.o: dlpolyplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dlpolyplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dsn6plugin-s.o: dsn6plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dsn6plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dxplugin-s.o: dxplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dxplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/edmplugin-s.o: edmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_edmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/fs4plugin-s.o: fs4plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_fs4plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gamessplugin-s.o: gamessplugin.c ${PLUGINAPI} qmplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gamessplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/graspplugin-s.o: graspplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_graspplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/grdplugin-s.o: grdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_grdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gridplugin-s.o: gridplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gridplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gromacsplugin-s.o: gromacsplugin.C ${PLUGINAPI} Gromacs.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gromacsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/jsplugin-s.o: jsplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_jsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/lammpsplugin-s.o: lammpsplugin.c ${PLUGINAPI} hash.c hash.h inthash.c inthash.h periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_lammpsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mapplugin-s.o: mapplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mapplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mdfplugin-s.o: mdfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/mol2plugin-s.o: mol2plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_mol2plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/moldenplugin-s.o: moldenplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_moldenplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/molemeshplugin-s.o: molemeshplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_molemeshplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/msmsplugin-s.o: msmsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_msmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/namdbinplugin-s.o: namdbinplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_namdbinplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/offplugin-s.o: offplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_offplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parm7plugin-s.o: parm7plugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parm7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/parmplugin-s.o: parmplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_parmplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pbeqplugin-s.o: pbeqplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pbeqplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pdbplugin-s.o: pdbplugin.c readpdb.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/phiplugin-s.o: phiplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_phiplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pltplugin-s.o: pltplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pltplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/pqrplugin-s.o: pqrplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_pqrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/psfplugin-s.o: psfplugin.c fortread.h ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_psfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/raster3dplugin-s.o: raster3dplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_raster3dplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/rst7plugin-s.o: rst7plugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_rst7plugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/situsplugin-s.o: situsplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_situsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/spiderplugin-s.o: spiderplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_spiderplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/stlplugin-s.o: stlplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_stlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tinkerplugin-s.o: tinkerplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tinkerplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/uhbdplugin-s.o: uhbdplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_uhbdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspchgcarplugin-s.o: vaspchgcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspchgcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspoutcarplugin-s.o: vaspoutcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspoutcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspparchgplugin-s.o: vaspparchgplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspparchgplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspposcarplugin-s.o: vaspposcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspposcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vasp5xdatcarplugin-s.o: vasp5xdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vasp5xdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxdatcarplugin-s.o: vaspxdatcarplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxdatcarplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vaspxmlplugin-s.o: vaspxmlplugin.c vaspplugin.h ${PLUGINAPI} periodic_table.h 
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_vaspxmlplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xbgfplugin-s.o: xbgfplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xbgfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xsfplugin-s.o: xsfplugin.C ${PLUGINAPI} periodic_table.h
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xsfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/xyzplugin-s.o: xyzplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_xyzplugin" -c $< $(COPTO)$@
-
-
-##
-## In-development plugins that aren't part of the build quite yet...
-##
-${ARCHDIR}/cpmdlogplugin-s.o: cpmdlogplugin.c ${PLUGINAPI} gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_cpmdlogplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/gaussianplugin-s.o: gaussianplugin.c ${PLUGINAPI}  gaussianplugin.h periodic_table.h unit_conversion.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_gaussianplugin" -c $< $(COPTO)$@
-
-
-##
-## Optionally compiled plugins that have library or platform-specific
-## dependencies of some kind
-##
-${ARCHDIR}/hoomdplugin-s.o: hoomdplugin.c ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(EXPATINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_hoomdplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/netcdfplugin-s.o: netcdfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(NETCDFINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_netcdfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/vtfplugin-s.o: vtfplugin.c ${PLUGINAPI}
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_vtfplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/webpdbplugin-s.o: webpdbplugin.c readpdb.h ${PLUGINAPI} periodic_table.h
-	${CC} ${SCCFLAGS} $(INCDIR) $(TCLINC) $(DEF)"VMDPLUGIN=molfile_webpdbplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dmsplugin-s.o: dmsplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(SQLITEINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dmsplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/dtrplugin-s.o: dtrplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_dtrplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/maeffplugin-s.o: maeffplugin.cxx ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(INCDIR) $(DEF)"VMDPLUGIN=molfile_maeffplugin" -c $< $(COPTO)$@
-
-${ARCHDIR}/tngplugin-s.o: tngplugin.C ${PLUGINAPI}
-	${CXX} ${SCXXFLAGS} $(TNGINC) $(INCDIR) $(DEF)"VMDPLUGIN=molfile_tngplugin" -c $< $(COPTO)$@
-
-
-${ARCHDIR} :
-	mkdir -p ${ARCHDIR}
-
-clean:
-	find ${COMPILEDIR} \( -name *.o -o -name *.a -o -name *.so -o -name *.dll \) -print | xargs rm -f
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile.rej b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile.rej
deleted file mode 100644
index 784d6328cd21a010705dc1c9cd5cac334a81ae54..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/Makefile.rej
+++ /dev/null
@@ -1,49 +0,0 @@
---- Makefile	20 Jul 2013 14:28:56 -0000	1.9
-+++ Makefile	7 Apr 2015 00:01:25 -0000
-@@ -42,11 +42,11 @@
- 
- # Win32/Win64 compiles
- ${ARCHDIR}/catdcd.exe : ${CATDCDOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.lib
--	LINK ${CATDCDOBJS} /OUT:${ARCHDIR}/catdcd.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS}
-+	LINK ${CATDCDOBJS} /OUT:${ARCHDIR}/catdcd.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS}
- 
- # all other platforms
- ${ARCHDIR}/catdcd : ${CATDCDOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.a
--	${CXX} ${CXXFLAGS} ${CATDCDOBJS} -o ${ARCHDIR}/catdcd -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} -lm
-+	${CXX} ${CXXFLAGS} ${CATDCDOBJS} -o ${ARCHDIR}/catdcd -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} -lm
- 
- ${ARCHDIR}/hash.o: hash.h hash.c
- 	${CXX} ${CXXFLAGS} ${INCDIR} -c ${SRCDIR}/hash.c $(COPTO)${ARCHDIR}/hash.o
---- Makefile	30 May 2007 02:41:51 -0000	1.9
-+++ Makefile	7 Apr 2015 00:01:25 -0000
-@@ -49,11 +49,11 @@
- 
- # Win32/Win64 compiles
- ${ARCHDIR}/cionize.exe : ${IONIZEOBJS} ${MGPOTOBJS} ${ARCHDIR}/cionize.o ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.lib
--	LINK ${IONIZEOBJS} ${MGPOTOBJS} /OUT:${ARCHDIR}/cionize.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS}
-+	LINK ${IONIZEOBJS} ${MGPOTOBJS} /OUT:${ARCHDIR}/cionize.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS}
- 
- # all other platforms
- ${ARCHDIR}/cionize: ${IONIZEOBJS} ${MGPOTOBJS} ${ARCHDIR}/cionize.o ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.a
--	${CXX} ${CXXFLAGS} ${ARCHDIR}/cionize.o ${IONIZEOBJS} ${MGPOTOBJS} -o ${ARCHDIR}/cionize -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} -lm
-+	${CXX} ${CXXFLAGS} ${ARCHDIR}/cionize.o ${IONIZEOBJS} ${MGPOTOBJS} -o ${ARCHDIR}/cionize -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} -lm
- 
- ${ARCHDIR}/hash.o: hash.h hash.c
- 	${CC}  ${CCFLAGS} ${INCDIR} -c ${SRCDIR}/hash.c $(COPTO)${ARCHDIR}/hash.o
---- Makefile	22 Feb 2011 18:45:04 -0000	1.4
-+++ Makefile	7 Apr 2015 00:01:25 -0000
-@@ -62,12 +62,12 @@
- 
- # Win32/Win64 compiles
- ${ARCHDIR}/volutil.exe : ${VOLUTILOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.lib
--	LINK ${VOLUTILOBJS} /OUT:${ARCHDIR}/volutil.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} wsock32.lib
-+	LINK ${VOLUTILOBJS} /OUT:${ARCHDIR}/volutil.exe /LIBPATH:${COMPILEDIR}/lib_${ARCH}/molfile libmolfile_plugin.lib ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} wsock32.lib
- 
- # all other platforms
-   
- ${ARCHDIR}/volutil: ${VOLUTILOBJS} ${COMPILEDIR}/lib_${ARCH}/molfile/libmolfile_plugin.a
--	${CXX} ${CXXFLAGS} ${VOLUTILOBJS} -o ${ARCHDIR}/volutil -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} -lm
-+	${CXX} ${CXXFLAGS} ${VOLUTILOBJS} -o ${ARCHDIR}/volutil -L${COMPILEDIR}/lib_${ARCH}/molfile -lmolfile_plugin ${TCLLIB} ${TCLLDFLAGS} ${NETCDFLIB} ${NETCDFLDFLAGS} ${EXPATLDFLAGS} ${SQLITELDFLAGS} -lm
-      
- ${ARCHDIR}/volmap.o: ${SRCDIR}/volmap.C
- 	${CXX} ${CXXFLAGS} ${INCDIR} -c ${SRCDIR}/volmap.C ${COPTO}${ARCHDIR}/volmap.o
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Entries
deleted file mode 100644
index 5635bf2f93ea6e03be73670975c9ea19de5bb4c3..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Entries
+++ /dev/null
@@ -1,57 +0,0 @@
-/babelplugin.html/1.8/Sat Mar 24 21:37:13 2007//
-/binposplugin.html/1.5/Sun May  7 02:13:45 2006//
-/biomoccaplugin.html/1.3/Sun May  7 02:30:18 2006//
-/brixplugin.html/1.7/Sat Mar 24 21:37:34 2007//
-/cpmdplugin.html/1.6/Sun May  7 02:40:24 2006//
-/dlpolyplugin.html/1.6/Sat Mar 24 21:38:31 2007//
-/dsn6plugin.html/1.7/Sat Mar 24 21:38:44 2007//
-/fs4plugin.html/1.8/Sat Mar 24 21:39:12 2007//
-/graspplugin.html/1.8/Sat Mar 24 21:40:02 2007//
-/grdplugin.html/1.7/Sat Mar 24 21:40:13 2007//
-/gridplugin.html/1.4/Sat Mar 24 21:40:19 2007//
-/namdbinplugin.html/1.5/Sat Mar 24 21:41:36 2007//
-/phiplugin.html/1.10/Sat Mar 24 21:43:12 2007//
-/pltplugin.html/1.7/Sat Mar 24 21:43:17 2007//
-/raster3dplugin.html/1.6/Sat Mar 24 21:45:34 2007//
-/spiderplugin.html/1.6/Sat Mar 24 21:45:54 2007//
-/stlplugin.html/1.6/Sat Mar 24 21:46:22 2007//
-/template.html/1.3/Wed Mar  8 20:09:10 2006//
-/tinkerplugin.html/1.4/Sat Mar 24 21:46:30 2007//
-/uhbdplugin.html/1.3/Sat Mar 24 21:46:39 2007//
-/xyzplugin.html/1.13/Sat Mar 24 21:47:36 2007//
-/xsfplugin.html/1.7/Fri Apr 18 21:10:31 2008//
-/avsplugin.html/1.6/Wed Jun 10 17:38:46 2009//
-/mapplugin.html/1.8/Wed Jun 10 17:38:46 2009//
-/bgfplugin.html/1.4/Mon Jun 15 14:48:35 2009//
-/cubeplugin.html/1.10/Mon Jun 15 14:48:35 2009//
-/dxplugin.html/1.11/Mon Jun 15 14:48:35 2009//
-/edmplugin.html/1.9/Mon Jun 15 14:48:36 2009//
-/g96plugin.html/1.5/Mon Jun 15 14:48:36 2009//
-/groplugin.html/1.5/Mon Jun 15 14:48:36 2009//
-/mol2plugin.html/1.8/Mon Jun 15 14:48:36 2009//
-/msmsplugin.html/1.6/Mon Jun 15 14:48:36 2009//
-/netcdfplugin.html/1.4/Mon Jun 15 14:48:36 2009//
-/pdbplugin.html/1.7/Mon Jun 15 14:48:36 2009//
-/situsplugin.html/1.5/Mon Jun 15 14:48:36 2009//
-/trrplugin.html/1.6/Mon Jun 15 14:48:37 2009//
-/webpdbplugin.html/1.8/Mon Jun 15 14:48:37 2009//
-/xbgfplugin.html/1.4/Mon Jun 15 14:48:37 2009//
-/vaspplugin.html/1.6/Tue Jun 23 20:43:43 2009//
-/parm7plugin.html/1.9/Tue Feb 22 03:41:35 2011//
-/parmplugin.html/1.7/Tue Feb 22 03:42:28 2011//
-/rst7plugin.html/1.6/Tue Feb 22 03:44:00 2011//
-/corplugin.html/1.9/Tue Feb 22 04:04:30 2011//
-/psfplugin.html/1.11/Tue Feb 22 04:05:31 2011//
-/gamessplugin.html/1.8/Tue Feb 22 04:06:36 2011//
-/moldenplugin.html/1.7/Tue Feb 22 04:08:47 2011//
-/mdfplugin.html/1.6/Tue Feb 22 04:09:31 2011//
-/pqrplugin.html/1.6/Tue Feb 22 04:11:14 2011//
-/dcdplugin.html/1.15/Tue Feb 22 04:17:22 2011//
-/ccp4plugin.html/1.10/Tue Feb 22 04:20:24 2011//
-/crdplugin.html/1.6/Mon Mar 14 16:08:13 2011//
-/lammpsplugin.html/1.7/Mon Jun 27 18:17:27 2011//
-/vtfplugin.html/1.5/Tue Sep 17 06:14:25 2013//
-/tngplugin.html/1.1/Thu Apr  9 21:06:48 2015//
-/index.html/1.60/Thu Apr  9 21:04:00 2015//
-/carplugin.html/1.6/Fri May  8 04:24:30 2015//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Repository
deleted file mode 100644
index 0834af27d6dd55fa53436a1f0d8549864f156a67..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/doc
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/avsplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/avsplugin.html
deleted file mode 100755
index 83f59ba45f0cb49d2f79408abad41ea1fe7ed1d0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/avsplugin.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--#set var="TITLE" value="AVS Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads AVS Field files, which can be used to store a variety
-of volumetric data. This plugin currently supports only a small subset of
-possible AVS Field file features, specifically it reads files created by 
-<a href="http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/Using_AutoDock_305.21.html#pgfId=10734">AutoDock</a>,
-for storing potential maps. 
-More information on this file format can be found at 
-<!-- <a href="http://astronomy.swin.edu.au/~pbourke/geomformats/field/">http://astronomy.swin.edu.au/~pbourke/geomformats/field/</a>. -->
-<a href="http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf">http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf</a>.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Field types</b>
-<br>All fields must be "uniform". "Irregular" and "rectilinear" fields are
-not yet supported.</p>
-
-<p><b>Data format</b>
-<br>Only ASCII files with data stored as floating-point numbers can be read
-by this plugin. Other combinations of file type and data format cannot be
-used.</p>
-
-<p><b>Unit Cell</b>
-<br>The unit cell must be three dimensional (<i>ndim</i> and <i>nspace</i>
-should both be three), and orthogonal.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/babelplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/babelplugin.html
deleted file mode 100755
index 14968396d6044206b2b23c7ce64002fe40a948e9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/babelplugin.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!--#set var="TITLE" value="Babel Plugin, Version 1.12"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays molecular structure files in 
-   several formats using the Babel program to translate them into
-   PDB files which are easily read by VMD.  In order to use this plugin
-   Babel 1.6 must be installed on your computer and must be executable 
-   in your default command path so that the Babel plugin can run it 
-   via calls to system().  Babel 1.6 is available from the
-   <a href="http://www.eyesopen.com/products/applications/babel.html">OpenEye Babel web site</a>
-</p>
-
-<p>This table lists all of the molecule file formats that Babel will 
-   translate to the PDB format which can be loaded by VMD:
-</p>
-
-<table>
-<tr>
-<td>Alchemy</td>
-<td>AMBER PREP</td>
-<td>Ball and Stick</td>
-
-<tr>
-<td>Biosym .CAR</td>
-<td>Boogie</td> 
-<td>Cacao Cartesian</td>
-
-<tr>
-<td>Cambridge CADPAC</td>
-<td>CHARMm</td>
-<td>Chem3D Cartesian 1</td>
-
-<tr>
-<td>Chem3D Cartesian 2</td>
-<td>CSD CSSR</td>
-<td>CSD FDAT</td>
-
-<tr>
-<td>CSD GSTAT</td>
-<td>Free Form Fractional</td>
-<td>GAMESS Output</td>
-
-<tr>
-<td>Gaussian Z-Matrix</td>
-<td>Gaussian Output</td>
-<td>Hyperchem HIN</td>
-
-<tr>
-<td>Mac Molecule</td>
-<td>Macromodel</td>
-<td>Micro World</td>
-
-<tr>
-<td>MM2 Input</td>
-<td>MM2 Ouput</td>
-<td>MM3</td>
-
-<tr>
-<td>MMADS</td>
-<td>MDL MOLfile</td>
-<td>MOLIN</td>
-
-<tr>
-<td>Mopac Cartesian</td>
-<td>Mopac Internal</td>
-<td>Mopac Output</td>
-
-<tr>
-<td></td>
-<td>ShelX</td>
-<td>Sybyl Mol</td>
-
-<tr>
-<td></td>
-<td>Sybyl Mol2</td>
-<td>XYZ</td>
-</table>  
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-    writing to these formats.</p>
-</p>
-
-<p><b>Unused data</b>
-<br>Babel performs a reasonable translation in most cases, however 
-    it is unavoidable that some formats may contain information which
-    doesn't have a corresponding record in PDB files, so this information
-    may be lost in the translation, and thus unavailble when loaded into VMD.
-</p>
-
-<p><b>Compressed files</b>
-<br>Compressed files will need to be expanded before this plugin can read
-them.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/bgfplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/bgfplugin.html
deleted file mode 100755
index 207d6ac5883a4d08758bde26098457fd870a6b35..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/bgfplugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="Biograf Plugin, Version 0.16"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-The bgf plugin reads files produced by Biograf
-  
-<p>
-<h3>Notes:</h3>
-<p>
-<b>Lone pairs and bonds fields:</b>
-<p>The VMD BGF plugin currently ignores the lone pair and valence fields, since these have no equivalent piece of data in VMD.</p>
-
-<p>
-<b>Forcefield types</b>
-<p>VMD equates the VMD "type" field with the BGF forcefield type; this means that DREIDING typing, for example, must be done manually (for example, with a tcl script).</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/binposplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/binposplugin.html
deleted file mode 100644
index 4a4ec10f9cc08dd587fda2dc35e3a929866cb146..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/binposplugin.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!--#set var="TITLE" value="Scripps 'binpos' Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads trajectory files written in the Scripps 
-"binpos" format, as produced by 
-<a href="http://amber.scripps.edu/">Amber</a> 
-and Thomas Cheatham's 
-<a href="http://www.chpc.utah.edu/~cheatham/ptraj.html">Ptraj</a> 
-trajectory analysis program.
-</p>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/biomoccaplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/biomoccaplugin.html
deleted file mode 100755
index 706a52967a7f003dde51bc1956f9f0d94c1381fa..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/biomoccaplugin.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--#set var="TITLE" value="Biomocca Plugin, Version 0.2"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin volumetric occupancy maps created by the 'biomocca' program
-developed by the Computational Electronics Group at UIUC:
-<a href=http://www.ceg.uiuc.edu/>http://www.ceg.uiuc.edu/</a>
-
-The biomocca map format is quite simple and constists of ASCII floating
-point numbers:
-<ul>
-<li>Origin of the map
-<li>integer X/Y/Z counts
-<li>voxel size in Angstroms
-<li>voxels follow in Z fastest, Y next fastest, X slowest
-</ul>
-
-<h3>Notes:</h3>
-<p>
-<b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/brixplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/brixplugin.html
deleted file mode 100755
index d3ded00ac57ce747f044a274aec19937af9b216c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/brixplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="BRIX Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the BRIX format, 
-used by 
-<a href="http://imsb.au.dk/~mok/o/">O</a>
-and other programs. More information on this file format can be found at 
-<a href="http://zombie.imsb.au.dk/~mok/brix/brix-1.html#ss1.2">http://zombie.imsb.au.dk/~mok/brix/brix-1.html#ss1.2</a>.
-</p> 
-
-<h3>Notes:</h3>
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>The header of the BRIX file contains the value of the RMS 
-deviation of the electron density map. This value is not used by 
-VMD presently.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/carplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/carplugin.html
deleted file mode 100755
index 403810fabab1239a2623de966e3a6d1e3f912ff9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/carplugin.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--#set var="TITLE" value="CAR Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads molecular coordinate data stored in Insight II/Discover
-Cartesian Coordinate format. More information about this file format can be
-found here:
-<a href="http://hincklab.uthscsa.edu/~ahinck/html/soft_packs/msi_docs/insight980/insight/a_FF-CLASSIC.fcs.html">http://hincklab.uthscsa.edu/~ahinck/html/soft_packs/msi_docs/insight980/insight/a_FF-CLASSIC.fcs.html</a>.
-<!--
-<a href="http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#781840">http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#781840</a>.
--->
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Multiple molecules</b>
-<br>CAR files can contain multiple molecule entries; only the first of these
-is read by the plugin. Multiple molecule support may be available in the
-future.
-
-<p><b>Periodic Boundary Condition (PBC) information</b>
-<br>This plugin currently ignores any two-dimensional PBC information that
-may be present. 3D PBC info, however, is loaded into VMD.
-
-<p><b>Helix records</b>
-<br>These records are also ignored by VMD.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/ccp4plugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/ccp4plugin.html
deleted file mode 100755
index 46d6429e4baea2e4ca8845e24b746a4812811bb8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/ccp4plugin.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--#set var="TITLE" value="CCP4, MRC Plugin, Version 1.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps written in the 
-MRC format, also used by the 
-<a href="http://www.ccp4.ac.uk/">CCP4 suite</a>. 
-More information on this file format can be found in the CCP4 
-documentation at 
-<a href="http://www.ccp4.ac.uk/html/maplib.html#description">http://www.ccp4.ac.uk/html/maplib.html#description</a>.
-</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Byte-order</b>
-<br>CCP4 files are created using the native byte-order (i.e., "little-endian"
-or "big-endian") of the machine used to create them. This plugin can read maps
-created with either byte-order.</p>
-
-<p><b>Density values</b>
-<br>Only "mode 2" maps (those with density values stored as 32-bit floating
-point values) can currently be read.</p>
-
-<p><b>Symmetry Records:</b>
-<br>CCP4 maps contain information useful in crystallography, including a
-collection of records that describe the symmetry of the crystal. Since VMD does
-not make use of such information currently, these symmetry records are only
-printed to the terminal when the file is read, and ignored otherwise.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/corplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/corplugin.html
deleted file mode 100755
index 4cf9b1f11a846544cc29ba5429beb723cfcdde8a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/corplugin.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--#set var="TITLE" value="COR Plugin, Version 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads molecular coordinate data stored in 
-<a href="http://brooks.scripps.edu/charmm_docs/TSRI_docs-list.htm">CHARMM</a>
-Cartesian Coordinate format. More information about this file format can be
-found below.
-
-<p>Note that the files created by CHARMM normally carry the extension
-<tt>.crd</tt>. Since this extension is also used by 
-<a href="crdplugin.html">Amber 7</a> trajectory files, the filetype must be
-explicitly set to <tt>cor</tt> when opening a Cartesian Coordinate File in
-VMD. This extra step can be omitted by renaming the file and changing the
-the extension to <tt>cor</tt>.</p>
-
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>The <tt>Weight</tt> field, which can be used to store atom-dependent
-data such as mass or charge is ignored by VMD.</p>
-
-<p><b>ASCII format</b>
-<br>This plugin reads only ASCII, or "formatted" COOR files. Binary
-coordinated files produced by CHARMM are presently not supported by VMD.
-</p>
-
-<h3>Format of the CHARMm coordinate file</h3>
-<pre>
-CHARMm coordinate files contain information about the location of each atom in Cartesian (3D) space. The format of the ASCII (CARD) CHARMm coordinate files is:
-    * Title line(s)
-    * Number of atoms in file
-    * Coordinate line (one for each atom in the file)
-
-The coordinate lines contain specific information about each atom in the model and consist of the following fields:
-    * Atom number (sequential)
-    * Residue number (specified relative to first residue in the PSF)
-    * Residue name
-    * Atom type
-    * X-coordinate
-    * Y-coordinate
-    * Z-coordinate
-    * Segment identifier
-    * Residue identifier
-    * Weighting array value
-
-The FORTRAN FORMAT statement for the coordinate lines is:
-
-I5, I5, 1X, A4, 1X, A4, 3(F10.5), 1X, A4, 1X, A4, F10.5
-</pre>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/cpmdplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/cpmdplugin.html
deleted file mode 100644
index ead9ebfd8b8f8f34dbca9c701e7791433e764241..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/cpmdplugin.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!--#set var="TITLE" value="CPMD Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads 
-<a href="http://www.cpmd.org/">CPMD trajectories</a> 
-from the <b>TRAJECTORY</b> file. 
-The file consists of many lines in the form
-<pre>
-timestep  x  y  z   vx  vy  vz
-</pre>
-which contain the timestep number (NFI), the x-, y-, and z-positions
-and the x-, y-, and z-velocities respectively (in atomic units) for each
-atom. If a trajectory file is continued, CPMD will insert a line
-with the string 
-<b>&lt;&lt;&lt;&lt;&lt;&lt;&nbsp;&nbsp;NEW&nbsp;DATA&nbsp;&nbsp;&gt;&gt;&gt;&gt;&gt;&gt;</b>
-which will be recognized and ignored by this plugin.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type. Saving in either binary DCD format (to reduce disk space
-requirements and enable much faster loading) or XYZ format (to avoid having to load
-a file with the atom name assignments first) instead is recommended.</p>
-
-<p><b>Automatic File Format Detection</b>
-<br>TRAJECTORY has no filename extension, so VMD will ask you to provide
-a file type manually or try to read it as PDB as last resort (which will fail). However, if you rename the file to a name ending in
-<b>.cpmd</b> VMD will atomatically detect the format.
-
-<p><b>Atom Names</b>
-<br>The TRAJECTORY file does not contain any information about the
-respective elements for the recorded positions. You have to 
-load a file containing that information in the same order, 
-e.g. the corresponding <b>GEOMETRY.xyz</b> file first and then
-use <b>Load Data Into Molecule...</b>.
-
-<p><b>Periodic Boundary Conditions</b>
-<br>CPMD does not apply periodic boundary conditions before writing
-to the TRAJECTORY file, so you may either preprocess the data
-accordingly or use a script like the pbcswrap script from the VMD
-script library to translate the atoms back into the unitcell.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/crdplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/crdplugin.html
deleted file mode 100755
index c5c841422e7a2e99f38ef5f3a755ac7b20cde826..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/crdplugin.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--#set var="TITLE" value="CRD Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes 
-<a href="http://amber.scripps.edu/">Amber</a> trajectory files. 
-More information can be found at 
-<a href="http://amber.scripps.edu/formats.html#trajectory">http://amber.scripps.edu/formats.html#trajectory</a>.
-</p>
-
-<p>
-Note that this plugin is not used for CHARMM "cartesian coordinate
-files", which often have the same extension. 
-Use the <a href="corplugin.html">COR plugin</a> for these <tt>crd</tt> files.
-</p>
-
-<h3>Notes:</h3>
-
-<p><b>Unused data</b>
-<br>Velocity information is ignored by VMD.</p>
-
-<p><b>Periodic Box</b>
-<br>This format makes no distinction between files that contain periodic box
-information and those that do not. When opening a crd file, the file type
-must be explicitly set to either <tt>crd</tt> or <tt>crdbox</tt> to ensure
-that the information is properly read by the plugin.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/cubeplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/cubeplugin.html
deleted file mode 100755
index a26f5c619bfe0965c8ed45f80ffd264a30dcc319..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/cubeplugin.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!--#set var="TITLE" value="Cube Plugin, Version 1.1"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads the atom positions and volumetric data sets in the 
-plain text "cube" format as created by the 
-<a href="http://www.gaussian.com/">Gaussian program package</a>. 
-The plugin supports cube files with single grid (e.g. densities,
-laplacian, electrostatic potential) and orbital cube files with
-multiple orbitals.<br>
-There are other programs that can create "cube" files natively
-or convert native data to the "cube" files. This plugin can only
-read those files, that comply with the following description:
-<pre>
-C     WRITE A FORMATTED CUBEFILE VERY SIMILAR TO THOSE CREATED BY 
-C     THE GAUSSIAN PROGRAM OR THE CUBEGEN UTILITY.
-C     THE FORMAT IS AS FOLLOWS (LAST CHECKED AGAINST GAUSSIAN 98):
-C
-C     LINE   FORMAT      CONTENTS
-C     ===============================================================
-C      1     A           TITLE
-C      2     A           DESCRIPTION OF PROPERTY STORED IN CUBEFILE
-C      3     I5,3F12.6   #ATOMS, X-,Y-,Z-COORDINATES OF ORIGIN
-C      4-6   I5,3F12.6   #GRIDPOINTS, INCREMENT VECTOR
-C      #ATOMS LINES OF ATOM COORDINATES:
-C      ...   I5,4F12.6   ATOM NUMBER, CHARGE, X-,Y-,Z-COORDINATE
-C      REST: 6E13.5      CUBE DATA (WITH Z INCREMENT MOVING FASTEST, THEN
-C                        Y AND THEN X)
-C
-C     FOR ORBITAL CUBE FILES, #ATOMS WILL BE < 0 AND THERE WILL BE ONE
-C     ADDITIONAL LINE AFTER THE FINAL ATOM GIVING THE NUMBER OF ORBITALS
-C     AND THEIR RESPECTIVE NUMBERS. ALSO THE ORBITAL NUMBER WILL BE
-C     THE FASTEST MOVING INCREMENT.
-C
-C     ALL COORDINATES ARE GIVEN IN ATOMIC UNITS.
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Coordinate Rotation / Periodic Display</b>
-<br>VMD currently can only display periodic images of the 
-unit cell correctly, if the first cell vector is collinear
-with the x-axis and the second cell vector in the xy-plane.
-Upon loading of the cube file, the coordinates and the 
-grid vectors are rotated accordingly. Unfortunately, that
-may make the atomic positions incompatible to some other
-coordinate files containing matching coordinates.
-
-<p><b>Read-only</b>
-<br>This plugin is only used to read files. 
-VMD does not currently support writing this file type.</p>
-
-<p><b>Memory Usage / Large Cube Files</b>
-<br>Due to the way cube files with multiple grids (e.g. orbitals)
-are written, the plugin will temporarily hold all gridded data
-in memory to get a <b>huge</b> performance increase. So 
-loading a single orbital data set from a large cube file with
-many orbitals may need a machine with a lot of available 
-memory and/or swap space. Also the plugin uses some features
-internally, which may not work for files larger than 2GB
-on 32-bit systems.
-
-<p><b>Atom Masses</b>
-<br>The plugin assigns masses to the atoms according to the 
-natural isotope distribution of the elements (see e.g.
-<a href="http://www.webelements.com/">http://www.webelements.com/</a>).
-If an element could not been recognized, a mass of 0 is assigned.
-To set the mass for those elements or assign a different mass for
-the other atoms, you have to use to create a selection with
-<b>atomselect</b> and then use the selection subcommands to set
-the mass.
-
-<p><b>Binary Cube Files</b>
-<br>Unformatted binary cube files, as they were created by
-versions before Gaussian 98 are not supported by this plugin.
-
-<p><b>Atomic Positions in Angstrom</b>
-<br>The atomic positions and the grid vectors in a cube file 
-are <b>always</b> in atomic units. There is a comment in 
-the Gaussian documentation, that describes, how you can 
-provide a custom grid in angstrom in the <b>input</b> of 
-a gaussian job.
-
-<p><b>Incompatibilities</b>
-<br>If VMD cannot read your cube file, please check the above
-notices. If your cube file has a negative number of atoms, 
-but is missing the orbitals line, you may still be able
-to read it, by changing the sign of the number of atoms.
-But most likely the positions and the grid will be given 
-in angstrom then (see the comment above), so all distances
-will be too short by a factor of about 1.9.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dcdplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dcdplugin.html
deleted file mode 100644
index 74727e06b1eb6b074bfb603ae591f168f22370a0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dcdplugin.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--#set var="TITLE" value="DCD Plugin, Version 1.11"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads and writes the "DCD" binary trajectory file format
-used by 
-<a href="http://www.charmm.org/">CHARMM</a>,
-<a href="http://www.ks.uiuc.edu/Research/namd/">NAMD</a>, 
-and 
-<a href="http://atb.csb.yale.edu/xplor/">X-PLOR</a>.
-
-The plugin performs automatic byte
-swapping to correctly read files written on machines with different endianness.
-The plugin supports reading of X-PLOR files, Charmm with fixed atoms
-and unit cell information, and NAMD files with fixed atoms and unit
-cell information.  The DCD plugin writes trajectories in Charmm 24 format
-with unit cell data and without fixed atoms.
-
-<p>
-<h3>Some basic DCD binary trajectory format specifications:</h3>
-<p>
-There's a description of the
-<a href="http://atb.csb.yale.edu/xplor/">X-PLOR</a>
-variation of the
-<a href="http://www.lrz-muenchen.de/~heller/ego/manual/node93.html">DCD format here</a>:
-<p>
-The DCD format is structured as follows (FORTRAN UNFORMATTED, with Fortran
-data type descriptions):
-<pre>
-HDR     NSET    ISTRT   NSAVC   5-ZEROS NATOM-NFREAT    DELTA   9-ZEROS
-`CORD'  #files  step 1  step    zeroes  (zero)          timestep  (zeroes)
-                        interval
-C*4     INT     INT     INT     5INT    INT             DOUBLE  9INT
-==========================================================================
-NTITLE          TITLE
-INT (=2)        C*MAXTITL
-                (=32)
-==========================================================================
-NATOM
-#atoms
-INT
-==========================================================================
-X(I), I=1,NATOM         (DOUBLE)
-Y(I), I=1,NATOM         
-Z(I), I=1,NATOM         
-==========================================================================
-</pre>
-
-<p>
-and the following describes the difference between X-PLOR
-<a href="http://www.ocms.ox.ac.uk/mirrored/xplor/manual/htmlman/node230.html">and CHARMM formats</a>:
-<p>
-Binary Trajectory Files
-<p>
-The file format is identical to the CHARMm-DCD format (Brooks et al. 1983,
-which can be read by QUANTA  and a variety of other programs. The only
-exception is that the number of coordinate sets written to the trajectory
-file is explicitly written into the header of CHARMm-DCD files, whereas  
-XPLOR writes a zero instead.
-<a href="http://www.bio.unizh.ch/docu/acc_docs/doc/charmm_principles/Ch04_mol_dyn.FM5.html#678927">Brief CHARMm format description</a>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dlpolyplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dlpolyplugin.html
deleted file mode 100755
index 15cfc260c13be5533ada17962bebf694072e715d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dlpolyplugin.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--#set var="TITLE" value="DLPOLY Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads formatted DLPOLY HISTORY (trajectory) files, 
-a minimalistic plain text format for storing molecular coordinate trajectories. 
-This plugin can't read binary history files, and may not handle all 
-variants yet but should work for the most common files.
-
-<p>
-The DLPOLY formatted HISTORY file spcecification 
-<a href="http://hidra.iqfr.csic.es/man/dlpoly/USRMAN/node156.html">is available here</a>
-
-<h3>Notes:</h3>
-
-<p><b>Periodic Cell Data</b>
-The plugin will read periodic cell information from the DLPOLY history file
-as long as the cell basis vectors are orthogonal.  The plugin doesn't presently
-convert non-orthogonal DLPOLY unit cell basis vectors to alpha/beta/gamma
-cell angles.
-</p>
-
-<p><b>Unused Data</b>
-<br>
-This plugin only reads the index and coordinates for each atom. Any
-additional data recorded for an atom is ignored presently.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dsn6plugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dsn6plugin.html
deleted file mode 100755
index 8cc9039520190155223570c90824daf5b5a3735d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dsn6plugin.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--#set var="TITLE" value="DSN6 Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the DSN6 format. More
-information on this file format can be found at <a
-  href="http://www.uoxray.uoregon.edu/tnt/manual/node104.html">http://www.uoxray.uoregon.edu/tnt/manual/node104.html</a>.</p>
-  
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>The DSN6 file format does not contain any data that is not read and used by
-VMD.</p>
-
-<p><b>Byte-order</b>
-<br>DSN6 files are created using the native byte-order (e.g., "little-endian"
-or "big-endian") of the machine used to create them. This plugin can read DSN6
-maps created with either byte-order.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dxplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dxplugin.html
deleted file mode 100755
index 44d8e81c7eea8d493113a3f4e2b924a2d107df8e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/dxplugin.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!--#set var="TITLE" value="DX Plugin, Version 1.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads potential maps stored in 
-<a href=http://opendx.npaci.edu/docs/html/>Data Explorerer "DX"</a> 
-format used by 
-<a href="http://agave.wustl.edu/apbs/">APBS</a>. 
-It may not read DX-format files produced by other applications, 
-though this could change in the future.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unit Cell</b>
-<br>All files are assumed to have an orthogonal unit cell.</p>
-
-<p><b>Example</b>
-<pre>
-   DX potential maps
-  
-   Format of the file is:
-   # Comments
-   .
-   .
-   .
-   object 1 class gridpositions counts xn yn zn
-   origin xorg yorg zorg
-   delta xdel 0 0
-   delta 0 ydel 0
-   delta 0 0 zdel
-   object 2 class gridconnections counts xn yn zn
-   object 3 class array type double rank 0 items [ xn*yn*zn ] data follows
-   f1 f2 f3
-   f4 f5 f6
-   .
-   .
-   .
-   object "Dataset name" class field
-  
-   Where xn, yn, and zn are the number of data points along each axis;
-   xorg, yorg, and zorg is the origin of the grid, in angstroms;
-   xdel, ydel, and zdel are the scaling factors to convert grid units to
-   angstroms.
-   Grid data follows, with three values per line, ordered z fast, y medium,
-   and x slow.
-  
-   Note: this plugin was written to read the OpenDX files created by the
-   APBS program, and doesn't support all of the features in the file format.
-</pre>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/edmplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/edmplugin.html
deleted file mode 100644
index 92b88b998c69727fb7198d5292fea71ccdb860b1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/edmplugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="X-PLOR and CNS EDM Plugin, Version 0.8"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the CNS and X-PLOR
-ASCII format. More information on this file format can be found in the
-<a href="http://cns.csb.yale.edu/v1.1/">CNS</a> 
-or 
-<a href="http://atb.csb.yale.edu/xplor/">X-PLOR</a>, 
-documentation.
-  
-<h1>Notes:</h1>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/fs4plugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/fs4plugin.html
deleted file mode 100755
index 3caafed104cc4227581eeb37f97dea28618030d0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/fs4plugin.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--#set var="TITLE" value="Fsfour Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps written in Fsfour format, used by
-<a href="http://www.scripps.edu/pub/dem-web/toc.html">XtalView</a>. The
-format is briefly described at <a
-  href="http://www.csb.yale.edu/userguides/datamanip/phases/FSFOUR.html">http://www.csb.yale.edu/userguides/datamanip/phases/FSFOUR.html</a>.</p>
-
-<h1>Feature-specific notes:</h1>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Byte-order</b>
-<br>Fsfour files are created using the native byte-order of the machine used
-to create them. This plugin can read maps created with either
-byte-order.</p>
-
-<p><b>Symmetry Records</b>
-<br>Fsfour maps may contain a collection of records that describe the
-symmetry of the crystal. Since VMD does not make use of such information
-currently, these records are ignored.</p>
-
-<p><b>Unit Cell Geometry</b>
-<br>Old versions of the <a
-  href="http://www.scripps.edu/~cdputnam/software/cns2fsfour.html">cns2fsfour</a>
-and <a
-  href="http://www.scripps.edu/~cdputnam/software/ccp2fsfour.html">ccp2fsfour</a>
-utilities produced files that lacked the unit cell information that was not
-used by XTalView. This plugin can currently load these files, but the unit
-cell will almost certainly be incorrect. Support for such files may become
-deprecated, users are encouraged to upgrade the the newest versions of
-these tools.
-
-<p><b>Unit Cell Origin</b>
-<br>Fsfour maps assume a periodic unit cell; therefore, each file contains
-data for a unit cell beginning at the point <0, 0, 0>. 
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/g96plugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/g96plugin.html
deleted file mode 100755
index 80262bca18035b7631a11ad51baea05a347eaefb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/g96plugin.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--#set var="TITLE" value="G96 Plugin, Version 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays structure/trajectory files in <a
-  href="http://www.igc.ethz.ch/gromos/">Gromos 96</a> format as recognized
-by <a href="http://www.gromacs.org/">GROMACS</a>. More information can be found
-  at <a
-    href="http://www.gromacs.org/documentation/reference_3.1/online/g96.html">http://www.gromacs.org/documentation/reference_3.1/online/g96.html</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Trajectories</b>
-<br>G96 files can contain multiple timesteps.</p>
-
-<p><b>Unused data</b>
-<br>G96 files may contain an optional "velocity" block. This data is not
-used by VMD.</p>
-
-<p><b>Compressed files</b>
-<br>Compressed files will need to be expanded before this plugin can read
-them.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/gamessplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/gamessplugin.html
deleted file mode 100644
index 1d147e19e014b98ebd9f222566159b52342dcc9a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/gamessplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="GAMESS Plugin, Version 0.12"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads GAMESS output files.
-
-<h3>Notes:</h3>
-
-<p><b>Structural Data</b>
-<br>The plugin can parse GAMESS output (*.log) files and
-extract structural information. 
-<br>Currently we support output
-files generated by the following GAMESS runtypes: 
-<br>
-<br> RUNTYP = ENERGY (extract single point geometry)
-<br> RUNTYP = OPTIMIZE (extract trajectory information) 
-<br> RUNTYP = SADPOINT (extract trajectory information)
-<br>
-<br> We plan to support additional runtypes in future releases.
-</p>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/graspplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/graspplugin.html
deleted file mode 100644
index 367693d8d1baa0e7b397068fe66e6b05a0f71ba6..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/graspplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="GRASP Plugin, Version 0.7"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays GRASP binary surface files 
-This format uses triangles exclusively to to represent 3-D geometry. 
-Short documents describing the GRASP surface file format can
-be found at these two sites:
-<li><a href="http://www.msg.ucsf.edu/local/programs/grasp/html/Appendix%20A.html">http://www.msg.ucsf.edu/local/programs/grasp/html/Appendix%20A.html</a>.
-<li><a href="http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.1">http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.1</a>
-</ul>
-
-<h3>Notes:</h3>
-Since GRASP surface files are a 'finished product' type of data,
-they can't be manipulated very much within VMD, though they can be
-displayed.
-
-<p><b>Unused data</b>
-At present, the plugin doesn't provide color data from 
-the GRASP surface file, the surface is loaded using the active
-user-defined graphics drawing color.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/grdplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/grdplugin.html
deleted file mode 100755
index 17f06e289c3eab71c213c853825a822ccbfe989c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/grdplugin.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--#set var="TITLE" value="GRD Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads binary potential maps in the format used by <a
-  href="http://trantor.bioc.columbia.edu/delphi/">DelPhi</a> and <a
-  href="http://honiglab.cpmc.columbia.edu/grasp/">Grasp</a>. More
-information on this format can be found at <a
-  href="http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.2">http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.2</a>
-and <a
-  href="http://trantor.bioc.columbia.edu/delphi/doc/file_format.html">http://trantor.bioc.columbia.edu/delphi/doc/file_format.html</a>.
-
-To read the "formatted ASCII" files created by <a
-  href="http://www.msg.ucsf.edu/local/programs/insightII/doc/life/insight2000.1/delphi/B_Utilities.html#696658">format_phi</a>,
-use the <a href="phiplugin.html">phiplugin</a>.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Grid Points</b>
-<br>It is assumed that the density values of all files are arranged in a
-cubic grid. This plugin is not limited to 65x65x65 grid points as earlier
-versions of the file format are.</p>
-
-<p><b>Unit Cell</b>
-<br>Since PHI maps do not explicitly state the angles of the basis vectors,
-it is assumed that they are orthogonal.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/gridplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/gridplugin.html
deleted file mode 100644
index ebbcdf405d56a5200fedebe2a538c61d7373ebbb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/gridplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="Molecular Discovery GRID Plugin, Version 0.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps created by Molecular Discovery's
-<a href="http://www.moldiscovery.com/soft_grid.php">GRID program</a>, also
-used by UHBD, and other software. 
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Format Uncertainty</b>
-Not sure if slicing order is the same in every file.
-</p>
-
-<p><b>Unused data</b>
-This plugin doesn't read in all data stored in the file, in particular
-various plane metadata.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/groplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/groplugin.html
deleted file mode 100755
index 1691a9aaedf033873d0dc458c30b2d34eae14e8a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/groplugin.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--#set var="TITLE" value="GRO Plugin, Version 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays molecular structure files in 
-<a href="http://www.gmd.de/SCAI/europort-1/H1.HTM">Gromos87</a> 
-format, as recognized by 
-<a href="http://www.gromacs.org/">GROMACS</a>. 
-More information can be found at 
-<a href="http://www.gromacs.org/documentation/reference_3.1/online/gro.html">http://www.gromacs.org/documentation/reference_3.1/online/gro.html</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>GRO files may contain an optional "velocity" block. This data is not
-used by VMD.</p>
-
-<p><b>Compressed files</b>
-<br>Compressed files will need to be expanded before this plugin can read
-them.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/index.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/index.html
deleted file mode 100755
index 9cb1f048ceb5badbe9659bf5d1fa24d7110a1567..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/index.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!--#set var="TITLE" value="Molfile Plugin Documentation"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<b>Molfile</b> plugins act as translators between the on-disk file
-representations of molecular structures, trajectories, volumetric
-data sets, and graphics geometry data, and the in-memory 
-representation of these data in VMD.  This page contains a 
-list of all of the currently available file reader plugins for VMD.
-For each plugin, we try to maintain an up-to-date document which 
-explains what limitations the plugin has, whether it reads all data or
-only some of the data from the file format, any known bugs, and any
-other useful information, often with links to the file format specifications
-which were used to develop the plugin.
-
-
-<h3>Calling VMD molfile plugins from your own code</h3>
-Although the molfile plugins were primarily developed for use within VMD,
-they can also be used by other scientific software written 
-in C/C++/Fortran.  They are provided under the 
-<a href=/Research/vmd/plugins/pluginlicense.html>UIUC Open Source License</a>.
-See the 
-<a href="/Research/vmd/plugins/doxygen/">VMD Plugin Programmer's Guide</a> 
-for more information on using VMD plugins in other software.
-
-
-<h3>Molecule Coordinate/Structure File Plugins</h3>
-<ul>
-<li><a href="parmplugin.html">AMBER 4-6 structure file(.parm)</a>
-<li><a href="parm7plugin.html">AMBER 7-9 structure file(.prmtop, .parm7)</a>
-<li><a href="rst7plugin.html">AMBER 7-9 restart file(.rst7)</a>
-<li><a href="babelplugin.html">Babel file translator plugin</a>
-<li><a href="bgfplugin.html">Biograf structure files (.bgf)</a>
-<li><a href="carplugin.html">Insight II/Discover coordinate file (.car)</a>
-<li><a href="corplugin.html">CHARMM coordinate file (.crd)</a>
-<li><a href="psfplugin.html">CHARMM, CNS, NAMD, X-PLOR PSF structure file (.psf)</a>
-<li><a href="gamessplugin.html">GAMESS log file (.log)</a>
-<li><a href="groplugin.html">Gromos 87, Gromacs structure file (.gro)</a>
-<li><a href="g96plugin.html">Gromos 96, Gromacs coordinate and trajectory (.g96)</a>
-<li><a href="https://github.com/h5md/VMD-h5mdplugin">H5MD plugin (.h5)</a>
-<li><a href="namdbinplugin.html">NAMD Restart file (.namdbin)</a>
-<li><a href="mdfplugin.html">Insight II/Discover structure file (.mdf)</a>
-<li><a href="netcdfplugin.html">MMTK NetCDF structure reader (.nc)</a>
-<li><a href="moldenplugin.html">Molden structure files (.molden)</a>
-<li><a href="pdbplugin.html">PDB (Protein Data Bank) files (.pdb)</a>
-<li><a href="pqrplugin.html">PQR (coordinate, charge, and radii) (.pqr)</a>
-<li><a href="mol2plugin.html">SYBYL Mol2 structure files (.mol2)</a>
-<li><a href="tinkerplugin.html">Tinker coordinate and trajectory reader (.arc)</a>
-<li><a href="vaspplugin.html">VASP atomic configurations (.POSCAR, .CONTCAR)</a>
-<li><a href="xbgfplugin.html">VMD XBGF structure files (.xbgf)</a>
-<li><a href="vtfplugin.html">VTF structure files (.vsf, .vcf)</a>
-<li><a href="webpdbplugin.html">WebPDB (web-based PDB downloader)</a>
-<li><a href="xsfplugin.html">XCrySDen, Quantum Espresso XSF/AXSF coordinate files (.axsf, .xsf)</a>
-<li><a href="xyzplugin.html">XYZ coordinate files (.xyz)</a>
-</ul>
-
-<h3>Molecular Dynamics Trajectory File Plugins</h3>
-<ul>
-<li><a href="binposplugin.html">AMBER 'binpos' trajectory reader (.binpos)</a>
-<li><a href="crdplugin.html">AMBER "CRD" trajectory reader (.crd, .crdbox)</a>
-<li><a href="netcdfplugin.html">AMBER NetCDF trajectory reader (.nc)</a>
-<li><a href="dcdplugin.html">CHARMM, NAMD, X-PLOR "DCD" reader/writer (.dcd)</a>
-<li><a href="cpmdplugin.html">CPMD (CPMD trajectory) reader (.cpmd)</a>
-<li><a href="dlpolyplugin.html">DLPOLY HISTORY file reader (.dlpolyhist)</a>
-<li><a href="trrplugin.html">Gromacs TRR/XTC reader (.trr, .xtc)</a>
-<li><a href="tngplugin.html">Gromacs TNG reader (.tng)</a>
-<li><a href="https://github.com/h5md/VMD-h5mdplugin">H5MD plugin (.h5)</a>
-<li><a href="lammpsplugin.html">LAMMPS trajectory reader (.lammpstrj)</a>
-<li><a href="netcdfplugin.html">MMTK NetCDF trajectory reader (.nc)</a>
-<li><a href="vaspplugin.html">VASP trajectories of ionic steps (.xml, .OUTCAR, .XCATCAR)</a>
-<li><a href="vtfplugin.html">VTF trajectory files (.vtf)</a>
-<li><a href="xsfplugin.html">XCrySDen, Quantum Espresso XSF/AXSF trajectory files (.axsf, .xsf)</a>
-<li><a href="xyzplugin.html">XYZ trajectory files (.xyz)</a>
-</ul>
-
-<h3>Volumetric Data/Density/Potential Map Plugins</h3>
-<ul>
-<li><a href="mapplugin.html">Autodock Grid Map File reader (.map)</a>
-<li><a href="avsplugin.html">AVS Field File reader (.fld)</a>
-<li><a href="biomoccaplugin.html">Biomocca volumetric occupancy map reader (.bmcg) </a>
-<li><a href="brixplugin.html">Brix format electron density map reader (.brix)</a>
-<li><a href="ccp4plugin.html">CCP4, MRC format electron density map reader (.ccp4, .mrc)</a> 
-<li><a href="dxplugin.html">Data Explorer (DX) format volumetric grid (.dx) </a>
-<li><a href="grdplugin.html">Delphi, GRASP unformatted binary phimap reader (.grd, .phi)</a>
-<li><a href="phiplugin.html">Delphi, GRASP formatted ASCII phimap reader (.big)</a>
-<li><a href="cubeplugin.html">Gaussian "cube" file reader (.cube)</a>
-<li><a href="gridplugin.html">Molecular Discovery, UHBD GRID map reader (.grid)</a>
-<li><a href="pltplugin.html">gOpenmol PLT format electron density map reader (.plt)</a> 
-<li><a href="dsn6plugin.html">"O" DSN6 format electron density map reader (.ds6, .dsn6, .omap)</a> 
-<li><a href="situsplugin.html">Situs volumetric grids (.sit, .situs)</a>
-<li><a href="spiderplugin.html">SPIDER volumetric images (.spi, .spider)</a>
-<li><a href="uhbdplugin.html">UHBD potential maps (.uhbd)</a>
-<li><a href="vaspplugin.html">VASP charge densities and electron localization functions (.CHGCAR, .ELFCAR, .LOCPOT, .PARCHG)</a>
-<li><a href="edmplugin.html">X-PLOR, CNS format electron density map reader (.cns, .edm, .xplor)</a>
-<li><a href="xsfplugin.html">XCrySDen, Quantum Espresso XSF/AXSF trajectory files (.axsf, .xsf)</a>
-<li><a href="fs4plugin.html">XtalView "fsfour" electron density map reader (.fs, .fs4)</a>
-</ul>
-
-<h3>Graphics Plugins</h3> 
-<ul>
-<li><a href="graspplugin.html">GRASP surface file reader (.grasp, .srf)</a>
-<li><a href="msmsplugin.html">MSMS surface file reader (.face, .vert)</a>
-<li><a href="raster3dplugin.html">Raster3D scene reader (.r3d)</a>
-<li><a href="stlplugin.html">STL solid model triangulated geometry files (.stl)</a>
-</ul>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/lammpsplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/lammpsplugin.html
deleted file mode 100755
index aa2922223e165ac5c91c16a2dc5d161595a8e7dc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/lammpsplugin.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!--#set var="TITLE" value="LAMMPS Plugin, Version 0.18"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads text mode LAMMPS trajectory files (aka dumps) in
-atom style or custom style. Not all fields of the custom style
-output are supported in the molfile API and thus cannot be
-communicated directly to VMD. Also the file format itself allows
-for a variable number of atoms which VMD currently cannot handle.
-Therefore the plugin will stop reading any trajectory file
-with an error message at the first frame that has a different
-number of atoms compared the previous ones.</p>
-
-<p>
-A brief summary of the "atom" LAMMPS trajectory 
-<a href="http://lammps.sandia.gov/doc/dump.html">dump</a> format
-for orthorhombic boxes is below. LAMMPS also supports a
-"custom" dump style that is very similar to the "atom" style,
-but it allows to output a custom selection of a large variety 
-of per-atom properties, including data created by "fix"es
-or "compute"s.  Upon writing VMD will currently only write
-"atom" style dump files.</p>
-
-<p>The characters following the BOX BOUNDS keyword indicate the 
-boundary conditions for each side in x-, y-, and z-direction respectively.
-'p' stands for periodic boundaries, but also 'f' (=fixed), 's' (=shrinkwrap),
-and 'm' (=shrinkwrap with minimum) are possible or combinations 
-thereof. When writing LAMMPS dumps, periodic boundaries are assumed
-if non-zero box dimensions are given; if not, then shrinkwrap
-is assumed and the corresponding lo-/hi-values are determined by 
-the plugin.</p>
-
-<p>Coordinates can be given in different variants: regular or
-as fractional coordinates (indicated by the postfix 's'). Similarly
-can they be output as wrapped back into the principal unitcell
-or unwrapped (indicated by the postfix 'u'). In addition to 
-wrapped coordinates, also the image flags ('ix', 'iy', 'iz')
-that are counters for how many times an atom has passed through
-the cell in the respective direction. In "atom" style dumps, the 
-<a href="http://lammps.sandia.gov/doc/dump_modify.html">dump_modify</a>
-command in LAMMPS can be used to change the output format.
-Multiple coordinate representations can be present in "custom" style 
-dumps. The lammpsplugin will make the best effort to reconstruct 
-unscaled (=regular) and unwrapped coordinates from the available 
-information and the simulation cell dimension information.</p>
-
-<p>If the BOX BOUNDS line also optionally contains the 'xy yz yz'
-flags, then the box is no longer orthorhombic and the corresponding
-'tilt factors' are written out in a 3rd column of numbers in the
-following three lines with the box boundaries. The plugin </p>
-
-<pre>
-ITEM: TIMESTEP
- %d (timestep number)
-ITEM: NUMBER OF ATOMS
-  %d (number of atoms)
-ITEM: BOX BOUNDS pp pp pp
-  %f %f (xlo, xhi)
-  %f %f (ylo, yhi)
-  %f %f (zlo, zhi)
-ITEM: ATOMS id type xs ys zs 
-  %d %d %f %f %f  (atomid, type, x-, y-, z, coordinates)
-  ...
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Triclinic Cells</b>
-<p>Support for automatic unscaling and unwrapping of coordinates
-from simulations using triclinic cells is currently not supported.</p>
-
-<p><b>Unused Data</b>
-<p>This plugin only reads from the available data what is compatible
-with the molfile plugin API. Also in keeping with the plugin API only
-coordinates and velocities are read in for every frame; all other 
-properties are taken from the very first frame. Any additional data 
-recorded for an atom is ignored, unless the environment variable
-LAMMPSREMAPFIELDS is used to replace a supported property with an
-unsupported one. For details see below.</p>
-
-<p><b>Legacy LAMMPS Dump Files</b>
-<p>The LAMMPS dump file format described above corresponds to recent
-versions of LAMMPS. It has been incrementally improved over the years.
-Older versions may not provide all the detail. The plugin will make 
-a best effort to guess missing information, but that may not always 
-produce the desired result.</p>
-
-<p><b>Environment Variables</b>
-<p>
-Some aspects of the behavior of the plugin can be controlled 
-through environment variables, that can be set either externally 
-before launching VMD or from the VMD console via manipulation of
-the <tt>env</tt> array (use "global env;" to access it in a subroutine).</p>
-
-<b>LAMMPSDIPOLE2ATOMS</b>
-<p>With this environment variable set to a number > 0.0 any point dipolar
-particle will be converted into two particles a certain distance away
-from the center and thus signifying the direction of the dipole. The
-numerical value of the LAMMPSDIPOLE2ATOMS environment variable is 
-interpreted as a scaling factor for this conversion with respect to
-the magnitude of the dipole moment.
-</p>
-<b>LAMMPSREMAPFIELDS</b>
-<p>
-This environment variable allows to map certain columns in a LAMMPS
-trajectory file to others and thus allows to read in properies, which
-VMD is normally not able to read. The content of the variable
-is the list of mappings in the format <code>old=new</code> and 
-separated by commas. For example to read in forces into the velocities
-fields, the following mapping is required: <code>vx=fx,vy=fy,vz=fz</code>.
-This approach can be applied to any data in the dump file, even the 
-output from variables, fixes, or computes.
-
-Only the fields for coordinates and velocities will be read and
-stored in every time step and thus a suitable to transferring 
-per timestep data into VMD through this mechanism. In addition
-VMD will read in the fields name, type, mass, radius/diameter, 
-and charge and thus those can also be remapped, but those will
-only be read in on the first timestep. 
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mapplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mapplugin.html
deleted file mode 100755
index ed59b4556725aad5aedbc5b731e092d50e2ea6a0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mapplugin.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--#set var="TITLE" value="MAP Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads 
-<a href="http://www.scripps.edu/pub/olson-web/doc/autodock/">AutoDock</a>
-Grid Map files, used by the package to store potential maps. 
-More information on this file format can be found at 
-<!-- <a href="http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/Using_AutoDock_305.21.html#pgfId=34041">http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/Using_AutoDock_305.21.html#pgfId=34041</a>. -->
-<a href="http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf">http://autodock.scripps.edu/faqs-help/manual/autodock-3-user-s-guide/AutoDock3.0.5_UserGuide.pdf</a>.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unit Cell</b>
-<br>This file format only supports orthogonal unit cells.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mdfplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mdfplugin.html
deleted file mode 100755
index 94ec83e6e337e17294f1a138ba80edffd2de4f40..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mdfplugin.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--#set var="TITLE" value="MDF Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-Molecular data file (.mdf) reader
-Insight II, Discover, etc.  Structure and bond information. This plugin
-reads only the topology section, ignoring the optional symmertry and
-atomset sections.
-
-<p>
-Format specification can be found at:
-<a href="http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#484257">
-http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#484257
-</a>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>TODO:</b>
-<br>
-The current code reads the file *four* times -- once on open, once
-to read the structure, and twice to read the bonds. Perhaps these could
-be consolidated, e.g. by counting the bonds and populating the hash
-tables during open or read_structure.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mol2plugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mol2plugin.html
deleted file mode 100644
index 9b64a3c581c5205fe17ac81a4e2a8fbbfa75936f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/mol2plugin.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--#set var="TITLE" value="Mol2 Plugin, Version 0.16"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes molecular coordinate and bonding data 
-stored in the
-<a href="http://www.tripos.com/custResources/mol2Files/">Mol2</a> 
-<a href="http://www.tripos.com/mol2/index.html">Mol2</a>
-file format.
-
-<h3>Notes:</h3>
-
-<p><b>Recognized data</b>
-<br>Only the following record types are currently recognized by the Mol2
-plugin: molecule, atom, and bond. All others are ignored.  The plugin 
-returns charges when they are available, and bond orders for each bond.
-
-<br>The mol2 plugin doesn't currently read SUBSTRUCTURE records which
-contain chain, information, residue names, etc.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/moldenplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/moldenplugin.html
deleted file mode 100644
index 8631dc5c374749b73565639a4ee053cc421b0bce..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/moldenplugin.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!--#set var="TITLE" value="Molden Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads in molecular structures in the file format used 
-<a href="http://www.cmbi.kun.nl/~schaft/molden/molden.html">by Molden</a>.
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/msmsplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/msmsplugin.html
deleted file mode 100644
index 104fccf9afa9aa3e1993a128ac2e6d1cc0926dbf..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/msmsplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="MSMS Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays MSMS surface files described
-by the MSMS vertex and facet output files.
-
-<h3>Notes:</h3>
-This plugin requires both the vertex and the facet file in order
-to successfully load the MSMS surface data.  The two files are
-expected to be named filename.vert and filename.face, as they 
-would be produced by MSMS.
-Since MSMS surface files are a 'finished product' type of data,
-they can't be manipulated very much within VMD when they are
-computed outside of VMD, though they can be displayed.
-
-<p><b>Unused data</b>
-At present, the plugin doesn't provide atom index data from 
-the surface facet file.  The surface is loaded using the active
-user-defined graphics drawing color.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/namdbinplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/namdbinplugin.html
deleted file mode 100644
index 24f90df38a42dd0475d2fec3654d35e52efa6852..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/namdbinplugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="NAMDBin Plugin, Version 0.2"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes NAMD binary restart files produced by 
-   all versions of NAMD dating all the way back to NAMD 1.x. 
-
-<h3>Notes:</h3>
-<p><b>Floating Point Precision</b>
-<p>
-This plugin reads and writes NAMD binary coordinate files, however
-the full precision of coordinates are not maintained in either
-the read or write processes, since the plugin interface currently uses 
-single precision floating point numbers for atom coordinates.
-</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/netcdfplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/netcdfplugin.html
deleted file mode 100755
index e349421fb69c54f08663b2efd5b21aaec1a76646..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/netcdfplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="NetCDF Plugin, Version 0.10"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-The NetCDF plugin reads structure and trajectory data written as
-<a href=http://www.unidata.ucar.edu/software/netcdf/>NetCDF files</a>, by 
-<a href=http://amber.scripps.edu/>AMBER 9</a> and
-<a href=http://dirac.cnrs-orleans.fr/MMTK/>MMTK</a>.  
-  
-<p>
-<h3>Notes:</h3>
-<ul>
-<li>The routines for reading 
-    <a href="http://amber.scripps.edu/formats.html#netcdf">AMBER 9 NetCDF files</a> 
-    accept a subset of the possible combinations of data fields.  
-    In particular, VMD doesn't currently read the AMBER velocity data.
-<li>The MMTK routines currently parse atom data with a simple method that
-    ignores atom grouping information and other high level organization stored
-    in the "description" data.
-</ul>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/parm7plugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/parm7plugin.html
deleted file mode 100755
index 03707cb6385a9b0f1508529d073c0cfc9775353f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/parm7plugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="AMBER 7-11 Parm Plugin, Version 0.13"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads molecular structure in Parm format, used by <a
-  href="http://ambermd.org/">Amber</a> versions 7 through 11.</p>
-
-The Amber file formats are 
-<a href="http://ambermd.org/formats.html">described in detail</a>
-on the Amber home page.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused Data</b>
-<br>The Amber box data is not currently used by VMD. Atom radii are also
-ignored.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/parmplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/parmplugin.html
deleted file mode 100755
index c20dcf687c78f1582758b3b0eba3b3c43bba45eb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/parmplugin.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--#set var="TITLE" value="AMBER 4-6 Parm Plugin, Version 4.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-This plugin reads molecular structure in Parm format, used by <a
-  href="http://ambermd.org/">Amber</a> versions 4-6.
-
-The Amber file formats are 
-<a href="http://ambermd.org/formats.html">described in detail</a> 
-on the Amber home page.
-
-<p>
-<h3>Notes:</h3>
-
-<p>
-<b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.
-
-<p>
-<b>Unused Data</b>
-<br>The Amber box data is not currently used by VMD.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pdbplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pdbplugin.html
deleted file mode 100644
index 6ca126926f7fe44fd19bf70d1935fec4c4c94891..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pdbplugin.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!--#set var="TITLE" value="PDB Plugin, Version 1.16"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes molecular coordinate data stored in the
-RCSB Protein Data Bank
-<a href="http://www.rcsb.org/pdb/file_formats/pdb/pdbguide2.2/guide2.2_frame.html">PDB file format</a>.
-
-<h3>Notes:</h3>
-<p><b>Support for non-standard PDB files</b>
-The PDB plugin will accept a number of variations of the PDB
-file format which are technically violations of the specification.
-These include files containing more than 99,999 ATOM/HETATM records,
-ATOM records with serial number fields extending into the space reserved
-for record keywords, and various other transgressions.
-
-<p><b>ATOM, HETATM records</b>
-The PDB plugin processes all fields in the ATOM and HETATM records.
-
-<p><b>CONECT records</b>
-VMD reads all CONECT records and treats them as an indication of
-"special" bonds that are noteworthy beyond the obvious ones that a
-simple distance based search would find.  VMD reads all of the bonds
-from the CONECT records, and then adds the bonds found by an automatic
-distance search, skipping any duplicates.
-
-<p><b>HEADER record</b>
-The PDB header accession code, data, and classification
-information information are read from the header, but only the 
-accession code and date are returned by the plugin.
-
-<p><b>REMARK records</b>
-All REMARK records are read and returned to VMD by the plugin.
-
-<p><b>Alternate Location Identifiers</b>
-Some PDB files contain ATOM records with non-empty alternate location
-identifiers (AltLoc) which indicate alternative conformations for parts of the
-structure.  VMD 1.8.4 and above reads the AltLoc fields and uses them to 
-prevent generation of spurious bonds between conformations of the structure,
-and to allow differet conformations to be selected using the "altloc" atom
-selection keyword.
-
-<p><b>Interpretation of atom serial numbers</b>
-<br>
-Since PDB files can only store 99,999 atoms without overrunning the
-columns designated for atom indices etc, the PDB plugin doesn't directly 
-use the atom indices specified in the PDB file as its own indices, instead 
-it keeps its own independent atom index counter, allowing it to read files
-containing millions of atoms.  The atom index field for atoms beyond 99,999
-may contain alphanumeric characters, or some other unique string scheme,
-as has commonly been used in software such as X-PLOR/CNS, and other packages.
-</p>
-
-<p><b>Unit Cell</b>
-<br>
-The PDB plugin reads in the CRYST1 unit cell information for use with 
-periodic image display when available. 
-
-<p><b>Multi-structure PDB files</b>
-The PDB plugin reads multi-structure PDB files and treats them 
-as an trajectory of atom positions, if each structure contains
-the same number of atoms.  If the subsequent structures have mismatched
-atom counts, only the first structure is returned.
-
-<p><b>Unused data</b>
-<br>
-Various PDB record types and fields are ignored by VMD, in general
-VMD doesn't do anything with the sequence data or crystallography-specific 
-fields in the format presently.  
-<br>
-All unused PDB records are returned as remark data by the PDB plugin,
-allowing this information to be parsed and accessed by plugins.
-While somewhat hackish and generally not how we'd prefer to do things,
-much of the information provided in PDB files is fairly free format,
-or provided in REMARK lines anyway, so this provides a means of getting
-at it, for plugins that are crafty enough to read this information.
-</p>
-
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/phiplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/phiplugin.html
deleted file mode 100755
index 30594a8998cc5b08aa72cdcac0d21021548efcac..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/phiplugin.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--#set var="TITLE" value="PHI Plugin, Version 0.7"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads "formatted ASCII" '.big' potential maps created by the
-<a href="http://www.msg.ucsf.edu/local/programs/insightII/doc/life/insight2000.1/delphi/B_Utilities.html#696658">format_phi</a> utility, or the 
-<a href=http://www.csb.yale.edu/userguides/datamanip/delphi/manual.html#ASCIIPHI>ASCIIPHI</a> utility.
-
-To read the "unformatted" binary phi maps produced by DelPhi, use the 
-<a href="grdplugin.html">grdplugin</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Grid Points</b>
-<br>It is assumed that the density values of all files are arranged in a
-cubic grid.</p>
-
-<p><b>Unit Cell</b>
-<br>Since ASCII PHI maps do not explicitly state the angles of the basis 
-vectors, it is assumed that they are orthogonal.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pltplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pltplugin.html
deleted file mode 100755
index 01fecefcc4134451b9436a7953633f916721f38c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pltplugin.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--#set var="TITLE" value="PLT Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the PLT format used by 
-<a href="http://www.csc.fi/gopenmol/">gOpenMol</a>. 
-More information on this file format can be found at 
-<a href="http://www.csc.fi/gopenmol/developers/plt_format.phtml">http://www.csc.fi/gopenmol/developers/plt_format.phtml</a>.</p>
-  
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Unused data</b>
-<br>VMD ignores the "surface type" value.</p>
-
-<p><b>Unit Cell</b>
-<br>Since PLT files don't contain any information about the geometry of the
-unit cell, it is assumed that the basis vectors are orthogonal.</p>
-
-<p><b>ASCII and Binary Files:</b>
-<br>This plugin can read binary plt files regardless of the byte-order of
-the platform used to create them. It does not currently support the
-"formatted ASCII" files used by the <tt>pltfile</tt> program included with
-gOpenMol.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pqrplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pqrplugin.html
deleted file mode 100644
index 1eab7bd285804663a51f503ce77e130a495bd6a6..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/pqrplugin.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--#set var="TITLE" value="PQR Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes molecular coordinate data stored in the PQR
-file format. This variant of the PDB format contains atom charge and radius
-information, and does not store many of fields found in PDB files.
-
-<h3>Notes:</h3>
-The PQR files written by this plugin currently contain the same radius and
-charge information used for VMD's internal atom representation. Since this
-may not be appropriate for some applications, it may be necessary to
-override these values in VMD using atomselect commands. Consult the VMD
-User's Guide for information on changing atom data using atomselections.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/psfplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/psfplugin.html
deleted file mode 100644
index 656da5931148f3597aa336c0395228ef447e62bd..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/psfplugin.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--#set var="TITLE" value="PSF Plugin, Version 1.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes the PSF ASCII structure file format
-   used by CHARMM, CNS, NAMD, and X-PLOR.
-
-<h3>Notes:</h3>
-<p><b>CHARMM extensions</b>
-<br>
-The current versions of the PSF plugin support the 
-Charmm31 CMAP, CHEQ, and EXT extensions when reading, but
-only the CMAP extension is supported for writing.
-
-<p><b>Bonds</b>
-<br>
-Bond information is read and written by the PSF plugin.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/raster3dplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/raster3dplugin.html
deleted file mode 100644
index 91317b3b89e0fd411e3d589c0e95324532136c90..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/raster3dplugin.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--#set var="TITLE" value="Raster3D Plugin, Version 0.2"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and displays Raster3D scene files in VMD.  
-  
-<h1>Notes:</h1>
-<p><b>Unused data</b>
-<br>
-The Raster3D scene file format has changed, adding new features and
-capabilities over the last few years.  VMD supports a limited 
-subset of these features, those geometric and scene description 
-elements that are representable within VMD's rendering built-in
-system.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/rst7plugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/rst7plugin.html
deleted file mode 100755
index 783a0cd8ac114d33b361b62c56784685e09ca579..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/rst7plugin.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--#set var="TITLE" value="Amber 7-11 Restart File Plugin, Version 0.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads and writes 
-<a href="http://amber.scripps.edu/">Amber</a> 'coord' restart files for
-AMBER versions 7 through 11.
-More information can be found at 
-<a href="http://ambermd.org/formats.html#restart">http://ambermd.org/formats.html#restart</a>.</p>
-  
-<h3>Notes:</h3>
-
-<p><b>Unused data</b>
-<br>Velocity and periodic box information are not presently used by VMD.</p>
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/situsplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/situsplugin.html
deleted file mode 100755
index 7676eaef382d237e086161958ec42cb7a53be6cf..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/situsplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="Situs Plugin, Version 1.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electron density maps stored in the 
-<a href="http://situs.biomachina.org/">Situs format</a>.
-
-The Situs map format is quite simple and constists of ASCII floating
-point numbers:
-<ul>
-<li>voxel size in Angstroms
-<li>coordinates of first voxel
-<li>integer X/Y/Z counts
-<li>voxels follow in X fastest, Y next fastest, Z slowest
-</ul>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/spiderplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/spiderplugin.html
deleted file mode 100755
index 6cd9b827d4164901f8437201a2bbc103c6bad222..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/spiderplugin.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--#set var="TITLE" value="SPIDER Plugin, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads volumetric data sets produced with the
-<a href=http://www.wadsworth.org/spider_doc/spider/docs/master.html>SPIDER</a>
-image processing system.
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<p><b>Format Specification</b>
-<br>
-File format specifications for SPIDER volumetric datasets are 
-<a href="http://www.wadsworth.org/spider_doc/spider/docs/image_doc.html">available online</a>.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/stlplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/stlplugin.html
deleted file mode 100755
index 54b912bfb83a7fd399478f30f206fefc9e87bddb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/stlplugin.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--#set var="TITLE" value="STL Plugin, Version 2.0"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads and displays files in STL (stereo lithography) format, the
-standard data format for automated fabricators. This format uses triangles
-exclusively to to represent 3-D geometry. More information can be found at 
-<a href="http://rpdrc.ic.polyu.edu.hk/old_files/stl_introduction.htm">http://rpdrc.ic.polyu.edu.hk/old_files/stl_introduction.htm</a>.</p>
-and at
-<a href="http://www.csit.fsu.edu/~burkardt/data/stla/stla.html">http://www.csit.fsu.edu/~burkardt/data/stla/stla.html</a>
-  
-<h3>Notes:</h3>
-
-<p><b>Unused data</b>
-<br>The STL specification dictates that the normal for each facet is to be
-stored with the vertex coordinates. Since this information is superfluous, it
-is ignored by the plugin.</p>
-
-<p><b>ASCII and Binary STL Files</b>
-<br>Currently, there is no support for the 
-<a href="http://www.csit.fsu.edu/~burkardt/data/stlb/stlb.html">binary STL format</a>. 
-Only files in the ASCII format can be read.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/template.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/template.html
deleted file mode 100755
index 6e0c5c57b95045780687f9d25b295a06e8ed3cc6..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/template.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--#set var="TITLE" value="FOO Plugin, Version 0.1"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-This plugin lorem ipsum.
-  
-<p>
-<h1>Feature-specific notes:</h1>
-<p>
-<b>Note 1:</b>
-<br>Lorem ipsum
-
-<b>Note 2:</b>
-<br>dolor sit amet
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/tinkerplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/tinkerplugin.html
deleted file mode 100755
index 412023b9c7bc9554684b417f26d0426c3e07b9d1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/tinkerplugin.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--#set var="TITLE" value="Tinker Plugin, Version 0.5"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads 
-<a href="http://dasher.wustl.edu/tinker/">Tinker</a> 
-files, a minimalistic plain text file format for storing molecular 
-coordinates, bonds, angles, and torsions. 
-
-<p>
-A brief summary of the format, as read by VMD follows:
-<pre>
-    Tinker molecule file format:
-    [ N ] ...             # of atoms, and molecule name
-    idx1 atom1 x y z ...  atom index, followed by name, xyz coords,
-    idx2 atom2 x y z ...  atom type index, bond, angle, torsion
-    ...
-    idx3 atomN x y z ... 
-                        
-    Note that this plugin only reads the atom name and coordinate fields, 
-    all other fields are ignored at present.
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Trajectories</b>
-<br>Tinker files can contain multiple timesteps. All timesteps, however 
-have to have the same number of atoms. Also the atoms must be in the same
-order, only the first timestep will be used to read the element names.
-Only the coordinates will be read fom successive timesteps.
-</p>
-
-<p><b>Unused Data</b>
-<br>This plugin only reads the label and coordinates for each atom. Any
-additional data recorded for an atom is ignored.</p>
-
-<p><b>Atom Count</b>
-<br>VMD requires that the first non-comment line of the file contain the
-number of atoms.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/tngplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/tngplugin.html
deleted file mode 100755
index 0a30b68ad411f9801fecc0d9dfafc4d8a809e96f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/tngplugin.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!--#set var="TITLE" value="Gromacs TNG Plugin, Versions 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>These plugins read the portable TNG binary trajectory file formats used by 
-<a href="http://www.gromacs.org/">GROMACS</a>. 
-The TNG file format is explained in detail in
-<a href="http://onlinelibrary.wiley.com/doi/10.1002/jcc.23495/abstract">
-"An efficient and extensible format, library, and API for
- binary trajectory data from molecular simulations"</a>
-  and more information can be found at
-<a href="http://manual.gromacs.org/online/tng.html">http://manual.gromacs.org/online/tng.html</a>.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/trrplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/trrplugin.html
deleted file mode 100755
index f2a744e04d1ada117467d3edcb9aabb1e61290c5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/trrplugin.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--#set var="TITLE" value="TRR/XTC Plugin, Versions 0.9"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>These plugins read the portable binary trajectory file formats used by <a
-  href="http://www.gromacs.org/">GROMACS</a>. The xtc file format is explained
-  in detail at <a
-    href="http://www.gromacs.org/documentation/reference_3.1/online/xtc.html">http://www.gromacs.org/documentation/reference_3.1/online/xtc.html</a>,
-  and more information on the trr file format can be found at <a
-    href="http://www.gromacs.org/documentation/reference_3.1/online/trr.html">http://www.gromacs.org/documentation/reference_3.1/online/trr.html</a>.</p>
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>These plugins are used only to read files. VMD does not currently
-support writing these file types.</p>
-
-<p><b>Unused data</b>
-<br>Velocities, forces, and energies stored in the trajectory file are
-ignored by VMD.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/uhbdplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/uhbdplugin.html
deleted file mode 100755
index 9e705a0d3391f7305f375db01aeac94c5dd0a7fe..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/uhbdplugin.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!--#set var="TITLE" value="UHBD Plugin, Version 0.4"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin reads electrostatic potential maps stored in the UHBD format.
-
-
-<h3>Notes:</h3>
-
-<p><b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.</p>
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/vaspplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/vaspplugin.html
deleted file mode 100644
index d49b970a0df49afc774f35020afd680cfa1f158d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/vaspplugin.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!--#set var="TITLE" value="VASP Plugins, Version 0.6"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-<a href="http://www.uni-ulm.de/~ssakong/vmdplugins">VASP plugins</a>
-are developed to read 
-<a href="http://cms.mpi.univie.ac.at/vasp/">VASP input/output files</a>
-and display atomic/charge configurations/trajectories in VMD.
-
-<p>
-What can I do with VASP plugins?
-
-<p>
-If you are VASP user and tired to use converting scripts output data 
-to pdb and xyz format to visualize it, then VASP plugins for VMD 
-natively handles following file formats:
-<ul>
-<li>vasprun.xml/OUTCAR : Plot trajectory of each ionic steps.
-<li>POSCAR/CONTCAR : Display atomic configuration.
-<li>XDATCAR : Plot trajectory of each ionic step.
-<li>CHGCAR/LOCPOT/ELFCAR/PARCHG : Display isosurfaces of charge density 
-    and electron localization function (ELF).
-</ul>
-
-<p>
-For further information, visit Sung Sakong's 
-<a href="http://www.uni-ulm.de/~ssakong/vmdplugins">VASP plugin home page</a>
-
-<p>
-<h3>Known bugs</h3>
-<ul>
-<li>Occassionally OUTCAR read plugin has problems recognizing atom types.
-I am using atomic mass to recognize the type of atom, but POTCAR files 
-contain POMASS values which is somewhat different from widely used
-atomic mass. I cannot match each atom type between periodic_table.h
-and POTCARs. Thus, I set a margin of 0.01 for atomic mass recognition 
-routine. It works for most of atoms, however in several POTCARs the 
-margin is not sufficient.
-<li>I found that file structure of vasprun.xml is frequently changed. I am 
-not so sure whether xml read plugin will work with next version VASP, 
-or not.
-</ul>
-
-<p>
-<h3>Fixed bugs</h3>
-<ul>
-<li>Memory leak is fixed. Common data structure for VASP data is designed 
-    by Rob Lahaye. (June 29, 2006)
-<li>CHGCAR plugin reads spin polarized charge again. (May 18, 2006)
-<li>VMD can save the coordinates in POSCAR. (May 17, 2006)
-<li>Plugins for VMD 1.8.4 are ready. I thank Rob Lahaye <lahaye at skku.edu> 
-    for many debugging and good advices. (May 15, 2006)
-<li>CHGCAR plugin reads 3d-mesh properly. (April 27, 2006)
-</ul>
-
-<p>                                       
-<h3>Bug report</h3>
-Sung Sakong (sung.sakong at uni-ulm.de)
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/vtfplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/vtfplugin.html
deleted file mode 100755
index 37081a62ccc09c78199ba95f8ef7f9cf0a9c9d16..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/vtfplugin.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--#set var="TITLE" value="VTF Plugin, Version 1.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-The plugin reads files written in the VTF 
-trajectory/structure/coordinate format, which is described in 
-<a href="https://github.com/olenz/vtfplugin/wiki/VTF-format">more detail here</a>.
-
-The format was designed especially for VMD and is useful for hand-written 
-simulation codes and coarse-grained simulations. It is currently used by the 
-<a href="http://espressomd.org/">ESPResSo</a> coarse-grained
-simulation package.
-
-<h3>Notes:</h3>
-<p>
-<b>Read-only</b>
-<br>This plugin is used only to read files. VMD does not currently support
-writing this file type.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/webpdbplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/webpdbplugin.html
deleted file mode 100644
index 72eed6a72b27d670bf204764fb7d926ebab1f8c4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/webpdbplugin.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--#set var="TITLE" value="WebPDB Plugin, Version 1.15"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>This plugin automatically downloads PDB structures over the web,
-   and loads them into VMD.  Structures are specified by their 
-   four-letter PDB accession code.
-
-<p>This plugin depends on Tcl in order to run.  On MacOS X and
-   Windows this means that the plugin must be able to find the
-   dyanmic link libraries for Tcl by automatic means.
-
-<h3>Notes:</h3>
-<p><b>PDB Format</b>
-This plugin shares the same behavior and limitations with the
-standard <a href="pdbplugin.html">PDB Plugin</a>.
-
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xbgfplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xbgfplugin.html
deleted file mode 100755
index 01b8451c26ed53c43b08744a0eda75df2650fa18..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xbgfplugin.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!--#set var="TITLE" value="XBGF Plugin, Version 0.13"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-The "xbgf" plugin is a modified version of the biograf file format
-used by various structure building tools in VMD.  It doesn't exist as
-a format out in the wild, and the files are only intended to be used
-internally, between these structure building tools.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xsfplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xsfplugin.html
deleted file mode 100644
index c1334d05fdb855d7def212d4795eadffce82e742..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xsfplugin.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!--#set var="TITLE" value="XSF Plugin, Version 0.7"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads the regular and the animated form of XCrySDen structure
-files (.xsf and .axsf) as they are read and written by the 
-<a href="http://www.xcrysden.org/">XCrySDen</a> visualization 
-program and created by the <a href="http://www.quantum-espresso/">Quantum Espresso</a>
-(also known as <a href="http://www.pwscf.org/">PWScf</a>)
-package of plane wave DFT based electronic 
-structure and MD programs. The format allows storing of atomic
-data with or without periodicity in 1, 2, or 3 dimensions, variable
-cell size trajectories and multiple 2d, and 3d grid data set.
-See the extensive
-<a href="http://www.xcrysden.org/doc/XSF.html">format description</a>
-on the XCrySDen home page for more details.
-
-<h3>Notes:</h3>
-
-<p><b>Trajectories</b>
-<br>This plugin supports animation XSF files (axsf) even in 
-combination with grid data sets.  All timesteps, however 
-have to have the same number of atoms (VMD does not support this
-currently anyways). Also the elements have to always be in the same
-order, only the first timestep will be used to read the element names.
-From all successive timesteps only the coordinates will be read.
-
-<p><b>Coordinate Rotation / Periodic Display</b>
-<br>VMD currently can only display periodic images of the 
-unit cell correctly, if the first cell vector is collinear
-with the x-axis and the second cell vector in the xy-plane.
-Upon loading of the xsf file, the coordinates and the 
-grid vectors are rotated accordingly. Unfortunately, that
-may make the atomic positions incompatible to some other
-coordinate files containing matching coordinates, but no
-unit cell information.
-
-<p><b>Atom Masses</b>
-<br>The plugin assigns masses to the atoms according to the 
-natural isotope distribution of the elements (see e.g.
-<a href="http://www.webelements.com/">http://www.webelements.com/</a>).
-If an element could not been recognized, a mass of 0 is assigned.
-To set the mass for those elements or assign a different mass for
-the other atoms, you have to use to create a selection with
-<b>atomselect</b> and then use the selection subcommands to set
-the mass.
-
-<p><b>Conventional Cell Coordinates</b>
-<br>This plugin currently only reads the primitive unit
-cell vectors and coordinates. Data for the conventional
-cell will be ignored.
-
-<p><b>2D Data Grids</b>
-<br>VMD does not currently provide visualizations for 
-two-dimensional data grids or means to store them, so this
-plugin ignores those data sets.
-
-<p><b>Incompatibilities</b>
-<br>The plugin follows the description of the format on the XCrySDen
-homepage, but due to the differences between the parsers, files that may
-be readable without a problem in XCrySDen, will not read completely or
-correctly by this plugin. A few examples were already spotted 'in the
-wild' and the required amendmends to the plugins were made.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xyzplugin.html b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xyzplugin.html
deleted file mode 100755
index 3eb8f178285f10fc9e5196a9f2e4c173ba721873..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/doc/xyzplugin.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!--#set var="TITLE" value="XYZ Plugin, Version 1.3"-->
-<!--#include virtual="/Research/vmd/include/header-vmd.shtml"-->
-
-<p>
-This plugin reads and writes XYZ files, a minimalistic plain text format for
-storing molecular coordinates. The format basically follows the format,
-that was read and written by the old XMol program, but also tries to
-be as compatible as possible to other variations of the XYZ format.
-
-<p>
-A brief summary of the format, as read by VMD follows:
-<pre>
-    XYZ molecule file format:
-      XYZ files are a simple molecule file format suitable for output
-      by homegrown software since they are very minimalistic.  They don't
-      even include bonding information.
-  
-    [ # optional comment line ] comment line (can be blank)
-                                ^^^ NOTE: comment lines aren't supported by 
-                                    the current version of this plugin.
-    [ N                       ] # of atoms, required by this xyz reader plugin
-    [ molecule name           ] name of molecule (can be blank)
-    atom1 x y z [optional data] atom name followed by xyz coords
-    atom2 x y z [ ...         ] and and (optionally) other data.
-    ...                         instead of atom name the atom number in
-    atomN x y z [ ...         ] the PTE can be given.
-                        
-    Note that this plugin currently ignores everything following the z 
-    coordinate (the optional data fields).
-</pre>
-
-<h3>Notes:</h3>
-
-<p><b>Trajectories</b>
-<br>XYZ files can contain multiple timesteps. All timesteps, however 
-have to have the same number of atoms (VMD does not support this
-currently anyways). Also the elements have to always be in the same
-order, only the first timestep will be used to read the element names.
-From all successive timesteps only the coordinates will be read.
-</p>
-
-<p><b>Unused Data</b>
-<br>This plugin only reads the label and coordinates for each atom. Any
-additional data recorded for an atom is ignored.</p>
-
-<p><b>Atom Count</b>
-<br>VMD requires that the first non-comment line of the file contain the
-number of atoms.</p>
-
-<p><b>Ordinal Numbers</b>
-<br>Atoms in an XYZ file can be labeled with either the atom name or ordinal
-number.</p>
-
-<p><b>Atom Masses</b>
-<br>The plugin assigns masses to the atoms according to the 
-natural isotope distribution of the elements (see e.g.
-<a href="http://www.webelements.com/">http://www.webelements.com/</a>).
-If an element name could not been recognized, a mass of 0 is assigned.
-To set the mass for those elements or assign a different mass for
-the other atoms, you have to use to create a selection with
-<b>atomselect</b> and then use the selection subcommands to set
-the mass.
-
-<p><b>Incompatibilities</b>
-<br>XYZ file as they are produced by the <a href="http://dasher.wustl.edu/tinker/">Tinker</a> package are <b>not</b> compatible to this plugin. Also some other
-XYZ format versions, that are missing the atom count or the title line
-will not work. You have to either convert them to a different format,
-that is understood by VMD or add the missing information.
-
-<!--#include virtual="/Research/vmd/include/footer-vmd.shtml"-->
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Entries
deleted file mode 100644
index dc524ff1e227353031dd1ca2920de48385bc8554..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Entries
+++ /dev/null
@@ -1,5 +0,0 @@
-/Makefile/1.1/Fri Mar 10 22:48:47 2006//
-/README/1.1/Fri Mar 10 22:40:59 2006//
-/f77_molfile.c/1.1/Fri Mar 10 22:48:49 2006//
-/tester.f/1.1/Fri Mar 10 22:48:49 2006//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Repository
deleted file mode 100644
index c6a4f7e0afae2a6c1c40c571ea2b68b628ca01f3..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/f77
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/Makefile b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/Makefile
deleted file mode 100644
index 4162302e825ef4729e90b5d0df29e6d40fd031cc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-# hello emacs this is a -*- makefile -*-
-# $Id: Makefile,v 1.1 2006/03/10 22:48:47 johns Exp $
-########################################################################
-ARCH           = LINUX
-ARCHDIR        = ../../compile/lib_$(ARCH)/molfile
-#FC            = gfortran
-FC             = g77 #-fno-second-underscore
-CC             = gcc
-LD             = $(FC)
-OPT            = -O2 -Wall
-CPPFLAGS       = -I../../include -I$(ARCHDIR) -D_F77_F2C_UNDERSCORE
-CFLAGS         = -c $(CPPFLAGS) $(OPT)
-FFLAGS         = -c $(OPT)
-NETCDFLIB      = -L../../../vmd/lib/netcdf/lib_LINUX
-NETCDFLDFLAGS  = -lnetcdf
-TCLLIB         = -L../../../vmd/lib/tcl/lib_LINUX
-TCLLDFLAGS     = -ltcl8.4
-LDFLAGS        = -L$(ARCHDIR) $(TCLLIB) $(NETCDFLIB)
-LDLIBS         =  -lmolfile_plugin $(NETCDFLDFLAGS) $(TCLLDFLAGS) -lstdc++ -ldl
-########################################################################
-OBJECTS  = tester.o f77_molfile.o 
-
-default: tester
-
-tester: $(OBJECTS)
-	$(FC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
-
-clean:
-	rm -f tester $(OBJECTS)
-########################################################################
-# pattern rules
-.SUFFIXES:
-.SUFFIXES: .c .f .o
-
-.c.o:
-	$(CC) $(CFLAGS) $< -o $@
-
-.f.o:
-	$(FC) $(FFLAGS) $< -o $@
-
-# dependencies
-tester.o     : tester.f
-f77_molfile.o: f77_molfile.c
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/README b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/README
deleted file mode 100644
index 22847ba6a39755aefeed5df27a62c7873049620c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/README
+++ /dev/null
@@ -1,87 +0,0 @@
-
-Fortran bindings for the VMD molfile plugins. v0.01
-Quick and dirty instructions, feel free to improve.
-
-Copyright 2006 (c) Axel Kohlmeyer <akohlmey@cmm.chem.upenn.edu>
-
-
-1. Compilation/Configuration/Compatibility
-
-a) compile the molfile plugins in the usual way.
-b) edit the config section of the Makefile:
-   - set your architecure, c and fortran compiler
-   - set fortran name mangling via define in CPPFLAGS.
-     no define            : fortran names are lowercase and 
-                            one underscore appended
-     -D_F77_NO_UNDERSCORE : fortran names are lowercase and
-                            without underscore appended
-     -D_F77_F2C_UNDERSCORE: fortran names are lowercase and 
-                            follow f2c/g77 underscoring conventions
-   - currently only Sun string length conventions (i.e. the length
-     of the strings is added to the list of arguments after all
-     other arguments) are supported.
-c) type: make
-   this will compile the interface code and a test/example program,
-   which will combine the interface with the static molfile lib.
-   if it does not link, see b) 
-d) adapt and try the tester with your own files.
-e) tested platforms: 
-   - Linux 32-bit with gcc/g77/gfortran, VMD-1.8.4b12cvs.
-
-2.) Usage/API
-
-a) currently only reading coordinates and static plugins are
-   supported. more to come...
-
-b) usage:
-   - you have to initialize the plugins and the interface by:
-     call f77_molfile_init
-
-   - to open a file for reading do:
-     call f77_molfile_open_read(handle, natom, infile, intype)
-     'handle' is of type integer*4 and a file descriptor 
-     (i.e. like an i/o channel) that identifies this file 
-     and will be set by the subroutine and has to be used
-     for all consecutive operations on the same opened file.
-     note that this number is not connected in any way whatsorever
-     to a fortran i/o channel number.
-     'natom' is of type integer*4 and will contain the number
-     of atoms in the opened file on exit.
-     'infile' is of type character*(*) and contains the
-     name of the file to open.
-     'intype' is the file type. it can be any valid molfile
-     plugin name or 'auto' for automatic detection based on
-     the filename extension. first matching plugin wins.
-
-    - to read a set of coordinates do:
-     call f77_molfile_read_next(handle, natom, xyz, box, status);
-     'handle' is the handle from the call to f77_molfile_open().
-     'natom' is the number of atoms from the call to f77_molfile_open().
-     'xyx' is an array of type real*4 and will contain the 
-     coordinates in angstrom after the successful read. the coordinates 
-     are stored in the order x(1),y(1),z(1),x(2),y(2),z(2),...
-     so xyz(:) has to be at least of size 3*natom.
-     'box' is of type real*4(6) and contains the box dimensions 
-     as, a, b, c, alpha, beta, gamma with a,b,c in angstrom and 
-     alpha, beta, gamma in degrees.
-     'status' is of type integer*4 and if set to zero on enter
-     will instruct the reader to skip this frame.
-     on exit it will be set to zero if there was a problem or
-     to 1 on success.
-
-    - to close the file do:
-    call f77_molfile_close_read(handle)
-    this will clear the file descriptor for the corresponding 
-    open call and close the file.
-     
-
-3.) Implementation and Limitations
-   The current implementation does use static variables
-   and arrays to handle the list of plugins, and concurrent
-   open files. so the code is not meant to be thread safe. 
-   If you want to use more plugins and use more simultaneously
-   open files, you can add -DMAXPLUGINS=<your number> and/or
-   -DMAXHANDLES=<your number> to CPPFLAGS, make clean and recompile.
-   
-
-2006/02/16.
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/f77_molfile.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/f77_molfile.c
deleted file mode 100644
index 1bb6aee33f8e61628d32f88fa160be5f8813234f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/f77_molfile.c
+++ /dev/null
@@ -1,363 +0,0 @@
-
-/* 
- * molfile fortran interface
- * $Id: f77_molfile.c,v 1.1 2006/03/10 22:48:49 johns Exp $
- * (c) 2006 Axel Kohlmeyer <akohlmey@cmm.chem.upenn.edu>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "libmolfile_plugin.h"
-#include "vmdplugin.h"
-
-#define F77TESTME 1
-
-/* fortran name mangling */ 
-#if defined(_F77_NO_UNDERSCORE)
-#define FNAME(n) n
-#elif defined(_F77_F2C_UNDERSCORE)
-#define FNAME(n) n ## __
-#else
-#define FNAME(n) n ## _
-#endif
-
-/* interface typedef magic */
-typedef int int4;
-
-struct molfile_f77_handle 
-{
-    void  *handle;
-    const char *fname;
-    const char *ftype;
-    molfile_plugin_t *plugin;
-};
-typedef struct molfile_f77_handle f77_fd;
-
-/* plugin list */
-#ifndef MAXPLUGINS
-#define MAXPLUGINS 200
-#endif
-static int numplugins=0;
-static molfile_plugin_t *plugin_list[MAXPLUGINS];
-
-/* we maintain a static list of assigned handles */
-#ifndef MAXHADNLES
-#define MAXHANDLES 200
-#endif
-static int4 numhandles=0;
-static f77_fd handle_list[MAXHANDLES];
-
-/* helper functions */
-/* helper function to copy fortran style (a la sun fortran) strings into
- * valid c style strings. just using the string pointers will not work,
- * since the strings are NOT zero terminated.
- *
- * WARNING: do not forget to free(2) them later, 
- * or you'll have a memory leak!
- */
-static char *f77strdup(const char *s,const int sz)
-{
-    char *r;
-
-    r = (char *)malloc(sz + 1);
-    r = (char *)memcpy(r, s, sz);
-    r[sz] = '\0';
-    return r;
-}
-
-/* trim off whitespace at the end of a string */
-static void f77trim(char *s,const int sz)
-{
-    int i;
-
-    i=1;
-    while( (i++ < sz) && isspace(s[sz-i]) ) {
-        s[sz-i] ='\0';
-    }
-}
-
-/* get the filename extension */
-static const char *f77getfnext(const char *s)
-{
-    int i,len;
-
-    len = strlen(s);
-    for (i=len; i>=0; --i) {
-        if(s[i] == '.') {
-            return &s[i+1];
-        }
-    }
-    return NULL;
-}
-
-/* check validity of plugins and register them. */
-static int f77register(void *ptr, vmdplugin_t *plugin) {
-
-    if (!plugin->type || !plugin->name || !plugin->author) {
-        fprintf(stderr," skipping plugin with incomplete header\n");
-        return -1;
-    }
-
-#if F77TESTME    
-    fprintf(stderr, " trying to register plugin #%d: %s,  type:    %s/%d\n"
-            " written by: %s\n\n", numplugins+1, plugin->name, 
-            plugin->type, plugin->abiversion, plugin->author);
-#endif
-
-    if (plugin->abiversion != vmdplugin_ABIVERSION) {
-        fprintf(stderr, " skipping plugin with incompatible ABI:%d/%d\n",
-                plugin->abiversion, vmdplugin_ABIVERSION);
-        return -2;
-    }
-
-    if (0 != strncmp(plugin->type, "mol file", 8)) {
-        fprintf(stderr, " skipping plugin of incompatible type:%s\n",
-                plugin->type);
-        return -3;
-    }
-
-    if (numplugins < MAXPLUGINS) {
-        plugin_list[numplugins] = (molfile_plugin_t *) plugin;
-        ++numplugins;
-        return 0;
-    }
-    
-    fprintf(stderr, " too many plugins: %d. increase MAXPLUGINS, "
-            "recompile, and try again.\n", numplugins);
-    
-    return -4;
-}
-
-
-/* the official fortran API */
-
-/* register all available plugins and clear handles. */
-void FNAME(f77_molfile_init)(void) 
-{
-    int i;
-    
-    MOLFILE_INIT_ALL;
-
-    for (i=0; i<MAXHANDLES; ++i) {
-        handle_list[i].handle = NULL;
-    }
-
-    MOLFILE_REGISTER_ALL(NULL,f77register);
-
-    /* 
-     * FIXME: check all plugins and make 
-     * sure the babel plugin(s) are last.
-     */
-}
-
-/* unregister all available plugins */
-void FNAME(f77_molfile_finish)(void) 
-{
-#if 0
-    int i;
-
-    /* FIXME: add code to close and nullify all open handles */
-    for (i=0; i<MAXHANDLES; ++i) {
-        handle_list[i] = NULL;
-    }
-#endif
-
-    MOLFILE_FINI_ALL;
-}
-
-
-/* open a file and provide file descriptor */
-void FNAME(f77_molfile_open_read)(int4 *handle, int4 *natoms,
-                        const char *infile, const char *intype, 
-                        const int len_if, const int len_it)
-{
-    char *fname, *ftype;
-    molfile_plugin_t *plugin;
-    int i;
-    
-    if (numhandles >= MAXHANDLES) {
-        fprintf(stderr, "too many molfile f77 handles.\n");
-        *handle = -666;
-        return;
-    }
-
-    fname = f77strdup(infile, len_if);
-    f77trim(fname,len_if);
-    
-    ftype = f77strdup(intype, len_it);
-    f77trim(ftype,len_it);
-            
-    fprintf(stderr, " %s: trying for: %s/%d, %s/%d\n", 
-            __FUNCTION__, fname, len_if, ftype, len_it);
-
-    plugin = NULL;
-    /* determine plugin type automatically */
-    if(0 == strncmp(intype, "auto", 4)) {
-        const char *fext;
-        
-        fext = f77getfnext(fname);
-        if (fext == NULL) {
-            fprintf(stderr, " could not determine file name extension "
-                    "for automatic plugin guess\n");
-            *handle = -111;
-            return;
-        }
-#if F77TESTME
-        fprintf(stderr, " filename extension: %s\n", fext);
-#endif
-
-        for (i=0; (i<numplugins) && plugin==NULL; ++i) {
-#if F77TESTME
-            fprintf(stderr, " tying filename extension: %s\n",
-                    plugin_list[i]->filename_extension);
-#endif
-            if (0 == strcmp(plugin_list[i]->filename_extension, fext)) {
-                fprintf(stderr, " using plugin: %s\n", 
-                        plugin_list[i]->prettyname);
-                
-                plugin = plugin_list[i];
-            }
-        }
-        if (plugin == NULL) {
-            fprintf(stderr, " could not determine matching plugin type"
-                    "from file name extension\n");
-            *handle = -222;
-            return;
-        }
-    } else {
-        
-        for (i=0; (i<numplugins) && (plugin==NULL); ++i) {
-#if F77TESTME
-            fprintf(stderr, " tying plugin type: %s\n",
-                    plugin_list[i]->name);
-#endif
-            if (0 == strcmp(plugin_list[i]->name, ftype)) {
-                fprintf(stderr, " using plugin: %s\n", 
-                        plugin_list[i]->prettyname);
-                plugin = plugin_list[i];
-            }
-        }
-        if (plugin == NULL) {
-            fprintf(stderr, " could not find plugin for type %s\n",ftype);
-            *handle = -333;
-            return;
-        }
-    }
-    
-    if(plugin == NULL) { /* this should not happen, but... */
-        fprintf(stderr, " no plugin found.\n");
-        *handle = -444;
-        return;
-    }
-    
-    /* build handle */
-    ++numhandles;
-    for (i=0; i<numhandles; ++i) {
-        if(handle_list[i].plugin == NULL) {
-            *handle = i;
-            handle_list[i].fname=fname;
-            handle_list[i].ftype=plugin->name;
-            handle_list[i].plugin=plugin;
-        }
-    }
-
-    /* open file for reading and detect number of atoms */
-    *natoms=MOLFILE_NUMATOMS_UNKNOWN;
-    handle_list[*handle].handle= 
-        plugin->open_file_read(fname,plugin->name,natoms);
-    if(handle_list[*handle].handle == NULL) {
-        fprintf(stderr, " open of %s-plugin for file %s failed\n",
-                plugin->type, fname);
-        --numhandles;
-        handle_list[*handle].plugin=NULL;
-        *handle=-777;
-        return;
-    }
-    
-    return;
-}
-
-/* read next time step */
-void FNAME(f77_molfile_read_next)(int4 *handle, int4 *natoms, float *xyz, 
-                             float *box, int4 *status)
-{
-    molfile_plugin_t *plugin;
-    molfile_timestep_t step;
-    int retval;
-
-    /* do some sanity checks on the handle */
-    if((*handle < 0) || (*handle >= MAXHANDLES)) {
-        fprintf(stderr, " %s: illegal handle: %d\n",
-                __FUNCTION__, *handle);
-        *status = 0;
-        return;
-    }
-
-    plugin = handle_list[*handle].plugin;
-    if(plugin==NULL) {
-        fprintf(stderr, " %s: inactive handle: %d\n",
-                __FUNCTION__, *handle);
-        *status = 0;
-        return;
-    }
-
-    /* skip or read the timestep as demanded */
-    if(status == 0) {
-        retval = plugin->read_next_timestep(handle_list[*handle].handle,
-                                             *natoms, NULL);
-    } else {
-        step.coords = xyz;
-        retval = plugin->read_next_timestep(handle_list[*handle].handle,
-                                             *natoms, &step);
-    }
-
-    /* copy the box parameters */
-    if (retval == MOLFILE_SUCCESS) {
-        *status = 1;
-        box[0]=step.A;
-        box[1]=step.B;
-        box[2]=step.C;
-        box[3]=step.alpha;
-        box[4]=step.beta;
-        box[5]=step.gamma;
-    } else {
-        *status = 0;
-    }
-}
-            
-/* close a read file descriptor */
-void FNAME(f77_molfile_close_read)(int4 *handle)
-{
-    molfile_plugin_t *plugin;
-    
-    /* do some sanity checks on the handle */
-    if((*handle < 0) || (*handle >= MAXHANDLES)) {
-        fprintf(stderr, " %s: illegal handle: %d\n",
-                __FUNCTION__, *handle);
-        *handle = -111;
-        return;
-    }
-
-    plugin = handle_list[*handle].plugin;
-    if(plugin==NULL) {
-        fprintf(stderr, " %s: inactive handle: %d\n",
-                __FUNCTION__, *handle);
-        *handle = -222;
-        return;
-    }
-
-#if F77TESTME
-    fprintf(stderr, " %s: trying to close handle %d"
-            " for file %s\n", __FUNCTION__, *handle, 
-            handle_list[*handle].fname);
-#endif
-
-    plugin->close_file_read(handle_list[*handle].handle);
-    --numhandles;
-    handle_list[*handle].plugin=NULL;
-    *handle=-1;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/tester.f b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/tester.f
deleted file mode 100644
index 40e250bb80cc1ad0d8446dd5d37f2726679b5636..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/f77/tester.f
+++ /dev/null
@@ -1,110 +0,0 @@
-c     testing frontend for the molfile plugin fortran interface
-c     $Id: tester.f,v 1.1 2006/03/10 22:48:49 johns Exp $
-c     (c) 2006 Axel Kohlmeyer <akohlmey@cmm.chem.upenn.edu>
-
-      program molfile
-      implicit none
-
-      integer*4 natom, maxatom, handle(4), status
-      parameter (maxatom=3000*3)
-      real*4    xyz(maxatom), box(6)
-
-      character infile*200, intype*10
-      integer i,j
-
-      print*,'molfile fortran tester v0.01'
-
-C     set some default values
-      infile = 'TRAJEC.dcd'
-      intype = 'auto'
-      natom  = -1
-      handle(1) = -1
-      handle(2) = -1
-      handle(3) = -1
-      handle(4) = -1
-      
-      print*,'filename: ', infile
-      print*,'type:     ', intype
-
-C     set up everything and 
-C     register all static plugins
-      call f77_molfile_init
-
-      call f77_molfile_open_read(handle(1),natom,infile,intype)
-
-      if (handle(1).lt.0) then
-         print*,'file type unknown or not registered'
-      else
-         print*,'file successfully opened:'
-         print*,'handle:',handle(1)
-         print*,'natom: ',natom
-      end if
-
-      do i=1,2000
-         status = 1   ! status=1 on entry means read
-         call f77_molfile_read_next(handle(1),natom,xyz(1),box,status);
-         print*,'read ',i,'  status:',status
-         print*,'atom(1)', (xyz(j),j=1,3)
-         print*,'atom(10)',(xyz(j),j=31,33)
-         print*,'atom(100)',(xyz(j),j=301,303)
-         print*,'box',box
-         if(status.eq.0) go to 666
-         status = 0   ! status=0 on entry means skip
-         call f77_molfile_read_next(handle(1),natom,xyz,box,status);
-         print*,'read ',i,'  status:',status
-         if(status.eq.0) go to 666
-      end do
- 666  continue
-
-      infile='li-nh3_4-end.pdb'
-      intype='pdb'
-      call f77_molfile_open_read(handle(2),natom,infile,intype)
-
-      if (handle(2).lt.0) then
-         print*,'file type unknown or not registered'
-      else
-         print*,'file successfully opened:'
-         print*,'handle:',handle(2)
-         print*,'natom: ',natom
-      end if
-
-      do i=1,2000
-         status = 1   ! status=1 on entry means read
-         call f77_molfile_read_next(handle(2),natom,xyz(1),box,status);
-         print*,'read ',i,'  status:',status
-         if(status.eq.0) go to 6666
-         print*,'atom(1)',  (xyz(j),j=1,3)
-         print*,'atom(10)', (xyz(j),j=31,33)
-         print*,'atom(100)',(xyz(j),j=301,303)
-         print*,'box',box
-         status = 0   ! status=0 on entry means skip
-         call f77_molfile_read_next(handle(2),natom,xyz,box,status);
-         print*,'read ',i,'  status:',status
-         if(status.eq.0) go to 6666
-      end do
- 6666 continue
-      call f77_molfile_open_read(handle(3),natom,infile,intype)
-      print*,'handle:',handle(3)
-
-      call f77_molfile_close_read(handle(1),status)
-      print*,'handle:',handle(1)
-      call f77_molfile_open_read(handle(1),natom,infile,intype)
-      print*,'handle:',handle(1)
-      call f77_molfile_open_read(handle(4),natom,infile,intype)
-      print*,'handle:',handle(4)
-
-
-      call f77_molfile_close_read(handle(2),status)
-      print*,'handle:',handle(2)
-      call f77_molfile_close_read(handle(1),status)
-      print*,'handle:',handle(1)
-      call f77_molfile_close_read(handle(3),status)
-      print*,'handle:',handle(3)
-      call f77_molfile_close_read(handle(2),status)
-      print*,'handle:',handle(2)
-      call f77_molfile_close_read(handle(4),status)
-      print*,'handle:',handle(4)
-
-      call f77_molfile_finish
-
-      end
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Entries
deleted file mode 100644
index c5313a23dcd400388b3b06083fa87f3bd22ad110..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Entries
+++ /dev/null
@@ -1,9 +0,0 @@
-/babelplugin.dsp/1.1/Thu Jan 10 06:58:25 2002//
-/dcdplugin.dsp/1.1/Thu Jan 10 06:58:25 2002//
-/gromacsplugin.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/pdbplugin.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/psfplugin.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/template.dsp/1.1/Thu Jan 10 06:58:26 2002//
-/vc60.idb/1.1/Thu Jan 10 06:58:27 2002//
-/vc60.pdb/1.1/Thu Jan 10 06:58:27 2002//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Repository
deleted file mode 100644
index c04963fb0bc3dc941e407375a2968f3b74a94e9f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/msvc
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/babelplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/babelplugin.dsp
deleted file mode 100755
index 71aaa1b22289a90f9e53d1eb76ff944f606e3cb5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/babelplugin.dsp
+++ /dev/null
@@ -1,131 +0,0 @@
-# Microsoft Developer Studio Project File - Name="babelplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=babelplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "babelplugin.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "babelplugin.mak" CFG="babelplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "babelplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "babelplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "babelplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "babelplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "babelplugin - Win32 Release"
-# Name "babelplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\babelplugin.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\vmddir.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\vmddir.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/dcdplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/dcdplugin.dsp
deleted file mode 100755
index f91ef31f67a8a7c7a0cefd128cb9421ebb5bd99c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/dcdplugin.dsp
+++ /dev/null
@@ -1,123 +0,0 @@
-# Microsoft Developer Studio Project File - Name="dcdplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=dcdplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="dcdplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "dcdplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "dcdplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "dcdplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "dcdplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /dcdtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /dcdtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "dcdplugin - Win32 Release"
-# Name "dcdplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readdcd.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\dcdplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readdcd.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/gromacsplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/gromacsplugin.dsp
deleted file mode 100755
index 0b458452f0e7357f3b0c86724ddf72a8186e3826..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/gromacsplugin.dsp
+++ /dev/null
@@ -1,124 +0,0 @@
-# Microsoft Developer Studio Project File - Name="gromacsplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=gromacsplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "gromacsplugin.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "gromacsplugin.mak" CFG="gromacsplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "gromacsplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "gromacsplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "gromacsplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "gromacsplugin___Win32_Release"
-# PROP BASE Intermediate_Dir "gromacsplugin___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GROMACSPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /TP /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "gromacsplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "gromacsplugin___Win32_Debug"
-# PROP BASE Intermediate_Dir "gromacsplugin___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GROMACSPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GROMACSPLUGIN_EXPORTS" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "gromacsplugin - Win32 Release"
-# Name "gromacsplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\Gromacs.C
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\gromacsplugin.C
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\Gromacs.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/pdbplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/pdbplugin.dsp
deleted file mode 100755
index 0c235e8a5548a6822ae42f0bc70597da0db0c5f8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/pdbplugin.dsp
+++ /dev/null
@@ -1,123 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pdbplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=pdbplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="pdbplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "pdbplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pdbplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "pdbplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "pdbplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "pdbplugin - Win32 Release"
-# Name "pdbplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\pdbplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\readpdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/psfplugin.dsp b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/psfplugin.dsp
deleted file mode 100755
index 8bf1c51d18499146f5521d453f8b82d3d9b34818..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/psfplugin.dsp
+++ /dev/null
@@ -1,115 +0,0 @@
-# Microsoft Developer Studio Project File - Name="psfplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=psfplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="psfplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "psfplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "psfplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "psfplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "psfplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "psfplugin - Win32 Release"
-# Name "psfplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\psfplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/template.dsp b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/template.dsp
deleted file mode 100755
index 8b27cd83580573d9c3468f4bf083f26014cc1121..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/template.dsp
+++ /dev/null
@@ -1,115 +0,0 @@
-# Microsoft Developer Studio Project File - Name="templateplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=templateplugin - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "template.mak" CFG="templateplugin - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "templateplugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "templateplugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "templateplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VMDPLUGIN_EXPORTS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF  "$(CFG)" == "templateplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSFPLUGIN_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "templateplugin - Win32 Release"
-# Name "templateplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\plugins\molfile_plugin\src\templateplugin.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\plugins\include\molfile_plugin.h
-# End Source File
-# Begin Source File
-
-SOURCE=\plugins\include\vmdplugin.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/vc60.idb b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/vc60.idb
deleted file mode 100755
index 5952223b9b20b79ff753677f66be2526154cc64c..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/vc60.idb and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/vc60.pdb b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/vc60.pdb
deleted file mode 100755
index 3e0e8fe2d8eeedbee4b45a98a55bbba2d82ee556..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/msvc/vc60.pdb and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/.#dlpolyplugin.c.1.21 b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/.#dlpolyplugin.c.1.21
deleted file mode 100644
index b4cb83670d1735a641e81bddd7dae551cc501837..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/.#dlpolyplugin.c.1.21
+++ /dev/null
@@ -1,505 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2009 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dlpolyplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.21 $       $Date: 2009/04/29 15:45:29 $
- *
- ***************************************************************************/
-
-/*
- * DLPOLY formatted history file format:
- *   http://www.cse.clrc.ac.uk/msi/software/DL_POLY/MANUALS/USRMAN3/node141.html
- *   http://hidra.iqfr.csic.es/man/dlpoly/USRMAN/node156.html
- *
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-typedef struct {
-  FILE *file;
-  int dlpolyversion;
-  int numatoms;
-  int cellwarnflag;
-} dlpolydata;
- 
-
-static void *open_dlpoly_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  dlpolydata *data;
-  char fbuffer[4096], buf[4096];
-  int dlpolyversion, scancount, nstep, keytrj, atomcount;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-
-  if (NULL == fgets(fbuffer, 1024, fd))  
-    return NULL;
-
-  if (!strcmp(filetype, "dlpolyhist")) {
-    dlpolyversion=2;
-  } else if (!strcmp(filetype, "dlpoly3hist")) {
-    dlpolyversion=3;
-  } else {
-    dlpolyversion=2;
-  }
- 
-  /* check to see if the first line is a "timestep" record */ 
-  scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, natoms);
-  if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, natoms);
-    if (scancount != 3) {
-      printf("open_dlpoly_read) unrecognized header record\n");
-      return NULL;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, &atomcount);
-    if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-      printf("open_dlpoly_read) unrecognized timestep record\n");
-      return NULL;
-    }
-
-    if (atomcount != *natoms) {
-      printf("open_dlpoly_read) mismatched atom count\n");
-      return NULL;
-    }
-  }
- 
-  data = (dlpolydata *) malloc(sizeof(dlpolydata));
-  memset(data, 0, sizeof(dlpolydata));
-  data->file = fd;
-  data->numatoms= *natoms;
-  data->cellwarnflag = 0;
-  data->dlpolyversion = dlpolyversion;
-
-  rewind(data->file); /* prepare for first read_timestep call */
-  return data;
-}
-
-
-static int read_dlpoly_structure(void *mydata, int *optflags,
-                              molfile_atom_t *atoms) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge;
-  dlpolydata *data = (dlpolydata *)mydata;
- 
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  /* check to see if the first line is a "timestep" record */
-  scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                     &nstep, &atomcount, &keytrj, &imcon, &tstep);
-  if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-    if (scancount != 3) {
-      printf("dlpoly structure) unrecognized header record\n");
-      return MOLFILE_ERROR;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                       &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-    if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-      printf("dlpoly structure) unrecognized timestep record\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check atom count */
-    if (atomcount != atomcount2) {
-      printf("dlpoly structure) header/timestep mismatched atom count\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* check atom count */
-  if (atomcount != data->numatoms) {
-    printf("dlpoly structure) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    /* eat the data but don't use it for anything */
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms + i;
-
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly structure v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly structure v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly structure) failed reading atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly structure) failed reading atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    strncpy(atom->name, buf, sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_dlpoly_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge, elapsedps;
-  dlpolydata *data = (dlpolydata *)mydata;
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  switch (data->dlpolyversion) {
-    case 3:
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount, &keytrj, &imcon, &tstep, &elapsedps);
-      if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v3) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount2, &keytrj, &imcon, &tstep, &elapsedps);
-        if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v3) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v3) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-
-    case 2:
-    default: 
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                         &nstep, &atomcount, &keytrj, &imcon, &tstep);
-      if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v2) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                           &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-        if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v2) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v2) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-  }
-
-  /* check atom count */
-  if (atomcount != natoms) {
-    printf("dlpoly timestep) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check and copy in periodic cell info */
-    if (ts != NULL) {
-      if (xaxis[1] != 0.0 || xaxis[2] != 0.0 || 
-          yaxis[0] != 0.0 || yaxis[2] != 0.0 || 
-          zaxis[0] != 0.0 || zaxis[1] != 0.0) {
-        if (data->cellwarnflag != 1)
-          printf("dlpoly timestep) non-orthogonal DLPOLY periodic cell data unsupported\n");
-        data->cellwarnflag = 1;
-      } else {
-        ts->A = xaxis[0];
-        ts->B = yaxis[1];
-        ts->C = zaxis[2];
-        if (data->cellwarnflag != 2)
-          printf("dlpoly timestep) converting DLPOLY periodic cell data\n");
-        data->cellwarnflag = 2;
-      }
-    }
-  }
-
-  /* read all per-atom data */
-  for (i=0; i<natoms; i++) {
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly timestep v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly timestep v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly timestep) failed parsing atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly timestep) failed parsing atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    if (ts != NULL) { 
-      if (atomid > 0 && atomid <= natoms) {
-        int addr = 3 * (atomid - 1);
-        ts->coords[addr    ] = x;
-        ts->coords[addr + 1] = y;
-        ts->coords[addr + 2] = z;
-      } else {
-        fprintf(stderr, "dlpoly timestep) ignoring illegal atom index %d\n", atomid);
-      }
-    } 
-  }
-
-  /* eat remaining spaces and LF character */
-  fgets(fbuffer, 1024, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_dlpoly_read(void *mydata) {
-  dlpolydata *data = (dlpolydata *)mydata;
-  fclose(data->file);
-  free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t dlpoly2plugin;
-static molfile_plugin_t dlpoly3plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&dlpoly2plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly2plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly2plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly2plugin.name = "dlpolyhist";
-  dlpoly2plugin.prettyname = "DLPOLY V2 History";
-  dlpoly2plugin.author = "John Stone";
-  dlpoly2plugin.majorv = 0;
-  dlpoly2plugin.minorv = 8;
-  dlpoly2plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly2plugin.filename_extension = "dlpolyhist";
-  dlpoly2plugin.open_file_read = open_dlpoly_read;
-  dlpoly2plugin.read_structure = read_dlpoly_structure;
-  dlpoly2plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly2plugin.close_file_read = close_dlpoly_read;
-
-  memset(&dlpoly3plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly3plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly3plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly3plugin.name = "dlpoly3hist";
-  dlpoly3plugin.prettyname = "DLPOLY V3 History";
-  dlpoly3plugin.author = "John Stone";
-  dlpoly3plugin.majorv = 0;
-  dlpoly3plugin.minorv = 8;
-  dlpoly3plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly3plugin.filename_extension = "dlpolyhist";
-  dlpoly3plugin.open_file_read = open_dlpoly_read;
-  dlpoly3plugin.read_structure = read_dlpoly_structure;
-  dlpoly3plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly3plugin.close_file_read = close_dlpoly_read;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&dlpoly2plugin);
-  (*cb)(v, (vmdplugin_t *)&dlpoly3plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_dlpoly_read(*argv, "dlpoly", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_dlpoly_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_dlpoly_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_dlpoly_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_dlpoly_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/.main.c.swp b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/.main.c.swp
deleted file mode 100644
index 0018b9cb4534222f0f4ea2f1cf96ac8736c91c58..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/.main.c.swp and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Entries b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Entries
deleted file mode 100644
index 02948dda28f5e9eac237f98a967715279e57ad3c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Entries
+++ /dev/null
@@ -1,97 +0,0 @@
-/dmsplugin.cxx/1.2/Wed Nov 30 19:33:50 2011//
-/maeffplugin.cxx/1.28/Sun Nov  6 17:49:24 2016//
-/dtrplugin.hxx/1.5/Sun Nov  6 19:16:52 2016//
-/dtrplugin.cxx/1.26/Sun Nov  6 19:25:35 2016//
-/pdbxplugin.C/1.17/Mon Nov 28 05:01:22 2016//
-/Gromacs.h/1.34/Mon Nov 28 05:01:53 2016//
-/avsplugin.C/1.23/Mon Nov 28 05:01:53 2016//
-/babelplugin.c/1.49/Mon Nov 28 05:01:53 2016//
-/basissetplugin.c/1.14/Mon Nov 28 05:01:53 2016//
-/bgfplugin.C/1.29/Mon Nov 28 05:01:53 2016//
-/binposplugin.c/1.12/Mon Nov 28 05:01:53 2016//
-/biomoccaplugin.C/1.6/Mon Nov 28 05:01:53 2016//
-/brixplugin.C/1.20/Mon Nov 28 05:01:53 2016//
-/carplugin.c/1.18/Mon Nov 28 05:01:53 2016//
-/ccp4plugin.C/1.38/Mon Nov 28 05:01:53 2016//
-/corplugin.c/1.33/Mon Nov 28 05:01:53 2016//
-/cpmdlogplugin.c/1.17/Mon Nov 28 05:00:25 2016//
-/cpmdplugin.c/1.15/Mon Nov 28 05:01:53 2016//
-/crdplugin.c/1.40/Mon Nov 28 05:01:53 2016//
-/cubeplugin.C/1.32/Mon Nov 28 05:01:53 2016//
-/dcdplugin.c/1.79/Mon Nov 28 05:01:53 2016//
-/dlpolyplugin.c/1.24/Mon Nov 28 05:01:53 2016//
-/dsn6plugin.C/1.25/Mon Nov 28 05:01:53 2016//
-/dxplugin.C/1.43/Mon Nov 28 05:01:53 2016//
-/edmplugin.C/1.34/Mon Nov 28 05:01:53 2016//
-/endianswap.h/1.7/Mon Nov 28 05:01:53 2016//
-/fastio.h/1.34/Mon Nov 28 05:01:53 2016//
-/fortread.h/1.10/Mon Nov 28 05:01:54 2016//
-/fs4plugin.C/1.23/Mon Nov 28 05:01:54 2016//
-/gamessplugin.c/1.211/Mon Nov 28 05:01:54 2016//
-/gaussianplugin.c/1.21/Mon Nov 28 05:00:26 2016//
-/gaussianplugin.h/1.10/Mon Nov 28 05:01:54 2016//
-/graspplugin.C/1.23/Mon Nov 28 05:01:54 2016//
-/grdplugin.C/1.17/Mon Nov 28 05:01:54 2016//
-/gridplugin.C/1.15/Mon Nov 28 05:01:54 2016//
-/gromacsplugin.C/1.52/Mon Nov 28 05:01:54 2016//
-/hash.c/1.7/Mon Nov 28 05:01:54 2016//
-/hash.h/1.9/Mon Nov 28 05:01:54 2016//
-/inthash.c/1.3/Mon Nov 28 05:01:54 2016//
-/inthash.h/1.4/Mon Nov 28 05:01:54 2016//
-/lammpsplugin.c/1.49/Mon Nov 28 05:01:54 2016//
-/largefiles.h/1.4/Mon Nov 28 05:01:54 2016//
-/main.c/1.16/Mon Nov 28 05:01:54 2016//
-/mapplugin.C/1.15/Mon Nov 28 05:01:54 2016//
-/mdfplugin.C/1.21/Mon Nov 28 05:01:54 2016//
-/mmcif.C/1.7/Mon Nov 28 05:01:54 2016//
-/mol2plugin.C/1.38/Mon Nov 28 05:01:54 2016//
-/moldenplugin.c/1.40/Mon Nov 28 05:01:54 2016//
-/molemeshplugin.C/1.3/Mon Nov 28 05:01:54 2016//
-/msmsplugin.C/1.13/Mon Nov 28 05:01:54 2016//
-/namdbinplugin.c/1.23/Mon Nov 28 05:01:54 2016//
-/netcdfplugin.c/1.29/Mon Nov 28 05:01:54 2016//
-/parm7plugin.C/1.34/Mon Nov 28 05:01:54 2016//
-/parmplugin.C/1.35/Mon Nov 28 05:01:54 2016//
-/pbeqplugin.C/1.7/Mon Nov 28 05:01:54 2016//
-/pdbplugin.c/1.73/Mon Nov 28 05:01:54 2016//
-/phiplugin.C/1.28/Mon Nov 28 05:01:54 2016//
-/pltplugin.C/1.14/Mon Nov 28 05:01:54 2016//
-/plyplugin.C/1.8/Mon Nov 28 05:01:54 2016//
-/pqrplugin.c/1.21/Mon Nov 28 05:01:54 2016//
-/psfplugin.c/1.83/Mon Nov 28 05:01:54 2016//
-/qmplugin.h/1.23/Mon Nov 28 05:01:54 2016//
-/raster3dplugin.C/1.18/Mon Nov 28 05:00:28 2016//
-/readpdb.h/1.43/Mon Nov 28 05:01:54 2016//
-/rst7plugin.c/1.20/Mon Nov 28 05:01:54 2016//
-/situsplugin.C/1.16/Mon Nov 28 05:01:54 2016//
-/spiderplugin.C/1.17/Mon Nov 28 05:01:54 2016//
-/stlplugin.C/1.16/Mon Nov 28 05:01:54 2016//
-/tinkerplugin.c/1.14/Mon Nov 28 05:01:54 2016//
-/uhbdplugin.C/1.14/Mon Nov 28 05:01:54 2016//
-/vmddir.h/1.12/Mon Nov 28 05:01:54 2016//
-/webpdbplugin.c/1.54/Mon Nov 28 05:01:55 2016//
-/xbgfplugin.C/1.34/Mon Nov 28 05:01:55 2016//
-/xyzplugin.c/1.37/Mon Nov 28 05:01:55 2016//
-/ReadPARM.h/1.15/Mon Nov 28 05:00:28 2016//
-/ReadPARM7.h/1.32/Mon Nov 28 05:00:28 2016//
-/abinitplugin.c/1.2/Mon Nov 28 05:00:25 2016//
-/hoomdplugin.c/1.16/Mon Nov 28 05:00:26 2016//
-/offplugin.C/1.7/Mon Nov 28 05:00:27 2016//
-/periodic_table.h/1.12/Mon Nov 28 05:00:27 2016//
-/ply.c/1.1/Mon Nov 28 05:00:27 2016//
-/ply.h/1.1/Mon Nov 28 05:00:28 2016//
-/tngplugin.C/1.7/Mon Nov 28 05:00:28 2016//
-/unit_conversion.h/1.3/Mon Nov 28 05:00:28 2016//
-/vasp5xdatcarplugin.c/1.3/Mon Nov 28 05:00:28 2016//
-/vaspchgcarplugin.c/1.13/Mon Nov 28 05:00:28 2016//
-/vaspoutcarplugin.c/1.9/Mon Nov 28 05:00:28 2016//
-/vaspparchgplugin.c/1.2/Mon Nov 28 05:00:28 2016//
-/vaspplugin.h/1.5/Mon Nov 28 05:00:28 2016//
-/vaspposcarplugin.c/1.9/Mon Nov 28 05:00:28 2016//
-/vaspxdatcarplugin.c/1.10/Mon Nov 28 05:00:28 2016//
-/vaspxmlplugin.c/1.9/Mon Nov 28 05:00:28 2016//
-/vtfplugin.c/1.18/Mon Nov 28 05:00:29 2016//
-/vtkplugin.C/1.5/Mon Nov 28 05:00:29 2016//
-/xsfplugin.C/1.20/Mon Nov 28 05:00:29 2016//
-/jsplugin.c/1.77/Wed Nov 30 23:28:53 2016//
-D
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Repository b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Repository
deleted file mode 100644
index 28a8325a6d5f8c345694cb97b2ef7df2112de6de..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-plugins/molfile_plugin/src
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Root b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Root
deleted file mode 100644
index 9e4365d61b2f14e506846d7196a01f3822ffe8d9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-/home/cvs/vmd/cvsroot
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/mmCIF.C,t b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/CVS/mmCIF.C,t
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/Gromacs.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/Gromacs.h
deleted file mode 100644
index d2d790adf1008fc3fdecd8fce0f0296ca74f0da7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/Gromacs.h
+++ /dev/null
@@ -1,1967 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *      $RCSfile: Gromacs.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:53 $
- ***************************************************************************/
-
-/*
- * GROMACS file format reader for VMD
- *
- * This code provides a high level I/O library for reading
- * and writing the following file formats:
- *	gro	GROMACS format or trajectory
- *	g96	GROMOS-96 format or trajectory
- *	trj	Trajectory - x, v and f (binary, full precision)
- *	trr	Trajectory - x, v and f (binary, full precision, portable)
- *	xtc	Trajectory - x only (compressed, portable, any precision)
- *      top
- * Currently supported: gro trj trr g96 [xtc]
- *
- * TODO list
- *   o  velocities are ignored because VMD doesn't use them, but some other 
- *      program might ...
- *   o  gro_rec() assumes positions in .gro files are nanometers and
- *      converts to angstroms, whereas they really could be any unit
- */
-
-#ifndef GROMACS_H
-#define GROMACS_H
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "endianswap.h"
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-// Error codes for mdio_errno
-#define MDIO_SUCCESS		0
-#define MDIO_BADFORMAT		1
-#define MDIO_EOF		2
-#define MDIO_BADPARAMS		3
-#define MDIO_IOERROR		4
-#define MDIO_BADPRECISION	5
-#define MDIO_BADMALLOC		6
-#define MDIO_CANTOPEN		7
-#define MDIO_BADEXTENSION	8
-#define MDIO_UNKNOWNFMT		9
-#define MDIO_CANTCLOSE		10
-#define MDIO_WRONGFORMAT	11
-#define MDIO_SIZEERROR		12
-#define MDIO_UNKNOWNERROR	1000
-
-#define MDIO_READ	0
-#define MDIO_WRITE	1
-
-#define MDIO_MAX_ERRVAL		11
-
-// Format extensions
-const char *mdio_fmtexts[] = {
-    "",
-    ".gro",
-    ".trr",
-    ".g96",
-    ".trj",
-    ".xtc",
-    NULL
-};
-
-
-static int mdio_errcode;	// Last error code
-
-#define TRX_MAGIC	1993	// Magic number for .trX files
-#define XTC_MAGIC	1995	// Magic number for .xtc files
-#define MAX_GRO_LINE	500	// Maximum line length of .gro files
-#define MAX_G96_LINE	500	// Maximum line length of .g96 files
-#define MAX_TRX_TITLE	80	// Maximum length of a title in .trX
-#define MAX_MDIO_TITLE	80	// Maximum supported title length
-#define ANGS_PER_NM	10	// Unit conversion factor
-#define ANGS2_PER_NM2	100	// Unit conversion factor
-
-
-// All the supported file types and their respective extensions
-#define MDFMT_GRO		1
-#define MDFMT_TRR		2
-#define MDFMT_G96		3
-#define MDFMT_TRJ		4
-#define MDFMT_XTC		5
-
-
-// A structure to hold .trX file format header information. This
-// is an optional member of the md_file structure that is used
-// when .trX files are being dealt with.
-typedef struct {
-	int version;		// File version number
-	char title[MAX_TRX_TITLE + 1];	// File title
-	int ir_size;
-	int e_size;
-	int box_size;
-	int vir_size;
-	int pres_size;
-	int top_size;
-	int sym_size;
-	int x_size;		// Positions of atoms
-	int v_size;		// Velocities of atoms
-	int f_size;
-	int natoms;		// Number of atoms in the system
-	int step;
-	int nre;
-	float t;
-	float lambda;
-} trx_hdr;
-
-
-// A generic i/o structure that contains information about the
-// file itself and the input/output state
-typedef struct {
-	FILE *	f;	// Pointer to the file
-	int	fmt;	// The file format
-	int	prec;	// Real number precision
-	int	rev;	// Reverse endiannism?
-	trx_hdr * trx;	// Trx files require a great deal more
-			// header data to be stored.
-} md_file;
-
-
-// A format-independent structure to hold header data from files
-typedef struct {
-	char title[MAX_MDIO_TITLE + 1];
-	int natoms;
-	float timeval;
-} md_header;
-
-
-// A format-independent structure to hold unit cell data
-typedef struct {
-  float A, B, C, alpha, beta, gamma;
-} md_box;
-
-
-// Timestep information
-typedef struct {
-	float *pos;	// Position array (3 * natoms)
-	//float *vel;	// Velocity array ** (VMD doesn't use this) **
-	//float *f;	// Force array ** (VMD doesn't use this) **
-	//float *box;	// Computational box ** (VMD doesn't use this) **
-	int natoms;	// Number of atoms
-	int step;	// Simulation step
-	float time;	// Time of simulation
-  md_box *box;
-} md_ts;
-
-
-// Atom information
-typedef struct {
-	char resid[7];		// Residue index number
-	char resname[7];	// Residue name
-	int atomnum;		// Atom index number
-	char atomname[7];	// Atom name
-	float pos[3];		// Position array (3 * natoms)
-	//float vel[3];	// Velocity array ** (VMD doesn't use this) **
-} md_atom;
-
-
-// Open a molecular dynamics file. The second parameter specifies
-// the format of the file. If it is zero, the format is determined
-// from the file extension. the third argument (if given) decides
-// whether to read (==0) or to write (!= 0).
-// using a default argument set to read for backward compatibility.
-static md_file *mdio_open(const char *, const int, const int=MDIO_READ);
-
-// Closes a molecular dynamics file.
-static int mdio_close(md_file *);
-
-
-// Format-independent file I/O routines
-static int mdio_header(md_file *, md_header *);
-static int mdio_timestep(md_file *, md_ts *);
-
-
-// .gro file functions
-static int gro_header(md_file *, char *, int, float *, int *, int = 1);
-static int gro_rec(md_file *, md_atom *);
-static int gro_timestep(md_file *, md_ts *);
-
-
-// .trX file functions
-static int trx_header(md_file *, int = 0);
-static int trx_int(md_file *, int *);
-static int trx_real(md_file *, float *);
-
-static int trx_rvector(md_file *, float *);
-static int trx_string(md_file *, char *, int);
-static int trx_timestep(md_file *, md_ts *);
-
-// .g96 file functions
-static int g96_header(md_file *, char *, int, float *);
-static int g96_timestep(md_file *, md_ts *);
-static int g96_rec(md_file *, md_atom *);
-static int g96_countatoms(md_file *);
-
-
-// .xtc file functions
-static int xtc_int(md_file *, int *);
-static int xtc_float(md_file *, float *);
-/* 
-static int xtc_receivebits(int *, int);
-static void xtc_receiveints(int *, int, int, const unsigned *, int *);
-*/
-static int xtc_timestep(md_file *, md_ts *);
-static int xtc_3dfcoord(md_file *, float *, int *, float *);
-
-
-// Error reporting functions
-static int mdio_errno(void);
-static const char *mdio_errmsg(int);
-static int mdio_seterror(int);
-
-
-// Miscellaneous functions
-static int strip_white(char *);
-static int mdio_readline(md_file *, char *, int, int = 1);
-static int mdio_tsfree(md_ts *, int = 0);
-static int mdio_readbox(md_box *, float *, float *, float *);
-
-
-
-static int xtc_receivebits(int *, int);
-
-// Error descriptions for mdio_errno
-static const char *mdio_errdescs[] = {
-	"no error",
-	"file does not match format",
-	"unexpected end-of-file reached",
-	"function called with bad parameters",
-	"file i/o error",
-	"unsupported precision",
-	"out of memory",
-	"cannot open file",
-	"bad file extension",
-	"unknown file format",
-	"cannot close file",
-	"wrong file format for this function",
-	"binary i/o error: sizeof(int) != 4",
-	NULL
-};
-
-/*! \fn static inline bool host_is_little_endian(void)
- * detect endiannes of host machine. returns true on little endian machines. */
-static inline int host_is_little_endian(void) 
-{
-  const union { unsigned char c[4]; unsigned int i; } 
-  fixed = { { 0x10 , 0x20 , 0x40 , 0x80 } };
-  const unsigned int i = 0x80402010U;
-        
-  if (fixed.i == i) {
-    return 1;
-  }
-  return 0;
-}
-
-
-
-// Open a molecular dynamics file. The second parameter specifies
-// the format of the file. If it is zero, the format is determined
-// from the file extension.
-md_file *mdio_open(const char *fn, const int fmt, const int rw) {
-	md_file *mf;
-
-	if (!fn) {
-		mdio_seterror(MDIO_BADPARAMS);
-		return NULL;
-	}
-
-	// Allocate memory
-	mf = (md_file *) malloc(sizeof(md_file));
-	if (!mf) {
-		mdio_seterror(MDIO_BADMALLOC);
-		return NULL;
-	}
-
-	// Zero out the structure
-	memset(mf, 0, sizeof(md_file));
-
-	// Determine the file type from the extension
-	if (!fmt) {
-		char *p;
-		int n;
-
-		// Seek to the extension part of the filename
-		for (p = (char *) &fn[strlen(fn) - 1]; *p != '.' && p > fn; p--);
-		if (p == fn) {
-			free(mf);
-			mdio_seterror(MDIO_BADEXTENSION);
-			return NULL;
-		}
-
-		// Check the extension against known extensions
-		for (n = 1; mdio_fmtexts[n]; n++)
-			if (!strcasecmp(p, mdio_fmtexts[n])) break;
-
-		// If !mdio_fmtexts[n], we failed (unknown ext)
-		if (!mdio_fmtexts[n]) {
-			free(mf);
-			mdio_seterror(MDIO_UNKNOWNFMT);
-			return NULL;
-		}
-
-		// All set
-		mf->fmt = n;
-	}
-	else {
-		mf->fmt = fmt;
-	}
-
-	// Differentiate between binary and ascii files. Also,
-	// .trX files need a header information structure allocated.
-	switch (mf->fmt) {
-    case MDFMT_GRO:
-	case MDFMT_G96: /* fallthrough */
-        if (rw) 
-            mf->f = fopen(fn, "wt");
-        else
-            mf->f = fopen(fn, "rt");
-
-		break;
-	case MDFMT_TRR:
-	case MDFMT_TRJ: /* fallthrough */
-		// Allocate the trx header data struct
-		mf->trx = (trx_hdr *) malloc(sizeof(trx_hdr));
-		if (!mf->trx) {
-			free(mf);
-			mdio_seterror(MDIO_BADMALLOC);
-			return NULL;
-		}
-		memset(mf->trx, 0, sizeof(trx_hdr));
-	case MDFMT_XTC:  /* fallthrough */
-		// Finally, open the file
-        if (rw)
-            mf->f = fopen(fn, "wb");
-        else
-            mf->f = fopen(fn, "rb");
-
-		break;
-	default:
-		free(mf);
-		mdio_seterror(MDIO_UNKNOWNFMT);
-		return NULL;
-	}
-
-	// Check for opening error
-	if (!mf->f) {
-		if (mf->trx) free(mf->trx);
-		free(mf);
-		mdio_seterror(MDIO_CANTOPEN);
-		return NULL;
-	}
-
-	// File is opened, we're all set!
-	mdio_seterror(MDIO_SUCCESS);
-	return mf;
-}
-
-
-// Closes a molecular dynamics file.
-static int mdio_close(md_file *mf) {
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (fclose(mf->f) == EOF) return mdio_seterror(MDIO_CANTCLOSE);
-
-	// Free the dynamically allocated memory
-	if (mf->trx) free(mf->trx);
-	free(mf);
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Returns the last error code reported by any of the mdio functions
-static int mdio_errno(void) {
-	return mdio_errcode;
-}
-
-
-// Returns a textual message regarding an mdio error code
-static const char *mdio_errmsg(int n) {
-	if (n < 0 || n > MDIO_MAX_ERRVAL) return (char *) "unknown error";
-	else return mdio_errdescs[n];
-}
-
-
-// Sets the error code and returns an appropriate return value
-// for the calling function to return to its parent
-static int mdio_seterror(int code) {
-	mdio_errcode = code;
-	return code ? -1 : 0;
-}
-
-
-// Reads a line from the text file, strips leading/trailing whitespace
-// and newline, checks for errors, and returns the number of characters
-// in the string on success or -1 on error.
-static int mdio_readline(md_file *mf, char *buf, int n, int strip) {
-	if (!buf || n < 1 || !mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	// Read the line
-	fgets(buf, n, mf->f);
-
-	// End of file reached?
-	if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-
-	// File I/O error?
-	if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-
-        // comment line?
-        if (buf[0] == '#') return mdio_readline(mf,buf,n,strip);
-
-	// Strip whitespace
-	if (strip) strip_white(buf);
-
-	return strlen(buf);
-}
-
-
-// Strips leading and trailing whitespace from a string. Tabs,
-// spaces, newlines and carriage returns are stripped. Example:
-// "\n   hello\t \r" becomes "hello".
-static int strip_white(char *buf) {
-	int i, j, k;
-
-	// Protect against NULL pointer
-	if (!buf) return -1;
-	if (!strlen(buf)) return -1;
-
-	// Kill trailing whitespace first
-	for (i = strlen(buf) - 1;
-	     buf[i] == ' ' || buf[i] == '\t' ||
-	     buf[i] == '\n' || buf[i] == '\r';
-	     i--)
-		buf[i] = 0;
-
-	// Skip past leading whitespace
-	for (i = 0; buf[i] == ' ' || buf[i] == '\t' ||
-	     buf[i] == '\n' || buf[i] == '\r'; i++);
-	if (i) {
-		k = 0;
-		for (j = i; buf[j]; j++)
-			buf[k++] = buf[j];
-		buf[k] = 0;
-	}
-
-	return strlen(buf);
-}
-
-
-// Frees the memory allocated in a ts structure. The holderror
-// parameter defaults to zero. Programs that are calling this
-// function because of an error reported by another function should
-// set holderror so that mdio_tsfree() does not overwrite the error
-// code with mdio_seterror().
-static int mdio_tsfree(md_ts *ts, int holderror) {
-	if (!ts) {
-		if (holderror) return -1;
-		else return mdio_seterror(MDIO_BADPARAMS);
-	}
-
-	if (ts->pos && ts->natoms > 0) free(ts->pos);
-
-  if (ts->box) free(ts->box);
-
-	if (holderror) return -1;
-	else return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Converts box basis vectors to A, B, C, alpha, beta, and gamma.  
-// Stores values in md_box struct, which should be allocated before calling
-// this function.
-static int mdio_readbox(md_box *box, float *x, float *y, float *z) {
-  float A, B, C;
-
-  if (!box) {
-    return mdio_seterror(MDIO_BADPARAMS);
-  }
-
-  // A, B, C are the lengths of the x, y, z vectors, respectively
-  A = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] ) * ANGS_PER_NM;
-  B = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] ) * ANGS_PER_NM;
-  C = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] ) * ANGS_PER_NM;
-  if ((A<=0) || (B<=0) || (C<=0)) {
-    /* Use zero-length box size and set angles to 90. */
-    box->A = box->B = box->C = 0;
-    box->alpha = box->beta = box->gamma = 90;
-  } else {
-    box->A = A;
-    box->B = B;
-    box->C = C;
-  
-    // gamma, beta, alpha are the angles between the x & y, x & z, y & z
-    // vectors, respectively
-    box->gamma = acos( (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])*ANGS2_PER_NM2/(A*B) ) * 90.0/M_PI_2;
-    box->beta = acos( (x[0]*z[0]+x[1]*z[1]+x[2]*z[2])*ANGS2_PER_NM2/(A*C) ) * 90.0/M_PI_2;
-    box->alpha = acos( (y[0]*z[0]+y[1]*z[1]+y[2]*z[2])*ANGS2_PER_NM2/(B*C) ) * 90.0/M_PI_2; 
-  }
-  return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Reads the header of a file (format independent)
-static int mdio_header(md_file *mf, md_header *mdh) {
-	int n;
-	if (!mf || !mdh) return mdio_seterror(MDIO_BADPARAMS);
-	if (!mf->f) return mdio_seterror(MDIO_BADPARAMS);
-
-	switch (mf->fmt) {
-	case MDFMT_GRO:
-		if (gro_header(mf, mdh->title, MAX_MDIO_TITLE,
-		&mdh->timeval, &mdh->natoms, 1) < 0)
-			return -1;
-		return 0;
-
-	case MDFMT_TRR: 
-	case MDFMT_TRJ: /* fallthrough */
-		if (trx_header(mf, 1) < 0) return -1;
-		mdh->natoms = mf->trx->natoms;
-		mdh->timeval = (float) mf->trx->t;
-		strncpy(mdh->title, mf->trx->title, MAX_MDIO_TITLE);
-		return 0;
-
-	case MDFMT_G96:
-		if (g96_header(mf, mdh->title, MAX_MDIO_TITLE,
-		&mdh->timeval) < 0) return -1;
-		mdh->natoms = -1;
-		return 0;
-
-	case MDFMT_XTC:
-		memset(mdh, 0, sizeof(md_header));
-		// Check magic number
-		if (xtc_int(mf, &n) < 0) return -1;
-		if (n != XTC_MAGIC) return mdio_seterror(MDIO_BADFORMAT);
-
-		// Get number of atoms
-		if (xtc_int(mf, &n) < 0) return -1;
-		mdh->natoms = n;
-		rewind(mf->f);
-		return 0;
-
-	default:
-		return mdio_seterror(MDIO_UNKNOWNFMT);
-	}
-}
-
-
-// Reads in a timestep from a file (format independent)
-static int mdio_timestep(md_file *mf, md_ts *ts) {
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-	if (!mf->f) return mdio_seterror(MDIO_BADPARAMS);
-
-	switch (mf->fmt) {
-	case MDFMT_GRO:
-		return gro_timestep(mf, ts);
-
-	case MDFMT_TRR:
-	case MDFMT_TRJ: /* fallthrough */
-		return trx_timestep(mf, ts);
-
-	case MDFMT_G96:
-		return g96_timestep(mf, ts);
-
-	case MDFMT_XTC:
-		return xtc_timestep(mf, ts);
-
-	default:
-		return mdio_seterror(MDIO_UNKNOWNFMT);
-	}
-}
-
-
-
-static int g96_header(md_file *mf, char *title, int titlelen, float *timeval) {
-	char buf[MAX_G96_LINE + 1];
-	char *p;
-
-	// Check parameters
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	// The header consists of blocks. The title block
-	// is mandatory, and a TIMESTEP block is optional.
-	// Example:
-	//
-	// TITLE
-	// Generated by trjconv :  t=  90.00000
-	// more title info
-	// .
-	// .
-	// .
-	// END
-	// .
-	// .
-	// .
-
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-	if (strcasecmp(buf, "TITLE")) return mdio_seterror(MDIO_BADFORMAT);
-
-	// Read in the title itself
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-        // The timevalue can be included in the title string
-        // after a "t=" prefix.
-        if ((p = (char *) strstr(buf, "t="))) {
-                char *q = p;
-                *(q--) = 0;
-
-                // Skip the `t=' and strip whitespace from
-                // the resulting strings
-                p += 2;
-                strip_white(p);
-                strip_white(buf);
-
-                // Grab the timevalue from the title string
-                if (timeval) *timeval = (float) atof(p);
-        }
-        else {
-                // No timevalue - just copy the string and strip
-                // any leading/trailing whitespace
-                if (timeval) *timeval = 0;
-                strip_white(buf);
-        }
-
-	// Copy the title string
-	if (title && titlelen) strncpy(title, buf, titlelen);
-
-	// Now ignore subsequent title lines and get the END string
-	while (strcasecmp(buf, "END"))
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-	// Done!
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Used to determine the number of atoms in a g96 file, because
-// VMD needs to know this for some reason.
-static int g96_countatoms(md_file *mf) {
-	char buf[MAX_G96_LINE + 1];
-	int natoms;
-	int n;
-	long fpos;
-	float lastf;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	fpos = ftell(mf->f);
-
-	natoms = 0;
-	for (;;) {
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1, 0) < 0)
-			break;
-		n = sscanf(buf, "%*6c%*6c%*6c%*6c %*f %*f %f", &lastf);
-		if (n == 1) natoms++;
-		else {
-			strip_white(buf);
-			if (!strcasecmp(buf, "END")) break;
-		}
-	}
-
-	fseek(mf->f, fpos, SEEK_SET);
-	return natoms;
-}
-
-
-// Reads an atom line from the G96 file
-static int g96_rec(md_file *mf, md_atom *ma) {
-	char buf[MAX_G96_LINE + 1];
-	char atomnum[7];
-	int n;
-
-	// Check parameters
-	if (!mf || !ma) return mdio_seterror(MDIO_BADPARAMS);
-
-	// Read in a line, assuming it is an atom line
-	do {
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1, 0) < 0) return -1;
-	} while (buf[0] == '#' || strlen(buf) == 0);
-
-	n = sscanf(buf, "%6c%6c%6c%6c %f %f %f",
-		ma->resid, ma->resname, ma->atomname, atomnum,
-		&ma->pos[0], &ma->pos[1], &ma->pos[2]);
-	if (n == 7) {
-		atomnum[6] = 0;
-		ma->resid[6] = 0;
-		ma->resname[6] = 0;
-		ma->atomname[6] = 0;
-
-		strip_white(atomnum);
-		strip_white(ma->resid);
-		strip_white(ma->resname);
-		strip_white(ma->atomname);
-
-		ma->atomnum = atoi(atomnum);
-
-		ma->pos[0] *= ANGS_PER_NM;
-		ma->pos[1] *= ANGS_PER_NM;
-		ma->pos[2] *= ANGS_PER_NM;
-
-		return 0;
-	}
-
-	return mdio_seterror(MDIO_BADFORMAT);
-}
-
-
-// Reads a timestep from a G96 file and stores the data in
-// the generic md_ts structure. Returns 0 on success or a
-// negative number on error and sets mdio_errcode.
-static int g96_timestep(md_file *mf, md_ts *ts) {
-	char		buf[MAX_G96_LINE + 1];
-	char		stripbuf[MAX_G96_LINE + 1];
-	float		pos[3], x[3], y[3], z[3], *currAtom;
-	long		fpos;
-	int		n, i, boxItems;
-
-	// Check parameters
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-
-  // Allocate data space for the timestep, using the number of atoms
-  // determined by open_g96_read().
-	ts->pos = (float *) malloc(sizeof(float) * 3 * ts->natoms);
-	if (!ts->pos) {
-		return mdio_seterror(MDIO_BADMALLOC);
-	}
-  currAtom = ts->pos;
-
-	// The timesteps follow the header in a fixed block
-	// format:
-	//
-	// TIMESTEP
-	//         <step number> <time value>
-	// END
-	// POSITIONRED
-	//     <x float> <y float> <z float>
-	//     .         .         .
-	//     .         .         .
-	//     .         .         .
-	// END
-	// VELOCITYRED
-	//     <x float> <y float> <z float>
-	//     .         .         .
-	//     .         .         .
-	//     .         .         .
-	// END
-	// BOX
-	//     <x float> <y float> <z float>
-	// END
-	//
-	// -----
-	//
-	// The TIMESTEP, VELOCITY and BOX blocks are optional.
-	// Floats are written in 15.9 precision.
-	//
-	// Reference: GROMACS 2.0 user manual
-	//            http://rugmd4.chem.rug.nl/~gmx/online2.0/g96.html
-
-	// First, look for an (optional) title block and skip it
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-  if (!strcasecmp(buf, "TITLE")) {
-    // skip over the text until we reach 'END'
-    while (strcasecmp(buf, "END")) {
-      if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-    }
-
-    // Read in the next line
-    if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-  }
-
-	// Next, look for a timestep block
-	if (!strcasecmp(buf, "TIMESTEP")) {
-		// Read in the value line
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-
-		// Extract the time value and the timestep index
-		n = sscanf(buf, "%d %f", &ts->step, &ts->time);
-		if (n != 2) return mdio_seterror(MDIO_BADFORMAT);
-
-		// Read the "END" line
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-		if (strcasecmp(buf, "END"))
-			return mdio_seterror(MDIO_BADFORMAT);
-
-		// Read in the next line
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-	}
-	else {
-		// No timestep specified -- set to zero
-		ts->step = 0;
-		ts->time = 0;
-	}
-
-	// At this point a POSITION or POSITIONRED block
-	// is REQUIRED by the format
-	if (!strcasecmp(buf, "POSITIONRED")) {
-
-    // So now we read in some atoms
-    i = 0;
-		while (i < ts->natoms) {
-			// Read in an atom
-			if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0)
-				return -1;
- 
-      // We shouldn't reach the end yet
-      if (!strcasecmp(buf, "END"))
-        return mdio_seterror(MDIO_BADFORMAT);
-
-			// Get the x,y,z coordinates
-			n = sscanf(buf, "%f %f %f", &pos[0], &pos[1], &pos[2]);
-      
-      // Ignore improperly formatted lines
-			if (n == 3) {
-				pos[0] *= ANGS_PER_NM;
-				pos[1] *= ANGS_PER_NM;
-				pos[2] *= ANGS_PER_NM;
-
-				// Copy the atom data into the array
-				memcpy(currAtom, pos, sizeof(float) * 3);
-        currAtom += 3;
-        i++;
-			}
-		}
-	}
-	else if (!strcasecmp(buf, "POSITION") || !strcasecmp(buf, "REFPOSITION")) {
-		/*
-		char resnum[7];
-		char resname[7];
-		char atomname[7];
-		char atomnum[7];
-		*/
-
-		// So now we read in some atoms
-    i = 0;
-		while (i < ts->natoms) {
-			// Read in the first line
-			if (mdio_readline(mf, buf, MAX_G96_LINE + 1, 0) < 0)
-				return -1;
- 
-      // We shouldn't reach the end yet
-      strcpy(stripbuf, buf);
-      strip_white(stripbuf); 
-      if (!strcasecmp(stripbuf, "END"))
-        return mdio_seterror(MDIO_BADFORMAT);
-
-			// Get the x,y,z coordinates and name data
-			n = sscanf(buf, "%*6c%*6c%*6c%*6c %f %f %f",
-				&pos[0], &pos[1], &pos[2]);
-
-      // Ignore improperly formatted lines
-			if (n == 3) {
-				pos[0] *= ANGS_PER_NM;
-				pos[1] *= ANGS_PER_NM;
-				pos[2] *= ANGS_PER_NM;
-
-				// Copy the atom data into the linked list item
-				memcpy(currAtom, pos, sizeof(float) * 3);
-				currAtom += 3;
-        i++;
-			}
-		}
-	}
-	else {
-		return mdio_seterror(MDIO_BADFORMAT);
-	}
-
-  // Read the END keyword
-  if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0)
-    return -1;
-  if (strcasecmp(buf, "END"))
-    return mdio_seterror(MDIO_BADFORMAT);
-
-	// ... another problem: there may or may not be a VELOCITY
-	// block or a BOX block, so we need to read one line beyond
-	// the POSITION block to determine this. If neither VEL. nor
-	// BOX are present we've read a line too far and infringed
-	// on the next timestep, so we need to keep track of the
-	// position now for a possible fseek() later to backtrack.
-	fpos = ftell(mf->f);
-
-	// Now we must read in the velocities and the box, if present
-	if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) {
-    // It's okay if we end the file here; any other errors need to be
-    // reported.
-    if (mdio_errcode == MDIO_EOF) 
-      return mdio_seterror(MDIO_SUCCESS);
-    else 
-      return -1;
-  }
-
-	// Is there a velocity block present ?
-	if (!strcasecmp(buf, "VELOCITY") || !strcasecmp(buf, "VELOCITYRED")) {
-		// Ignore all the coordinates - VMD doesn't use them
-		for (;;) {
-			if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0)
-				return -1;
-			if (!strcasecmp(buf, "END")) break;
-		}
-
-		// Again, record our position because we may need
-		// to fseek here later if we read too far.
-		fpos = ftell(mf->f);
-
-		// Go ahead and read the next line.
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-	}
-
-	// Is there a box present ?
-	if (!strcasecmp(buf, "BOX")) {
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) return -1;
-    boxItems = sscanf(buf, " %f %f %f %f %f %f %f %f %f", 
-               &x[0], &y[1], &z[2], &x[1], &x[2], &y[0], &y[2], &z[0], &z[1]);
-    if (boxItems == 3) {
-      x[1] = x[2] = 0;
-      y[0] = y[2] = 0;
-      z[0] = z[1] = 0;
-    }
-    else if (boxItems != 9) 
-      return mdio_seterror(MDIO_BADFORMAT);
-
-    // Allocate the box and convert the vectors.
-    ts->box = (md_box *) malloc(sizeof(md_box));
-    if (mdio_readbox(ts->box, x, y, z) < 0) {
-      free(ts->box);
-      ts->box = NULL;
-      return mdio_seterror(MDIO_BADFORMAT);
-    }
-
-		if (mdio_readline(mf, buf, MAX_G96_LINE + 1) < 0) {
-      free(ts->box);
-      ts->box = NULL;
-      return -1;
-    }
-		if (strcasecmp(buf, "END")) {
-      free(ts->box);
-      ts->box = NULL;
-			return mdio_seterror(MDIO_BADFORMAT);
-    }
-	}
-	else {
-		// We have read too far, so fseek back to the
-		// last known safe position so we don't return
-		// with the file pointer set infringing on the
-		// next timestep data.
-		fseek(mf->f, fpos, SEEK_SET);
-	}
-
-	// We're done!
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Attempts to read header data from a GROMACS structure file
-// The GROMACS header format is as follows (fixed, 2 lines ASCII):
-// <title> [ n= <timevalue> ]
-//     <num atoms>
-static int gro_header(md_file *mf, char *title, int titlelen, float *timeval,
-               int *natoms, int rewind) {
-  char buf[MAX_GRO_LINE + 1];
-  long fpos;
-  char *p;
-
-  // Check parameters
-  if (!mf)
-    return mdio_seterror(MDIO_BADPARAMS);
-
-  // Get the current file position for rewinding later
-  fpos = ftell(mf->f);
-
-  // The header consists of 2 lines - get the first line
-  if (mdio_readline(mf, buf, MAX_GRO_LINE + 1) < 0) return -1;
-
-  // The timevalue can be included in the title string
-  // after a "t=" prefix.
-  if ((p = (char *) strstr(buf, "t="))) {
-    char *q = p;
-    *(q--) = 0;
-
-    // Skip the `t=' and strip whitespace from
-    // the resulting strings
-    p += 2;
-    strip_white(p);
-    strip_white(buf);
-
-    // Grab the timevalue from the title string
-    if (timeval) *timeval = (float) atof(p);
-  } else {
-    // No timevalue - just copy the string
-    if (timeval) *timeval = 0;
-  }
-
-  // Copy the title string
-  if (title && titlelen) strncpy(title, buf, titlelen);
-
-  // Get the second line and grab the number of atoms
-  if (mdio_readline(mf, buf, MAX_GRO_LINE + 1) < 0) return -1;
-
-  // Store the number of atoms
-  if (natoms && (!(*natoms = atoi(buf))))
-    return mdio_seterror(MDIO_BADFORMAT);
-
-  // Now we rewind the file so that subsequent calls to
-  // gro_timestep() will succeed. gro_timestep() requires
-  // the header to be at the current file pointer.
-  if (rewind)
-    fseek(mf->f, fpos, SEEK_SET);
-
-  return 0; // Done!
-}
-
-
-// Reads one atom record from a GROMACS file. Returns GMX_SUCCESS
-// on success or a negative number on error.
-//
-// Record format (one line, fixed):
-//    rrrrrRRRRRaaaaaAAAAA <x pos> <y pos> <z pos> <x vel> <y vel> <z vel>
-//
-//    r = residue number
-//    R = residue name
-//    a = atom name
-//    A = atom number
-//
-static int gro_rec(md_file *mf, md_atom *ma) {
-  char buf[MAX_GRO_LINE + 1];
-  char atomnum[6];
-  char xposc[12], yposc[12], zposc[12];
-  int n;
-
-  if (!mf)
-    return mdio_seterror(MDIO_BADPARAMS);
-
-  do {
-    if (mdio_readline(mf, buf, MAX_GRO_LINE + 1, 0) < 0)
-      return -1;
-  } while (buf[0] == '#' || !strlen(buf));
-
-  // Read in the fields
-  n = sscanf(buf, "%5c%5c%5c%5c%8c%8c%8c", 
-             ma->resid, ma->resname, ma->atomname, atomnum, 
-             xposc, yposc, zposc);
-
-  if (n != 7)
-    return mdio_seterror(MDIO_BADFORMAT);
-
-  // Null terminate the strings
-  ma->resname[5] = 0;
-  ma->atomname[5] = 0;
-  ma->resid[5] = 0;
-  atomnum[5] = 0;
-  xposc[8] = 0;
-  yposc[8] = 0;
-  zposc[8] = 0;
- 
-  if ((sscanf(xposc, "%f", &ma->pos[0]) != 1) ||
-      (sscanf(yposc, "%f", &ma->pos[1]) != 1) ||
-      (sscanf(zposc, "%f", &ma->pos[2]) != 1)) {
-    return mdio_seterror(MDIO_BADFORMAT);
-  }
-
-  // Convert strings to numbers
-  strip_white(atomnum);
-  ma->atomnum = atoi(atomnum);
-
-  // Convert nanometers to angstroms
-  ma->pos[0] *= ANGS_PER_NM;
-  ma->pos[1] *= ANGS_PER_NM;
-  ma->pos[2] *= ANGS_PER_NM;
-
-  // Strip leading and trailing whitespace
-  strip_white(ma->atomname);
-  strip_white(ma->resname);
-  strip_white(ma->resid);
-
-  return 0;
-}
-
-
-// Reads in a timestep from a .gro file. Ignores the data
-// not needed for a timestep, so is a little faster than
-// calling gro_rec() for each atom. Also reads in the
-// header block.
-//
-static int gro_timestep(md_file *mf, md_ts *ts) {
-	char buf[MAX_GRO_LINE + 1];
-	long coord;
-	int i, n, boxItems;
-  float x[3], y[3], z[3];
-  char xposc[12], yposc[12], zposc[12];
-
-  if (!mf || !ts) 
-    return mdio_seterror(MDIO_BADPARAMS);
-
-  if (gro_header(mf, NULL, 0, &ts->time, &ts->natoms, 0) < 0)
-    return -1;
-
-  ts->pos = (float *) malloc(3 * sizeof(float) * ts->natoms);
-  if (!ts->pos)
-    return mdio_seterror(MDIO_BADMALLOC);
-
-  coord = 0;
-  for (i = 0; i < ts->natoms; i++) {
-    if (mdio_readline(mf, buf, MAX_GRO_LINE + 1, 0) < 0) {
-      free(ts->pos);
-      return -1;
-    }
-	
-    n = sscanf(buf, "%*5c%*5c%*5c%*5c%8c%8c%8c", xposc, yposc, zposc);
-    if (n != 3) 
-      return mdio_seterror(MDIO_BADFORMAT);
-
-    if ((sscanf(xposc, "%f", &ts->pos[coord    ]) != 1) ||
-        (sscanf(yposc, "%f", &ts->pos[coord + 1]) != 1) ||
-        (sscanf(zposc, "%f", &ts->pos[coord + 2]) != 1)) {
-      return mdio_seterror(MDIO_BADFORMAT);
-    }
-
-    ts->pos[coord    ] *= ANGS_PER_NM;
-    ts->pos[coord + 1] *= ANGS_PER_NM;
-    ts->pos[coord + 2] *= ANGS_PER_NM;
-
-    coord += 3;
-  }
-
-  // Read the box, stored as three vectors representing its edges
-  if (mdio_readline(mf, buf, MAX_GRO_LINE + 1, 0) < 0) {
-    free(ts->pos);
-    return -1;
-  }
-
-  boxItems = sscanf(buf, " %f %f %f %f %f %f %f %f %f", 
-             &x[0], &y[1], &z[2], &x[1], &x[2], &y[0], &y[2], &z[0], &z[1]);
-
-  // File may only include three scalars for the box information -- if
-  // that's the case, the box is orthoganal.
-  if (boxItems == 3) {
-    x[1] = x[2] = 0;
-    y[0] = y[2] = 0;
-    z[0] = z[1] = 0;
-  } else if (boxItems != 9) {
-    free(ts->pos);
-    return -1;
-  }
-
-  // Allocate the box and convert the vectors.
-  ts->box = (md_box *) malloc(sizeof(md_box));
-  if (mdio_readbox(ts->box, x, y, z) < 0) {
-    free(ts->pos);
-    free(ts->box);
-    ts->box = NULL;
-    return -1;
-  }
-
-  return 0;
-}
-
-
-// Attempts to read header data from a .trX trajectory file
-//
-// The .trX header format is as follows:
-//
-//	4 bytes		- magic number (0x07C9)
-//	...
-//
-static int trx_header(md_file *mf, int rewind) {
-	int magic;
-	trx_hdr *hdr;
-	long fpos;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	// In case we need to rewind
-	fpos = ftell(mf->f);
-
-	// We need to store some data to the trX header data
-	// structure inside the md_file structure
-	hdr = mf->trx;
-	if (!mf->trx) return mdio_seterror(MDIO_BADPARAMS);
-
-	// Read the magic number
-	if (trx_int(mf, &magic) < 0) return -1;
-	if (magic != TRX_MAGIC) {
-		// Try reverse endianism
-		swap4_aligned(&magic, 1);
-		if (magic != TRX_MAGIC) return mdio_seterror(MDIO_BADFORMAT);
-
-		// Enable byte swapping (actually works, too!)
-		mf->rev = 1;
-	}
-
-	// Read the version number. 
-        // XXX. this is not the version number, but the storage size
-	// of the following XDR encoded string.
-	// the 'title' string is in fact the version identifier.
-	// since VMD does not use any of that, it does no harm,
-	// but is should still be fixed occasionally. AK 2005/01/08.
-
-	if(mf->fmt!=MDFMT_TRJ) {
-		// It appears that TRJ files either don't contain a version
-		// number or don't have a length-delimiter on the string,
-		// whereas TRR files do contain both.  Thus, with TRJ, we just
-		// assume that the version number is the string length and 
-		// just hope for the best. -- WLD 2006/07/09
-		if (trx_int(mf, &hdr->version) < 0) return -1;
-	}
-
-	// Read in the title string
-	if (trx_string(mf, hdr->title, MAX_TRX_TITLE) < 0)
-		return -1;
-
-	// Read in some size data
-	if (trx_int(mf, &hdr->ir_size) < 0) return -1;
-	if (trx_int(mf, &hdr->e_size) < 0) return -1;
-	if (trx_int(mf, &hdr->box_size) < 0) return -1;
-	if (trx_int(mf, &hdr->vir_size) < 0) return -1;
-	if (trx_int(mf, &hdr->pres_size) < 0) return -1;
-	if (trx_int(mf, &hdr->top_size) < 0) return -1;
-	if (trx_int(mf, &hdr->sym_size) < 0) return -1;
-	if (trx_int(mf, &hdr->x_size) < 0) return -1;
-	if (trx_int(mf, &hdr->v_size) < 0) return -1;
-	if (trx_int(mf, &hdr->f_size) < 0) return -1;
-	if (trx_int(mf, &hdr->natoms) < 0) return -1;
-	if (trx_int(mf, &hdr->step) < 0) return -1;
-	if (trx_int(mf, &hdr->nre) < 0) return -1;
-
-	// Make sure there are atoms...
-	if (!hdr->natoms) return mdio_seterror(MDIO_BADFORMAT);
-
-	// Try to determine precision (float? double?)
-	if (hdr->x_size) mf->prec = hdr->x_size / (hdr->natoms * 3);
-	else if (hdr->v_size) mf->prec = hdr->v_size / (hdr->natoms * 3);
-	else if (hdr->f_size) mf->prec = hdr->f_size / (hdr->natoms * 3);
-	else return mdio_seterror(MDIO_BADPRECISION);
-
-	if (mf->prec != sizeof(float) && mf->prec != sizeof(double)) {
-		// We have no data types this size! The
-		// file must've been generated on another
-		// platform
-		return mdio_seterror(MDIO_BADPRECISION);
-	}
-
-	// Read in timestep and lambda
-	if (trx_real(mf, &hdr->t) < 0) return -1;
-	if (trx_real(mf, &hdr->lambda) < 0) return -1;
-
-	// Rewind if necessary
-	if (rewind) fseek(mf->f, fpos, SEEK_SET);
-
-	return 0;
-}
-
-
-// Reads in an integer and stores it in y. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int trx_int(md_file *mf, int *y) {
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-        // sanity check.
-        if (sizeof(int) != 4) return mdio_seterror(MDIO_SIZEERROR);
-
-	if (y) {
-		if (fread(y, 4, 1, mf->f) != 1)
-			return mdio_seterror(MDIO_IOERROR);
-		if (mf->rev) swap4_aligned(y, 1);
-	}
-	else if (fseek(mf->f, 4, SEEK_CUR) != 0)
-		return mdio_seterror(MDIO_IOERROR);
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// Reads in either a float or a double, depending on the
-// precision, and stores that number in y. Returns
-// GMX_SUCCESS on success or a negative number on error.
-static int trx_real(md_file *mf, float *y) {
-	double x;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	switch (mf->prec) {
-		case sizeof(float):
-			if (!y) {
-				if (fseek(mf->f, mf->prec, SEEK_CUR) != 0)
-					return mdio_seterror(MDIO_IOERROR);
-			} else {
-				if (fread(y, mf->prec, 1, mf->f) != 1)
-					return mdio_seterror(MDIO_IOERROR);
-				if (mf->rev) swap4_aligned(y, 1);
-			}
-			return mdio_seterror(MDIO_SUCCESS);
-
-		case sizeof(double):
-			if (!y) {
-				if (fseek(mf->f, mf->prec, SEEK_CUR) != 0)
-					return mdio_seterror(MDIO_IOERROR);
-			} else {
-				if (fread(&x, mf->prec, 1, mf->f) != 1)
-					return mdio_seterror(MDIO_IOERROR);
-				if (mf->rev) swap8_aligned(&x, 1);
-				*y = (float) x;
-			}
-			return mdio_seterror(MDIO_SUCCESS);
-
-		default:
-			return mdio_seterror(MDIO_BADPRECISION);
-	}
-
-}
-
-
-// Reads in a real-valued vector (taking precision into account).
-// Stores the vector in vec, and returns GMX_SUCCESS on success
-// or a negative number on error.
-static int trx_rvector(md_file *mf, float *vec) {
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (!vec) {
-		if (trx_real(mf, NULL) < 0) return -1;
-		if (trx_real(mf, NULL) < 0) return -1;
-		if (trx_real(mf, NULL) < 0) return -1;
-		return mdio_seterror(MDIO_SUCCESS);
-	} else {
-		if (trx_real(mf, &vec[0]) < 0) return -1;
-		if (trx_real(mf, &vec[1]) < 0) return -1;
-		if (trx_real(mf, &vec[2]) < 0) return -1;
-		return mdio_seterror(MDIO_SUCCESS);
-	}
-}
-
-
-// Reads in a string by first reading an integer containing the
-// string's length, then reading in the string itself and storing
-// it in str. If the length is greater than max, it is truncated
-// and the rest of the string is skipped in the file. Returns the
-// length of the string on success or a negative number on error.
-static int trx_string(md_file *mf, char *str, int max) {
-	int size;
-  size_t ssize;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (trx_int(mf, &size) < 0) return -1;
-  ssize = (size_t)size;
-
-	if (str && size <= max) {
-		if (fread(str, 1, size, mf->f) != ssize)
-			return mdio_seterror(MDIO_IOERROR);
-		str[size] = 0;
-		return size;
-	} else if (str) {
-		if (fread(str, 1, max, mf->f) != ssize)
-			return mdio_seterror(MDIO_IOERROR);
-		if (fseek(mf->f, size - max, SEEK_CUR) != 0)
-			return mdio_seterror(MDIO_IOERROR);
-		str[max] = 0;
-		return max;
-	} else {
-		if (fseek(mf->f, size, SEEK_CUR) != 0)
-			return mdio_seterror(MDIO_IOERROR);
-		return 0;
-	}
-}
-
-
-// Reads in a timestep frame from the .trX file and returns the
-// data in a timestep structure. Returns NULL on error.
-static int trx_timestep(md_file *mf, md_ts *ts) {
-	int i;
-  float x[3], y[3], z[3];
-	trx_hdr *hdr;
-
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-	if (mf->fmt != MDFMT_TRJ && mf->fmt != MDFMT_TRR)
-		return mdio_seterror(MDIO_WRONGFORMAT);
-
-	// Read the header
-	if (trx_header(mf) < 0) return -1;
-
-	// We need some data from the trX header
-	hdr = mf->trx;
-	if (!hdr) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (hdr->box_size) { // XXX need to check value of box_size!!
-		if (trx_rvector(mf, x) < 0) return -1;
-		if (trx_rvector(mf, y) < 0) return -1;
-		if (trx_rvector(mf, z) < 0) return -1;
-    // Allocate the box and convert the vectors.
-    ts->box = (md_box *) malloc(sizeof(md_box));
-    if (mdio_readbox(ts->box, x, y, z) < 0) {
-      free(ts->box);
-      ts->box = NULL;
-      return -1;
-    }
-	}
-
-	if (hdr->vir_size) {
-		if (trx_rvector(mf, NULL) < 0) return -1;
-		if (trx_rvector(mf, NULL) < 0) return -1;
-		if (trx_rvector(mf, NULL) < 0) return -1;
-	}
-
-        if (hdr->pres_size) {
-                if (trx_rvector(mf, NULL) < 0) return -1;
-                if (trx_rvector(mf, NULL) < 0) return -1;
-                if (trx_rvector(mf, NULL) < 0) return -1;
-        }
-
-        if (hdr->x_size) {
-                ts->pos = (float *) malloc(sizeof(float) * 3 * hdr->natoms);
-                if (!ts->pos) return mdio_seterror(MDIO_BADMALLOC);
-
-		ts->natoms = hdr->natoms;
-
-		for (i = 0; i < hdr->natoms; i++) {
-			if (trx_rvector(mf, &ts->pos[i * 3]) < 0) {
-				mdio_tsfree(ts, 1);
-				return -1;
-			}
-			ts->pos[i * 3] *= ANGS_PER_NM;
-			ts->pos[i * 3 + 1] *= ANGS_PER_NM;
-			ts->pos[i * 3 + 2] *= ANGS_PER_NM;
-		}
-        }
-
-        if (hdr->v_size) {
-		for (i = 0; i < hdr->natoms; i++) {
-			if (trx_rvector(mf, NULL) < 0) {
-				mdio_tsfree(ts, 1);
-				return -1;
-			}
-		}
-        }
-
-        if (hdr->f_size) {
-		for (i = 0; i < hdr->natoms; i++) {
-			if (trx_rvector(mf, NULL) < 0) {
-				mdio_tsfree(ts, 1);
-				return -1;
-			}
-		}
-        }
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// writes an int in big endian. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int put_trx_int(md_file *mf, int y) {
-      if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-      // sanity check.
-      if (sizeof(int) != 4) return mdio_seterror(MDIO_SIZEERROR);
-
-      if (mf->rev) swap4_aligned(&y, 1);
-      if (fwrite(&y, 4, 1, mf->f) != 1)
-    return mdio_seterror(MDIO_IOERROR);
-
-  return mdio_seterror(MDIO_SUCCESS);
-}
-
-// writes a real in big-endian. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int put_trx_real(md_file *mf, float y) {
-      if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-      if (mf->rev) swap4_aligned(&y, 1);
-      if (fwrite(&y, 4, 1, mf->f) != 1)
-        return mdio_seterror(MDIO_IOERROR);
-
-      return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// writes an xdr encoded string. Returns GMX_SUCCESS
-// on success or a negative number on error.
-static int put_trx_string(md_file *mf, const char *s) {
-	if (!mf || !s) return mdio_seterror(MDIO_BADPARAMS);
-        
-        // write: size of object, string length, string data
-        size_t len = strlen(s);
-        if ( put_trx_int(mf, len+1)
-             || put_trx_int(mf, len)
-             || (fwrite(s, len, 1, mf->f) != 1))
-          return mdio_seterror(MDIO_IOERROR);
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// xtc_int() - reads an integer from an xtc file
-static int xtc_int(md_file *mf, int *i) {
-	unsigned char c[4];
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-        // sanity check.
-        if (sizeof(int) != 4) return mdio_seterror(MDIO_SIZEERROR);
-
-	if (fread(c, 1, 4, mf->f) != 4) {
-		if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-		else if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-		else return mdio_seterror(MDIO_UNKNOWNERROR);
-	}
-
-	if (i) *i = c[3] + (c[2] << 8) + (c[1] << 16) + (c[0] << 24);
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// xtc_float() - reads a float from an xtc file
-static int xtc_float(md_file *mf, float *f) {
-	unsigned char c[4];
-	int i;
-
-	if (!mf) return mdio_seterror(MDIO_BADPARAMS);
-
-	if (fread(c, 1, 4, mf->f) != 4) {
-		if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-		else if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-		else return mdio_seterror(MDIO_UNKNOWNERROR);
-	}
-
-	if (f) {
-		// By reading the number in as an integer and then
-		// copying it to a floating point number we can
-		// ensure proper endianness
-		i = c[3] + (c[2] << 8) + (c[1] << 16) + (c[0] << 24);
-		memcpy(f, &i, 4);
-	}
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-// xtc_data() - reads a specific amount of data from an xtc
-// file using the xdr format.
-static int xtc_data(md_file *mf, char *buf, int len) {
-	if (!mf || len < 1) return mdio_seterror(MDIO_BADPARAMS);
-  size_t slen = (size_t)len;
-	if (buf) {
-		if (fread(buf, 1, slen, mf->f) != slen) {
-			if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-			if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-			else return mdio_seterror(MDIO_UNKNOWNERROR);
-		}
-		if (len % 4) {
-			if (fseek(mf->f, 4 - (len % 4), SEEK_CUR)) {
-				if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-				if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-				else return mdio_seterror(MDIO_UNKNOWNERROR);
-			}
-		}
-	}
-	else {
-		int newlen;
-		newlen = len;
-		if (len % 4) newlen += (4 - (len % 4));
-		if (fseek(mf->f, newlen, SEEK_CUR)) {
-			if (feof(mf->f)) return mdio_seterror(MDIO_EOF);
-			if (ferror(mf->f)) return mdio_seterror(MDIO_IOERROR);
-			else return mdio_seterror(MDIO_UNKNOWNERROR);
-		}
-	}
-	return len;
-}
-
-
-// xtc_timestep() - reads a timestep from an .xtc file.
-static int xtc_timestep(md_file *mf, md_ts *ts) {
-	int n;
-	float f, x[3], y[3], z[3];
-
-	int size = 0; // explicitly initialized to zero.
-	float precision;
-
-	if (!mf || !ts) return mdio_seterror(MDIO_BADPARAMS);
-	if (!mf->f) return mdio_seterror(MDIO_BADPARAMS);
-	if (mf->fmt != MDFMT_XTC) return mdio_seterror(MDIO_WRONGFORMAT);
-
-	// Check magic number
-	if (xtc_int(mf, &n) < 0) return -1;
-	if (n != XTC_MAGIC) return mdio_seterror(MDIO_BADFORMAT);
-
-	// Get number of atoms
-	if (xtc_int(mf, &n) < 0) return -1;
-	ts->natoms = n;
-
-	// Get the simulation step
-	if (xtc_int(mf, &n) < 0) return -1;
-	ts->step = n;
-
-	// Get the time value
-	if (xtc_float(mf, &f) < 0) return -1;
-	ts->time = f;
-
-	// Read the basis vectors of the box
-  if ( (xtc_float(mf, &x[0]) < 0) ||
-       (xtc_float(mf, &x[1]) < 0) ||
-       (xtc_float(mf, &x[2]) < 0) ||
-       (xtc_float(mf, &y[0]) < 0) ||
-       (xtc_float(mf, &y[1]) < 0) ||
-       (xtc_float(mf, &y[2]) < 0) ||
-       (xtc_float(mf, &z[0]) < 0) ||
-       (xtc_float(mf, &z[1]) < 0) ||
-       (xtc_float(mf, &z[2]) < 0) )
-    return -1;
-  // Allocate the box and convert the vectors.
-  ts->box = (md_box *) malloc(sizeof(md_box));
-  if (mdio_readbox(ts->box, x, y, z) < 0) {
-    free(ts->box);
-    ts->box = NULL;
-    return -1;
-  }
-
-	ts->pos = (float *) malloc(sizeof(float) * 3 * ts->natoms);
-	if (!ts->pos) return mdio_seterror(MDIO_BADMALLOC);
-	n = xtc_3dfcoord(mf, ts->pos, &size, &precision);
-	if (n < 0) return -1;
-
-	/* Now we're left with the job of scaling... */
-	for (n = 0; n < ts->natoms * 3; n++)
-		ts->pos[n] *= ANGS_PER_NM;
-
-	return mdio_seterror(MDIO_SUCCESS);
-}
-
-
-///////////////////////////////////////////////////////////////////////
-// This algorithm is an implementation of the 3dfcoord algorithm
-// written by Frans van Hoesel (hoesel@chem.rug.nl) as part of the
-// Europort project in 1995.
-///////////////////////////////////////////////////////////////////////
-
-// integer table used in decompression
-static int xtc_magicints[] = {
-	0, 0, 0, 0, 0, 0, 0, 0, 0,8, 10, 12, 16, 20, 25, 32, 40, 50, 64,
-	80, 101, 128, 161, 203, 256, 322, 406, 512, 645, 812, 1024, 1290,
-	1625, 2048, 2580, 3250, 4096, 5060, 6501, 8192, 10321, 13003, 16384,
-	20642, 26007, 32768, 41285, 52015, 65536, 82570, 104031, 131072,
-	165140, 208063, 262144, 330280, 416127, 524287, 660561, 832255,
-	1048576, 1321122, 1664510, 2097152, 2642245, 3329021, 4194304,
-	5284491, 6658042, 8388607, 10568983, 13316085, 16777216 };
-
-#define FIRSTIDX 9
-/* note that magicints[FIRSTIDX-1] == 0 */
-#define LASTIDX (sizeof(xtc_magicints) / sizeof(*xtc_magicints))
-
-
-// returns the number of bits in the binary expansion of
-// the given integer.
-static int xtc_sizeofint(int size) {
-	unsigned int num = 1;
-  unsigned int ssize = (unsigned int)size;
-	int nbits = 0;
-
-	while (ssize >= num && nbits < 32) {
-		nbits++;
-		num <<= 1;
-	}
-	return nbits;
-}
-
-// calculates the number of bits a set of integers, when compressed,
-// will take up.
-static int xtc_sizeofints(int nints, unsigned int *sizes) {
-	int i;
-  unsigned int num;
-	unsigned int nbytes, nbits, bytes[32], bytecnt, tmp;
-	nbytes = 1;
-	bytes[0] = 1;
-	nbits = 0;
-	for (i=0; i < nints; i++) {	
-		tmp = 0;
-		for (bytecnt = 0; bytecnt < nbytes; bytecnt++) {
-			tmp = bytes[bytecnt] * sizes[i] + tmp;
-			bytes[bytecnt] = tmp & 0xff;
-			tmp >>= 8;
-		}
-		while (tmp != 0) {
-			bytes[bytecnt++] = tmp & 0xff;
-			tmp >>= 8;
-		}
-		nbytes = bytecnt;
-	}
-	num = 1;
-	nbytes--;
-	while (bytes[nbytes] >= num) {
-		nbits++;
-		num *= 2;
-	}
-	return nbits + nbytes * 8;
-}
-
-// reads bits from a buffer.    
-static int xtc_receivebits(int *buf, int nbits) {
-	int cnt, num; 
-	unsigned int lastbits, lastbyte;
-	unsigned char * cbuf;
-	int mask = (1 << nbits) -1;
-
-	cbuf = ((unsigned char *)buf) + 3 * sizeof(*buf);
-	cnt = buf[0];
-	lastbits = (unsigned int) buf[1];
-	lastbyte = (unsigned int) buf[2];
-
-	num = 0;
-	while (nbits >= 8) {
-		lastbyte = ( lastbyte << 8 ) | cbuf[cnt++];
-		num |=  (lastbyte >> lastbits) << (nbits - 8);
-		nbits -=8;
-	}
-	if (nbits > 0) {
-		if (lastbits < (unsigned int)nbits) {
-			lastbits += 8;
-			lastbyte = (lastbyte << 8) | cbuf[cnt++];
-		}
-		lastbits -= nbits;
-		num |= (lastbyte >> lastbits) & ((1 << nbits) -1);
-	}
-	num &= mask;
-	buf[0] = cnt;
-	buf[1] = lastbits;
-	buf[2] = lastbyte;
-	return num; 
-}
-
-// decompresses small integers from the buffer
-// sizes parameter has to be non-zero to prevent divide-by-zero
-static void xtc_receiveints(int *buf, const int nints, int nbits,
-			unsigned int *sizes, int *nums) {
-	int bytes[32];
-	int i, j, nbytes, p, num;
-
-	bytes[1] = bytes[2] = bytes[3] = 0;
-	nbytes = 0;
-	while (nbits > 8) {
-		bytes[nbytes++] = xtc_receivebits(buf, 8);
-		nbits -= 8;
-	}
-	if (nbits > 0) {
-		bytes[nbytes++] = xtc_receivebits(buf, nbits);
-	}
-	for (i = nints-1; i > 0; i--) {
-		num = 0;
-		for (j = nbytes-1; j >=0; j--) {
-			num = (num << 8) | bytes[j];
-			p = num / sizes[i];
-			bytes[j] = p;
-			num = num - p * sizes[i];
-		}
-		nums[i] = num;
-	}
-	nums[0] = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
-}
-
-// function that actually reads and writes compressed coordinates    
-static int xtc_3dfcoord(md_file *mf, float *fp, int *size, float *precision) {
-	static int *ip = NULL;
-	static int oldsize;
-	static int *buf;
-
-	int minint[3], maxint[3], *lip;
-	int smallidx;
-	unsigned sizeint[3], sizesmall[3], bitsizeint[3], size3;
-	int flag, k;
-	int small, smaller, i, is_smaller, run;
-	float *lfp;
-	int tmp, *thiscoord,  prevcoord[3];
-
-	int bufsize, lsize;
-	unsigned int bitsize;
-	float inv_precision;
-
-        /* avoid uninitialized data compiler warnings */
-        bitsizeint[0] = 0;
-        bitsizeint[1] = 0;
-        bitsizeint[2] = 0;
-
-	if (xtc_int(mf, &lsize) < 0) return -1;
-
-	if (*size != 0 && lsize != *size) return mdio_seterror(MDIO_BADFORMAT);
-
-	*size = lsize;
-	size3 = *size * 3;
-	if (*size <= 9) {
-		for (i = 0; i < *size; i++) {
-			if (xtc_float(mf, fp + (3 * i)) < 0) return -1;
-			if (xtc_float(mf, fp + (3 * i) + 1) < 0) return -1;
-			if (xtc_float(mf, fp + (3 * i) + 2) < 0) return -1;
-		}
-		return *size;
-	}
-	xtc_float(mf, precision);
-	if (ip == NULL) {
-		ip = (int *)malloc(size3 * sizeof(*ip));
-		if (ip == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		bufsize = (int) (size3 * 1.2);
-		buf = (int *)malloc(bufsize * sizeof(*buf));
-		if (buf == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		oldsize = *size;
-	} else if (*size > oldsize) {
-		ip = (int *)realloc(ip, size3 * sizeof(*ip));
-		if (ip == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		bufsize = (int) (size3 * 1.2);
-		buf = (int *)realloc(buf, bufsize * sizeof(*buf));
-		if (buf == NULL) return mdio_seterror(MDIO_BADMALLOC);
-		oldsize = *size;
-	}
-	buf[0] = buf[1] = buf[2] = 0;
-
-	xtc_int(mf, &(minint[0]));
-	xtc_int(mf, &(minint[1]));
-	xtc_int(mf, &(minint[2]));
-
-	xtc_int(mf, &(maxint[0]));
-	xtc_int(mf, &(maxint[1]));
-	xtc_int(mf, &(maxint[2]));
-		
-	sizeint[0] = maxint[0] - minint[0]+1;
-	sizeint[1] = maxint[1] - minint[1]+1;
-	sizeint[2] = maxint[2] - minint[2]+1;
-	
-	/* check if one of the sizes is to big to be multiplied */
-	if ((sizeint[0] | sizeint[1] | sizeint[2] ) > 0xffffff) {
-		bitsizeint[0] = xtc_sizeofint(sizeint[0]);
-		bitsizeint[1] = xtc_sizeofint(sizeint[1]);
-		bitsizeint[2] = xtc_sizeofint(sizeint[2]);
-		bitsize = 0; /* flag the use of large sizes */
-	} else {
-		bitsize = xtc_sizeofints(3, sizeint);
-	}
-
-	xtc_int(mf, &smallidx);
-	smaller = xtc_magicints[FIRSTIDX > smallidx - 1 ? FIRSTIDX : smallidx - 1] / 2;
-	small = xtc_magicints[smallidx] / 2;
-	sizesmall[0] = sizesmall[1] = sizesmall[2] = xtc_magicints[smallidx];
-
-	/* check for zero values that would yield corrupted data */
-	if ( !sizesmall[0] || !sizesmall[1] || !sizesmall[2] ) {
-		printf("XTC corrupted, sizesmall==0 (case 1)\n");
-		return -1;
-	}
-
-
-	/* buf[0] holds the length in bytes */
-	if (xtc_int(mf, &(buf[0])) < 0) return -1;
-
-	if (xtc_data(mf, (char *) &buf[3], (int) buf[0]) < 0) return -1;
-
-	buf[0] = buf[1] = buf[2] = 0;
-
-	lfp = fp;
-	inv_precision = 1.0f / (*precision);
-	run = 0;
-	i = 0;
-	lip = ip;
-	while (i < lsize) {
-		thiscoord = (int *)(lip) + i * 3;
-
-		if (bitsize == 0) {
-			thiscoord[0] = xtc_receivebits(buf, bitsizeint[0]);
-			thiscoord[1] = xtc_receivebits(buf, bitsizeint[1]);
-			thiscoord[2] = xtc_receivebits(buf, bitsizeint[2]);
-		} else {
-			xtc_receiveints(buf, 3, bitsize, sizeint, thiscoord);
-		}
-
-		i++;
-		thiscoord[0] += minint[0];
-		thiscoord[1] += minint[1];
-		thiscoord[2] += minint[2];
-
-		prevcoord[0] = thiscoord[0];
-		prevcoord[1] = thiscoord[1];
-		prevcoord[2] = thiscoord[2];
- 
-
-		flag = xtc_receivebits(buf, 1);
-		is_smaller = 0;
-		if (flag == 1) {
-			run = xtc_receivebits(buf, 5);
-			is_smaller = run % 3;
-			run -= is_smaller;
-			is_smaller--;
-		}
-		if (run > 0) {
-			thiscoord += 3;
-			for (k = 0; k < run; k+=3) {
-				xtc_receiveints(buf, 3, smallidx, sizesmall, thiscoord);
-				i++;
-				thiscoord[0] += prevcoord[0] - small;
-				thiscoord[1] += prevcoord[1] - small;
-				thiscoord[2] += prevcoord[2] - small;
-				if (k == 0) {
-					/* interchange first with second atom for better
-					 * compression of water molecules
-					 */
-					tmp = thiscoord[0]; thiscoord[0] = prevcoord[0];
-					prevcoord[0] = tmp;
-					tmp = thiscoord[1]; thiscoord[1] = prevcoord[1];
-					prevcoord[1] = tmp;
-					tmp = thiscoord[2]; thiscoord[2] = prevcoord[2];
-					prevcoord[2] = tmp;
-					*lfp++ = prevcoord[0] * inv_precision;
-					*lfp++ = prevcoord[1] * inv_precision;
-					*lfp++ = prevcoord[2] * inv_precision;
-
-					if ( !sizesmall[0] || !sizesmall[1] || !sizesmall[2] ) {
-						printf("XTC corrupted, sizesmall==0 (case 2)\n");
-						return -1;
-					}
-
-				} else {
-					prevcoord[0] = thiscoord[0];
-					prevcoord[1] = thiscoord[1];
-					prevcoord[2] = thiscoord[2];
-				}
-				*lfp++ = thiscoord[0] * inv_precision;
-				*lfp++ = thiscoord[1] * inv_precision;
-				*lfp++ = thiscoord[2] * inv_precision;
-			}
-		} else {
-			*lfp++ = thiscoord[0] * inv_precision;
-			*lfp++ = thiscoord[1] * inv_precision;
-			*lfp++ = thiscoord[2] * inv_precision;		
-		}
-		smallidx += is_smaller;
-		if (is_smaller < 0) {
-			small = smaller;
-			if (smallidx > FIRSTIDX) {
-				smaller = xtc_magicints[smallidx - 1] /2;
-			} else {
-				smaller = 0;
-			}
-		} else if (is_smaller > 0) {
-			smaller = small;
-			small = xtc_magicints[smallidx] / 2;
-		}
-		sizesmall[0] = sizesmall[1] = sizesmall[2] = xtc_magicints[smallidx] ;
-	}
-	return 1;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ReadPARM.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ReadPARM.h
deleted file mode 100644
index 2b0e6803fa014162c4c167b03bac895292b32738..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ReadPARM.h
+++ /dev/null
@@ -1,976 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: ReadPARM.h,v $
- *      $Author: johns $        $Locker:  $                $State: Exp $
- *      $Revision: 1.15 $      $Date: 2016/11/06 17:54:57 $
- *
- ***************************************************************************
- * DESCRIPTION:
- * NOTE:: Significant were made to the VMD version of
- *        Bill Ross's original code in order to make it easy to hook
- *        into VMD plugin structures.
- * Here is what was changed:
- *     Functions became Class Methods, data became instance variables
- *     The Code to check for compressed files before opening was disabled
- *     Methods get_parm_atom, get_parm_bond, get_hydrogen_bond,
- *     get_parm_natoms, get_parm_nbonds, get_parm_boxInfo were added in 
- *     order to convert from prm.c parlance to VMD conventions.
- *     RCS Information headers and footers were added.
- ***************************************************************************/
-
-/*
- * COPYRIGHT 1992, REGENTS OF THE UNIVERSITY OF CALIFORNIA
- *
- *  prm.c - read information from an amber PARM topology file:
- *      atom/residue/bond/charge info, plus force field data.
- *      This file and the accompanying prm.h may be distributed
- *      provided this notice is retained unmodified and provided
- *      that any modifications to the rest of the file are noted
- *      in comments.
- *
- *      Bill Ross, UCSF 1994
- */
-
-#ifndef READPARM_H
-#define READPARM_H
-
-// XXX enable the new AMBER reading code, deals with packed 
-// fortran 12I6 integer formats.
-#define USENEWCODE 1
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include "molfile_plugin.h"  // needed for molfile return codes etc
-
-#if 0 
-#define _REAL		double
-#define DBLFMT          "%lf"
-#else
-#define _REAL		float
-#define DBLFMT          "%f"
-#endif
-
-typedef struct parm {
-	char	ititl[81];
-	int 	IfBox, Nmxrs, IfCap,
-		 Natom,  Ntypes,  Nbonh,  Mbona,  Ntheth,  Mtheta, 
-		 Nphih,  Mphia,  Nhparm, Nparm, Nnb, Nres,
-		 Nbona,  Ntheta,  Nphia,  Numbnd,  Numang,  Nptra,
-		 Natyp,  Nphb, Nat3, Ntype2d, Nttyp, Nspm, Iptres, Nspsol,
-		 Ipatm, Natcap;
-	char 	*AtomNames, *ResNames, *AtomSym, *AtomTree;
-	_REAL	*Charges, *Masses, *Rk, *Req, *Tk, *Teq, *Pk, *Pn, *Phase,
-		 *Solty, *Cn1, *Cn2, *HB12, *HB6;
-	_REAL	Box[3], Cutcap, Xcap, Ycap, Zcap;
-	int 	*Iac, *Iblo, *Cno, *Ipres, *ExclAt, *TreeJoin, 
-		*AtomRes, *BondHAt1, *BondHAt2, *BondHNum, *BondAt1, *BondAt2, 
-		*BondNum, *AngleHAt1, *AngleHAt2, *AngleHAt3, *AngleHNum, 
-		*AngleAt1, *AngleAt2, *AngleAt3, *AngleNum, *DihHAt1, 
-		*DihHAt2, *DihHAt3, *DihHAt4, *DihHNum, *DihAt1, *DihAt2, 
-		*DihAt3, *DihAt4, *DihNum, *Boundary;
-} parmstruct;
-
-// put the class in an anonymous namespace to give it internal linkage
-namespace {
-  class ReadPARM {
-  public:
-    ReadPARM() {popn = 0;}
-    ~ReadPARM(void) {}
- 
-    int popn;
-    parmstruct *prm;
-    FILE *open_parm_file(const char *name);
-    void close_parm_file(FILE *fileptr);
-    char *get(int size);
-    int preadln(FILE *file, char *string);
-    int readparm(FILE *file);
-    void get_parm_atom(int, char *, char *, char *, char *, int *, float *,
-                       float *);
-
-    void get_parm_bond(int, int fromAtom[], int toAtom[]);
-    void get_hydrogen_bond(int, int fromAtom[], int toAtom[]);
-    int get_parm_natoms();
-    int get_parm_nbonds();
-    int get_parm_boxInfo();
-    int read_fortran_12I6(FILE *fp, int *data, int count);  
-  };
-}
-
-
-/*	fortran formats 
- *	 9118 FORMAT(12I6)
- *	 9128 FORMAT(5E16.8)
-static char	*f9118 = (char *) "%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d\n";
- */
-
-static int readtoeoln(FILE *f) {
-  int c;
-
-  /* skip to eoln */
-  while((c = getc(f)) != '\n') {
-    if (c == EOF) 
-      return -1;
-  }
-
-  return 0;
-}  
-
-/***********************************************************************
- 			    	open_parm_file()
-************************************************************************/
-
-/*
- *  open_parm_file() - fopen regular or popen compressed file for reading
- */
-
-FILE *ReadPARM::open_parm_file(const char *name) {
-	struct stat	buf;
-	char		cbuf[120];
-	int		length, compressed;
-	FILE		*fp;
-
-	length = strlen(name);
-	compressed = 0;  // Just to start
-//	compressed = iscompressed(name);
-	strcpy(cbuf, name);
-
-	/*
-	 *  if file doesn't exist, maybe it has been compressed/decompressed
-	 */
-
-	if (stat(cbuf, &buf) == -1) {
-		switch (errno) {
-		case ENOENT:	{
-			if (!compressed) {
-				strcat(cbuf, ".Z");
-				if (stat(cbuf, &buf) == -1) {
-					printf("%s, %s: does not exist\n", 
-						name, cbuf);
-					return(NULL);
-				}
-				compressed++;
-                                // Don't modify the filename
-				//strcat(name, ".Z"); /* TODO: add protection */
-			} else {
-				cbuf[length-2] = '\0';
-				if (stat(cbuf, &buf) == -1) {
-					printf("%s, %s: does not exist\n", 
-							name, cbuf);
-					return(NULL);
-				}
-				compressed = 0;
-			}
-			break;
-		}
-		default:
-			return(NULL);
-		}
-	}
-
-	/*
-	 *  open the file
-	 */
-#if defined(_MSC_VER) || defined(__MINGW32__)
-        if (compressed) {
-          /* NO "zcat" on Win32 */
-          printf("Cannot load compressed PARM files on Windows.\n");
-          return NULL;
-        }
-#else
-	if (compressed) {
-		char pcmd[sizeof(cbuf) + 7];
-		popn = 1;
-
-		sprintf(pcmd, "zcat '%s'", cbuf);
-		if ((fp = popen(pcmd, "r")) == NULL) {
-			perror(pcmd);
-                        return NULL;
-		}
-        }
-#endif
-	else {
-		if ((fp = fopen(cbuf, "r")) == NULL) {
-			perror(cbuf);
-                        return NULL;
-		}
-	}
-	return(fp);
-}
-
-/***********************************************************************
- 			    close_parm_file   
-************************************************************************/
-
-/*
- *  close_parm_file() - close fopened or popened file
- */
-void ReadPARM::close_parm_file(FILE *fileptr) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  if (popn) {
-    printf("pclose() no such function on win32!\n");
-  } else {
-    if (fclose(fileptr) == -1)
-      perror("fclose");
-  }
-#else
-  if (popn) {
-    if (pclose(fileptr) == -1)
-      perror("pclose");
-  } else {
-    if (fclose(fileptr) == -1)
-      perror("fclose");
-  }
-#endif
-}
-
-
-/***********************************************************************
-                                      GET()
-************************************************************************/
-char *ReadPARM::get(int size) {
-	char	*ptr;
-
-#ifdef DEBUG
-	printf("malloc %d\n", size);
-	fflush(stdout);
-#endif
-	if (size ==0)
-		return((char *) NULL);
-
-	if ((ptr = (char *) malloc((unsigned)size)) == NULL) {
-		printf("malloc %d", size);
-		fflush(stdout);
-		perror("malloc err:");
-        fprintf(stderr, "Exiting due to ReadPARM memory allocation error.\n");
-	}
-	return(ptr);
-}
-
-/***********************************************************************
- 			  	PREADLN()
-************************************************************************/
-int ReadPARM::preadln(FILE *file, char *string) {
-  int i, j;
-
-  for (i=0; i<81; i++) {
-    if ((j = getc(file)) == EOF) {
-      printf("Error: unexpected EOF in Parm file\n");
-      return MOLFILE_ERROR;
-    }
-
-    string[i] = (char) j;
-    if (string[i] == '\n') {
-      break;
-    }
-  }
-
-  if (i == 80  &&  string[i] != '\n') {
-    printf("Error: line too long in Parm file:\n%.80s", string);
-    return MOLFILE_ERROR;
-  }
-
-  return 0; /* success */
-}
-
-/***************************************************************************
-		      		READPARM()
-****************************************************************************/
-/*
- * readparm() - instantiate a given parmstruct
- */
-int ReadPARM::readparm(FILE *file) {
-        //
-        // XXX This code leaks memory every time it's run!  prm is allocated
-        // but its data is never freed, even when ReadPARM itself is deleted.
-        // I've added exception code so we at least have a chance of 
-        // recovering gracefully from a memory allocation error.
-
-	_REAL 		*H;
-	int		i, res, ifpert;
-        int *buffer; // used for reading fortran integer blocks
-
-	prm = (parmstruct *) get(sizeof(parmstruct));
-        if (prm == NULL) {
-          return MOLFILE_ERROR; /* allocation failure */
-        }
-
-	/* READ TITLE */
-	if (preadln(file, prm->ititl) != 0) {
-          return MOLFILE_ERROR;
-        }
-
-	/* READ CONTROL INTEGERS */
-#if !defined(USENEWCODE)
-	fscanf(file, f9118, 
-		&prm->Natom,  &prm->Ntypes, &prm->Nbonh, &prm->Mbona, 
-		&prm->Ntheth, &prm->Mtheta, &prm->Nphih, &prm->Mphia, 
-		&prm->Nhparm, &prm->Nparm,  &prm->Nnb,   &prm->Nres);
-
-	fscanf(file, f9118, 
-		&prm->Nbona,  &prm->Ntheta, &prm->Nphia, &prm->Numbnd, 
-		&prm->Numang, &prm->Nptra,  &prm->Natyp, &prm->Nphb, 
-		&ifpert,      &idum,        &idum,       &idum);
-
-	fscanf(file, " %d %d %d %d %d %d", 
-		&idum, &idum,&idum,&prm->IfBox,&prm->Nmxrs,&prm->IfCap);
-#else
-        buffer = new int[30];
-        if (!read_fortran_12I6(file,buffer,30)) { 
-          return MOLFILE_ERROR;
-        }
-        prm->Natom = buffer[0];
-        prm->Ntypes = buffer[1];
-        prm->Nbonh = buffer[2];
-        prm->Mbona = buffer[3];
-        prm->Ntheth = buffer[4];
-        prm->Mtheta = buffer[5];
-        prm->Nphih = buffer[6];
-        prm->Mphia = buffer[7];
-        prm->Nhparm = buffer[8];
-        prm->Nparm = buffer[9];
-        prm->Nnb = buffer[10];
-        prm->Nres = buffer[11];
-        prm->Nbona = buffer[12];
-        prm->Ntheta = buffer[13];
-        prm->Nphia = buffer[14];
-        prm->Numbnd = buffer[15];
-        prm->Numang = buffer[16];
-        prm->Nptra = buffer[17];
-        prm->Natyp = buffer[18];
-        prm->Nphb = buffer[19];
-        ifpert = buffer[20];
-        // items 21 through 26 are ignored currently.
-        prm->IfBox = buffer[27];
-        prm->Nmxrs = buffer[28];
-        prm->IfCap = buffer[29];
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-
-       if (ifpert) {
-         printf("not equipped to read perturbation prmtop\n");
-         free(prm);
-         return MOLFILE_ERROR;
-       }
-
-
-	/* ALLOCATE MEMORY */
-	prm->Nat3 = 3 * prm->Natom;
-	prm->Ntype2d = prm->Ntypes * prm->Ntypes;
-	prm->Nttyp = prm->Ntypes*(prm->Ntypes+1)/2;
-
-	/*
-	 * get most of the indirect stuff; some extra allowed for char arrays
-	 */
-	prm->AtomNames = (char *) get(4*prm->Natom+81);
-	prm->Charges = (_REAL *) get(sizeof(_REAL)*prm->Natom);
-	prm->Masses = (_REAL *) get(sizeof(_REAL)*prm->Natom);
-	prm->Iac = (int *) get(sizeof(int)*prm->Natom);
-	prm->Iblo = (int *) get(sizeof(int)*prm->Natom);
-	prm->Cno = (int *) get(sizeof(int)* prm->Ntype2d);
-	prm->ResNames = (char *) get(4* prm->Nres+81);
-	prm->Ipres = (int *) get(sizeof(int)*( prm->Nres+1));
-        prm->Rk = (_REAL *) get(sizeof(_REAL)* prm->Numbnd);
-        prm->Req = (_REAL *) get(sizeof(_REAL)* prm->Numbnd);
-        prm->Tk = (_REAL *) get(sizeof(_REAL)* prm->Numang);
-        prm->Teq = (_REAL *) get(sizeof(_REAL)* prm->Numang);
-        prm->Pk = (_REAL *) get(sizeof(_REAL)* prm->Nptra);
-        prm->Pn = (_REAL *) get(sizeof(_REAL)* prm->Nptra);
-        prm->Phase = (_REAL *) get(sizeof(_REAL)* prm->Nptra);
-        prm->Solty = (_REAL *) get(sizeof(_REAL)* prm->Natyp);
-        prm->Cn1 = (_REAL *) get(sizeof(_REAL)* prm->Nttyp);
-        prm->Cn2 = (_REAL *) get(sizeof(_REAL)* prm->Nttyp);
-	prm->BondHAt1 = (int *) get(sizeof(int)* prm->Nbonh);
-	prm->BondHAt2 = (int *) get(sizeof(int)* prm->Nbonh);
-	prm->BondHNum = (int *) get(sizeof(int)* prm->Nbonh);
-	prm->BondAt1 = (int *) get(sizeof(int)* prm->Nbona);
-	prm->BondAt2 = (int *) get(sizeof(int)* prm->Nbona);
-	prm->BondNum = (int *) get(sizeof(int)* prm->Nbona);
-	prm->AngleHAt1 = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleHAt2 = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleHAt3 = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleHNum = (int *) get(sizeof(int)* prm->Ntheth);
-	prm->AngleAt1 = (int *) get(sizeof(int)* prm->Ntheta);
-	prm->AngleAt2 = (int *) get(sizeof(int)*prm->Ntheta);
-	prm->AngleAt3 = (int *) get(sizeof(int)*prm->Ntheta);
-	prm->AngleNum = (int *) get(sizeof(int)*prm->Ntheta);
-	prm->DihHAt1 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHAt2 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHAt3 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHAt4 = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihHNum = (int *) get(sizeof(int)*prm->Nphih);
-	prm->DihAt1 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihAt2 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihAt3 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihAt4 = (int *) get(sizeof(int)*prm->Nphia);
-	prm->DihNum = (int *) get(sizeof(int)*prm->Nphia);
-	prm->ExclAt = (int *) get(sizeof(int)*prm->Nnb);
-	prm->HB12 = (_REAL *) get(sizeof(_REAL)*prm->Nphb);
-	prm->HB6 = (_REAL *) get(sizeof(_REAL)*prm->Nphb);
-	prm->AtomSym = (char *) get(4*prm->Natom+81);
-	prm->AtomTree = (char *) get(4*prm->Natom+81);
-	prm->TreeJoin = (int *) get(sizeof(int)*prm->Natom);
-	prm->AtomRes = (int *) get(sizeof(int)*prm->Natom);
-
-	/* 
-	 * READ ATOM NAMES -IH(M04)
-	 */
-	for (i=0; i<(prm->Natom/20 + (prm->Natom%20 ? 1 : 0)); i++) {
-		preadln(file, &prm->AtomNames[i*80]);
-        }
-
-	/* 
-	 * READ ATOM CHARGES -X(L15)
-	 *	(pre-multiplied by an energy factor of 18.2223 == sqrt(332)
-	 *	 for faster force field calculations)
-	 */
-	for (i=0; i<prm->Natom; i++) {
-          fscanf(file, " " DBLFMT, &prm->Charges[i]);
-          prm->Charges[i] *= 0.0548778; /* convert back to elementary charge units */
-        }
-        readtoeoln(file);
-
-	/* 
-	 * READ ATOM MASSES -X(L20)
-	 */
-	for (i=0; i<prm->Natom; i++)
-	  fscanf(file, " " DBLFMT, &prm->Masses[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ ATOM L-J TYPES -IX(I04)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++) 
-          fscanf(file, " %d", &prm->Iac[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Iac, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ ATOM INDEX TO 1st IN EXCLUDED ATOM LIST "NATEX" -IX(I08)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++)
-          fscanf(file, " %d", &prm->Iblo[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Iblo, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ TYPE INDEX TO N-B TYPE -IX(I06)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Ntype2d; i++)
-          fscanf(file, " %d", &prm->Cno[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Cno, prm->Ntype2d)) {
-          return MOLFILE_ERROR;
-        } 
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ RES NAMES (4 chars each, 4th blank) -IH(M02)
-	 */
-	for (i=0; i<(prm->Nres/20 + (prm->Nres%20 ? 1 : 0)); i++)
-          preadln(file, &prm->ResNames[i*80]);
-
-	/* 
-	 * READ RES POINTERS TO 1st ATOM 		-IX(I02)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nres; i++) 
-          fscanf(file, " %d", &prm->Ipres[i]);
-#else
-        if (!read_fortran_12I6(file, prm->Ipres, prm->Nres)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-	prm->Ipres[prm->Nres] = prm->Natom + 1;
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND FORCE CONSTANTS 			-RK()
-	 */
-	for (i=0; i< prm->Numbnd; i++) 
-          fscanf(file, " " DBLFMT, &prm->Rk[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND LENGTH OF MINIMUM ENERGY  		-REQ()
-	 */
-	for (i=0; i< prm->Numbnd; i++) 
-          fscanf(file, " " DBLFMT, &prm->Req[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND ANGLE FORCE CONSTANTS (following Rk nomen) -TK()
-	 */
-	for (i=0; i< prm->Numang; i++) 
-          fscanf(file, " " DBLFMT, &prm->Tk[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ BOND ANGLE OF MINIMUM ENERGY (following Req nomen) -TEQ()
-	 */
-	for (i=0; i< prm->Numang; i++) 
-          fscanf(file, " " DBLFMT, &prm->Teq[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL PEAK MAGNITUDE 		-PK()
-	 */
-	for (i=0; i< prm->Nptra; i++) 
-          fscanf(file, " " DBLFMT, &prm->Pk[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL PERIODICITY 			-PN()
-	 */
-	for (i=0; i< prm->Nptra; i++) 
-          fscanf(file, " " DBLFMT, &prm->Pn[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL PHASE  			-PHASE()
-	 */
-	for (i=0; i< prm->Nptra; i++) 
-          fscanf(file, " " DBLFMT, &prm->Phase[i]);
-        readtoeoln(file);
-
-	/* 
-	 * ?? "RESERVED" 				-SOLTY()
-	 */
-	for (i=0; i< prm->Natyp; i++) 
-          fscanf(file, " " DBLFMT, &prm->Solty[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ L-J R**12 FOR ALL PAIRS OF ATOM TYPES  	-CN1()
-	 *	(SHOULD BE 0 WHERE H-BONDS)
-	 */
-	for (i=0; i< prm->Nttyp; i++) 
-          fscanf(file, " " DBLFMT, &prm->Cn1[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ L-J R**6 FOR ALL PAIRS OF ATOM TYPES 	-CN2()
-	 *	(SHOULD BE 0 WHERE H-BONDS)
-	 */
-	for (i=0; i< prm->Nttyp; i++) 
-          fscanf(file, " " DBLFMT, &prm->Cn2[i]);
-        readtoeoln(file);
-
-	/* 
-	 * READ COVALENT BOND W/ HYDROGEN (3*(atnum-1)): 
-	 *	IBH = ATOM1 		-IX(I12)
-	 *	JBH = ATOM2 		-IX(I14)
-	 *	ICBH = BOND ARRAY PTR	-IX(I16)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nbonh; i++) 
-          fscanf(file, " %d %d %d", 
-                 &prm->BondHAt1[i], &prm->BondHAt2[i], &prm->BondHNum[i]);
-#else
-        buffer = new int[3*prm->Nbonh];
-        if (!read_fortran_12I6(file, buffer, 3*prm->Nbonh)) { 
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nbonh; i++) { 
-          prm->BondHAt1[i] = buffer[3*i];
-          prm->BondHAt2[i] = buffer[3*i+1];
-          prm->BondHNum[i] = buffer[3*i+2];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ COVALENT BOND W/OUT HYDROGEN (3*(atnum-1)):
-	 *	IB = ATOM1		-IX(I18)
-	 *	JB = ATOM2		-IX(I20)
-	 *	ICB = BOND ARRAY PTR	-IX(I22)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nbona; i++)
-          fscanf(file, " %d %d %d", 
-                 &prm->BondAt1[i], &prm->BondAt2[i], &prm->BondNum[i]);
-#else
-        buffer = new int[3*prm->Nbona];
-        if (!read_fortran_12I6(file, buffer, 3*prm->Nbona)) { 
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nbona; i++) { 
-          prm->BondAt1[i] = buffer[3*i];
-          prm->BondAt2[i] = buffer[3*i+1];
-          prm->BondNum[i] = buffer[3*i+2];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ ANGLE W/ HYDROGEN: 
-	 *	ITH = ATOM1			-IX(I24)
-	 *	JTH = ATOM2			-IX(I26)
-	 *	KTH = ATOM3			-IX(I28)
-	 *	ICTH = ANGLE ARRAY PTR		-IX(I30)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Ntheth; i++)
-          fscanf(file, " %d %d %d %d", 
-                 &prm->AngleHAt1[i], &prm->AngleHAt2[i], 
-                 &prm->AngleHAt3[i], &prm->AngleHNum[i]);
-#else
-        buffer = new int[4*prm->Ntheth];
-        if (!read_fortran_12I6(file, buffer, 4*prm->Ntheth)) { 
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Ntheth; i++) { 
-          prm->AngleHAt1[i] = buffer[4*i];
-          prm->AngleHAt2[i] = buffer[4*i+1];
-          prm->AngleHAt3[i] = buffer[4*i+2];
-          prm->AngleHNum[i] = buffer[4*i+3];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ ANGLE W/OUT HYDROGEN: 
-	 *	IT = ATOM1			-IX(I32)
-	 *	JT = ATOM2			-IX(I34)
-	 *	KT = ATOM3			-IX(I36)
-	 *	ICT = ANGLE ARRAY PTR		-IX(I38)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Ntheta; i++)
-          fscanf(file, " %d %d %d %d", 
-                 &prm->AngleAt1[i], &prm->AngleAt2[i], 
-                 &prm->AngleAt3[i], &prm->AngleNum[i]);
-#else
-        buffer = new int[4*prm->Ntheta];
-        if (!read_fortran_12I6(file, buffer, 4*prm->Ntheta)) {
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Ntheta; i++) { 
-          prm->AngleAt1[i] = buffer[4*i];
-          prm->AngleAt2[i] = buffer[4*i+1];
-          prm->AngleAt3[i] = buffer[4*i+2];
-          prm->AngleNum[i] = buffer[4*i+3];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL W/ HYDROGEN: 
-	 *	ITH = ATOM1			-IX(40)
-	 *	JTH = ATOM2			-IX(42)
-	 *	KTH = ATOM3			-IX(44)
-	 *	LTH = ATOM4			-IX(46)
-	 *	ICTH = DIHEDRAL ARRAY PTR	-IX(48)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nphih; i++)
-          fscanf(file, " %d %d %d %d %d", 
-                 &prm->DihHAt1[i], &prm->DihHAt2[i], &prm->DihHAt3[i], 
-                 &prm->DihHAt4[i], &prm->DihHNum[i]);
-#else
-        buffer = new int[5*prm->Nphih];
-        if (!read_fortran_12I6(file, buffer, 5*prm->Nphih)) {
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nphih; i++) { 
-          prm->DihHAt1[i] = buffer[5*i];
-          prm->DihHAt2[i] = buffer[5*i+1];
-          prm->DihHAt3[i] = buffer[5*i+2];
-          prm->DihHAt4[i] = buffer[5*i+3];
-          prm->DihHNum[i] = buffer[5*i+4];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/* 
-	 * READ DIHEDRAL W/OUT HYDROGEN: 
-	 *	IT = ATOM1
-	 *	JT = ATOM2
-	 *	KT = ATOM3
-	 *	LT = ATOM4
-	 *	ICT = DIHEDRAL ARRAY PTR
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nphia; i++) {
-          fscanf(file, " %d %d %d %d %d", 
-                 &prm->DihAt1[i], &prm->DihAt2[i], &prm->DihAt3[i], 
-                 &prm->DihAt4[i], &prm->DihNum[i]);
-	}
-#else
-        buffer = new int[5*prm->Nphia];
-        if (!read_fortran_12I6(file, buffer, 5*prm->Nphia)) {
-          return MOLFILE_ERROR;
-        }
-        for (i=0; i<prm->Nphia; i++) {
-          prm->DihAt1[i] = buffer[5*i];
-          prm->DihAt2[i] = buffer[5*i+1];
-          prm->DihAt3[i] = buffer[5*i+2];
-          prm->DihAt4[i] = buffer[5*i+3];
-          prm->DihNum[i] = buffer[5*i+4];
-        }
-        delete [] buffer;
-#endif
-        readtoeoln(file);
-
-	/*
-	 * READ EXCLUDED ATOM LIST	-IX(I10)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Nnb; i++)
-		fscanf(file, " %d", &prm->ExclAt[i]);
-#else
-        if (!read_fortran_12I6(file, prm->ExclAt, prm->Nnb)) {
-           return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/*
-	 * READ H-BOND R**12 TERM FOR ALL N-B TYPES	-ASOL()
-	 */
-	for (i=0; i<prm->Nphb; i++) 
-          fscanf(file, " " DBLFMT, &prm->HB12[i]);
-        readtoeoln(file);
-
-	/*
-	 * READ H-BOND R**6 TERM FOR ALL N-B TYPES	-BSOL()
-	 */
-	for (i=0; i<prm->Nphb; i++) 
-          fscanf(file, " " DBLFMT, &prm->HB6[i]);
-        readtoeoln(file);
-
-	/*
-	 * READ H-BOND CUTOFF (NOT USED) ??		-HBCUT()
-	 */
-	H = (_REAL *) get(prm->Nphb * sizeof(_REAL));
-	for (i=0; i<prm->Nphb; i++) 
-          fscanf(file, " " DBLFMT, &H[i]);
-	free((char *)H);
-        readtoeoln(file);
-
-	/*
-	 * READ ATOM SYMBOLS (FOR ANALYSIS PROGS)	-IH(M06)
-	 */
-	for (i=0; i<(prm->Natom/20 + (prm->Natom%20 ? 1 : 0)); i++)
-          preadln(file, &prm->AtomSym[i*80]);
-
-	/*
-	 * READ TREE SYMBOLS (FOR ANALYSIS PROGS)	-IH(M08)
-	 */
-	for (i=0; i<(prm->Natom/20 + (prm->Natom%20 ? 1 : 0)); i++)
-          preadln(file, &prm->AtomTree[i*80]);
-      
-	/*
-	 * READ TREE JOIN INFO (FOR ANALYSIS PROGS)	-IX(I64)
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++)
-          fscanf(file, " %d", &prm->TreeJoin[i]);
-#else
-        if (!read_fortran_12I6(file, prm->TreeJoin, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        readtoeoln(file);
-
-	/*
-	 * READ PER-ATOM RES NUMBER			-IX(I66)
-	 *	NOTE: this appears to be something entirely different
-	 *	NOTE: overwriting this with correct PER-ATOM RES NUMBERs
-	 */
-#if !defined(USENEWCODE)
-	for (i=0; i<prm->Natom; i++)
-          fscanf(file, " %d", &prm->AtomRes[i]);
-#else
-        if (!read_fortran_12I6(file, prm->AtomRes, prm->Natom)) {
-          return MOLFILE_ERROR;
-        }
-#endif
-        res = 0;
-	for (i=0; i<prm->Natom; i++) {
-          if (i+1 == prm->Ipres[res+1])	/* atom is 1st of next res */
-            res++;
-          prm->AtomRes[i] = res;
-	}
-      
-	/*
-	 * BOUNDARY CONDITION STUFF
-	 */
-	if (!prm->IfBox) {
-		prm->Nspm = 1;
-		prm->Boundary = (int *) get(sizeof(int)*prm->Nspm);
-		prm->Boundary[0] = prm->Natom;
-	} else {
-                readtoeoln(file);
-#if !defined(USENEWCODE)
-		fscanf(file, " %d %d %d", &prm->Iptres, &prm->Nspm, 
-								&prm->Nspsol);
-#else
-                buffer = new int[3];
-                if (!read_fortran_12I6(file, buffer, 3)) { 
-                  return MOLFILE_ERROR;
-                }
-                prm->Iptres = buffer[0];
-                prm->Nspm = buffer[1];
-                prm->Nspsol = buffer[2];
-                delete [] buffer;
-#endif
-                readtoeoln(file);
-		prm->Boundary = (int *) get(sizeof(int)*prm->Nspm);
-#if !defined(USENEWCODE)
-		for (i=0; i<prm->Nspm; i++)
-			fscanf(file, " %d", &prm->Boundary[i]);
-#else
-                if (!read_fortran_12I6(file, prm->Boundary, prm->Nspm)) {
-                  return MOLFILE_ERROR;
-                }
-#endif
-                readtoeoln(file);
-		fscanf(file, " " DBLFMT " " DBLFMT " " DBLFMT, 
-				&prm->Box[0], &prm->Box[1], &prm->Box[2]);
-                readtoeoln(file);
-		if (prm->Iptres)
-			prm->Ipatm = prm->Ipres[prm->Iptres] - 1; 
-      		/* IF(IPTRES.GT.0) IPTATM = IX(I02+IPTRES-1+1)-1 */
-	}
-
-	/*
-	 * ----- LOAD THE CAP INFORMATION IF NEEDED -----
-	 */
-	if (prm->IfCap) {
-		/* if (prm->IfBox) 
-			skipeoln(file); */
-		fscanf(file, " %d " DBLFMT " " DBLFMT " " DBLFMT " " DBLFMT,
-				&prm->Natcap, &prm->Cutcap, 
-				&prm->Xcap, &prm->Ycap, &prm->Zcap);
-	}
-
-  return MOLFILE_SUCCESS;
-}
-
-
-void ReadPARM::get_parm_atom(int i, char *name, char *atype, char *resname,
-char *segname, int *resid, float *q, float *m) {
-  int nres = prm->Nres;
-
-  int j,k;
-  int flag = 0;
-  char *blank = (char *) " ";
-
-  *q = prm->Charges[i];
-  *m = prm->Masses[i];
-
-  for (k = 0; k < 4; k++) {
-    if (prm->AtomNames[i*4+k] == *blank)
-       name[k] = '\0';
-    else
-       name[k] = prm->AtomNames[i*4+k];
-  }
-  name[k] = '\0';
-
-  for (k = 0; k < 4; k++) {
-    if ((prm->AtomSym[i*4+k]) == *blank)
-       atype[k] = '\0';
-    else
-       atype[k] = prm->AtomSym[i*4+k];
-  }
-  atype[k] = '\0';
-
-  for (j = 0; j < nres-1; j++)
-    if (((i+1) >= prm->Ipres[j]) && ((i+1) < prm->Ipres[j+1])) {
-      *resid = j;
-      resname[0] = prm->ResNames[j*4];
-      resname[1] = prm->ResNames[j*4+1];
-      resname[2] = prm->ResNames[j*4+2];
-      resname[3] = '\0';
-      flag = 1;
-    }
-  if (flag == 0) {
-     *resid = j;
-     resname[0] = prm->ResNames[j*4];
-     resname[1] = prm->ResNames[j*4+1];
-     resname[2] = prm->ResNames[j*4+2];
-     resname[3] = '\0';
-     flag = 1;
-  }
-
-  segname[0] = '\0'; 
-
-}
-
-void ReadPARM::get_parm_bond (int i, int fromAtom[], int toAtom[]) {
-
-  if (i < prm->Nbona) {
-     fromAtom[i] = (int) ((prm->BondAt1[i])/3 + 1);
-     toAtom[i] =   (int) ((prm->BondAt2[i])/3 + 1);
-  }
-  else get_hydrogen_bond (i, fromAtom, toAtom);
-}
-
-void ReadPARM::get_hydrogen_bond(int i, int fromAtom[], int toAtom[]) {
-  fromAtom[i] = (int) ((prm->BondHAt1[i-prm->Nbona])/3 + 1);
-  toAtom[i] = (int) ((prm->BondHAt2[i-prm->Nbona])/3 + 1);
-}
-
-
-int ReadPARM::get_parm_natoms() {return prm->Natom;}
-
-int ReadPARM::get_parm_nbonds() {return (prm->Nbona + prm->Nbonh);}
-
-int ReadPARM::get_parm_boxInfo() {return(prm->IfBox);}
-
-
-// Read FORTRAN 12I6 format data (no space between adjacent data is assumed)
-// One needs to read the whole data block into the buffer here
-// fp - file pointer.
-// data - buffer to hold the whole block. Should be allocated before the call
-// count - number of ints in the block.
-int ReadPARM::read_fortran_12I6(FILE *fp, int *data, int count) {
-  int i, j;
-  char buf[7];
-
-  for (i=0; i<count; ++i) { 
-    for (j=0; j<6; ++j) { 
-      buf[j]=getc(fp);
-      if (buf[j]=='\n' || buf[j]=='\0' || buf[j]==EOF)
-        return 0;
-    }
-    buf[6] = '\0';
-
-    if (sscanf(buf,"%d",data+i) != 1)
-      return 0;
-
-    if (i%12==11 && i<count-1)
-      readtoeoln(fp);
-  }
-
-  return 1;
-}
-
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ReadPARM7.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ReadPARM7.h
deleted file mode 100644
index 21d967d796975e63e6ef6b5013762f66e00aaae4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ReadPARM7.h
+++ /dev/null
@@ -1,462 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: ReadPARM7.h,v $
- *      $Author: johns $        $Locker:  $                $State: Exp $
- *      $Revision: 1.32 $      $Date: 2016/11/06 17:54:56 $
- *
- ***************************************************************************
- * DESCRIPTION:
- * NOTE:: Significant modifications were made to the VMD version of 
- *        Bill Ross's original code in order to make it easy to hook 
- *        into VMD plugin structures.  
- *        Further modifications were made to the VMD code to 
- *        read amber 7 parm files, courtesy of Brian Bennion
- * Here is what has changed:
- *     Functions became Class Methods, data became instance variables
- *     The Code to check for compressed files before opening was disabled
- *     Methods get_parm7_atom, get_parm7_bond, get_hydrogen_bond,
- *     get_parm7_natoms, get_parm7_nbonds, get_parm7_boxInfo were added in 
- *     order to convert from prm.c parlance to VMD conventions.
- ***************************************************************************/
-
-/*
- * COPYRIGHT 1992, REGENTS OF THE UNIVERSITY OF CALIFORNIA
- *
- *  prm.c - read information from an amber PARM topology file:
- *      atom/residue/bond/charge info, plus force field data.
- *      This file and the accompanying prm.h may be distributed
- *      provided this notice is retained unmodified and provided
- *      that any modifications to the rest of the file are noted
- *      in comments.
- *
- *      Bill Ross, UCSF 1994
- */
-
-#ifndef READPARM7_H
-#define READPARM7_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include "molfile_plugin.h"  // needed for molfile return codes etc
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#if 0 
-#define _REAL   double
-#define DBLFMT  "%lf"
-#else
-#define _REAL   float
-#define DBLFMT  "%f"
-#endif
-
-
-typedef struct parm {
-  char title[85];
-  char version[85];
-  int   IfBox, Nmxrs, IfCap,
-        Natom,  Ntypes,  Nbonds, Nbonh,  Mbona,  Ntheth,  Mtheta, 
-        Nphih,  Mphia,  Nhparm, Nparm, Nnb, Nres,Mptra,
-        Nbona,  Ntheta,  Nphia,  Numbnd,  Numang,  Nptra,Jparm,
-        Natyp,  Nphb, Nat3, Ntype2d, Nttyp, Nspm, Iptres, Nspsol,
-        Ipatm, Natcap,Ifpert,Nbper,Ngper,Ndper,Mbper,Mgper,Mdper,
-        Numextra;
-  _REAL Box[3], Cutcap, Xcap, Ycap, Zcap;
-} parmstruct;
-
-static int read_parm7_flag(FILE *file, const char *flag, const char *format) {
-  char buf[1024];
-    
-  /* read the %FLAG text */
-  fscanf(file, "%s\n", buf);
-  if (strcmp("%FLAG", buf)) {
-    printf("AMBER 7 parm read error, at flag section %s,\n", flag);
-    printf("        expected %%FLAG but got %s\n", buf);
-    return 0; /* read of flag data failed */
-  }
-
-  /* read field name specifier */
-  fscanf(file, "%s\n", buf);
-  if (flag != NULL) {
-    if (strcmp(flag, buf)) {
-      printf("AMBER 7 parm read error at flag section %s,\n", flag);
-      printf("      expected flag field %s but got %s\n", flag, buf);
-      return 0; /* read of flag data failed */
-    }
-  }
-
-  /* read format string */
-  fscanf(file, "%s\n", buf);
-  if (format != NULL) {
-    if (strcmp(format, buf)) {
-      if ( (!strcmp(flag, "TITLE") || !strcmp(flag, "CTITLE") )
-          && !strcmp(format, "%FORMAT(20a4)")) {
-        if (!strcmp(buf, "%FORMAT(a80)"))
-          return 1; /* accept a80 as substitute for 20a4 */
-      }
-      printf("AMBER 7 parm read error at flag section %s,\n", flag);
-      printf("      expected format %s but got %s\n", format, buf);
-      return 0; /* read of flag data failed */
-    }
-  }
-
-  return 1; /* read of flag data succeeded */
-}
-
-/*
- *  open_parm7_file() - fopen regular or popen compressed file for reading
- *  Return FILE handle on success.
- *  set as_pipe to 1 if opened with popen, or 0 if opened with fopen.
- */
-
-static FILE *open_parm7_file(const char *name, int *as_pipe) {
-  struct stat buf;
-  char cbuf[8192];
-  int length;
-  int &compressed = *as_pipe;
-  FILE *fp;
-
-  length = strlen(name);
-  compressed = 0;  // Just to start
-  strcpy(cbuf, name);
-
-  /*
-   *  if file doesn't exist, maybe it has been compressed/decompressed
-   */
-  if (stat(cbuf, &buf) == -1) {
-    switch (errno) {
-      case ENOENT:
-        if (!compressed) {
-          strcat(cbuf, ".Z");
-          if (stat(cbuf, &buf) == -1) {
-            printf("%s, %s: does not exist\n", name, cbuf);
-            return(NULL);
-          }
-          compressed++;
-
-          // Don't modify the filename
-          //strcat(name, ".Z"); /* TODO: add protection */
-        } else {
-          cbuf[length-2] = '\0';
-          if (stat(cbuf, &buf) == -1) {
-            printf("%s, %s: does not exist\n", name, cbuf);
-            return(NULL);
-          }
-          compressed = 0;
-        }
-        break;
-
-      default:
-        return(NULL);
-    }
-  }
-
-  /*
-   *  open the file
-   */
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  if (compressed) {
-    /* NO "zcat" on Win32 */
-    printf("Cannot load compressed PARM files on Windows.\n");
-    return NULL;
-  }
-#else
-  if (compressed) {
-    char pcmd[sizeof(cbuf) + 7];
-    sprintf(pcmd, "zcat '%s'", cbuf);
-    if ((fp = popen(pcmd, "r")) == NULL) {
-      perror(pcmd);
-      return NULL;
-    }
-  }
-#endif
-  else {
-    if ((fp = fopen(cbuf, "r")) == NULL) {
-      perror(cbuf);
-      return NULL;
-    }
-  }
-
-  return(fp);
-}
-
-
-static int parse_parm7_atoms(const char *fmt, 
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  char buf[85];
-
-  if (strncasecmp(fmt, "%FORMAT(20a4)", 13))
-    return 0;
-
-  int j=0;
-  for (int i=0; i<natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (!(i%20)) {
-      j=0;
-      fgets(buf, 85, file);
-    }
-    strncpy(atom->name, buf+4*j, 4);
-    atom->name[4]='\0';
-    j++;
-  }
-  return 1;
-}
-
-
-static int parse_parm7_charge(const char *fmt, 
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(5E16.8)", 15) &&
-      strncasecmp(fmt, "%FORMAT(3E24.16)", 16)) 
-    return 0;
-
-  for (int i=0; i<natoms; i++) {
-    double q=0;
-    if (fscanf(file, " %lf", &q) != 1) {
-      fprintf(stderr, "PARM7: error reading charge at index %d\n", i);
-      return 0;
-    }
-    atoms[i].charge = 0.0548778 * (float)q; /* convert to elementary charge units */
-  }
-
-  return 1;
-}
-
-
-static int parse_parm7_mass(const char *fmt,
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(5E16.8)", 15)) return 0;
-  for (int i=0; i<natoms; i++) {
-    double m=0;
-    if (fscanf(file, " %lf", &m) != 1) {
-      fprintf(stderr, "PARM7: error reading mass at index %d\n", i);
-      return 0;
-    }
-    atoms[i].mass = (float)m;
-  }
-  return 1;
-}
-
-
-static int parse_parm7_atype(const char *fmt,
-    int natoms, molfile_atom_t *atoms, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(20a4)", 13)) return 0;
-  char buf[85];
-  int j=0;
-  for (int i=0; i<natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (!(i%20)) {
-      j=0;
-      fgets(buf, 85, file);
-    }
-    strncpy(atom->type, buf+4*j, 4);
-    atom->type[4]='\0';
-    j++;
-  }
-  return 1;
-}
-
-
-static int parse_parm7_resnames(const char *fmt,
-    int nres, char *resnames, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(20a4)", 13)) return 0;
-  char buf[85];
-  int j=0;
-  for (int i=0; i<nres; i++) {
-    if (!(i%20)) {
-      j=0;
-      fgets(buf, 85, file);
-    }
-    strncpy(resnames, buf+4*j, 4);
-    resnames += 4;
-    j++;
-  }
-
-  return 1;
-}
-
-static int parse_parm7_respointers(const char *fmt, int natoms, 
-    molfile_atom_t *atoms, int nres, const char *resnames, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(10I8)", 13)) return 0;
-  int cur, next;
-  fscanf(file, " %d", &cur);
-  for (int i=1; i<nres; i++) {
-    if (fscanf(file, " %d", &next) != 1) {
-      fprintf(stderr, "PARM7: error reading respointer records at residue %d\n", i);
-      return 0;
-    }
-    while (cur < next) {
-      if (cur > natoms) {
-        fprintf(stderr, "invalid atom index: %d\n", cur);
-        return 0;
-      }
-      strncpy(atoms[cur-1].resname, resnames, 4);
-      atoms[cur-1].resname[4] = '\0';
-      atoms[cur-1].resid = i;
-      cur++;
-    }
-    resnames += 4;
-  }
-  // store the last residue name
-  while (cur <= natoms) {
-    strncpy(atoms[cur-1].resname, resnames, 4);
-    atoms[cur-1].resname[4] = '\0';
-    atoms[cur-1].resid = nres;
-    cur++;
-  }
-
-  return 1;
-}
-
-
-static int parse_parm7_bonds(const char *fmt,
-    int nbonds, int *from, int *to, FILE *file) {
-  if (strncasecmp(fmt, "%FORMAT(10I8)", 13)) 
-    return 0;
-
-  int a, b, tmp;
-  for (int i=0; i<nbonds; i++) {
-    if (fscanf(file, " %d %d %d", &a, &b, &tmp) != 3) {
-      fprintf(stderr, "PARM7: error reading bond number %d\n", i);
-      return 0;
-    }
-    from[i] = a/3 + 1;
-    to[i]   = b/3 + 1;
-  }
-
-  return 1;
-}
-
-
-/*
- *  close_parm7_file() - close fopened or popened file
- */
-static void close_parm7_file(FILE *fileptr, int popn) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  if (popn) {
-    printf("pclose() no such function on win32!\n");
-  } else {
-   if (fclose(fileptr) == -1)
-     perror("fclose");
-  }
-#else
-  if (popn) {
-    if (pclose(fileptr) == -1)
-      perror("pclose");
-  } else {
-    if (fclose(fileptr) == -1)
-      perror("fclose");
-  }
-#endif
-}
-
-static const char *parm7 = "%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d\n";
-
-static parmstruct *read_parm7_header(FILE *file) {
-  char sdum[512]; 
-  parmstruct *prm;
-  prm = new parmstruct;
-
-  /* READ VERSION */
-  fgets(sdum, 512, file);
-
-  /* READ TITLE */
-  fscanf(file, "%s\n", sdum); // "%FLAG"
-  if (strcmp("%FLAG", sdum)) {
-    printf("AMBER 7 parm read error, can't find TITLE flag.\n");
-    printf("        expected %%FLAG, got %s\n", sdum);
-    delete prm;
-    return NULL;
-  }
-  fscanf(file, "%s\n", sdum); // "TITLE" or "CTITLE"
-  if (strcmp("TITLE", sdum) && strcmp("CTITLE", sdum)) {
-    printf("AMBER 7 parm read error, at flag section TITLE,\n");
-    printf("        expected TITLE or CTITLE but got %s,\n", sdum);
-    delete prm;
-    return NULL;
-  }
-  fscanf(file, "%s\n", sdum); // "FORMAT (20a4)"
-  if (strcmp(sdum, "%FORMAT(20a4)") && strcmp(sdum, "%FORMAT(a80)")) {
-    printf("AMBER 7 parm read error, at flag section TITLE,\n");
-    printf("        expected %%FLAG but got %s,\n", sdum);
-    delete prm;
-    return NULL;
-  }
-
-  // read the title string itself, and handle empty lines
-#if 0
-  // XXX this code fails with some AMBER 9 test files
-  fscanf(file, "%s\n", prm->title);
-#else
-  // XXX this hack causes AMBER 9 prmtop files to load
-  fgets(prm->title, sizeof(prm->title), file);
-#endif
-
-  if (strstr(prm->title, "%FLAG") == NULL) {
-    // Got a title string
-    if (!read_parm7_flag(file, "POINTERS", "%FORMAT(10I8)")) {
-      delete prm;
-      return NULL;
-    }
-  } else {
-    // NO title string, use a special method to pick up next flag
-#if 0
-    fscanf(file,"%s\n", sdum);
-    if (strcmp("POINTERS", sdum)) {
-      printf("AMBER 7 parm read error at flag section POINTERS\n");
-      printf("      expected flag field POINTERS but got %s\n", sdum);
-#else
-    if (strstr(prm->title, "POINTERS") == NULL) {
-      printf("AMBER 7 parm read error at flag section POINTERS\n");
-      printf("      expected flag field POINTERS but got %s\n", prm->title);
-#endif
-      delete prm;
-      return NULL;
-    }
-#if 0
-    fscanf(file,"%s\n", sdum);
-    if (strcasecmp("%FORMAT(10I8)", sdum)) {
-#else
-    fgets(sdum, sizeof(sdum), file);
-    if ((strstr(sdum, "%FORMAT(10I8)") == NULL) &&
-        (strstr(sdum, "%FORMAT(10i8)") == NULL)) {
-#endif
-      printf("AMBER 7 parm read error at flag section POINTERS,\n");
-      printf("      expected format %%FORMAT(10I8) but got %s\n", sdum);
-      delete prm;
-      return NULL;
-    }
-  }
-
-  /* READ POINTERS (CONTROL INTEGERS) */
-  fscanf(file,parm7,
-         &prm->Natom,  &prm->Ntypes, &prm->Nbonh, &prm->Nbona,
-         &prm->Ntheth, &prm->Ntheta, &prm->Nphih, &prm->Nphia,
-         &prm->Jparm,  &prm->Nparm);
-  fscanf(file, parm7,  
-         &prm->Nnb,   &prm->Nres,   &prm->Mbona,  &prm->Mtheta,
-         &prm->Mphia, &prm->Numbnd, &prm->Numang, &prm->Mptra,
-         &prm->Natyp, &prm->Nphb);
-  fscanf(file, parm7,  &prm->Ifpert, &prm->Nbper,  &prm->Ngper,
-         &prm->Ndper, &prm->Mbper,  &prm->Mgper, &prm->Mdper,
-         &prm->IfBox, &prm->Nmxrs,  &prm->IfCap);
-
-  fscanf(file,"%8d",&prm->Numextra); //BB
-  prm->Nptra=prm->Mptra; //BB new to amber 7 files...
-
-  prm->Nat3 = 3 * prm->Natom;
-  prm->Ntype2d = prm->Ntypes * prm->Ntypes;
-  prm->Nttyp = prm->Ntypes*(prm->Ntypes+1)/2;
-
-  return prm;
-}
-
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/abinitplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/abinitplugin.c
deleted file mode 100644
index 5b51c29f6451198ac9e47889c31ba1631a8b7201..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/abinitplugin.c
+++ /dev/null
@@ -1,1930 +0,0 @@
-/*
- *  ABINIT plugin for VMD
- *  Rob Lahaye, Sungkyunkwan University, Korea
- *  August 2010
- *
- *  LICENSE:
- *    You can include my code for as long as it is part of an 
- *  open source project. Hence: I do not allow my code to be 
- *  part of any closed source project.
- *
- *  ABINIT manual   
- *  http://www.abinit.org/
- * 
- *  LINUX
- *  gcc -O2 -Wall -fPIC -I. -I$VMDBASEDIR/plugins/include -c abinitplugin.c
- *  gcc -shared -o abinitplugin.so abinitplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c abinitplugin.c
- *  c++ -bundle -o abinitplugin.so abinitplugin.o
- *
- *  Install
- *  copy abinitplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
- /*
-  * This plugin does NOT read the general input (*.in) and output (*.out) files of abinit;
-  * their syntax is far too flexible and complex to be read in all its varieties.
-  * Most (soon hopefully: all) other output files can be read by this plugin. 
-  *
-  * The VMD generic plugin routines jump to the appropriate routine, depending on the
-  * selected file type:
-  *
-  * open_file_read / read_structure / read_next_timestep / 
-  *            |__ GEO_open_file_read/read_structure/read_next_timestep
-  *            |__ DEN_POT_WFK_open_file_read/read_structure/read_next_timestep
-  *
-  * read_volumetric_metadata / read_volumetric_data
-  *            |__ DEN_read_volumetric_metadata/read_volumetric_data
-  *            |__ POT_read_volumetric_metadata/read_volumetric_data
-  *            |__ WFK_read_volumetric_metadata/read_volumetric_data (NOT YET IMPLEMENTED)
-  *
-  * open_file_write / write_structure / write_timestep / close_file_write
-  *            |
-  *            |__ the output format is in a sloppy abinit input file format; however,
-  *                this file cannot serve as an input file to abinit, although its
-  *                syntax is supposed to be easy to understand for a human :).
-  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#if defined(_MSC_VER)
-#include <io.h>
-#define F_OK 0
-// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs
-// on Windows, which is supposed to be POSIX compliant...
-#define access _access
-#else
-#include <unistd.h>
-#endif
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "periodic_table.h"
-#include "unit_conversion.h"
-
-#define LINESIZE 2048  /* maximum length of a line */
-#define NATOM_MAX 300  /* maximum number of atoms */
-
-#define DBGPRINT if(1) fprintf
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-/* Structure to store a file's binary type */
-enum Endianness { little_endian, big_endian };
-typedef struct {
-  enum Endianness endian; /* little or big endian*/
-  int recordmarker;       /* 4 or 8 bytes */
-} binary_t;
-
-
-/* Structure to store the header data of an abinit binary file
- * See for example
- *   http://www.abinit.org/documentation/helpfiles/for-v6.0/users/abinit_help.html#6
- */
-typedef struct {
-  binary_t bintype;
-  char codvsn[7];
-  int headform,fform;
-  int bantot, date, intxc, ixc, natom, ngfft[3], nkpt, npsp,
-      nspden, nspinor, nsppol, nsym, ntypat, occopt, pertcase, usepaw;
-  double ecut, ecutdg, ecutsm, ecut_eff, qptn[3], rprimd[3][3], stmbias, tphysel, tsmear;
-  int usewvl, *istwfk, *nband, *npwarr, *so_psp, *symafm, *symrel[3][3], *typat;
-  double *kpt[3], *occ, *tnons[3], *znucltypat, *wtk;
-
-  char title[133];
-  double znuclpsp, zionpsp;
-  int pspso, pspdat, pspcod, pspxc, lmn_size;
-
-  double residm, *xred[3], etotal, fermie;
-
-  int cplex;
-} abinit_binary_header_t;
-
-
-/* Structure to store important abinit data so that it can be easily shared among the routines */
-typedef struct {
-  FILE *file;                  /* file pointer for reading or writing */
-  char *filename;              /* file name for reading or writing */
-  char filetype[4];            /* type of data file: e.g. GEOmetric or DENsity file */
-
-  float rotmat[3][3];          /* rotation matrix, stored for periodic display hack */
-
-  /* variables for atomic structure */
-  float rprimd[3][3];          /* Real space PRIMitive translations of the unit cell */
-  int natom;                   /* total number of atoms */
-  int typat[NATOM_MAX];        /* number of atoms per atom type */
-  molfile_atom_t *atomlist;
-
-  /* volumetric variables for data of charge density, wavefunction, etc. */
-  int nvolsets;                /* number of volumetric datasets */
-  molfile_volumetric_t *vol;   /* volume set metadata */
-
-  abinit_binary_header_t *hdr; /* header info of an abinit binary file */
-} abinit_plugindata_t;
-
-
-static int binread(void *, size_t, FILE *, binary_t);
-static abinit_binary_header_t *abinit_header(FILE *);
-
-
-/* Allocate memory for header */
-static abinit_binary_header_t *abinit_header_malloc()
-{
-  abinit_binary_header_t *hdr = (abinit_binary_header_t *)malloc(sizeof(abinit_binary_header_t));
-
-  /* zero all bytes in the structure */
-  if (hdr) memset(hdr, 0, sizeof(abinit_binary_header_t));
-  else fprintf(stderr, "\n\nABINIT plugin) ERROR: cannot allocate memory for header.\n");
-
-  return hdr;
-}
-
-
-/* Allocate memory for plugin data */
-static abinit_plugindata_t *abinit_plugindata_malloc()
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)malloc(sizeof(abinit_plugindata_t));
-
-  /* zero all bytes in the structure */
-  if (data) memset(data, 0, sizeof(abinit_plugindata_t));
-  else fprintf(stderr, "\n\nABINIT plugin) ERROR: cannot allocate memory for plugin data.\n");
-
-  return data;
-}
-
-
-/* Free up the header data */
-static void abinit_header_free(abinit_binary_header_t *hdr)
-{
-  int i;
-
-  if (!hdr) return;
-
-  if (hdr->istwfk) free(hdr->istwfk);
-  if (hdr->nband) free(hdr->nband);
-  if (hdr->npwarr) free(hdr->npwarr);
-  if (hdr->so_psp) free(hdr->so_psp);
-  if (hdr->symafm) free(hdr->symafm);
-  for (i = 0; i < 3; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) if (hdr->symrel[i][j]) free(hdr->symrel[i][j]);
-    if (hdr->kpt[i]) free(hdr->kpt[i]);
-    if (hdr->tnons[i]) free(hdr->tnons[i]);
-    if (hdr->xred[i]) free(hdr->xred[i]);
-  }
-  if (hdr->typat) free(hdr->typat);
-  if (hdr->occ) free(hdr->occ);
-  if (hdr->znucltypat) free(hdr->znucltypat);
-  if (hdr->wtk) free(hdr->wtk);
-
-  free(hdr);
-  hdr = NULL;
-}
-
-
-/* Free up the plugin data */
-static void abinit_plugindata_free(abinit_plugindata_t *data)
-{
-  if (!data) return;
-
-  if (data->file) fclose(data->file);
-  if (data->filename) free(data->filename);
-  if (data->atomlist) free(data->atomlist);
-  if (data->vol) free(data->vol);
-
-  abinit_header_free(data->hdr);
-
-  free(data);
-  data = NULL;
-}
-
-
-/* This rotation matrix is determined by two vectors.
- * The matrix aligns the first vector along the x-axis
- * and places the second vector in the xy-plane.
- *
- * Input: data-structure, which contains the matrix
- */
-static void abinit_buildrotmat(abinit_plugindata_t *data)
-{
-  float const *const a = data->rprimd[0];
-  float const *const b = data->rprimd[1];
-
-  /* Rotate first about y-axis and z-axis to align vector a along the x-axis.
-   * phi  : angle between vector a and its projection on the xy-plane
-   * theta: angle between projection of vector a on the xy-plane and the x-axis
-   */
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  /* Rotate about x-axis to place b in the xy-plane. */
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  data->rotmat[0][0] =  cph * cth;
-  data->rotmat[0][1] =  cph * sth;
-  data->rotmat[0][2] =  sph;
-  data->rotmat[1][0] = -sth * cps - sph * cth * sps;
-  data->rotmat[1][1] =  cth * cps - sph * sth * sps;
-  data->rotmat[1][2] =  cph * sps; 
-  data->rotmat[2][0] =  sth * sps - sph * cth * cps;
-  data->rotmat[2][1] = -cth * sps - sph * sth * cps; 
-  data->rotmat[2][2] =  cph * cps;
-
-  DBGPRINT(stderr, "   ROTATION MATRIX: %f   %f   %f\n", data->rotmat[0][0], data->rotmat[0][1], data->rotmat[0][2]);
-  DBGPRINT(stderr, "                    %f   %f   %f\n", data->rotmat[1][0], data->rotmat[1][1], data->rotmat[1][2]);
-  DBGPRINT(stderr, "                    %f   %f   %f\n", data->rotmat[2][0], data->rotmat[2][1], data->rotmat[2][2]);
-}
-
-
-/* Read a non-empty line from stream, remove comments (#... or !...)
- * and strip redundant whitespaces.
- *
- * Input: string, which can contain the line
- *        input stream
- *
- * Return: the stripped line, or NULL when EOF is reached
- */
-static char *abinit_readline(char *line, FILE *stream)
-{
-  char *lineptr;
-
-  if (!line || !stream) return NULL;
-
-  do {
-    int i;
-    char *cptr;
-
-    /* read one line from the stream */
-    lineptr = fgets(line, LINESIZE, stream);
-
-    /* first remove comment from the line */
-    for (i = 0; i < strlen(line); ++i) {
-        if (line[i] == '#' || line[i] == '!') {line[i] = '\0'; break;}
-    }
-
-    /* next remove redundant white spaces at the end of the line */
-    for (cptr = &line[strlen(line) - 1]; isspace(*cptr); --cptr) *cptr = '\0';
-
-    /* continue for as long as EOF is not reached and the line is empty */
-  } while (lineptr != NULL && strlen(line) == 0);
-
-  return lineptr;
-}
-
-
-/* Abinit uses and generates several types of files:
- *   foobar_GEO: geometry file (formatted/ascii text)
- *   foobar_DEN: charge density file (unformatted/binary)
- *   foobar_WFK: wavefunction file (unformatted/binary)
- *   foobar_POT: potential file (unformatted/binary)
- *
- * If the filetype is already set, then we only compare the
- * filetype with the given string, otherwise we first find
- * out about the filetype and then do the compare.
- *
- * Input: abinit-data-structure (may or may not have the filetype set)
-          string to compare with
- *
- * Return: comparison result: 1 (equal), 0 (not equal or error)
- */
-static int abinit_filetype(abinit_plugindata_t *data, char const *cmp)
-{
-  char lineptr[LINESIZE];
-
-  if (!data || !cmp) return 0;
-
-  /* if filetype is already set, then only compare */
-  if (strlen(data->filetype) != 0) return (strncmp(data->filetype, cmp, 3) == 0);
-
-  /* first try to read the abinit binary header */
-  data->hdr = abinit_header(data->file);
-  if (data->hdr) {
-    /* header is read successfully,
-     * therefore it must be an abinit unformatted (binary) file
-     */
-
-    switch(data->hdr->fform) {
-    case   2: /* WFK Wave Function file */
-              strcpy(data->filetype, "WFK");
-              break;
-    case  52: /* DEN Charge Density file */
-              strcpy(data->filetype, "DEN");
-              break;
-    case 102: /* POT Potential file */
-              strcpy(data->filetype, "POT");
-              break;
-    default:  /* Error */
-              strcpy(data->filetype, "ERR");
-              break;
-    }
-
-  } else {
-    /* reading the abinit binary header failed;
-     * we now resort to formatted (ascii text) file.
-     */
-
-    /* read the first non-empty line of the file */
-    rewind(data->file);
-    abinit_readline(lineptr, data->file);
-
-    if (strstr(lineptr, " GEO file"))
-      strcpy(data->filetype, "GEO"); /* GEO geometry file */
-    else
-      strcpy(data->filetype, "ERR"); /* Error */
-
-    /* set the file pointer back to the beginning of the file */
-    rewind(data->file);
-  }
-
-  return (strncmp(data->filetype, cmp, 3) == 0);
-}
-
-
-/* Construct a new file name by finding the first integer number
- * in the existing file name, and create the same file name but
- * with this integer number incremented.
- *
- * Note: the string 'filename' is changed into the new filename
- * ONLY if the file with the new filename exists! 
- *
- * Input: filename
- *
- * Return: 0 (success), 1 (no more files), 2 (error)
- */
-static int increment_filename(char *filename)
-{
-  int i;
-  char *newfilename = NULL, *endpart = NULL;
-
-  DBGPRINT(stderr, "Enter increment_filename\n");
-
-  DBGPRINT(stderr, "increment_filename: filename = %s \n", filename);
-  /* search for integer in the filename starting from the end of the string */
-  for (i = strlen(filename) - 1; i >= 0 && !newfilename; --i) {
-
-    /* endpart points to the string AFTER the integer */
-    if (!endpart && isdigit(filename[i])) endpart = strdup(filename + i + 1);
-
-    /* allocate newfilename when integer is found */
-    if (endpart && !newfilename && !isdigit(filename[i])) {
-       newfilename = (char *)malloc(sizeof(char) * (2 + strlen(filename)));
-       if (!newfilename) {
-         free(endpart);
-         return 2;
-       }
-
-       /* first copy part of the string BEFORE the integer number */
-       strncpy(newfilename, filename, i + 1);
-
-       /* second append the incremented integer number and add 'endpart' of the filename */
-       sprintf(newfilename + i + 1, "%d%s", 1 + atoi(filename + i + 1), endpart);
-    }
-  }
-
-  /* if the endpart is not found, then the file name does not have a number in it,
-   * and therefore this filename is not part of a series of timesteps.
-   * note that if this occurs, then 'newfilename' must also still be NULL !
-   */
-  if (!endpart) {
-    DBGPRINT(stderr, "Exit increment_filename\n");
-    return 1;
-  }
-  
-  /* clean up */
-  free(endpart);
-
-  /* check if we can access the new file */
-  if (access(newfilename, F_OK) != 0) {
-    /* the new file cannot be accessed, so it does not exist */
-    free(newfilename);
-    DBGPRINT(stderr, "Exit increment_filename\n");
-    return 1;
-  } else {
-    /* the new filename exists! Replace the old file name. */
-    strcpy(filename, newfilename);
-    free(newfilename);
-    DBGPRINT(stderr, "increment_filename: filename = %s \n", filename);
-    DBGPRINT(stderr, "Exit increment_filename\n");
-    return 0;
-  }
-}
-
-
-/* Geometry files are generated by ABINIT when "prtgeo 1" is given in
- * the input file. Note that this is NOT the abinit default!
- *
- * Input: data-structure
- *        reference to the number of atoms
- *
- * Return: data-structure, or NULL on error
- */
-static void *GEO_open_file_read(abinit_plugindata_t *data, int *natoms)
-{
-  char lineptr[LINESIZE], atomname[NATOM_MAX][10];
-  int i, idx;
-
-  DBGPRINT(stderr, "Enter GEO_open_file_read\n");
-
-  /* go to the line with the text 'XMOL data' */
-  while (abinit_readline(lineptr, data->file) != NULL) {
-    if (strstr(lineptr, "XMOL data")) break;
-  }
-  if (!strstr(lineptr, "XMOL data")) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: '%s' has no 'XMOL data...' lines.\n", data->filename);
-    return NULL;
-  }
-
-  /* next non-empty line has the number of atoms */
-  if (abinit_readline(lineptr, data->file) == NULL) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: cannot find the number of atoms in file '%s'.\n", data->filename);
-    return NULL;
-  }
-  data->natom = atoi(lineptr);
-  if (data->natom <= 0 || data->natom > NATOM_MAX) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: file '%s' has %d number of atoms.\n", data->filename, data->natom);
-    return NULL;
-  }
-
-  /* read through the list of atom names and ignore their positions */
-  for (i = 0; i < NATOM_MAX; ++i) data->typat[i] = atomname[i][0] = '\0';
-  for (idx = i = 0; i < data->natom; ++i) {
-    int n;
-    char name[10];
-    if (1 != fscanf(data->file, "%s %*f %*f %*f", name)) {
-      fprintf(stderr, "\n\nABINIT read) ERROR: file '%s' does not have the atom list.\n", data->filename);
-      return NULL;
-    }
-
-    /* compare current atom name with previous read list and set typat accordingly */
-    for (n = 0; n < idx; ++n) if (strcmp(atomname[n], name) == 0) break;
-    if (n == idx) strcpy(atomname[idx++], name);
-    data->typat[i] = n + 1;
-
-    DBGPRINT(stderr, "   \"%s\": name = %s : data->typat[%d] = %d\n", data->filetype, atomname[n], i, data->typat[i]);
-  }
-
-  rewind(data->file);
-
-  *natoms = data->natom;
-
-  DBGPRINT(stderr, "Exit GEO_open_file_read\n");
-  return data;
-}
-
-
-static int GEO_read_structure(abinit_plugindata_t *data, int *optflags, molfile_atom_t *atomlist)
-{
-  char lineptr[LINESIZE];
-  int i, status;
-
-  DBGPRINT(stderr, "Enter GEO_read_structure\n");
-
-  /* go to the line with the 'XMOL data' */
-  do {
-    char *line = abinit_readline(lineptr, data->file);
-    status = line != NULL && !strstr(lineptr, "XMOL data");
-  } while (status);
-
-  /* skip line with atom numbers */
-  abinit_readline(lineptr, data->file);
-
-  /* find atom types in XMOL list */
-  for (i = 0; i < data->natom; ++i) {
-    molfile_atom_t *const atom = &(atomlist[i]);
-
-    /* required fields */
-    if (1 != fscanf(data->file, "%s %*f %*f %*f", atom->name)) {
-      fprintf(stderr, "\n\nABINIT read) ERROR: file '%s' does not have the atom list.\n", data->filename);
-      return MOLFILE_ERROR;
-    }
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->segid[0]='\0';
-    atom->chain[0]='\0';
-
-    /* Optional fields (defined in *optflags) */
-    atom->atomicnumber = get_pte_idx(atom->name);
-    atom->mass = get_pte_mass(atom->atomicnumber);
-    atom->radius = get_pte_vdw_radius(atom->atomicnumber);
-
-    DBGPRINT(stderr, "   atom %d : %d (%s)\n", i, atom->atomicnumber, atom->name);
-  }
-
-  /* tell which of the optional fields in the molfile_atom_t structure are provided */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS; 
-
-  rewind(data->file);
-
-  DBGPRINT(stderr, "Exit GEO_read_structure\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int GEO_read_next_timestep(abinit_plugindata_t *data, int natoms, molfile_timestep_t *ts)
-{
-  char lineptr[LINESIZE];
-  float *a, *b, *c;
-  int i , status;
-
-  DBGPRINT(stderr, "Enter GEO_read_next_timestep\n");
-
-  /* At the very first call the file pointer will be non-NULL.
-   * All consecutive calls will have a NULL file pointer (see at the end
-   * of this routine) and in that case "increment" the filename for the
-   * data of the next timestep; if this file does not exist, then there
-   * are no more timesteps.
-   */
-  if (!data->file) {
-    if (increment_filename(data->filename) != 0) return MOLFILE_EOF;
-
-    data->file = fopen(data->filename, "r");
-    if (!data->file) return MOLFILE_EOF;
-  }
-
-  DBGPRINT(stderr, "GEO_read_next_timestep: filename = %s \n", data->filename);
-
-  /* go to the line with 'Primitive vectors...' */
-  do {
-    char *line = abinit_readline(lineptr, data->file);
-    status = ( line != NULL && !strstr(lineptr, "Primitive vectors") );
-  } while (status);
-
-  /* read unit cell vectors from file */
-  for (i = 0; i < 3; ++i) {
-    float length, *r = data->rprimd[i];
-    if (3 != fscanf(data->file, "%*s %f %f %f", &r[0], &r[1], &r[2])) return MOLFILE_EOF;
-
-    /* convert length units from Bohr to Angstrom */
-    r[0] *= BOHR_TO_ANGS;
-    r[1] *= BOHR_TO_ANGS;
-    r[2] *= BOHR_TO_ANGS;
-
-    /* lengths of the respective unit cell vector */
-    length = sqrt(r[0]*r[0] + r[1]*r[1] + r[2]*r[2]);
-    switch (i) {
-      case 0: ts->A = length; break;
-      case 1: ts->B = length; break;
-      case 2: ts->C = length; break;
-    }
-  }
-  abinit_buildrotmat(data);
-
-  /* determine angles between the vectors of the unit cell */
-  a = data->rprimd[0];
-  b = data->rprimd[1];
-  c = data->rprimd[2];
-
-  /* alpha: angle (in degrees) between b and c */
-  ts->alpha = (180.0/M_PI) * acos( (b[0]*c[0] + b[1]*c[1] + b[2]*c[2]) / (ts->B*ts->C) );
-
-  /* beta: angle (in degrees) between a and c */
-  ts->beta  = (180.0/M_PI) * acos( (a[0]*c[0] + a[1]*c[1] + a[2]*c[2]) / (ts->A*ts->C) );
-
-  /* gamma: angle (in degrees) between a and b */
-  ts->gamma = (180.0/M_PI) * acos( (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]) / (ts->A*ts->B) );
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  /* go to the line with 'XMOL data' */
-  do {
-    char *line = abinit_readline(lineptr, data->file);
-    status = line != NULL && !strstr(lineptr, "XMOL data");
-  } while (status);
-
-  /* skip line with atom numbers */
-  abinit_readline(lineptr, data->file);
-
-  /* read coordinates (in Angstrom) of each atom */
-  for (i = 0; i < data->natom; ++i) {
-    float x, y, z, *coords = &ts->coords[3*i];
-    fscanf(data->file, "%*s %f %f %f", &x, &y, &z);
-    coords[0] = data->rotmat[0][0]*x + data->rotmat[0][1]*y + data->rotmat[0][2]*z;
-    coords[1] = data->rotmat[1][0]*x + data->rotmat[1][1]*y + data->rotmat[1][2]*z;
-    coords[2] = data->rotmat[2][0]*x + data->rotmat[2][1]*y + data->rotmat[2][2]*z;
-  }
-
-  /* close the file and NULLify as preparation for the next timestep call */
-  fclose(data->file);
-  data->file = NULL;
-
-  DBGPRINT(stderr, "Exit GEO_read_next_timestep\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-/* Electron density (DEN), potential (POT), and wavefunction (WFK)
- * files have the structure information in the generic header,
- * followed by the volumetric data. For all three we can determine
- * the structure with the same reading routine.
- * The volumetric data is the similar for density and potential (DEN/POT)
- * files, but is different for wavefunction (WFK) files.
- */
-static void *DEN_POT_WFK_open_file_read(abinit_plugindata_t *data, int *natoms)
-{
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_POT_WFK_open_file_read\n");
-
-  data->natom = data->hdr->natom;
-
-  if (data->natom <= 0 || data->natom > NATOM_MAX) return NULL;
-
-  for (i = 0; i < data->natom; ++i) data->typat[i] = data->hdr->typat[i];
-
-  for (i = 0; i < data->natom; ++i) DBGPRINT(stderr, "   \"%s\": data->typat[%d] = %d\n", data->filetype, i, data->typat[i]);
-
-  *natoms = data->natom;
-
-  DBGPRINT(stderr, "Exit DEN_POT_WFK_open_file_read\n");
-  return data;
-}
-
-
-static int DEN_POT_WFK_read_structure(abinit_plugindata_t *data, int *optflags, molfile_atom_t *atomlist)
-{
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_POT_WFK_read_structure\n");
-
-  /* set the atom types, names, etc. */
-  for (i = 0; i < data->natom; ++i) {
-    molfile_atom_t *const atom = &(atomlist[i]);
-
-    /* optional fields (defined in *optflags) */
-    atom->atomicnumber = (int)floor(0.5 + data->hdr->znucltypat[data->hdr->typat[i] - 1]);
-    atom->mass = get_pte_mass(atom->atomicnumber);
-    atom->radius = get_pte_vdw_radius(atom->atomicnumber);
-
-    /* required fields */
-    strncpy(atom->name, get_pte_label(atom->atomicnumber), sizeof(atom->name));    
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->segid[0]='\0';
-    atom->chain[0]='\0';
-
-    DBGPRINT(stderr, "   atom %d : %d (%s)\n", i, atom->atomicnumber, atom->name);
-  }
-
-  /* tell which of the optional fields in the molfile_atom_t structure are provided */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS; 
-
-  DBGPRINT(stderr, "Exit DEN_POT_WFK_read_structure\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int DEN_POT_WFK_read_next_timestep(abinit_plugindata_t *data, int natoms, molfile_timestep_t *ts)
-{
-  float *a, *b, *c;
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_POT_WFK_read_next_timestep\n");
-
-  /* At the very first call the file pointer will be non-NULL.
-   * All consecutive calls will have a NULL file pointer (see at the end
-   * of this routine) and in that case "increment" the filename for the
-   * data of the next timestep; if this file does not exist, then there
-   * are no more timesteps.
-   */
-  if (!data->file) {
-    /* alas, volumetric data cannot (yet ?) be read as timesteps */
-    return MOLFILE_EOF;
-
-    if (increment_filename(data->filename) != 0) return MOLFILE_EOF;
-
-    data->file = fopen(data->filename, "r");
-    if (!data->file) return MOLFILE_EOF;
-
-    /* read the new header info from the new file */
-    abinit_header_free(data->hdr);
-    data->hdr = abinit_header(data->file);
-    if (!data->hdr) return MOLFILE_EOF;
-  }
-
-  /* get unit cell vectors and convert them to Angstrom */
-  for (i = 0; i < 3; ++i) {
-    float length;
-    int k;
-    for (k = 0; k < 3; ++k) data->rprimd[i][k] = data->hdr->rprimd[i][k] * BOHR_TO_ANGS;
-    length = sqrt(pow(data->rprimd[i][0], 2) + pow(data->rprimd[i][1], 2) + pow(data->rprimd[i][2], 2));
-    switch (i) {
-      case 0: ts->A = length; break;
-      case 1: ts->B = length; break;
-      case 2: ts->C = length; break;
-    }    
-  }
-  abinit_buildrotmat(data);
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  /* determine angles between the vectors of the unit cell */
-  a = data->rprimd[0];
-  b = data->rprimd[1];
-  c = data->rprimd[2];
-
-  /* alpha: angle (in degrees) between b and c */
-  ts->alpha = (180.0/M_PI) * acos( (b[0]*c[0] + b[1]*c[1] + b[2]*c[2]) / (ts->B*ts->C) );
-
-  /* beta: angle (in degrees) between a and c */
-  ts->beta  = (180.0/M_PI) * acos( (a[0]*c[0] + a[1]*c[1] + a[2]*c[2]) / (ts->A*ts->C) );
-
-  /* gamma: angle (in degrees) between a and b */
-  ts->gamma = (180.0/M_PI) * acos( (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]) / (ts->A*ts->B) );
-
-  /* get coordinates (in Angstrom) of each atom */
-  for (i = 0; i < data->natom; ++i) {
-    double **xred = data->hdr->xred;
-    float *coords = &ts->coords[3*i];
-    float const x = xred[0][i] * a[0] + xred[1][i] * b[0] + xred[2][i] * c[0],
-                y = xred[0][i] * a[1] + xred[1][i] * b[1] + xred[2][i] * c[1],
-		z = xred[0][i] * a[2] + xred[1][i] * b[2] + xred[2][i] * c[2];
-
-    coords[0] = data->rotmat[0][0]*x + data->rotmat[0][1]*y + data->rotmat[0][2]*z;
-    coords[1] = data->rotmat[1][0]*x + data->rotmat[1][1]*y + data->rotmat[1][2]*z;
-    coords[2] = data->rotmat[2][0]*x + data->rotmat[2][1]*y + data->rotmat[2][2]*z;
-  }
-
-  /* close the file and NULLify as preparation for the next timestep call */
-  fclose(data->file);
-  data->file = NULL;
-
-  DBGPRINT(stderr, "Exit DEN_POT_WFK_read_next_timestep\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int DEN_read_volumetric_metadata(abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  char const spintext[3][30] = { "Charge density spin up",
-                                 "Charge density spin down",
-                                 "Charge density spin up - down" };
-  char const magntext[3][40] = { "X-projection of local magnetization",
-                                 "Y-projection of local magnetization",
-                                 "Z-projection of local magnetization" };
-  int i;
-
-  DBGPRINT(stderr, "Enter DEN_read_volumetric_metadata\n");
-
-  /* Abinit provides the electron density, which is the negative of the
-   * charge density. For norm-conserving pseudopotentials (usepaw = 0)
-   * this is the pseudo-valence electron density; for a PAW calculation
-   * (usepaw = 1) this is the pseudo-valence electron density plus the
-   * compensation charge density.
-   * To visualize the electron density from a PAW calculation, create
-   * the density file with the pawprtden key word, not prtden (however,
-   * if you want to chain this density into later calculations, you have
-   * to use prtden.
-   */
-  if (data->hdr->usepaw) {
-    fprintf(stderr, "\n\nABINIT read) WARNING: be sure that you have used \"pawprtden 1\"\n");
-    fprintf(stderr,     "                      in order to visualize the electron density!\n\n");
-  }
-
-  /* Initialize the volume set list
-   * Total charge density (spin up+down) : always present
-   *    spin up / spin down / spin up-down \ only there for
-   *    X / Y / Z local magnetization      /  spin-polarized calculations
-   *                    (the latter two are absent for non-spin-polarized calculations)
-   */
-  data->nvolsets = (data->hdr->nspden == 1 ? 1 : 4);
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: cannot allocate space for volumetric data.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* get unit cell vectors and convert to Angstrom */
-  for (i = 0; i < 3; ++i) {
-    int k;
-    for (k = 0; k < 3; ++k) data->rprimd[i][k] = data->hdr->rprimd[i][k] * BOHR_TO_ANGS;
-  }
-  abinit_buildrotmat(data);
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  for (i = 0; i < data->nvolsets; ++i) {
-
-    int k;
-
-    /* handle to the current volume set meta data */
-    molfile_volumetric_t *const set = &(data->vol[i]);
-
-    /* set the volume data name */
-    if (i == 0) {
-        /* the first data set always is the total charge density */
-        sprintf(set->dataname, "Total charge density");
-    } else if (data->hdr->nspden <= 2) {
-        /* datasets contain spin polarized (up/down) densities */
-        sprintf(set->dataname, "%s", spintext[i-1]);
-    } else if (data->hdr->nspden == 4) {
-        /* subsequent datasets contain magnetization data */
-        sprintf(set->dataname, "%s", magntext[i-1]);
-    } else {
-        /* we should never get here.... */
-        sprintf(set->dataname, "%s", "ERROR: no datasets available");
-    }
-
-    /* rotate unit cell vectors */
-    for (k = 0 ; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->rprimd[0][0]
-		    + data->rotmat[k][1] * data->rprimd[0][1]
-		    + data->rotmat[k][2] * data->rprimd[0][2];
-
-      set->yaxis[k] = data->rotmat[k][0] * data->rprimd[1][0] 
-		    + data->rotmat[k][1] * data->rprimd[1][1]
-		    + data->rotmat[k][2] * data->rprimd[1][2];
-
-      set->zaxis[k] = data->rotmat[k][0] * data->rprimd[2][0] 
-		    + data->rotmat[k][1] * data->rprimd[2][1]
-		    + data->rotmat[k][2] * data->rprimd[2][2];
-    }
-    DBGPRINT(stderr, "   set->xaxis[%d] set->yaxis[%d] set->zaxis[%d]\n", k, k, k);
-    for (k = 0 ; k < 3; ++k) DBGPRINT(stderr, "   %f         %f        %f\n", set->xaxis[k], set->yaxis[k], set->zaxis[k]);
-
-    /* Add one more to the grid size and later fill the extra voxel
-     * with the same value from the beginning of the row to make
-     * the volumetric data smooth across the cell boundaries.
-     */
-    set->xsize = data->hdr->ngfft[0] + 1;
-    set->ysize = data->hdr->ngfft[1] + 1;
-    set->zsize = data->hdr->ngfft[2] + 1;
-
-    set->has_color = 0;
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  DBGPRINT(stderr, "Exit DEN_read_volumetric_metadata.\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int DEN_read_volumetric_data(abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
-{
-  double const density_conversion = 1.0/pow(BOHR_TO_ANGS, 3);
-  int iset;
-
-  DBGPRINT(stderr, "Enter DEN_read_volumetric_data\n");
-
-  /* this should never happen, nevertheless check it to prevent disasters */
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  /* The density output file contains the header plus:
-   * do ispden=1,nspden
-   * write(unit) (rhor(ir),ir=1,cplex*ngfft(1)*ngfft(2)*ngfft(3))
-   * enddo
-   */
-  for (iset = 0; iset <= set && iset < data->hdr->nspden; ++iset) {
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-
-    char recordmarker[10];
-    int n, ix, iy, iz;
-
-    /* Fill the datablock with the density or magnetization data.
-     * Note that for each 'iset'-loop the datablock is overwritten,
-     * so that only the last datablock readings remain.
-     */
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          double value;
-
-          /* The datablock grid is one voxel larger in each direction in order
-	   * to smoothen the density at the cell boundaries; hence fill the extra
-	   * voxel with the same value as the one at the beginning of that row.
-	   */
-          if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else if (data->hdr->cplex == 1) {
-            /* get the volumetric data and convert */
-            binread(&value, 8, data->file, data->hdr->bintype);
-	    value *= density_conversion;
-	  } else if (data->hdr->cplex == 2) {
-            /* get volumetric data as a complex number and convert */
-	    double a, b;
-            binread(&a, 8, data->file, data->hdr->bintype);
-            binread(&b, 8, data->file, data->hdr->bintype);
-	    value = sqrt(a*a + b*b) * density_conversion;
-	  } else {
-            /* we should never get here */
-            return MOLFILE_ERROR;
-          }
-
-          /* fill the datablock according to the data provided */
-          if (data->hdr->nspden <= 2) {
-            /* data is charge density as one or two sets: total and spin up */
-
-            if (set == 0 || set == 1) {
-              /* first two sets are always directly provided as total and spin up */
-              datablock[n] = value;
-            } else if (set == 2) {
-              /* third set we calculate from first two sets: down = total - up */
-              datablock[n] = (iset == 0 ? value : datablock[n] - value);
-            } else if (set == 3) {
-              /* fourth set we calculate from first two sets: up - down = 2*up - total */
-              datablock[n] = (iset == 0 ? -value : datablock[n] + 2*value);
-            } else {
-              /* we should never get here */
-              return MOLFILE_ERROR;
-            }
-
-          } else if (data->hdr->nspden == 4) {
-            /* data is magnetization as four sets: total charge density and X-Y-Z-magnetization */
-            datablock[n] = value;
-
-          } else {
-            /* we should never get here...*/
-            return MOLFILE_ERROR;
-          }
-
-	}
-      }
-    }
-
-    /* skip the recordmarker bytes twice */
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-  }
-
-  DBGPRINT(stderr, "Exit DEN_read_volumetric_data\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int POT_read_volumetric_metadata(abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  int i;
-
-  DBGPRINT(stderr, "Enter POT_read_volumetric_metadata\n");
-
-  data->nvolsets = data->hdr->nspden;
-
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-    fprintf(stderr, "\n\nABINIT read) ERROR: cannot allocate space for volumetric data.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* get unit cell vectors and convert to Angstrom */
-  for (i = 0; i < 3; ++i) {
-    int k;
-    for (k = 0; k < 3; ++k) data->rprimd[i][k] = data->hdr->rprimd[i][k] * BOHR_TO_ANGS;
-  }
-  abinit_buildrotmat(data);
-
-  for (i = 0; i < 9; ++i) DBGPRINT(stderr, "   data->rprimd[%d][%d] = %f %s", i%3, i/3, data->rprimd[i%3][i/3], ((i+1)%3 == 0 ? "\n" : ""));
-
-  for (i = 0; i < data->nvolsets; ++i) {
-
-    int k;
-
-    /* handle to the current volume set meta data */
-    molfile_volumetric_t *const set = &(data->vol[i]);
-
-    if (data->nvolsets == 1) strcpy(set->dataname, "Total potential");
-    else if (data->nvolsets == 2) {
-        if (i == 0) strcpy(set->dataname, "Spin up potential");
-        if (i == 1) strcpy(set->dataname, "Spin down potential");
-    } else if (data->nvolsets == 4) {
-        if (i == 0) strcpy(set->dataname, "Spin up-up potential");
-        if (i == 1) strcpy(set->dataname, "Spin down-down potential");
-        if (i == 2) strcpy(set->dataname, "Real part of spin up-down potential");
-        if (i == 3) strcpy(set->dataname, "Imaginary part of spin up-down potential");
-    }
-
-    /* rotate unit cell vectors */
-    for (k = 0 ; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->rprimd[0][0]
-		    + data->rotmat[k][1] * data->rprimd[0][1]
-		    + data->rotmat[k][2] * data->rprimd[0][2];
-
-      set->yaxis[k] = data->rotmat[k][0] * data->rprimd[1][0] 
-		    + data->rotmat[k][1] * data->rprimd[1][1]
-		    + data->rotmat[k][2] * data->rprimd[1][2];
-
-      set->zaxis[k] = data->rotmat[k][0] * data->rprimd[2][0] 
-		    + data->rotmat[k][1] * data->rprimd[2][1]
-		    + data->rotmat[k][2] * data->rprimd[2][2];
-    }
-    DBGPRINT(stderr, "   set->xaxis[%d] set->yaxis[%d] set->zaxis[%d]\n", k, k, k);
-    for (k = 0 ; k < 3; ++k) DBGPRINT(stderr, "   %f         %f        %f\n", set->xaxis[k], set->yaxis[k], set->zaxis[k]);
-
-    /* Add one more to the grid size and fill the extra voxel
-     * with the same value at the beginning of the row to make
-     * the volumetric data smooth across the cell boundaries.
-     */
-    set->xsize = data->hdr->ngfft[0] + 1;
-    set->ysize = data->hdr->ngfft[1] + 1;
-    set->zsize = data->hdr->ngfft[2] + 1;
-
-    set->has_color = 0;
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  DBGPRINT(stderr, "Exit POT_read_volumetric_metadata.\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int POT_read_volumetric_data(abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
-{
-  int n, iset;
-
-  DBGPRINT(stderr, "Enter POT_read_volumetric_data\n");
-
-  /* this should never happen, nevertheless check it to prevent disasters */
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  /* The potential files contain the header plus:
-   * do ispden=1,nspden
-   * write(unit) (potential(ir),ir=1,cplex*ngfft(1)*ngfft(2)*ngfft(3))
-   * enddo
-   */
-  for (n = iset = 0; iset <= set; ++iset) {
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-
-    char recordmarker[10];
-    int ix, iy, iz;
-
-    /* Fill the datablock with the density data.
-     * Note that for each 'iset'-loop the datablock is overwritten,
-     * so that only the last datablock readings remain.
-     */
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          double value;
-
-          /* The datablock grid is one voxel larger in each direction in order
-	   * to smoothen the density at the cell boundaries; hence fill the extra
-	   * voxel with the same value as the one at the beginning of that row.
-	   */
-          if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else if (data->hdr->cplex == 1) {
-            /* get the volumetric data and convert */
-            binread(&value, 8, data->file, data->hdr->bintype);
-	    value *= HARTREE_TO_EV;
-	  } else if (data->hdr->cplex == 2) {
-            /* get volumetric data as a complex number and convert */
-	    double a, b;
-            binread(&a, 8, data->file, data->hdr->bintype);
-            binread(&b, 8, data->file, data->hdr->bintype);
-	    value = sqrt(a*a + b*b) * HARTREE_TO_EV;
-	  } else return MOLFILE_ERROR;
-
-          datablock[n] = value;
-	}
-      }
-    }
-
-    /* THIS HAS NOT BEEN VERIFIED YET: skip the recordmarker bytes twice */
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-    fread(recordmarker, 1, data->hdr->bintype.recordmarker, data->file);
-  }
-
-  DBGPRINT(stderr, "Exit POT_read_volumetric_data\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int WFK_read_volumetric_metadata(abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  /* net yet implemented */
-  DBGPRINT(stderr, "Enter/Exit WFK_read_volumetric_metadata\n");
-  fprintf(stderr, "\n\nABINIT read) WARNING: loading WFK is NOT YET IMPLEMENTED!\n");
-  return MOLFILE_ERROR;
-}
-
-
-static int WFK_read_volumetric_data(abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
-{
-  /* net yet implemented */
-  DBGPRINT(stderr, "Enter/Exit WFK_read_volumetric_data: NOT YET IMPLEMENTED!\n");
-  fprintf(stderr, "\n\nABINIT read) WARNING: loading WFK is NOT YET IMPLEMENTED!\n");
-  return MOLFILE_ERROR;
-}
-
-/* ===================================
- * Generic vmd routines
- * ===================================
- */
-
-
-/* VMD calls this one just once to verify access to the file. */
-static void *open_file_read(const char *filename, const char *filetype, int *natoms)
-{
-  void *result = NULL;
-  abinit_plugindata_t *data;
-
-  DBGPRINT(stderr, "Enter open_file_read\n");
-
-  /* verify that the input variables are OK */
-  if (!filename || !natoms) return NULL;
-
-  /* start with undefined value and set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  /* allocate memory for the abinit data structure */
-  data = abinit_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* allocate memory for filename (add an extra 10 bytes for some more flexibility) */
-  data->filename = (char *)malloc( sizeof(char) * (strlen(filename) + 10) );
-
-  /* open the file for reading */
-  data->file = fopen(filename, "rb");
-
-  if (!data->file || !data->filename) {
-    abinit_plugindata_free(data);
-    return NULL;
-  }
-  strcpy(data->filename, filename);
-
-  if (abinit_filetype(data, "GEO"))
-    result = GEO_open_file_read(data, natoms);
-  else if (abinit_filetype(data, "DEN") || abinit_filetype(data, "POT") || abinit_filetype(data, "WFK"))
-    result = DEN_POT_WFK_open_file_read(data, natoms);
-
-  if (result == NULL) abinit_plugindata_free(data);
-
-  DBGPRINT(stderr, "Exit open_file_read\n");
-  return result;
-}
-
-
-/* VMD calls this once to find out about the atom types in the structure */
-static int read_structure(void *mydata, int *optflags, molfile_atom_t *atomlist)
-{
-  int result = MOLFILE_ERROR;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_structure\n");
-
-  if (!data || !optflags || !atomlist) return MOLFILE_ERROR;
-
-  if (abinit_filetype(data, "GEO"))
-    result = GEO_read_structure(data, optflags, atomlist);
-  else if (abinit_filetype(data, "DEN") || abinit_filetype(data, "POT") || abinit_filetype(data, "WFK"))
-    result = DEN_POT_WFK_read_structure(data, optflags, atomlist);
-
-  DBGPRINT(stderr, "Exit read_structure\n");
-  return result;
-}
-
-
-/* VMD keeps calling for a next timestep, until it gets End-Of-File here */
-static int read_next_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  int result = MOLFILE_EOF;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_next_timestep\n");
-
-  /* Save coordinatess only if we are given a timestep pointer.
-   * Otherwise assume that VMD wants us to skip past it.
-   */
-  if (!ts || !data) return MOLFILE_EOF;
-
-  /* Double check that the number of atoms are correct */
-  if (natoms != data->natom) return MOLFILE_EOF;
-
-  if (abinit_filetype(data, "GEO"))
-    result = GEO_read_next_timestep(data, natoms, ts);
-  else if (abinit_filetype(data, "DEN") || abinit_filetype(data, "POT") || abinit_filetype(data, "WFK"))
-    result = DEN_POT_WFK_read_next_timestep(data, natoms, ts);
-
-  DBGPRINT(stderr, "Exit read_next_timestep\n");
-  return result;
-}
-
-
-static void close_file_read(void *mydata)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter close_read\n");
-
-  abinit_plugindata_free(data);
-
-  DBGPRINT(stderr, "Exit close_read\n");
-}
-
-
-
-/* This writes the basic structure data in the syntax of the abinit input format. */
-static void *open_file_write(const char *filename, const char *filetype, int natoms)
-{
-  abinit_plugindata_t *data = abinit_plugindata_malloc();
-
-  DBGPRINT(stderr, "Enter open_file_write\n");
-
-  if (!data) return NULL;
-
-  /* allocate memory for filename (add an extra 10 bytes for some more flexibility) */
-  data->filename = (char *)malloc( sizeof(char) * (strlen(filename) + 10) );
-
-  /* open the file for writing */
-  data->file = fopen(filename, "w");
-
-  if (!data->filename || !data->file) {
-    abinit_plugindata_free(data);
-    fprintf(stderr, "ABINIT write) ERROR: unable to open file '%s' for writing\n", filename);
-    return NULL;
-  }
-  strcpy(data->filename, filename);
-
-  data->natom = natoms;
-
-  DBGPRINT(stderr, "Exit open_file_write\n");
-  return data;
-}
-
-
-static int write_structure(void *mydata, int optflags, const molfile_atom_t *atoms)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-  int i, znucl[NATOM_MAX], ntypat;
-
-  DBGPRINT(stderr, "Enter write_structure\n");
-
-  if (!data || !atoms) return MOLFILE_ERROR;
-
-  for (i = 0; i < NATOM_MAX; ++i) znucl[i] = 0;
-
-
-  for (ntypat = i = 0; i < data->natom; ++i) {
-    int const idx = get_pte_idx(atoms[i].type);
-    int k;
-
-    /* check if we already have this atom's idx in the list */
-    for (k = 0; k < ntypat; ++k) if (idx == znucl[k]) break;
-
-    /* if it is not yet in the list, increment ntypat */
-    if (k == ntypat) ntypat++;
-
-    znucl[k] = idx;
-    data->typat[i] = k + 1;
-  }
-
-  /* write header with info */
-  fprintf(data->file, "# Format below is in a sloppy ABINIT style.\n");
-  fprintf(data->file, "# See http://www.abinit.org/ for the meaning of the keywords used here.\n\n");
-
-  /* write the atom data to file */
-  fprintf(data->file, "# Definition of the atom types\nntypat %d\nznucl ", ntypat);
-  for (i = 0; i < ntypat; ++i) fprintf(data->file, " %d", znucl[i]);
-  fprintf(data->file, "\n\n");
-
-  fprintf(data->file, "# Definition of the atoms\nnatom %d\ntypat ", data->natom);
-  for (i = 0; i < data->natom; ++i) fprintf(data->file, " %d", data->typat[i]);
-  fprintf(data->file, "\n\n");
-
-  DBGPRINT(stderr, "Exit write_structure\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_timestep(void *mydata, const molfile_timestep_t *ts)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata; 
-  int i;
-
-  DBGPRINT(stderr, "Enter write_timestep\n");
-
-  if (!data || !ts) return MOLFILE_ERROR;
-
-  fprintf(data->file, "# Definition of the unit cell in Bohr\n");
-  fprintf(data->file, "acell %f %f %f\n", ts->A * ANGS_TO_BOHR, ts->B * ANGS_TO_BOHR, ts->C * ANGS_TO_BOHR);
-  fprintf(data->file, "angdeg %f %f %f\n\n", ts->alpha, ts->beta, ts->gamma);
-
-  fprintf(data->file, "# location of the atoms in Bohr\nxcart ");
-  for (i = 0; i < data->natom; ++i) {
-    float const rx = ts->coords[3*i    ]  * ANGS_TO_BOHR,
-                ry = ts->coords[3*i + 1]  * ANGS_TO_BOHR,
-                rz = ts->coords[3*i + 2]  * ANGS_TO_BOHR;
-    fprintf(data->file, "%s%17.12f %17.12f %17.12f\n", (i != 0 ? "      " : ""), rx, ry, rz);
-  }
-  fprintf(data->file, "\n\n");
-
-  DBGPRINT(stderr, "Exit write_timestep\n");
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_write(void *mydata)
-{
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-  DBGPRINT(stderr, "Enter close_file_write\n");
-
-  abinit_plugindata_free(data);
-
-  DBGPRINT(stderr, "Exit close_file_write\n");
-}
-
-
-static int read_volumetric_metadata(void *mydata, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  int result = MOLFILE_ERROR;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_volumetric_metadata\n");
-
-  if (!data || !nvolsets || !metadata) return MOLFILE_ERROR;
-
-  if (abinit_filetype(data, "DEN"))
-    result = DEN_read_volumetric_metadata(data, nvolsets, metadata);
-  else if (abinit_filetype(data, "POT"))
-    result = POT_read_volumetric_metadata(data, nvolsets, metadata);
-  else if (abinit_filetype(data, "WFK"))
-    result = WFK_read_volumetric_metadata(data, nvolsets, metadata);
-
-  DBGPRINT(stderr, "Exit read_volumetric_metadata\n");
-  return result;
-}
-
-static int read_volumetric_data(void *mydata, int set, float *datablock, float *colorblock)
-{
-  int result = MOLFILE_ERROR;
-  abinit_plugindata_t *data = (abinit_plugindata_t *)mydata;
-
-  DBGPRINT(stderr, "Enter read_volumetric_data\n");
-
-  if (!data || !datablock) return MOLFILE_ERROR;
-
-  if (abinit_filetype(data, "DEN"))
-    result = DEN_read_volumetric_data(data, set, datablock, colorblock);
-  else if (abinit_filetype(data, "POT"))
-    result = POT_read_volumetric_data(data, set, datablock, colorblock);
-  else if (abinit_filetype(data, "WFK"))
-    result = WFK_read_volumetric_data(data, set, datablock, colorblock);
-
-  DBGPRINT(stderr, "Exit read_volumetric_data\n");
-  return result;
-}
-
-
-/* ===================================
- * Registration stuff
- * ===================================
- */
-
-static molfile_plugin_t abinitplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  /* zero all bytes in the plugin prior to setting the fields */
-  memset(&abinitplugin, 0, sizeof(molfile_plugin_t));
-
-  /* see molfile_plugin.h for details on the fields */
-  /* header  */
-  abinitplugin.abiversion   = vmdplugin_ABIVERSION; /* the ABI for the base plugin type */
-  abinitplugin.type         = MOLFILE_PLUGIN_TYPE;  /* string descriptor of the plugin type */
-  abinitplugin.name         = "ABINIT";             /* name for the plugin */
-  abinitplugin.prettyname   = "ABINIT";             /* name in filetype list */
-  abinitplugin.author       = "Rob Lahaye";         /* string identifier */
-  abinitplugin.majorv       = 0;                    /* major version */
-  abinitplugin.minorv       = 4;                    /* minor version */
-  abinitplugin.is_reentrant = VMDPLUGIN_THREADSAFE; /* can this library be run concurrently with itself? */
-
-  /* the rest of the plugin */
-  abinitplugin.filename_extension       = "*|*_GEO|*_DEN|*_WFK|*_POT|*_VHA|*_VHXC|*_VXC"; /* filename extension for this file type */
-  abinitplugin.open_file_read           = open_file_read;           /* try to open the file for reading */
-  abinitplugin.read_structure           = read_structure;           /* read molecular structure from the given file handle */
-  abinitplugin.read_bonds               = 0;                        /* read bond information for the molecule */
-  abinitplugin.read_next_timestep       = read_next_timestep;       /* read the next timestep from the file */
-  abinitplugin.close_file_read          = close_file_read;          /* close the file and release all data */
-  abinitplugin.open_file_write          = open_file_write;          /* open a coordinate file for writing */
-  abinitplugin.write_structure          = write_structure;          /* write a timestep to the coordinate file */
-  abinitplugin.write_timestep           = write_timestep;           /* write a timestep to the coordinate file */
-  abinitplugin.close_file_write         = close_file_write;         /* close the file and release all data */
-  abinitplugin.read_volumetric_metadata = read_volumetric_metadata; /* retrieve metadata pertaining to volumetric datasets in this file */
-  abinitplugin.read_volumetric_data     = read_volumetric_data;     /* read the specified volumetric data set into the space pointed to by datablock */
-  abinitplugin.read_rawgraphics         = 0;                        /* read raw graphics data stored in this file */
-  abinitplugin.read_molecule_metadata   = 0;                        /* read molecule metadata */
-  abinitplugin.write_bonds              = 0;                        /* write bond information for the molecule */
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-
-  (*cb)(v, (vmdplugin_t *)&abinitplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-/* ===================================
- * Procedures to read the binary data
- * ===================================
- */
-
-
-/* Do a binary read of 'size' bytes from stream.
- * Store the bytes into the pointer according to the match
- * between the endianness of the file and the system reading it.
- * Return the number of bytes succesfully read.
- */
-static int binread(void *ptr, size_t size, FILE *stream, binary_t bintype)
-{
-  char *data = (char *)ptr;
-  char *storage = malloc(size * sizeof(char));
-  int const result = fread(storage, 1, size, stream);
-  unsigned int i = 1;
-  enum Endianness myEndian = ( *(char *)&i == 1 ? little_endian : big_endian );
-
-  for (i = 0; i < size; ++i) {
-    int const index = (myEndian == bintype.endian ? i : size - i - 1);
-    data[i] = storage[index];
-  }
-
-  free(storage);
-  return result;
-}
-
-
-/* Read the full header of a binary ABINIT file until the point
- * where the data starts.
- * Return a pointer to the header struct, or NULL if the reading fails.
- */ 
-static abinit_binary_header_t *abinit_header(FILE *fp)
-{
-  int const debug = 0;
-
-  /* the pattern of the first 4 or 8 bytes of a binary abinit file determines the
-   * endianness and recordmarker length of the file.
-   */
-  char const Big_Endian_4_pattern[]    = {'\x00','\x00','\x00','\x0e'},
-             Big_Endian_8_pattern[]    = {'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x0e'}, 
-             Little_Endian_4_pattern[] = {'\x0e','\x00','\x00','\x00'},
-             Little_Endian_8_pattern[] = {'\x0e','\x00','\x00','\x00','\x00','\x00','\x00','\x00'};
-
-  char skip[1024];
-  int i, bc = 0;
-
-  abinit_binary_header_t *hdr = abinit_header_malloc();
-  if (!hdr) return NULL;
-
-  /* be sure to start from the beginning of the file */
-  rewind(fp);
-
-  if (debug) fprintf(stderr, "START OF BINARY FILE DEBUG INFO\n");
-
-  /* Determine endianness and record length of the binary file.
-   * Note that this pattern is followed by a version string, which has no null termination.
-   * Therefore the pattern is always followed by a non-null byte.
-   */
-  fread(skip, 1, 8, fp);
-  if      (memcmp(skip, Big_Endian_4_pattern, 4) == 0)    {hdr->bintype.endian = big_endian;    hdr->bintype.recordmarker = 4;}
-  else if (memcmp(skip, Big_Endian_8_pattern, 8) == 0)    {hdr->bintype.endian = big_endian;    hdr->bintype.recordmarker = 8;}
-  else if (memcmp(skip, Little_Endian_8_pattern, 8) == 0) {hdr->bintype.endian = little_endian; hdr->bintype.recordmarker = 8;}
-  else if (memcmp(skip, Little_Endian_4_pattern, 4) == 0) {hdr->bintype.endian = little_endian; hdr->bintype.recordmarker = 4;}
-  else {abinit_header_free(hdr); return NULL;}
-
-  if (debug) fprintf(stderr, "Binary file is in %s with a record-marker of %d bytes\n",
-	                       (hdr->bintype.endian == big_endian ? "Big Endian" : "Little Endian"), hdr->bintype.recordmarker);
-
-  /* start reading again from the beginning of the file */
-  rewind(fp);
-
-  /*The header
-   * The wavefunction files, density files, and potential files all begin with the same records,
-   * called the "header".
-   *
-   *character*6 :: codvsn
-   *integer :: headform,fform
-   *integer :: bantot,date,intxc,ixc,natom,ngfft(3),nkpt,npsp,
-   *nspden,nspinor,nsppol,nsym,ntypat,occopt,pertcase,usepaw
-   *integer :: usewvl, cplex, nspden
-   *double precision :: acell(3),ecut,ecutdg,ecutsm,ecut_eff,qptn(3),rprimd(3,3),stmbias,tphysel,tsmear
-   *integer :: istwfk(nkpt),nband(nkpt*nsppol),npwarr(nkpt),so_psp(npsp),&
-   *& symafm(nsym),symrel(3,3,nsym),typat(natom),nrhoijsel(nspden),rhoijselect(*,nspden)
-   *double precision :: kpt(3,nkpt),occ(bantot),tnons(3,nsym),znucltypat(ntypat),wtk(nkpt)
-   *character*132 :: title
-   *double precision :: znuclpsp,zionpsp
-   *integer :: pspso,pspdat,pspcod,pspxc,lmax,lloc,mmax=integers
-   *double precision :: residm,xred(3,natom),etotal,fermie,rhoij(*,nspden)
-   *
-   * write(unit=header) codvsn,headform,fform
-   * write(unit=header) bantot,date,intxc,ixc,natom,ngfft(1:3),&
-   *& nkpt,nspden,nspinor,nsppol,nsym,npsp,ntypat,occopt,pertcase,usepaw,&
-   *& ecut,ecutdg,ecutsm,ecut_eff,qptn(1:3),rprimd(1:3,1:3),stmbias,tphysel,tsmear,usewvl
-
-   * write(unit=header) istwfk(1:nkpt),nband(1:nkpt*nsppol),&
-   *& npwarr(1:nkpt),so_psp(1:npsp),symafm(1:nsym),symrel(1:3,1:3,1:nsym),typat(1:natom),&
-   *& kpt(1:3,1:nkpt),occ(1:bantot),tnons(1:3,1:nsym),znucltypat(1:ntypat),wtk(1:nkpt)
-   * do ipsp=1,npsp
-   *! (npsp lines, 1 for each pseudopotential ; npsp=ntypat, except if alchemical pseudo-atoms)
-   *  write(unit=unit) title,znuclpsp,zionpsp,pspso,pspdat,pspcod,pspxc,lmn_size
-   * enddo
-   *!(in case of usepaw==0, final record: residm, coordinates, total energy, Fermi energy)
-   * write(unit=unit) residm,xred(1:3,1:natom),etotal,fermie
-   *!(in case of usepaw==1, there are some additional records)
-   * if (usepaw==1)then
-   *  write(unit=unit)( pawrhoij(iatom)%nrhoijsel(1:nspden),iatom=1,natom), cplex, nspden
-   *  write(unit=unit)((pawrhoij(iatom)%rhoijselect(1:      nrhoijsel(ispden),ispden),ispden=1,nspden),iatom=1,natom),&
-   *&                 ((pawrhoij(iatom)%rhoijp     (1:cplex*nrhoijsel(ispden),ispden),ispden=1,nspden),iatom=1,natom)
-   * endif
-   */
-
-  /* skip first the recordmarker bytes */
-  bc += fread(skip, 1, hdr->bintype.recordmarker, fp);
-
-  /* code version */
-  bc += fread(hdr->codvsn, sizeof(char), 6, fp); hdr->codvsn[6] = '\0';
-  if (debug) fprintf(stderr, "codvsn = '%s' (code version)\n", hdr->codvsn); 
-
-  /* format of the header */
-  bc += binread(&hdr->headform, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "headform = '%d' (format of the header)\n", hdr->headform);
-
-  /* specification for data type: 2 for wf; 52 for density; 102 for potential */
-  bc += binread(&hdr->fform, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "fform = '%d' (2 for wf; 52 for density; 102 for potential)\n", hdr->fform);
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  /* total number of bands (sum of nband on all kpts and spins) */
-  bc += binread(&hdr->bantot, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "bantot = '%d' (sum of nband on all kpts and spins)\n", hdr->bantot);
-
-  /* starting date */
-  bc += binread(&hdr->date, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "date = '%d' (starting date)\n", hdr->date);
-
-  bc += binread(&hdr->intxc, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "intxc = '%d'\n", hdr->intxc);
-
-  bc += binread(&hdr->ixc, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ixc = '%d'\n", hdr->ixc);
-
-  bc += binread(&hdr->natom, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "natom = '%d'\n", hdr->natom);
-
-  /* failsafe */
-  if (hdr->natom <= 0) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: natom = %d is wrong!",  hdr->natom);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  bc += binread(&hdr->ngfft[0], 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ngfft[0] = '%d'\n", hdr->ngfft[0]);
-  bc += binread(&hdr->ngfft[1], 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ngfft[1] = '%d'\n", hdr->ngfft[1]);
-  bc += binread(&hdr->ngfft[2], 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ngfft[2] = '%d'\n", hdr->ngfft[2]);
-
-  bc += binread(&hdr->nkpt, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nkpt = '%d'\n", hdr->nkpt);
-
-  bc += binread(&hdr->nspden, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nspden = '%d'\n", hdr->nspden);
-
-  /* failsafe */
-  if (hdr->nspden != 1 && hdr->nspden != 2 && hdr->nspden != 4) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: nspden = %d is wrong!",  hdr->nspden);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  bc += binread(&hdr->nspinor, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nspinor = '%d'\n", hdr->nspinor);
-
-  bc += binread(&hdr->nsppol, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nsppol = '%d'\n", hdr->nsppol);
-
-  bc += binread(&hdr->nsym, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "nsym = '%d'\n", hdr->nsym);
-
-  bc += binread(&hdr->npsp, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "npsp = '%d'\n", hdr->npsp);
-
-  bc += binread(&hdr->ntypat, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ntypat = '%d'\n", hdr->ntypat);
-
-  bc += binread(&hdr->occopt, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "occopt = '%d'\n", hdr->occopt);
-
-  /* the index of the perturbation, 0 if GS calculation */
-  bc += binread(&hdr->pertcase, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "pertcase = '%d' (the index of the perturbation, 0 if GS calculation)\n", hdr->pertcase);
-
-  bc += binread(&hdr->usepaw, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "usepaw = '%d' (0=norm-conserving psps, 1=paw)\n", hdr->usepaw);
-
-  /* failsafe */
-  if (hdr->usepaw != 0 && hdr->usepaw != 1) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: usepaw = %d is wrong!", hdr->usepaw);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  bc += binread(&hdr->ecut, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecut = '%g'\n", hdr->ecut);
-
-  /* input variable (ecut for NC psps, pawecutdg for paw) */
-  bc += binread(&hdr->ecutdg, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecutdg = '%g' (ecut for NC psps, pawecutdg for paw)\n", hdr->ecutdg);
-
-  bc += binread(&hdr->ecutsm, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecutsm = '%g'\n", hdr->ecutsm);
-
-  /* ecut*dilatmx**2 (dilatmx is an input variable) */
-  bc += binread(&hdr->ecut_eff, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "ecut_eff = '%g' (ecut*dilatmx**2 [dilatmx is an input variable])\n", hdr->ecut_eff);
-
-  bc += binread(&hdr->qptn[0], 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "qptn[0] = '%g'\n", hdr->qptn[0]);
-  bc += binread(&hdr->qptn[1], 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "qptn[1] = '%g'\n", hdr->qptn[1]);
-  bc += binread(&hdr->qptn[2], 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "qptn[2] = '%g'\n", hdr->qptn[2]);
-
-  for (i = 0; i < 3; ++i) {
-    bc += binread(&hdr->rprimd[i][0], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "rprimd[%d][0] = '%g'\n", i, hdr->rprimd[i][0]);
-    bc += binread(&hdr->rprimd[i][1], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "rprimd[%d][1] = '%g'\n", i, hdr->rprimd[i][1]);
-    bc += binread(&hdr->rprimd[i][2], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "rprimd[%d][2] = '%g'\n", i, hdr->rprimd[i][2]);
-  }
-
-  bc += binread(&hdr->stmbias, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "stmbias = '%g'\n", hdr->stmbias);
-
-  bc += binread(&hdr->tphysel, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "tphysel = '%g'\n", hdr->tphysel);
-
-  bc += binread(&hdr->tsmear, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "tsmear = '%g'\n", hdr->tsmear);
-
-  bc += binread(&hdr->usewvl, 4, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "usewvl = '%d'\n", hdr->usewvl);
-
-  /* failsafe */
-  if (hdr->usewvl != 0 && hdr->usewvl != 1) {
-    fprintf(stderr, "ABINIT read) ERROR Binary Header: usewvl = %d is wrong!",  hdr->usewvl);
-    abinit_header_free(hdr);
-    return NULL;
-  }
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  hdr->istwfk = (int *)malloc(sizeof(int) * hdr->nkpt);
-  hdr->nband  = (int *)malloc(sizeof(int) * hdr->nkpt * hdr->nsppol);
-  hdr->npwarr = (int *)malloc(sizeof(int) * hdr->nkpt);
-  hdr->so_psp = (int *)malloc(sizeof(int) * hdr->npsp);
-  hdr->symafm = (int *)malloc(sizeof(int) * hdr->nsym);
-  hdr->typat  = (int *)malloc(sizeof(int) * hdr->natom);
-
-  if (!hdr->istwfk || !hdr->nband || !hdr->npwarr || !hdr->so_psp || !hdr->symafm || !hdr->typat) {
-    abinit_header_free(hdr);
-    return NULL;
-  }
-  for (i = 0; i < 3; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      hdr->symrel[i][j] = (int *)malloc(sizeof(int) * hdr->nsym);
-      if (!hdr->symrel[i][j]) {abinit_header_free(hdr); return NULL;}
-    }
-  }
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    bc += binread(&hdr->istwfk[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "istwfk[%d] = '%d'\n", i, hdr->istwfk[i]);
-  }
-
-  for (i = 0; i < hdr->nkpt * hdr->nsppol; ++i) {
-    bc += binread(&hdr->nband[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "nband[%d] = '%d'\n", i, hdr->nband[i]);
-  }
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    bc += binread(&hdr->npwarr[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "npwarr[%d] = '%d'\n", i, hdr->npwarr[i]);
-  }
-
-  for (i = 0; i < hdr->npsp; ++i) {
-    bc += binread(&hdr->so_psp[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "so_psp[%d] = '%d'\n", i, hdr->so_psp[i]);
-  }
-
-  for (i = 0; i < hdr->nsym; ++i) {
-    bc += binread(&hdr->symafm[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "symafm[%d] = '%d'\n", i, hdr->symafm[i]);
-  }
-
-  for (i = 0; i < hdr->nsym; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      int k;     
-      for (k = 0; k < 3; ++k) {
-        bc += binread(&hdr->symrel[k][j][i], 4, fp, hdr->bintype);
-        if (debug) fprintf(stderr, "symrel[%d][%d][%2d]= '%2d'", k, j, i, hdr->symrel[k][j][i]);
-      }
-      if (debug) fprintf(stderr, "\n");
-    }
-    if (debug) fprintf(stderr, "\n");
-  }
-
-  for (i = 0; i < hdr->natom; ++i) {
-    bc += binread(&hdr->typat[i], 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "typat[%d] = '%d'\n", i, hdr->typat[i]);
-  }
-
-  for (i = 0; i < 3; ++i) {
-    hdr->kpt[i] = (double *)malloc(sizeof(double) * hdr->nkpt);
-    hdr->tnons[i] = (double *)malloc(sizeof(double) * hdr->nsym);
-    if (!hdr->kpt[i] || !hdr->tnons[i]) {abinit_header_free(hdr); return NULL;}
-  }
-
-  hdr->occ = (double *)malloc(sizeof(double) * hdr->bantot);
-  hdr->znucltypat = (double *)malloc(sizeof(double) * hdr->ntypat);
-  hdr->wtk = (double *)malloc(sizeof(double) * hdr->nkpt);
-  if (!hdr->occ || !hdr->znucltypat || !hdr->wtk) {abinit_header_free(hdr); return NULL;}
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      bc += binread(&hdr->kpt[j][i], 8, fp, hdr->bintype);
-      if (debug) fprintf(stderr, "kpt[%d][%2d] = '%g'\n", j, i, hdr->kpt[j][i]);
-    }
-  }
-
-  for (i = 0; i < hdr->bantot; ++i) {
-    bc += binread(&hdr->occ[i], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "occ[%d] = '%g'\n", i, hdr->occ[i]);
-  }
-
-  for (i = 0; i < hdr->nsym; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      bc += binread(&hdr->tnons[j][i], 8, fp, hdr->bintype);
-      if (debug) fprintf(stderr, "tnons[%d][%2d] = '%g' ", j, i, hdr->tnons[j][i]);
-    }
-    if (debug) fprintf(stderr, "\n");
-  }
-
-  for (i = 0; i < hdr->ntypat; ++i) {
-    bc += binread(&hdr->znucltypat[i], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "znucltypat[%d] = '%g'\n", i, hdr->znucltypat[i]);
-  }
-
-  for (i = 0; i < hdr->nkpt; ++i) {
-    bc += binread(&hdr->wtk[i], 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "wtk[%d] = '%g'\n", i, hdr->wtk[i]);
-  }
-
-  for (i = 0; i < hdr->npsp; ++i) {
-
-    /* skip the recordmarker bytes two times */
-    bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-    bc += fread(hdr->title, sizeof(char), 132, fp); hdr->title[132] = '\0';
-    if (debug) fprintf(stderr, "title = '%s'\n", hdr->title);
-
-    bc += binread(&hdr->znuclpsp, 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "znuclpsp = '%g'\n", hdr->znuclpsp);
-
-    bc += binread(&hdr->zionpsp, 8, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "zionpsp = '%g'\n", hdr->zionpsp);
-
-    bc += binread(&hdr->pspso, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspso = '%d'\n", hdr->pspso);
-
-    bc += binread(&hdr->pspdat, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspdat = '%d'\n", hdr->pspdat);
-
-    bc += binread(&hdr->pspcod, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspcod = '%d'\n", hdr->pspcod);
-
-    bc += binread(&hdr->pspxc, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "pspxc = '%d'\n", hdr->pspxc);
-
-    bc += binread(&hdr->lmn_size, 4, fp, hdr->bintype);
-    if (debug) fprintf(stderr, "lmn_size = '%d'\n", hdr->lmn_size);
-  }
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  for (i = 0; i < 3; ++i) {
-    hdr->xred[i] = (double *)malloc(sizeof(double) * hdr->natom);
-    if (!hdr->xred[i]) {abinit_header_free(hdr); return NULL;}
-  }
-
-  bc += binread(&hdr->residm, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "residm = '%g'\n", hdr->residm);
-
-  for (i = 0; i < hdr->natom; ++i) {
-    int j;
-    for (j = 0; j < 3; ++j) {
-      bc += binread(&hdr->xred[j][i], 8, fp, hdr->bintype);
-      if (debug) fprintf(stderr, "xred[%d][%d] = '%g'\n", j, i, hdr->xred[j][i]);
-
-      /* failsafe */
-      if (hdr->xred[j][i] < -1 || hdr->xred[j][i] > 1) {
-        fprintf(stderr, "Binary Header Error: hdr->xred[%d][%d] = %g; something must be wrong!", j, i, hdr->xred[j][i]);
-        {abinit_header_free(hdr); return NULL;}
-      }
-    }
-  }
-
-  bc += binread(&hdr->etotal, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "etotal = '%g'\n", hdr->etotal);
-
-  bc += binread(&hdr->fermie, 8, fp, hdr->bintype);
-  if (debug) fprintf(stderr, "fermie = '%g'\n", hdr->fermie);
-
-  if (hdr->usepaw == 1) {
-    struct pawrhoij_t {
-      int *nrhoijsel;
-      int **rhoijselect;
-      double **rhoij;
-    };
-    struct pawrhoij_t *pawrhoij = malloc(hdr->natom * sizeof(struct pawrhoij_t));
-
-    for (i = 0; i < hdr->natom; ++i) {
-      int j;
-      pawrhoij[i].nrhoijsel = (int *)malloc(sizeof(int) * hdr->nspden);
-      if (!pawrhoij[i].nrhoijsel) {abinit_header_free(hdr); return NULL;}
-      for (j = 0; j < hdr->nspden; ++j){
-        bc += binread(&pawrhoij[i].nrhoijsel[j], 4, fp, hdr->bintype);
-        if (debug) fprintf(stderr, "pawrhoij[%d].nrhoijsel[%d] = '%d'\n", i, j, pawrhoij[i].nrhoijsel[j]);
-      }
-      pawrhoij[i].rhoijselect = (int **)malloc(sizeof(int) * hdr->nspden);
-      pawrhoij[i].rhoij = (double **)malloc(sizeof(double) * hdr->nspden);
-      if (!pawrhoij[i].rhoijselect || !pawrhoij[i].rhoij) {abinit_header_free(hdr); return NULL;}
-      for (j = 0; j < hdr->nspden; ++j) {
-        int k;
-        pawrhoij[i].rhoijselect[j] = (int *)malloc(sizeof(int) * pawrhoij[i].nrhoijsel[j]);
-        pawrhoij[i].rhoij[j] = (double *)malloc(sizeof(double) * pawrhoij[i].nrhoijsel[j]);
-        if (!pawrhoij[i].rhoijselect[j]) {abinit_header_free(hdr); return NULL;}
-        for (k = 0; k < pawrhoij[i].nrhoijsel[j]; ++k) {
-          bc += binread(&pawrhoij[i].rhoijselect[j][k], 4, fp, hdr->bintype);
-	 if (debug) fprintf(stderr, "pawrhoij[%d].rhoijselect[%d][%d] = '%d'\n", i, j, k, pawrhoij[i].rhoijselect[j][k]);
-        }
-        for (k = 0; k < pawrhoij[i].nrhoijsel[j]; ++k) {
-          bc += binread(&pawrhoij[i].rhoij[j][k], 8, fp, hdr->bintype);
-	 if (debug) fprintf(stderr, "pawrhoij[%d].rhoij[%d][%d] = '%g'\n", i, j, k, pawrhoij[i].rhoij[j][k]);
-        }
-      }
-      for (j = 0; j < hdr->nspden; ++j) {
-        free(pawrhoij[i].rhoijselect[j]);
-        free(pawrhoij[i].rhoij[j]);
-      }
-      free(pawrhoij[i].rhoijselect);
-      free(pawrhoij[i].rhoij);
-      free(pawrhoij[i].nrhoijsel);
-    }
-    free(pawrhoij);
-  } /* end of "if (usepaw == 1)" */
-
-  /* cplex depends on other variables:
-   * In GS calculations, cplex = 1.
-   * In response function calculations (non-zero pertcase), cplex = 1 at the gamma point (qpt=(0,0,0))
-   * and cplex = 2 if qpt/=(0,0,0).
-   */
-  hdr->cplex = 1;
-  if (hdr->pertcase != 0 && fabs(hdr->qptn[0]) > 10e-6 && fabs(hdr->qptn[1]) > 10e-6 && fabs(hdr->qptn[2]) > 10e-6) hdr->cplex = 2;
-
-
-  /* skip the recordmarker bytes two times */
-  bc += fread(skip, 1, 2 * hdr->bintype.recordmarker, fp);
-
-  if (debug) fprintf(stderr, "END OF BINARY FILE DEBUG INFO\n");
-
-  return hdr;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/avsplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/avsplugin.C
deleted file mode 100644
index d721b77b7ff69f0ee72b6f3721b533d72023a17e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/avsplugin.C
+++ /dev/null
@@ -1,579 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: avsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * AVS field files
- *
- * XXX - This plugin currently only supports the specific subset of AVS field
- * files that are produced by autodock. 'field' type must be 'uniform',
- * 'data' must be of type 'float', 'ndim' and 'nspace' must be 3, and
- * 'filetype' of all files referenced must be 'ascii'. 
- *
- * XXX - The plugin also expects the values to appear in a certain order,
- * this should definitely be fixed.
- *
- * More info for this format can be found at
- * <http://astronomy.swin.edu.au/~pbourke/geomformats/field/>
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 256
-
-typedef struct {
-  char filename[256]; /* XXX - LAME */
-  int filetype, skip, offset, stride;
-} datasource_t;
-
-typedef struct {
-  int nsets;
-  molfile_volumetric_t *vol;
-  datasource_t *data;
-} avsfield_t;
-
-enum {NONE, ASCII, BINARY, UNFORMATTED};  /* File types */
-enum {UNIFORM, IRREGULAR, RECTILINEAR};   /* Field types */
-enum {AVSFLOAT};                          /* Data types */
-
-/* Reads lines from the stream into the array pointed to by s.
- * Returns a pointer to s when the first non-comment line is read or NULL on
- * error.
- */
-static char *get_string(char *s, int n, FILE *stream) {
-  do {
-    if (fgets(s, n, stream) == NULL) {
-      fprintf(stderr, "avsplugin) Error reading string.\n");
-      return NULL;
-    }
-  } while (s[0] == '#');
-  return s;
-}
-
-/* Read information from a string and store it into a datasource structure.
- * Returns 0 on success, 1 on error.
- */
-static int read_datasource(char *s, datasource_t *data) {
-  char *src, *tok, *value;
-  src = strdup(s);
-  tok = strtok(src, " \t\n");
-
-  /* Load default values -- used if these attributes aren't set */
-  data->skip = 0;
-  data->offset = 0;
-  data->stride = 1;
-
-  /* Load default values -- must be changed */
-  data->filename[0] = '\0';
-  data->filetype = NONE;
-
-  /* The first word should be "coord" or "variable" */
-  if ( (strcasecmp(tok, "coord") != 0) && (strcasecmp(tok, "variable") != 0) ) {
-    fprintf(stderr, "avsplugin) Improperly formatted header: expected coord or variable.\n");
-    free(src);
-    return 1;
-  }
-
-  /* Next should be the integer ID of the data source */
-  tok = strtok(NULL, " \t\n");
-  if (!isdigit(*tok)) {
-    fprintf(stderr, "avsplugin) Improperly formatted header: expected ID.\n");
-    free(src);
-    return 1;
-  }
-
-  /* Now read the additional arguments */
-  tok = strtok(NULL, " \t\n");
-  while(tok) {
-    value = strchr(tok, '=');
-    if (!value) {
-      fprintf(stderr, "avsplugin) Error reading value.\n");
-      free(src);
-      return 1;
-    }
-    value++; /* Point to the first character after '=' */
-
-    if (strncasecmp(tok, "file=", value - tok) == 0) {
-      /* XXX - This should be changed to something safer */
-      strcpy(data->filename, value);
-    }
-    else if (strncasecmp(tok, "filetype=", value - tok) == 0) {
-      /* XXX - For now, only ascii files are recognized. Other possible
-       * values are "unformatted" for unformatted Fortran data, and "binary"
-       * for raw binary data.
-       */
-      if (strcasecmp(value, "ascii") == 0) {
-        data->filetype = ASCII;
-      }
-      else {
-        fprintf(stderr, "avsplugin) Non-ASCII files are not supported.\n");
-        free(src);
-        return 1;
-      }
-    }
-    else if (strncasecmp(tok, "skip=", value - tok) == 0) {
-      /* XXX - This should probably be more rigorous */
-      data->skip = atoi(value);
-    }
-    else if (strncasecmp(tok, "offset=", value - tok) == 0) {
-      /* XXX - This should probably be more rigorous */
-      data->offset = atoi(value);
-    }
-    else if (strncasecmp(tok, "stride=", value - tok) == 0) {
-      /* XXX - This should definitely be more rigorous -- we don't want
-       * stride set to 0 of the value isn't an integer. */
-      data->stride = atoi(value);
-    }
-    else {
-      /* XXX - For now, return with an error if there's an unrecognized
-       * argument. This should probably be changed.
-       */
-      fprintf(stderr, "avsplugin) Unrecognized argument.\n");
-      free(src);
-      return 1;
-    }
-
-    tok = strtok(NULL, " \t\n");
-  }
-
-  free(src);
-
-  /* Make sure the filename and filetype have been set */
-  if ((data->filename[0] == '\0') || (data->filetype == NONE)) {
-    fprintf(stderr, "avsplugin) Filename not set in options.\n");
-    return 1;
-  }
-  
-  return 0;
-}
-
-static void *open_avsfield_read(const char *filepath, const char *filetype, int *natoms) {
-  avsfield_t *avsfield;
-  FILE *fd;
-  char inbuf[LINESIZE], current_file[256];
-  int ndim, nspace, veclen, xsize, ysize, zsize, 
-      index, i, coord_count, var_count;
-  float value, origin[3], gridlength[3];
-  datasource_t *coord = NULL, *variable = NULL;
-
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "avsplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Check for an AVS file */
-  if (fgets(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    fprintf(stderr, "avsplugin) Error reading line.\n");
-    return NULL;
-  }
-  if (strncmp(inbuf, "# AVS", 5) != 0) {
-    fclose(fd);
-    fprintf(stderr, "avsplugin) Improperly formatted header.\n");
-    return NULL;
-  }
-
-  /* Check the number of dimensions */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "ndim=%d", &ndim) != 1) {
-    fprintf(stderr, "avsplugin) Error reading ndim.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (ndim != 3) {
-    fprintf(stderr, "avsplugin) Error: ndim must be 3.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Find the size of the grid in grid units */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "dim1=%d", &xsize) != 1) {
-    fprintf(stderr, "avsplugin) Error reading dim1.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "dim2=%d", &ysize) != 1) {
-    fprintf(stderr, "avsplugin) Error reading dim2.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "dim3=%d", &zsize) != 1) {
-    fprintf(stderr, "avsplugin) Error reading dim3.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Check the number of coordinates per point */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "nspace=%d", &nspace) != 1) {
-    fprintf(stderr, "avsplugin) Error reading nspace.\n");
-    fclose(fd);
-    return NULL;
-  }
-  if (nspace != 3) {
-    fprintf(stderr, "avsplugin) Error: nspace must be 3.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Find out how many values are stored for each point (the length of the
-   * vector for the vector field) */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (sscanf(inbuf, "veclen=%d", &veclen) != 1) {
-    fprintf(stderr, "avsplugin) Error reading veclen.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Check that the data type is "float" */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (strncmp(inbuf, "data=float", 10) != 0) {
-    fprintf(stderr, "avsplugin) Error reading data type.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Check that the field type is "uniform" */
-  if (get_string(inbuf, LINESIZE, fd) == NULL) {
-    fclose(fd);
-    return NULL;
-  }
-  if (strncmp(inbuf, "field=uniform", 13) != 0) {
-    fprintf(stderr, "avsplugin) Error reading field type.\n");
-    fclose(fd);
-    return NULL;
-  }
-
-  /* Allocate space for the coordinate and variable information 
-   * coord is deleted in this fuction, variable is deleted when the plugin
-   * is closed.
-   */
-  coord = new datasource_t[ndim];
-  variable = new datasource_t[veclen];
-
-  /* Find the coordinate information */
-  for (i = 0; i < ndim; i++) {
-    if (get_string(inbuf, LINESIZE, fd) == NULL) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if ( (sscanf(inbuf, "coord %d", &coord_count) != 1) || (coord_count != i+1) ) {
-    fprintf(stderr, "avsplugin) Error reading coord count.\n");
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if (read_datasource(inbuf, &coord[i])) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-  }
-
-  /* XXX - Ignore the labels (should be used for vol dataname) */
-  for (i = 0; i < veclen; i++) {
-    if (get_string(inbuf, LINESIZE, fd) == NULL) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-  }
-  
-  /* Find the variable information */
-  for (i = 0; i < veclen; i++) {
-    if (get_string(inbuf, LINESIZE, fd) == NULL) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if ( (sscanf(inbuf, "variable %d", &var_count) != 1) || (var_count != i+1) ) {
-      fprintf(stderr, "avsplugin) Error reading variable count.\n");
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-    if (read_datasource(inbuf, &variable[i])) {
-      delete[] coord;
-      fclose(fd);
-      return NULL;
-    }
-  }
-
-  /* Close the AVS file */
-  fclose(fd);
-  fd = NULL;
-
-  /* Read the coordinate file(s) to find the origin and grid size 
-   * XXX - this only works for "uniform" fields
-   */
-  for (i = 0; i < ndim; i++) {
-    if (strcmp(current_file, coord[i].filename) != 0) {
-      /* Close the old file if one was open, and open a new one */
-      if (fd) {
-        fclose(fd);
-        fd = NULL;
-      }
-      strcpy(current_file, coord[i].filename); /* XXX - unsafe */
-      fd = fopen(current_file, "rb");
-      if (!fd) {
-        fprintf(stderr, "avsplugin) Error opening file.\n");
-        delete[] coord;
-        return NULL;
-      }
-    }
-    else {
-      /* Return to the beginning of the file */
-      rewind(fd);
-    }
-
-    /* Skip the "skip" lines */
-    for (index = 0; index < coord[i].skip; index++) {
-      if (fgets(inbuf, LINESIZE, fd) == NULL) {
-        fprintf(stderr, "avsplugin) Error reading line.\n");
-        fclose(fd);
-        delete[] coord;
-        return NULL;
-      }
-    }
-
-    /* Skip the "offset" values */
-    for (index = 0; index < coord[i].offset; index++) {
-      if (fscanf(fd, " %f", &value) != 1) {
-        fprintf(stderr, "avsplugin) Error skipping offset.\n");
-        fclose(fd);
-        delete[] coord;
-        return NULL;
-      }
-    }
-
-    /* Read the origin, skip "stride" values, and read the end */
-    if (fscanf(fd, " %f", &value) != 1) {
-      fprintf(stderr, "avsplugin) Error reading origin.\n");
-      fclose(fd);
-      delete[] coord;
-      return NULL;
-    }
-    origin[i] = value;
-    for (index = 0; index < coord[i].stride; index++) {
-      if (fscanf(fd, " %f", &value) != 1) {
-        fprintf(stderr, "avsplugin) Error skipping stride.\n");
-        fclose(fd);
-        delete[] coord;
-        return NULL;
-      }
-    }
-    gridlength[i] = value - origin[i];
-  }
-
-  /* Free the coordinates */
-  delete[] coord;
-  coord = NULL;
-  fclose(fd);
-
-  /* Allocate and initialize the avsfield structure */
-  avsfield = new avsfield_t;
-  avsfield->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-
-  /* AVS field files can have an arbitrary number of sets */
-  avsfield->nsets = veclen;
-  avsfield->vol = new molfile_volumetric_t[veclen];
-  avsfield->data = variable;
-
-  for (i = 0; i < veclen; i++) {
-    /* strcpy(avsfield->vol[i].dataname, "AVS Field: "); */
-    sprintf(avsfield->vol[i].dataname, "AVS Field: %d", i);
-
-    avsfield->vol[i].origin[0] = origin[0];
-    avsfield->vol[i].origin[1] = origin[1];
-    avsfield->vol[i].origin[2] = origin[2];
-
-    avsfield->vol[i].xaxis[0] = gridlength[0];
-    avsfield->vol[i].xaxis[1] = 0;
-    avsfield->vol[i].xaxis[2] = 0;
-
-    avsfield->vol[i].yaxis[0] = 0;
-    avsfield->vol[i].yaxis[1] = gridlength[1];
-    avsfield->vol[i].yaxis[2] = 0;
-
-    avsfield->vol[i].zaxis[0] = 0;
-    avsfield->vol[i].zaxis[1] = 0;
-    avsfield->vol[i].zaxis[2] = gridlength[2];
-
-    avsfield->vol[i].xsize = xsize;
-    avsfield->vol[i].ysize = ysize;
-    avsfield->vol[i].zsize = zsize;
-
-    avsfield->vol[i].has_color = 0;
-  }
-
-  return avsfield;
-}
-
-static int read_avsfield_metadata(void *v, int *nsets,
-  molfile_volumetric_t **metadata) {
-  avsfield_t *avsfield = (avsfield_t *)v;
-  *nsets = avsfield->nsets;
-  *metadata = avsfield->vol;
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_avsfield_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  avsfield_t *avsfield = (avsfield_t *)v;
-  int skip, offset, stride, count, ndata, index;
-  float value, *cellIndex = datablock;
-  char inbuf[LINESIZE];
-  FILE *fd;
-  
-  fd = fopen(avsfield->data[set].filename, "rb");
-  if (!fd) {
-    fprintf(stderr, "avsplugin) Error opening file.\n");
-    return MOLFILE_ERROR; 
-  }
-
-  skip = avsfield->data[set].skip;
-  offset = avsfield->data[set].offset;
-  stride = avsfield->data[set].stride;
-
-  count = 0;
-  ndata = avsfield->vol[0].xsize * avsfield->vol[0].ysize * avsfield->vol[0].zsize;
-
-  /* Skip the "skip" lines */
-  for (index = 0; index < skip; index++) {
-    if (fgets(inbuf, LINESIZE, fd) == NULL) {
-      fprintf(stderr, "avsplugin) Error skipping lines.\n");
-      fclose(fd);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* Skip the "offset" values */
-  for (index = 0; index < offset; index++) {
-    if (fscanf(fd, " %f", &value) != 1) {
-      fprintf(stderr, "avsplugin) Error skipping offset.\n");
-      fclose(fd);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  while (count < ndata) {
-    /* Read a value into the datablock and skip "stride" values */
-    if (fscanf(fd, " %f", &value) != 1) {
-      fprintf(stderr, "avsplugin) Error reading data.\n");
-      fclose(fd);
-      return MOLFILE_ERROR;
-    }
-    *cellIndex = value;
-    cellIndex++;
-    count++;
-
-    for (index = 0; index < stride-1; index++) {
-      if (fscanf(fd, " %f", &value) != 1) {
-        fprintf(stderr, "avsplugin) Error skipping stride.\n");
-        fclose(fd);
-        return MOLFILE_ERROR;
-      }
-    }
-  }
-
-  fclose(fd);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_avsfield_read(void *v) {
-  avsfield_t *avsfield = (avsfield_t *)v;
-
-  if (avsfield->vol != NULL)
-    delete [] avsfield->vol;
-  if (avsfield->data != NULL)
-    delete [] avsfield->data;
-  delete avsfield;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(plugin));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "fld";
-  plugin.prettyname = "AVS Field";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "fld";
-  plugin.open_file_read = open_avsfield_read;
-  plugin.read_volumetric_metadata = read_avsfield_metadata;
-  plugin.read_volumetric_data = read_avsfield_data;
-  plugin.close_file_read = close_avsfield_read;
-
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/babelplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/babelplugin.c
deleted file mode 100644
index 23274d828f86e09df9f5ca1a5b82109723e7b6d3..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/babelplugin.c
+++ /dev/null
@@ -1,725 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: babelplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.49 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * Convert files using Babel 1.6
- *   http://www.eyesopen.com/products/applications/babel.html
- *
- * Convert files using Open Babel 1.100.2
- *   http://openbabel.sourceforge.net/babel.shtml
- */
-
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#if !defined(_MSC_VER) 
-#include <unistd.h>  /* for getuid */
-#endif
-
-#include "molfile_plugin.h"
-#include "readpdb.h"
-#include "vmddir.h"
-#include "periodic_table.h"
-
-typedef struct {
-  FILE *fd;
-  int natoms;
-  char *original_file;
-  char *current_file;
-  int babel_num;
-  int babel_i;
-} pdbdata;
-
-/* 
- * I guess this is to try to keep tmp files from clobbering each other
- */
-static int vmd_getuid(void) {
-#if defined(_MSC_VER)
-  return 0;
-#else
-  return getuid();
-#endif
-}
-
-static int vmd_delete_file(const char * path) {
-#if defined(_MSC_VER)
-  if (DeleteFile(path) == 0)
-    return -1;
-  else
-    return 0;
-#else
-  return unlink(path);
-#endif
-}
-
-#define BABEL_TMPDIR "/tmp/"
-
-/*
- * Dude, don't even think for a minute that I came up with this code.  It's
- * copied from BabelConvert.C, ok?
- * This gets called three times, with has_multi = 1, -2, and -1.  Don't ask
- * me why.
- */
-static char *file(const char *filename, int idx, int has_multi) {
-   /* temp space to save the filename or glob */
-   int i=0;
-   char *ptr;
-   char *tempspace = (char *)malloc(513);
-   const char *s;
-   for (s = filename; *s != 0; s++) { 
-      if ((*s == '/') || (*s == '\\'))
-        i = s-filename+1;
-   }
-   /*
-   // so filename+i points to the actual name
-   // if there are multiple files in the conversion, then the output
-   // looks like "test0041.extensions".  If there was a single file,
-   // the output looks like "test.extensions"
-   */
-   if (has_multi == -1) {
-      sprintf(tempspace, "%svmdbabel*.u%d.%s", BABEL_TMPDIR,
-              vmd_getuid(), filename + i);
-   } else if (has_multi == -2) {
-      char *reallytemp = (char *)malloc(strlen(filename+i)+1);
-      strcpy(reallytemp, filename+i);
-      *(reallytemp + strlen(reallytemp) - 1) = 0;
-      sprintf(tempspace, "vmdbabel%%[0-9.]u%d.%s%%c",
-              vmd_getuid(), reallytemp);
-      free(reallytemp);
-   } else if (has_multi == 0) {
-      sprintf(tempspace, "%svmdbabel.u%d.%s", BABEL_TMPDIR,
-              vmd_getuid(), filename + i);
-   } else {
-      sprintf(tempspace, "%svmdbabel%04d.u%d.%s", BABEL_TMPDIR, idx+1,
-              vmd_getuid(), filename + i);
-   }
-   for (ptr = tempspace; *ptr; ptr++) {  /* babel makes them lowercase! */
-      *ptr = tolower(*ptr);              /* grrrrrrr                    */
-   }
-   return tempspace;
-}
-
-static void delete_all(const char *filename) {
-  const char *s;
-  char *t;
-
-  s = file(filename, 0, -1); /* puts a '*' in number field */
-  t = (char *)malloc(strlen(s) + 35);
-#if defined(_MSC_VER)
-   sprintf(t, "del %s", s);
-#else
-   sprintf(t, "/bin/rm -f \"%s\"", s);
-#endif
-  system(t);
-  free(t);
-}
- 
-static void *open_pdb_read(const char *filepath, int *natoms) {
-  FILE *fd;
-  pdbdata *pdb;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx;
-  fd = fopen(filepath, "r");
-  if (!fd) return NULL;
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->fd = fd;
-  *natoms = 0;
-  do {
-    if((indx = read_pdb_record(pdb->fd, pdbstr)) == PDB_ATOM)
-      *natoms += 1;
-  } while (indx != PDB_END && indx != PDB_EOF);
-  rewind(pdb->fd);
-  pdb->natoms = *natoms;
-  return pdb;
-}
-
-/*
- * Babel 1.6 internal file type names
- */
-static const char *babel16filetypes[] = {
-"alc",
-"prep",
-"bs",
-"bgf",
-"car",
-"boog",
-"caccrt",
-"cadpac",
-"charmm",
-"c3d1",
-"c3d2",
-"cssr",
-"fdat",
-"gstat",
-"dock",
-"dpdb",
-"feat",
-"fract",
-"gamout",
-"gzmat",
-"gauout",
-"g94",
-"gr96A",
-"gr96N",
-"hin",
-"sdf",
-"m3d",
-"macmol",
-"macmod",
-"micro",
-"mm2in",
-"mm2out",
-"mm3",
-"mmads",
-"mdl",
-"molen",
-"mopcrt",
-"mopint",
-"mopout",
-"pcmod",
-"psin",
-"psout",
-"msf",
-"schakal",
-"shelx",
-"smiles",
-"spar",
-"semi",
-"spmm",
-"mol",
-"mol2",
-"wiz",
-"unixyz",
-"xyz",  
-"xed",
-0
-};
-
-/*
- * Plugin names registered in VMD for each Babel 1.6 file type
- */
-static const char *babel16filetypenames[] = {
-  "Alchemy",          "AMBERPREP",       "BallStick",      
-  "MSIBGF",           "BiosymCAR",       "Boogie",
-  "Cacao",            "CADPAC",          "CHARMm",
-  "Chem3d-1",         "Chem3d-2",        "CSSR",
-  "FDAT",             "GSTAT",           "Dock",
-  "DockPDB",          "Feature",         "Fractional",    
-  "GAMESSoutput",     "GaussianZmatrix", "Gaussian92output", 
-  "Gaussian94output", "Gromos96A",       "Gromos96N",
-  "HyperchemHIN",     "IsisSDF",         "M3D",
-  "MacMolecule",      "Macromodel",      "MicroWorld",
-  "MM2Input",         "MM2Output",       "MM3",
-  "MMADS",            "MDLMOL",          "MOLIN",
-  "MopacCartesian",   "MopacInternal",   "MopacOutput",
-  "PCModel",          "PSGVBin",         "PSGVBout",
-  "QuantaMSF",        "Schakal",         "ShelX",
-  "SMILES",
-  "Spartan",          "SpartanSE",       "SpartanMM",
-  "SybylMol",         "SybylMol2",       "Conjure",
-  "UniChemXYZ",       "XYZ",             "XED", 
-  0
-};
-
-
-/*
- * Open Babel 1.100.2 internal file type names
- */
-static const char *openbabel11filetypes[] = {
-"alc",
-"prep",
-"bs",
-"caccrt",
-"ccc",
-"c3d1",
-"c3d2",
-"cml",
-"crk2d",
-"crk3d",
-"box",
-"dmol",
-"feat",
-"gam",
-"gpr",
-"mm1gp",
-"qm1gp",
-"hin",
-"jout",
-"bin",
-"mmd",
-"car",
-"sdf",
-"mol",
-"mopcrt",
-"mopout",
-"mmads",
-"mpqc",
-"bgf",
-"nwo",
-"pqs",
-"qcout",
-"res",
-"smi",
-"mol2",
-"unixyz",
-"vmol",
-"xyz",
-0
-};
-
-/*
- * Plugin names registered in VMD for each Open Babel 1.100.2 file type
- */
-static const char *openbabel11filetypenames[] = {
-  "Alchemy",          "AMBERPREP",       "BallStick",      
-  "Cacao",            "CCC",           
-  "Chem3d-1",         "Chem3d-2",        "ChemicalMarkup"
-  "CRK2D",            "CRK3D",           "Dock35Box",
-  "Dmol3Coord",       "Feature",         "GAMESSoutput",     
-  "GhemicalProj",     "GhemicalMM",      "GhemicalQM",
-  "HyperchemHIN",     "JaguarOutput",    "OpenEyeBinary",
-  "Macromodel",       "BiosymCAR",       "IsisSDF",
-  "MDLMOL",           "MopacCartesian",  "MopacOutput",     
-  "MMADS",            "MPQC",            "MSIBGF",  
-  "NWChemOutput",     "PQS",             "QChemOutput",
-  "ShelX",            "SMILES",          "SybylMol2",   
-  "UniChemXYZ",       "ViewMol",         "XYZ",
-  0
-};
-
-
-static const char *babel16type_from_name(const char *name) {
-  const char **ptr = babel16filetypenames;
-  int i=0;
-  while (*ptr) {
-    if (!strcmp(*ptr, name))
-      return babel16filetypes[i];
-    ptr++;
-    i++;
-  }
-  return NULL;
-}
-
-static const char *babel16type_support(const char *filetype) {
-  const char **ptr = babel16filetypes;
-  int i=0;
-  while (*ptr) {
-    if (!strcmp(*ptr, filetype))
-      return babel16filetypes[i];
-    ptr++;
-    i++;
-  }
-  return NULL;
-}
-
-static const char *openbabel11type_from_name(const char *name) {
-  const char **ptr = openbabel11filetypenames;
-  int i=0; 
-  while (*ptr) {
-    if (!strcmp(*ptr, name))
-      return openbabel11filetypes[i];
-    ptr++;
-    i++;
-  }
-  return NULL;
-}
-
-
-/* 
- * Figure out the file type, call babel, and return a handle if successful.
- * From this point we're just reading in a pdb file.
- */
-static void *open_babel_read(const char *filename, const char *filetypename,
-    int *natoms) {
-
-  const char *babelbin;
-  char *current_file;
-  pdbdata *pdb;
-  char *s;
-  const char *fmt;
-  int count = 0;
-  VMDDIR *dirp;
-  char *dp;
-  char temps[100];
-  char tempc;
-  char lastc;
-  int may_have_multi = 0;
-  char *tmp_multi = NULL;
-  const char *filetype;
-
-  babelbin = getenv("VMDBABELBIN");
-  if (!babelbin) {
-    fprintf(stderr, "Babel plugin needs VMDBABELBIN environment variable\n"
-                    "to point to location of Babel executable\n");
-    return NULL;
-  }
-
-#if 0
-  /* Try Open Babel file type names first... */ 
-  filetype = openbabel11type_from_name(filetypename);
-  if (!filetype) {
-    fprintf(stderr, "No Open Babel 1.100.2 file type for '%s'\n", filetypename);
-  }
-#endif
-
-  /* Try Babel 1.6 file type names if Open Babel didn't match */ 
-  //filetype = babel16type_from_name(filetypename);
-  filetype = babel16type_support(filetypename);
-  if (!filetype) {
-    fprintf(stderr, "No Babel 1.6 file type for '%s'\n", filetypename);
-    return NULL;
-  }
-  s = (char *)malloc(strlen(babelbin) +               
-              strlen(" -i       -opdb ") +
-              strlen(filename) +
-              strlen(file(filename, 0, 1)) +
-              20);
- 
-  /*
-  // On windows its necessary to quote command names due to
-  // the high tendency for paths to have spaces in them.
-  */
-  //sprintf(s, "\"%s\" -i%s \"%s\" all -opdb \"%s\"",
-  sprintf(s, "\"%s\" -i%s \"%s\" -opdb \"%s\"",
-     babelbin, filetype, filename, (const char *)file(filename, 0, 0));
-
-  delete_all(filename);       /* delete any conflicting existing files  */
-  system(s);                  /* run the babel command                  */
-  free(s);
-
-  /* now find how many frames were printed */
-  fmt = file(filename, 0, -2);
-  dirp = vmd_opendir(BABEL_TMPDIR);
-  if (dirp == NULL) {
-    return NULL; /* failure */
-  }
- 
-   lastc = *(filename + strlen(filename) -1);
-
-   while ((dp = vmd_readdir(dirp)) != NULL) {
-      if (sscanf(dp, fmt, temps, &tempc) > 1 && lastc == tempc) {
-     count++;
-     /* check if there is 1 element but Babel thinks there are several */
-     if (count == 1) {
-        if (strstr(dp, "0001.")) {
-           may_have_multi = 1;
-           tmp_multi = strdup(dp);
-        }
-     }
-      }
-   }
-   vmd_closedir(dirp);
-
-   if (may_have_multi && count == 1) {
-      /* then move the test0001.extension file to test.extension */
-      char *s2, *t2;
-      s2 = (char *)malloc(2*(strlen(tmp_multi)+strlen(BABEL_TMPDIR))+40);
-
-#if defined(_MSC_VER)
-      sprintf(s2, "move \"%s\\%s\" \"%s\\\"", BABEL_TMPDIR, tmp_multi, BABEL_TMPDIR);
-#else
-      sprintf(s2, "mv \"%s/%s\" \"%s/\"", BABEL_TMPDIR, tmp_multi, BABEL_TMPDIR);
-#endif
-
-      t2 = strstr(tmp_multi, "0001.");
-      *t2 = 0;
-      strcat(s2, tmp_multi);
-      strcat(s2, t2 + 4);
-      fprintf(stderr, "%s\n", s2);
-      system(s2);
-      free(s2);
-   }
-
-   if (tmp_multi) {
-      free(tmp_multi);
-   }
-
-  /*
-   * Ok, now that we're done with all that crap, we should have a bunch
-   * of temp files.  Now we need to open the first one to get the
-   * number of atoms.
-   */
-  if (count == 0) {
-    fprintf(stderr, "Babel molecule file translation failed!\n");
-    return NULL;
-  }
-  current_file = file(filename, 0, count > 1);
-  pdb = open_pdb_read(current_file, natoms);
-  if (!pdb) {
-    fprintf(stderr, "Couldn't read structure from Babel pdb output\n");
-    free(current_file);
-    return NULL;
-  }
-  pdb->original_file = strdup(filename); 
-  pdb->current_file = current_file;
-  pdb->babel_num = count;
-  pdb->babel_i = 1;
-  return pdb;
-}
-
-static int read_pdb_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) {
-  pdbdata *pdb = (pdbdata *)mydata;
-  molfile_atom_t *atom;
-  char pdbrec[PDB_BUFFER_LENGTH];
-  int i, rectype, atomserial, pteidx;
-  char ridstr[8];
-  char elementsymbol[3];
-  int badptecount = 0;
-  long fpos = ftell(pdb->fd);
- 
-  *optflags = MOLFILE_INSERTION | MOLFILE_OCCUPANCY | MOLFILE_BFACTOR | 
-              MOLFILE_ALTLOC | MOLFILE_ATOMICNUMBER;
-
-  i = 0;
-  do {
-    rectype = read_pdb_record(pdb->fd, pdbrec);
-    switch (rectype) {
-    case PDB_ATOM:
-      atom = atoms+i;
-      get_pdb_fields(pdbrec, strlen(pdbrec), &atomserial,
-          atom->name, atom->resname, atom->chain, atom->segid, 
-          ridstr, atom->insertion, atom->altloc, elementsymbol,
-          NULL, NULL, NULL, &atom->occupancy, &atom->bfactor);
-      atom->resid = atoi(ridstr);
-
-      /* determine atomic number from the element symbol */
-      pteidx = get_pte_idx_from_string(elementsymbol);
-      atom->atomicnumber = pteidx;
-      if (pteidx != 0) {
-        atom->mass = get_pte_mass(pteidx);
-        atom->radius = get_pte_vdw_radius(pteidx);
-      } else {
-        badptecount++; /* unrecognized element */
-      }
-      strcpy(atom->type, atom->name);
-      i++;
-      break;
-    default:
-      break;
-    }
-  } while (rectype != PDB_END && rectype != PDB_EOF);
-
-  fseek(pdb->fd, fpos, SEEK_SET);
-
-  /* if all atoms are recognized, set the mass and radius flags too,  */
-  /* otherwise let VMD guess these for itself using it's own methods  */
-  if (badptecount == 0) {
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx, i;
-  float *x, *y, *z;
-  float occup[1], beta[1];
-  if (ts) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = 0;
-  }
-  i = 0;
-  if (!pdb->fd) 
-    return MOLFILE_ERROR;
-
-  /* Read the rest of the frames in the current fd.  If there aren't any
-   * more close it and go on to the next one.  If there aren't any more frames,
-   * return MOLFILE_ERROR (-1);
-   */
-  
-  while (i < pdb->natoms) {
-    indx = read_pdb_record(pdb->fd, pdbstr);
-    if(indx == PDB_ATOM) {
-      /* just get the coordinates, and store them */
-      if (ts) {
-        get_pdb_coordinates(pdbstr, x, y, z, occup, beta);
-        x += 3;
-        y += 3;
-        z += 3;
-        i++;
-      }
-    } else if (indx == PDB_CRYST1) {
-      if (ts) {
-        get_pdb_cryst1(pdbstr, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    } else if (indx == PDB_EOF) {
-      if (i == 0) {
-        /* Need to start a new frame, if possible */
-        fclose(pdb->fd);
-        pdb->fd = 0;
-        vmd_delete_file(pdb->current_file);
-        free(pdb->current_file);
-        pdb->current_file = 0;
-        pdb->babel_i++;
-        if (pdb->babel_i >= pdb->babel_num) 
-          return MOLFILE_ERROR; 
-        pdb->current_file = file(pdb->original_file, pdb->babel_i, pdb->babel_num > 1); 
-        pdb->fd = fopen(pdb->current_file, "r");
-        if (!pdb->fd) {
-          fprintf(stderr, 
-            "Couldn't read babel output file %s\n", pdb->current_file); 
-          free(pdb->current_file);
-          pdb->current_file = 0;
-          return MOLFILE_ERROR; 
-        } 
-      } else {
-        /* premature end */
-        fprintf(stderr, "PDB file %s contained too few atoms\n", pdb->current_file);
-        return MOLFILE_ERROR;
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS; 
-}
-
-/* 
- * Free the pdb handle, and delete all the babel temp files.
- */
-static void close_pdb_read(void *v) {
-  pdbdata *pdb = (pdbdata *)v;
-  if (!pdb) return;
-  if (pdb->fd) {
-    fclose(pdb->fd);
-    pdb->fd = 0;
-    vmd_delete_file(pdb->current_file);
-    free(pdb->current_file);
-  }
-  free(pdb);
-}
-
-
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t *plugins;
-static int nplugins;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-#if defined(_MSC_VER)
-  return VMDPLUGIN_SUCCESS;
-#else
-  /* register all Babel 1.6 conversion options */
-  const char **s = babel16filetypenames;
-  int i;
-  nplugins = 0;
-  while (*s) { nplugins++; s++; }
-  plugins = (molfile_plugin_t*)calloc(nplugins, sizeof(molfile_plugin_t));
-  for (i=0; i<nplugins; i++) {
-    plugins[i].abiversion = vmdplugin_ABIVERSION;         /* ABI version */
-    plugins[i].type = MOLFILE_CONVERTER_PLUGIN_TYPE;      /* type of plugin */
-    plugins[i].name = babel16filetypenames[i];            /* name of plugin */
-    plugins[i].prettyname = babel16filetypenames[i];      /* name of plugin */
-    plugins[i].author = "Justin Gullingsrud, John Stone"; /* author */
-    plugins[i].majorv = 1;                                /* major version */
-    plugins[i].minorv = 13;                               /* minor version */
-    plugins[i].is_reentrant = VMDPLUGIN_THREADUNSAFE;     /* is not reentrant */
-    plugins[i].filename_extension = babel16filetypes[i];  /* file extension */
-    plugins[i].open_file_read = open_babel_read;
-    plugins[i].read_structure = read_pdb_structure;
-    plugins[i].read_next_timestep = read_next_timestep;
-    plugins[i].close_file_read = close_pdb_read;
-  }
-
-#if 0
-  /* register all Open Babel 1.100.2 conversion options */
-  const char **s = openbabel11filetypenames;
-  int i;
-  nplugins = 0;
-  while (*s) { nplugins++; s++; }
-  plugins = (molfile_plugin_t*)calloc(nplugins, sizeof(molfile_plugin_t));
-  for (i=0; i<nplugins; i++) {
-    plugins[i].abiversion = vmdplugin_ABIVERSION;         /* ABI version */
-    plugins[i].type = MOLFILE_CONVERTER_PLUGIN_TYPE;      /* type of plugin */
-    plugins[i].shortname = openbabel11filetypenames[i];   /* name of plugin */
-    plugins[i].prettyname = openbabel11filetypenames[i];  /* name of plugin */
-    plugins[i].author = "Justin Gullingsrud, John Stone"; /* author */
-    plugins[i].majorv = 2;                                /* major version */
-    plugins[i].minorv = 12;                               /* minor version */
-    plugins[i].is_reentrant = VMDPLUGIN_THREADUNSAFE;     /* is not reentrant */
-    plugins[i].filename_extension = openbabel11filetypes[i];  /* file extension */
-    plugins[i].open_file_read = open_babel_read;
-    plugins[i].read_structure = read_pdb_structure;
-    plugins[i].read_next_timestep = read_next_timestep;
-    plugins[i].close_file_read = close_pdb_read;
-  }
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-#endif
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-#if defined(_MSC_VER)
-  return VMDPLUGIN_SUCCESS;
-#else
-  int i;
-  for (i=0; i<nplugins; i++) {
-    (*cb)(v, (vmdplugin_t *)(plugins+i));
-  }
-  return VMDPLUGIN_SUCCESS;
-#endif
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-#if defined(_MSC_VER)
-  return VMDPLUGIN_SUCCESS;
-#else
-  free(plugins);
-  nplugins = 0;
-  plugins = 0;
-  return VMDPLUGIN_SUCCESS;
-#endif
-}
-
-
-#ifdef TEST_BABEL_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_header_t header;
-  molfile_timestep_t timestep;
-  void *v;
-
-  while (--argc) {
-    ++argv;
-    v = open_babel_read(*argv, "xyz", &header);
-    if (!v) {
-      fprintf(stderr, "open_babel_read failed for file %s\n", *argv);
-      return 1;
-    }
-    timestep.coords = (float *)malloc(3*sizeof(float)*header.numatoms);
-    while (!read_next_timestep(v, &timestep));
-    close_pdb_read(v);
-  }
-  return 0;
-}
-
-
-#endif
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/basissetplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/basissetplugin.c
deleted file mode 100644
index 9b803a7613acc7f3cccbf38b917903f647c9a377..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/basissetplugin.c
+++ /dev/null
@@ -1,739 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: basissetplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* *******************************************************
- *
- *          B A S I S    S E T    P L U G I N 
- *
- * This plugin reads basis sets for quantum chemical
- * calculations. The basis set must be in the GAMESS format.
- * Such files can be downloaded for virtually any basis set
- * from the EMSL basis set exchange website:
- * https://bse.pnl.gov/bse/portal
- *
- * ********************************************************/
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-#include <math.h>
-
-#include "qmplugin.h"
-#include "unit_conversion.h"
- 
-#define ANGSTROM 0
-#define BOHR     1
-#define SPIN_ALPHA 0
-#define SPIN_BETA  1
-
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifdef GAMESS_DEBUG
-#define PRINTERR fprintf(stderr, "\n In file %s, line %d: \n %s \n \n", \
-                            __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-
-#define UNK_SHELL -666
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL -2
-#define SP_P_SHELL -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-
-#define FOUND   1
-#define STOPPED 2
-
-#define NUM_ELEMENTS 109
-
-/* Translation table for element to atomic numbers for element
- * names used Gamess format files from EMSL */
-static const char *elements[] = { 
-  "(unknown)", "HYDROGEN", "HELIUM", "LITHIUM", "BERYLLIUM", "BORON",
-  "CARBON", "NITROGEN", "OXYGEN", "FLUORINE", "NEON",
-  "SODIUM", "MAGNESIUM", "ALUMINUM", "SILICON", "PHOSPHOROUS",
-  "SULFUR", "CHLORINE", "ARGON", "POTASSIUM", "CALCIUM", "SCANDIUM",
-  "TITANIUM", "VANADIUM", "CHROMIUM", "MANGANESE", "IRON", "COBALT",
-  "NICKEL", "COPPER", "ZINC", "GALLIUM", "GERMANIUM", "ARSENIC",
-  "SELENIUM", "BROMINE", "KRYPTON",
-  "RUBIDIUM", "STRONTIUM", "YTTRIUM", "ZIRCONIUM", "NIOBIUM",
-  "MOLYBDENUM", "TECHNETIUM", "RUTHENIUM", "RHODIUM", "PALLADIUM",
-  "SILVER", "CADMIUM", "INDIUM", "TIN", "ANTIMONY", "TELLURIUM",
-  "IODINE", "XENON",
-  "CESIUM", "BARIUM", "LANTHANUM", "CER", "PRASEODYMIUM", "NEODYMIUM",
-  "PROMETIUM", "SAMARIUM", "EUROPIUM", "GADOLIUM", "TERBIUM",
-  "DYSPROSIUM", "HOLMIUM", "ERBIUM", "THULIUM", "YTTERBIUM", 
-  "LUTETIUM", "HAFNIUM", "TANTALUM", "TUNGSTEN", "RHENIUM", "OSMIUM",
-  "IRIDIUM", "PLATINUM", "GOLD", "MERCURY", "THALLIUM", "LEAD",
-  "BISMUTH", "POLONIUM", "ASTATINE", "RADON",
-  "FRANCIUM", "RADIUM", "ACTINIUM", "THORIUM", "PROTACTINIUM", 
-  "URANIUM", "NEPTUNIUM", "PLUTONIUM", "AMERICIUM", "CURIUM", 
-  "BERKELIUM", "CALIFORNIUM", "EINSTEINIUM", "FERMIUM", "MENDELEVIUM",
-  "NOBELIUM", "LAWRENCIUM", "RUTHERFORDIUM", "DUBNIUM", "SEABORGIUM",
-  "BOHRIUM", "HASSIUM", "MEITNERIUM"};
-
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-static void print_input_data(qmdata_t *);
-
-
-/* the function get_basis we also parse the basis function section to
- * determine the number of basis functions, contraction
- * coefficients. For Pople/Huzinga style basis sets
- * this numbers are in principle fixed, and could hence
- * be provided by the the plugin itself; however, the user might
- * define his own basis/contraction coeffients and hence reading
- * them from the input file seem to be somewhat more general. */
-static int get_basis (qmdata_t *);
-
-
-/* read all primitives for the current shell */
-static int read_shell_primitives(qmdata_t *, prim_t **prim,
-                                 char *shellsymm, int icoeff);
-
-/* convert shell type from char to int */
-static int shelltype_int(char type);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(qmdata_t *);
-
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the file and get the number
- * of atoms.
- *
- * *************************************************************/
-static void *open_basis_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  qmdata_t *data;
-
-  
-  /* open the input file */
-  fd = fopen(filename, "rb");
- 
-  if (!fd) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* allocate memory for main data structure */
-  data = (qmdata_t *)calloc(1,sizeof(qmdata_t));
-
-  /* make sure memory was allocated properly */
-  if (data == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  data->num_shells = 0;
-  data->num_basis_funcs = 0;
-  data->num_basis_atoms = 0;
-
-  /* initialize some of the character arrays */
-  memset(data->basis_string,0,sizeof(data->basis_string));
-
-  /* store file pointer in qmdata_t struct */
-  data->file = fd;
-
-  /* Read the basis set */
-  if (!get_basis(data)) return NULL; 
-
-
-  /* provide VMD with the proper number of atoms */
-  *natoms = 0;
-
-  /* Test print the parsed data in same format as logfile */
-  print_input_data(data);
-
-  return data;
-}
-
-
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_basis_metadata(void *mydata, 
-    molfile_qm_metadata_t *metadata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  metadata->ncart = 0;
-  metadata->nimag = 0;
-  metadata->nintcoords = 0;
-
-  metadata->have_sysinfo = 0;
-  metadata->have_carthessian = 0;
-  metadata->have_inthessian = 0;
-  metadata->have_normalmodes = 0;
-
-  /* orbital + basis set data */
-  metadata->num_basis_funcs = data->num_basis_funcs;
-  metadata->num_basis_atoms = data->num_basis_atoms;
-  metadata->num_shells      = data->num_shells;
-  metadata->wavef_size      = 0;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_basis_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i;
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-
-/*   strncpy(sys_data->basis_string, data->basis_string, */
-/*           sizeof(sys_data->basis_string)); */
-
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->num_basis_atoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-      basis_data->atomic_number[i] = data->atomicnum_per_basisatom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_types[i] = data->shell_types[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-
-/**********************************************************
- *
- * clean up when done and free all the memory do avoid
- * memory leaks
- *
- **********************************************************/
-static void close_basis_read(void *mydata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->basis);
-  free(data->shell_types);
-  free(data->atomicnum_per_basisatom);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->angular_momentum);
-  free(data->filepos_array);
-
-  if (data->basis_set) {
-    for(i=0; i<data->num_basis_atoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-#define TORF(x) (x ? "T" : "F")
-
-static void print_input_data(qmdata_t *data) {
-  int i, j, k;
-  int primcount=0;
-  int shellcount=0;
-
-/*   printf("\n"); */
-/*   printf("     BASIS OPTIONS\n"); */
-/*   printf("     -------------\n"); */
-/*   printf("%s\n", data->basis_string); */
-/*   printf("\n\n\n"); */
-  printf("\n");
-  printf("     ATOMIC BASIS SET\n");
-  printf("     ----------------\n");
-  printf(" THE CONTRACTED PRIMITIVE FUNCTIONS HAVE BEEN UNNORMALIZED\n");
-  printf(" THE CONTRACTED BASIS FUNCTIONS ARE NOW NORMALIZED TO UNITY\n");
-  printf("\n");
-  printf("  SHELL TYPE  PRIMITIVE        EXPONENT          CONTRACTION COEFFICIENT(S)\n");
-  printf("\n");
-
-  printf(" =================================================================\n");
-  for (i=0; i<data->num_basis_atoms; i++) {
-    printf("%-8d (%10s)\n\n", data->basis_set[i].atomicnum, data->basis_set[i].name);
-    printf("\n");
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j,
-               data->basis_set[i].shell[j].type,
-               primcount+1,
-               data->basis_set[i].shell[j].prim[k].exponent,
-               data->basis_set[i].shell[j].prim[k].contraction_coeff);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-  printf("\n");
-  printf(" TOTAL NUMBER OF BASIS SET SHELLS             =%5d\n", data->num_shells);
-  printf(" TOTAL NUMBER OF ATOMS                        =%5i\n", data->numatoms);
-  printf("\n");
-}
-
-
-
-
-/*******************************************************
- *
- * this function reads in the basis set data 
- *
- * ******************************************************/
-int get_basis(qmdata_t *data) {
-
-  char buffer[BUFSIZ];
-  char word[4][BUFSIZ];
-  int i = 0; 
-  int success = 0;
-  int numread, numshells;
-  shell_t *shell;
-  long filepos;
-
-  /* initialize buffers */
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-  
-  if (!pass_keyline(data->file, "$DATA", NULL))
-    printf("basissetplugin) No basis set found!\n");
-
-
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  data->basis_set = (basis_atom_t*)calloc(1, sizeof(basis_atom_t));
-
-
-  i = 0; /* basis atom counter */
-
-  do {
-    prim_t *prim = NULL;
-    char shelltype;
-    int numprim = 0;
-    int icoeff = 0;
-    filepos = ftell(data->file);
-    GET_LINE(buffer, data->file);
-      
-    /* Count the number of relevant words in the line. */
-    numread = sscanf(buffer,"%s %s %s %s",&word[0][0], &word[1][0],
-           &word[2][0], &word[3][0]);
-
-    if (!strcmp(&word[0][0], "$END")) break;
-
-    switch (numread) {
-      case 1:
-        /* Next atom */
-        if (i>0) {
-          data->basis_set = (basis_atom_t*)realloc(data->basis_set, (i+1)*sizeof(basis_atom_t));
-        }
-
-        strcpy(data->basis_set[i].name, &word[0][0]);
-
-
-        /* read the basis set for the current atom */
-        shell = (shell_t*)calloc(1, sizeof(shell_t)); 
-        numshells = 0;
-
-        do {
-          filepos = ftell(data->file);
-          numprim = read_shell_primitives(data, &prim, &shelltype, icoeff);
-
-          if (numprim>0) {
-            /* make sure we have eiter S, L, P, D, F or G shells */
-            if ( (shelltype!='S' && shelltype!='L' && shelltype!='P' && 
-                  shelltype!='D' && shelltype!='F' && shelltype!='G') ) {
-              printf("basissetplugin) WARNING ... %c shells are not supported \n", shelltype);
-            }
-            
-            /* create new shell */
-            if (numshells) {
-              shell = (shell_t*)realloc(shell, (numshells+1)*sizeof(shell_t));
-            }
-            shell[numshells].numprims = numprim;
-            shell[numshells].type = shelltype_int(shelltype);
-            shell[numshells].prim = prim;
-            data->num_basis_funcs += numprim;
-
-            /* We split L-shells into one S and one P-shell.
-             * I.e. for L-shells we have to go back read the shell again
-             * this time using the second contraction coefficients. */
-            if (shelltype=='L' && !icoeff) {
-              fseek(data->file, filepos, SEEK_SET);
-              icoeff++;
-            } else if (shelltype=='L' && icoeff) {
-              shell[numshells].type = SP_P_SHELL;
-              icoeff = 0;
-            }
-
-            numshells++;
-          }
-        } while (numprim);
-
-        /* store shells in atom */
-        data->basis_set[i].numshells = numshells;
-        data->basis_set[i].shell = shell;
-
-        /* store the total number of basis functions */
-        data->num_shells += numshells;
-        i++;
-
-        /* go back one line so that we can read the name of the
-         * next atom */
-        fseek(data->file, filepos, SEEK_SET);
-
-        break;
-
-    }
-
-  } while (!success);
-
-
-  printf("basissetplugin) Parsed %d uncontracted basis functions for %d atoms.\n",
-         data->num_basis_funcs, i);
-
-  data->num_basis_atoms = i;
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- *
- * Convert shell type from char to int.
- *
- ************************************************ */
-static int shelltype_int(char type) {
-  int shelltype;
-
-  switch (type) {
-    case 'L':
-      shelltype = SP_S_SHELL;
-      break;
-    case 'M':
-      shelltype = SP_P_SHELL;
-      break;
-    case 'S':
-      shelltype = S_SHELL;
-      break;
-    case 'P':
-      shelltype = P_SHELL;
-      break;
-    case 'D':
-      shelltype = D_SHELL;
-      break;
-    case 'F':
-      shelltype = F_SHELL;
-      break;
-    case 'G':
-      shelltype = G_SHELL;
-      break;
-    default:
-      shelltype = UNK_SHELL;
-      break;
-  }
-
-  return shelltype;
-}
-
-
-
-/******************************************************
- *
- * Populate the flat arrays containing the basis
- * set data.
- *
- ******************************************************/
-static int fill_basis_arrays(qmdata_t *data) {
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0;
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_types;
-  int *atomicnum_per_basisatom;
-
-  /* Count the total number of primitives which
-   * determines the size of the basis array. */
-  for(i=0; i<data->num_basis_atoms; i++) {
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      primcount += data->basis_set[i].shell[j].numprims;
-    }
-  }
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per basis function, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  basis = (float *)calloc(2*primcount,sizeof(float));
-
-  /* make sure memory was allocated properly */
-  if (basis == NULL) {
-    PRINTERR;
-    return MOLFILE_ERROR;
-  }
-
-  shell_types = (int *)calloc(data->num_shells, sizeof(int));
-  
-  /* make sure memory was allocated properly */
-  if (shell_types == NULL) {
-    PRINTERR; 
-    return MOLFILE_ERROR;
-  }
-
-  num_shells_per_atom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_shells_per_atom == NULL) {
-    PRINTERR; 
-    return MOLFILE_ERROR;
-  }
-
-  num_prim_per_shell = (int *)calloc(data->num_shells, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_prim_per_shell == NULL) {
-    PRINTERR;
-    return MOLFILE_ERROR;
-  }
-
-  atomicnum_per_basisatom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (atomicnum_per_basisatom == NULL) {
-    PRINTERR;
-    return MOLFILE_ERROR;
-  }
-
-
-  /* store pointers in struct qmdata_t */
-  data->basis = basis;
-  data->shell_types = shell_types;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell = num_prim_per_shell;
-  data->atomicnum_per_basisatom = atomicnum_per_basisatom;
-
-  primcount = 0;
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int j;
-    /* assign atomic number from element name */
-    data->basis_set[i].atomicnum = 0;
-    for (j=0; j<NUM_ELEMENTS; j++) {
-      if (!strcmp(elements[j], data->basis_set[i].name)) {
-        data->basis_set[i].atomicnum = j;
-        break;
-      }
-    }
-    atomicnum_per_basisatom[i] = data->basis_set[i].atomicnum;
-
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_types[shellcount] = data->basis_set[i].shell[j].type;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * read all primitives for the current shell
- *
- ******************************************************/
-static int read_shell_primitives(qmdata_t *data, prim_t **prim, char *shelltype,
-                                 int icoeff) {
-  char buffer[BUFSIZ];
-  float exponent = 0.0; 
-  float contract[2] = {0.0, 0.0};
-  int i, success;
-  int primcounter = 0, nprim = 0;;
-
-  GET_LINE(buffer, data->file);
-  success = sscanf(buffer,"%c %d", shelltype, &nprim);
-
-  (*prim) = (prim_t*)calloc(nprim, sizeof(prim_t));
-
-  for (i=0; i<nprim; i++) {
-    GET_LINE(buffer, data->file);
-    success = sscanf(buffer,"%*d %f %f %f",
-                       &exponent, &contract[0], &contract[1]); 
-
-    /* store in basis array and increase the counter */ 
-    switch (success) {
-      case 2:
-        /* store exponent */
-        (*prim)[i].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[i].contraction_coeff = contract[0];
-
-        primcounter++;
-        break;
-
-      case 3:
-        /* store exponent */
-        (*prim)[i].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[i].contraction_coeff = contract[icoeff];
-        
-        primcounter++;
-        break;
-
-      case -1:
-        /* otherwise it's an empty line which represents the end of the shell */
-        break;
-
-      case 1:
-        /* the user had given the next atom a numeric name */
-        break;
-    }
-
-  }
-
-  if (!primcounter) free(*prim);
-
-  return primcounter;
-}
-
-
-
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "basisset";
-  plugin.prettyname = "Basis Set";
-  plugin.author = "Jan Saam";
-  plugin.majorv = 0;
-  plugin.minorv = 1;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "basis";
-  plugin.open_file_read  = open_basis_read;
-  plugin.close_file_read = close_basis_read;
-  plugin.read_structure = NULL;
-
-  plugin.read_qm_metadata = read_basis_metadata;
-  plugin.read_qm_rundata  = read_basis_rundata;
-
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_timestep_metadata    = NULL;
-  plugin.read_qm_timestep_metadata = NULL;
-  plugin.read_timestep = NULL;
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/bgfplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/bgfplugin.C
deleted file mode 100644
index c4b2a730fe8bdadd78a015952256765ee514ed66..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/bgfplugin.C
+++ /dev/null
@@ -1,668 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: bgfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.29 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include "molfile_plugin.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-
-typedef struct {
-  FILE *file;
-  molfile_atom_t *atomlist;
-  int natoms, nbonds, optflags, coords_read;
-  int *from, *to;
-  float *bondorder;
-} bgfdata;
-
-// Open the file and create the bgf struct used to pass data to the other
-// functions.
-static void *open_bgf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  bgfdata *bgf;
-  char line[LINESIZE]; 
-  int nbonds, optflags;
-  int numat=0;
-  nbonds=0;
-  int nbline; //Number of bonds in current line
-
-  if ((fd = fopen(path, "r")) == NULL)
-    return NULL;
-
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      printf("bgfplugin) Improperly terminated bgf file\n");
-      return NULL;
-    }
-
-    if ((strncmp(line, "ATOM", 4) == 0) || (strncmp(line, "HETATM", 6)==0)) 
-      numat++;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      nbline=(strlen(line)-1)/6; 
-      nbline -= 2;
-      nbonds += nbline;
-    }
-
-  } while ( strncmp(line, "END", 3) );
-    
-  optflags = MOLFILE_INSERTION | MOLFILE_CHARGE; 
-  *natoms = numat;
-  rewind(fd);
-
-  // Allocate and initialize the bgf structure
-  bgf = (bgfdata *) malloc(sizeof(bgfdata));
-  memset(bgf, 0, sizeof(bgfdata));
-
-  bgf->file = fd;
-  bgf->natoms = *natoms;
-  bgf->nbonds = nbonds;
-
-  bgf->optflags = optflags;
-  bgf->coords_read = 0;
-  bgf->from = NULL;
-  bgf->to = NULL;
-  bgf->bondorder = NULL;
-
-  return bgf;
-}
-
-
-static void adjust_bgf_field_string(char *field) {
-  int i, len;
-
-  len = strlen(field);
-  while (len > 0 && field[len-1] == ' ') {
-    field[len-1] = '\0';
-    len--;
-  }
-
-  while (len > 0 && field[0] == ' ') {
-    for (i=0; i < len; i++)
-      field[i] = field[i+1];
-    len--;
-  }
-}
-
-
-static void get_bgf_coordinates(const char *record, 
-                                float *x, float *y, float *z) {
-  char numstr[50]; /* store all fields in one array to save memset calls */
-  memset(numstr, 0, sizeof(numstr));
-  if (x != NULL) {
-    strncpy(numstr, record + 31, 10);
-    *x = (float) atof(numstr);
-  }
-
-  if (y != NULL) {
-    strncpy(numstr+10, record + 41, 10);
-    *y = (float) atof(numstr+10);
-  }
-
-  if (z != NULL) {
-    strncpy(numstr+20, record + 51, 10);
-    *z = (float) atof(numstr+20);
-  }
-}
-
-
-static void get_bgf_fields(const char *record, char *name, char *resname, 
-                           char *chain, char* segname,
-                           int *resid, char *type, float *charge,
-                           float *x, float *y, float *z) {
-  char tempresid[6];
-  char tempcharge[9];
-
-  /* get atom name */
-  strncpy(name, record + 13, 5);
-  name[5] = '\0';
-  adjust_bgf_field_string(name); /* remove spaces from the name */
-
-  /* get residue name */
-  strncpy(resname, record + 19, 4);
-  resname[4] = '\0';
-  adjust_bgf_field_string(resname); /* remove spaces from the resname */
-
-  /* set segname */
-  segname[0]='\0';
-
-  /* get chain name */
-  chain[0] = record[23];
-  chain[1] = '\0';
-
-  /* get residue id number */
-  strncpy(tempresid, record + 26, 5);
-  tempresid[5] = '\0';
-  adjust_bgf_field_string(tempresid); /* remove spaces from the resid */
-  *resid=atoi(tempresid);
-
-  /* get force field type */
-  strncpy(type, record+61, 5);
-  type[5]='\0';
-  adjust_bgf_field_string(type);
-
-  /* get charge*/
-  strncpy(tempcharge, record + 72, 8);
-  tempcharge[8] = '\0';
-  adjust_bgf_field_string(tempcharge); /* remove spaces from the charge */
-  *charge=atof(tempcharge);
-
-  /* get x, y, and z coordinates */
-  get_bgf_coordinates(record, x, y, z);
-}  
-
-
-// Read atom information, but not coordinates.
-static int read_bgf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  bgfdata *bgf = (bgfdata *)v;
-  char line[LINESIZE]; 
-  molfile_atom_t *atom;
-  int natoms=0;
-
-  *optflags = bgf->optflags;
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) FORMAT ATOM record not found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) Error occurred reading atom record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(line, "ATOM", 4) && strncmp(line, "HETATM", 6)) 
-      continue;
-
-    atom=atoms+natoms;
-    natoms++;
-
-    get_bgf_fields(line, atom->name, atom->resname, atom->chain, 
-                   atom->segid, &atom->resid, atom->type, &atom->charge, 
-                   NULL, NULL, NULL);
-  } while (strncmp(line, "END", 3));
-
-  bgf->natoms = natoms;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-// Read atom coordinates
-static int read_bgf_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  bgfdata *bgf = (bgfdata *)v;
-  char line[LINESIZE];
-  int i;
-  float x, y, z;
-
-  // Since the file is rewound when coordinates are read, EOF shouldn't
-  // happen. Instead, use a flag to indicate that the single timestep has
-  // been read
-  if (bgf->coords_read) {
-    return MOLFILE_EOF;
-  }
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) No FORMAT ATOM record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  for (i = 0; i < bgf->natoms; i++) {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) Error occurred reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-    // skip comments and blank lines
-    if (strncmp(line,"ATOM",4)!=0 && strncmp(line,"HETATM",6)!=0) continue;
-
-    get_bgf_coordinates(line, &x, &y, &z);
-
-    if (ts) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-  bgf->coords_read = 1;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void *open_bgf_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  bgfdata *data;
-
-  if ((fd = fopen(filename, "w")) == NULL) {
-    printf("bgfplugin) Error: unable to open bgf file %s for writing\n", filename);
-    return NULL;
-  }
-  
-  data = (bgfdata *) malloc(sizeof(bgfdata));
-  memset(data, 0, sizeof(bgfdata));
-  data->natoms = natoms;
-  data->file = fd;
-  data->nbonds = 0;
-  return data;
-}
-
-
-static int write_bgf_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  bgfdata *data = (bgfdata *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->natoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->natoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-static void getatomfield(char* atomfield, const char* resname) {
-  if ((strncmp(resname,"ALA",3) == 0) || (strncmp(resname,"ASP",3) == 0) || (strncmp(resname,"ARG",3) == 0) || (strncmp(resname,"ASN",3) == 0) || (strncmp(resname,"CYS",3) == 0) || (strncmp(resname,"GLN",3) == 0) || (strncmp(resname,"GLU",3) == 0) || (strncmp(resname,"GLY",3) == 0) || (strncmp(resname,"HIS",3) == 0) || (strncmp(resname,"ILE",3) == 0) || (strncmp(resname,"LEU",3) == 0) || (strncmp(resname,"LYS",3) == 0) || (strncmp(resname,"MET",3) == 0) || (strncmp(resname,"PHE",3) == 0) || (strncmp(resname,"PRO",3) == 0) || (strncmp(resname,"SER",3) == 0) || (strncmp(resname,"THR",3) == 0) || (strncmp(resname,"TRP",3) == 0) || (strncmp(resname,"TYR",3) == 0) || (strncmp(resname,"VAL",3) == 0) || (strncmp(resname,"ADE",3) == 0) || (strncmp(resname,"THY",3) == 0) || (strncmp(resname,"GUA",3) == 0) || (strncmp(resname,"CYT",3) == 0) || (strncmp(resname,"URA",3) == 0) || (strncmp(resname,"HSD",3) == 0) || (strncmp(resname,"HSE",3) == 0) || (strncmp(resname,"HSP",3) == 0)) {
-    strncpy(atomfield, "ATOM  \0", 7);
-  } else {
-    strncpy(atomfield, "HETATM\0", 7);
-  }
-}
-      
-static int read_bgf_bonds_aux(void *v, int *nbonds, int **fromptr, int **toptr, float **bondorderptr) {
-  bgfdata *bgf = (bgfdata *)v;
-  char line[LINESIZE]; 
-  char nextline[LINESIZE]; 
-  if (bgf->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    return MOLFILE_SUCCESS;
-  }
-
-  // Find and read the BOND record
-  rewind(bgf->file);
-  do {
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) No bond record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-    fgets(line, LINESIZE, bgf->file);
-  } while ( strncmp(line, "FORMAT CONECT", 13) != 0 );
-
-  // Read the bonds
-  int j; //From atom
-  int k; //To atom
-  bool conline=false; //true if line after the conect line is an order line
-  char currbond[7]="xxxxxx"; //Stores current bond field
-  char currcon[7]="xxxxxx"; //Stores current ORDER field
-  char* bondptr; //pointer to current position in bond line
-  char* conptr; //pointer to current position in order line
-  int bonds[8]; //Stores bonds of current atom
-  float orders[8]; //Stores bond orders of current atom
-  int numbonds; //Stores number of bonds of current atom
-  int numords; //Stores number of bond order records of current atom
-  float bo; //current bond order
-  int i=0; //Number of the current bond
-  int numfields=0; //number of fields in the current line
-  fgets(line, LINESIZE, bgf->file);
-  while (1) {
-    // bondptr=NULL;
-    //conptr=NULL;
-    conline=false;
-
-    if (strncmp(line,"END", 3)==0) 
-      break;
-
-    fgets(nextline, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("bgfplugin) Error occurred reading bond record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(nextline,"ORDER",5)==0) 
-      conline=true;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      numfields=(strlen(line)-1)/6;
-      bondptr=&line[0];
-      numfields--;
-      bondptr += 6;
-      numbonds=0;
-      numords=0;
-      strncpy(currbond,bondptr,6);
-      j=atoi(currbond);
-      printf("bond: %i\n", j);
-      numfields--;
-      bondptr += 6;
-
-      while ((numfields > 0) && (numbonds < 8)) {
-        strncpy(currbond,bondptr,6);
-        numfields--;
-        bondptr += 6;
-        bonds[numbonds]=atoi(currbond);
-        printf("bond: %i\n", bonds[numbonds]);
-        numbonds++;
-      }
-
-      if (conline) {
-        numfields=(strlen(line)-1)/6;
-        conptr=&nextline[0];
-        numfields -= 2;
-        conptr += 12;
-        numords=0;
-        while ((numfields > 0) && (numords < numbonds)) {
-          strncpy(currcon,conptr,6);
-          numfields--;
-          conptr+=6;
-          bo=atof(currcon);
-          orders[numords]=bo;
-          numords++;
-        }
-      }
-
-      for (int l=0;l<numbonds;l++) {
-        k=bonds[l];
-        if (j<k) {
-          bgf->from[i]=j;
-          bgf->to[i]=k;
-
-          if (conline) {
-            bgf->bondorder[i]=orders[l];
-          } else {
-            bgf->bondorder[i]=1.0;
-          }
-
-          i++;
-        }
-      }
-        
-      if (conline) {
-        fgets(line, LINESIZE, bgf->file);
-      } else {
-        strncpy(line,nextline,LINESIZE);
-      }
-    } else {
-      strncpy(line,nextline,LINESIZE);
-    }
-  }
-
-  *nbonds = i;
-  *fromptr = bgf->from;
-  *toptr = bgf->to;
-  *bondorderptr = bgf->bondorder; 
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_bgf_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                          float **bondorderptr, int **bondtype, 
-                          int *nbondtypes, char ***bondtypename) {
-  bgfdata *bgf = (bgfdata *)v;
-
-  *nbonds=bgf->nbonds;
-  if (bgf->nbonds > 0) {
-    bgf->from = (int *) malloc(*nbonds*sizeof(int));
-    bgf->to = (int *) malloc(*nbonds*sizeof(int));
-    bgf->bondorder = (float *) malloc(*nbonds*sizeof(float));
-
-    if ((read_bgf_bonds_aux(bgf, nbonds, &(bgf->from), &(bgf->to), &(bgf->bondorder))) != MOLFILE_SUCCESS) {
-      fclose(bgf->file);
-      bgf->file = NULL;
-      return MOLFILE_ERROR;
-    }
-
-    *fromptr = bgf->from;
-    *toptr = bgf->to;
-    *bondorderptr = bgf->bondorder; 
-  } else {
-    printf("bgfplugin) WARNING: no bonds defined in bgf file.\n");
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL;
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_bgf_timestep(void *mydata, const molfile_timestep_t *ts) {
-  bgfdata *data = (bgfdata *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-
-  //print header block
-  fprintf(data->file, "BIOGRF  332\n");
-  fprintf(data->file, "REMARK NATOM %4i\n", data->natoms);
-  fprintf(data->file, "FORCEFIELD DREIDING\n");
-  fprintf(data->file, "FORMAT ATOM   (a6,1x,i5,1x,a5,1x,a3,1x,a1,1x,a5,3f10.5,1x,a5,i3,i2,1x,f8.5,i2,i4,f10.5)\n");
-
-  atom = data->atomlist;
-  pos = ts->coords;
-  int numbonds=0;
-  int lp=0;
-  char atomfield[7];
-  for (i = 0; i < data->natoms; i++) {
-    getatomfield(&atomfield[0], atom->resname);
-    fprintf(data->file, "%-6s %5i %5s %3.3s %1s %5i%10.5f%10.5f%10.5f %-5s%3i%2i %8.5f%2i%4i\n", atomfield, i+1, atom->name, atom->resname, atom->chain, atom->resid, pos[0], pos[1], pos[2], atom->type, numbonds, lp, atom->charge, 0, 0);
-    ++atom; 
-    pos += 3;
-  }
-
-  //write the connectivity data
-  fprintf(data->file,"FORMAT CONECT (a6,14i6) \nFORMAT ORDER (a6,i6,13f6.3)\n");
-
-  //iterate through the bond arrays and write them all
-  int *bonds    =(int *)  malloc((data->natoms+1) * sizeof(int) * 6);
-  float *orders =(float *)malloc((data->natoms+1) * sizeof(float) * 6);
-  int *numcons  =(int *)  malloc((data->natoms+1) * sizeof(int));
-
-  for (i=0;i<data->natoms+1;i++) {
-    numcons[i]=0;
-  }
-
-  int j, k;         //indices for atoms being bonded
-  float o;          //bond order
-  bool printorder;  //flag to print bond orders
-  int l;            //dummy iterator in bond order loop
-  for (i=0;i<data->nbonds;i++) {
-    j=data->from[i];
-    k=data->to[i];
-
-    if (data->bondorder != NULL)
-      o=data->bondorder[i];
-    else
-      o=1.0f;
-
-    numcons[j]++;
-    numcons[k]++;
-    if (numcons[j]>6) {
-      printf("bgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[j]--;
-      numcons[k]--;
-      continue;
-    }
-       
-    if (numcons[k]>6) {
-      printf("bgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[k]--;
-      numcons[j]--;
-      continue;
-    }
-    bonds[6*j+numcons[j]-1]=k;
-    bonds[6*k+numcons[k]-1]=j;
-    orders[6*j+numcons[j]-1]=o;
-    orders[6*k+numcons[k]-1]=o;
-  }
-
-  for (i=1;i<=data->natoms;i++) {
-    fprintf(data->file,"CONECT%6i",i);
-    for (j=0;j<numcons[i];j++) {
-      fprintf(data->file,"%6i",bonds[6*i+j]);
-    }
-    fprintf(data->file,"\n");
-    printorder = false;
-    for (l=0;l<numcons[i];l++) {
-      if (orders[6*i+l] != 1.0) {
-        printorder = true;
-      }
-    }
-    if (printorder) {
-      fprintf(data->file,"ORDER %6i",i);
-      for (j=0;j<numcons[i];j++) {
-        fprintf(data->file,"%6i",int(orders[6*i+j]));
-      }
-      fprintf(data->file,"\n");
-    }
-  }
-
-  if (bonds != NULL) {
-    free(bonds);
-    bonds = NULL;
-  }
-  if (orders != NULL) {
-    free(orders);
-    orders = NULL;
-  }
-  if (numcons != NULL) {
-    free(numcons);
-    numcons = NULL;
-  }
-
-  fprintf(data->file,"END\n");
-  return MOLFILE_SUCCESS;
-}
-
-static int write_bgf_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                           float *bondorderptr,  int *bondtype, 
-                           int nbondtypes, char **bondtypename) {
-  bgfdata *data = (bgfdata *)v;
-  data->from = (int*) malloc(nbonds * sizeof(int));
-  data->to = (int*) malloc(nbonds * sizeof(int));
-
-  //set the pointers for use later
-  for (int i=0;i<nbonds;i++) {
-    data->from[i]=fromptr[i];
-    data->to[i]=toptr[i];
-  }
-
-  if (bondorderptr != NULL) {  
-    data->bondorder = (float*) malloc(nbonds * sizeof(float));
-    for (int i=0;i<nbonds;i++) {
-      data->bondorder[i]=bondorderptr[i];
-    }
-  }
-
-  data->nbonds = nbonds;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_bgf_write(void *mydata) {
-  bgfdata *data = (bgfdata *)mydata;
-  if (data) {
-    if (data->file != NULL) fclose(data->file);
-    data->file = NULL;
-    if (data->atomlist != NULL) free(data->atomlist);
-    data->atomlist = NULL;
-    if (data->from != NULL) free(data->from);
-    data->from = NULL;
-    if (data->to != NULL) free(data->to);
-    data->to = NULL;
-    if (data->bondorder != NULL) free(data->bondorder);
-    data->bondorder = NULL;
-    free(data);
-  }
-}
-
-//
-// Free the memory used by the bgf structure
-static void close_bgf_read(void *v) {
-  bgfdata *bgf = (bgfdata *)v;
-  if (bgf) {
-    if (bgf->file != NULL) fclose(bgf->file);
-    bgf->file = NULL;
-    if (bgf->from != NULL) free(bgf->from);
-    bgf->from = NULL;
-    if (bgf->to != NULL)   free(bgf->to);
-    bgf->to = NULL;
-    if (bgf->bondorder != NULL)   free(bgf->bondorder);
-    bgf->bondorder = NULL;
-    free(bgf);
-  }
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "bgf";
-  plugin.prettyname = "MSI Biograf Format";
-  plugin.author = "Peter Freddolino ";
-  plugin.majorv = 0;
-  plugin.minorv = 16;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "bgf";
-  plugin.open_file_read = open_bgf_read;
-  plugin.read_structure = read_bgf_structure;
-  plugin.read_bonds = read_bgf_bonds;
-  plugin.read_next_timestep = read_bgf_timestep;
-  plugin.close_file_read = close_bgf_read;
-  plugin.open_file_write = open_bgf_write;
-  plugin.write_structure = write_bgf_structure;
-  plugin.write_timestep = write_bgf_timestep;
-  plugin.close_file_write = close_bgf_write;
-  plugin.write_bonds = write_bgf_bonds;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *) &plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/binposplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/binposplugin.c
deleted file mode 100644
index 0aea70d2533cae9415894df8ea4c56984ab8d5a5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/binposplugin.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: binposplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.12 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-
-#include "molfile_plugin.h"
-
-#if INT_MAX == 2147483647
-  typedef int binpos_int32;
-#elif SHRT_MAX == 2147483647
-  typedef short binpos_int32;
-#elif LONG_MAX == 2147483647
-  typedef long binpos_int32;
-#endif
-
-typedef struct {
-  FILE *fd;
-  int numatoms;
-  int wrongendian;
-  float *xyz;
-} binposhandle;
-
-static void *open_binpos_read(const char *path, const char *filetype, 
-    int *natoms) {
-  binposhandle *binpos;
-  FILE *fd;
-  int er=0,point,igarb;
-  char lenbuf[4];
-  char tmpc;
-  char magicchar[5];
-
-  fd = fopen(path, "rb");
-  if (!fd) 
-   {
-    fprintf(stderr, "Could not open file '%s' for reading.\n", path);
-    return NULL;
-   }
-  binpos = (binposhandle *)malloc(sizeof(binposhandle));
-  memset(binpos, 0, sizeof(binposhandle));
-  fread(magicchar,sizeof(char),4,fd);
-  magicchar[4]= '\0' ;
-  if(strcmp(magicchar,"fxyz")!=0)
-   {
-    fprintf(stderr,"not a binpos amber coordinate file\n");
-    return NULL;
-   }
-  fprintf(stderr,"Proceeding to open amber7 binpos coordinate file\n");
-  fread(&igarb,sizeof(int),1,fd);
-  point=ftell(fd);
-
-/* Check for endianism here*/
-  if(igarb>1000000000)
-   {
-    fprintf(stderr, "File '%s' appears to be other-endian.\n", path);
-    binpos->wrongendian = 1;
-    memcpy(lenbuf, (const char *)&igarb, 4);
-    tmpc = lenbuf[0]; lenbuf[0] = lenbuf[3]; lenbuf[3] = tmpc;
-    tmpc = lenbuf[1]; lenbuf[1] = lenbuf[2]; lenbuf[2] = tmpc;
-    memcpy((char *)&igarb, lenbuf, 4);
-
-	if((fseek(fd, point, SEEK_SET))!=0)
-      {
-	  fprintf(stderr,"Endian correction failed. er=%d\n",er);
-      return NULL;	
-     }
-	fseek(fd, point, SEEK_SET);
-   }
-  binpos->fd = fd;
-  binpos->numatoms = igarb;
-  binpos->xyz = (float *)malloc(3 * binpos->numatoms * sizeof(float));
-
-  if (!binpos->xyz) {
-    fprintf(stderr, "Unable to allocate space for %d atoms.\n", binpos->numatoms);
-    fclose(fd);
-    free(binpos);
-    return NULL;
-  }
-  *natoms = binpos->numatoms;
-  return binpos;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) 
- {
-  binposhandle *binpos;
-  int i, numatoms,igarb;
-  char *cdata;
-  char tmpc;
-
-  binpos = (binposhandle *)v;
-  if (!binpos->fd) 
-    return MOLFILE_ERROR;  /* Done reading frames */
-
-  numatoms = binpos->numatoms;
-
-  if (fread(binpos->xyz, sizeof(float), 3 * numatoms, binpos->fd)
-	                         != (size_t)(3 * numatoms)) {
-    fprintf(stderr, "Failure reading data from amber7 binary file.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (binpos->wrongendian) {
-
-/*For float or single precision endian conversion*/
-/*amber7 binpos files are always float not doubles*/
-    cdata = (char *) binpos->xyz;
-    for ( i=0; i<3*numatoms; ++i, cdata+=4 ) {
-    tmpc = cdata[0]; cdata[0] = cdata[3]; cdata[3] = tmpc;
-    tmpc = cdata[1]; cdata[1] = cdata[2]; cdata[2] = tmpc;
-    }
-  }
-
-  if (ts) {
-    for ( i=0; i<numatoms; ++i) {
-      ts->coords[3*i] = binpos->xyz[3*i];
-      ts->coords[3*i+1] = binpos->xyz[3*i+1];
-      ts->coords[3*i+2] = binpos->xyz[3*i+2];
-    }
-  }
-  /*
-   * Close the file handle and set to NULL so we know we're done reading 
-   * 
-   */
-
-  if((fread(&igarb,sizeof(int),1,binpos->fd))!=1)
-   {
-    fclose(binpos->fd);
-    binpos->fd = NULL;
-   }
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_file_read(void *v) {
-  binposhandle *binpos = (binposhandle *)v;
-  if (binpos->fd)
-    fclose(binpos->fd);
-  free(binpos->xyz);
-  free(binpos);
-}
-
-static void *open_binpos_write(const char *path, const char *filetype, 
-    int natoms) {
-  binposhandle *binpos;
-  FILE *fd;
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file %s for writing\n", path);
-    return NULL;
-  }
-  fprintf(stderr,"Writing file in current machine endian-ism\n");
-  binpos = (binposhandle *)malloc(sizeof(binposhandle));
-  binpos->fd = fd;
-  binpos->numatoms = natoms;
-  fwrite( "fxyz", 4, 1, binpos->fd);
-  return binpos;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  
-  int i,numatoms;
-
-  binposhandle *binpos = (binposhandle *)v;
-  
-  if (!binpos->fd)
-    return MOLFILE_ERROR;
-
-/*add the number of atoms in between frames*/
-  /*myint = (binpos_int32)binpos->numatoms;*/
-  numatoms = binpos->numatoms;
-
-  fwrite(&numatoms, 4, 1, binpos->fd);
-
-  for (i=0; i<3*numatoms; i++) 
-   {
-    float tmp = ts->coords[i];
-    if (fwrite(&tmp, sizeof(float), 1, binpos->fd) != 1) {
-      fprintf(stderr, "Error writing amber7 binary file\n");
-      return MOLFILE_ERROR;
-     }
-   }
-
-  /*
-   * Close and NULLify the file handle so we don't write any more frames.
-   */
-/*  fclose(binpos->fd);
-  binpos->fd = NULL;*/
-
-  return MOLFILE_SUCCESS;
-}
-       
-static void close_file_write(void *v) {
-  binposhandle *binpos = (binposhandle *)v;
-  if (binpos->fd)
-    fclose(binpos->fd);
-  free(binpos);
-}
-
-/*
- * Initialization stuff here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "binpos";
-  plugin.prettyname = "Scripps Binpos";
-  plugin.author = "Brian Bennion";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "binpos";
-  plugin.open_file_read = open_binpos_read;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_file_read;
-  plugin.open_file_write = open_binpos_write;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/biomoccaplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/biomoccaplugin.C
deleted file mode 100644
index 2f3e2e612014ba2bf435ffd11c1ca2e7c6296167..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/biomoccaplugin.C
+++ /dev/null
@@ -1,193 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: biomoccaplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.6 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * Biomocca volumetric map file reader
- *   Biomocca is written by the CEG at UIUC:
- *     http://www.ceg.uiuc.edu/
- *
- * File format (simple ASCII text): 
- * Xcenter Ycenter Zcenter (in Angstroms)
- * Nx(number of cells on the x axis)  Ny  Nz
- * d (cell spacing, in Angstroms)
- * Voxel values (-1, 0, 1, ...) stored in Z/Y/X fortran style order
- *
- * Meaning of voxel values: 
- * -1 for lipid
- *  0 for channel or solvent baths
- *  1 stands for the protein
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} biomocca_t;
-
-
-static void *open_biomocca_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  biomocca_t *biomocca;
-  float scale;
-  int xsize, ysize, zsize;
-  float orig[3];
-  
-  fd = fopen(filepath, "r");
-  if (!fd) {
-    printf("biomoccaplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  if (fscanf(fd, "%f %f %f", orig, orig+1, orig+2) != 3) {
-    printf("biomoccaplugin) Error reading grid origin.\n");
-    return NULL;
-  }
-
-  /* get the number of grid points */
-  if (fscanf(fd, "%d %d %d", &xsize, &ysize, &zsize) != 3) {
-    printf("biomoccaplugin) Error reading grid dimensions.\n");
-    return NULL;
-  }
-
-  /* get the voxel scale */
-  if (fscanf(fd, "%f", &scale) != 1) {;
-    printf("biomoccaplugin) Error reading voxel scale.\n");
-    return NULL;
-  }
-
-  /* allocate and initialize the biomocca structure */
-  biomocca = new biomocca_t;
-  biomocca->fd = fd;
-  biomocca->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  biomocca->nsets = 1; /* this file contains only one data set */
-
-  biomocca->vol = new molfile_volumetric_t[1];
-  strcpy(biomocca->vol[0].dataname, "BioMocca map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    biomocca->vol[0].origin[i] = orig[i];
-    biomocca->vol[0].xaxis[i] = 0.0;
-    biomocca->vol[0].yaxis[i] = 0.0;
-    biomocca->vol[0].zaxis[i] = 0.0;
-  }
-
-  biomocca->vol[0].xaxis[0] = scale * (xsize-1);
-  biomocca->vol[0].yaxis[1] = scale * (ysize-1);
-  biomocca->vol[0].zaxis[2] = scale * (zsize-1);
-
-  biomocca->vol[0].origin[0] -= 0.5 * biomocca->vol[0].xaxis[0];
-  biomocca->vol[0].origin[1] -= 0.5 * biomocca->vol[0].yaxis[1];
-  biomocca->vol[0].origin[2] -= 0.5 * biomocca->vol[0].zaxis[2];
-
-  biomocca->vol[0].xsize = xsize;
-  biomocca->vol[0].ysize = ysize;
-  biomocca->vol[0].zsize = zsize;
-
-  biomocca->vol[0].has_color = 0; /* BioMocca maps contain no color info */
-
-  return biomocca;
-}
-
-static int read_biomocca_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  biomocca_t *biomocca = (biomocca_t *)v;
-  *nsets = biomocca->nsets; 
-  *metadata = biomocca->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_biomocca_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  biomocca_t *biomocca = (biomocca_t *)v;
-  FILE *fd = biomocca->fd;
-  int x, y, z, xsize, ysize, zsize, xysize;
-
-  xsize = biomocca->vol[0].xsize;
-  ysize = biomocca->vol[0].ysize;
-  zsize = biomocca->vol[0].zsize;
-  xysize = xsize * ysize;
-
-  for (x=0; x<xsize; x++) {
-    for (y=0; y<ysize; y++) {
-      for (z=0; z<zsize; z++) {
-        if (fscanf(fd, "%f", datablock + z*xysize + y*xsize + x) != 1) {
-          printf("biomoccaplugin) Failed reading biomocca map data\n");
-          return MOLFILE_ERROR;
-        }
-  
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_biomocca_read(void *v) {
-  biomocca_t *biomocca = (biomocca_t *)v;
-  
-  fclose(biomocca->fd);
-  if (biomocca->vol != NULL)
-    delete [] biomocca->vol; 
-  delete biomocca;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t)); 
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "biomocca";
-  plugin.prettyname = "Biomocca Volumetric Map";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "bmcg";
-  plugin.open_file_read = open_biomocca_read;
-  plugin.read_volumetric_metadata = read_biomocca_metadata;
-  plugin.read_volumetric_data = read_biomocca_data;
-  plugin.close_file_read = close_biomocca_read;
- 
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/brixplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/brixplugin.C
deleted file mode 100644
index d48ca27e849abe96349f5b9d51510743ee4e960b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/brixplugin.C
+++ /dev/null
@@ -1,314 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: brixplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.20 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * BRIX format electron density maps.
- *
- * More info for format can be found at 
- * <http://zombie.imsb.au.dk/~mok/brix/brix-1.html#ss1.2>
- * 
- * TODO: Speed up inner loop of read_data, perhaps reading one full brick
- *       from the file at a time.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  float prod, plus;
-  molfile_volumetric_t *vol;
-} brix_t;
-
-
-static void *open_brix_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  brix_t *brix;
-  char keyWord[81];
-  // File header data:
-  int org_x, org_y, org_z, ext_x, ext_y, ext_z;
-  float grid_x, grid_y, grid_z, cell_x, cell_y, cell_z, 
-        cell_alpha, cell_beta, cell_gamma, prod, plus, sigma, 
-        xaxis[3], yaxis[3], zaxis[3], z1, z2, z3;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "brixplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // read in BRIX file header information -- stored as a 512-element char array
-  fscanf(fd, "%3s", keyWord);
-  if (strcmp(keyWord, ":-)") != 0) {
-    fprintf(stderr, "brixplugin) Error improperly formatted header.\n");
-    return NULL;
-  }
-
-  // "Origin: the origin of the map in grid units, along X, Y, Z."
-  fscanf(fd, " %s %d %d %d", keyWord, &org_x, &org_y, &org_z);
-  if (strcasecmp(keyWord, "origin") != 0) {
-    fprintf(stderr, "brixplugin) Error reading origin.\n");
-    return NULL;
-  }
-
-  // "Extent: the extent (size) of the map, along X, Y, Z, in grid units"
-  fscanf(fd, " %s %d %d %d", keyWord, &ext_x, &ext_y, &ext_z);
-  if (strcasecmp(keyWord, "extent") != 0) {
-    fprintf(stderr, "brixplugin) Error reading extent.\n");
-    return NULL;
-  }
-
-  // "Grid: number of grid points along the whole unit cell, along X, Y, Z."
-  fscanf(fd, " %s %f %f %f", keyWord, &grid_x, &grid_y, &grid_z);
-  if (strcasecmp(keyWord, "grid") != 0) {
-    fprintf(stderr, "brixplugin) Error reading grid.\n");
-    return NULL;
-  }
-
-  // "Cell: Unit cell parameters"
-  // cell x, y, and z are the length of the unit cell along each axis,
-  // cell alpha, beta, and cell_gamma are the angles between axes.
-  fscanf(fd, " %s %f %f %f %f %f %f", keyWord,
-         &cell_x, &cell_y, &cell_z, &cell_alpha, &cell_beta, &cell_gamma);
-  if (strcasecmp(keyWord, "cell") != 0) {
-    fprintf(stderr, "brixplugin) Error reading cell.\n");
-    return NULL;
-  }
-
-  // Convert angles to radians
-  cell_alpha *= M_PI / 180.0;
-  cell_beta *= M_PI / 180.0;
-  cell_gamma *= M_PI / 180.0;
-
-  // "Prod, plus: Constants that bring the electron density from byte to 
-  // normal scale."
-  fscanf(fd, " %s %f", keyWord, &prod);
-  if (strcasecmp(keyWord, "prod") != 0) {
-    fprintf(stderr, "brixplugin) Error reading prod.\n");
-    return NULL;
-  }
-  fscanf(fd, " %s %f", keyWord, &plus);
-  if (strcasecmp(keyWord, "plus") != 0) {
-    fprintf(stderr, "brixplugin) Error reading plus.\n");
-    return NULL;
-  }
-
-  // "Sigma: Rms deviation of electron density map."
-  fscanf(fd, " %s %f", keyWord, &sigma);
-  if (strcasecmp(keyWord, "sigma") != 0) {
-    fprintf(stderr, "brixplugin) Error reading sigma.\n");
-    return NULL;
-  }
-
-  // Allocate and initialize the brix structure
-  brix = new brix_t;
-  brix->fd = fd;
-  brix->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  brix->nsets = 1; // this file contains only one data set
-
-  brix->prod = prod;
-  brix->plus = plus;
-
-  brix->vol = new molfile_volumetric_t[1];
-  strcpy(brix->vol[0].dataname, "BRIX Electron Density Map");
-
-  // Calculate non-orthogonal unit cell coordinates
-  xaxis[0] = cell_x / grid_x;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(cell_gamma) * cell_y / grid_y;
-  yaxis[1] = sin(cell_gamma) * cell_y / grid_y;
-  yaxis[2] = 0;
-
-  z1 = cos(cell_beta);
-  z2 = (cos(cell_alpha) - cos(cell_beta)*cos(cell_gamma)) / sin(cell_gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * cell_z / grid_z;
-  zaxis[1] = z2 * cell_z / grid_z;
-  zaxis[2] = z3 * cell_z / grid_z;
-
-  brix->vol[0].origin[0] = xaxis[0] * org_x + yaxis[0] * org_y + 
-                           zaxis[0] * org_z;
-  brix->vol[0].origin[1] = yaxis[1] * org_y + zaxis[1] * org_z;
-  brix->vol[0].origin[2] = zaxis[2] * org_z;
-
-  brix->vol[0].xaxis[0] = xaxis[0] * (ext_x - 1);
-  brix->vol[0].xaxis[1] = 0;
-  brix->vol[0].xaxis[2] = 0;
-
-  brix->vol[0].yaxis[0] = yaxis[0] * (ext_y - 1);
-  brix->vol[0].yaxis[1] = yaxis[1] * (ext_y - 1);
-  brix->vol[0].yaxis[2] = 0;
-
-  brix->vol[0].zaxis[0] = zaxis[0] * (ext_z - 1);
-  brix->vol[0].zaxis[1] = zaxis[1] * (ext_z - 1);
-  brix->vol[0].zaxis[2] = zaxis[2] * (ext_z - 1);
-
-  brix->vol[0].xsize = ext_x;
-  brix->vol[0].ysize = ext_y;
-  brix->vol[0].zsize = ext_z;
-
-  brix->vol[0].has_color = 0;
-
-  return brix;
-}
-
-static int read_brix_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  brix_t *brix = (brix_t *)v;
-  *nsets = brix->nsets; 
-  *metadata = brix->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_brix_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  brix_t *brix = (brix_t *)v;
-  float * cell = datablock;
-  int xsize, ysize, zsize, xysize, xbrix, ybrix, zbrix, cellIndex;
-  int x, y, z, xbrik, ybrik, zbrik;
-  unsigned char brick[512];
-  FILE * fd = brix->fd;
-  float div, plus;
-
-  // Read 512-byte "bricks" of data. Each brick contains data for 8*8*8 
-  // gridpoints.
-  fseek(fd, 512, SEEK_SET);
-
-  div = 1.0 / brix->prod;
-  plus = brix->plus;
-
-  xsize = brix->vol[0].xsize;
-  ysize = brix->vol[0].ysize;
-  zsize = brix->vol[0].zsize;
-  xysize = xsize * ysize;
-
-  xbrix = (int) ceil((float) xsize / 8.0);
-  ybrix = (int) ceil((float) ysize / 8.0);
-  zbrix = (int) ceil((float) zsize / 8.0);
-
-  // For every density value, 
-  // cellIndex = (x + xbrik*8) + (y + ybrik*8)*xsize + (z + zbrik*8) * xysize
-  cellIndex = 0;
-  for (zbrik = 0; zbrik < zbrix; zbrik++) {
-    for (ybrik = 0; ybrik < ybrix; ybrik++) {
-      for (xbrik = 0; xbrik < xbrix; xbrik++) {
-        if (feof(fd)) {
-          fprintf(stderr, "brixplugin) Unexpected end-of-file.\n");
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          fprintf(stderr, "brixplugin) Error reading file.\n");
-          return MOLFILE_ERROR;
-        }
-
-        // Read a data brick into the buffer.
-        fread(brick, sizeof(char), 512, fd);
-
-        // Copy the brick values into the cell
-        for (z = 0; z < 8; z++) {
-          for (y = 0; y < 8; y++) {
-            for (x = 0; x < 8; x++) {
-
-              if ( ((x + xbrik*8) < xsize) && ((y + ybrik*8) < ysize) &&
-                   ((z + zbrik*8) < zsize) )
-                cell[cellIndex] = 
-                  div * ((float) brick[x+y*8+z*64] - plus);
-
-              cellIndex++;
-            } // end for(x)
- 
-            cellIndex += xsize - 8;
-          } // end for(y)
-
-          cellIndex += xysize - 8*xsize;
-        } // end for(z)
- 
-        cellIndex += 8 - 8*xysize; 
-      } // end for(xbrik)
-
-      cellIndex += 8 * (xsize - xbrix);
-    } // end for(ybrik)
-
-    cellIndex += 8 * (xysize - xsize*ybrik);
-  } // end for(zbrik)
- 
-  return MOLFILE_SUCCESS;
-}
-
-static void close_brix_read(void *v) {
-  brix_t *brix = (brix_t *)v;
-
-  fclose(brix->fd);
-  if (brix->vol != NULL)
-    delete [] brix->vol; 
-  delete brix;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "brix";
-  plugin.prettyname = "BRIX Density Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 8;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "brix,brx";
-  plugin.open_file_read = open_brix_read;
-  plugin.read_volumetric_metadata = read_brix_metadata;
-  plugin.read_volumetric_data = read_brix_data;
-  plugin.close_file_read = close_brix_read;
-
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/carplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/carplugin.c
deleted file mode 100644
index b4e3983b5a466d6f0d6fd58049e4a28c18d3cce5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/carplugin.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: carplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.18 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * Plugin for Insight II/Discover car (cartesian coordinate file) file format.
- * 
- * TODO: 
- * + 2D PBC info (probably just as a simplified 3D PBC)
- * + HELIX info (not sure how this will be handled)
- *
- * File Header:
- *   !BIOSYM archive 3
- *   HELIX 
- *     (if HELIX information is present)
- *   PBC=ON, PBC=OFF, PBC=2D 
- *     (one of these three choices must be present. PBC cannot be "ON" if
- *     HELIX information is present.)
- * Coordinate Header:
- *   Title (this line may be blank, but must be present)
- *     1-64 title for the system
- *     65-80 energy
- *   ! DATE day month date time year
- *     (day, month, date, time, year are optional)
- *   PBC information if PBC=ON:
- *     1-3 PBC
- *     4-13 a cell vector a in angstroms
- *     14-23 b cell vector b in angstroms
- *     24-33 c cell vector c in angstroms
- *     34-43 alpha cell angle alpha in degrees
- *     44-53 beta cell angle beta in degrees
- *     54-63 gamma cell angle gamma in degrees
- *     64-80 space group name
- *   PBC information if PBC=2D:
- *     1-3 PBC
- *     4-13 k plane vector k in angstroms
- *     14-23 l plane vector l in angstroms
- *     24-33 gamma plane angle gamma in degrees
- *     34-50 plane group name
- * Molecule Data:
- *   If helix info is present:
- *     1-5 HELIX
- *     6-15 sigma in degrees
- *     16-25 d in angstroms
- *     26-35 kappa angle between l axis and helix axis in degrees
- *     36-45 lambda angle between k axis and helix axis in degrees
- *     46-55 Tk fractional position of helix axis along k axis
- *     56-65 Tl fractional position of helix axis along l axis
- *   Atom data:
- *     1-5 atom name
- *     7-20 x Cartesian coordinate of atom in angstroms
- *     22-35 y Cartesian coordinate of atom in angstroms
- *     37-50 z Cartesian coordinate of atom in angstroms
- *     52-55 type of residue containing atom
- *     57-63 residue sequence name relative to beginning of current
- *     molecule, left justified
- *     64-70 potential type of atom left justified
- *     72-73 element symbol
- *     75-80 partial charge on atom
- *   Final line for a given molecule:
- *     1-3 end
- * Final line for the entire molecular system input:
- *     1-3 end
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#define LINESIZE 1024
-
-/* possible values for pbc */
-enum {PBC_ON, PBC_OFF, PBC_2D};
-
-typedef struct {
-  FILE *file;
-  int numatoms, pbc, helix, eof;
-  long coord_location;
-  molfile_atom_t *atomlist;
-} cardata;
-
-/* Parse a line contianing atom data from a car file and store it in the
- * atom structure. Returns 1 on success, 0 on failure.
- */
-static int read_car_structure_line(molfile_atom_t *atom, char *line) {
-  char name[LINESIZE], type[LINESIZE];
-  int resid;
-  float charge;
-
-  if (sscanf(line, "%s %*f %*f %*f %*s %d %*s %s %f", name, &resid, type, &charge) 
-      != 4)
-    return 0;
-
-  /* check the length of the name and type strings before copying. */
-  if ( (strlen(name) >= 8) || (strlen(type) >= 8) )
-    return 0;
-  strcpy(atom->name, name);
-  strcpy(atom->type, type);
-
-  /* Check that the resid won't overflow the resname string, then copy it
-   * over
-   */
-  if (resid > 9999999)
-    atom->resname[0] = '\0';
-  else
-    sprintf(atom->resname, "%d", resid);
-
-  atom->resid = resid;
-
-  atom->chain[0] = '\0';
-  atom->segid[0] = '\0';
-
-  atom->charge = charge;
-
-  return 1;
-}
-
-/* Parse a line contianing atom coordinates from a car file and store them
- * in the array 'coords' in XYZ order. Returns 1 on success, 0 on failure.
- */
-static int read_car_coordinates(float *coords, char *line) {
-  float x, y, z;
-
-  if (sscanf(line, "%*s %f %f %f %*s %*d %*s %*s %*f", &x, &y, &z) 
-      != 3)
-    return 0;
-
-  coords[0] = x;
-  coords[1] = y;
-  coords[2] = z;
-
-  return 1;
-}
-
-static void *open_car_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  cardata *data;
-  char line[LINESIZE];
-
-  fd = fopen(filename, "rb"); if (!fd) return NULL;
-  
-  data = (cardata *)malloc(sizeof(cardata));
-  data->eof = 0;
-  data->file = fd;
-
-  /* First line: "!BIOSYM archive n", where n indicates the file format */
-  fgets(line, LINESIZE, fd);
-  if (strncmp(line, "!BIOSYM archive", 15)) {
-    fprintf(stderr, "ERROR) badly formatted/missing header.\n");
-    return NULL;
-  }
-
-  /* Second line: "HELIX" if helix information is present. Followed by PBC
-   * info on the next line: "PBC=ON|OFF|2D". 
-   * If HELIX is present, PBC cannot be "ON": return an error if this happens. 
-   */
-  fgets(line, LINESIZE, fd);
-  if (!strncmp(line, "HELIX", 5)) {
-    data->helix = 1;
-    fgets(line, LINESIZE, fd);
-    fprintf(stdout, "WARNING) ignoring helix information.\n");
-  }
-  else {
-    data->helix = 0;
-  }
-
-  if (!strncmp(line, "PBC=ON", 6)) {
-    data->pbc = PBC_ON;
-  }
-  else if (!strncmp(line, "PBC=OFF", 7)) {
-    data->pbc = PBC_OFF;
-  }
-  else if (!strncmp(line, "PBC=2D", 6)) {
-    data->pbc = PBC_2D;
-    fprintf(stdout, "WARNING) ignoring 2D PBC information.\n");
-  }
-  else {
-    fprintf(stderr, "ERROR) badly formatted/missing PBC info.\n");
-    return NULL;
-  }
-
-  if (data->helix && (data->pbc == PBC_ON)) {
-    fprintf(stderr, "ERROR) car file contains helix and 3D PBC information.");
-    return NULL;
-  }
-
-  /* Next line: title/energy for the system. Skipped. */
-  fgets(line, LINESIZE, fd);
-
-  /* Next line: "!DATE [day month date time year]". */
-  fgets(line, LINESIZE, fd);
-  if (strncmp(line, "!DATE", 5)) {
-    fprintf(stderr, "ERROR) badly formatted/missing date.\n");
-    return NULL;
-  }
-    
-  /* Store the location of the beginning of the PBC/coordinate data. */
-  data->coord_location = ftell(fd);
-
-  /* Skip the PBC and HELIX entries, if present */
-  if (data->pbc != PBC_OFF) 
-    fgets(line, LINESIZE, fd);
-  if (data->helix)
-    fgets(line, LINESIZE, fd);
-
-  /* Count the atoms in all molecules*/
-  data->numatoms = 0;
-  fgets(line, LINESIZE, fd);
-  while(strncmp(line, "end", 3)) {
-    while(strncmp(line, "end", 3)) {
-      data->numatoms++;
-      fgets(line, LINESIZE, fd);
-
-      if (feof(fd)) {
-        fprintf(stderr, "ERROR) unexpected end-of-file.\n");
-        return NULL;
-      }
-      if (ferror(fd)) {
-        fprintf(stderr, "ERROR) error reading car file.\n");
-        return NULL;
-      }
-    }
-    fgets(line, LINESIZE, fd);
-  }
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-static int read_car_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  int mol_num;
-  char line[LINESIZE];
-  molfile_atom_t *atom;
-  cardata *data = (cardata *)mydata;
-
-  *optflags = MOLFILE_CHARGE; /* car files contain partial charges */
-
-  /* move to the beginning of the atom data in the file, skipping any PBC or
-   * HELIX information that may be present
-   */
-  fseek(data->file, data->coord_location, SEEK_SET);
-  if (data->pbc != PBC_OFF) 
-    fgets(line, LINESIZE, data->file);
-  if (data->helix)
-    fgets(line, LINESIZE, data->file);
-
-  mol_num = 0;
-  atom = atoms;
-  fgets(line, LINESIZE, data->file);
-  /* Loop through all molecules */
-  while(strncmp(line, "end", 3)) {
-    /* Read the structure for each molecule */
-    while(strncmp(line, "end", 3)) {
-      if (!read_car_structure_line(atom, line)) {
-        fprintf(stderr, "ERROR) badly formatted structure line:\n%s\n", line);
-        return MOLFILE_ERROR;
-      }
-
-      /* XXX - this code can easily create buffer overflows
-               and cause data corruption or segfaults:
-
-         XXX - use the chain name to identify different molecules
-         sprintf(atom->chain, "%d", mol_num);
-
-         we avoid the buffer overflow and use typical capital 
-         letters for the chain identifiers instead.
-      */
-      sprintf(atom->chain, "%c", (char) (((int) 'A') + (mol_num % 26))); 
-
-      atom++;
-      
-      fgets(line, LINESIZE, data->file);
-      if (feof(data->file)) {
-        fprintf(stderr, "ERROR) unexpected end-of-file while reading structure.\n");
-        return MOLFILE_ERROR;
-      }
-      if (ferror(data->file)) {
-        fprintf(stderr, "ERROR) error reading car file while reading structure.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-    fgets(line, LINESIZE, data->file);
-    mol_num++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_car_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char line[LINESIZE];
-  cardata *data = (cardata *)mydata;
-  float *coords = NULL;
-
-  /* return if coordinates have been read */
-  if (data->eof)
-    return MOLFILE_EOF;
-
-  /* move to the beginning of the atom data in the file */
-  fseek(data->file, data->coord_location, SEEK_SET);
-
-  /* read the PBC record if present */
-  if (data->pbc == PBC_ON) {
-    fgets(line, LINESIZE, data->file);
-
-    if (ts) {
-      if ( sscanf(line, "PBC %f %f %f %f %f %f %*s", 
-                  &ts->A, &ts->B, &ts->C, 
-                  &ts->alpha, &ts->beta, &ts->gamma) != 6 ) {
-        fprintf(stderr, "ERROR) badly formatted PBC line:\n%s\n", line);
-        return MOLFILE_ERROR;
-      }
-    }
-  }
-  else if (data->pbc == PBC_2D) {
-    /* XXX - Ignore 2D PBC information */
-    fgets(line, LINESIZE, data->file);
-  }
-
-  /* skip the helix record if present */
-  if (data->helix)
-    fgets(line, LINESIZE, data->file);
-
-  if (ts)
-    coords = ts->coords;
-
-  fgets(line, LINESIZE, data->file);
-  /* Loop through all molecules */
-  while(strncmp(line, "end", 3)) {
-    /* Read the coordinates for each molecule */
-    while(strncmp(line, "end", 3)) {
-      /* only save coords if we're given a timestep pointer. */
-      if (ts) {
-        if (!read_car_coordinates(coords, line)) {
-          fprintf(stderr, "ERROR) badly formatted coordinate line:\n%s\n", line);
-          return MOLFILE_ERROR;
-        }
-        coords += 3;
-      }
-
-      fgets(line, LINESIZE, data->file);
-      if (feof(data->file)) {
-        fprintf(stderr, "ERROR) unexpected end-of-file while reading coordinates.\n");
-        return MOLFILE_ERROR;
-      }
-      if (ferror(data->file)) {
-        fprintf(stderr, "ERROR) file error while reading coordinates.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-    fgets(line, LINESIZE, data->file);
-  }
-
-  /* set eof since this file contians only one "timestep" */
-  data->eof = 1;
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_car_read(void *mydata) {
-  if (mydata) {
-    cardata *data = (cardata *)mydata;
-    fclose(data->file);
-    free(data);
-  }
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "car";
-  plugin.prettyname = "InsightII car";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "car";
-  plugin.open_file_read = open_car_read;
-  plugin.read_structure = read_car_structure;
-  plugin.read_next_timestep = read_car_timestep;
-  plugin.close_file_read = close_car_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ccp4plugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ccp4plugin.C
deleted file mode 100644
index dd56cd8ce494c2a97883cbe5dc451a19695abb30..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ccp4plugin.C
+++ /dev/null
@@ -1,706 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: ccp4plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.38 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-//
-// CCP4 electron density map file format description:
-//   http://www2.mrc-lmb.cam.ac.uk/image2000.html
-//   http://www.ccp4.ac.uk/html/maplib.html
-//   http://iims.ebi.ac.uk/3dem-mrc-maps/distribution/mrc_maps.txt
-//
-// TODO: Fix translation/scaling problems found when using 
-//       non-orthogonal unit cells.
-//
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-#define CCP4HDSIZE 1024
-
-// CCP4 and IMOD MRC image types
-// based on notes in:
-//   http://bio3d.colorado.edu/imod/doc/mrc_format.txt
-#define MRC_TYPE_BYTE   0
-#define MRC_TYPE_SHORT  1
-#define MRC_TYPE_FLOAT  2
-#define MRC_TYPE_SHORT2 3
-#define MRC_TYPE_FLOAT2 4
-#define MRC_TYPE_USHORT 6  /* non-standard */
-#define MRC_TYPE_UCHAR3 16 /* non-standard */
-
-#define IMOD_FILE_ID            0x494d4f44
-#define IMOD_MAGIC_STAMP        1146047817
-#define IMOD_FLAG_SIGNED               0x1
-#define IMOD_FLAG_HEADER_SPACING       0x2
-#define IMOD_FLAG_ORIGIN_INVERTED_SIGN 0x4
-
-typedef struct {
-  FILE *fd;
-  int voxtype; 
-  int imodstamp;
-  int imodflags;
-  int nsets;
-  int swap;
-  int xyz2crs[3];
-  long dataOffset;
-  molfile_volumetric_t *vol;
-} ccp4_t;
-
-typedef struct {
-  unsigned char red;
-  unsigned char blue;
-  unsigned char green;
-} uchar3;
-
-static void *open_ccp4_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  ccp4_t *ccp4;
-  char mapString[4], symData[81];
-  int nxyzstart[3], extent[3], grid[3], crs2xyz[3], voxtype, symBytes;
-  float origin2k[3];
-  int swap, i, xIndex, yIndex, zIndex;
-  long dataOffset, filesize;
-  float cellDimensions[3], cellAngles[3], xaxis[3], yaxis[3], zaxis[3];
-  float alpha, beta, gamma, xScale, yScale, zScale, z1, z2, z3;
-  int imodstamp=0,imodflags=0;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    printf("ccp4plugin) Error opening file %s\n", filepath);
-    return NULL;
-  }
-
-  if ((fread(extent, sizeof(int), 3, fd) != 3) ||
-      (fread(&voxtype, sizeof(int), 1, fd) != 1) ||
-      (fread(nxyzstart, sizeof(int), 3, fd) != 3) ||
-      (fread(grid, sizeof(int), 3, fd) != 3) ||
-      (fread(cellDimensions, sizeof(float), 3, fd) != 3) ||
-      (fread(cellAngles, sizeof(float), 3, fd) != 3) ||
-      (fread(crs2xyz, sizeof(int), 3, fd) != 3)) {
-    printf("ccp4plugin) Error: Improperly formatted line.\n");
-    return NULL;
-  }
-
-  // Check the number of bytes used for storing symmetry operators
-  // (word 23, byte 92)
-  fseek(fd, 23 * 4, SEEK_SET);
-  if ((fread(&symBytes, sizeof(int), 1, fd) != 1) ) {
-    printf("ccp4plugin) Error: Failed reading symmetry bytes record.\n");
-    return NULL;
-  }
-
-  // read MRC2000 Origin record at word 49, byte 196, and use it if necessary
-  // http://www2.mrc-lmb.cam.ac.uk/image2000.html
-  fseek(fd, 49 * 4, SEEK_SET);
-  if (fread(origin2k, sizeof(float), 3, fd) != 3) {
-    printf("ccp4plugin) Error: unable to read ORIGIN records at offset 196.\n");
-  }
-
-  // Check for IMOD stamp at offset 152, indicating an IMOD file 
-  fseek(fd, 152, SEEK_SET);
-  if (fread(&imodstamp, sizeof(int), 1, fd) != 1) {
-    printf("ccp4plugin) Error: failed to read IMOD stamp from MRC file.\n");
-    return NULL;
-  }
-  if (fread(&imodflags, sizeof(int), 1, fd) != 1) {
-    printf("ccp4plugin) Error: failed to read IMOD flags from MRC file.\n");
-    return NULL;
-  }
-
-  // Check file endianism using some heuristics
-  swap = 0;
-  int tmp[3];
-  memcpy(tmp, extent, 3*sizeof(int));
-  if (tmp[0] > 65536 || tmp[1] > 65536 || tmp[2] > 65536) {
-    swap4_aligned(tmp, 3);
-    if (tmp[0] > 65536 || tmp[1] > 65536 || tmp[2] > 65536) {
-      swap = 0;
-      printf("ccp4plugin) Guessing file endianism: native\n");
-    } else {
-      swap = 1;
-      printf("ccp4plugin) Guessing file endianism: swapped\n");
-    }
-  }
-  if (voxtype > 16 && swap == 0) {
-    tmp[0] = voxtype;
-    swap4_aligned(tmp, 1);
-    if (tmp[0] <= 16) {
-      swap = 1;
-      printf("ccp4plugin) Guessing file endianism: swapped\n");
-    }
-  }
-
-  // Byte-swap header information if needed
-  if (swap == 1) {
-    swap4_aligned(extent, 3);
-    swap4_aligned(&voxtype, 1);
-    swap4_aligned(nxyzstart, 3);
-    swap4_aligned(origin2k, 3);
-    swap4_aligned(grid, 3);
-    swap4_aligned(cellDimensions, 3);
-    swap4_aligned(cellAngles, 3);
-    swap4_aligned(crs2xyz, 3);
-    swap4_aligned(&symBytes, 1);
-    swap4_aligned(&imodstamp, 1);
-    swap4_aligned(&imodflags, 1);
-  }
-
-  // Check for the string "MAP" at word 52 byte 208, indicating a CCP4 file.
-  fseek(fd, 52 * 4, SEEK_SET);
-  if (fgets(mapString, 4, fd) == NULL) {
-    printf("ccp4plugin) Error: unable to read 'MAP' string, not a valid CCP4/IMOD MRC file.\n");
-    return NULL;
-  }
-  if ((strcmp(mapString, "MAP") != 0) && (imodstamp != IMOD_MAGIC_STAMP)) {
-    //Older versions of IMOD (2.6.19 or below) do not have the "MAP " string.
-    //If the IMOD stamp is there its probably a valid mrc file
-    printf("ccp4plugin) Warning: 'MAP' string missing which usually indicates that this is\n\
-not a valid IMOD file. Some older versions of IMOD did not include the 'MAP'\n\
-string so file loading will continue but may fail.\n");
-  }
-
-  // Check if we found an IMOD file or not
-  if (imodstamp == IMOD_MAGIC_STAMP) {
-    printf("ccp4plugin) MRC file generated by IMOD-compatible program.\n");
-    if (imodflags & IMOD_FLAG_SIGNED)
-      printf("ccp4plugin) IMOD flag: data uses signed-bytes\n");
-    else 
-      printf("ccp4plugin) IMOD flag: data uses unsigned-bytes\n");
-
-    if (imodflags & IMOD_FLAG_HEADER_SPACING)
-      printf("ccp4plugin) IMOD flag: pixel spacing set in extended header\n");
-
-    if (imodflags & IMOD_FLAG_ORIGIN_INVERTED_SIGN)
-      printf("ccp4plugin) IMOD flag: origin sign is inverted.\n");
-  } else {
-    printf("ccp4plugin) No IMOD stamp found.\n");
-    imodflags = 0;
-  }
-
-  // Check the data type of the file.
-  switch (voxtype) {
-    case MRC_TYPE_BYTE:
-      printf("ccp4plugin) voxel type: byte\n");
-      break;
-
-    case MRC_TYPE_SHORT:
-      printf("ccp4plugin) voxel type: short (16-bit signed int)\n");
-      break;
-
-    case MRC_TYPE_FLOAT:
-      printf("ccp4plugin) voxel type: float (32-bit real)\n");
-      break;
-
-    case MRC_TYPE_SHORT2:
-      printf("ccp4plugin) voxel type: short2 (2x 16-bit signed int)\n");
-      printf("ccp4plugin) Error: unimplemented voxel format\n");
-      return NULL;
-
-    case MRC_TYPE_FLOAT2:
-      printf("ccp4plugin) voxel type: float2 (2x 32-bit real)\n");
-      printf("ccp4plugin) Error: unimplemented voxel format\n");
-      return NULL;
-
-    case MRC_TYPE_USHORT:
-      printf("ccp4plugin) voxel type: ushort (16-bit unsigned int)\n");
-      break;
-
-    case MRC_TYPE_UCHAR3:
-      printf("ccp4plugin) voxel type: uchar3 (3x unsigned char)\n");
-      break;
-
-    default:
-      printf("ccp4plugin) Error: Only byte, short (16-bit integer) or float (32-bit real) data types are supported.\n");
-      return NULL;
-  }
-
-#if 1
-  printf("ccp4plugin)    extent: %d x %d x %d\n",
-         extent[0], extent[1], extent[2]);
-  printf("ccp4plugin) nxyzstart: %d x %d x %d\n", 
-         nxyzstart[0], nxyzstart[1], nxyzstart[2]);
-  printf("ccp4plugin)  origin2k: %f x %f x %f\n", 
-         origin2k[0], origin2k[1], origin2k[2]);
-  printf("ccp4plugin)      grid: %d x %d x %d\n", grid[0], grid[1], grid[2]);
-  printf("ccp4plugin)   celldim: %f x %f x %f\n", 
-         cellDimensions[0], cellDimensions[1], cellDimensions[2]);
-  printf("cpp4plugin)cellangles: %f, %f, %f\n", 
-         cellAngles[0], cellAngles[1], cellAngles[2]);
-  printf("ccp4plugin)   crs2xyz: %d %d %d\n", 
-         crs2xyz[0], crs2xyz[1], crs2xyz[2]);
-  printf("ccp4plugin)  symBytes: %d\n", symBytes);
-#endif
-
-  // Check the dataOffset: this fixes the problem caused by files claiming
-  // to have symmetry records when they do not.
-  fseek(fd, 0, SEEK_END);
-  filesize = ftell(fd);
-
-  // compute data offset using file size and voxel type info
-  if (voxtype == MRC_TYPE_BYTE) {
-    dataOffset = filesize - sizeof(char)*(extent[0]*extent[1]*extent[2]);
-  } else if (voxtype == MRC_TYPE_FLOAT) {
-    dataOffset = filesize - sizeof(float)*(extent[0]*extent[1]*extent[2]);
-  } else if (voxtype == MRC_TYPE_SHORT || voxtype == MRC_TYPE_USHORT) {
-    dataOffset = filesize - sizeof(short)*(extent[0]*extent[1]*extent[2]);
-  } else if (voxtype == MRC_TYPE_UCHAR3) {
-    dataOffset = filesize - sizeof(uchar3)*(extent[0]*extent[1]*extent[2]);
-  } else {
-    printf("ccp4plugin) unimplemented voxel type!\n");
-  }
-
-  if (dataOffset != (CCP4HDSIZE + symBytes)) {
-    if (dataOffset == CCP4HDSIZE) {
-      // Bogus symmetry record information
-      printf("ccp4plugin) Warning: file contains bogus symmetry record.\n");
-      symBytes = 0;
-    } else if (dataOffset < CCP4HDSIZE) {
-      printf("ccp4plugin) Error: File appears truncated and doesn't match header.\n");
-      return NULL;
-    } else if ((dataOffset > CCP4HDSIZE) && (dataOffset < (1024*1024))) {
-      // Fix for loading SPIDER files which are larger than usual
-      // In this specific case, we must absolutely trust the symBytes record
-      dataOffset = CCP4HDSIZE + symBytes; 
-      printf("ccp4plugin) Warning: File is larger than expected and doesn't match header.\n");
-      printf("ccp4plugin) Warning: Continuing file load, good luck!\n");
-    } else {
-      printf("ccp4plugin) Error: File is MUCH larger than expected and doesn't match header.\n");
-      return NULL;
-    }
-  }
-
-  // Read symmetry records -- organized as 80-byte lines of text.
-  if (symBytes != 0) {
-    printf("ccp4plugin) Symmetry records found:\n");
-    fseek(fd, CCP4HDSIZE, SEEK_SET);
-    for (i = 0; i < symBytes/80; i++) {
-      fgets(symData, 81, fd);
-      printf("ccp4plugin) %s\n", symData);
-    }
-  }
-
-  // check extent and grid interval counts
-  if (grid[0] == 0 && extent[0] > 0) {
-    grid[0] = extent[0] - 1;
-    printf("ccp4plugin) Warning: Fixed X interval count\n");
-  }
-  if (grid[1] == 0 && extent[1] > 0) {
-    grid[1] = extent[1] - 1;
-    printf("ccp4plugin) Warning: Fixed Y interval count\n");
-  }
-  if (grid[2] == 0 && extent[2] > 0) {
-    grid[2] = extent[2] - 1;
-    printf("ccp4plugin) Warning: Fixed Z interval count\n");
-  }
-
-  // Allocate and initialize the ccp4 structure
-  ccp4 = new ccp4_t;
-  ccp4->fd = fd;
-  ccp4->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  ccp4->nsets = 1; // this EDM file contains only one data set
-  ccp4->voxtype = voxtype;
-  ccp4->imodstamp = imodstamp;
-  ccp4->imodflags = imodflags;
-  ccp4->swap = swap;
-  ccp4->dataOffset = dataOffset;
-
-  ccp4->vol = new molfile_volumetric_t[1];
-  strcpy(ccp4->vol[0].dataname, "CCP4 Electron Density Map");
-
-  // Mapping between CCP4 column, row, section and VMD x, y, z.
-  if (crs2xyz[0] == 0 && crs2xyz[1] == 0 && crs2xyz[2] == 0) {
-    printf("ccp4plugin) Warning: All crs2xyz records are zero.\n");
-    printf("ccp4plugin) Warning: Setting crs2xyz to 1, 2, 3\n");
-    crs2xyz[0] = 1;
-    crs2xyz[0] = 2;
-    crs2xyz[0] = 3;
-  }
-
-  ccp4->xyz2crs[crs2xyz[0]-1] = 0;
-  ccp4->xyz2crs[crs2xyz[1]-1] = 1;
-  ccp4->xyz2crs[crs2xyz[2]-1] = 2;
-  xIndex = ccp4->xyz2crs[0];
-  yIndex = ccp4->xyz2crs[1];
-  zIndex = ccp4->xyz2crs[2];
-
-  // calculate non-orthogonal unit cell coordinates
-  alpha = (M_PI / 180.0) * cellAngles[0];
-  beta = (M_PI / 180.0) * cellAngles[1];
-  gamma = (M_PI / 180.0) * cellAngles[2];
-
-  if (cellDimensions[0] == 0.0 && 
-      cellDimensions[1] == 0.0 &&
-      cellDimensions[2] == 0.0) {
-    printf("ccp4plugin) Warning: Cell dimensions are all zero.\n");
-    printf("ccp4plugin) Warning: Setting to 1.0, 1.0, 1.0 for viewing.\n");
-    printf("ccp4plugin) Warning: Map file will not align with other structures.\n");
-    cellDimensions[0] = 1.0;
-    cellDimensions[1] = 1.0;
-    cellDimensions[2] = 1.0;
-  } 
-
-
-  xScale = cellDimensions[0] / grid[0];
-  yScale = cellDimensions[1] / grid[1];
-  zScale = cellDimensions[2] / grid[2];
-
-  // calculate non-orthogonal unit cell coordinates
-  xaxis[0] = xScale;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(gamma) * yScale;
-  yaxis[1] = sin(gamma) * yScale;
-  yaxis[2] = 0;
-
-  z1 = cos(beta);
-  z2 = (cos(alpha) - cos(beta)*cos(gamma)) / sin(gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * zScale;
-  zaxis[1] = z2 * zScale;
-  zaxis[2] = z3 * zScale;
-
-#if 1
-  // Handle both MRC-2000 and older format maps
-  if (origin2k[0] == 0.0f && origin2k[1] == 0.0f && origin2k[2] == 0.0f) {
-    printf("ccp4plugin) using CCP4 n[xyz]start origin\n");
-    ccp4->vol[0].origin[0] = xaxis[0] * nxyzstart[xIndex] + 
-                             yaxis[0] * nxyzstart[yIndex] +
-                             zaxis[0] * nxyzstart[zIndex];
-    ccp4->vol[0].origin[1] = yaxis[1] * nxyzstart[yIndex] +
-                             zaxis[1] * nxyzstart[zIndex];
-    ccp4->vol[0].origin[2] = zaxis[2] * nxyzstart[zIndex];
-  } else {
-    // Use ORIGIN records rather than old n[xyz]start records
-    //   http://www2.mrc-lmb.cam.ac.uk/image2000.html
-    // XXX the ORIGIN field is only used by the EM community, and
-    //     has undefined meaning for non-orthogonal maps and/or
-    //     non-cubic voxels, etc.
-    printf("ccp4plugin) using MRC2000 origin\n");
-    ccp4->vol[0].origin[0] = origin2k[xIndex];
-    ccp4->vol[0].origin[1] = origin2k[yIndex];
-    ccp4->vol[0].origin[2] = origin2k[zIndex];
-  }
-#else
-  // old code that only pays attention to old MRC nxstart/nystart/nzstart
-  ccp4->vol[0].origin[0] = xaxis[0] * nxyzstart[xIndex] + 
-                           yaxis[0] * nxyzstart[yIndex] +
-                           zaxis[0] * nxyzstart[zIndex];
-  ccp4->vol[0].origin[1] = yaxis[1] * nxyzstart[yIndex] +
-                           zaxis[1] * nxyzstart[zIndex];
-  ccp4->vol[0].origin[2] = zaxis[2] * nxyzstart[zIndex];
-#endif
-
-#if 0
-  printf("ccp4plugin) origin: %.3f %.3f %.3f\n",
-         ccp4->vol[0].origin[0],
-         ccp4->vol[0].origin[1],
-         ccp4->vol[0].origin[2]);
-#endif
-
-  ccp4->vol[0].xaxis[0] = xaxis[0] * (extent[xIndex]-1);
-  ccp4->vol[0].xaxis[1] = 0;
-  ccp4->vol[0].xaxis[2] = 0;
-
-  ccp4->vol[0].yaxis[0] = yaxis[0] * (extent[yIndex]-1);
-  ccp4->vol[0].yaxis[1] = yaxis[1] * (extent[yIndex]-1);
-  ccp4->vol[0].yaxis[2] = 0;
-
-  ccp4->vol[0].zaxis[0] = zaxis[0] * (extent[zIndex]-1);
-  ccp4->vol[0].zaxis[1] = zaxis[1] * (extent[zIndex]-1);
-  ccp4->vol[0].zaxis[2] = zaxis[2] * (extent[zIndex]-1);
-
-  ccp4->vol[0].xsize = extent[xIndex];
-  ccp4->vol[0].ysize = extent[yIndex];
-  ccp4->vol[0].zsize = extent[zIndex];
-
-  ccp4->vol[0].has_color = 0;
-
-  return ccp4;
-}
-
-static int read_ccp4_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  ccp4_t *ccp4 = (ccp4_t *)v;
-  *nsets = ccp4->nsets; 
-  *metadata = ccp4->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_ccp4_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  ccp4_t *ccp4 = (ccp4_t *)v;
-  int x, y, z, xSize, ySize, zSize, xySize, extent[3], coord[3];
-  FILE *fd = ccp4->fd;
-
-  xSize = ccp4->vol[0].xsize;
-  ySize = ccp4->vol[0].ysize;
-  zSize = ccp4->vol[0].zsize;
-  xySize = xSize * ySize;
-
-  // coord = <col, row, sec>
-  // extent = <colSize, rowSize, secSize>
-  extent[ccp4->xyz2crs[0]] = xSize;
-  extent[ccp4->xyz2crs[1]] = ySize;
-  extent[ccp4->xyz2crs[2]] = zSize;
-
-  fseek(fd, ccp4->dataOffset, SEEK_SET);
-
-  // Read entire rows of data from the file, then write into the
-  // datablock with the correct slice ordering.
-  if ((ccp4->voxtype == MRC_TYPE_BYTE) && (ccp4->imodflags & IMOD_FLAG_SIGNED)) {
-    printf("ccp4plugin) reading signed-byte voxel data\n");
-    char *rowdata = new char[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if ( fread(rowdata, sizeof(char), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if ((ccp4->voxtype == MRC_TYPE_BYTE) && !(ccp4->imodflags & IMOD_FLAG_SIGNED)) {
-    printf("ccp4plugin) reading unsigned-byte voxel data\n");
-    unsigned char *rowdata = new unsigned char[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if ( fread(rowdata, sizeof(unsigned char), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if (ccp4->voxtype == MRC_TYPE_FLOAT) {
-    printf("ccp4plugin) reading float (32-bit real) voxel data\n");
-    float *rowdata = new float[extent[0]];
-    int x, y, z;
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (fread(rowdata, sizeof(float), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-    if (ccp4->swap == 1)
-      swap4_aligned(datablock, xySize * zSize);
-  } else if (ccp4->voxtype == MRC_TYPE_SHORT) {
-    printf("ccp4plugin) reading short (16-bit int) voxel data\n");
-    short *rowdata = new short[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (fread(rowdata, sizeof(short), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ccp4->swap == 1)
-          swap2_aligned(rowdata, extent[0]);
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if (ccp4->voxtype == MRC_TYPE_SHORT2) {
-    /* IMOD developers said that this is not used anymore and not worth our time to implement */
-    printf("TYPE_SHORT2 not implemented yet...\n");
-    return MOLFILE_ERROR;
-  } else if (ccp4->voxtype == MRC_TYPE_USHORT) {
-    printf("ccp4plugin) reading unsigned short (16-bit int) voxel data\n");
-    unsigned short *rowdata = new unsigned short[extent[0]];
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (fread(rowdata, sizeof(unsigned short), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ccp4->swap == 1)
-          swap2_aligned(rowdata, extent[0]);
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          datablock[x + y*xSize + z*xySize] = rowdata[coord[0]];
-        }
-      }
-    }
-    delete [] rowdata;
-  } else if (ccp4->voxtype == MRC_TYPE_UCHAR3) {
-    printf("ccp4plugin) reading unsigned char * 3 (8-bit uchar * 3) voxel data\n");
-    uchar3 *rowdata = new uchar3[extent[0]];
-    float grayscale;
-    for (coord[2] = 0; coord[2] < extent[2]; coord[2]++) {
-      for (coord[1] = 0; coord[1] < extent[1]; coord[1]++) {
-        if (feof(fd)) {
-          printf("ccp4plugin) Unexpected end-of-file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          printf("ccp4plugin) Problem reading the file.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        if ( fread(rowdata, sizeof(uchar3), extent[0], fd) != extent[0] ) {
-          printf("ccp4plugin) Error reading data row.\n");
-          delete [] rowdata;
-          return MOLFILE_ERROR;
-        }
-        for (coord[0] = 0; coord[0] < extent[0]; coord[0]++) {
-          x = coord[ccp4->xyz2crs[0]];
-          y = coord[ccp4->xyz2crs[1]];
-          z = coord[ccp4->xyz2crs[2]];
-          grayscale = rowdata[coord[0]].red + rowdata[coord[0]].blue + rowdata[coord[0]].green;
-          datablock[x + y*xSize + z*xySize] = grayscale/3.0;
-        }
-      }
-    }
-    delete [] rowdata;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-static void close_ccp4_read(void *v) {
-  ccp4_t *ccp4 = (ccp4_t *)v;
-
-  fclose(ccp4->fd);
-  delete [] ccp4->vol; 
-  delete ccp4;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "ccp4";
-  plugin.prettyname = "CCP4, MRC Density Map";
-  plugin.author = "Eamon Caddigan, Brendan McMorrow, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "ccp4,mrc,map";
-  plugin.open_file_read = open_ccp4_read;
-  plugin.read_volumetric_metadata = read_ccp4_metadata;
-  plugin.read_volumetric_data = read_ccp4_data;
-  plugin.close_file_read = close_ccp4_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/corplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/corplugin.c
deleted file mode 100644
index 0a2b3ef0595fb1bfe35f1af5e17b4df2a864c1db..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/corplugin.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: corplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.33 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * This plugin reads molecular coordinate data stored in 
- * CHARMM CARD Cartesian Coordinate format (ascii text format, not binary).
- *    http://www.charmm.org/
- *    http://www.charmm.org/documentation/c32b2/io.html       
- *
- * Normal format for less than 100000 atoms and PSF IDs with less than
- * five characters
- * TITLE (lines starting with "*")
- * NATOM (I5)
- * ATOMNO RESNO   RES  TYPE  X     Y     Z   SEGID RESID Weighting
- *   I5    I5  1X A4 1X A4 F10.5 F10.5 F10.5 1X A4 1X A4 F10.5
- *
- * Expanded format for more than 100000 atoms (upto 10**10) and with
- * upto 8 character PSF IDs. (versions c31a1 and later)
- * TITLE (lines starting with "*")
- * NATOM (I10)
- * ATOMNO RESNO   RES  TYPE  X     Y     Z   SEGID RESID Weighting
- *   I10   I10 2X A8 2X A8       3F20.10     2X A8 2X A8 F20.10
- *
- */
-
-#include "molfile_plugin.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define COR_RECORD_LENGTH   141 /* 80 */
-
-/* Remove leading and trailing whitespace from the string str of size n */
-static void strip_whitespace(char *str, int n) {
-  char *beg, *end;
-
-  beg = str;
-  end = str + (n-2); /* Point to the last non-null character in the string */
-
-  /* Remove leading whitespace */
-  while(beg <= end && *beg == ' ') {
-    beg++;
-  }
-
-  /* Remove trailing whitespace */
-  while(end >= str && *end == ' ') {
-    end--;
-  }
-
-  if (beg < end) {
-    /* Shift the string */
-    *(end+1) = '\0';
-    memmove(str, beg, (end - beg + 2));
-  } else {
-    str[0] = '\0';
-  }
-
-  return;
-}
-
-/* Get a string from a stream, printing any errors that occur */
-static char *corgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    printf("corplugin) Unexpected end-of-file.\n");
-    returnVal = NULL;
-  } else if (ferror(stream)) {
-    printf("corplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      printf("corplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-/* Open the .cor file and skip past the remarks to the first data section.
- * Returns the file pointer, or NULL if error.  Also puts the number of
- * atoms in the molecule into the given integer.  
- */
-static FILE *open_cor_file(const char *fname, int *natom, int *iofoext) {
-  char inbuf[COR_RECORD_LENGTH+2], header[11];
-  FILE *f;
-
-  *natom = MOLFILE_NUMATOMS_NONE;
-
-  if (!fname) {
-    printf("corplugin) Error opening file: no filename given.\n");
-    return NULL;
-  }
-
-  if ((f = fopen(fname, "r")) == NULL) {
-    printf("corplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Read and discard the header */
-  do {
-    if (fgets(inbuf, COR_RECORD_LENGTH+1, f) == NULL) {
-      fclose(f);
-      printf("corplugin) Error opening file: cannot read line.\n");
-      return NULL;
-    }
-
-    if (sscanf(inbuf, "%10c", header) != 1) {
-      fclose(f);
-      printf("corplugin) Error opening file: improperly formatted line.\n");
-      return NULL;
-    }
-
-  } while (header[0]=='*');
-
-  /* check for EXT keyword */
-  *iofoext = 0 ;
-  if (strstr(inbuf,"EXT") != NULL) 
-    *iofoext = 1;
-
-  /* check atom count */
-  header[10] = '\0';
-  *natom = atoi(header);
-  if (*natom > 99999) 
-    *iofoext = 1;
-
-  if (*iofoext == 1)
-    printf("corplugin) Using EXTended CHARMM coordinates file\n");
-
-  return f;
-}
-
-/* Read in the next atom info into the given storage areas; this assumes
-   that file has already been moved to the beginning of the atom records.
-   Returns the serial number of the atom. If there is an error, returns -1.*/
-static int get_cor_atom(FILE *f, char *atomName, char *atomType, char
-    *resName, char *segName, int *resId, int ioext) {
-  char inbuf[COR_RECORD_LENGTH+2], numAtomStr[11], resNStr[11], resIdStr[11];
-  char atomNameStr[11], segNameStr[11], resNameStr[11];
-  int numAtom;
-
-  memset(inbuf, 0, sizeof(inbuf));
-
-  if (corgets(inbuf, COR_RECORD_LENGTH+1, f) == NULL) {
-    return -1;
-  }
-
-  if (strlen(inbuf) < 60) {
-    printf("corplugin) Line too short: \n%s\n", inbuf);
-    return -1;
-  }
-
-  memset(numAtomStr, 0, sizeof(numAtomStr));
-  memset(resNStr, 0, sizeof(resNStr));
-  memset(resIdStr, 0, sizeof(resIdStr));
-  memset(resNameStr, 0, sizeof(resNameStr));
-  memset(segNameStr, 0, sizeof(segNameStr));
-  memset(atomNameStr, 0, sizeof(atomNameStr));
-
-  /*
-
-    CHARMM has a variety of input formats for the
-       read coor card
-    command. In order to support all of them the simplest would be to replace 
-
-    if (sscanf(inbuf, "%5c%5c%5c%5c%*10c%*10c%*10c%5c", 
-
-    with
-
-    if (sscanf(inbuf, "%s %s %s %s %*s %*s %*s %s", 
-
-    However this solution has 2 problems:
-     1. buffer overruns
-     2. it doesn't handle the cases where X,Y,Z values have no spaces in-between
-
-    In this fix we handle only two most important cases, depending on
-     the value of IOFOrmat command (either EXTEnded or NOEXtended):
-     EXT:    2I10,2X,A8,2X,A8,3F20.10,2X,A8,2X,A8,F20.10
-     NOEXT:  2I5,1X,A4,1X,A4,3F10.5,1X,A4,1X,A4,F10.5
-
-    This implementation introduces new flag iofoext in cordata
-    structure, which can choose between the 2 formats. Note that
-    CHARMM adds EXT keyword in the coordinate and psf files in the
-    case of IOFO EXTE command in the input script, or automatically
-    when there are 100,000 or more atoms in the system!
-
-  */
-
-  if (ioext == 1) {
-    if (sscanf(inbuf, "%10c%10c%10c%10c%*20c%*20c%*20c%10c%10c",
-               numAtomStr, resNStr, resNameStr, atomNameStr, segNameStr, resIdStr) != 6) {
-      printf("corplugin) Improperly formatted line: \n%s\n", inbuf);
-      return -1;
-    }
-    strip_whitespace(resName, sizeof(resName));  /* strip from long original */
-    strip_whitespace(atomName, sizeof(atomName));
-    strip_whitespace(segName, sizeof(segName));
-    memcpy(resName, resNameStr, 7);              /* XXX truncate extra chars */
-    memcpy(atomName, atomNameStr, 7);
-    memcpy(segName, segNameStr, 7);
-    resName[7] = '\0';                           /* NUL terminate strings.. */
-    atomName[7] = '\0';
-    segName[7] = '\0';
-  } else {
-    if (sscanf(inbuf, "%5c%5c%5c%5c%*10c%*10c%*10c%5c%5c",
-               numAtomStr, resNStr, resName, atomName, segName, resIdStr) != 6) {
-      printf("corplugin) Improperly formatted line: \n%s\n", inbuf);
-      return -1;
-    }
-    strip_whitespace(resName, 8);
-    strip_whitespace(atomName, 8);
-    strip_whitespace(segName, 8);
-  }
-
-  numAtom = atoi(numAtomStr);
-  *resId = atoi(resIdStr);
-  strcpy(atomType, atomName);
-
-  return numAtom;
-}
-
-
-/*
- * API functions
- */
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  int iofoext;      /* flag for extended CHARMM c31 version support */
-} cordata;
-
-static void *open_cor_read(const char *path, const char *filetype, 
-    int *natoms) {
-  int ioext ;
-  FILE *fd;
-  cordata *cor;
-
-  if (!(fd = open_cor_file(path, natoms, &ioext))) {
-    return NULL;
-  } 
-  cor = (cordata *) malloc(sizeof(cordata));
-  memset(cor, 0, sizeof(cordata));
-  cor->numatoms = *natoms;
-  cor->file = fd;
-  cor->iofoext = ioext ;
-  return cor;
-}
-
-static int read_cor_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  cordata *data = (cordata *)v;
-  int i;
-  
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (get_cor_atom(data->file, atom->name, atom->type, 
-                     atom->resname, atom->segid, 
-                     &atom->resid, data->iofoext) < 0) {
-      printf("corplugin) couldn't read atom %d\n", i);
-      return MOLFILE_ERROR;
-    }
-    atom->chain[0] = atom->segid[0];
-    atom->chain[1] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cor_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  cordata *cor = (cordata *)v;
-  char inbuf[COR_RECORD_LENGTH+2], header[6];
-  char xStr[21], yStr[21], zStr[21];
-  int i;
-
-  memset(inbuf, 0, sizeof(inbuf));
-  memset(header, 0, sizeof(header));
-  memset(xStr, 0, sizeof(xStr));
-  memset(yStr, 0, sizeof(yStr));
-  memset(zStr, 0, sizeof(zStr));
-
-  /* Skip the header */
-  do {
-    /* Return -1 on EOF */
-    if (feof(cor->file) || ferror(cor->file) || 
-        (fgets(inbuf, COR_RECORD_LENGTH+1, cor->file) == NULL)) {
-      return MOLFILE_ERROR;
-    }
-
-    if (sscanf(inbuf, " %5c", header) != 1) {
-      printf("corplugin) Improperly formatted line.\n");
-      return MOLFILE_ERROR;
-    }
-
-  } while (header[0]=='*');
-
-
-  /* read the coordinates */
-  for (i = 0; i < natoms; i++) {
-    if (corgets(inbuf, COR_RECORD_LENGTH+1, cor->file) == NULL) {
-      return MOLFILE_ERROR;
-    }
-    
-    if (cor->iofoext == 1 ) {
-      if (sscanf(inbuf, "%*10c%*10c%*10c%*10c%20c%20c%20c%*10c", 
-                 xStr, yStr, zStr) != 3) {
-        printf("corplugin) Error reading coordinates on line %d.\n%s\n", i, inbuf);
-        return MOLFILE_ERROR;
-      } else if (ts != NULL) {
-        /* We have a timestep -- save the coordinates */
-        ts->coords[3*i  ] = atof(xStr);
-        ts->coords[3*i+1] = atof(yStr);
-        ts->coords[3*i+2] = atof(zStr);
-      }
-    } else {
-      if (sscanf(inbuf, "%*5c%*5c%*5c%*5c%10c%10c%10c%*5c", 
-                 xStr, yStr, zStr) != 3) {
-        printf("corplugin) Error reading coordinates on line %d.\n%s\n", i, inbuf);
-        return MOLFILE_ERROR;
-      } else if (ts != NULL) {
-        /* We have a timestep -- save the coordinates */
-        ts->coords[3*i  ] = atof(xStr);
-        ts->coords[3*i+1] = atof(yStr);
-        ts->coords[3*i+2] = atof(zStr);
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_cor_read(void *mydata) {
-  cordata *data = (cordata *)mydata;
-  if (data) {
-    if (data->file) fclose(data->file);
-    free(data);
-  }
-}  
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cor";
-  plugin.prettyname = "CHARMM Coordinates";
-  plugin.author = "Eamon Caddigan, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cor";
-  plugin.open_file_read = open_cor_read;
-  plugin.read_structure = read_cor_structure;
-  plugin.read_next_timestep = read_cor_timestep;
-  plugin.close_file_read = close_cor_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cpmdlogplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cpmdlogplugin.c
deleted file mode 100644
index fa3bbb9f369e63bbecfd04439cddb71ee1c0fce1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cpmdlogplugin.c
+++ /dev/null
@@ -1,1666 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-
-/* *******************************************************
- *
- *          CPMD Output File Reader Plugin
- *
- * This plugin allows VMD to read some CPMD output files.
- * So far only PROPERTIES and specially modified 
- * MOLECULAR DYNAMICS BO runs.
- *
- * ********************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-#include <math.h>
-
-#include "gaussianplugin.h"
-#include "periodic_table.h"
-#include "unit_conversion.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
- 
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifndef CPMDLOG_DEBUG
-#define CPMDLOG_DEBUG 0
-#endif
-#define CPMDLOG_BASIS_DEBUG 1
-
-#if CPMDLOG_DEBUG
-#define PRINTERR vmdcon_printf(VMDCON_ERROR,                            \
-                               "\n In file %s, line %d: \n %s \n \n",   \
-                               __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#if CPMDLOG_DEBUG
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE ;   \
-    else fprintf(stderr,"%s:%d %s",__FILE__, __LINE__, x)
-#else
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-#endif
-
-/* make sure pointers are NULLed after free(3)ing them. */
-#define SAFE_FREE(ptr) free(ptr); ptr=NULL
-/* calloc with test of success */
-#define SAFE_CALLOC(ptr,type,count)                                 \
-  ptr = (type *)calloc(count,sizeof(type));                         \
-  if (ptr == NULL) {                                                \
-    PRINTERR;                                                       \
-    return MOLFILE_ERROR;                                           \
-  }
-
-#define UNK_SHELL -666
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL  -2
-#define SP_P_SHELL  -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-#define I_SHELL 6
-
-#define SPIN_ALPHA 0
-#define SPIN_BETA  1
-
-#define STATUS_UNKNOWN       -1
-#define STATUS_CONVERGED      0
-#define STATUS_SCF_NOT_CONV   1
-#define STATUS_TOO_MANY_STEPS 2
-#define STATUS_BROKEN_OFF     3
-
-static const char *runtypes[] = { 
-  "(unknown)", "ENERGY", "OPTIMIZE", "SADPOINT", "HESSIAN", 
-  "SURFACE", "DYNAMICS", "PROPERTIES", NULL};
-
-static const char *scftypes[] = { 
-  "(unknown)", "RHF", "UHF", "ROHF", "GVB", "MCSCF", "FF", NULL };
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-/** Top level CPMD log file parser. Responsible 
- *  for static, i.e. non-trajectory information. */
-static int parse_static_data(gaussiandata *, int *);
-
-/** Check if the current run is an actual CPMD run; 
- *  returns true/false */
-static int have_cpmd(gaussiandata *);
-
-/* this function replaces the basis set data from the log file with
- * with the equivalent data read from an internal basis set data base.
- * for simplicity we use the same format as gaussian. the basis set
- * data is expected to be in $VMDDIR/basis/<basis-set-name>.gbs. */
-static int get_internal_basis(gaussiandata *);
-
-/* convert shell symmetry type from char to int */
-static int shellsymm_int(char *symm);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(gaussiandata *);
-
-static int read_first_frame(gaussiandata *);
-
-/* this subroutine scans the output file for
- * the trajectory information */
-static int get_traj_frame(gaussiandata *);
-
-/* count the number of readable QM timesteps 
- * and collect other information about the
- * total trajectory. */
-static int find_traj_end(gaussiandata *);
-
-/* this function parses the input file for the final
- * wavefunction and stores it in the appropriate arrays; */
-static int get_wavefunction(gaussiandata *, qm_timestep_t *, qm_wavefunction_t *);
-
-/** read in mulliken charges */
-static int get_population(gaussiandata *, qm_timestep_t *);
-
-/* turn fortran double precision 'D' exponents into c parsable 'E's */
-static void fix_fortran_exp(char *string) {
-  while (*string) {
-    if ( (*string == 'D') || (*string == 'd')) *string='e';
-    ++string;
-  }
-}
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the CPMD logfile and get the number
- * of atoms.
- * We are also reading all the static (i.e. non-trajectory)
- * data here since we have to parse a bit to get the atom count
- * anyway. These data will then be provided to VMD by
- * read_cpmdlog_metadata() and read_cpmdlog_rundata().
- *
- * *************************************************************/
-static void *open_cpmdlog_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  gaussiandata *data;
-  
-  /* open the input file */
-  fd = fopen(filename, "rb");
-  if (fd == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* set up main data structure */
-  data = (gaussiandata *) calloc(1,sizeof(gaussiandata));
-  if (data == NULL) return NULL;
-  
-  data->runtyp = RUNTYP_UNKNOWN;
-  data->scftyp = SCFTYP_UNKNOWN;
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* check if the file is CPMD format; 
-   * if yes parse it, if not exit */
-  if (have_cpmd(data)==TRUE) {
-    /* if we're dealing with an unsupported CPMD
-     * version, we better quit. so far we can test 3.9.x-3.13.x */
-    if ((data->version < 30900) || (data->version > 40000)) {
-      vmdcon_printf(VMDCON_ERROR,
-                    "cpmdlogplugin) CPMD version %s is not "
-                    "(yet) supported. Bailing out.\n",
-                    data->version_string);
-      free(data);
-      return NULL;
-    }
-
-    /* get the non-trajectory information from the log file */    
-    if (parse_static_data(data, natoms) == FALSE) {
-      free(data);
-      return NULL;
-    }
-  }
-  else {
-    free(data);
-    return NULL;
-  }
-
-  return data;
-}
-
-
-/************************************************************
- * 
- * Provide VMD with the structure of the molecule, i.e the
- * atoms coordinates names, etc.
- *
- *************************************************************/
-static int read_cpmdlog_structure(void *mydata, int *optflags, 
-                      molfile_atom_t *atoms) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  molfile_atom_t *atom;
-  int i = 0;
- 
-  /* optional data from PTE */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS;
-
-  if (data->have_mulliken) 
-    *optflags |= MOLFILE_CHARGE;
-
-  /* all the information I need has already been read in
-   * via the initial scan and I simply need to copy 
-   * everything from the temporary arrays into the 
-   * proper VMD arrays. */
-
-  /* get initial pointer for atom array */
-  cur_atom = data->initatoms;
-
-  for(i=0; i<data->numatoms; i++) {
-    atom = atoms+i;
-    strncpy(atom->name, cur_atom->type, sizeof(atom->name)); 
-    strncpy(atom->type, get_pte_label(cur_atom->atomicnum), sizeof(atom->type));
-    strncpy(atom->resname,"QM", sizeof(atom->resname)); 
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->atomicnumber = cur_atom->atomicnum;
-    atom->radius = get_pte_vdw_radius(cur_atom->atomicnum);
-    /* XXX; check on isotopes. should be possible to read. */
-    atom->mass   = get_pte_mass(cur_atom->atomicnum);  
-    if (data->have_mulliken)
-      atom->charge = data->qm_timestep->mulliken_charges[i];
-
-    cur_atom++;
-  }
- 
-  return MOLFILE_SUCCESS; 
-}
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_cpmdlog_metadata(void *mydata, 
-    molfile_qm_metadata_t *gaussian_metadata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-
-  gaussian_metadata->ncart = 0;
-  gaussian_metadata->nimag = 0;
-  gaussian_metadata->nintcoords = 0;
-
-  /* orbital data */
-  gaussian_metadata->num_basis_funcs = data->num_basis_funcs;
-  gaussian_metadata->num_shells      = data->num_shells;
-  gaussian_metadata->wavef_size      = data->wavef_size;  
-
-#if vmdplugin_ABIVERSION > 11
-  /* charges */
-  gaussian_metadata->have_esp = 0;
-  gaussian_metadata->have_carthessian = 0;
-  gaussian_metadata->have_internals   = 0;
-  gaussian_metadata->have_normalmodes = FALSE;
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_cpmdlog_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-  int i;
-
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-  molfile_qm_sysinfo_t *sys_data     = &qm_data->run;
-
-  /* fill in molfile_qm_sysinfo_t */
-  sys_data->nproc = data->nproc;
-  sys_data->memory = data->memory; 
-  sys_data->runtype = data->runtyp;
-  sys_data->scftype = data->scftyp;
-  sys_data->totalcharge = data->totalcharge;
-/*  sys_data->multiplicity = data->multiplicity; */
-  sys_data->num_electrons = data->num_electrons;
-  sys_data->num_occupied_A = data->occ_orbitals_A;
-  sys_data->num_occupied_B = data->occ_orbitals_B;
-
-  strncpy(sys_data->basis_string, data->basis_string,
-          sizeof(sys_data->basis_string));
-  
-  strncpy(sys_data->runtitle, data->runtitle, sizeof(sys_data->runtitle));
-  strncpy(sys_data->geometry, data->geometry, sizeof(sys_data->geometry));
-  strncpy(sys_data->version_string, data->version_string,
-          sizeof(sys_data->version_string));
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->numatoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_symmetry[i] = data->shell_symmetry[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-
-    for (i=0; i<3*data->wavef_size; i++) {
-      basis_data->angular_momentum[i] = data->angular_momentum[i];
-    }
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-#if vmdplugin_ABIVERSION > 11
-
-/***********************************************************
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***********************************************************
- * Provide QM metadata for next timestep. 
- * This actually triggers reading the entire next timestep
- * since we have to parse the whole timestep anyway in order
- * to get the metadata. So we store the read data locally
- * and hand them to VMD when requested by read_timestep().
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  int i, have = 0;
-  gaussiandata *data = (gaussiandata *)mydata;
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) read_qm_timestep_metadata(): %d/%d/%d\n",
-                data->num_frames, 
-                data->num_frames_read,
-                data->num_frames_sent);
-#endif
-
-  meta->count = -1; /* Don't know the number of frames yet */
-  meta->has_gradient = 0;
-
-  if (data->num_frames_read > data->num_frames_sent) {
-    have = 1;
-  } else if (data->num_frames_read < data->num_frames) {
-#if CPMDLOG_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "cpmdlogplugin) Probing timestep %d\n", 
-                  data->num_frames_read);
-#endif
-    have = get_traj_frame(data);
-  }
-
-  if (have) {
-    /* get a pointer to the current qm timestep */
-    qm_timestep_t *cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-#if CPMDLOG_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "cpmdlogplugin) Approved timestep %d\n", 
-                  data->num_frames_sent);
-#endif
-    meta->num_scfiter  = 0;
-
-    for (i=0; (i<MAX_NUM_WAVE && i<cur_qm_ts->numwave); i++) { 
-#if CPMDLOG_DEBUG
-      vmdcon_printf(VMDCON_INFO,
-                    "cpmdlogplugin) num_orbitals_per_wavef[%d/%d]=%d\n",
-                    i+1, cur_qm_ts->numwave, cur_qm_ts->wave[i].num_orbitals);
-#endif
-      meta->num_orbitals_per_wavef[i] = cur_qm_ts->wave[i].num_orbitals;
-    }
-    meta->wavef_size = data->wavef_size;
-
-  } else {
-    meta->num_scfiter = 0;
-    meta->num_orbitals_per_wavef[0] = 0;
-    meta->num_wavef = 0;
-    meta->wavef_size = 0;
-
-    data->end_of_trajectory = TRUE;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * This function provides the data of the next timestep.
- * Here we actually don't read the data from file, that had
- * to be done already upon calling read_timestep_metadata().
- * Instead we copy the stuff from the local data structure
- * into the one's provided by VMD.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-			 molfile_qm_timestep_t *qm_ts) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  int i = 0;
-  qm_timestep_t *cur_qm_ts;
-
-  if (data->end_of_trajectory == TRUE) return MOLFILE_ERROR;
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO,
-                "cpmdlogplugin) Sending timestep %d\n", 
-                data->num_frames_sent);
-#endif
-
-  /* initialize pointer for temporary arrays */
-  cur_atom = data->initatoms; 
-  
-  /* copy the coordinates */
-  for(i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = cur_atom->x;
-    ts->coords[3*i+1] = cur_atom->y;
-    ts->coords[3*i+2] = cur_atom->z; 
-    cur_atom++;
-  }    
-  
-  /* get a convenient pointer to the current qm timestep */
-  cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-
-  /* store the SCF energies */
-  for (i=0; i<cur_qm_ts->num_scfiter; i++) {
-    qm_ts->scfenergies[i] = cur_qm_ts->scfenergies[i];
-  }
-
-  /* store the wave function and orbital energies */
-  if (cur_qm_ts->wave) {
-    for (i=0; i<cur_qm_ts->numwave; i++) {
-      qm_wavefunction_t *wave = &cur_qm_ts->wave[i];
-      if (wave->wave_coeffs && wave->orb_energies) {
-        memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-               wave->num_orbitals*data->wavef_size*sizeof(float));
-        memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-               wave->num_orbitals*sizeof(float));
-      }
-    }
-  }
-
-  if (data->runtyp == RUNTYP_ENERGY || data->runtyp == RUNTYP_HESSIAN) {
-    /* We have only a single point */
-    data->end_of_trajectory = TRUE;
-  }
-
-  data->num_frames_sent++;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-/** Clean up when done and free all memory 
- *  to avoid memory leaks.
- *
- **********************************************************/
-static void close_cpmdlog_read(void *mydata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->file_name);
-  free(data->initatoms);
-  free(data->basis);
-  free(data->shell_symmetry);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->mulliken_charges);
-  free(data->internal_coordinates);
-  free(data->wavenumbers);
-  free(data->intensities);
-  free(data->normal_modes);
-  free(data->angular_momentum);
-
-  if (data->basis_set) {
-    for(i=0; i<data->numatoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  for (i=0; i<data->num_frames_read; i++) {
-    free(data->qm_timestep[i].scfenergies);
-    free(data->qm_timestep[i].gradient);
-    free(data->qm_timestep[i].mulliken_charges);
-    for (j=0; j<data->qm_timestep[i].numwave; j++) {
-      free(data->qm_timestep[i].wave[j].wave_coeffs);
-      free(data->qm_timestep[i].wave[j].orb_energies);
-/*       free(data->qm_timestep[i].wave[j].occupancies); */
-    }
-    free(data->qm_timestep[i].wave);
-  }
-  free(data->qm_timestep);
-  
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-/*! count number of QM dataset frames. */
-static int find_traj_end(gaussiandata *data) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(data->file);
-
-  while (1) {
-    if (!fgets(buffer, sizeof(buffer), data->file)) break;
-
-    if (strstr(buffer, "PROJECTION COORDINATES")) {
-      data->num_frames++;
-    } 
-  }
-  data->opt_status = STATUS_UNKNOWN;
-
-  fseek(data->file, filepos, SEEK_SET);
-  return FALSE;  
-}
-
-
-static int get_final_info(gaussiandata *data) {
-  long filepos;
-  filepos = ftell(data->file);
-
-  if (data->runtyp == RUNTYP_OPTIMIZE || 
-      data->runtyp == RUNTYP_DYNAMICS) {
-    /* Try to advance to the end of the geometry
-     * optimization or MD. If no regular end is found we
-     * won't find any propertiies to read and return. */
-    if (!find_traj_end(data)) return FALSE;
-  }
-
-#if 0
-  if (get_esp_charges(data)) {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) ESP charges found!\n");
-  }
-#endif
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE; 
-}
-
-
-
-/********************************************************
- *
- * Main gaussian log file parser responsible for static,  
- * i.e. non-trajectory information.
- *
- ********************************************************/
-static int parse_static_data(gaussiandata *data, int *natoms) 
-{
-  char buffer[BUFSIZ];
-  char word[4][MOLFILE_BUFSIZ];
-  char *vmdbasis;
-  int  i,n;
-  int  numatoms, numstates, numelectrons, totalcharge;
-
-  buffer[0] = '\0';
-  
-  /* set some defaults */
-  data->scftyp = SCFTYP_RHF;
-  data->runtyp = RUNTYP_UNKNOWN;
-  numelectrons = 0;
-  data->totalcharge = 0;
-  data->multiplicity = 1;
-  data->have_basis=FALSE;       
-  /* CPMD never outputs basis set info, so we use 
-   * VSTO-6G unless overridden by environment */
-  vmdbasis = getenv("VMDDEFBASISSET");
-  if (vmdbasis == NULL) 
-    vmdbasis = "VSTO-6G";
-
-  strncpy(data->gbasis, vmdbasis, sizeof(data->gbasis));
-  strncpy(data->basis_string, "Internal ", sizeof(data->basis_string));
-  strncat(data->basis_string, vmdbasis, sizeof(data->basis_string) - 10);
-
-
-  /* try to find job type parameters within the next 100 lines.*/
-  for (i=0; i<100; ++i) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    if ( (strcmp(word[0],"CALCULATE" ) == 0 &&
-          strcmp(word[1],"SOME"      ) == 0 && 
-          strcmp(word[2],"PROPERTIES") == 0 ) ) {
-      data->runtyp = RUNTYP_PROPERTIES;
-      break;
-    } else if ( (strcmp(word[0],"GEOMETRY"    ) == 0 &&
-                 strcmp(word[1],"OPTIMIZATION") == 0 ) ) {
-      data->runtyp = RUNTYP_OPTIMIZE;
-      break;
-    } else if ( (strcmp(word[1],"MOLECULAR"    ) == 0 &&
-                 strcmp(word[2],"DYNAMICS") == 0 ) ) {
-      data->runtyp = RUNTYP_DYNAMICS;
-      break;
-      
-    }
-  }
-
-  /* XXX: add support for other types later? */
-  if ((data->runtyp != RUNTYP_PROPERTIES) &&
-      (data->runtyp != RUNTYP_DYNAMICS) ) {
-    vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Run-type: %s is currently "
-                  "not supported by this plugin.\n", runtypes[data->runtyp]);
-    return FALSE;
-  }
-  
-  if ((data->runtyp != RUNTYP_PROPERTIES) && (data->version < 31303)) {
-    vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Run-type: %s is currently "
-                  "not supported for outputs of this CPMD version.\n", 
-                  runtypes[data->runtyp]);
-    return FALSE;
-  }
-  
-  /* scavange for more setup information */
-  do {
-
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%s%s%s%s",word[0],word[1],word[2],word[3]);
-
-    /* empty line */
-    if (n < 0) continue;
-
-    /* atom types and initial coordinates */
-    if ( (strstr(word[0],"************") != 0 &&
-          strcmp(word[1],"ATOMS"       ) == 0 && 
-          strstr(word[2],"************") != 0 ) ) {
-      /* NR TYPE X(bohr) Y(bohr) Z(bohr) MBL */
-      GET_LINE(buffer, data->file);
-
-      numatoms=0;
-      data->initatoms=NULL;
-      while (1) {
-        qm_atom_t *atm;
-      
-        GET_LINE(buffer, data->file);
-        /* end of ATOMS block */
-        if (strstr(buffer, "*************************") != NULL)
-          break;
-        
-        data->initatoms=realloc(data->initatoms,(numatoms+1)*sizeof(qm_atom_t));
-        atm = data->initatoms + numatoms;
-        
-        n=sscanf(buffer,"%*d%s%g%g%g", atm->type, &atm->x, &atm->y, &atm->z);
-        if (n != 4) {
-          free(data->initatoms);
-          data->initatoms=NULL;
-          vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Failed to parse initial" 
-                        " coordinates. Stopping.\n");
-          return FALSE;
-        }
-        atm->atomicnum=get_pte_idx(atm->type);
-        atm->x *= BOHR_TO_ANGS;
-        atm->y *= BOHR_TO_ANGS;
-        atm->z *= BOHR_TO_ANGS;
-        ++numatoms;
-      };
-      data->numatoms = numatoms;
-      *natoms = numatoms;
-      
-    } else if ( (strcmp(word[0],"NUMBER" ) == 0 &&
-                 strcmp(word[2],"STATES:") == 0 ) ) {
-      numstates=atoi(word[3]);
-
-    } else if ( (strcmp(word[0],"NUMBER" ) == 0 &&
-                 strcmp(word[2],"ELECTRONS:") == 0 ) ) {
-      numelectrons=(int) (atof(word[3]) + 0.5); /* XXX */
-      data->num_electrons = numelectrons;
-      
-    } else if (strcmp(word[0],"CHARGE:" ) == 0 ) {
-      totalcharge =(int) (atof(word[1]) + 0.5); /* XXX */
-      data->totalcharge = totalcharge;
-      
-    } else if (strcmp(word[0],"OCCUPATION" ) == 0 ) {
-      ; /* XXX. */
-      
-    } else if ( (strcmp(word[0],"CELL" ) == 0 &&
-                 strcmp(word[1],"DIMENSION:") == 0 ) ) {
-      n=sscanf(buffer,"%*s%*s%g%g%g%g%g%g",data->initcell,data->initcell+1, 
-               data->initcell+2,data->initcell+3,data->initcell+4,data->initcell+5);
-      
-    /*  
-        PROJECT WAVEFUNCTION ON ATOMIC ORBITALS EVERY           10 STEPS
-    */
-    } else if ( (strcmp(word[0],"PROJECT" ) == 0 &&
-                 strcmp(word[1],"WAVEFUNCTION") == 0 ) ) {
-        data->have_wavefunction=1;
-    /*
-      DIPOLE MOMENT CALCULATION 
-      STORE DIPOLE MOMENTS EVERY                          10 STEPS
-      WANNIER FUNCTION DYNAMICS 
-    */
-    } else if ( (strcmp(word[0],"WANNIER" ) == 0 &&
-                 strcmp(word[1],"FUNCTION") == 0 ) ) {
-        if (data->have_wavefunction) {
-            data->have_wavefunction=2;
-        }
-    }
-  } while( strcmp(word[0],"INITIALIZATION") || 
-           strcmp(word[1],"TIME:") );
-
-  if (numstates >= numelectrons) 
-    data->scftyp = SCFTYP_UHF;
-
-  switch (data->scftyp) {
-    case SCFTYP_RHF:
-      data->occ_orbitals_A = numstates;
-      data->occ_orbitals_B = 0;
-      break;
-    case SCFTYP_UHF:            /* XXX: this is most likely wrong. check! */
-      data->occ_orbitals_A = numstates/2;
-      data->occ_orbitals_B = numstates/2;
-      break;
-    default:
-      break;
-  }
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Atoms: %d   Charge: %d   Multiplicity: %d\n", 
-                data->numatoms, data->totalcharge, data->multiplicity);
-
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Run-type: %s, SCF-type: %s\n",
-                runtypes[data->runtyp], scftypes[data->scftyp]);
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) using %s basis set.\n", data->basis_string);
-
-  read_first_frame(data);
-
-  get_final_info(data);
-  
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) found %d QM data frames.\n", data->num_frames);
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) num_frames_read = %d\n", 
-                data->num_frames_read);
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) num_frames_sent = %d\n", 
-                data->num_frames_sent);
-#endif
-  return TRUE;
-}
-
-/**********************************************************
- *
- * this subroutine checks if the provided files is
- * actually a CPMD file and gathers its version code.
- *
- **********************************************************/
-static int have_cpmd(gaussiandata *data) 
-{
-  char word[4][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ];
-  char *ptr;
-  int i = 0;
- 
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  /* check if the file is CPMD format 
-   * CPMD output typically begins with:
-   *  'PROGRAM CPMD STARTED'
-   */
-  i=0; /* check only the first 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    ++i;
-  } while( (strcmp(word[0],"PROGRAM") || 
-            strcmp(word[1],"CPMD") || 
-            strcmp(word[2],"STARTED")) && (i<100) );
-  if (i>=100) return FALSE;
-  vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Analyzing CPMD log file: %s\n",data->file_name);
-  
-  /* now read on until we find the block of text with encoded version
-   * number and compile date. */
-  i=0; /* check only the next 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s",word[0],word[1]);
-  } while ( (i<100) &&  (strcmp(word[0],"VERSION")) );
-  if (i>=100) return FALSE;
-
-  strcpy(data->version_string,word[1]);
-
-  /* now split version number strings */
-  ptr=strtok(word[1],"._");
-  data->version = 10000*atoi(ptr);
-  ptr=strtok(NULL,"._");
-  data->version += 100*atoi(ptr);
-  ptr=strtok(NULL,"._");
-  data->version += atoi(ptr);
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) CPMD version = %s  (Version code: %d)\n",
-                data->version_string, data->version);
-  return TRUE;
-}
-
-/*! read coordinates for old-style population analysis */
-static int read_first_frame(gaussiandata *data) {
-  
-  data->qm_timestep = NULL;
-
-  /* Read the basis set. */
-  get_internal_basis(data);
-
-  /* the angular momentum is populated in get_wavefunction 
-   * which is called by get_traj_frame(). We have obtained
-   * the array size wavef_size already from the basis set
-   * statistics */
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Reserving storage for %d cartesian atomic basis functions\n",
-                data->wavef_size);
-  SAFE_CALLOC(data->angular_momentum,int,3*data->wavef_size);
-
-  if (data->version < 31303) {
-
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) ##################################"
-                  "####################################\n");
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) This version of CPMD does not print "
-                  "the actual coordinates on properties runs.\n");
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) Using initial coordinates from the "
-                  "input file instead.\n");
-    vmdcon_printf(VMDCON_WARN,
-                  "cpmdlogplugin) These coodinates are most likely "
-                  "inconsistent with the projection.\n Try the following:\n\n"
-                  "set cur [atomselect top all]\n"
-                  "set new [atomselect [mol new GEOMETRY.xyz] all]\n"
-                  "$cur set {x y z} [$new get {x y z}]\n"
-                  "$cur delete; mol delete [$new molid]; $new delete\n\n");
-    vmdcon_printf(VMDCON_WARN, 
-                  "cpmdlogplugin) ##################################"
-                  "####################################\n");
-    /* Try to read wavefunction and orbital energies */
-    SAFE_CALLOC(data->qm_timestep,qm_timestep_t,1);
-    if (get_wavefunction(data, data->qm_timestep, NULL) == FALSE) {
-      vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) No wavefunction present for timestep %d\n", data->num_frames_read);
-      free(data->qm_timestep);
-      data->qm_timestep=NULL;
-    } else {
-      vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Wavefunction found.\n");
-      data->num_frames_read=1;
-      data->num_frames=1;
-    }
-  } else {
-    /* don't copy coordinates yet. we have the newer version of CPMD
-     * that prints them right before each projection. */
-    data->num_frames = 0;
-  }
-  
-  return TRUE;
-}
-
-
-/*******************************************************
- *
- * this function reads in the basis set data from 
- * <basis>.gbs or $VMDDIR/basis/<basis>.gbs
- *
- * XXX: this is the same function as in gaussianplugin
- * ******************************************************/
-int get_internal_basis(gaussiandata *data) {
-
-  char *vmddir=NULL;
-  FILE *fp;
-  char buffer[BUFSIZ];
-  char word[3][MOLFILE_BUFSIZ];
-  char filepath[256];
-  int  i,n, wavef_size; 
-
-  /* no point in adding a basis set if we already have this information */
-  if (data->have_basis) return TRUE;
-
-  /* try to open basis set database file. a file in the current
-   * directory takes priority over what is shipped with VMD. */
-  sprintf(filepath,"%s.gbs",data->gbasis);
-  fp=fopen(filepath,"rb");
-  if (fp == NULL) {
-      vmddir=getenv("VMDDIR");
-      if (vmddir == NULL) {
-          vmddir="/usr/local/lib/vmd";
-      }
-      sprintf(filepath,"%s/basis/%s.gbs",vmddir,data->gbasis);
-      fp=fopen(filepath,"rb");
-  }
-
-  if (fp == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) failed to read basis set "
-                  "from data base file %s\n", filepath);
-    data->num_shells_per_atom=NULL;
-    data->have_basis=FALSE;
-    return FALSE;
-  } else {
-    vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) reading basis set "
-                  "from data base file %s\n", filepath);
-  }
-  data->wavef_size=0;
-  
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  SAFE_CALLOC(data->basis_set,basis_atom_t,data->numatoms);
-
-  for (i=0; i < data->numatoms; ++i) {
-    int numshells, numprim;
-    int numread, ishell;
-    float scalef;
-    shell_t *shell;
-    
-    /* search for the characteristic first line starting with '****'. */
-    rewind(fp);
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-    } while(strcmp(word[0],"****"));
-  
-    /* search for an entry for the current atom in the format '<name> 0'. */
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      if (feof(fp)) {
-        free(data->basis_set);
-        data->basis_set=NULL;
-        data->num_shells_per_atom=NULL;
-        data->have_basis=FALSE;
-        vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) EOF in data base "
-                      "file %s while looking for element %s.\n", filepath, 
-                      get_pte_label(data->initatoms[i].atomicnum), buffer);
-        fclose(fp);
-        return FALSE;
-      }
-      n=sscanf(buffer,"%s%s",word[0],word[1]);
-    } while ( (n != 2) || strcmp(word[1],"0") ||
-              (strcmp(word[0],get_pte_label(data->initatoms[i].atomicnum))) );
-    
-    strncpy(data->basis_set[i].name,data->gbasis,sizeof(data->gbasis));
-    
-    numshells=0;
-    shell=NULL;
-
-    /* read basis set until end of element */
-    do {
-
-      fgets(buffer, sizeof(buffer), fp);
-      if (strstr(buffer,"****")) break;
-      if (ferror(fp)) {
-        vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) read error in data "
-                      "base file %s while reading basis of element %s.\n", 
-                      filepath, get_pte_label(data->initatoms[i].atomicnum));
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      numread=sscanf(buffer,"%s%d%f",word[0],&numprim,&scalef);
-      if (numread == 3) {
-#if CPMDLOG_DEBUG && CPMDLOG_BASIS_DEBUG
-        vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) atom: %d, element: %s, shell: %d "
-                      "%s-type shell, %d primitives, scalefactor %f\n", i,
-                      get_pte_label(data->initatoms[i].atomicnum), numshells+1, 
-                      word[0], numprim, scalef);
-#endif
-        ;
-      } else {
-        vmdcon_printf(VMDCON_ERROR, 
-                      "cpmdlogplugin) basis set parse error: %s",buffer);
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      ishell=numshells;
-      ++numshells;
-      shell=realloc(shell,numshells*sizeof(shell_t));
-      shell[ishell].numprims=numprim;
-      shell[ishell].symmetry=shellsymm_int(word[0]);
-      shell[ishell].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      data->num_basis_funcs += numprim;
-
-      switch(shell[ishell].symmetry) {
-        case S_SHELL:
-          data->wavef_size += 1;
-          break;
-        case P_SHELL:
-          data->wavef_size += 3;
-          break;
-        case SP_S_SHELL:
-          data->wavef_size += 4;
-          break;
-        case D_SHELL:
-          data->wavef_size += 6;  /* cartesian representation! */
-          break;
-        case SPD_S_SHELL:
-          data->wavef_size += 10;  /* cartesian representation! */
-          break;
-        case F_SHELL:
-          data->wavef_size += 10;  /* cartesian representation! */
-          break;
-        default:
-          break;
-      }
-      
-      if (shell[ishell].symmetry == SP_S_SHELL) {
-        ++numshells;
-        shell=realloc(shell,numshells*sizeof(shell_t));
-        shell[ishell+1].numprims=numprim;
-        shell[ishell+1].symmetry=SP_P_SHELL;
-        shell[ishell+1].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-        data->num_basis_funcs += numprim;
-      }
-
-      for (n=0; n<numprim; ++n) {
-        fgets(buffer, sizeof(buffer), fp);
-        if (ferror(fp)) {
-          vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) read error in data "
-                        "base file %s while reading basis of element %s.\n", 
-                        filepath, get_pte_label(data->initatoms[i].atomicnum));
-          free(data->basis_set);
-          data->basis_set=NULL;
-          return FALSE;
-        }
-        sscanf(buffer,"%s%s%s", word[0],word[1],word[2]);
-        fix_fortran_exp(word[0]);
-        shell[ishell].prim[n].exponent=atof(word[0])*scalef*scalef;
-        fix_fortran_exp(word[1]);
-        shell[ishell].prim[n].contraction_coeff=atof(word[1]);
-        if (shell[ishell].symmetry == SP_S_SHELL) {
-          shell[ishell+1].prim[n].exponent=shell[ishell].prim[n].exponent;
-          fix_fortran_exp(word[2]);
-          shell[ishell+1].prim[n].contraction_coeff=atof(word[2]);
-        }
-      }
-    } while(1);
-
-  
-    /* store shells in atom */
-    data->basis_set[i].numshells = numshells;
-    data->basis_set[i].shell = shell;
-    
-    /* store the total number of basis functions */
-    data->num_shells += numshells;
-  }
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Parsed %d uncontracted basis functions. \n", 
-                data->num_basis_funcs);
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  data->have_basis = TRUE;
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- * Convert shell symmetry type from char to int.
- * XXX: same function exists in gaussianplugin.
- ************************************************ */
-static int shellsymm_int(char *symm) {
-  int shell_symmetry;
-
-  switch (toupper(symm[0])) {
-    case 'S':
-      if (symm[1] == '\0') {
-        shell_symmetry = S_SHELL;
-      } else if (toupper(symm[1]) == 'P') {
-        if (symm[2] == '\0') {
-          shell_symmetry = SP_S_SHELL;
-        } else if (toupper(symm[1]) == 'D') {
-          shell_symmetry = SPD_S_SHELL;
-        } else {
-          shell_symmetry = UNK_SHELL;
-        } 
-      } else {
-        shell_symmetry = UNK_SHELL;
-      }
-      break;
-    case 'L':
-      shell_symmetry = SP_S_SHELL;
-      break;
-    case 'M': 
-      shell_symmetry = SP_P_SHELL;
-      break;
-    case 'P':
-      shell_symmetry = P_SHELL;
-      break;
-    case 'D':
-      shell_symmetry = D_SHELL;
-      break;
-    case 'F':
-      shell_symmetry = F_SHELL;
-      break;
-    case 'G':
-      shell_symmetry = G_SHELL;
-      break;
-    default:
-      shell_symmetry = UNK_SHELL;
-      break;
-  }
-
-  return shell_symmetry;
-}
-
-
-/** Populate the flat arrays containing the basis set data. */
-static int fill_basis_arrays(gaussiandata *data) {
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0 ;
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_symmetry;
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per primitive gaussian, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  SAFE_CALLOC(basis,float,2*data->num_basis_funcs);
-  SAFE_CALLOC(shell_symmetry,int,data->num_shells);
-  SAFE_CALLOC(num_shells_per_atom,int,data->numatoms);
-  SAFE_CALLOC(num_prim_per_shell,int,data->num_shells);
-  
-  /* place pointers into struct gaussiandata */
-  data->basis = basis;
-  data->shell_symmetry = shell_symmetry;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell = num_prim_per_shell;
-
-  for(i=0; i<data->numatoms; i++) {
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_symmetry[shellcount] = data->basis_set[i].shell[j].symmetry;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-  return TRUE;
-}
-
-/** this function extracts the trajectory information
- *  from the output file */
-static int get_traj_frame(gaussiandata *data) {
-  qm_timestep_t *cur_qm_ts;
-  char buffer[BUFSIZ];
-  char word[4][MOLFILE_BUFSIZ];
-  int n,i;
-  
-
-  buffer[0] = '\0';
-  word[0][0] = '\0';
-  word[1][0] = '\0';
-  word[2][0] = '\0';
-  word[3][0] = '\0';
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Timestep %d: ====\n", 
-                data->num_frames_read);
-#endif
-
-  /* allocate more memory for the timestep array */
-  data->qm_timestep = 
-    (qm_timestep_t *)realloc(data->qm_timestep, 
-                             (data->num_frames_read+1)*sizeof(qm_timestep_t));
-
-  /* get a convenient pointer to the current qm timestep */
-  cur_qm_ts = data->qm_timestep+data->num_frames_read;
-  memset(cur_qm_ts, 0, sizeof(qm_timestep_t));
-
-  /* search for data */
-  while (1) {
-
-    GET_LINE(buffer,data->file);
-    n = sscanf(buffer,"%s%s%s%s",word[0],word[1],word[2],word[3]);
-    
-    /* empty or uninteresting line */
-    if (n < 3) continue;
-
-    /* coordinates relevant for projection.
-     * this needs a CPMD version > 3.13.2
- ********************* PROJECTION COORDINATES ********************
-   NR   TYPE        X(bohr)        Y(bohr)        Z(bohr)    
-    1      B       8.536664      10.525423      10.202766
-    2      B      10.195353       8.831898      12.528872
-    3      H      10.467571       8.964546       9.816927
-    4      H       8.327684      10.371750      12.680045
-    5      H      12.222474       9.664531      13.239192
-    6      H       9.579094       6.722748      12.777072
-    7      H       6.516216       9.875605       9.562778
-    8      H       9.404536      12.649641       9.952504
- ****************************************************************
- */
-    if ( (strstr(word[0],"************") != 0 &&
-          strcmp(word[1],"PROJECTION"  ) == 0 && 
-          strcmp(word[2],"COORDINATES" ) == 0 && 
-          strstr(word[3],"************") != 0 ) ) {
-
-      /* NR TYPE X(bohr) Y(bohr) Z(bohr) */
-      GET_LINE(buffer, data->file);
-
-      if (data->initatoms==NULL) {
-        vmdcon_printf(VMDCON_ERROR,"why is initatoms NULL?\n");
-        return FALSE;
-      }
-
-      for (i=0; i < data->numatoms; ++i) {
-        qm_atom_t *atm;
-      
-        GET_LINE(buffer, data->file);
-        atm = data->initatoms + i;
-        
-        n=sscanf(buffer,"%*d%*s%g%g%g", &atm->x, &atm->y, &atm->z);
-        
-        if (n != 3) {
-          vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) Failed to parse "
-                        "projection coordinates. Stopping.\n");
-          return FALSE;
-        }
-        atm->atomicnum=get_pte_idx(atm->type);
-        atm->x *= BOHR_TO_ANGS;
-        atm->y *= BOHR_TO_ANGS;
-        atm->z *= BOHR_TO_ANGS;
-      }
-      buffer[0] = '\0';
-#if CPMDLOG_DEBUG
-      vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Coordinates found for timestep %d\n", data->num_frames_read);
-#endif
-    } else if ( (strcmp(word[0],"WAVEFUNCTIONS") == 0) &&
-         (strcmp(word[2],"ATOMIC"       ) == 0) &&
-         (strcmp(word[3],"ORBITAL"      ) == 0) ) {
-
-      /* Try to read wavefunction and orbital energies */
-      if (get_wavefunction(data, cur_qm_ts, NULL) == FALSE) {
-          vmdcon_printf(VMDCON_WARN, "cpmdlogplugin) No wavefunction present for timestep %d\n", data->num_frames_read);
-          /* XXX: add flag to ignore wfn */
-      }
-      if (data->have_wavefunction == 2) {
-#if 0          
-          /* Try to read localized wavefunctions  */
-          /* XXX: used offset or something. */
-          if (get_wavefunction(data, cur_qm_ts+XXX) == FALSE) {
-              vmdcon_printf(VMDCON_WARN, "cpmdlogplugin) No localized wavefunction present for timestep %d\n", data->num_frames_read);
-          }
-#endif
-      }
-      buffer[0] = '\0';
-      break; /* XXX */
-    } else if ( (strcmp(word[0],"POPULATION") == 0) &&
-                (strcmp(word[1],"ANALYSIS"  ) == 0) &&
-                (strcmp(word[3],"PROJECTED" ) == 0) ) {
-#if 0
-      if (get_population(data, cur_qm_ts)) {
-        vmdcon_printf(VMDCON_INFO, "cpmdlogplugin) Mulliken charges found\n");
-      }
-#endif
-      buffer[0] = '\0';
-      
-    } else if ( strcmp(word[0],"*"     ) == 0 &&
-                strcmp(word[1],"TIMING") == 0 && 
-                strcmp(word[2],"*"     ) == 0 ) {
-      data->end_of_trajectory=FALSE;
-      break;
-    } else if (feof(data->file)) {
-      data->end_of_trajectory=TRUE;
-      break;
-    }
-  }
-
-  /* next timestep or end of file */
-  data->num_frames_read++;
-
-  return TRUE;
-}
-
-
-
-/*********************************************************
- *
- * this function reads the actual wavefunction, which is
- * punched at the end of the log file
- *
- **********************************************************/
-static int get_wavefunction(gaussiandata *data, qm_timestep_t *ts, 
-                            qm_wavefunction_t *wf)
-{
-  float *orbital_energies;
-  float *wave_function;
-  char buffer[BUFSIZ];
-#define ORBSPERBLOCK 8
-  char word[ORBSPERBLOCK+1][MOLFILE_BUFSIZ];
-  int orbital_counter = 0;
-  int i = 0, j = 0, num_values = 0;
-  int total_orbs = data->occ_orbitals_A + data->occ_orbitals_B;
-  int num_orbs;
-
-  if (wf == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  wf->type = MOLFILE_WAVE_CANON;
-  wf->spin = SPIN_ALPHA;
-  
-  buffer[0] = '\0';
-  for (i=0; i <= ORBSPERBLOCK ; i++) word[i][0] = '\0';
-  /*
-   * Scan for something like this:
-      ORBITAL      1       2       3       4       5       6       7       8
-  COMPLETNESS    0.972   0.951   0.972   0.972   0.951   0.972   0.951   0.972
-  OCCUPATION     2.000   2.000   2.000   2.000   2.000   2.000   2.000   2.000
-  1   B  S      -0.064  -0.163   0.064   0.365   0.163  -0.365   0.163  -0.365
-         Px      0.000  -0.170   0.000   0.000  -0.170   0.000  -0.170   0.000
-         Pz      0.086   0.227  -0.086   0.181  -0.227  -0.181  -0.227  -0.181
-         Py      0.043   0.000   0.043   0.411   0.000   0.411   0.000   0.411
-  2   B  S       0.365  -0.163  -0.365  -0.064   0.163   0.064   0.163   0.064
-         Px      0.000  -0.170   0.000   0.000  -0.170   0.000  -0.170   0.000
-         Pz     -0.181  -0.227   0.181  -0.086   0.227   0.086   0.227   0.086
-         Py     -0.411   0.000  -0.411  -0.043   0.000  -0.043   0.000  -0.043
-  3   H  S      -0.049   0.200   0.049  -0.049   0.540   0.049   0.540   0.049
-  4   H  S      -0.049  -0.540   0.049  -0.049  -0.200   0.049  -0.200   0.049
-  5   H  S       0.520   0.078   0.041   0.056  -0.078   0.031  -0.078   0.031
-    ...
-   */
-
-
-  /* Reserve space for arrays storing wavefunction and orbital
-   * energies. For the wavefunction we reserve the number
-   * of alpha orbitals squared, for unrestricted twice as much.
-   * Accordingly, for the energies I use the number of A orbitals 
-   * In gaussian the number of alpha and beta orbitals is always 
-   * the same. */
-
-#if 0
-  SAFE_CALLOC(wave_function,float,data->wavef_size*num_orbs);
-  SAFE_CALLOC(orbital_energies,float,num_orbs);
-  ts->wave_function    = wave_function;
-  ts->orbital_energies = orbital_energies;
-
-
-  while (orbital_counter < num_orbs) {
-    /* read up to line of orbital indices */
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s",word[0]);
-    } while (strcmp(word[0],"ORBITAL"));
-
-    GET_LINE(buffer, data->file);           /* completeness */
-    num_orbs = sscanf(buffer,"%*s%s%s%s%s%s%s%s%s",word[0],word[1],
-                      word[2],word[3],word[4],word[5],word[6],word[7]);
-
-    /* we don't have orbital energies here, but we
-     * can use it for the completenes parameter. */
-    for(i=0; i<num_orbs; i++) 
-      *(orbital_energies+i) = atof(word[i]);
-
-    GET_LINE(buffer, data->file);           /* occupation */
-             
-    /* step orbital energy pointer */
-    orbital_energies = orbital_energies+num_orbs;
-    orbital_counter += num_orbs;
-
-    /* read in the wavefunction */
-    for (i=0; i<data->wavef_size; i++) {
-      int xexp=0, yexp=0, zexp=0;
-
-      /* read in the wavefunction coefficients for up 
-       * to 8 orbitals at a time line by line */
-      GET_LINE(buffer, data->file);
-      num_values = sscanf(buffer+7,"%4s%s%s%s%s%s%s%s%s", word[0], 
-                          word[1], word[2],word[3], word[4], 
-                          word[5], word[6], word[7], word[8]);
-
-      /* handle magenetic quantum number. in cartesian basis the
-       * labels are: S, PX, PY, PZ, DXX, DXY, DXZ, DYY, DYZ, DZZ, ...*/
-      for (j=1; j<strlen(word[0]); j++) {
-        switch (toupper(word[0][j])) {
-          case 'X':
-            xexp++;
-            break;
-          case 'Y':
-            yexp++;
-            break;
-          case 'Z':
-            zexp++;
-            break;
-            /* if we have pure d/f-functions the nomenclature changes to 
-             * 'D 0', 'D-1', 'D+1', 'D-2', 'D+2' */
-          case '+': /* fallthrough */
-          case '-': /* fallthrough */
-          case '0': /* fallthrough */
-          case '1': /* fallthrough */
-          case '2': /* fallthrough */
-            vmdcon_printf(VMDCON_ERROR, "cpmdlogplugin) pure basis function "
-                          "detected: '%s'. bailing out...\n", word[0]);
-            free(ts->wave_function);
-            wave_function=NULL;
-            free(ts->orbital_energies);
-            ts->orbital_energies=NULL;
-            return FALSE;
-            break;
-          default:
-            /* do nothing */
-            break;
-        }
-      }
-      data->angular_momentum[3*i  ] = xexp;
-      data->angular_momentum[3*i+1] = yexp;
-      data->angular_momentum[3*i+2] = zexp;
-#if CPMDLOG_DEBUG && CPMDLOG_BASIS_DEBUG
-      fprintf(stderr,"%s:%d orbital %d/%d  function %d/%s: %d %d %d\n", 
-              __FILE__, __LINE__, num_orbs, orbital_counter, 
-              i, word[0], xexp, yexp, zexp);
-#endif
-
-      /* each orbital has data->wavef_size entries, 
-       * hence we have to use this number as offset when storing 
-       * them in groups of five */
-      for (j=0 ; j<num_values-1; j++) {
-        wave_function[j*data->wavef_size+i] = atof(word[j+1]);
-      }
-    }
-    /* move wavefunction pointer to start of next block of orbitals */
-    wave_function = wave_function + num_orbs*data->wavef_size;
-    /* XXX: FIXME test with open shell run */
-    if ((data->scftyp == SCFTYP_UHF) && (orbital_counter==data->wavef_size)) {
-      GET_LINE(buffer, data->file);
-    }
-  }
-
-  /* store the number of orbitals read in */
-  ts->wavef_size = orbital_counter;
-#endif
-
-#if CPMDLOG_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "cpmdlogplugin) Number of orbitals scanned: %d \n",
-                orbital_counter);
-#endif
-  return TRUE;
-}
-
-
-/* Read the population analysis section.
- * Currently we parse only the Mulliken charges
- * but we might want to add support for populations
- * and for Lowdin analysis. */
-static int get_population(gaussiandata *data, qm_timestep_t *ts) {
-  int i;
-  char buffer[BUFSIZ];
-  data->have_mulliken = FALSE;
-
-
-  /* Read Mulliken charges if present */
-  ts->mulliken_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (!ts->mulliken_charges) {
-    PRINTERR; 
-    return FALSE;
-  }
-  
-  for (i=0; i<data->numatoms; i++) {
-    int n;
-    float mullpop, mullcharge, lowpop, lowcharge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*i%*s%f%f%f%f",
-               &mullpop, &mullcharge, &lowpop, &lowcharge);
-    if (n!=4) return FALSE;
-    ts->mulliken_charges[i] = mullcharge;
-  }
-
-  if (i!=data->numatoms) return FALSE;
-
-  data->have_mulliken = TRUE;
-  return TRUE;
-}
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cpmdlog";
-  plugin.prettyname = "CPMD 3.x output ";
-  plugin.author = "Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 0;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "out";
-  plugin.open_file_read = open_cpmdlog_read;
-  plugin.read_structure = read_cpmdlog_structure;
-  plugin.close_file_read = close_cpmdlog_read;
-
-  plugin.read_qm_metadata = read_cpmdlog_metadata;
-  plugin.read_qm_rundata  = read_cpmdlog_rundata;
-
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-#endif
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-  plugin.read_timestep = read_timestep;
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int numatoms, i, j, optflags;
-  molfile_atom_t *atoms;
-  molfile_timestep_t timestep;
-  molfile_metadata_t metadata;
-  molfile_timestep_metadata_t ts_metadata;
-  molfile_qm_timestep_metadata_t qm_ts_metadata;
-  molfile_qm_metadata_t qm_metadata;
-  molfile_qm_timestep_t qm_ts;
- 
-  void *v;
-
-  while (--argc) {
-    ++argv;
-    v = open_cpmdlog_read(*argv, "log", &numatoms);
-    if (!v) {
-      fprintf(stderr, "open_cpmdlog_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_cpmdlog_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", numatoms);
-    atoms = (molfile_atom_t *)malloc(sizeof(molfile_atom_t)*numatoms);
-    read_cpmdlog_structure(v,&optflags, atoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*numatoms);
-
-    
-    while (1) {
-      memset(&ts_metadata, 0, sizeof(molfile_timestep_metadata_t));
-      read_timestep_metadata(v, &ts_metadata);
-      memset(&qm_metadata, 0, sizeof(molfile_qm_metadata_t));
-      read_qm_timestep_metadata(v, &qm_ts_metadata);
-      qm_ts.scfenergies = (double *)malloc(qm_ts_metadata.num_scfiter*sizeof(double));
-      qm_ts.wave        = (molfile_qm_wavefunction_t *)malloc(qm_ts_metadata.num_wavef
-                                                              *sizeof(molfile_qm_wavefunction_t));
-      memset(qm_ts.wave, 0, qm_ts_metadata.num_wavef*sizeof(molfile_qm_wavefunction_t));
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        qm_ts.wave[j].wave_coeffs = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]
-                                                     * qm_ts_metadata.wavef_size * sizeof(float));
-        qm_ts.wave[j].orbital_energies = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]*sizeof(float));
-      }
-      qm_ts.gradient = (float *) malloc(3*numatoms*sizeof(float));
-      if (read_timestep(v, numatoms, &timestep, &qm_metadata, &qm_ts)) break;
-      /* do something with data */
-      /* XXX */
-
-      free(qm_ts.gradient);
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        free(qm_ts.wave[j].wave_coeffs);
-        free(qm_ts.wave[j].orbital_energies);
-      }
-      free(qm_ts.wave);
-      free(qm_ts.scfenergies);
-      i++;
-    }
-    fprintf(stderr, "ended read_timestep on frame %d\n", i);
-    close_cpmdlog_read(v);
-  }
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cpmdplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cpmdplugin.c
deleted file mode 100644
index d31eddc526339d06b5b2033cb1b10fe8b3535d56..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cpmdplugin.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: cpmdplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.15 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "unit_conversion.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  const char *file_name;
-} cpmddata;
- 
-static void *open_cpmd_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  cpmddata *data;
-  char linebuf[255];
-  int i, nfi_first, nfi_current, atomcount;
- 
-  printf("cpmd) trying to open file '%s'\n",filename);
-	  
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  data = (cpmddata *)malloc(sizeof(cpmddata));
-  data->file = fd;
-  data->file_name = filename;
-
-  nfi_first = 0;
-  nfi_current = 0;
-
-  /* first column is the current timestep number  */
-  fgets(linebuf, 255, fd);
-  i = sscanf(linebuf, "%d", &nfi_first);
-  if (i < 1) {
-    fprintf(stderr, "read) cpmd trajectory file '%s' should have the timestep number "
-            "in the first column\n", filename);
-    return NULL;
-  }
-  atomcount   = 0;
-  nfi_current = nfi_first;
-
-  /* loop through file until the contents of the first column
-     changes, indicating the end of a configuration */
-  while ((nfi_first == nfi_current) && !ferror(fd) && !feof(fd)) {
-    ++atomcount;
-    fgets(linebuf, 255, fd);
-    i = sscanf(linebuf, "%d", &nfi_current);
-    if (i < 1) {
-      fprintf(stderr, "read) cpmd trajectory file '%s' should have the "
-              "timestep number in the first column\n", filename);
-      return NULL;
-    }
-  }
-  printf("cpmd) found %d atoms in first timestep\n",atomcount);
-  *natoms = atomcount;
-  data->numatoms=*natoms;
-
-  /* rewind to the beginning for reading the coordinates elsewhere.*/
-  rewind(fd);
-
-  return data;
-}
-
-static int read_cpmd_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  int i, j;
-  char *k;
-  float coord;
-  molfile_atom_t *atom;
-  cpmddata *data = (cpmddata *)mydata;
-  
-  printf("cpmd) trying to read structure\n");
-  *optflags = MOLFILE_NOOPTIONS; /* no optional data */
-
-  for(i=0;i<data->numatoms;i++) {
-    char buffer[1024];
-    char fbuffer[1024];
-    k = fgets(fbuffer, 1024, data->file);
-    atom = atoms + i;
-    j=sscanf(fbuffer, "%s %f %f %f", buffer, &coord, &coord, &coord);
-    if (k == NULL) {
-      fprintf(stderr, "cpmd structure) missing atom(s) in file '%s'\n",data->file_name);
-      fprintf(stderr, "cpmd structure) expecting '%d' atoms, found only '%d'\n",data->numatoms,i+1);
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "cpmd structure) missing type or coordinate(s) in file '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    }
-
-    /* I don't know what to do with these */
-    strncpy(atom->name, buffer, sizeof(atom->name));
-    strncpy(atom->type, buffer, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    /* skip to the end of line */
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cpmd_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j, nfi_first, nfi_current;
-  char fbuffer[1024];
-  float x, y, z;
-  const float bohr=BOHR_TO_ANGS;
-  char *k;
-  
-  cpmddata *data = (cpmddata *)mydata;
-  nfi_first = nfi_current = -1;
-  
-  /* read the coordinates */
-  for (i=0; i<natoms; i++) {
-
-    k = fgets(fbuffer, 1024, data->file);
-
-    /* read next line if this is a continuation indicator */
-    if (strstr(fbuffer, "NEW DATA")) {
-      k = fgets(fbuffer, 1024, data->file);
-    }
-    j = sscanf(fbuffer, "%d %f %f %f", &nfi_current, &x, &y, &z);
-    if (nfi_first < 0) nfi_first = nfi_current;
-    
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "cpmd timestep) missing or illegal data in file"
-              " '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (nfi_first != nfi_current) {
-      fprintf(stderr, "cpmd timestep) short record in timestep %d of file"
-              " '%s' for atom '%d'\n",nfi_first, data->file_name,i+1);
-    }
-    
-    ts->coords[3*i  ] = x*bohr;
-    ts->coords[3*i+1] = y*bohr;
-    ts->coords[3*i+2] = z*bohr;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_cpmd_read(void *mydata) {
-  cpmddata *data = (cpmddata *)mydata;
-  
-  fclose(data->file);
-  free(data);
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cpmd";
-  plugin.prettyname = "CPMD";
-  plugin.author = "Axel Kohlmeyer, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cpmd";
-  plugin.open_file_read = open_cpmd_read;
-/*  plugin.read_structure = read_cpmd_structure; */
-  plugin.read_next_timestep = read_cpmd_timestep;
-  plugin.close_file_read = close_cpmd_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/crdplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/crdplugin.c
deleted file mode 100644
index 170f721a575fb05dd517ad338ceb3af89830585b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/crdplugin.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: crdplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.40 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * TODO: This plugin should probably be merged with the 'rst7' plugin, since
- *       the differences between them are minor, and there's no logical reason
- *       for them to be implemented completely independently as they are now.
- *       The major differences in formatting are in regard to the 6F12.7 (rst7)
- *       versus 10F8.3 (crd) ascii floating point conversion modes. 
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *file;
-  int has_box;
-  int numatoms;
-} crddata;
- 
-static void *open_crd_read(const char *filename, const char *filetype, 
-    int *natoms) {
- 
-  FILE *fd;
-  crddata *data;
- 
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  /* first line is title, so skip past it */
-  while (getc(fd) != '\n');
-
-  /* 
-   * CRD's don't store the number of atoms in the timestep, so we assume that
-   * the application will determine this for us.  
-   */
-  data = (crddata *)malloc(sizeof(crddata));
-  data->file = fd;
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-  /* filetype "crd" has no box; filetype "crdbox" does. */
-  data->has_box = strcmp(filetype, "crd"); 
-  return data;
-}
-
-/*
- * CRD files with box info are indistinguishable from regular CRD's.  
- * We regard CRD's with box info as a different file format.
- * CRD's don't tell how many atoms there are in each frame.  We therefore
- * rely on the numatoms field in the molfile_timestep_t parameter.
- */
-static int read_crd_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  crddata *crd = (crddata *)mydata;
-  int i, j;
-  float x, y, z;
-  float a, b, c;
-
-  /* Read in the atom coordinates */
-  for (i=0; i<natoms; i++) {
-    j = fscanf(crd->file, "%f %f %f", &x, &y, &z);
-    if (j == EOF) {
-      return MOLFILE_ERROR;
-    } else if (j <= 0) {
-      fprintf(stderr, "Problem reading CRD file\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* only save coords if we're given a valid ts pointer */ 
-    /* otherwise assume that VMD wants us to skip it.     */
-    if (ts != NULL) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-
-  /* Read the PBC box info. */
-  if (crd->has_box) {
-    j = fscanf(crd->file, "%f %f %f", &a, &b, &c);
-    if (j == EOF) {
-      printf("EOF in box\n");
-      return MOLFILE_ERROR;
-    } else if (j <= 0) {
-      printf("Problem reading box part of CRD file, scanf returned %d\n",j);
-      return MOLFILE_ERROR;
-    }
-
-    /* only save coords if we're given a valid ts pointer */ 
-    /* otherwise assume that VMD wants us to skip it.     */
-    if (ts != NULL) {
-      ts->A = a;
-      ts->B = b;
-      ts->C = c;
-
-      /* XXX periodic cell angles are only stored in the PARM file */
-      /* we should probably retrieve these from the already-loaded */
-      /* molecule when possible.                                   */
-      ts->alpha = 90.0;
-      ts->beta  = 90.0;
-      ts->gamma = 90.0;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_crd_read(void *mydata) {
-  crddata *crd = (crddata *)mydata;
-  fclose(crd->file);
-  free(crd);
-}
-
-static void *open_crd_write(const char *path, const char *filetype,
-    int natoms) {
-  crddata *crd;
-  FILE *fd;
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file %s for writing\n", path);
-    return NULL;
-  }
-  fprintf(fd, "TITLE : Created by VMD with %d atoms\n", natoms);
-  
-  crd = (crddata *)malloc(sizeof(crddata));
-  crd->file = fd;
-  crd->numatoms = natoms;
-  crd->has_box = strcmp(filetype, "crd"); 
-  return crd;
-}    
-  
-static int write_crd_timestep(void *v, const molfile_timestep_t *ts) {
-  crddata *crd = (crddata *)v;
-  int i;
-  int lfdone=0;
-  const int ndata = crd->numatoms * 3;
-
-  for (i=0; i<ndata; i++) {
-    lfdone = 0;
-    fprintf(crd->file, "%8.3f", ts->coords[i]);
-    if ((i+1) % 10 == 0) {
-      fprintf(crd->file, "\n"); 
-      lfdone = 1;
-    }
-  }
-  if (!lfdone)
-    fprintf(crd->file, "\n"); 
-    
-  if (crd->has_box) {
-    fprintf (crd->file, "%8.3f%8.3f%8.3f\n", ts->A, ts->B, ts->C);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_crd_write(void *v) {
-  crddata *crd = (crddata *)v;
-  fclose(crd->file);
-  free(crd);
-}
-
-/* registration stuff */
-    
-static molfile_plugin_t plugin;
-static molfile_plugin_t crdboxplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "crd";
-  plugin.prettyname = "AMBER Coordinates";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mdcrd,crd";
-  plugin.open_file_read = open_crd_read;
-  plugin.read_next_timestep = read_crd_timestep;
-  plugin.close_file_read = close_crd_read;
-  plugin.open_file_write = open_crd_write;
-  plugin.write_timestep = write_crd_timestep;
-  plugin.close_file_write = close_crd_write;
-
-  memcpy(&crdboxplugin, &plugin, sizeof(molfile_plugin_t));
-  crdboxplugin.name = "crdbox";
-  crdboxplugin.prettyname = "AMBER Coordinates with Periodic Box";
-
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  (*cb)(v, (vmdplugin_t *)&crdboxplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cubeplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cubeplugin.C
deleted file mode 100644
index aee24cf70990b61f2b3ca9a36d90ce5b1a62fbf8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/cubeplugin.C
+++ /dev/null
@@ -1,665 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: cubeplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.32 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-//
-// Plugin reader for Gaussian "cube" files
-//
-// Gaussian "cube" file format described here (as of 2013-09-24):
-// http://www.gaussian.com/g_tech/g_ur/u_cubegen.htm
-//
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "unit_conversion.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#include "periodic_table.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-static const float bohr = BOHR_TO_ANGS;
-
-// A format-independent structure to hold unit cell data
-typedef struct {
-  float A, B, C, alpha, beta, gamma;
-} cube_box;
-
-typedef struct {
-  FILE *fd;              // file descriptor
-  int nsets;             // number of volume datasets
-  int numatoms;          // number of atoms
-  bool coord;            // has coordinate data
-  long crdpos, datapos;  // seek offsets for coords and data
-  char *file_name;       // original filename 
-  float *datacache;      // temporary cache of orbital data prior to conversion
-  molfile_volumetric_t *vol; // volume data
-  float origin[3];       // origin, stored for periodic display hack 
-  float rotmat[3][3];    // rotation matrix, stored for periodic display hack
-  cube_box box;          // unit cell dimensions
-} cube_t;
-
-// Converts box basis vectors to A, B, C, alpha, beta, and gamma.  
-// Stores values in cube_box struct, which should be allocated before calling
-// this function.
-static int cube_readbox(cube_box *box, float *x, float *y, float *z) {
-  float A, B, C;
-
-  if (!box) {
-    return 1;
-  }
-
-  // provide defaults
-  box->A = 10.0;
-  box->B = 10.0;
-  box->C = 10.0;
-  box->alpha = 90.0;
-  box->beta  = 90.0;
-  box->gamma = 90.0;
-
-  // A, B, C are the lengths of the x, y, z vectors, respectively
-  A = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] );
-  B = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] );
-  C = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] );
-  if ((A<=0) || (B<=0) || (C<=0)) {
-    return 1;
-  }
-  box->A = A;
-  box->B = B;
-  box->C = C;
-
-  // gamma, beta, alpha are the angles between the x & y, x & z, y & z
-  // vectors, respectively
-  box->gamma = acos( (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])/(A*B) ) * 90.0/M_PI_2;
-  box->beta = acos( (x[0]*z[0]+x[1]*z[1]+x[2]*z[2])/(A*C) ) * 90.0/M_PI_2;
-  box->alpha = acos( (y[0]*z[0]+y[1]*z[1]+y[2]*z[2])/(B*C) ) * 90.0/M_PI_2; 
-
-  return 0;
-}
-
-// calculate and store origin and rotation matrix to realign everything later.
-static void cube_buildrotmat(cube_t *cube, float *o, float *a, float *b)
-{
-  // we rotate first around y and z to align a along the x-axis...
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  // ...then we rotate around x to put b into the xy-plane.
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  const double r[3][3] = { 
-    {               cph*cth,                    cph*sth,      sph},
-    {-sth*cps - sph*cth*sps,      cth*cps - sph*sth*sps,  cph*sps},
-    { sth*sps - sph*cth*cps,     -cth*sps - sph*sth*cps,  cph*cps}
-  };
-
-  for (int i=0; i<3; ++i) {
-    cube->origin[i] = o[i];
-    for (int j=0; j<3; ++j) {
-      cube->rotmat[i][j] = r[i][j];
-    }
-  }
-}
-
-// prototype.
-static void close_cube_read(void *v);
-
-static void *open_cube_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  cube_t *cube;
-  int xsize, ysize, zsize;
-  float a[3], b[3], c[3];
-  int i;
-  char readbuf[1024];
- 
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-
-  cube = new cube_t;
-  cube->fd = fd;
-  cube->vol = NULL;
-  cube->coord = false;
-  cube->file_name = strdup(filepath);
-  cube->datacache = NULL;
-
-  // initialize origin and rotmat to sensible defaults.
-  for (i=0; i<3; ++i) {
-      for (int j=0; j<3; ++j) {
-          cube->rotmat[i][j] = 0.0;
-      }
-  }
-  for (i=0; i<3; ++i) {
-      cube->origin[i] = 0.0;
-      cube->rotmat[i][i] = 1.0;
-  }
-
-  molfile_volumetric_t voltmpl; // base information for all data sets.
-
-  // read in cube file header information
-  fgets(readbuf, 1023, cube->fd);    // go on to next line
-
-  // identify this file, and read title string into dataset info
-  strcpy(voltmpl.dataname, "Gaussian Cube: ");
-  strncat(voltmpl.dataname, readbuf, 240);      // 240 is max space left after
-                                                //   "Gaussian Cube: "
-  fgets(readbuf, 1023, cube->fd); // skip second header line 
-
-  // read number of atoms and cube origin
-  // XXX: As of Gaussian09 revD01 this line contains an
-  // additional, yet undocumented (integer) number
-  // we read the entire and parse only the known numbers
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",
-              &cube->numatoms,
-              &voltmpl.origin[0],
-              &voltmpl.origin[1],
-              &voltmpl.origin[2]) != 4 )) {
-    close_cube_read(cube);
-    return NULL;
-  }
-
-  if (cube->numatoms > 0) {   // density cube file
-    cube->nsets = 1;          // this cube file contains only one data set
-  } else {
-    // cube file with orbitals => multiple densities.
-    cube->numatoms = - cube->numatoms;
-    cube->nsets = 0;          // we don't know yet how many data sets.
-  }
-  *natoms = cube->numatoms;
-
-
-  // read in cube axes and sizes
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",&xsize, &a[0], &a[1], &a[2]) != 4)) {
-    close_cube_read(cube);
-    return NULL;
-  }
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",&ysize, &b[0], &b[1], &b[2]) != 4)) {
-    close_cube_read(cube);
-    return NULL;
-  }
-  if ((fgets(readbuf, 255, cube->fd) == NULL) ||
-      (sscanf(readbuf, "%d%f%f%f",&zsize, &c[0], &c[1], &c[2]) != 4)) {
-    close_cube_read(cube);
-    return NULL;
-  }
-
-  // calculate number of samples in each dimension
-  voltmpl.xsize = xsize;
-  voltmpl.ysize = ysize;
-  voltmpl.zsize = zsize;
-  voltmpl.has_color = 0;
-
-  // to make the periodic display work, we need to rotate
-  // the cellvectors (and the coordinates) in such a way,
-  // that the a-vector is collinear with the x-axis and
-  // the b-vector is in the xy-plane. 
-  cube_buildrotmat(cube, voltmpl.origin, a, b);
-  // print warning, if the rotation will be significant:
-  if ((fabs((double) a[1]) + fabs((double) a[2]) + fabs((double) b[2]))
-      > 0.001) {
-    vmdcon_printf(VMDCON_WARN, 
-            "cubeplugin) Coordinates will be rotated to comply \n");
-    vmdcon_printf(VMDCON_WARN, 
-            "cubeplugin) with VMD's conventions for periodic display.\n");
-  }
-
-  // all dimensional units are always in Bohr
-  // so scale axes and origin correctly.
-  // NOTE: the angstroms are only allowed in input.
-  voltmpl.origin[0] *= bohr; 
-  voltmpl.origin[1] *= bohr;
-  voltmpl.origin[2] *= bohr;
-
-  // store aligned axes.
-  for (i=0; i<3; ++i) {
-    voltmpl.xaxis[i] = cube->rotmat[i][0] * a[0] 
-      + cube->rotmat[i][1] * a[1] + cube->rotmat[i][2] * a[2];
-
-    voltmpl.yaxis[i] = cube->rotmat[i][0] * b[0] 
-      + cube->rotmat[i][1] * b[1] + cube->rotmat[i][2] * b[2];
-    
-    voltmpl.zaxis[i] = cube->rotmat[i][0] * c[0] 
-      + cube->rotmat[i][1] * c[1] + cube->rotmat[i][2] * c[2];
-  }
-
-  voltmpl.xaxis[0] *= bohr * xsize;
-  voltmpl.xaxis[1] *= bohr * xsize; 
-  voltmpl.xaxis[2] *= bohr * xsize; 
-
-  voltmpl.yaxis[0] *= bohr * ysize; 
-  voltmpl.yaxis[1] *= bohr * ysize; 
-  voltmpl.yaxis[2] *= bohr * ysize; 
-
-  voltmpl.zaxis[0] *= bohr * zsize; 
-  voltmpl.zaxis[1] *= bohr * zsize; 
-  voltmpl.zaxis[2] *= bohr * zsize; 
-
-  /*   As of VMD version 1.8.3, volumetric data points are 
-   *   expected to represent the center of a grid box. cube format 
-   *   volumetric data represents the value at the edges of the 
-   *   grid boxes, so we need to shift the internal origin by half
-   *   a grid box diagonal to have the data at the correct position.
-   *   This will need to be changed again when the plugin interface 
-   *   is updated to explicitly allow point/face-centered data sets.
-   */
-  voltmpl.origin[0] -= 0.5 * ( voltmpl.xaxis[0] / (double) xsize
-                    + voltmpl.yaxis[0] / (double) ysize
-                    + voltmpl.zaxis[0] / (double) zsize);
-  voltmpl.origin[1] -= 0.5 * ( voltmpl.xaxis[1] / (double) xsize
-                    + voltmpl.yaxis[1] / (double) ysize
-                    + voltmpl.zaxis[1] / (double) zsize);
-  voltmpl.origin[2] -= 0.5 * ( voltmpl.xaxis[2] / (double) xsize
-                    + voltmpl.yaxis[2] / (double) ysize
-                    + voltmpl.zaxis[2] / (double) zsize);
-
-#if defined(TEST_PLUGIN)
-  printf("cell before rotation:\n");
-  printf("a: %12.8f %12.8f %12.8f\n", a[0]*xsize*bohr, a[1]*ysize*bohr, a[2]*zsize*bohr);
-  printf("b: %12.8f %12.8f %12.8f\n", b[0]*xsize*bohr, b[1]*ysize*bohr, b[2]*zsize*bohr);
-  printf("c: %12.8f %12.8f %12.8f\n", c[0]*xsize*bohr, c[1]*ysize*bohr, c[2]*zsize*bohr);
-
-  printf("cell after rotation:\n");
-  printf("x: %12.8f %12.8f %12.8f\n", voltmpl.xaxis[0], voltmpl.xaxis[1], voltmpl.xaxis[2]);
-  printf("y: %12.8f %12.8f %12.8f\n", voltmpl.yaxis[0], voltmpl.yaxis[1], voltmpl.yaxis[2]);
-  printf("z: %12.8f %12.8f %12.8f\n", voltmpl.zaxis[0], voltmpl.zaxis[1], voltmpl.zaxis[2]);
-#endif
-
-  // store the unit cell information for later perusal.
-  if (cube_readbox(&(cube->box), voltmpl.xaxis, voltmpl.yaxis, voltmpl.zaxis)) {
-    vmdcon_printf(VMDCON_WARN, "cubeplugin) Calculation of unit cell "
-                  "size failed. Continuing anyways...\n");
-  }
-
-  cube->crdpos = ftell(cube->fd); // and record beginning of coordinates
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
-
-  if (cube->nsets >0) { 
-    int i;
-
-    // density cube file, copy voltmpl into the cube struct.
-    cube->vol = new molfile_volumetric_t[1];
-    memcpy(cube->vol, &voltmpl, sizeof(voltmpl));
-
-    // skip over coordinates to find the start of volumetric data
-    for (i=0; i < cube->numatoms; i++)
-      fgets(readbuf, 1023, cube->fd);
-
-    cube->datapos = ftell(cube->fd); // and record beginning of data
-    // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O, 
-    // hope we don't read any files >= 2GB...
-  } else {              
-    int i;
-
-    // orbital cube file. we now have to read the orbitals section
-    // skip over coordinates
-    for (i=0; i < cube->numatoms; i++)
-      fgets(readbuf, 1023, cube->fd);
-      
-    fscanf(cube->fd, "%d", &cube->nsets);
-    vmdcon_printf(VMDCON_INFO, "cubeplugin) found %d orbitals\n", cube->nsets);
-    cube->vol = new molfile_volumetric_t[cube->nsets];
-    for (i=0; i < cube->nsets; ++i) {
-      int orb;
-      fscanf(cube->fd, "%d", &orb);
-      memcpy(&cube->vol[i], &voltmpl, sizeof(voltmpl));
-      sprintf(cube->vol[i].dataname, "Gaussian Cube: Orbital %d", orb);
-    }
-      
-    fgets(readbuf, 1023, cube->fd);  // gobble up rest of line
-    cube->datapos = ftell(cube->fd); // and record beginning of data
-    // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O, 
-    // hope we don't read any files >= 2GB...
-  }
-
-  return cube;
-}
-
-  
-static int read_cube_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  int i, j;
-  char *k;
-  molfile_atom_t *atom;
-
-  cube_t *cube = (cube_t *)v;
-
-  // go to coordinates
-  fseek(cube->fd, cube->crdpos, SEEK_SET);
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
-
-  /* set mass and radius from PTE, charge from atoms section of cube file. */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS | MOLFILE_CHARGE; 
-
-  for(i=0;i<cube->numatoms;i++) {
-    int idx;
-    float chrg;
-    char fbuffer[1024];
-
-    atom = atoms + i;
-
-    k = fgets(fbuffer, 1024, cube->fd);
-    j=sscanf(fbuffer, "%d %f %*f %*f %*f", &idx, &chrg);
-    if (k == NULL) {
-      vmdcon_printf(VMDCON_ERROR, "cube structure) missing atom(s) in "
-                                  "file '%s'\n",cube->file_name);
-      vmdcon_printf(VMDCON_ERROR, "cube structure) expecting '%d' atoms,"
-                                  " found only '%d'\n",cube->numatoms,i+1);
-      return MOLFILE_ERROR;
-    } else if (j < 2) {
-      vmdcon_printf(VMDCON_INFO, "cube structure) missing atom data in file"
-                                 " '%s' for atom '%d'\n",cube->file_name,i+1);
-      return MOLFILE_ERROR;
-    }
-
-    // assign atom symbol to number. flag unknown or dummy atoms with X.
-    atom->atomicnumber = idx;
-    strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->mass = get_pte_mass(idx);
-    atom->radius = get_pte_vdw_radius(idx);
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->charge = chrg;
-    /* skip to the end of line */
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_cube_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  int i, j, n;
-  char fbuffer[1024];
-  float x, y, z;
-  char *k;
-  
-  cube_t *cube = (cube_t *)v;
-
-  // there is only one set of coordinates
-  if (cube->coord) return MOLFILE_EOF;
-  cube->coord = true;
-
-  // jump to coordinate position
-  fseek(cube->fd, cube->crdpos, SEEK_SET);
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
- 
-  /* read the coordinates */
-  for (i=0; i<cube->numatoms; i++) {
-    k = fgets(fbuffer, 1024, cube->fd);
-    j = sscanf(fbuffer, "%*d %*f %f %f %f", &x, &y, &z);
-    
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 3) {
-      vmdcon_printf(VMDCON_ERROR, "cube timestep) missing type or coordinate(s)"
-                    " in file '%s' for atom '%d'\n",cube->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (j>=3) {
-      if (ts != NULL) { 
-        // Only save coords if we're given a timestep pointer, 
-        // otherwise assume that VMD wants us to skip past it.
-        
-        // In order to make the periodic display work, we need to
-        // rotate the coordinates around the origin by the stored
-        // rotation matrix. All coordinates are in Bohr, so they
-        // must be converted to Angstrom, too.
-        x -= cube->origin[0];
-        y -= cube->origin[1];
-        z -= cube->origin[2];
-        
-        for (n=0; n<3; ++n) {
-          ts->coords[3*i + n] = bohr*(cube->origin[n] 
-                                      + cube->rotmat[n][0] * x
-                                      + cube->rotmat[n][1] * y
-                                      + cube->rotmat[n][2] * z);
-        }
-      }
-    } else {
-      break;
-    }
-  }
-  // set unitcell dimensions from cached data.
-  if (ts != NULL) { 
-      ts->A = cube->box.A;
-      ts->B = cube->box.B;
-      ts->C = cube->box.C;
-      ts->alpha = cube->box.alpha;
-      ts->beta  = cube->box.beta;
-      ts->gamma = cube->box.gamma;
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cube_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  cube_t *cube = (cube_t *)v;
-  *nsets = cube->nsets; 
-  *metadata = cube->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_cube_data(void *v, int set, float *datablock, float *colorblock) {
-  cube_t *cube = (cube_t *)v;
-
-  vmdcon_printf(VMDCON_INFO, "cubeplugin) trying to read cube data set %d\n", set);
-
-  int xsize = cube->vol[set].xsize; 
-  int ysize = cube->vol[set].ysize;
-  int zsize = cube->vol[set].zsize;
-  int xysize = xsize*ysize;
-  int nsize = cube->nsets;
-  int nzsize = nsize*zsize;
-  int nyzsize = nsize*zsize*ysize;
-  int x, y, z;
-
-  // go to data
-  fseek(cube->fd, cube->datapos, SEEK_SET);
-  // XXX fseek()/ftell() are incompatible with 64-bit LFS I/O implementations, 
-  // hope we don't read any files >= 2GB...
-
-  // read the data values in 
-  if (cube->nsets == 1) { // density cube file
-    for (x=0; x<xsize; x++) {
-      for (y=0; y<ysize; y++) {
-        for (z=0; z<zsize; z++) {
-          if (fscanf(cube->fd, "%f", &datablock[z*xysize + y*xsize + x]) != 1) {
-              return MOLFILE_ERROR;
-          }
-        }
-      } 
-    }
-  } else {
-    // XXX we may wish to examine this strategy for alternatives that provide
-    // the same performance but without the extra copy, but it makes sense 
-    // for now.  
-
-    // Since the orbital cube file stores the data orb1(a1,b1,c1), orb2(a1,b1,c1), 
-    // ... orbn(a1,b1,c1), orb1(a1,b1,c2), orb2(a1,a1,c2), ..., orbn(ai,bj,ck)
-    // we have to cache the whole data set of have any kind of reasonable performance.
-    // otherwise we would have to read (and parse!) the whole file over and over again.
-    // this way we have to do it only once at the temporary expense of some memory.
-    if (cube->datacache == NULL) {
-      int points = xsize*ysize*zsize * nsize; // number of grid cells * nsets
-      int i;
-
-      // let people know what is going on.
-      vmdcon_printf(VMDCON_INFO, "cubeplugin) creating %d MByte cube orbital"
-                    " cache.\n", (int) (points*sizeof(float)) / 1048576);
-      cube->datacache = new float[points];
-            
-      for (i=0; i < points; ++i) {
-        if (fscanf(cube->fd, "%f", &cube->datacache[i]) != 1) {
-          return MOLFILE_ERROR;
-        }
-
-        // print an ascii progress bar so impatient people do not get scared.
-        // this does not translate well with vmdcon, so we keep it.
-        // we'd need some way to flag replacing a line instead of writing it.
-        if ((i % (1048576/sizeof(float))) == 0) {  // one dot per MB.
-          fprintf(stderr, "."); 
-        }
-      }
-    }
-      
-    for (x=0; x<xsize; x++) {
-      for (y=0; y<ysize; y++) {
-        for (z=0; z<zsize; z++) {
-          datablock[z*xysize + y*xsize + x] = cube->datacache[x*nyzsize + y*nzsize + z*nsize + set];
-        }
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_cube_read(void *v) {
-  cube_t *cube = (cube_t *)v;
-
-  fclose(cube->fd);
-  if (cube->vol) {
-    delete[] cube->vol; 
-  }
-  free(cube->file_name);
-  if (cube->datacache) { 
-    vmdcon_printf(VMDCON_INFO, "cubeplugin) freeing cube orbital cache.\n");
-    delete[] cube->datacache; 
-  }  
-
-  delete cube;
-}
-
-/*
- * Initialization stuff here
- */
-
-int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "cube";
-  plugin.prettyname = "Gaussian Cube";
-  plugin.author = "Axel Kohlmeyer, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cub,cube";
-  plugin.open_file_read = open_cube_read;
-  plugin.read_structure = read_cube_structure;
-  plugin.read_next_timestep = read_cube_timestep;
-  plugin.close_file_read = close_cube_read;
-  plugin.read_volumetric_metadata = read_cube_metadata;
-  plugin.read_volumetric_data = read_cube_data;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-  void *v;
-  int i, nsets, set;
-  molfile_volumetric_t * meta;
-
-  while (--argc) {
-    ++argv;
-    v = open_cube_read(*argv, "cube", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_cube_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_cube_read succeeded for file %s\n", *argv);
-
-    // try loading the EDM metadata now
-    if (read_cube_metadata(v, &nsets, &meta)) {
-      return 1; // failed to load cube file
-    }
-    fprintf(stderr, "read_cube_metadata succeeded for file %s\n", *argv);
-
-    for (set=0; set<nsets; set++) {
-      printf("Loading volume set: %d\n", set);   
-      
-      int elements = meta[set].xsize * meta[set].ysize * meta[set].zsize;
-      printf("   Grid Elements: %d\n", elements);
-      printf(" Grid dimensions: X: %d Y: %d Z: %d\n", 
-             meta[set].xsize, meta[set].ysize, meta[set].zsize);
-
-      float * voldata = (float *) malloc(sizeof(float) * elements);
-      float * coldata = NULL;
-
-      if (meta[set].has_color) {
-        coldata = (float *) malloc(sizeof(float) * elements * 3);
-      }
-
-      // try loading the data sets now
-      if (read_cube_data(v, set, voldata, coldata)) {
-        return 1; // failed to load cube file
-      }
-
-      printf("First 6 elements:\n   ");
-      for (i=0; i<6; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-
-      printf("Last 6 elements:\n   ");
-      for (i=elements - 6; i<elements; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-    }
-
-    close_cube_read(v);
-  }
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dcdplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dcdplugin.c
deleted file mode 100644
index a8c71fd8db94780cd80e6e7e0ffd1813f70a2726..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dcdplugin.c
+++ /dev/null
@@ -1,1244 +0,0 @@
-/***************************************************************************
- *cr                                                                       
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the           
- *cr                        University of Illinois                       
- *cr                         All Rights Reserved                        
- *cr                                                                   
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dcdplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.79 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Code for reading and writing CHARMM, NAMD, and X-PLOR format 
- *   molecular dynamic trajectory files.
- *
- * TODO:
- *   Integrate improvements from the NAMD source tree
- *    - NAMD's writer code has better type-correctness for the sizes
- *      of "int".  NAMD uses "int32" explicitly, which is required on
- *      machines like the T3E.  VMD's version of the code doesn't do that
- *      presently.
- *
- *  Try various alternative I/O API options:
- *   - use mmap(), with read-once flags
- *   - use O_DIRECT open mode on new revs of Linux kernel 
- *   - use directio() call on a file descriptor to enable on Solaris
- *   - use aio_open()/read()/write()
- *   - use readv/writev() etc.
- *
- *  Standalone test binary compilation flags:
- *  cc -fast -xarch=v9a -I../../include -DTEST_DCDPLUGIN dcdplugin.c \
- *    -o ~/bin/readdcd -lm
- *
- *  Profiling flags:
- *  cc -xpg -fast -xarch=v9a -g -I../../include -DTEST_DCDPLUGIN dcdplugin.c \
- *    -o ~/bin/readdcd -lm
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-#include "fastio.h"       /* must come before others, for O_DIRECT...   */
-
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <time.h>
-#include "endianswap.h"
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#define RECSCALE32BIT 1
-#define RECSCALE64BIT 2
-#define RECSCALEMAX   2
-
-typedef struct {
-  fio_fd fd;
-  int natoms;
-  int nsets;
-  int setsread;
-  int istart;
-  int nsavc;
-  double delta;
-  int nfixed;
-  float *x, *y, *z;
-  int *freeind;
-  float *fixedcoords;
-  int reverse;
-  int charmm;  
-  int first;
-  int with_unitcell;
-} dcdhandle;
-
-/* Define error codes that may be returned by the DCD routines */
-#define DCD_SUCCESS      0  /* No problems                     */
-#define DCD_EOF         -1  /* Normal EOF                      */
-#define DCD_DNE         -2  /* DCD file does not exist         */
-#define DCD_OPENFAILED  -3  /* Open of DCD file failed         */
-#define DCD_BADREAD     -4  /* read call on DCD file failed    */
-#define DCD_BADEOF      -5  /* premature EOF found in DCD file */
-#define DCD_BADFORMAT   -6  /* format of DCD file is wrong     */
-#define DCD_FILEEXISTS  -7  /* output file already exists      */
-#define DCD_BADMALLOC   -8  /* malloc failed                   */
-#define DCD_BADWRITE    -9  /* write call on DCD file failed   */
-
-/* Define feature flags for this DCD file */
-#define DCD_IS_XPLOR        0x00
-#define DCD_IS_CHARMM       0x01
-#define DCD_HAS_4DIMS       0x02
-#define DCD_HAS_EXTRA_BLOCK 0x04
-#define DCD_HAS_64BIT_REC   0x08
-
-/* defines used by write_dcdstep */
-#define NFILE_POS 8L
-#define NSTEP_POS 20L
-
-/* READ Macro to make porting easier */
-#define READ(fd, buf, size)  fio_fread(((void *) buf), (size), 1, (fd))
-
-/* WRITE Macro to make porting easier */
-#define WRITE(fd, buf, size) fio_fwrite(((void *) buf), (size), 1, (fd))
-
-/* XXX This is broken - fread never returns -1 */
-#define CHECK_FREAD(X, msg) if (X==-1) { return(DCD_BADREAD); }
-#define CHECK_FEOF(X, msg)  if (X==0)  { return(DCD_BADEOF); }
-
-
-/* print DCD error in a human readable way */
-static void print_dcderror(const char *func, int errcode) {
-  const char *errstr;
-
-  switch (errcode) {
-    case DCD_EOF:         errstr = "end of file"; break;
-    case DCD_DNE:         errstr = "file not found"; break;
-    case DCD_OPENFAILED:  errstr = "file open failed"; break;
-    case DCD_BADREAD:     errstr = "error during read"; break;
-    case DCD_BADEOF:      errstr = "premature end of file"; break;
-    case DCD_BADFORMAT:   errstr = "corruption or unrecognized file structure"; break;
-    case DCD_FILEEXISTS:  errstr = "output file already exists"; break;
-    case DCD_BADMALLOC:   errstr = "memory allocation failed"; break;
-    case DCD_BADWRITE:    errstr = "error during write"; break;
-    case DCD_SUCCESS:     
-    default:
-      errstr = "no error";
-      break;
-  } 
-  printf("dcdplugin) %s: %s\n", func, errstr); 
-}
-
-
-/*
- * Read the header information from a dcd file.
- * Input: fd - a file struct opened for binary reading.
- * Output: 0 on success, negative error code on failure.
- * Side effects: *natoms set to number of atoms per frame
- *               *nsets set to number of frames in dcd file
- *               *istart set to starting timestep of dcd file
- *               *nsavc set to timesteps between dcd saves
- *               *delta set to value of trajectory timestep
- *               *nfixed set to number of fixed atoms 
- *               *freeind may be set to heap-allocated space
- *               *reverse set to one if reverse-endian, zero if not.
- *               *charmm set to internal code for handling charmm data.
- */
-static int read_dcdheader(fio_fd fd, int *N, int *NSET, int *ISTART, 
-                   int *NSAVC, double *DELTA, int *NAMNF, 
-                   int **FREEINDEXES, float **fixedcoords, int *reverseEndian, 
-                   int *charmm)
-{
-  unsigned int input_integer[2];  /* buffer space */
-  int i, ret_val, rec_scale;
-  char hdrbuf[84];    /* char buffer used to store header */
-  int NTITLE;
-  int dcdcordmagic;
-  char *corp = (char *) &dcdcordmagic;
-
-  /* coordinate dcd file magic string 'CORD' */
-  corp[0] = 'C';
-  corp[1] = 'O';
-  corp[2] = 'R';
-  corp[3] = 'D';
-
-  /* First thing in the file should be an 84.
-   * some 64-bit compiles have a 64-bit record length indicator,
-   * so we have to read two ints and check in a more complicated 
-   * way. :-( */
-  ret_val = READ(fd, input_integer, 2*sizeof(unsigned int));
-  CHECK_FREAD(ret_val, "reading first int from dcd file");
-  CHECK_FEOF(ret_val, "reading first int from dcd file");
-
-  /* Check magic number in file header and determine byte order*/
-  if ((input_integer[0]+input_integer[1]) == 84) {
-    *reverseEndian=0;
-    rec_scale=RECSCALE64BIT;
-    printf("dcdplugin) detected CHARMM -i8 64-bit DCD file of native endianness\n");
-  } else if (input_integer[0] == 84 && input_integer[1] == dcdcordmagic) {
-    *reverseEndian=0;
-    rec_scale=RECSCALE32BIT;
-    printf("dcdplugin) detected standard 32-bit DCD file of native endianness\n");
-  } else {
-    /* now try reverse endian */
-    swap4_aligned(input_integer, 2); /* will have to unswap magic if 32-bit */
-    if ((input_integer[0]+input_integer[1]) == 84) {
-      *reverseEndian=1;
-      rec_scale=RECSCALE64BIT;
-      printf("dcdplugin) detected CHARMM -i8 64-bit DCD file of opposite endianness\n");
-    } else {
-      swap4_aligned(&input_integer[1], 1); /* unswap magic (see above) */
-      if (input_integer[0] == 84 && input_integer[1] == dcdcordmagic) {
-        *reverseEndian=1;
-        rec_scale=RECSCALE32BIT;
-        printf("dcdplugin) detected standard 32-bit DCD file of opposite endianness\n");
-      } else {
-        /* not simply reversed endianism or -i8, something rather more evil */
-        printf("dcdplugin) unrecognized DCD header:\n");
-        printf("dcdplugin)   [0]: %10d  [1]: %10d\n", input_integer[0], input_integer[1]);
-        printf("dcdplugin)   [0]: 0x%08x  [1]: 0x%08x\n", input_integer[0], input_integer[1]);
-        return DCD_BADFORMAT;
-
-      }
-    }
-  }
-
-  /* check for magic string, in case of long record markers */
-  if (rec_scale == RECSCALE64BIT) { 
-    ret_val = READ(fd, input_integer, sizeof(unsigned int));
-    if (input_integer[0] != dcdcordmagic) {
-      printf("dcdplugin) failed to find CORD magic in CHARMM -i8 64-bit DCD file\n");
-      return DCD_BADFORMAT;
-    }
-  }
-
-  /* Buffer the entire header for random access */
-  ret_val = READ(fd, hdrbuf, 80);
-  CHECK_FREAD(ret_val, "buffering header");
-  CHECK_FEOF(ret_val, "buffering header");
-
-  /* CHARMm-genereate DCD files set the last integer in the     */
-  /* header, which is unused by X-PLOR, to its version number.  */
-  /* Checking if this is nonzero tells us this is a CHARMm file */
-  /* and to look for other CHARMm flags.                        */
-  if (*((int *) (hdrbuf + 76)) != 0) {
-    (*charmm) = DCD_IS_CHARMM;
-    if (*((int *) (hdrbuf + 40)) != 0)
-      (*charmm) |= DCD_HAS_EXTRA_BLOCK;
-
-    if (*((int *) (hdrbuf + 44)) == 1)
-      (*charmm) |= DCD_HAS_4DIMS;
-
-    if (rec_scale == RECSCALE64BIT)
-      (*charmm) |= DCD_HAS_64BIT_REC;
-  
-  } else {
-    (*charmm) = DCD_IS_XPLOR; /* must be an X-PLOR format DCD file */
-  }
-
-  if (*charmm & DCD_IS_CHARMM) {
-    /* CHARMM and NAMD versions 2.1b1 and later */
-    printf("dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)\n");
-  } else {
-    /* CHARMM and NAMD versions prior to 2.1b1  */
-    printf("dcdplugin) X-PLOR format DCD file (also NAMD 2.0 and earlier)\n");
-  }
-
-  /* Store the number of sets of coordinates (NSET) */
-  (*NSET) = *((int *) (hdrbuf));
-  if (*reverseEndian) swap4_unaligned(NSET, 1);
-
-  /* Store ISTART, the starting timestep */
-  (*ISTART) = *((int *) (hdrbuf + 4));
-  if (*reverseEndian) swap4_unaligned(ISTART, 1);
-
-  /* Store NSAVC, the number of timesteps between dcd saves */
-  (*NSAVC) = *((int *) (hdrbuf + 8));
-  if (*reverseEndian) swap4_unaligned(NSAVC, 1);
-
-  /* Store NAMNF, the number of fixed atoms */
-  (*NAMNF) = *((int *) (hdrbuf + 32));
-  if (*reverseEndian) swap4_unaligned(NAMNF, 1);
-
-  /* Read in the timestep, DELTA */
-  /* Note: DELTA is stored as a double with X-PLOR but as a float with CHARMm */
-  if ((*charmm) & DCD_IS_CHARMM) {
-    float ftmp;
-    ftmp = *((float *)(hdrbuf+36)); /* is this safe on Alpha? */
-    if (*reverseEndian)
-      swap4_aligned(&ftmp, 1);
-
-    *DELTA = (double)ftmp;
-  } else {
-    (*DELTA) = *((double *)(hdrbuf + 36));
-    if (*reverseEndian) swap8_unaligned(DELTA, 1);
-  }
-
-  /* Get the end size of the first block */
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  CHECK_FREAD(ret_val, "reading second 84 from dcd file");
-  CHECK_FEOF(ret_val, "reading second 84 from dcd file");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if (rec_scale == RECSCALE64BIT) {
-    if ((input_integer[0]+input_integer[1]) != 84) {
-      return DCD_BADFORMAT;
-    }
-  } else {
-    if (input_integer[0] != 84) {
-      return DCD_BADFORMAT;
-    }
-  }
-  
-  /* Read in the size of the next block */
-  input_integer[1] = 0;
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  CHECK_FREAD(ret_val, "reading size of title block");
-  CHECK_FEOF(ret_val, "reading size of title block");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if ((((input_integer[0]+input_integer[1])-4) % 80) == 0) {
-    /* Read NTITLE, the number of 80 character title strings there are */
-    ret_val = READ(fd, &NTITLE, sizeof(int));
-    CHECK_FREAD(ret_val, "reading NTITLE");
-    CHECK_FEOF(ret_val, "reading NTITLE");
-    if (*reverseEndian) swap4_aligned(&NTITLE, 1);
-
-    if (NTITLE < 0) {
-      printf("dcdplugin) WARNING: Bogus NTITLE value: %d (hex: %08x)\n", 
-             NTITLE, NTITLE);
-      return DCD_BADFORMAT;
-    }
-
-    if (NTITLE > 1000) {
-      printf("dcdplugin) WARNING: Bogus NTITLE value: %d (hex: %08x)\n", 
-             NTITLE, NTITLE);
-      if (NTITLE == 1095062083) {
-        printf("dcdplugin) WARNING: Broken Vega ZZ 2.4.0 DCD file detected\n");
-        printf("dcdplugin) Assuming 2 title lines, good luck...\n");
-        NTITLE = 2;
-      } else {
-        printf("dcdplugin) Assuming zero title lines, good luck...\n");
-        NTITLE = 0;
-      }
-    }
-
-    for (i=0; i<NTITLE; i++) {
-      fio_fseek(fd, 80, FIO_SEEK_CUR);
-      CHECK_FEOF(ret_val, "reading TITLE");
-    }
-
-    /* Get the ending size for this block */
-    ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of title block");
-    CHECK_FEOF(ret_val, "reading size of title block");
-  } else {
-    return DCD_BADFORMAT;
-  }
-
-  /* Read in an integer '4' */
-  input_integer[1] = 0;
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  
-  CHECK_FREAD(ret_val, "reading a '4'");
-  CHECK_FEOF(ret_val, "reading a '4'");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if ((input_integer[0]+input_integer[1]) != 4) {
-    return DCD_BADFORMAT;
-  }
-
-  /* Read in the number of atoms */
-  ret_val = READ(fd, N, sizeof(int));
-  CHECK_FREAD(ret_val, "reading number of atoms");
-  CHECK_FEOF(ret_val, "reading number of atoms");
-  if (*reverseEndian) swap4_aligned(N, 1);
-
-  /* Read in an integer '4' */
-  input_integer[1] = 0;
-  ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-  CHECK_FREAD(ret_val, "reading a '4'");
-  CHECK_FEOF(ret_val, "reading a '4'");
-  if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-  if ((input_integer[0]+input_integer[1]) != 4) {
-    return DCD_BADFORMAT;
-  }
-
-  *FREEINDEXES = NULL;
-  *fixedcoords = NULL;
-  if (*NAMNF != 0) {
-    (*FREEINDEXES) = (int *) calloc(((*N)-(*NAMNF)), sizeof(int));
-    if (*FREEINDEXES == NULL)
-      return DCD_BADMALLOC;
-
-    *fixedcoords = (float *) calloc((*N)*4 - (*NAMNF), sizeof(float));
-    if (*fixedcoords == NULL)
-      return DCD_BADMALLOC;
-
-    /* Read in index array size */
-    input_integer[1]=0;
-    ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of index array");
-    CHECK_FEOF(ret_val, "reading size of index array");
-    if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-    if ((input_integer[0]+input_integer[1]) != ((*N)-(*NAMNF))*4) {
-      return DCD_BADFORMAT;
-    }
-
-    ret_val = READ(fd, (*FREEINDEXES), ((*N)-(*NAMNF))*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of index array");
-    CHECK_FEOF(ret_val, "reading size of index array");
-
-    if (*reverseEndian)
-      swap4_aligned((*FREEINDEXES), ((*N)-(*NAMNF)));
-
-    input_integer[1]=0;
-    ret_val = READ(fd, input_integer, rec_scale*sizeof(int));
-    CHECK_FREAD(ret_val, "reading size of index array");
-    CHECK_FEOF(ret_val, "reading size of index array");
-    if (*reverseEndian) swap4_aligned(input_integer, rec_scale);
-
-    if ((input_integer[0]+input_integer[1]) != ((*N)-(*NAMNF))*4) {
-      return DCD_BADFORMAT;
-    }
-  }
-
-  return DCD_SUCCESS;
-}
-
-static int read_charmm_extrablock(fio_fd fd, int charmm, int reverseEndian,
-                                  float *unitcell) {
-  int i, input_integer[2], rec_scale;
-
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale = RECSCALE64BIT;
-  } else {
-    rec_scale = RECSCALE32BIT;
-  }
-
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_EXTRA_BLOCK)) {
-    /* Leading integer must be 48 */
-    input_integer[1] = 0;
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale)
-      return DCD_BADREAD; 
-    if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-    if ((input_integer[0]+input_integer[1]) == 48) {
-      double tmp[6];
-      if (fio_fread(tmp, 48, 1, fd) != 1) return DCD_BADREAD;
-      if (reverseEndian) 
-        swap8_aligned(tmp, 6);
-      for (i=0; i<6; i++) unitcell[i] = (float)tmp[i];
-    } else {
-      /* unrecognized block, just skip it */
-      if (fio_fseek(fd, (input_integer[0]+input_integer[1]), FIO_SEEK_CUR)) return DCD_BADREAD;
-    }
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD; 
-  } 
-
-  return DCD_SUCCESS;
-}
-
-static int read_fixed_atoms(fio_fd fd, int N, int num_free, const int *indexes,
-                            int reverseEndian, const float *fixedcoords, 
-                            float *freeatoms, float *pos, int charmm) {
-  int i, input_integer[2], rec_scale;
-  
-  if(charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-  
-  /* Read leading integer */
-  input_integer[1]=0;
-  if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;
-  if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-  if ((input_integer[0]+input_integer[1]) != 4*num_free) return DCD_BADFORMAT;
-  
-  /* Read free atom coordinates */
-  if (fio_fread(freeatoms, 4*num_free, 1, fd) != 1) return DCD_BADREAD;
-  if (reverseEndian)
-    swap4_aligned(freeatoms, num_free);
-
-  /* Copy fixed and free atom coordinates into position buffer */
-  memcpy(pos, fixedcoords, 4*N);
-  for (i=0; i<num_free; i++)
-    pos[indexes[i]-1] = freeatoms[i];
-
-  /* Read trailing integer */ 
-  input_integer[1]=0;
-  if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;
-  if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-  if ((input_integer[0]+input_integer[1]) != 4*num_free) return DCD_BADFORMAT;
-
-  return DCD_SUCCESS;
-}
-  
-static int read_charmm_4dim(fio_fd fd, int charmm, int reverseEndian) {
-  int input_integer[2],rec_scale;
-
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-    
-  /* If this is a CHARMm file and contains a 4th dimension block, */
-  /* we must skip past it to avoid problems                       */
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_4DIMS)) {
-    input_integer[1]=0;
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;  
-    if (reverseEndian) swap4_aligned(input_integer, rec_scale);
-    if (fio_fseek(fd, (input_integer[0]+input_integer[1]), FIO_SEEK_CUR)) return DCD_BADREAD;
-    if (fio_fread(input_integer, sizeof(int), rec_scale, fd) != rec_scale) return DCD_BADREAD;  
-  }
-
-  return DCD_SUCCESS;
-}
-
-/* 
- * Read a dcd timestep from a dcd file
- * Input: fd - a file struct opened for binary reading, from which the 
- *             header information has already been read.
- *        natoms, nfixed, first, *freeind, reverse, charmm - the corresponding 
- *             items as set by read_dcdheader
- *        first - true if this is the first frame we are reading.
- *        x, y, z: space for natoms each of floats.
- *        unitcell - space for six floats to hold the unit cell data.  
- *                   Not set if no unit cell data is present.
- * Output: 0 on success, negative error code on failure.
- * Side effects: x, y, z contain the coordinates for the timestep read.
- *               unitcell holds unit cell data if present.
- */
-static int read_dcdstep(fio_fd fd, int N, float *X, float *Y, float *Z, 
-                        float *unitcell, int num_fixed,
-                        int first, int *indexes, float *fixedcoords, 
-                        int reverseEndian, int charmm) {
-  int ret_val, rec_scale;   /* Return value from read */
-  
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-  
-  if ((num_fixed==0) || first) {
-    /* temp storage for reading formatting info */
-    /* note: has to be max size we'll ever use  */
-    int tmpbuf[6*RECSCALEMAX]; 
-
-    fio_iovec iov[7];   /* I/O vector for fio_readv() call          */
-    fio_size_t readlen; /* number of bytes actually read            */
-    int i;
-
-    /* if there are no fixed atoms or this is the first timestep read */
-    /* then we read all coordinates normally.                         */
-
-    /* read the charmm periodic cell information */
-    /* XXX this too should be read together with the other items in a */
-    /*     single fio_readv() call in order to prevent lots of extra  */
-    /*     kernel/user context switches.                              */
-    ret_val = read_charmm_extrablock(fd, charmm, reverseEndian, unitcell);
-    if (ret_val) return ret_val;
-
-    /* setup the I/O vector for the call to fio_readv() */
-    iov[0].iov_base = (fio_caddr_t) &tmpbuf[0]; /* read format integer    */
-    iov[0].iov_len  = rec_scale*sizeof(int);
-
-    iov[1].iov_base = (fio_caddr_t) X;          /* read X coordinates     */
-    iov[1].iov_len  = sizeof(float)*N;
-
-    iov[2].iov_base = (fio_caddr_t) &tmpbuf[1*rec_scale]; /* read 2 format integers */
-    iov[2].iov_len  = rec_scale*sizeof(int) * 2;
-
-    iov[3].iov_base = (fio_caddr_t) Y;          /* read Y coordinates     */
-    iov[3].iov_len  = sizeof(float)*N;
-
-    iov[4].iov_base = (fio_caddr_t) &tmpbuf[3*rec_scale]; /* read 2 format integers */
-    iov[4].iov_len  = rec_scale*sizeof(int) * 2;
-
-    iov[5].iov_base = (fio_caddr_t) Z;          /* read Y coordinates     */
-    iov[5].iov_len  = sizeof(float)*N;
-
-    iov[6].iov_base = (fio_caddr_t) &tmpbuf[5*rec_scale]; /* read format integer    */
-    iov[6].iov_len  = rec_scale*sizeof(int);
-
-#if 1
-    /* Use fall-back code instead of readv():                            */
-    /*  Some platforms implement readv() as user level code in libc,     */
-    /*  and due to POSIX atomicity requirements for readv()/writev(),    */
-    /*  they may copy data to internal temp buffers, which can kill      */
-    /*  performance, and in cases when doing single I/O ops on large,    */
-    /*  buffers, e.g. > 2GB, can fail with shorts reads or writes...     */
-    /*  On such platforms it is best to avoid using readv()/writev()...  */
-    {
-      int readcnt = 0;
-      readlen = 0;
-      readcnt =  fio_fread(iov[0].iov_base, iov[0].iov_len, 1, fd);
-      readcnt += fio_fread(iov[1].iov_base, iov[1].iov_len, 1, fd);
-      readcnt += fio_fread(iov[2].iov_base, iov[2].iov_len, 1, fd);
-      readcnt += fio_fread(iov[3].iov_base, iov[3].iov_len, 1, fd);
-      readcnt += fio_fread(iov[4].iov_base, iov[4].iov_len, 1, fd);
-      readcnt += fio_fread(iov[5].iov_base, iov[5].iov_len, 1, fd);
-      readcnt += fio_fread(iov[6].iov_base, iov[6].iov_len, 1, fd);
-
-      /* if both records read correctly, then the reads are okay */
-      if (readcnt != 7)
-        return DCD_BADREAD;
-    }
-#else
-    readlen = fio_readv(fd, &iov[0], 7);
-    if (readlen != (rec_scale*6*sizeof(int) + 3*N*sizeof(float)))
-      return DCD_BADREAD;
-#endif
-
-    /* convert endianism if necessary */
-    if (reverseEndian) {
-      swap4_aligned(&tmpbuf[0], rec_scale*6);
-      swap4_aligned(X, N);
-      swap4_aligned(Y, N);
-      swap4_aligned(Z, N);
-    }
-
-    /* double-check the fortran format size values for safety */
-    if(rec_scale == 1) {
-      for (i=0; i<6; i++) {
-        if (tmpbuf[i] != sizeof(float)*N) return DCD_BADFORMAT;
-      }
-    } else {
-      for (i=0; i<6; i++) {
-          if ((tmpbuf[2*i]+tmpbuf[2*i+1]) != sizeof(float)*N) return DCD_BADFORMAT;
-      }
-    }
-
-    /* copy fixed atom coordinates into fixedcoords array if this was the */
-    /* first timestep, to be used from now on.  We just copy all atoms.   */
-    if (num_fixed && first) {
-      memcpy(fixedcoords, X, N*sizeof(float));
-      memcpy(fixedcoords+N, Y, N*sizeof(float));
-      memcpy(fixedcoords+2*N, Z, N*sizeof(float));
-    }
-
-    /* read in the optional charmm 4th array */
-    /* XXX this too should be read together with the other items in a */
-    /*     single fio_readv() call in order to prevent lots of extra  */
-    /*     kernel/user context switches.                              */
-    ret_val = read_charmm_4dim(fd, charmm, reverseEndian);
-    if (ret_val) return ret_val;
-  } else {
-    /* if there are fixed atoms, and this isn't the first frame, then we */
-    /* only read in the non-fixed atoms for all subsequent timesteps.    */
-    ret_val = read_charmm_extrablock(fd, charmm, reverseEndian, unitcell);
-    if (ret_val) return ret_val;
-    ret_val = read_fixed_atoms(fd, N, N-num_fixed, indexes, reverseEndian,
-                               fixedcoords, fixedcoords+3*N, X, charmm);
-    if (ret_val) return ret_val;
-    ret_val = read_fixed_atoms(fd, N, N-num_fixed, indexes, reverseEndian,
-                               fixedcoords+N, fixedcoords+3*N, Y, charmm);
-    if (ret_val) return ret_val;
-    ret_val = read_fixed_atoms(fd, N, N-num_fixed, indexes, reverseEndian,
-                               fixedcoords+2*N, fixedcoords+3*N, Z, charmm);
-    if (ret_val) return ret_val;
-    ret_val = read_charmm_4dim(fd, charmm, reverseEndian);
-    if (ret_val) return ret_val;
-  }
-
-  return DCD_SUCCESS;
-}
-
-
-/* 
- * Skip past a timestep.  If there are fixed atoms, this cannot be used with
- * the first timestep.  
- * Input: fd - a file struct from which the header has already been read
- *        natoms - number of atoms per timestep
- *        nfixed - number of fixed atoms
- *        charmm - charmm flags as returned by read_dcdheader
- * Output: 0 on success, negative error code on failure.
- * Side effects: One timestep will be skipped; fd will be positioned at the
- *               next timestep.
- */
-static int skip_dcdstep(fio_fd fd, int natoms, int nfixed, int charmm) {
-  
-  int seekoffset = 0;
-  int rec_scale;
-
-  if (charmm & DCD_HAS_64BIT_REC) {
-    rec_scale=RECSCALE64BIT;
-  } else {
-    rec_scale=RECSCALE32BIT;
-  }
-
-  /* Skip charmm extra block */
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_EXTRA_BLOCK)) {
-    seekoffset += 4*rec_scale + 48 + 4*rec_scale;
-  }
-
-  /* For each atom set, seek past an int, the free atoms, and another int. */
-  seekoffset += 3 * (2*rec_scale + natoms - nfixed) * 4;
-
-  /* Assume that charmm 4th dim is the same size as the other three. */
-  if ((charmm & DCD_IS_CHARMM) && (charmm & DCD_HAS_4DIMS)) {
-    seekoffset += (2*rec_scale + natoms - nfixed) * 4;
-  }
- 
-  if (fio_fseek(fd, seekoffset, FIO_SEEK_CUR)) return DCD_BADEOF;
-
-  return DCD_SUCCESS;
-}
-
-
-/* 
- * Write a timestep to a dcd file
- * Input: fd - a file struct for which a dcd header has already been written
- *       curframe: Count of frames written to this file, starting with 1.
- *       curstep: Count of timesteps elapsed = istart + curframe * nsavc.
- *        natoms - number of elements in x, y, z arrays
- *        x, y, z: pointers to atom coordinates
- * Output: 0 on success, negative error code on failure.
- * Side effects: coordinates are written to the dcd file.
- */
-static int write_dcdstep(fio_fd fd, int curframe, int curstep, int N, 
-                  const float *X, const float *Y, const float *Z, 
-                  const double *unitcell, int charmm) {
-  int out_integer;
-
-  if (charmm) {
-    /* write out optional unit cell */
-    if (unitcell != NULL) {
-      out_integer = 48; /* 48 bytes (6 floats) */
-      fio_write_int32(fd, out_integer);
-      WRITE(fd, unitcell, out_integer);
-      fio_write_int32(fd, out_integer);
-    }
-  }
-
-  /* write out coordinates */
-  out_integer = N*4; /* N*4 bytes per X/Y/Z array (N floats per array) */
-  fio_write_int32(fd, out_integer);
-  if (fio_fwrite((void *) X, out_integer, 1, fd) != 1) return DCD_BADWRITE;
-  fio_write_int32(fd, out_integer);
-  fio_write_int32(fd, out_integer);
-  if (fio_fwrite((void *) Y, out_integer, 1, fd) != 1) return DCD_BADWRITE;
-  fio_write_int32(fd, out_integer);
-  fio_write_int32(fd, out_integer);
-  if (fio_fwrite((void *) Z, out_integer, 1, fd) != 1) return DCD_BADWRITE;
-  fio_write_int32(fd, out_integer);
-
-  /* update the DCD header information */
-  fio_fseek(fd, NFILE_POS, FIO_SEEK_SET);
-  fio_write_int32(fd, curframe);
-  fio_fseek(fd, NSTEP_POS, FIO_SEEK_SET);
-  fio_write_int32(fd, curstep);
-  fio_fseek(fd, 0, FIO_SEEK_END);
-
-  return DCD_SUCCESS;
-}
-
-/*
- * Write a header for a new dcd file
- * Input: fd - file struct opened for binary writing
- *        remarks - string to be put in the remarks section of the header.  
- *                  The string will be truncated to 70 characters.
- *        natoms, istart, nsavc, delta - see comments in read_dcdheader
- * Output: 0 on success, negative error code on failure.
- * Side effects: Header information is written to the dcd file.
- */
-static int write_dcdheader(fio_fd fd, const char *remarks, int N, 
-                    int ISTART, int NSAVC, double DELTA, int with_unitcell,
-                    int charmm) {
-  int out_integer;
-  float out_float;
-  char title_string[200];
-  time_t cur_time;
-  struct tm *tmbuf;
-  char time_str[81];
-
-  out_integer = 84;
-  WRITE(fd, (char *) & out_integer, sizeof(int));
-  strcpy(title_string, "CORD");
-  WRITE(fd, title_string, 4);
-  fio_write_int32(fd, 0);      /* Number of frames in file, none written yet   */
-  fio_write_int32(fd, ISTART); /* Starting timestep                            */
-  fio_write_int32(fd, NSAVC);  /* Timesteps between frames written to the file */
-  fio_write_int32(fd, 0);      /* Number of timesteps in simulation            */
-  fio_write_int32(fd, 0);      /* NAMD writes NSTEP or ISTART - NSAVC here?    */
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  if (charmm) {
-    out_float = DELTA;
-    WRITE(fd, (char *) &out_float, sizeof(float));
-    if (with_unitcell) {
-      fio_write_int32(fd, 1);
-    } else {
-      fio_write_int32(fd, 0);
-    }
-  } else {
-    WRITE(fd, (char *) &DELTA, sizeof(double));
-  }
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  fio_write_int32(fd, 0);
-  if (charmm) {
-    fio_write_int32(fd, 24); /* Pretend to be CHARMM version 24 */
-  } else {
-    fio_write_int32(fd, 0);
-  }
-  fio_write_int32(fd, 84);
-  fio_write_int32(fd, 164);
-  fio_write_int32(fd, 2);
-
-  strncpy(title_string, remarks, 80);
-  title_string[79] = '\0';
-  WRITE(fd, title_string, 80);
-
-  cur_time=time(NULL);
-  tmbuf=localtime(&cur_time);
-  strftime(time_str, 80, "REMARKS Created %d %B, %Y at %R", tmbuf);
-  WRITE(fd, time_str, 80);
-
-  fio_write_int32(fd, 164);
-  fio_write_int32(fd, 4);
-  fio_write_int32(fd, N);
-  fio_write_int32(fd, 4);
-
-  return DCD_SUCCESS;
-}
-
-
-/*
- * clean up dcd data
- * Input: nfixed, freeind - elements as returned by read_dcdheader
- * Output: None
- * Side effects: Space pointed to by freeind is freed if necessary.
- */
-static void close_dcd_read(int *indexes, float *fixedcoords) {
-  free(indexes);
-  free(fixedcoords);
-}
-
-
-
-
-
-static void *open_dcd_read(const char *path, const char *filetype, 
-    int *natoms) {
-  dcdhandle *dcd;
-  fio_fd fd;
-  int rc;
-  struct stat stbuf;
-
-  if (!path) return NULL;
-
-  /* See if the file exists, and get its size */
-  memset(&stbuf, 0, sizeof(struct stat));
-  if (stat(path, &stbuf)) {
-    printf("dcdplugin) Could not access file '%s'.\n", path);
-    return NULL;
-  }
-
-  if (fio_open(path, FIO_READ, &fd) < 0) {
-    printf("dcdplugin) Could not open file '%s' for reading.\n", path);
-    return NULL;
-  }
-
-  dcd = (dcdhandle *)malloc(sizeof(dcdhandle));
-  memset(dcd, 0, sizeof(dcdhandle));
-  dcd->fd = fd;
-
-  if ((rc = read_dcdheader(dcd->fd, &dcd->natoms, &dcd->nsets, &dcd->istart, 
-         &dcd->nsavc, &dcd->delta, &dcd->nfixed, &dcd->freeind, 
-         &dcd->fixedcoords, &dcd->reverse, &dcd->charmm))) {
-    print_dcderror("read_dcdheader", rc);
-    fio_fclose(dcd->fd);
-    free(dcd);
-    return NULL;
-  }
-
-  /*
-   * Check that the file is big enough to really hold the number of sets
-   * it claims to have.  Then we'll use nsets to keep track of where EOF
-   * should be.
-   */
-  {
-    fio_size_t ndims, firstframesize, framesize, extrablocksize;
-    fio_size_t trjsize, filesize, curpos;
-    int newnsets;
-
-    extrablocksize = dcd->charmm & DCD_HAS_EXTRA_BLOCK ? 48 + 8 : 0;
-    ndims = dcd->charmm & DCD_HAS_4DIMS ? 4 : 3;
-    firstframesize = (dcd->natoms+2) * ndims * sizeof(float) + extrablocksize;
-    framesize = (dcd->natoms-dcd->nfixed+2) * ndims * sizeof(float) 
-      + extrablocksize;
-
-    /* 
-     * It's safe to use ftell, even though ftell returns a long, because the 
-     * header size is < 4GB.
-     */
-
-    curpos = fio_ftell(dcd->fd); /* save current offset (end of header) */
-
-#if defined(_MSC_VER) && defined(FASTIO_NATIVEWIN32)
-    /* the stat() call is not 64-bit savvy on Windows             */
-    /* so we have to use the fastio fseek/ftell routines for this */
-    /* until we add a portable filesize routine for this purpose  */
-    fio_fseek(dcd->fd, 0, FIO_SEEK_END);       /* seek to end of file */
-    filesize = fio_ftell(dcd->fd);
-    fio_fseek(dcd->fd, curpos, FIO_SEEK_SET);  /* return to end of header */
-#else
-    filesize = stbuf.st_size; /* this works ok on Unix machines */
-#endif
-    trjsize = filesize - curpos - firstframesize;
-    if (trjsize < 0) {
-      printf("dcdplugin) file '%s' appears to contain no timesteps.\n", path);
-      fio_fclose(dcd->fd);
-      free(dcd);
-      return NULL;
-    }
-
-    newnsets = trjsize / framesize + 1;
-
-    if (dcd->nsets > 0 && newnsets != dcd->nsets) {
-      printf("dcdplugin) Warning: DCD header claims %d frames, file size indicates there are actually %d frames\n", dcd->nsets, newnsets);
-    }
-
-    dcd->nsets = newnsets; 
-    dcd->setsread = 0;
-  }
-
-  dcd->first = 1;
-  dcd->x = (float *)malloc(dcd->natoms * sizeof(float));
-  dcd->y = (float *)malloc(dcd->natoms * sizeof(float));
-  dcd->z = (float *)malloc(dcd->natoms * sizeof(float));
-  if (!dcd->x || !dcd->y || !dcd->z) {
-    printf("dcdplugin) Unable to allocate space for %d atoms.\n", dcd->natoms);
-    if (dcd->x)
-      free(dcd->x);
-    if (dcd->y)
-      free(dcd->y);
-    if (dcd->z)
-      free(dcd->z);
-    fio_fclose(dcd->fd);
-    free(dcd);
-    return NULL;
-  }
-  *natoms = dcd->natoms;
-  return dcd;
-}
-
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  dcdhandle *dcd;
-  int i, j, rc;
-  float unitcell[6];
-  unitcell[0] = unitcell[2] = unitcell[5] = 1.0f;
-  unitcell[1] = unitcell[3] = unitcell[4] = 90.0f;
-  dcd = (dcdhandle *)v;
-
-  /* Check for EOF here; that way all EOF's encountered later must be errors */
-  if (dcd->setsread == dcd->nsets) return MOLFILE_EOF;
-  dcd->setsread++;
-  if (!ts) {
-    if (dcd->first && dcd->nfixed) {
-      /* We can't just skip it because we need the fixed atom coordinates */
-      rc = read_dcdstep(dcd->fd, dcd->natoms, dcd->x, dcd->y, dcd->z, 
-          unitcell, dcd->nfixed, dcd->first, dcd->freeind, dcd->fixedcoords, 
-             dcd->reverse, dcd->charmm);
-      dcd->first = 0;
-      return rc; /* XXX this needs to be updated */
-    }
-    dcd->first = 0;
-    /* XXX this needs to be changed */
-    return skip_dcdstep(dcd->fd, dcd->natoms, dcd->nfixed, dcd->charmm);
-  }
-  rc = read_dcdstep(dcd->fd, dcd->natoms, dcd->x, dcd->y, dcd->z, unitcell,
-             dcd->nfixed, dcd->first, dcd->freeind, dcd->fixedcoords, 
-             dcd->reverse, dcd->charmm);
-  dcd->first = 0;
-  if (rc < 0) {  
-    print_dcderror("read_dcdstep", rc);
-    return MOLFILE_ERROR;
-  }
-
-  /* copy timestep data from plugin-local buffers to VMD's buffer */
-  /* XXX 
-   *   This code is still the root of all evil.  Just doing this extra copy
-   *   cuts the I/O rate of the DCD reader from 728 MB/sec down to
-   *   394 MB/sec when reading from a ram filesystem.  
-   *   For a physical disk filesystem, the I/O rate goes from 
-   *   187 MB/sec down to 122 MB/sec.  Clearly this extra copy has to go.
-   */
-  {
-    int natoms = dcd->natoms;
-    float *nts = ts->coords;
-    const float *bufx = dcd->x;
-    const float *bufy = dcd->y;
-    const float *bufz = dcd->z;
-
-    for (i=0, j=0; i<natoms; i++, j+=3) {
-      nts[j    ] = bufx[i];
-      nts[j + 1] = bufy[i];
-      nts[j + 2] = bufz[i];
-    }
-  }
-
-  ts->A = unitcell[0];
-  ts->B = unitcell[2];
-  ts->C = unitcell[5];
-
-  if (unitcell[1] >= -1.0 && unitcell[1] <= 1.0 &&
-      unitcell[3] >= -1.0 && unitcell[3] <= 1.0 &&
-      unitcell[4] >= -1.0 && unitcell[4] <= 1.0) {
-    /* This file was generated by CHARMM, or by NAMD > 2.5, with the angle */
-    /* cosines of the periodic cell angles written to the DCD file.        */ 
-    /* This formulation improves rounding behavior for orthogonal cells    */
-    /* so that the angles end up at precisely 90 degrees, unlike acos().   */
-    ts->alpha = 90.0 - asin(unitcell[4]) * 90.0 / M_PI_2; /* cosBC */
-    ts->beta  = 90.0 - asin(unitcell[3]) * 90.0 / M_PI_2; /* cosAC */
-    ts->gamma = 90.0 - asin(unitcell[1]) * 90.0 / M_PI_2; /* cosAB */
-  } else {
-    /* This file was likely generated by NAMD 2.5 and the periodic cell    */
-    /* angles are specified in degrees rather than angle cosines.          */
-    ts->alpha = unitcell[4]; /* angle between B and C */
-    ts->beta  = unitcell[3]; /* angle between A and C */
-    ts->gamma = unitcell[1]; /* angle between A and B */
-  }
- 
-  return MOLFILE_SUCCESS;
-}
- 
-
-static void close_file_read(void *v) {
-  dcdhandle *dcd = (dcdhandle *)v;
-  close_dcd_read(dcd->freeind, dcd->fixedcoords);
-  fio_fclose(dcd->fd);
-  free(dcd->x);
-  free(dcd->y);
-  free(dcd->z);
-  free(dcd); 
-}
-
-
-static void *open_dcd_write(const char *path, const char *filetype, 
-    int natoms) {
-  dcdhandle *dcd;
-  fio_fd fd;
-  int rc;
-  int istart, nsavc;
-  double delta;
-  int with_unitcell;
-  int charmm;
-
-  if (fio_open(path, FIO_WRITE, &fd) < 0) {
-    printf("dcdplugin) Could not open file '%s' for writing\n", path);
-    return NULL;
-  }
-
-  dcd = (dcdhandle *)malloc(sizeof(dcdhandle));
-  memset(dcd, 0, sizeof(dcdhandle));
-  dcd->fd = fd;
-
-  istart = 0;             /* starting timestep of DCD file                  */
-  nsavc = 1;              /* number of timesteps between written DCD frames */
-  delta = 1.0;            /* length of a timestep                           */
-
-  if (getenv("VMDDCDWRITEXPLORFORMAT") != NULL) {
-    with_unitcell = 0;      /* no unit cell info */
-    charmm = DCD_IS_XPLOR;  /* X-PLOR format */
-    printf("dcdplugin) WARNING: Writing DCD file in X-PLOR format, \n");
-    printf("dcdplugin) WARNING: unit cell information will be lost!\n");
-  } else {
-    with_unitcell = 1;      /* contains unit cell infor (Charmm format) */
-    charmm = DCD_IS_CHARMM; /* charmm-formatted DCD file                */ 
-    if (with_unitcell) 
-      charmm |= DCD_HAS_EXTRA_BLOCK;
-  }
- 
-  rc = write_dcdheader(dcd->fd, "Created by DCD plugin", natoms, 
-                       istart, nsavc, delta, with_unitcell, charmm);
-
-  if (rc < 0) {
-    print_dcderror("write_dcdheader", rc);
-    fio_fclose(dcd->fd);
-    free(dcd);
-    return NULL;
-  }
-
-  dcd->natoms = natoms;
-  dcd->nsets = 0;
-  dcd->istart = istart;
-  dcd->nsavc = nsavc;
-  dcd->with_unitcell = with_unitcell;
-  dcd->charmm = charmm;
-  dcd->x = (float *)malloc(natoms * sizeof(float));
-  dcd->y = (float *)malloc(natoms * sizeof(float));
-  dcd->z = (float *)malloc(natoms * sizeof(float));
-  return dcd;
-}
-
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) { 
-  dcdhandle *dcd = (dcdhandle *)v;
-  int i, rc, curstep;
-  float *pos = ts->coords;
-  double unitcell[6];
-  unitcell[0] = unitcell[2] = unitcell[5] = 1.0f;
-  unitcell[1] = unitcell[3] = unitcell[4] = 90.0f;
-
-  /* copy atom coords into separate X/Y/Z arrays for writing */
-  for (i=0; i<dcd->natoms; i++) {
-    dcd->x[i] = *(pos++); 
-    dcd->y[i] = *(pos++); 
-    dcd->z[i] = *(pos++); 
-  }
-  dcd->nsets++;
-  curstep = dcd->istart + dcd->nsets * dcd->nsavc;
-
-  unitcell[0] = ts->A;
-  unitcell[2] = ts->B;
-  unitcell[5] = ts->C;
-  unitcell[1] = sin((M_PI_2 / 90.0) * (90.0 - ts->gamma)); /* cosAB */
-  unitcell[3] = sin((M_PI_2 / 90.0) * (90.0 - ts->beta));  /* cosAC */
-  unitcell[4] = sin((M_PI_2 / 90.0) * (90.0 - ts->alpha)); /* cosBC */
-
-  rc = write_dcdstep(dcd->fd, dcd->nsets, curstep, dcd->natoms, 
-                     dcd->x, dcd->y, dcd->z,
-                     dcd->with_unitcell ? unitcell : NULL,
-                     dcd->charmm);
-  if (rc < 0) {
-    print_dcderror("write_dcdstep", rc);
-    return MOLFILE_ERROR;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_file_write(void *v) {
-  dcdhandle *dcd = (dcdhandle *)v;
-  fio_fclose(dcd->fd);
-  free(dcd->x);
-  free(dcd->y);
-  free(dcd->z);
-  free(dcd);
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "dcd";
-  plugin.prettyname = "CHARMM,NAMD,XPLOR DCD Trajectory";
-  plugin.author = "Axel Kohlmeyer, Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 12;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "dcd";
-  plugin.open_file_read = open_dcd_read;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_file_read;
-  plugin.open_file_write = open_dcd_write;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-  
-#ifdef TEST_DCDPLUGIN
-
-#include <sys/time.h>
-
-/* get the time of day from the system clock, and store it (in seconds) */
-double time_of_day(void) {
-#if defined(_MSC_VER)
-  double t;
-
-  t = GetTickCount();
-  t = t / 1000.0;
-
-  return t;
-#else
-  struct timeval tm;
-  struct timezone tz;
-
-  gettimeofday(&tm, &tz);
-  return((double)(tm.tv_sec) + (double)(tm.tv_usec)/1000000.0);
-#endif
-}
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  dcdhandle *dcd;
-  int i, natoms;
-  float sizeMB =0.0, totalMB = 0.0;
-  double starttime, endtime, totaltime = 0.0;
-
-  while (--argc) {
-    ++argv; 
-    natoms = 0;
-    v = open_dcd_read(*argv, "dcd", &natoms);
-    if (!v) {
-      fprintf(stderr, "main) open_dcd_read failed for file %s\n", *argv);
-      return 1;
-    }
-    dcd = (dcdhandle *)v;
-    sizeMB = ((natoms * 3.0) * dcd->nsets * 4.0) / (1024.0 * 1024.0);
-    totalMB += sizeMB; 
-    printf("main) file: %s\n", *argv);
-    printf("  %d atoms, %d frames, size: %6.1fMB\n", natoms, dcd->nsets, sizeMB);
-
-    starttime = time_of_day();
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    for (i=0; i<dcd->nsets; i++) {
-      int rc = read_next_timestep(v, natoms, &timestep);
-      if (rc) {
-        fprintf(stderr, "error in read_next_timestep on frame %d\n", i);
-        return 1;
-      }
-    }
-    endtime = time_of_day();
-    close_file_read(v);
-    totaltime += endtime - starttime;
-    printf("  Time: %5.1f seconds\n", endtime - starttime);
-    printf("  Speed: %5.1f MB/sec, %5.1f timesteps/sec\n", sizeMB / (endtime - starttime), (dcd->nsets / (endtime - starttime)));
-  }
-  printf("Overall Size: %6.1f MB\n", totalMB);
-  printf("Overall Time: %6.1f seconds\n", totaltime);
-  printf("Overall Speed: %5.1f MB/sec\n", totalMB / totaltime);
-  return 0;
-}
-      
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dlpolyplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dlpolyplugin.c
deleted file mode 100644
index 99a2a36c237edc2094815c7b289cec0a0c6b5b2b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dlpolyplugin.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dlpolyplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.24 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/*
- * DLPOLY formatted history file format:
- *   http://www.ccp5.ac.uk/DL_POLY/MANUALS/USRMAN4.pdf
- *   http://www.ccp5.ac.uk/DL_POLY_CLASSIC/MANUALS/USRMAN.pdf
- *
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-typedef struct {
-  FILE *file;
-  int dlpolyversion;
-  int numatoms;
-  int cellwarnflag;
-} dlpolydata;
- 
-
-static void *open_dlpoly_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  dlpolydata *data;
-  char fbuffer[4096], buf[4096];
-  int dlpolyversion, scancount, nstep, keytrj, atomcount;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-
-  if (NULL == fgets(fbuffer, 1024, fd))  
-    return NULL;
-
-  if (!strcmp(filetype, "dlpolyhist")) {
-    dlpolyversion=2;
-  } else if (!strcmp(filetype, "dlpoly3hist")) {
-    dlpolyversion=3;
-  } else {
-    dlpolyversion=2;
-  }
- 
-  /* check to see if the first line is a "timestep" record */ 
-  scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, natoms);
-  if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, natoms);
-    if (scancount != 3) {
-      printf("open_dlpoly_read) unrecognized header record\n");
-      return NULL;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%s %d %d", buf, &nstep, &atomcount);
-    if (scancount != 3 || strcmp(buf, "timestep") != 0) {
-      printf("open_dlpoly_read) unrecognized timestep record\n");
-      return NULL;
-    }
-
-    if (atomcount != *natoms) {
-      printf("open_dlpoly_read) mismatched atom count\n");
-      return NULL;
-    }
-  }
- 
-  data = (dlpolydata *) malloc(sizeof(dlpolydata));
-  memset(data, 0, sizeof(dlpolydata));
-  data->file = fd;
-  data->numatoms= *natoms;
-  data->cellwarnflag = 0;
-  data->dlpolyversion = dlpolyversion;
-
-  rewind(data->file); /* prepare for first read_timestep call */
-  return data;
-}
-
-
-static void *open_dlpoly_config_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  dlpolydata *data;
-  char fbuffer[4096], buf[4096];
-  int dlpolyversion, scancount, keytrj, imcon;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-
-  if (NULL == fgets(fbuffer, 1024, fd))  
-    return NULL;
-
-  if (!strcmp(filetype, "dlpolyconfig")) {
-    dlpolyversion=2;
-  }
- 
-  
-  scancount = sscanf(fbuffer, "%s %d %d", buf, &imcon, natoms);
-  if (scancount != 3 ) {
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, fd))  
-      return NULL;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &imcon, natoms);
-    if (scancount != 3) {
-      printf("open_dlpoly_read) unrecognized header record\n");
-      return NULL;
-    } 
-  }
-    
-  data = (dlpolydata *) malloc(sizeof(dlpolydata));
-  memset(data, 0, sizeof(dlpolydata));
-  data->file = fd;
-  data->numatoms= *natoms;
-  data->cellwarnflag = 0;
-  data->dlpolyversion = dlpolyversion;
-
-  rewind(data->file); /* prepare for first read_timestep call */
-  return data;
-}
-
-static int read_dlpoly_structure(void *mydata, int *optflags,
-                              molfile_atom_t *atoms) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge;
-  dlpolydata *data = (dlpolydata *)mydata;
- 
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  /* check to see if the first line is a "timestep" record */
-  scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                     &nstep, &atomcount, &keytrj, &imcon, &tstep);
-  if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-    /* if not a timestep, it might have the normal header on it      */
-    /* in which case we'll skip the first line, and parse the second */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-    if (scancount != 3) {
-      printf("dlpoly structure) unrecognized header record\n");
-      return MOLFILE_ERROR;
-    } 
-
-    /* now check the first timestep record for safety */
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                       &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-    if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-      printf("dlpoly structure) unrecognized timestep record\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check atom count */
-    if (atomcount != atomcount2) {
-      printf("dlpoly structure) header/timestep mismatched atom count\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* check atom count */
-  if (atomcount != data->numatoms) {
-    printf("dlpoly structure) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon >= 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    /* eat the data but don't use it for anything */
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms + i;
-
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly structure v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly structure v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly structure) failed reading atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly structure) failed reading atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    strncpy(atom->name, buf, sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_dlpoly_config_structure(void *mydata, int *optflags,
-                              molfile_atom_t *atoms) {
-  char fbuffer[4096], buf[4096];
-  float x, y, z;
-  int i, atomcount, keytrj, imcon, scancount, atomid;
-  dlpolydata *data = (dlpolydata *)mydata;
- 
-  /* we don't read any optional data */
-  *optflags = MOLFILE_NOOPTIONS;
-
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-    if (NULL == fgets(fbuffer, 1024, data->file))
-      return MOLFILE_EOF;
-    scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &imcon, &atomcount);
-    if (scancount != 3) {
-      printf("dlpoly structure) unrecognized header record\n");
-      return MOLFILE_ERROR;
-    } 
-
-  /* check atom count */
-  if (atomcount != data->numatoms) {
-    printf("dlpoly structure) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    /* eat the data but don't use it for anything */
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly structure) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-  }
-
-  for (i=0; i<data->numatoms; i++) {
-    molfile_atom_t *atom = atoms + i;
-
-    /* read the coordinates */
-    if (2 != fscanf(data->file, "%s %d", buf, &atomid)) {
-      printf("dlpoly structure v3) failed parsing atom labels\n");
-      return MOLFILE_ERROR;
-    }
-    /* read the coordinates */
-    if (3 != fscanf(data->file, "%f %f %f", &x, &y, &z)) {
-      printf("dlpoly structure) failed reading atom coordinates\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly structure) failed reading atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly structure) failed reading atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    strncpy(atom->name, buf, sizeof(atom->name));
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_dlpoly_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char fbuffer[4096], buf[4096];
-  float rsd, x, y, z;
-  int i, nstep, atomcount, keytrj, imcon, scancount, atomid, atomcount2;
-  float tstep, mass, charge, elapsedps;
-  dlpolydata *data = (dlpolydata *)mydata;
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  switch (data->dlpolyversion) {
-    case 3:
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount, &keytrj, &imcon, &tstep, &elapsedps);
-      if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v3) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f %f", buf, 
-                    &nstep, &atomcount2, &keytrj, &imcon, &tstep, &elapsedps);
-        if (scancount != 7 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v3) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v3) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-
-    case 2:
-    default: 
-      scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                         &nstep, &atomcount, &keytrj, &imcon, &tstep);
-      if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-        /* if not a timestep, it might have the normal header on it      */
-        /* in which case we'll skip the first line, and parse the second */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &nstep, &atomcount);
-        if (scancount != 3) {
-          printf("dlpoly timestep v2) unrecognized header record\n");
-          return MOLFILE_ERROR;
-        } 
-
-        /* now check the first timestep record for safety */
-        if (NULL == fgets(fbuffer, 1024, data->file))
-          return MOLFILE_EOF;
-        scancount = sscanf(fbuffer, "%s %d %d %d %d %f", buf, 
-                           &nstep, &atomcount2, &keytrj, &imcon, &tstep);
-        if (scancount != 6 || strcmp(buf, "timestep") != 0) {
-          printf("dlpoly timestep v2) unrecognized timestep record\n");
-          return MOLFILE_ERROR;
-        }
-
-        /* check atom count */
-        if (atomcount != atomcount2) {
-          printf("dlpoly timestep v2) header/timestep mismatched atom count\n");
-          return MOLFILE_ERROR;
-        }
-      }
-      break;
-  }
-
-  /* check atom count */
-  if (atomcount != natoms) {
-    printf("dlpoly timestep) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon >= 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check and copy in periodic cell info */
-    if (ts != NULL) {
-      if (xaxis[1] != 0.0 || xaxis[2] != 0.0 || 
-          yaxis[0] != 0.0 || yaxis[2] != 0.0 || 
-          zaxis[0] != 0.0 || zaxis[1] != 0.0) {
-        if (data->cellwarnflag != 1)
-          printf("dlpoly timestep) non-orthogonal DLPOLY periodic cell data unsupported\n");
-        data->cellwarnflag = 1;
-      } else {
-        ts->A = xaxis[0];
-        ts->B = yaxis[1];
-        ts->C = zaxis[2];
-        if (data->cellwarnflag != 2)
-          printf("dlpoly timestep) converting DLPOLY periodic cell data\n");
-        data->cellwarnflag = 2;
-      }
-    }
-  }
-
-  /* read all per-atom data */
-  for (i=0; i<natoms; i++) {
-    /* read the coordinates */
-    switch (data->dlpolyversion) {
-      case 3:
-        if (8 != fscanf(data->file, "%s %d %f %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &rsd, &x, &y, &z)) {
-          printf("dlpoly timestep v3) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-
-      case 2:
-      default: 
-        if (7 != fscanf(data->file, "%s %d %f %f %f %f %f",
-               buf, &atomid, &mass, &charge, &x, &y, &z)) {
-          printf("dlpoly timestep v2) failed parsing atom coordinates\n");
-          return MOLFILE_ERROR;
-        }
-        break;
-    }
-
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly timestep) failed parsing atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly timestep) failed parsing atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    if (ts != NULL) { 
-      if (atomid > 0 && atomid <= natoms) {
-        int addr = 3 * (atomid - 1);
-        ts->coords[addr    ] = x;
-        ts->coords[addr + 1] = y;
-        ts->coords[addr + 2] = z;
-      } else {
-        fprintf(stderr, "dlpoly timestep) ignoring illegal atom index %d\n", atomid);
-      }
-    } 
-  }
-
-  /* eat remaining spaces and LF character */
-  fgets(fbuffer, 1024, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-    
-
-static int read_dlpoly_config_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  char fbuffer[4096], buf[4096];
-  float x, y, z;
-  int i, atomcount, keytrj, imcon, scancount, atomid;
-  dlpolydata *data = (dlpolydata *)mydata;
-
-  /* if we get nothing, assume we hit end of file */
-  if (NULL == fgets(fbuffer, 1024, data->file))  
-    return MOLFILE_EOF;
-
-  if (NULL == fgets(fbuffer, 1024, data->file))
-    return MOLFILE_EOF;
-  scancount = sscanf(fbuffer, "%d %d %d", &keytrj, &imcon, &atomcount);
-  if (scancount != 3) {
-    printf("dlpoly timestep v3) unrecognized header record\n");
-    return MOLFILE_ERROR;
-  } 
-
-  /* check atom count */
-  if (atomcount != natoms) {
-    printf("dlpoly timestep) mismatched atom count\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* read periodic cell vectors */
-  if (imcon > 0) {
-    float xaxis[3];
-    float yaxis[3];
-    float zaxis[3];
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &xaxis[0], &xaxis[1], &xaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &yaxis[0], &yaxis[1], &yaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (3 != fscanf(data->file, "%f %f %f\n", &zaxis[0], &zaxis[1], &zaxis[2])) {
-      printf("dlpoly timestep) failed reading unit cell basis vectors\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check and copy in periodic cell info */
-    if (ts != NULL) {
-      if (xaxis[1] != 0.0 || xaxis[2] != 0.0 || 
-          yaxis[0] != 0.0 || yaxis[2] != 0.0 || 
-          zaxis[0] != 0.0 || xaxis[1] != 0.0) {
-        if (data->cellwarnflag != 1)
-          printf("dlpoly timestep) non-orthogonal DLPOLY periodic cell data unsupported\n");
-        data->cellwarnflag = 1;
-      } else {
-        ts->A = xaxis[0];
-        ts->B = yaxis[1];
-        ts->C = zaxis[2];
-        if (data->cellwarnflag != 2)
-          printf("dlpoly timestep) converting DLPOLY periodic cell data\n");
-        data->cellwarnflag = 2;
-      }
-    }
-  }
-
-  /* read all per-atom data */
-  for (i=0; i<natoms; i++) {
-    /* read the coordinates */
-    if (2 != fscanf(data->file, "%s %d", buf, &atomid)) {
-      printf("dlpoly timestep v3) failed parsing atom labels\n");
-      return MOLFILE_ERROR;
-    }
-    /* read the coordinates */
-    if (3 != fscanf(data->file, "%f %f %f", &x, &y, &z)) {
-      printf("dlpoly timestep) failed parsing atom coordinates\n");
-      return MOLFILE_ERROR;
-    }
-    /* read the velocities */
-    if (keytrj > 0) {
-      float xv, yv, zv;
-      if (3 != fscanf(data->file, "%f %f %f", &xv, &yv, &zv)) {
-        printf("dlpoly timestep) failed parsing atom velocities\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* read the forces */
-    if (keytrj > 1) {
-      float xf, yf, zf;
-      if (3 != fscanf(data->file, "%f %f %f", &xf, &yf, &zf)) {
-        printf("dlpoly timestep) failed parsing atom forces\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    if (ts != NULL) { 
-      if (atomid > 0 && atomid <= natoms) {
-        int addr = 3 * (atomid - 1);
-        ts->coords[addr    ] = x;
-        ts->coords[addr + 1] = y;
-        ts->coords[addr + 2] = z;
-      } else {
-        fprintf(stderr, "dlpoly timestep) ignoring illegal atom index %d\n", atomid);
-      }
-    } 
-  }
-
-  /* eat remaining spaces and LF character */
-  fgets(fbuffer, 1024, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-    
-    
-    
-static void close_dlpoly_read(void *mydata) {
-  dlpolydata *data = (dlpolydata *)mydata;
-  fclose(data->file);
-  free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t dlpoly2plugin;
-static molfile_plugin_t dlpoly3plugin;
-
-static molfile_plugin_t dlpolypluginconfig;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&dlpoly2plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly2plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly2plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly2plugin.name = "dlpolyhist";
-  dlpoly2plugin.prettyname = "DL_POLY_C HISTORY";
-  dlpoly2plugin.author = "John Stone";
-  dlpoly2plugin.majorv = 0;
-  dlpoly2plugin.minorv = 8;
-  dlpoly2plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly2plugin.filename_extension = "dlpolyhist";
-  dlpoly2plugin.open_file_read = open_dlpoly_read;
-  dlpoly2plugin.read_structure = read_dlpoly_structure;
-  dlpoly2plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly2plugin.close_file_read = close_dlpoly_read;
-
-  memset(&dlpoly3plugin, 0, sizeof(molfile_plugin_t));
-  dlpoly3plugin.abiversion = vmdplugin_ABIVERSION;
-  dlpoly3plugin.type = MOLFILE_PLUGIN_TYPE;
-  dlpoly3plugin.name = "dlpoly3hist";
-  dlpoly3plugin.prettyname = "DL_POLY_4 HISTORY";
-  dlpoly3plugin.author = "John Stone";
-  dlpoly3plugin.majorv = 0;
-  dlpoly3plugin.minorv = 8;
-  dlpoly3plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpoly3plugin.filename_extension = "dlpolyhist";
-  dlpoly3plugin.open_file_read = open_dlpoly_read;
-  dlpoly3plugin.read_structure = read_dlpoly_structure;
-  dlpoly3plugin.read_next_timestep = read_dlpoly_timestep;
-  dlpoly3plugin.close_file_read = close_dlpoly_read;
-
-  memset(&dlpolypluginconfig, 0, sizeof(molfile_plugin_t));
-  dlpolypluginconfig.abiversion = vmdplugin_ABIVERSION;
-  dlpolypluginconfig.type = MOLFILE_PLUGIN_TYPE;
-  dlpolypluginconfig.name = "dlpolyconfig";
-  dlpolypluginconfig.prettyname = "DL_POLY CONFIG";
-  dlpolypluginconfig.author = "Alin M Elena";
-  dlpolypluginconfig.majorv = 0;
-  dlpolypluginconfig.minorv = 1;
-  dlpolypluginconfig.is_reentrant = VMDPLUGIN_THREADSAFE;
-  dlpolypluginconfig.filename_extension = "dlpolyconfig";
-  dlpolypluginconfig.open_file_read = open_dlpoly_config_read;
-  dlpolypluginconfig.read_structure = read_dlpoly_config_structure;
-  dlpolypluginconfig.read_next_timestep = read_dlpoly_config_timestep;
-  dlpolypluginconfig.close_file_read = close_dlpoly_read;
-  
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&dlpoly2plugin);
-  (*cb)(v, (vmdplugin_t *)&dlpoly3plugin);
-  (*cb)(v, (vmdplugin_t *)&dlpolypluginconfig);
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_dlpoly_read(*argv, "dlpoly", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_dlpoly_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_dlpoly_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_dlpoly_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_dlpoly_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dmsplugin.cxx b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dmsplugin.cxx
deleted file mode 100644
index edc1b83340ff01c853b80db74ee0aee9d3b0645e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dmsplugin.cxx
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#include "molfile_plugin.h"
-#include <sqlite3.h>
-
-#include <ctype.h> /* for isspace() */
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <vector>
-#include <map>
-
-
-#ifdef _MSC_VER
-#include <windows.h>
-static int fs_remove_file( const char * path ) {
-  DeleteFileA( path );
-  return 1; /* FIXME: check for failure */
-}
-#else
-#include <unistd.h>
-#include <errno.h>
-static int fs_remove_file( const char * path ) {
-    if (unlink(path)!=0 && errno!=ENOENT) {
-        fprintf(stderr, "Removing %s failed: %s\n", path, strerror(errno));
-        return 0;
-    }
-    return 1;
-}
-#endif
-
-#ifndef M_PI
-#define M_PI (3.1415926535897932385)
-#endif
-
-#ifndef M_PI_2
-#define M_PI_2 (1.5707963267948966192)
-#endif
-
-struct element {
-  double daltons;
-  const char* abbreviation;
-  const char* name;
-};
-
-/* url = "http://physics.nist.gov/cgi-bin/Elements/elInfo.pl?element=%d&context=noframes"%element */
-static struct element amu[] = {
-  {1.00794,"H","Hydrogen"},
-  {4.002602,"He","Helium"},
-  {6.941,"Li","Lithium"},
-  {9.012182,"Be","Beryllium"},
-  {10.811,"B","Boron"},
-  {12.0107,"C","Carbon"},
-  {14.0067,"N","Nitrogen"},
-  {15.9994,"O","Oxygen"},
-  {18.9984032,"F","Fluorine"},
-  {20.1797,"Ne","Neon"},
-  {22.989770,"Na","Sodium"},
-  {24.3050,"Mg","Magnesium"},
-  {26.981538,"Al","Aluminum"},
-  {28.0855,"Si","Silicon"},
-  {30.973761,"P","Phosphorus"},
-  {32.065,"S","Sulfur"},
-  {35.453,"Cl","Chlorine"},
-  {39.0983,"K","Potassium"},
-  {39.948,"Ar","Argon"},
-  {40.078,"Ca","Calcium"},
-  {44.955910,"Sc","Scandium"},
-  {47.867,"Ti","Titanium"},
-  {50.9415,"V","Vanadium"},
-  {51.9961,"Cr","Chromium"},
-  {54.938049,"Mn","Manganese"},
-  {55.845,"Fe","Iron"},
-  {58.6934,"Ni","Nickel"},
-  {58.933200,"Co","Cobalt"},
-  {63.546,"Cu","Copper"},
-  {65.409,"Zn","Zinc"},
-  {69.723,"Ga","Gallium"},
-  {72.64,"Ge","Germanium"},
-  {74.92160,"As","Arsenic"},
-  {78.96,"Se","Selenium"},
-  {79.904,"Br","Bromine"},
-  {83.798,"Kr","Krypton"},
-  {85.4678,"Rb","Rubidium"},
-  {87.62,"Sr","Strontium"},
-  {88.90585,"Y","Yttrium"},
-  {91.224,"Zr","Zirconium"},
-  {92.90638,"Nb","Niobium"},
-  {95.94,"Mo","Molybdenum"},
-  {101.07,"Ru","Ruthenium"},
-  {102.90550,"Rh","Rhodium"},
-  {106.42,"Pd","Palladium"},
-  {107.8682,"Ag","Silver"},
-  {112.411,"Cd","Cadmium"},
-  {114.818,"In","Indium"},
-  {118.710,"Sn","Tin"},
-  {121.760,"Sb","Antimony"},
-  {126.90447,"I","Iodine"},
-  {127.60,"Te","Tellurium"},
-  {131.293,"Xe","Xenon"},
-  {132.90545,"Cs","Cesium"},
-  {137.327,"Ba","Barium"},
-  {138.9055,"La","Lanthanum"},
-  {140.116,"Ce","Cerium"},
-  {140.90765,"Pr","Praseodymium"},
-  {144.24,"Nd","Neodymium"},
-  {150.36,"Sm","Samarium"},
-  {151.964,"Eu","Europium"},
-  {157.25,"Gd","Gadolinium"},
-  {158.92534,"Tb","Terbium"},
-  {162.500,"Dy","Dysprosium"},
-  {164.93032,"Ho","Holmium"},
-  {167.259,"Er","Erbium"},
-  {168.93421,"Tm","Thulium"},
-  {173.04,"Yb","Ytterbium"},
-  {174.967,"Lu","Lutetium"},
-  {178.49,"Hf","Hafnium"},
-  {180.9479,"Ta","Tantalum"},
-  {183.84,"W","Tungsten"},
-  {186.207,"Re","Rhenium"},
-  {190.23,"Os","Osmium"},
-  {192.217,"Ir","Iridium"},
-  {195.078,"Pt","Platinum"},
-  {196.96655,"Au","Gold"},
-  {200.59,"Hg","Mercury"},
-  {204.3833,"Tl","Thallium"},
-  {207.2,"Pb","Lead"},
-  {208.98038,"Bi","Bismuth"},
-  {231.03588,"Pa","Protactinium"},
-  {232.0381,"Th","Thorium"},
-  {238.02891,"U","Uranium"}
-};
-
-static const int nelements = sizeof(amu)/sizeof(amu[0]);
-
-static const char * 
-find_element_by_atomic_number(int target) {
-  if (target < 1) target=1;
-  if (target >= nelements) target = nelements;
-  return amu[target-1].abbreviation;
-}
-
-static int 
-find_element_by_amu(double target) {
-  int left = 0;
-  int right = nelements-1;
-  int swap;
-
-  /* -----------------------------------------------
-  // Knuth's binary search
-  // ----------------------------------------------- */
-  while(left <= right) {
-    int mid = (left+right)/2;
-    if (target> amu[mid].daltons) {
-      left = mid + 1;
-    } else if (target< amu[mid].daltons) {
-      right = mid - 1;
-    } else {
-      /* Exact match (unlikely) */
-      left = right = mid;
-      return left+1;
-    }
-  }
-
-  /* -----------------------------------------------
-  // CAUTION: at this point, the meanings of 
-  // left and right are switched (i.e. left >= right,
-  // see the while() loop above if you don't believe me!
-  // ----------------------------------------------- */
-  swap = left;
-  left = right;
-  right = swap;
-
-  if (left < 0) left = right;
-  if (right > nelements-1) right = left;
-
-  if (target - amu[left].daltons < amu[right].daltons - target) {
-    return left+1;
-  }
-
-  return right+1;
-}
-
-static int table_size( sqlite3 * db, const char * tname, 
-                       sqlite_int64 * count ) {
-    sqlite3_stmt *stmt;
-    char * buf;
-
-    if (!tname) return 0;
-    buf = (char *)malloc(strlen(tname) + 100);
-    sprintf(buf, "select count() from '%s'", tname);
-    if (sqlite3_prepare_v2(db, buf, -1, &stmt, NULL)) {
-        free(buf);
-        return 0;
-    }
-    if (SQLITE_ROW != sqlite3_step(stmt)) {
-        sqlite3_finalize(stmt);
-        free(buf);
-        return 0;
-    }
-    if (count) *count = sqlite3_column_int64(stmt, 0);
-    sqlite3_finalize(stmt);
-    return 1; /* success */
-}
-
-static molfile_plugin_t plugin;
-//static molfile_plugin_t append_plugin;
-
-namespace {
-    struct Handle {
-        sqlite3 * db;
-        int natoms;
-        int frames_read;
-        std::vector<int> from, to, gids;
-        std::vector<int> glue_from, glue_to;
-        std::vector<float> order;
-        Handle(sqlite3 * _db, int n) 
-        : db(_db), natoms(n), frames_read(0) {}
-            
-        ~Handle() {
-            if (db && sqlite3_close(db)) 
-                fprintf(stderr, "Error closing db: %s\n", sqlite3_errmsg(db));
-        }
-    };
-}
-
-
-  static void *open_file_read( const char *filename, const char *filetype,
-                        int *natoms ) {
-
-      sqlite3 * db;
-      sqlite_int64 count;
-      Handle * h;
-      if (sqlite3_open_v2( filename, &db, SQLITE_OPEN_READONLY, NULL)) {
-          fprintf(stderr, "Error opening dms at %s: %s", 
-                  filename, sqlite3_errmsg(db));
-          return NULL;
-      }
-      if (!table_size( db, "particle", &count )) return NULL;
-      h = new Handle(db, count);
-      *natoms = count;
-      return h;
-  }
-
-static void close_file_read(void *v) { delete (Handle *)v; }
-
-static int has_nonwhitespace( const char * p ) {
-    for (; *p; ++p) {
-        if (!isspace(*p)) return 1;
-    }
-    return 0;
-}
-
-#define GET_STRING( col, field ) do { \
-    if ( col >= 0 ) { \
-        const char * val = (const char *)sqlite3_column_text(stmt, col); \
-        if (val) { \
-            strncpy( atom->field, val, sizeof(atom->field) ); \
-            atom->field[sizeof(atom->field)-1] = '\0'; \
-        } \
-    } \
-} while(0)
-
-#define GET_INT( col, field ) do { \
-    if ( col >= 0 ) { \
-        atom->field = sqlite3_column_int(stmt, col); \
-    } \
-} while (0)
-
-#define GET_DOUBLE( col, field ) do { \
-    if ( col >= 0 ) { \
-        atom->field = sqlite3_column_double(stmt, col); \
-    } \
-} while (0)
-
-  static
-  int read_structure( void *v, int *optflags, molfile_atom_t *atoms ) {
-      Handle *h = (Handle *)v;
-      sqlite3 * db = h->db;
-      sqlite3_stmt * stmt;
-      static const char infosql[] = "pragma table_info(particle)";
-      static const char loadsql[] = "select * from particle";
-      molfile_atom_t * atom = NULL;
-
-      int gid_col = -1;
-      int name_col = -1;
-      int anum_col = -1;
-      int resid_col = -1;
-      int resname_col = -1;
-      int chain_col = -1;
-      int segid_col = -1;
-      int mass_col = -1;
-      int charge_col = -1;
-      int x_col = -1;
-      int y_col = -1;
-      int z_col = -1;
-      int vx_col = -1;
-      int vy_col = -1;
-      int vz_col = -1;
-      int occ_col = -1;
-  
-      int ncols=0;
-      *optflags = 0;
-  
-      if (sqlite3_prepare_v2(db, infosql, -1, &stmt, NULL)) {
-          fprintf(stderr, "Error getting particle info: %s", 
-                  sqlite3_errmsg(db));
-          return MOLFILE_ERROR;
-      }
-      atom = atoms;
-      while (SQLITE_ROW==sqlite3_step(stmt)) {
-          const char * name = (const char *)sqlite3_column_text(stmt,1);
-
-          if      (!strcmp(name, "anum")) anum_col = ncols;
-          else if (!strcmp(name, "id")) gid_col = ncols;
-          else if (!strcmp(name, "name")) name_col = ncols;
-          else if (!strcmp(name, "resid")) resid_col = ncols;
-          else if (!strcmp(name, "resname")) resname_col = ncols;
-          else if (!strcmp(name, "chain")) chain_col = ncols;
-          else if (!strcmp(name, "segid")) segid_col = ncols;
-          else if (!strcmp(name, "mass")) mass_col = ncols;
-          else if (!strcmp(name, "charge")) charge_col = ncols;
-          else if (!strcmp(name, "x")) x_col = ncols;
-          else if (!strcmp(name, "y")) y_col = ncols;
-          else if (!strcmp(name, "z")) z_col = ncols;
-          else if (!strcmp(name, "vx")) vx_col = ncols;
-          else if (!strcmp(name, "vy")) vy_col = ncols;
-          else if (!strcmp(name, "vz")) vz_col = ncols;
-          else if (!strcmp(name, "occupancy")) occ_col = ncols;
-          ++ncols;
-      }  
-      sqlite3_finalize(stmt);
-
-      if (anum_col >= 0)   *optflags |= MOLFILE_ATOMICNUMBER;
-      if (charge_col >= 0) *optflags |= MOLFILE_CHARGE;
-      if (mass_col >= 0)   *optflags |= MOLFILE_MASS;
-      if (occ_col >= 0)    *optflags |= MOLFILE_OCCUPANCY;
-
-      if (gid_col<0) {
-          fprintf(stderr, "Missing id column in particle table\n");
-          return MOLFILE_ERROR;
-      }
-
-      if (sqlite3_prepare_v2(db, loadsql, -1, &stmt, NULL)) {
-          fprintf(stderr, "Error loading particle structure: %s",
-                  sqlite3_errmsg(db));
-          return MOLFILE_ERROR;
-      }
-      while (SQLITE_ROW==sqlite3_step(stmt)) {
-          memset(atom, 0, sizeof(*atom));
-          GET_STRING(    name_col, name );
-          GET_INT(       anum_col, atomicnumber );
-          GET_INT(      resid_col, resid );
-          GET_STRING( resname_col, resname );
-          GET_DOUBLE(    mass_col, mass );
-          GET_DOUBLE(  charge_col, charge );
-          GET_DOUBLE(     occ_col, occupancy );
-          GET_STRING(   chain_col, chain );
-          GET_STRING(   segid_col, segid );
-
-          h->gids.push_back(sqlite3_column_int(stmt, gid_col));
-
-          /* if the name is all space, and we have an atomic number, use the
-          element name instead. */
-          if (atom->atomicnumber) {
-            if (!has_nonwhitespace(atom->name)) {
-              const char *nm = 
-                find_element_by_atomic_number(atom->atomicnumber);
-              strncpy( atom->name, nm, sizeof(atom->name));
-            }
-          }
-          ++atom;
-      }
-      sqlite3_finalize(stmt);
-      return MOLFILE_SUCCESS;
-  }
-
-static
-#if vmdplugin_ABIVERSION > 14
-int read_bonds(void *v, int *nbonds, int **from, int **to, float** order,
-               int **bondtype, int *nbondtypes, char ***bondtypename) {
-#else
-int read_bonds(void *v, int *nbonds, int **from, int **to, float** order) {
-#endif
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite_int64 count = 0;
-    if (table_size(h->db, "bond", &count) && count>0) {
-        sqlite3_stmt * stmt;
-        int with_order = 1;
-        /* Try including order first */
-        static const char * sql = "select p0,p1,\"order\" from bond";
-        if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-            /* Fall back to just p0, p1 */
-            static const char * sql = "select p0,p1 from bond";
-            with_order = 0;
-            if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-                fprintf(stderr, "Error reading bonds: %s", sqlite3_errmsg(db));
-                return MOLFILE_ERROR;
-            }
-        }
-        h->from.resize(count);
-        h->to.resize(count);
-        h->order.resize(count);
-
-        *from = &h->from[0];
-        *to   = &h->to[0];
-        *order = &h->order[0];
-#if vmdplugin_ABIVERSION > 14
-        *bondtype = NULL;
-        *nbondtypes = 0;
-        *bondtypename = NULL;
-  #endif
-
-        std::map<int,int> gidmap;
-        for (unsigned i=0; i<h->gids.size(); i++) gidmap[h->gids[i]]=i+1;
-
-        for (int i=0; sqlite3_step(stmt)==SQLITE_ROW; i++) {
-            std::map<int,int>::const_iterator iter;
-
-            int from = sqlite3_column_int(stmt,0);
-            int to   = sqlite3_column_int(stmt,1);
-            h->order[i] = with_order ? sqlite3_column_int(stmt,2) : 1;
-            if ((iter=gidmap.find(from))==gidmap.end()) {
-                fprintf(stderr, "Illegal bond in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->from[i] = iter->second;
-            if ((iter=gidmap.find(to))==gidmap.end()) {
-                fprintf(stderr, "Illegal bond in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->to[i] = iter->second;
-        }
-        sqlite3_finalize(stmt);
-    }
-    *nbonds = count;
-    return MOLFILE_SUCCESS;
-}
-
-static
-int read_fictitious_bonds(void *v, int *nbonds, int **from, int **to) {
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite_int64 count = 0;
-    if (table_size(h->db, "glue", &count) && count>0) {
-        sqlite3_stmt * stmt;
-        static const char * sql = "select p0,p1 from glue";
-        if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-            fprintf(stderr, "Error reading bonds: %s", sqlite3_errmsg(db));
-            return MOLFILE_ERROR;
-        }
-        h->glue_from.resize(count);
-        h->glue_to.resize(count);
-
-        *from = &h->glue_from[0];
-        *to   = &h->glue_to[0];
-
-        std::map<int,int> gidmap;
-        for (unsigned i=0; i<h->gids.size(); i++) gidmap[h->gids[i]]=i+1;
-
-        for (int i=0; sqlite3_step(stmt)==SQLITE_ROW; i++) {
-            std::map<int,int>::const_iterator iter;
-
-            int from = sqlite3_column_int(stmt,0);
-            int to   = sqlite3_column_int(stmt,1);
-            if ((iter=gidmap.find(from))==gidmap.end()) {
-                fprintf(stderr, "Illegal glue in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->glue_from[i] = iter->second;
-            if ((iter=gidmap.find(to))==gidmap.end()) {
-                fprintf(stderr, "Illegal glue in row %d: %d-%d\n", 
-                        i+1, from, to);
-                return MOLFILE_ERROR;
-            }
-            h->glue_to[i] = iter->second;
-        }
-        sqlite3_finalize(stmt);
-    }
-    *nbonds = count;
-    return MOLFILE_SUCCESS;
-}
-
-  static
-  double dotprod(const double *x, const double *y) {
-    return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
-  }
-
-  static
-  int read_global_cell(Handle * h, molfile_timestep_t * ts) {
-      sqlite3_stmt * stmt;
-      sqlite_int64 count;
-      int i,j;
-      double cell[3][3];
-      double cosAB, cosAC, cosBC;
-      const double * A, * B, * C;
-      if (!table_size(h->db, "global_cell", &count)) return MOLFILE_SUCCESS;
-      if (count != 3) {
-          fprintf(stderr, "Error: expected global_cell size of 3, got %d",
-                  (int)count);
-          return MOLFILE_ERROR;
-      }
-      if (sqlite3_prepare_v2(h->db,"select x,y,z from global_cell", -1, &stmt, NULL))  {
-          fprintf(stderr, "Error compiling global_cell reader: %s",
-                  sqlite3_errmsg(h->db));
-          return MOLFILE_ERROR;
-      }
-      for (i=0; i<3; i++) {
-          sqlite3_step(stmt);
-          for (j=0; j<3; j++) {
-              cell[i][j] = sqlite3_column_double(stmt,j);
-          }
-      }
-      sqlite3_finalize(stmt);
-
-      A = cell[0];
-      B = cell[1];
-      C = cell[2];
-
-      /* store lengths */
-      ts->A = sqrt(dotprod(A,A));
-      ts->B = sqrt(dotprod(B,B));
-      ts->C = sqrt(dotprod(C,C));
-
-      if (ts->A==0 || ts->B==0 || ts->C==0) {
-          ts->alpha = ts->beta = ts->gamma = 90.0;
-
-      } else {
-        /* compute angles */
-        cosAB = dotprod(A,B)/(ts->A * ts->B);
-        cosAC = dotprod(A,C)/(ts->A * ts->C);
-        cosBC = dotprod(B,C)/(ts->B * ts->C);
-
-        /* clamp */
-        if (cosAB > 1.0) cosAB = 1.0; else if (cosAB < -1.0) cosAB = -1.0;
-        if (cosAC > 1.0) cosAC = 1.0; else if (cosAC < -1.0) cosAC = -1.0;
-        if (cosBC > 1.0) cosBC = 1.0; else if (cosBC < -1.0) cosBC = -1.0;
-
-        /* convert to angles using asin to avoid nasty rounding when we are
-        close to 90 degree angles. */
-        ts->alpha = 90.0 - asin(cosBC) * 90.0 / M_PI_2; /* cosBC */
-        ts->beta  = 90.0 - asin(cosAC) * 90.0 / M_PI_2; /* cosAC */
-        ts->gamma = 90.0 - asin(cosAB) * 90.0 / M_PI_2; /* cosAB */
-      }
-      return MOLFILE_SUCCESS;
-  }
-
-  static
-  int read_timestep(Handle * h, molfile_timestep_t *ts) {
-
-      sqlite3_stmt * stmt;
-      float * pos = ts->coords;
-      float * vel = ts->velocities;
-      const char * sql = vel ? "select x,y,z,vx,vy,vz from particle"
-                             : "select x,y,z          from particle";
-      if (sqlite3_prepare_v2( h->db, sql, -1, &stmt, NULL)) {
-          fprintf(stderr, "Error reading timestep: %s\n", 
-                  sqlite3_errmsg(h->db));
-          return MOLFILE_ERROR;
-      }
-      while (SQLITE_ROW==sqlite3_step(stmt)) {
-          int i;
-          for (i=0; i<3; i++) *pos++ = sqlite3_column_double(stmt,i);
-          if (vel) {
-            for (i=0; i<3; i++) *vel++ = sqlite3_column_double(stmt,i+3);
-          }
-      }
-      sqlite3_finalize(stmt);
-      return read_global_cell(h,ts);
-  }
-
-
-  static
-  int read_next_timestep( void *v, int atoms, molfile_timestep_t *ts) {
-    Handle *h = (Handle *)v;
-    if (h->frames_read++) return MOLFILE_EOF;
-    return read_timestep(h, ts);
-  }
-
-  static
-  int read_timestep2(void *v, ssize_t n, molfile_timestep_t *ts) {
-    Handle *h = (Handle *)v;
-    if (n!=0) return MOLFILE_EOF;
-    return read_timestep(h, ts);
-  }
-
-  static
-  int read_timestep_metadata( void *v, molfile_timestep_metadata_t *m) {
-    /* FIXME: assume velocities */
-    m->has_velocities = 1;
-    m->count = 1; /* number of timesteps */
-    m->avg_bytes_per_timestep = 10000; /* FIXME */
-    return MOLFILE_SUCCESS;
-  }
-
-  static
-  void *open_file_write(const char *path, const char *type, int natoms) {
-
-      sqlite3 * db;
-      Handle *h=NULL;
-      /* delete existing file so we don't just append */
-      if (!fs_remove_file(path)) return NULL;
-      if (sqlite3_open(path, &db)) {
-          fprintf(stderr, "Failed opening %s: %s\n", 
-                  path, sqlite3_errmsg(db));
-          return NULL;
-      }
-      h = new Handle(db, natoms);
-      return h;
-  }
-
-  static
-#if vmdplugin_ABIVERSION > 14
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order,
-                  int *bondtype, int nbondtypes, char **bondtypename) {
-#else
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order) {
-#endif
-      Handle *h = (Handle *)v;
-      h->from.resize(nbonds);
-      h->to.resize(nbonds);
-      
-      std::copy(from, from+nbonds, h->from.begin());
-      std::copy(to,   to+nbonds,   h->to.begin());
-      if (order) {
-          h->order.resize(nbonds);
-          std::copy(order, order+nbonds, h->order.begin());
-      } else {
-          h->order.clear();
-          h->order.insert(h->order.begin(), nbonds, 1);
-      }
-      return MOLFILE_SUCCESS;
-  }
-
-  static
-  int write_structure(void *v, int optflags, const molfile_atom_t *atoms) {
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite3_stmt * stmt;
-    int i;
-
-    sqlite3_exec(db, "begin", NULL, NULL, NULL);
-    if (sqlite3_exec(db, 
-        " create table if not exists particle (\n"
-        "id integer primary key, \n"
-        "anum integer,\n"
-        "x float, y float, z float,\n"
-        "vx float, vy float, vz float,\n"
-        "mass float, charge float,\n"
-        "name text, resname text, resid integer, chain text, segid text)", 
-        NULL, NULL, NULL)) {
-        fprintf(stderr, "Error creating particle table %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    if (sqlite3_prepare_v2(db, "insert into particle values ("
-                "?," /* id */
-                "?," /* anum */
-                "?,?,?,?,?,?," /* x,y,z, vx,vy,vz */
-                "?,?,"  /* mass, charge */
-                "?,?,?,?,?)", /* name, resname, resid, chain, segid */
-                -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling insert particle statement %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    for (i=0; i<h->natoms; i++) {
-        const molfile_atom_t * a = atoms+i;
-        int anum=0;
-        if (optflags & MOLFILE_ATOMICNUMBER) {
-            anum=a->atomicnumber;
-        } else if (optflags & MOLFILE_MASS) {
-            anum=find_element_by_amu(a->mass);
-        }
-
-        sqlite3_bind_int(stmt, 1, i );
-        sqlite3_bind_int(stmt, 2, anum );
-        sqlite3_bind_double( stmt, 9, 
-                optflags & MOLFILE_MASS ?  a->mass : 0.0 );
-        sqlite3_bind_double( stmt, 10, 
-                optflags & MOLFILE_CHARGE ? a->charge : 0.0 );
-        sqlite3_bind_text( stmt, 11, a->name, -1, SQLITE_STATIC );
-        sqlite3_bind_text( stmt, 12, a->resname, -1, SQLITE_STATIC );
-        sqlite3_bind_int(  stmt, 13, a->resid );
-        sqlite3_bind_text( stmt, 14, a->chain, -1, SQLITE_STATIC );
-        sqlite3_bind_text( stmt, 15, a->segid, -1, SQLITE_STATIC );
-        
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error adding particle: %s\n",
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-    
-    /* bonds */
-    if (sqlite3_exec(db,
-        "  create table if not exists bond (\n"
-        "    p0 integer, p1 integer, 'order' integer)", NULL, NULL, NULL )) {
-        fprintf(stderr, "Error creating bond table: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    if (sqlite3_prepare_v2(db, "insert into bond values (?,?,?)", -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling bond insert statement: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    for (unsigned i=0; i<h->from.size(); i++) {
-        sqlite3_bind_int( stmt, 1, h->from[i]-1);
-        sqlite3_bind_int( stmt, 2, h->to[i]-1);
-        sqlite3_bind_int( stmt, 3, h->order[i]);
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error adding bond: %s\n", 
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-    sqlite3_exec(db, "commit", NULL, NULL, NULL);
-    return MOLFILE_SUCCESS;
-  }
-
-  static
-  void convert_to_homebox( const molfile_timestep_t * ts, double box[9]) {
-
-    double A[3], B[3], C[3];
-
-    /* Convert VMD's unit cell information */
-    double cosBC = sin( ((90 - ts->alpha ) / 180) * M_PI );
-    double cosAC = sin( ((90 - ts->beta  ) / 180) * M_PI );
-    double cosAB = sin( ((90 - ts->gamma ) / 180) * M_PI );
-    double sinAB = cos( ((90 - ts->gamma ) / 180) * M_PI );
-
-    double Ax = ts->A;
-    double Ay = 0;
-    double Az = 0;
-    double Bx = ts->B * cosAB;
-    double By = ts->B * sinAB;
-    double Bz = 0;
-    double Cx,Cy,Cz;
-    if (sinAB != 0) {
-      Cx = cosAC;
-      Cy = (cosBC - cosAC*cosAB) / sinAB;
-      Cz = sqrt(1-Cx*Cx-Cy*Cy);
-      Cx *= ts->C;
-      Cy *= ts->C;
-      Cz *= ts->C;
-    } else {
-      Cx=Cy=Cz=0;
-    }
-    A[0] = Ax; A[1] = Ay; A[2] = Az;
-    B[0] = Bx; B[1] = By; B[2] = Bz;
-    C[0] = Cx; C[1] = Cy; C[2] = Cz;
-
-    /* put vectors in rows of box */
-    box[0] = A[0]; box[1] = A[1]; box[2] = A[2];
-    box[3] = B[0]; box[4] = B[1]; box[5] = B[2];
-    box[6] = C[0]; box[7] = C[1]; box[8] = C[2];
-  }
-
-  static
-  int write_timestep(void *v, const molfile_timestep_t *ts) {
-    Handle *h = (Handle *)v;
-    sqlite3 * db = h->db;
-    sqlite3_stmt * stmt;
-    double box[9];
-    int i;
-    if (h->frames_read) return MOLFILE_EOF;
-    static const char sql[]=
-        "update particle set x=?,y=?,z=?,vx=?,vy=?,vz=? where id=?";
-    if (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling update positions statement: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    sqlite3_exec(db, "begin", NULL, NULL, NULL);
-    for (i=0; i<h->natoms; i++) {
-        sqlite3_bind_double( stmt, 1, ts->coords[3*i  ] );
-        sqlite3_bind_double( stmt, 2, ts->coords[3*i+1] );
-        sqlite3_bind_double( stmt, 3, ts->coords[3*i+2] );
-        double vx=0, vy=0, vz=0;
-        if (ts->velocities) {
-            vx=ts->velocities[3*i];
-            vy=ts->velocities[3*i+1];
-            vz=ts->velocities[3*i+2];
-        }
-        sqlite3_bind_double( stmt, 4, vx );
-        sqlite3_bind_double( stmt, 5, vy );
-        sqlite3_bind_double( stmt, 6, vz );
-        sqlite3_bind_int( stmt, 7, i );
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error updating position: %s\n",
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-
-    if (sqlite3_exec(db,
-        "  create table if not exists global_cell (\n"
-        "  id integer primary key, x float, y float, z float)",
-        NULL, NULL, NULL)) {
-        fprintf(stderr, "Error creating global cell table %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    sqlite3_exec(db, "delete from global_cell", NULL, NULL, NULL);
-    if (sqlite3_prepare_v2(db, "insert into global_cell (x,y,z) values (?,?,?)",
-                -1, &stmt, NULL)) {
-        fprintf(stderr, "Error compiling global_cell statement: %s\n",
-                sqlite3_errmsg(db));
-        return MOLFILE_ERROR;
-    }
-    convert_to_homebox( ts, box );
-    for (i=0; i<3; i++) {
-        sqlite3_bind_double(stmt, 1, box[3*i  ]);
-        sqlite3_bind_double(stmt, 2, box[3*i+1]);
-        sqlite3_bind_double(stmt, 3, box[3*i+2]);
-        if (sqlite3_step(stmt)!=SQLITE_DONE) {
-            fprintf(stderr, "Error updating global cell: %s\n", 
-                    sqlite3_errmsg(db));
-            sqlite3_finalize(stmt);
-            return MOLFILE_ERROR;
-        }
-        sqlite3_reset(stmt);
-    }
-    sqlite3_finalize(stmt);
-    sqlite3_exec(db, "commit", NULL, NULL, NULL);
-    return MOLFILE_SUCCESS;
-  }
-
-  static void close_file_write(void *v) { delete (Handle *)v; }
-
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(plugin));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "dms";
-  plugin.prettyname = "DESRES Molecular Structure";
-  plugin.author = "D.E. Shaw Research, LLC: Justin Gullingsrud";
-  plugin.majorv = 1;
-  plugin.minorv = 0;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-
-  plugin.filename_extension = "dms";
-  plugin.open_file_read = open_file_read;
-  plugin.read_structure = read_structure;
-  plugin.read_bonds = read_bonds;
-  plugin.read_next_timestep = read_next_timestep;
-#if defined(DESRES_READ_TIMESTEP2)
-  plugin.read_timestep2 = read_timestep2;
-  plugin.read_fictitious_bonds = read_fictitious_bonds;
-#endif
-  plugin.close_file_read = close_file_read;
-
-  plugin.read_timestep_metadata = read_timestep_metadata;
-
-  plugin.open_file_write = open_file_write;
-  plugin.write_structure = write_structure;
-  plugin.write_bonds = write_bonds;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register( void *v, vmdplugin_register_cb cb) {
-  cb( v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dsn6plugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dsn6plugin.C
deleted file mode 100644
index 00829915aef73d18a7cc671a08ac32d9ef5773de..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dsn6plugin.C
+++ /dev/null
@@ -1,316 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dsn6plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.25 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * DSN6 format electron density maps.
- *
- * More info for format can be found at 
- * <http://www.uoxray.uoregon.edu/tnt/manual/node104.html>
- * TODO: Check byte-swapping and alignment issues in read_data()
- *
- * apparently there are some gotchas there, and mapman does some things to 
- * fix up some variants of DSN6:
- * Gerard "DVD" Kleywegt  gerard@xray.bmc.uu.se: 
- *   "dale's description is largely correct, but in elements 13 to 15
- *    the actual cell angles are stored (multiplied by a scale factor)
- *    rather than their cosines. also, turbo-frodo-style dsn6 maps
- *    differ slightly from o-style dsn6 maps. shown below is a chunk
- *    of code (yes, fortran) from mapman that fills the header record"
- * See original email for mapman code snippet:
- *      http://o-info.bioxray.dk/pipermail/o-info/2002-June/005993.html
- * 
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  float prod, plus;
-  molfile_volumetric_t *vol;
-} dsn6_t;
-
-
-static void *open_dsn6_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  dsn6_t *dsn6;
-  short fileHeader[19];
-  int start_x, start_y, start_z, extent_x, extent_y, extent_z;
-  float scale, A, B, C, alpha, beta, gamma, 
-        xaxis[3], yaxis[3], zaxis[3], z1, z2, z3;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "Error opening file.\n");
-    return NULL;
-  }
-
-  // Read the header into a 19-element int array. The integers are stored
-  // according to the endianness of the machine used to write the file, so
-  // swapping may be necessary.
-  fread(fileHeader, sizeof(short), 19, fd);
-
-  // Check byte-order, swapping if necessary
-  if (fileHeader[18] == 25600)
-    swap2_aligned(fileHeader, 19);
-  else if (fileHeader[18] != 100) {
-    fprintf(stderr, "Error reading file header.\n");
-    return NULL;
-  }
-  // else fileHeader[18] is 100, byte-order is fine 
-  // (this value is hard-coded into the file format)
-
-  // Unit cell origin, in grid coordinates
-  start_x = fileHeader[0];
-  start_y = fileHeader[1];
-  start_z = fileHeader[2];
-
-  // Unit cell size
-  extent_x = fileHeader[3];
-  extent_y = fileHeader[4];
-  extent_z = fileHeader[5];
-
-  // Constant cell scaling factor
-  scale = 1.0 / fileHeader[17];
-
-  // Unit cell edge, in angstroms / sample
-  A = scale * fileHeader[9] / fileHeader[6];
-  B = scale * fileHeader[10] / fileHeader[7];
-  C = scale * fileHeader[11] / fileHeader[8];
-
-  // Cell angles, in radians
-  alpha = scale * fileHeader[12] * M_PI / 180.0;
-  beta = scale * fileHeader[13] * M_PI / 180.0;
-  gamma = scale * fileHeader[14] * M_PI / 180.0;
-
-  // Allocate and initialize the dsn6 structure
-  dsn6 = new dsn6_t;
-  dsn6->fd = fd;
-  dsn6->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  dsn6->nsets = 1; // this file contains only one data set
-
-  // Grid data scaling constants
-  dsn6->prod = (float) fileHeader[15] / fileHeader[18];
-  dsn6->plus = fileHeader[16];
-
-  dsn6->vol = new molfile_volumetric_t[1];
-  strcpy(dsn6->vol[0].dataname, "DSN6 Electron Density Map");
-
-  // Calculate non-orthogonal unit cell coordinates
-  xaxis[0] = A;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(gamma) * B;
-  yaxis[1] = sin(gamma) * B;
-  yaxis[2] = 0;
-
-  z1 = cos(beta);
-  z2 = (cos(alpha) - cos(beta)*cos(gamma)) / sin(gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * C;
-  zaxis[1] = z2 * C;
-  zaxis[2] = z3 * C;
-
-  // Convert the origin from grid space to cartesian coordinates
-  dsn6->vol[0].origin[0] = xaxis[0] * start_x + yaxis[0] * start_y + 
-                           zaxis[0] * start_z;
-  dsn6->vol[0].origin[1] = yaxis[1] * start_y + zaxis[1] * start_z;
-  dsn6->vol[0].origin[2] = zaxis[2] * start_z;
-
-  dsn6->vol[0].xaxis[0] = xaxis[0] * (extent_x-1);
-  dsn6->vol[0].xaxis[1] = 0;
-  dsn6->vol[0].xaxis[2] = 0;
-
-  dsn6->vol[0].yaxis[0] = yaxis[0] * (extent_y-1);
-  dsn6->vol[0].yaxis[1] = yaxis[1] * (extent_y-1);
-  dsn6->vol[0].yaxis[2] = 0;
-
-  dsn6->vol[0].zaxis[0] = zaxis[0] * (extent_z-1);
-  dsn6->vol[0].zaxis[1] = zaxis[1] * (extent_z-1);
-  dsn6->vol[0].zaxis[2] = zaxis[2] * (extent_z-1);
-
-  dsn6->vol[0].xsize = extent_x;
-  dsn6->vol[0].ysize = extent_y;
-  dsn6->vol[0].zsize = extent_z;
-
-  dsn6->vol[0].has_color = 0;
-
-  return dsn6;
-}
-
-static int read_dsn6_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  dsn6_t *dsn6 = (dsn6_t *)v;
-  *nsets = dsn6->nsets; 
-  *metadata = dsn6->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_dsn6_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  dsn6_t *dsn6 = (dsn6_t *)v;
-  float * cell = datablock;
-  unsigned char brick[512];
-  unsigned char* brickPtr = NULL;
-  int xsize, ysize, zsize, xysize, xbrix, ybrix, zbrix, cellIndex;
-  int x, y, z, xbrik, ybrik, zbrik;
-  FILE * fd = dsn6->fd;
-  float div, plus;
-
-  // Read 512-byte "bricks" of data. Each brick contains data for 8*8*8 
-  // gridpoints.
-  fseek(fd, 512, SEEK_SET);
-
-  div = 1.0 / dsn6->prod;
-  plus = dsn6->plus;
-
-  xsize = dsn6->vol[0].xsize;
-  ysize = dsn6->vol[0].ysize;
-  zsize = dsn6->vol[0].zsize;
-  xysize = xsize * ysize;
-
-  xbrix = (int) ceil((float) xsize / 8.0);
-  ybrix = (int) ceil((float) ysize / 8.0);
-  zbrix = (int) ceil((float) zsize / 8.0);
-
-  cellIndex = 0;
-  for (zbrik = 0; zbrik < zbrix; zbrik++) {
-    for (ybrik = 0; ybrik < ybrix; ybrik++) {
-      for (xbrik = 0; xbrik < xbrix; xbrik++) {
-        // Read the next brick into the buffer and swap its bytes.
-        if (feof(fd)) {
-          fprintf(stderr, "Unexpected end-of-file.\n");
-          return MOLFILE_ERROR;
-        }
-        if (ferror(fd)) {
-          fprintf(stderr, "Error reading file.\n");
-          return MOLFILE_ERROR;
-        }
-
-        fread(brick, sizeof(char), 512, fd);
-        swap2_unaligned(brick, 512*sizeof(char));
-        brickPtr = brick;
-
-        for (z = 0; z < 8; z++) {
-          if ((z + zbrik*8) >= zsize) {
-            cellIndex += (8 - z) * xysize;
-            break;
-          }
-
-          for (y = 0; y < 8; y++) {
-            if ((y + ybrik*8) >= ysize) {
-              cellIndex += (8 - y) * xsize;
-              brickPtr += (8 - y) * 8;
-              break;
-            }
-
-            for (x = 0; x < 8; x++) {
-              if ((x + xbrik*8) >= xsize) {
-                cellIndex += 8 - x;
-                brickPtr += 8 - x;
-                break;
-              }
-
-              // cell[(x+xbrik*8) + (y+ybrik*8)*xsize + (z+zbrik*8)*xysize] =
-              // div * ((float) brick[x + 8*y + 64*z] - plus)
-              cell[cellIndex] = div * ((float) *brickPtr - plus);
-
-              brickPtr++;
-              cellIndex++;
-            } // end for(x)
-           
-            cellIndex += xsize - 8;
-          } // end for(y)
-         
-          cellIndex += xysize - 8*xsize;
-        } // end for(z)
-      
-        cellIndex += 8 - 8*xysize; 
-      } // end for(xbrik)
-
-      cellIndex += 8 * (xsize - xbrix);
-    } // end for(ybrik)
-
-    cellIndex += 8 * (xysize - xsize*ybrik);
-  } // end for(zbrik)
- 
-  return MOLFILE_SUCCESS;
-}
-
-static void close_dsn6_read(void *v) {
-  dsn6_t *dsn6 = (dsn6_t *)v;
-
-  fclose(dsn6->fd);
-  if (dsn6->vol != NULL)
-    delete [] dsn6->vol; 
-  delete dsn6;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "DSN6";
-  plugin.prettyname = "DSN6";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "ds6,dsn6,omap";
-  plugin.open_file_read = open_dsn6_read;
-  plugin.read_volumetric_metadata = read_dsn6_metadata;
-  plugin.read_volumetric_data = read_dsn6_data;
-  plugin.close_file_read = close_dsn6_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dtrplugin.cxx b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dtrplugin.cxx
deleted file mode 100644
index 674ed5561de62ff4c365eb3537b074e829fcb1fb..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dtrplugin.cxx
+++ /dev/null
@@ -1,2380 +0,0 @@
-//
-// Version info for VMD plugin tree:
-//   $Id: dtrplugin.cxx,v 1.26 2016/11/06 19:25:35 johns Exp $
-//
-// Version info for last sync with D. E. Shaw Research:
-//  //depot/desrad/main/sw/libs/molfile/plugins/dtrplugin.cxx#30
-//
-
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#include "dtrplugin.hxx"
-
-using namespace desres::molfile;
-
-#include <sstream>
-#include <ios>
-#include <iomanip>
-#include <math.h>
-#include <errno.h>
-#include <stdexcept>
-#include <string>
-#include <map>
-#include <vector>
-#include <ios>
-#include <set>
-#include <iostream>
-#include <fstream>
-#include <algorithm>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "vmddir.h"
-#include "endianswap.h"
-
-static const char SERIALIZED_VERSION[] = "0006";
-const char * desres::molfile::dtr_serialized_version() {
-  return SERIALIZED_VERSION;
-}
-
-static bool badversion(const std::string& version) {
-    return version != SERIALIZED_VERSION;
-}
-
-#ifndef DESRES_WIN32
-static const char s_sep = '/';
-#include <sys/mman.h>
-
-#include <netinet/in.h> /* for htonl */
-#if defined(_AIX) || defined(ANDROID)
-#include <fcntl.h>
-#else
-#include <sys/fcntl.h>
-#endif
-
-#if defined(__sun)
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
-#else
-/// windows version
-
-#define M_PI (3.1415926535897932385)
-#define M_PI_2 (1.5707963267948966192)
-
-#ifndef S_ISREG
-#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
-#endif
-
-#ifndef S_ISDIR
-#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
-#endif
-
-#ifndef PRIu64
-#if _MSC_VER < 1400
-#define PRIu64 "ld"
-#else 
-#define PRIu64 "I64u"
-#endif
-#endif
-
-static const char s_sep = '\\';
-
-#endif
-
-static const uint32_t magic_timekey = 0x4445534b;
-static const uint32_t magic_frame   = 0x4445534d;
-static const uint32_t s_version     = 0x00000100;
-static const uint32_t s_irosetta    = 0x12345678;
-static const float    s_frosetta    = 1234.5;
-static const double   s_drosetta    = 1234.5e6;
-static const uint32_t s_lrosetta_lo = 0x89abcdef;
-static const uint32_t s_lrosetta_hi = 0x01234567;
-static const uint32_t s_blocksize   = 4096;
-static const uint32_t s_alignsize   = 8;
-
-namespace {
-
-  const double PEAKmassInAmu = 418.4;
-
-  double sfxp_ulp32flt(int32_t x) {
-    return ldexp(((double) x),-31);
-  }
-
-
-  uint64_t assemble64( uint32_t lo, uint32_t hi) {
-    uint64_t hi64 = hi; 
-    return (hi64 << 32) | lo; 
-  }
-  
-  double assembleDouble(uint32_t lo, uint32_t hi) {
-    union {
-      uint64_t ival;
-      double   dval;
-    } u;
-    u.ival = assemble64(lo,hi);
-    return u.dval;
-  }
-
-  /// definitions of binary representation of frameset files
-
-  typedef struct {
-    uint32_t magic;           //!< Magic number
-    uint32_t version;         //!< Version of creator
-    uint32_t framesize_lo;    //!< bytes in frame (low)
-    uint32_t framesize_hi;    //!< bytes in frame (high)
-  } required_header_t;
-
-  //! Header structure within file.
-  typedef struct {
-    required_header_t required; //!< 4 word mini-header
-
-    uint32_t size_header_block; //!< Size of this header
-    uint32_t unused0;         //!< not used in current implementation
-    uint32_t irosetta;        //!< 32-bit integer rosetta value.
-    float    frosetta;        //!< 32-bit float rosetta
-
-    uint32_t drosetta_lo;     //!< 64-bit float rosetta (low)
-    uint32_t drosetta_hi;     //!< 64-bit float rosetta (high)
-    uint32_t lrosetta_lo;     //!< 64-bit integer rosetta (low)
-    uint32_t lrosetta_hi;     //!< 64-bit integer rosetta (high)
-
-    uint32_t endianism;       //!< Endianism of writer machine.
-    uint32_t nlabels;         //!< Number of labeled fields.
-    uint32_t size_meta_block; //!< Number of bytes of meta information (padded)
-    uint32_t size_typename_block; //!< Number of bytes of typenames (padded)
-
-    uint32_t size_label_block; //!< Number of bytes to store label strings (padded)
-    uint32_t size_scalar_block; //!< Number of bytes of scalar storage (padded)
-    uint32_t size_field_block_lo; //!< Number of bytes of field storage (padded)
-    uint32_t size_field_block_hi; //!< Number of bytes of field storage (padded)
-
-    uint32_t size_crc_block;  //!< Size of the trailing CRC field (unused!)
-    uint32_t size_padding_block; //!< Number of ignored bytes to pad to pagesize boundary.
-    uint32_t unused1;         //!< Not used in current implementation.
-    uint32_t unused2;         //!< Not used in current implementation.
-
-  } header_t;
-
-  typedef struct {
-    uint32_t type;            //!< \brief Typecode for this type.
-    uint32_t elementsize;     //!< \brief Number of bytes in an element
-    uint32_t count_lo;        //!< \brief Number of elements (low)
-    uint32_t count_hi;        //!< \brief Number of elements (high)
-  } metadisk_t;
-
-  typedef struct key_prologue {
-    uint32_t magic;           /* Magic number for frames */
-    uint32_t frames_per_file; /* Number of frames in each file */
-    uint32_t key_record_size; /* The size of each key record */
-  } key_prologue_t;
-
-
-  //// utility routines
-
-  /*!
-   * Extracts the low 32 bits of a 64 bit integer by masking.
-   */
-  uint32_t lobytes(const uint64_t& x) {
-    uint32_t mask = 0xffffffff;
-    return x & mask;
-  }
-
-  /*!
-   * Extract the high 32 bits of a 64 bit integer by shifting.
-   */
-  uint32_t hibytes(const uint64_t& x) {
-    return x >> 32;
-  }
-
-  /*!
-   * Extract the low 32 bits of a 64 bit float as an integer.
-   */
-  uint32_t lobytes(const double& x) {
-    union {
-      uint64_t ival;
-      double   dval;
-    } u;
-    u.dval = x;
-    return lobytes(u.ival);
-  }
-
-  /*!
-   * Extract the high 32 bits of a 64 bit float as an integer.
-   */
-  uint32_t hibytes(const double& x) {
-    union {
-      uint64_t ival;
-      double   dval;
-    } u;
-    u.dval = x;
-    return hibytes(u.ival);
-  }
-
-  /*!
-   * The byte order associated with this machine.  We use
-   * 1234 for little endian, 4321 for big endian, and
-   * 3412 for the unlikely PDB endianism.
-   */
-  uint32_t machineEndianism() {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-    uint32_t byteorder = 1234;
-#else
-#if __BYTE_ORDER == __BIG_ENDIAN
-    uint32_t byteorder = 4321;
-#else
-#ifdef PDB_ENDIAN
-#if __BYTE_ORDER == __PDB_ENDIAN
-    uint32_t byteorder = 3412;
-#endif
-#endif
-#endif
-#endif
-    // If we get a compile error here, then __BYTE_ORDER
-    // has an unexpected value.
-    return byteorder;
-  }
-
-  uint64_t alignInteger( const uint64_t &x, unsigned border) {
-    return x + (border - x%border)%border;
-  }
-
-
-  /*!
-   * See RFC 1146 for Fletcher's Checksum (http://tools.ietf.org/html/rfc1146)
-   */
-  uint32_t fletcher( const uint16_t *data, size_t len ) {
-    uint32_t sum1 = 0xffff, sum2 = 0xffff;
- 
-    while (len) {
-      unsigned tlen = len > 360 ? 360 : len;
-      len -= tlen;
-      do {
-        sum1 += *data++;
-        sum2 += sum1;
-      } while (--tlen);
-      sum1 = (sum1 & 0xffff) + (sum1 >> 16);
-      sum2 = (sum2 & 0xffff) + (sum2 >> 16);
-    }
-    /* Second reduction step to reduce sums to 16 bits */
-    sum1 = (sum1 & 0xffff) + (sum1 >> 16);
-    sum2 = (sum2 & 0xffff) + (sum2 >> 16);
-    return sum2 << 16 | sum1;
-  }
-
-  bool isfile(const std::string &name) {
-    struct stat statbuf;
-    return (stat(name.c_str(),&statbuf) == 0 && S_ISREG(statbuf.st_mode));
-  }
-
-  /*!
-   * Remove a file or directory.  For directories,
-   * we recurse through subfiles and remove those
-   * before attempting the ::rmdir();
-   */
-  void recursivelyRemove(std::string path) {
-    struct stat statbuf;
-
-    // -----------------------------------------------
-    // Only try to unlink if the file exists
-    // We recurse through directories and unlink
-    // other files.
-    // -----------------------------------------------
-
-#ifdef DESRES_WIN32
-    // Use ::stat instead of ::lstat on windows since there are no symlinks
-    if (stat(path.c_str(),&statbuf) == 0) {
-#else
-    if (::lstat(path.c_str(),&statbuf) == 0) {
-#endif
-      if (!S_ISDIR(statbuf.st_mode)) {
-        if (::unlink(path.c_str()) != 0) {
-            throw std::runtime_error(strerror(errno));
-        }
-      } else {
-        VMDDIR* directory = NULL;
-        try {
-          directory = vmd_opendir(path.c_str());
-          if (directory) {
-            // Remove subfiles
-            char * entry;
-            while( (entry=vmd_readdir(directory)) != NULL ) {
-              // Don't unlink . or ..
-              if (entry[0] == '.') {
-                if (entry[1] == 0) continue;
-                if (entry[1] == '.' && entry[2] == 0) continue;
-              }
-              recursivelyRemove(path + s_sep + entry);
-            }
-            vmd_closedir(directory);
-            directory = NULL;
-
-            // Remove the actual directory
-            if (::rmdir(path.c_str()) != 0) {
-              throw std::runtime_error(strerror(errno));
-            }
-          }
-        } catch(...) {
-          if (directory) vmd_closedir(directory);
-          throw;
-        }
-      }
-    }
-  }
-
-
-  ////////
-  // CRC
-  ////////
-  
-  typedef uint32_t crc;
-  
-  #define POLYNOMIAL 0x04C11DB7
-  #define WIDTH  (8 * sizeof(crc))
-  #define TOPBIT (1 << (WIDTH - 1))
-  #define FINAL_XOR_VALUE 0xFFFFFFFF
-
-  crc processByte( crc remainder, char msg ) {
-        remainder ^= (msg << (WIDTH - 8));
-        for (uint8_t bit = 8; bit > 0; --bit)
-        {
-            if (remainder & TOPBIT) {
-                remainder = (remainder << 1) ^ POLYNOMIAL;
-            } else {
-                remainder = (remainder << 1);
-            }
-        }
-        return remainder;
-  }
-
-  crc processBytes(const char *message, int nBytes) {
-    crc  remainder = 0;	
-    for (int byte = 0; byte < nBytes; ++byte) {
-        remainder = processByte( remainder, message[byte] );
-    }
-    return remainder;
-  } 
-
-  int32_t cksum(const std::string &s) {
-    ssize_t len = s.size();
-    int32_t result = processBytes( s.c_str(), len );
-  
-    for ( ; len; len >>= 8) {
-      result = processByte( result, len & 0xff );
-    }
-    return result ^ FINAL_XOR_VALUE;
-  }
-
-}
-
-bool Timekeys::init(const std::string& path ) {
-    std::string timekeys_path = path;
-    timekeys_path += s_sep;
-    timekeys_path += "timekeys";
-    FILE * fd = fopen( timekeys_path.c_str(), "rb" );
-    if (!fd) {
-      fprintf(stderr, "Could not find timekeys file at %s\n", 
-          timekeys_path.c_str());
-      return false;
-    }
-  
-    /* check the magic number */
-    key_prologue_t prologue[1];
-    if (fread( prologue, sizeof(key_prologue_t), 1, fd )!=1) {
-      fprintf(stderr, "Failed to read key prologue from %s\n",
-          timekeys_path.c_str());
-      fclose(fd);
-      return false;
-    }
-    prologue->magic = htonl(prologue->magic);
-    if (prologue->magic != magic_timekey) {
-      fprintf(stderr, "timekeys magic number %x doesn't match %x\n",
-          prologue->magic, magic_timekey);
-      fclose(fd);
-      return false;
-    }
-  
-    /* get frames per file and key record size */
-    prologue->frames_per_file = ntohl( prologue->frames_per_file );
-    prologue->key_record_size = ntohl( prologue->key_record_size );
-    m_fpf = prologue->frames_per_file;
-  
-    /* read all key records */
-    fseek(fd, 0, SEEK_END);
-    off_t keyfile_size = ftello(fd);
-    size_t nframes = (keyfile_size-sizeof(key_prologue_t))/sizeof(key_record_t);
-  
-    keys.resize(nframes);
-    fseek(fd, sizeof(key_prologue_t), SEEK_SET);
-    if (fread(&keys[0], sizeof(key_record_t), nframes, fd)!=nframes) {
-      fprintf(stderr, "Failed to read all timekeys records: %s\n",
-          strerror(errno));
-      fclose(fd);
-      return false;
-    }
-    fclose(fd);
-  
-    /* Check that we didn't get zero-length frames; this would be a strong
-     * indicator of file corruption! */
-    int warning_count=0;
-    size_t i;
-    for (i=0; i<nframes; i++) {
-        if (keys[i].size()==0) {
-            if (++warning_count<10) {
-              fprintf(stderr, "dtrplugin -- WARNING: timekey %d of dtr %s reports 0-length frame; file corruption likely.\n", (int)i, path.c_str());
-            }
-            if (warning_count==10) {
-                fprintf(stderr, "dtrplugin -- WARNING: skipping remaining warnings in dtr %s\n", path.c_str());
-            }
-        }
-    }
-    if (warning_count) {
-        fprintf(stderr, "dtrplugin -- WARNING: found %d likely corrupt timekeys in %s\n",
-                warning_count, path.c_str());
-    }
-
-    m_size = m_fullsize = keys.size();
-    if (!keys.size()) return true;
-
-    m_first = keys[0].time();
-    m_framesize = keys[0].size();
-    if (keys.size()==1) {
-        m_interval=0;
-        keys.clear();
-        return true;
-    }
-    m_interval=keys[1].time()-keys[0].time();
-    for (i=1; i<keys.size(); i++) {
-        if (keys[i].size() == 0) {
-            /* ignore obviously corrupt frames */
-            continue;
-        }
-        /* constant frame size */
-        if (keys[i].size() != m_framesize) {
-            fprintf(stderr, "non-constant framesize at frame %zd\n", i);
-            printf("size %" PRIu64 " framesize %" PRIu64 "\n\n",
-                    keys[i].size(), m_framesize);
-            return true;
-        }
-        /* constant time interval */
-        if (fabs((keys[i].time()-keys[i-1].time())-m_interval) > 1e-3) {
-            if (getenv("DTRPLUGIN_VERBOSE")) fprintf(stderr, 
-                    "non-constant time interval at frame %zd\n", i);
-            return true;
-        }
-        /* constant offset */
-        if (keys[i].offset() != m_framesize*( i % m_fpf)) {
-            fprintf(stderr, "unexpected offset for frame %zd\n", i);
-            return true;
-        }
-    }
-    /* looks good!  Don't need the explicit key records anymore */
-    keys.clear();
-    return true;
-}
-
-key_record_t Timekeys::operator[](uint64_t i) const {
-    if (i>m_fullsize) throw std::runtime_error("frame index out of range");
-    if (keys.size()) return keys.at(i);
-
-    key_record_t timekey;
-#if defined(_MSC_VER)
-    double time = m_first + ((__int64) i)*m_interval;
-#else
-    double time = m_first + i*m_interval;
-#endif
-    uint64_t offset = (i % m_fpf) * m_framesize;
-
-    timekey.time_lo = htonl(lobytes(time));
-    timekey.time_hi = htonl(hibytes(time));
-    timekey.offset_lo = htonl(lobytes(offset));
-    timekey.offset_hi = htonl(hibytes(offset));
-    timekey.framesize_lo = htonl(lobytes(m_framesize));
-    timekey.framesize_hi = htonl(hibytes(m_framesize));
-    return timekey;
-}
-
-namespace {
-    template <typename T> 
-    void rawdump(std::ostream& out, const T& v) {
-        out.write((char *)&v, sizeof(v));
-    }
-
-    template <typename T> 
-    void rawload(std::istream& in, T& v) {
-        in.read((char *)&v, sizeof(v));
-    }
-}
-
-void Timekeys::dump(std::ostream& out) const {
-    rawdump(out, m_first);
-    rawdump(out, m_interval);
-    rawdump(out, m_framesize);
-    rawdump(out, m_size);
-    rawdump(out, m_fullsize);
-    rawdump(out, m_fpf);
-    rawdump(out, keys.size());
-    if (keys.size()) {
-        out.write((const char *)&keys[0], keys.size()*sizeof(keys[0]));
-    }
-}
-
-void Timekeys::load(std::istream& in) {
-    size_t sz;
-    rawload(in, m_first);
-    rawload(in, m_interval);
-    rawload(in, m_framesize);
-    rawload(in, m_size);
-    rawload(in, m_fullsize);
-    rawload(in, m_fpf);
-    rawload(in, sz);
-    if (sz) {
-        keys.resize(sz);
-        in.read((char *)&keys[0], keys.size()*sizeof(keys[0]));
-    }
-}
-
-namespace {
-  struct Blob {
-    std::string type;
-    uint64_t count;
-    const void *data;
-    bool byteswap;
-
-    Blob() : count(0), data(0) {}
-    Blob( const std::string &type_, uint64_t count_, const void *data_,
-          uint32_t frame_endianism )
-    : type(type_), count(count_), data(data_), byteswap(false) {
-      uint32_t my_endianism = machineEndianism();
-      if (frame_endianism != my_endianism) {
-        if ( (frame_endianism==1234 && my_endianism==4321) || 
-             (frame_endianism==4321 && my_endianism==1234) ) {
-          byteswap=true;
-        } else {
-          throw std::runtime_error("Unable to handle frame endianness");
-        }
-      }
-    }
-
-    std::string str() const {
-      if (type=="char" && count>0) {
-        const char *s=(const char *)data;
-        return std::string(s, s+count);
-      }
-      return "";
-    }
-    void get_float(float *buf) const {
-      if (type=="float") {
-        memcpy(buf, data, count*sizeof(float));
-      } else if (type=="double") {
-        const double *p = reinterpret_cast<const double *>(data);
-        for (uint64_t i=0; i<count; i++) buf[i] = p[i];
-      } else {
-        memset(buf, 0, count*sizeof(float));
-      }
-      if (byteswap) swap4_unaligned(buf, count);
-    }
-    void get_double(double *buf) const {
-      if (type=="double") {
-        memcpy(buf, data, count*sizeof(double));
-      } else if (type=="float") {
-        const float *p = reinterpret_cast<const float *>(data);
-        for (uint64_t i=0; i<count; i++) buf[i] = p[i];
-      } else {
-        memset(buf, 0, count*sizeof(double));
-      }
-      if (byteswap) swap8_unaligned(buf, count);
-    }
-    void get_int32(int32_t *buf) const {
-      if (type=="int32_t") {
-        memcpy(buf, data, count*sizeof(int32_t));
-      } else {
-        memset(buf, 0, count*sizeof(int32_t));
-      }
-      if (byteswap) swap4_unaligned(buf, count);
-    }
-    void get_uint32(uint32_t *buf) const {
-      if (type=="uint32_t") {
-        memcpy(buf, data, count*sizeof(uint32_t));
-      } else {
-        memset(buf, 0, count*sizeof(uint32_t));
-      }
-      if (byteswap) swap4_unaligned(buf, count);
-    }
-  };
-
-  typedef std::map<std::string, Blob> BlobMap;
-}
-
-static inline std::string addslash(const std::string& s){
-    return (s.rbegin()[0] == '/') ? s : s + "/";
-}
-
-#define DD_RELPATH_MAXLEN (9) 
-static std::string 
-DDreldir(const std::string& fname, int ndir1, int ndir2){
-
-    if( fname.find('/', 0) != std::string::npos ) {
-      fprintf(stderr, "DDreldir: filename '%s' must not contain '/'\n",
-          fname.c_str());
-      return "";
-    }
-
-    uint32_t hash = cksum(fname);
-
-    // uint32_t u1 = ndir1;
-    // uint32_t u2 = ndir2;
-    uint32_t d1, d2;
-    char answer[DD_RELPATH_MAXLEN];
-    if(ndir1 > 0){
-	d1 = hash%ndir1;
-	if(ndir2 > 0){
-	    d2 = (hash/ndir1)%ndir2;
-	    sprintf(answer, "%03x/%03x/", d1, d2);
-	}else{
-	    sprintf(answer, "%03x/", d1);
-	}
-    }else{
-	sprintf(answer, "./");
-    }
-    return std::string(answer);
-}
-
-namespace {
-  class DDException : public std::runtime_error{
-  public:
-      int eno;
-      DDException(const std::string &text, int _eno=0) 
-      : std::runtime_error(text + strerror(_eno)), eno(_eno){}
-  };
-}
-
-void DDmkdir(const std::string &dirpath, mode_t mode, int ndir1, int ndir2){
-    std::string dpslash(addslash(dirpath));
-
-    mode_t openmode = mode | 0300; // make sure we can write into the directory
-    if( mkdir(dpslash.c_str(), openmode) < 0 )
-	throw DDException("mkdir", errno);
-	
-    if( mkdir((dpslash + "not_hashed").c_str(), openmode) < 0 )
-        throw DDException("mkdir not_hashed subdirectory", errno);
-
-    FILE *fp = fopen((dpslash + "not_hashed/.ddparams").c_str(), "w");
-    if(fp == NULL)
-	throw DDException("fopen( .ddparams, \"w\" )", errno);
-    if( fprintf(fp, "%d %d\n", ndir1, ndir2) < 0 ){
-        fclose(fp);
-	throw DDException("fprintf(.ddparams ...)", errno);
-    }
-    if( fclose(fp) )
-	throw DDException("fclose(.ddparams)", errno);
-
-    for(int i=0; i<ndir1; ++i){
-	char sub[6];
-	sprintf(sub, "%03x/", i);
-	std::string dirsub = dpslash + sub;
-        {
-	    if( mkdir(dirsub.c_str(), openmode) < 0 )
-		throw DDException("mkdir " + dirsub, errno);
-	}
-	for(int j=0; j<ndir2; ++j){
-	    char subsub[6];
-	    sprintf(subsub, "%03x", j);
-	    std::string dirsubsub = dirsub + subsub;
-	    if( mkdir(dirsubsub.c_str(), mode) < 0 ) // NOT openmode!
-		throw DDException("mkdir " + dirsubsub, errno);
-	}
-        if( mode != openmode ){
-            // change the mode back to what the user requested now
-            // that we're done creating stuff...
-            if( chmod(dirsub.c_str(), mode) < 0 )
-                throw DDException("chmod " + dirsub, errno);
-        }
-    }
-    if( mode != openmode ){
-        // change the mode back to what the user requested now
-        // that we're done creating stuff...
-        if( chmod(dpslash.c_str(), mode) < 0 )
-            throw DDException("chmod " + dpslash, errno);
-        if( chmod((dpslash + "not_hashed").c_str(), mode) < 0 )
-          throw DDException("chmod " + dpslash + "not_hashed", errno);
-    }
-}
-
-
-static void 
-DDgetparams(const std::string& dirpath, int *ndir1, int *ndir2) {
-  // get ddparams, or assume (0,0) and let the frame file opens fail.
-  *ndir1 = *ndir2 = 0;
-  std::string dirslash(addslash(dirpath));
-  // New convention - .ddparams is in not_hashed/.
-  FILE *fp = fopen((dirslash + "not_hashed/.ddparams").c_str(), "r");
-  // Allow the old convention of placing .ddparams in the top-level.
-  if( fp == NULL && errno == ENOENT ) {
-      fp = fopen((dirslash + ".ddparams").c_str(), "r");
-  }
-  if(fp != NULL) {
-    if( fscanf(fp, "%d%d", ndir1, ndir2) != 2 ) 
-      fprintf(stderr, "Failed to parse .ddparams; assuming flat structure\n");
-    if( fclose(fp) ) {
-      fprintf(stderr, "Warning: Failed to close .ddparams file: %s\n",
-          strerror(errno));
-    }
-  }
-}
-
-static std::string framefile( const std::string &dtr,
-                              size_t frameno, 
-                              size_t frames_per_file,
-                              int ndir1,
-                              int ndir2) {
-  unsigned frame_file = frameno / frames_per_file;
-  std::ostringstream filename;
-  filename << "frame" << std::setfill('0') << std::setw(9)
-           << frame_file;
-  std::string fname = filename.str();
-
-  std::string fullpath(dtr);
-  fullpath += "/";
-  fullpath += DDreldir(fname, ndir1, ndir2);
-  fullpath += fname;
-  return fullpath;
-}
-
-static BlobMap read_frame( const void *mapping, uint64_t len ) {
-
-    const char *base = reinterpret_cast<const char *>(mapping);
-    const header_t *header = reinterpret_cast<const header_t*>(base);
-    if (len<sizeof(header_t)) 
-        throw std::runtime_error("Frame size is smaller than header_t");
-    if (ntohl(header->required.magic) != magic_frame) {
-        char buf[256];
-        sprintf(buf, "invalid magic number: expected %d, got %d\n",
-                magic_frame, ntohl(header->required.magic));
-        throw std::runtime_error(buf);
-    }
-
-    uint32_t size_header_block = ntohl(header->size_header_block);
-    uint32_t frames_endianism = ntohl(header->endianism);
-    uint32_t frames_nlabels = ntohl(header->nlabels);
-    uint32_t size_meta_block = ntohl(header->size_meta_block);
-    uint32_t size_typename_block = ntohl(header->size_typename_block);
-    uint32_t size_label_block = ntohl(header->size_label_block);
-    uint32_t size_scalar_block = ntohl(header->size_scalar_block);
-    uint32_t size_field_block_lo = ntohl(header->size_field_block_lo);
-    uint32_t size_field_block_hi = ntohl(header->size_field_block_hi);
-    uint64_t size_field_block = assemble64(size_field_block_lo,
-                                           size_field_block_hi);
-
-    uint64_t offset_header_block = 0;
-    uint64_t offset_meta_block = offset_header_block + size_header_block;
-    uint64_t offset_typename_block = offset_meta_block + size_meta_block;
-    uint64_t offset_label_block = offset_typename_block + size_typename_block;
-    uint64_t offset_scalar_block = offset_label_block + size_label_block;
-    uint64_t offset_field_block = offset_scalar_block + size_scalar_block;
-    uint64_t offset_crc_block = offset_field_block + size_field_block;
-
-    const metadisk_t* diskmeta  = reinterpret_cast<const metadisk_t*>(base+offset_meta_block);
-    const char* typenames = reinterpret_cast<const char*>(base+offset_typename_block);
-    const char* labels    = reinterpret_cast<const char*>(base+offset_label_block); 
-    const char* scalars   = reinterpret_cast<const char*>(base+offset_scalar_block);
-    const char* fields    = reinterpret_cast<const char*>(base+offset_field_block);
-    const uint32_t  * crc = reinterpret_cast<const uint32_t*>(base+offset_crc_block);
-    if (*crc != 0) {
-        uint32_t frame_crc = fletcher(reinterpret_cast<const uint16_t*>(base),offset_crc_block/2);
-        if (frame_crc != *crc) {
-            throw std::runtime_error("Checksum did not match");
-        }
-    }
-    /* More sanity checks */
-    if (len<offset_meta_block+size_meta_block)
-        throw std::runtime_error("Frame size cannot contain meta block");
-    if (len<offset_typename_block+size_typename_block)
-        throw std::runtime_error("F size cannot contain meta block");
-    if (len<offset_label_block+size_label_block)
-        throw std::runtime_error("F size cannot contain meta block");
-    if (len<offset_scalar_block+size_scalar_block)
-        throw std::runtime_error("F size cannot contain meta block");
-    if (len<offset_field_block+size_field_block)
-        throw std::runtime_error("Frame size cannot contain meta block");
-
-    std::vector<std::string> types;
-    while(*typenames) {
-      if (typenames >= labels) {
-        fprintf(stderr, "More typenames than labels!\n");
-        break;
-      }
-      std::string type(typenames);
-      types.push_back(type);
-      typenames += type.size()+1;
-    }
-
-    BlobMap blobs;
-
-    for (size_t ii=0; ii<frames_nlabels; ++ii) {
-      std::string label(labels);
-      labels += label.size()+1;
-      // Pull out the typecode, elementsize, and count
-      uint32_t code = ntohl(diskmeta[ii].type);
-      uint32_t elementsize = ntohl(diskmeta[ii].elementsize);
-      uint32_t count_lo = ntohl(diskmeta[ii].count_lo);
-      uint32_t count_hi = ntohl(diskmeta[ii].count_hi);
-      uint64_t count = assemble64(count_lo,count_hi);
-      uint64_t nbytes = elementsize*count;
-
-      const char *addr=0;
-      if (count <= 1) {
-        addr=scalars;
-        scalars += alignInteger(nbytes, s_alignsize);
-      } else {
-        addr=fields;
-        fields += alignInteger(nbytes, s_alignsize);
-      }
-      try {
-        blobs[label] = Blob( types.at(code), count, addr, frames_endianism );
-      }
-      catch (std::exception &e) {
-        fprintf(stderr, "Failed fetching '%s' data from frame\n", 
-            label.c_str());
-      }
-    }
-    return blobs;
-}
-
-static void *read_file( int fd, off_t offset, ssize_t &framesize ) {
-  if (fd<=0) {
-    fprintf(stderr, "read_file: bad file descriptor\n");
-    return NULL;
-  }
-  if (framesize==0) {
-    struct stat statbuf;
-    if (fstat(fd,&statbuf)!=0) {
-      fprintf(stderr, "Could not stat file: %s\n", strerror(errno));
-      return NULL;
-    }
-    framesize=statbuf.st_size-offset;
-  }
-
-  void *mapping = malloc(framesize);
-  if (lseek(fd, offset, SEEK_SET)!=offset) {
-      fprintf(stderr, "seek to specified offset failed: %s\n", strerror(errno));
-      free(mapping);
-      return NULL;
-  }
-
-  ssize_t rc = read(fd, mapping, framesize);
-  if (rc==0) {
-      free(mapping);
-      return NULL;
-  }
-  if (rc==-1) {
-      fprintf(stderr, "reading bytes from frame failed: %s\n", strerror(errno));
-      free(mapping);
-      return NULL;
-  }
-  if (rc != framesize) {
-      fprintf(stderr, "unexpected short read\n");
-      free(mapping);
-      return NULL;
-  }
-  return mapping;
-}
-
-uint64_t key_record_t::size() const {
-  return assemble64(ntohl(framesize_lo), ntohl(framesize_hi));
-}
-uint64_t key_record_t::offset() const {
-  return assemble64(ntohl(offset_lo), ntohl(offset_hi));
-}
-double key_record_t::time() const {
-  return assembleDouble(ntohl(time_lo), ntohl(time_hi));
-}
-
-static metadata_t * read_meta( const std::string& metafile, unsigned natoms,
-                               bool with_invmass ) {
-
-  metadata_t * meta = NULL;
-  int meta_fd = open(metafile.c_str(), O_RDONLY|O_BINARY);
-  ssize_t framesize=0;
-  void *meta_mapping = read_file( meta_fd, 0, framesize );
-  if (meta_mapping==NULL) {
-    close(meta_fd);
-    return meta;
-  }
-  BlobMap meta_blobs;
-  try {
-      meta_blobs = read_frame( meta_mapping, framesize );
-  }
-  catch (std::exception &e) {
-      fprintf(stderr, "Reading metadata failed: %s\n", e.what());
-      free(meta_mapping);
-      close(meta_fd);
-      return meta;
-  }
-  meta = new metadata_t;
-
-  if (with_invmass && meta_blobs.find("INVMASS")!=meta_blobs.end()) {
-    Blob blob=meta_blobs["INVMASS"];
-    if (blob.count != natoms) {
-      fprintf(stderr, "bad rmass count %d != %d\n", (int)blob.count, (int)natoms);
-    } else {
-      meta->invmass.resize(natoms);
-      blob.get_float(&meta->invmass[0]);
-    }
-  }
-  free(meta_mapping);
-  close(meta_fd);
-  return meta;
-}
-
-bool StkReader::recognizes(const std::string &path) {
-      return path.size()>4 && 
-             path.substr(path.size()-4)==".stk" &&
-             isfile(path);
-}
-
-StkReader::StkReader(DtrReader *reader) {
-  dtr=reader->path();
-  framesets.push_back(reader);
-  curframeset=0;
-}
-
-bool StkReader::init(const std::string &path, int * changed) {
-  curframeset=0;
-  dtr=path;
-
-  if (changed) *changed = 0;
-  /* process all the lines in the stk file */
-  std::vector<std::string> fnames;
-  std::ifstream input(path.c_str());
-  if (!input) {
-      fprintf(stderr, "Cannot open '%s' for reading\n", path.c_str());
-      return false;
-  }
-  std::string fname;
-  /* instantiate all the dtr readers */
-  while (std::getline(input, fname)) {
-      fnames.push_back(fname);
-  }
-  if (!fnames.size()) {
-      fprintf(stderr, "Empty stk file\n");
-      return false;
-  }
-  if (framesets.size()) {
-      /* reloading an stk.  Find the dtrs that match the ones we already have,
-       * and discard the rest */
-      unsigned i=0; /* i will become the index of the last dtr that we've
-                       already loaded */
-      for (; i<fnames.size(); i++) {
-          if (i==framesets.size() || fnames[i]!=framesets[i]->path()) break;
-          if (getenv("DTRPLUGIN_VERBOSE")) 
-              fprintf(stderr, "StkReader: Reusing dtr at %s\n", 
-                      fnames[i].c_str());
-      }
-      /* delete any remaining framesets */
-      for (unsigned j=i; j<framesets.size(); j++) delete framesets[j];
-      framesets.erase(framesets.begin()+i, framesets.end());
-
-      /* delete the filenames we've already loaded */
-      fnames.erase(fnames.begin(), fnames.begin()+i);
-
-      /* The set of overlapping frames may have changed!  Restore the keys
-       * to their full, non-overlapping glory.  */
-      for (i=0; i<framesets.size(); i++) {
-          DtrReader * r = framesets[i];
-          r->keys.restore_full_size();
-      }
-  }
-  
-  /* instantiate dtr readers */
-  for (unsigned i=0; i<fnames.size(); i++) {
-      DtrReader *reader = new DtrReader;
-      if (getenv("DTRPLUGIN_VERBOSE"))
-        fprintf(stderr, "StkReader: Loading timekeys from dtr at %s\n", 
-                fnames[i].c_str());
-      if (i>0) {
-        const DtrReader * first = framesets[0];
-        /* reuse information from earlier readers */
-        reader->natoms = first->natoms;
-        reader->with_velocity = first->with_velocity;
-        reader->set_meta(first->get_meta());
-      }
-      if (!reader->init(fnames[i], NULL)) {
-          delete reader;
-          fprintf(stderr, "Failed opening frameset at %s\n", fnames[i].c_str());
-          return false;
-      }
-      if (changed) *changed += 1;
-      framesets.push_back(reader);
-      if (i==0) this->with_velocity = reader->with_velocity;
-  }
-
-  natoms=framesets[0]->natoms;
-
-  // now remove overlaps
-  while (!framesets.back()->size()) {
-      delete framesets.back();
-      framesets.pop_back();
-  }
-  if (framesets.size()) {
-    double first=framesets.back()->keys[0].time();
-    size_t i=framesets.size()-1;
-    while (i--) {
-        /* find out how many frames to keep in frameset[i] */
-        Timekeys& cur = framesets[i]->keys;
-        size_t n = cur.size();
-        while (n && cur[n-1].time() >= first) --n;
-        cur.truncate( n );
-        if (cur.size()) {
-          double c0t = cur[0].time();
-          first = (first < c0t) ? first : c0t;
-        }
-    }
-  }
-  return true;
-}
-
-ssize_t StkReader::size() const {
-  ssize_t result=0;
-  for (size_t i=0; i<framesets.size(); i++) 
-    result += framesets[i]->keys.size();
-  return result;
-}
-
-int StkReader::next(molfile_timestep_t *ts) {
-  int rc=MOLFILE_EOF;
-  while (curframeset < framesets.size() && 
-         (rc=framesets[curframeset]->next(ts))==MOLFILE_EOF) {
-    ++curframeset;
-  }
-  return rc;
-}
-
-const DtrReader * StkReader::component(ssize_t &n) const {
-  for (size_t i=0; i<framesets.size(); i++) {
-    ssize_t size = framesets[i]->size();
-    if (n < size) return framesets[i];
-    n -= size;
-  }
-  return NULL;
-}
-
-int StkReader::frame(ssize_t n, molfile_timestep_t *ts) const {
-  const DtrReader *comp = component(n);
-  if (!comp) return MOLFILE_EOF;
-  return comp->frame(n, ts);
-}
-
-StkReader::~StkReader() {
-  for (size_t i=0; i<framesets.size(); i++) 
-    delete framesets[i];
-}
-
-std::string DtrReader::framefile(ssize_t n) const {
-  return ::framefile( dtr, n, framesperfile(), ndir1(), ndir2() );
-}
-
-bool DtrReader::init(const std::string &path, int * changed) {
-  dtr = path;
-  /* Read the timekeys file */
-  if (!keys.init(path)) return false;
-
-  bool with_momentum = false;
-  // read the first frame to see how many atoms there are, and whether 
-  // there are any velocities.
-  // Do this only if n_atoms isn't already set
-  if (keys.size()>0 && natoms==0) {
-    if (getenv("DTRPLUGIN_VERBOSE")) {
-      fprintf(stderr, "reading first frame to get atom count\n");
-    }
-    std::string fname=::framefile(dtr, 0, keys.framesperfile(), 
-            ndir1(), ndir2());
-    int fd = open(fname.c_str(), O_RDONLY|O_BINARY);
-    ssize_t framesize=0;
-    unsigned i;
-    void *mapping = read_file( fd, 0, framesize );
-    if (mapping==NULL)  {
-      fprintf(stderr, "Failed to find frame at %s\n", fname.c_str());
-      close(fd);
-      return false;
-    }
-    BlobMap blobs;
-    try {
-        blobs = read_frame(mapping, framesize);
-    }
-    catch (std::exception &e) {
-        fprintf(stderr, "Warning: reading first frame failed, %s", e.what());
-    }
-    with_momentum = blobs.find("MOMENTUM")!=blobs.end();
-
-    // I'm aware of three possible sources of positions: 
-    //  "POSN" (the original frameset format)
-    //  "POSITION" (the wrapped frameset formats)
-    //  "POS" (anton trajectories)
-    const char *posnames[] = { "POSN", "POSITION", "POS" };
-    for (i=0; i<3; i++) {
-      if (blobs.find(posnames[i])!=blobs.end()) {
-        natoms = blobs[posnames[i]].count / 3;
-        break;
-      }
-    }
-    // similar for velocities
-    const char *velnames[] = { "MOMENTUM", "VELOCITY" };
-    for (i=0; i<2; i++) {
-      if (blobs.find(velnames[i])!=blobs.end()) {
-        with_velocity=true;
-        break;
-      }
-    }
-    free(mapping);
-    close(fd);
-  }
-
-  if (natoms>0 && meta==NULL && owns_meta==false) {
-    meta=read_meta( dtr + s_sep + "metadata",natoms, with_momentum );
-    owns_meta = true;
-  }
-
-  /* we always reread the timekeys */
-  if (changed) *changed = 1;
-  return true;
-
-}
-
-ssize_t DtrReader::times(ssize_t start, ssize_t count, double *t) const {
-    ssize_t remaining = keys.size()-start;
-    count = (count < remaining) ? count : remaining;
-    for (ssize_t j=0; j<count; j++) {
-        t[j]=keys[start++].time();
-    }
-    return count;
-}
-
-ssize_t StkReader::times(ssize_t start, ssize_t count, double *t) const {
-    ssize_t nread=0;
-    size_t i=0,n=framesets.size();
-    if (start<0) return 0;
-    if (count<=0) return 0;
-    /* Find the first frameset containing frames in the desired range */
-    /* FIXME: could do this using a binary search... */
-    for (; i<n; i++) {
-        ssize_t sz = framesets[i]->size();
-        if (start<sz) break;
-        start -= sz;
-    }
-    /* Read times from framesets until count times are read. */
-    for (; i<n; i++) {
-        ssize_t sz = framesets[i]->times(start, count, t+nread);
-        nread += sz;
-        count -= sz;
-        start=0;
-        if (!count) break;
-    }
-    return nread;
-}
-
-static double dotprod(const double *x, const double *y) {
-  return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
-}
-
-static void read_homebox( const double *box,
-                          molfile_timestep_t *ts ) {
-
-  ts->A = ts->B = ts->C = 0;
-
-  double A[3] = { box[0], box[3], box[6] };
-  double B[3] = { box[1], box[4], box[7] };
-  double C[3] = { box[2], box[5], box[8] };
-
-  // store lengths
-  ts->A = sqrt(dotprod(A,A));
-  ts->B = sqrt(dotprod(B,B));
-  ts->C = sqrt(dotprod(C,C));
-
-  if (ts->A == 0 || ts->B == 0 || ts->C == 0) {
-
-    ts->alpha = ts->beta = ts->gamma = 90;
-
-  } else {
-
-    // compute angles
-    double cosAB = dotprod(A,B)/(ts->A * ts->B);
-    double cosAC = dotprod(A,C)/(ts->A * ts->C);
-    double cosBC = dotprod(B,C)/(ts->B * ts->C);
-
-    // clamp
-    if (cosAB > 1.0) cosAB = 1.0; else if (cosAB < -1.0) cosAB = -1.0;
-    if (cosAC > 1.0) cosAC = 1.0; else if (cosAC < -1.0) cosAC = -1.0;
-    if (cosBC > 1.0) cosBC = 1.0; else if (cosBC < -1.0) cosBC = -1.0;
-
-    // convert to angles using asin to avoid nasty rounding when we are
-    // close to 90 degree angles.
-    ts->alpha = 90.0 - asin(cosBC) * 90.0 / M_PI_2; /* cosBC */
-    ts->beta  = 90.0 - asin(cosAC) * 90.0 / M_PI_2; /* cosAC */
-    ts->gamma = 90.0 - asin(cosAB) * 90.0 / M_PI_2; /* cosAB */
-  }
-}
-
-void write_homebox( const molfile_timestep_t * ts,
-                    float * box ) {
-
-  double A[3], B[3], C[3];
-
-  // Convert VMD's unit cell information
-  double cosBC = sin( ((90 - ts->alpha ) / 180) * M_PI );
-  double cosAC = sin( ((90 - ts->beta  ) / 180) * M_PI );
-  double cosAB = sin( ((90 - ts->gamma ) / 180) * M_PI );
-  double sinAB = cos( ((90 - ts->gamma ) / 180) * M_PI );
-
-  double Ax = ts->A;
-  double Ay = 0;
-  double Az = 0;
-  double Bx = ts->B * cosAB;
-  double By = ts->B * sinAB;
-  double Bz = 0;
-  double Cx,Cy,Cz;
-  if (sinAB != 0) {
-    Cx = cosAC;
-    Cy = (cosBC - cosAC*cosAB) / sinAB;
-    Cz = sqrt(1-Cx*Cx-Cy*Cy);
-    Cx *= ts->C;
-    Cy *= ts->C;
-    Cz *= ts->C;
-  } else {
-    Cx=Cy=Cz=0;
-  }
-  A[0] = Ax; A[1] = Ay; A[2] = Az;
-  B[0] = Bx; B[1] = By; B[2] = Bz;
-  C[0] = Cx; C[1] = Cy; C[2] = Cz;
-
-  // put vectors in column of homebox
-  box[0] = A[0]; box[3] = A[1]; box[6] = A[2];
-  box[1] = B[0]; box[4] = B[1]; box[7] = B[2];
-  box[2] = C[0]; box[5] = C[1]; box[8] = C[2];
-}
-
-static int handle_wrapped_v2(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    molfile_timestep_t *ts ) {
-
-  // just read POSITION in either single or double precision
-  if (blobs.find("POSITION")==blobs.end()) {
-    fprintf(stderr, "ERROR, Missing POSITION field in frame\n");
-    return MOLFILE_ERROR;
-  }
-  Blob pos=blobs["POSITION"];
-  if (pos.count != 3*natoms) {
-    fprintf(stderr, "ERROR, Expected %d elements in POSITION; got %" PRIu64 "\n",
-        3*natoms, pos.count);
-    return MOLFILE_ERROR;
-  }
-  pos.get_float(ts->coords);
-
-  if (with_velocity && ts->velocities && blobs.find("VELOCITY")!=blobs.end()) {
-    Blob vel=blobs["VELOCITY"];
-    if (vel.count != 3*natoms) {
-      fprintf(stderr, "ERROR, Expected %d elements in VELOCITY; got %" PRIu64 "\n",
-          3*natoms, vel.count);
-      return MOLFILE_ERROR;
-    }
-    vel.get_float(ts->velocities);
-  }
-
-  if (blobs.find("UNITCELL")!=blobs.end()) {
-    double box[9];
-    blobs["UNITCELL"].get_double(box);
-    read_homebox( box, ts );
-  }
-
-#if defined(DESRES_READ_TIMESTEP2)
-  if (blobs.find("ENERGY")!=blobs.end()) {
-      blobs["ENERGY"].get_double(&ts->total_energy);
-  }
-
-  if (blobs.find("POT_ENERGY")!=blobs.end()) {
-      blobs["POT_ENERGY"].get_double(&ts->potential_energy);
-  }
-
-  if (blobs.find("KIN_ENERGY")!=blobs.end()) {
-      blobs["KIN_ENERGY"].get_double(&ts->kinetic_energy);
-  }
-
-  if (blobs.find("EX_ENERGY")!=blobs.end()) {
-      blobs["EX_ENERGY"].get_double(&ts->extended_energy);
-  }
-
-  if (blobs.find("PRESSURE")!=blobs.end()) {
-      blobs["PRESSURE"].get_double(&ts->pressure);
-  }
-
-  if (blobs.find("TEMPERATURE")!=blobs.end()) {
-      blobs["TEMPERATURE"].get_double(&ts->temperature);
-  }
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-namespace {
-
-  inline void
-  compute_center(int partition,
-                 int nx, int ny, int nz,
-                 float b0, float b1, float b2,
-                 float b3, float b4, float b5,
-                 float b6, float b7, float b8,
-                 float* cx, float* cy, float* cz) {
-    double nu, nv, nw, mu, mv, mw;
-    double xc, yc, zc;
-
-    // -----------------------------------------------
-    // Map the partition number to its "mesh" position
-    // (see define_mesh_collective in topology.c)
-    // -----------------------------------------------
-    int hmx = partition;
-    int hmy  = hmx / nx;     /* y = y + ny*( z + nz*r ) */
-    int hmz  = hmy / ny;     /* z = z + nz*r */
-    hmx -= hmy * nx;         /* x = x */
-    hmy -= hmz * ny;         /* y = y */
-
-    nu = (double)nx;
-    nv = (double)ny;
-    nw = (double)nz;
-
-    // -----------------------------------------------
-    // Code adapted from configure_global_cell in
-    // topology.c
-    // -----------------------------------------------
-    mu = -0.5*(nu-1) + (double)hmx;
-    mv = -0.5*(nv-1) + (double)hmy;
-    mw = -0.5*(nw-1) + (double)hmz;
-
-    // We used to do FORCE_PRECISION(xc,float) here, but that
-    // seems unnecessary in the context of trajectory writing.
-    xc = b0*mu + b1*mv + b2*mw; 
-    yc = b3*mu + b4*mv + b5*mw; 
-    zc = b6*mu + b7*mv + b8*mw; 
-
-    *cx = xc;
-    *cy = yc;
-    *cz = zc;
-  }
-
-  inline int 
-  posn_momentum_v_1(int32_t nx, int32_t ny, int32_t nz,
-                    uint64_t nparticles,
-                    const double  * home_box,
-                    const uint32_t* gid,
-                    const uint32_t* npp,
-                    const float   * rm, // reciprocal mass
-                    const float* posn, const float* momentum,
-                    /* returns */
-                    float *position, float *velocity, double *box) {
-
-    // bounding box is a straight multiple of the home box
-    if (box) {
-      box[0] = home_box[0]*nx;
-      box[1] = home_box[1]*ny;
-      box[2] = home_box[2]*nz;
-        
-      box[3] = home_box[3]*nx;
-      box[4] = home_box[4]*ny;
-      box[5] = home_box[5]*nz;
-
-      box[6] = home_box[6]*nx;
-      box[7] = home_box[7]*ny;
-      box[8] = home_box[8]*nz;
-    }
-
-
-    int partition = 0;
-    int remaining = 0;
-    float cx = 0;
-    float cy = 0;
-    float cz = 0;
-    float ux = home_box[0];
-    float vx = home_box[1];
-    float wx = home_box[2];
-    float uy = home_box[3];
-    float vy = home_box[4];
-    float wy = home_box[5];
-    float uz = home_box[6];
-    float vz = home_box[7];
-    float wz = home_box[8];
-
-    for(uint64_t i=0; i<nparticles; ++i) {
-      if (remaining == 0) {
-        do {
-          remaining = npp[partition];
-          ++partition;
-        } while (!remaining); // skip empty partitions
-          compute_center(partition-1, nx,ny,nz, ux,vx,wx, uy,vy,wy, uz,vz,wz,
-                        &cx,&cy,&cz);
-      }
-      uint32_t id = gid[i];
-      if (id >= nparticles) {
-        fprintf(stderr, "non-contiguous particles\n");
-        return MOLFILE_ERROR;
-      }
-
-      if (posn) {
-        float x = posn[3*i+0];
-        float y = posn[3*i+1];
-        float z = posn[3*i+2];
-
-        position[3*id+0] = ux*x + vx*y + wx*z + cx;
-        position[3*id+1] = uy*x + vy*y + wy*z + cy;
-        position[3*id+2] = uz*x + vz*y + wz*z + cz;
-      }
-
-      if (velocity && momentum && rm) {
-        velocity[3*id+0] = momentum[3*i+0]*rm[id];
-        velocity[3*id+1] = momentum[3*i+1]*rm[id];
-        velocity[3*id+2] = momentum[3*i+2]*rm[id];
-      } else if (velocity) {
-        velocity[3*id+0] = 0.0;
-        velocity[3*id+1] = 0.0;
-        velocity[3*id+2] = 0.0;
-      }
-      --remaining;
-    }
-    return MOLFILE_SUCCESS;
-  }
-}
-
-static int handle_posn_momentum_v1(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    const float * rmass,
-    molfile_timestep_t *ts ) {
-
-  int32_t nx, ny, nz;
-  double home_box[9], box[9];
-  blobs["HOME_BOX"].get_double(home_box);
-  blobs["NX"].get_int32(&nx);
-  blobs["NY"].get_int32(&ny);
-  blobs["NZ"].get_int32(&nz);
-  
-  std::vector<uint32_t> gid, npp;
-  std::vector<float> pos, mtm;
-  Blob gidblob=blobs["GID"];
-  Blob nppblob=blobs["NPP"];
-  Blob posblob=blobs["POSN"];
-  Blob mtmblob=blobs["MOMENTUM"];
-
-  if (gidblob.count != natoms) {
-    fprintf(stderr, "Missing GID field\n");
-    return MOLFILE_ERROR;
-  }
-  if (posblob.count != 3*natoms) {
-    fprintf(stderr, "Missing POSN field\n");
-    return MOLFILE_ERROR;
-  }
-  gid.resize(gidblob.count);
-  npp.resize(nppblob.count);
-  pos.resize(posblob.count);
-  mtm.resize(mtmblob.count);
-
-  gidblob.get_uint32(&gid[0]);
-  nppblob.get_uint32(&npp[0]);
-  posblob.get_float(&pos[0]);
-
-  if (rmass && with_velocity) mtmblob.get_float(&mtm[0]);
-
-  posn_momentum_v_1( nx, ny, nz, natoms, home_box, 
-                     &gid[0], &npp[0], rmass,
-                     &pos[0],
-                     &mtm[0],
-                     ts->coords,
-                     ts->velocities,
-                     box );
-
-  read_homebox( box, ts );
-  return MOLFILE_SUCCESS;
-}
-
-static int handle_wrapped_v1(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    molfile_timestep_t *ts ) {
-
-  {
-    // homebox
-    double home_box[9], box[9];
-    int32_t nx, ny, nz;
-    blobs["HOME_BOX"].get_double(home_box);
-    blobs["NX"].get_int32(&nx);
-    blobs["NY"].get_int32(&ny);
-    blobs["NZ"].get_int32(&nz);
-    box[0] = home_box[0]*nx;
-    box[1] = home_box[1]*ny;
-    box[2] = home_box[2]*nz;
-      
-    box[3] = home_box[3]*nx;
-    box[4] = home_box[4]*ny;
-    box[5] = home_box[5]*nz;
- 
-    box[6] = home_box[6]*nx;
-    box[7] = home_box[7]*ny;
-    box[8] = home_box[8]*nz;
-    read_homebox( box, ts );
-  }
-
-  Blob posblob=blobs["POSN"];
-  Blob velblob=blobs["VELOCITY"];
-
-  // get positions
-  if (posblob.count != 3*natoms) {
-    fprintf(stderr, "Missing POSN field\n");
-    return MOLFILE_ERROR;
-  }
-  posblob.get_float(ts->coords);
-  
-  // if required, get velocities
-  if (ts->velocities && velblob.count > 0) {
-    if (velblob.count != 3*natoms) {
-      fprintf(stderr, "VELOCITY field has %" PRIu64 " values; expected %d\n",
-          velblob.count, 3*natoms);
-      return MOLFILE_ERROR;
-    }
-    velblob.get_float(ts->velocities);
-  }
-  return MOLFILE_SUCCESS;
-}
-
-static int handle_anton_sfxp_v3(
-    BlobMap &blobs,
-    uint32_t natoms,
-    bool with_velocity, 
-    const float * rmass,
-    molfile_timestep_t *ts ) {
-
-  if (!rmass) {
-    fprintf(stderr, "Cannot read anton_sfxp_v3 frame without rmass\n");
-    return MOLFILE_ERROR;
-  }
-
-  double positionScale=0, momentumScale=0;
-  // position scale...
-  {
-    Blob blob = blobs["POSITIONSCALE"];
-    if (blob.count != 1) {
-      fprintf(stderr, "Missing POSITIONSCALE field\n");
-      return MOLFILE_ERROR;
-    }
-    blob.get_double(&positionScale);
-  }
-  // momentum scale
-  if (ts->velocities) {
-    Blob blob = blobs["MOMENTUMSCALE"];
-    if (blob.count != 1) {
-      fprintf(stderr, "Missing MOMENTUMSCALE field\n");
-      return MOLFILE_ERROR;
-    }
-    blob.get_double(&momentumScale);
-    momentumScale *= PEAKmassInAmu;
-  }
-
-  // box
-  {
-    double box[9] = { 0,0,0, 0,0,0, 0,0,0 };
-    uint32_t anton_box[3];
-    Blob boxblob = blobs["BOX"];
-    if (boxblob.count != 3) {
-      fprintf(stderr, "Missing BOX field\n");
-      return MOLFILE_ERROR;
-    }
-    boxblob.get_uint32(anton_box);
-    box[0] = sfxp_ulp32flt(anton_box[0])*positionScale;
-    box[4] = sfxp_ulp32flt(anton_box[1])*positionScale;
-    box[8] = sfxp_ulp32flt(anton_box[2])*positionScale;
-    read_homebox( box, ts );
-  }
-
-  // velocities
-  std::vector<int32_t> vel;
-  if (ts->velocities) {
-    Blob velblob = blobs["MOMENTUM"];
-    if (velblob.count != 3*natoms) {
-      fprintf(stderr, "Missing MOMENTUM field\n");
-      return MOLFILE_ERROR;
-    }
-    vel.resize(3*natoms);
-    velblob.get_int32(&vel[0]);
-  }
-
-  // positions
-  std::vector<int32_t> pos(3*natoms);
-  {
-    Blob posblob = blobs["POS"];
-    if (posblob.count != 3*natoms) {
-      fprintf(stderr, "Missing POS field\n");
-      return MOLFILE_ERROR;
-    }
-    posblob.get_int32(&pos[0]);
-  }
-  // convert and read into supplied storage
-  for (unsigned i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = sfxp_ulp32flt(pos[3*i+0])*positionScale;
-    ts->coords[3*i+1] = sfxp_ulp32flt(pos[3*i+1])*positionScale;
-    ts->coords[3*i+2] = sfxp_ulp32flt(pos[3*i+2])*positionScale;
-    if (ts->velocities) {
-      const double rm = rmass[i] * momentumScale; // includes PEAKmassInAmu
-      ts->velocities[3*i  ] = (float)(rm * sfxp_ulp32flt(vel[3*i  ]));
-      ts->velocities[3*i+1] = (float)(rm * sfxp_ulp32flt(vel[3*i+1]));
-      ts->velocities[3*i+2] = (float)(rm * sfxp_ulp32flt(vel[3*i+2]));
-    }
-  }
-  return MOLFILE_SUCCESS;
-}
-
-int DtrReader::next(molfile_timestep_t *ts) {
-
-  if (eof()) return MOLFILE_EOF;
-  if (!ts) {
-    ++m_curframe;
-    return MOLFILE_SUCCESS;
-  }
-  ssize_t iframe = m_curframe;
-  ++m_curframe;
-  return frame(iframe, ts);
-}
-
-int DtrReader::ndir1() const {
-  if (m_ndir1<0) DDgetparams(dtr, &m_ndir1, &m_ndir2);
-  return m_ndir1;
-}
-
-int DtrReader::ndir2() const {
-  if (m_ndir2<0) DDgetparams(dtr, &m_ndir1, &m_ndir2);
-  return m_ndir2;
-}
-
-int DtrReader::frame(ssize_t iframe, molfile_timestep_t *ts) const {
-  int rc = MOLFILE_SUCCESS;
-  {
-    off_t offset=0;
-    ssize_t framesize=0;
-    if (framesperfile() != 1) {
-      offset = assemble64( ntohl(keys[iframe].offset_lo), 
-                           ntohl(keys[iframe].offset_hi) );
-      framesize = assemble64( ntohl(keys[iframe].framesize_lo), 
-                              ntohl(keys[iframe].framesize_hi) );
-
-    }
-    ts->physical_time = keys[iframe].time();
-    std::string fname=::framefile(dtr, iframe, framesperfile(), ndir1(), ndir2());
-    int fd = open(fname.c_str(), O_RDONLY|O_BINARY);
-    if (fd<0) return MOLFILE_EOF;
-    void *mapping = read_file( fd, offset, framesize );
-    if (mapping==NULL) {
-      close(fd);
-      return MOLFILE_EOF;
-    }
-
-    rc = frame_from_bytes( mapping, framesize, ts );
-
-    free(mapping);
-    close(fd);
-  }
-  return rc;
-}
-
-int DtrReader::frame_from_bytes(const void *buf, uint64_t len, 
-                                molfile_timestep_t *ts) const {
-
-  BlobMap blobs;
-  try {
-      blobs = read_frame(buf, len);
-  }
-  catch (std::exception &e) {
-      fprintf(stderr, "Reading frame failed: %s\n", e.what());
-      return MOLFILE_ERROR;
-  }
-
-  const float * rmass = meta && meta->invmass.size() ? 
-      &meta->invmass[0] : NULL;
-
-  // Now, dispatch to routines based on format
-  std::string format = blobs["FORMAT"].str();
-  if (format=="WRAPPED_V_2" || format == "DBL_WRAPPED_V_2") {
-    return handle_wrapped_v2(blobs, natoms, with_velocity, ts);
-
-  } else if (format=="POSN_MOMENTUM_V_1" || format=="DBL_POSN_MOMENTUM_V_1") {
-    return handle_posn_momentum_v1(blobs, natoms, with_velocity, rmass, ts);
-
-  } else if (format=="WRAPPED_V_1" || format == "DBL_WRAPPED_V_1") {
-    return handle_wrapped_v1(blobs, natoms, with_velocity, ts);
-
-  } else if (format=="ANTON_SFXP_V3") {
-    return handle_anton_sfxp_v3(blobs, natoms, with_velocity, rmass, ts);
-  }
-  fprintf(stderr, "ERROR, can't handle format %s\n", format.c_str());
-  return MOLFILE_ERROR;
-}
-
-
-namespace {
-  struct meta_t {
-    std::string label;
-    std::string typecode;
-    uint32_t elementsize;
-    uint64_t count;
-    const char *bytes;
-    meta_t() {}
-    meta_t(const std::string &l, const std::string &t, uint32_t e, uint32_t c,
-           const void *b)
-    : label(l), typecode(t), elementsize(e), count(c), 
-    bytes(reinterpret_cast<const char *>(b)) {}
-  };
-  typedef std::vector<meta_t> MetaList;
-
-  uint64_t typename_size(const MetaList &meta) {
-    // just the set of distinct types
-    uint64_t sz=0;
-    typedef std::set<std::string> Typemap;
-    Typemap types;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      types.insert(m->typecode);
-    for (Typemap::const_iterator s=types.begin(); s!=types.end();++s)
-      sz += s->size() + 1;
-    sz += 1;
-    return alignInteger(sz, s_alignsize);
-  }
-
-  uint64_t label_size(const MetaList &meta) {
-    uint64_t sz=0;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      sz += m->label.size() + 1;
-    sz += 1;
-    return alignInteger(sz, s_alignsize);
-  }
-
-  uint64_t scalar_size(const MetaList &meta) {
-    uint64_t sz=0;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      if (m->count <= 1) 
-        sz += alignInteger( m->elementsize * m->count, s_alignsize );
-    return sz;
-  }
-  uint64_t field_size(const MetaList &meta) {
-    uint64_t sz=0;
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m)
-      if (m->count > 1) 
-        sz += alignInteger( m->elementsize * m->count, s_alignsize );
-    return sz;
-  }
-
-  void construct_frame( const std::vector<meta_t>& meta, 
-                        std::vector<char>& bytes ) {
-    uint64_t offset_header_block = 0;
-    uint64_t size_header_block =
-      alignInteger( sizeof(header_t), s_alignsize );
-
-    uint64_t offset_meta_block = offset_header_block + size_header_block;
-    uint64_t size_meta_block = 
-      alignInteger( meta.size()*sizeof(metadisk_t), s_alignsize );
-
-    uint64_t offset_typename_block = offset_meta_block + size_meta_block;
-    uint64_t size_typename_block = typename_size(meta);
-
-    uint64_t offset_label_block = offset_typename_block + size_typename_block;
-    uint64_t size_label_block = label_size(meta);
-
-    uint64_t offset_scalar_block = offset_label_block + size_label_block;
-    uint64_t size_scalar_block = scalar_size(meta);
-
-    uint64_t offset_field_block = offset_scalar_block + size_scalar_block;
-    uint64_t size_field_block = field_size(meta);
-
-    uint64_t offset_crc_block = offset_field_block + size_field_block;
-    uint64_t size_crc_block = sizeof(uint32_t);
-
-    uint64_t offset_padding_block = offset_crc_block + size_crc_block;
-    uint64_t size_padding_block = 
-      alignInteger(offset_padding_block,s_blocksize) - offset_padding_block;
-
-    uint64_t framesize = offset_padding_block + size_padding_block;
-
-    // construct the frame
-    bytes.resize(framesize);
-    char * base = &bytes[0];
-    memset( base, 0, framesize );
-
-    header_t *header = reinterpret_cast<header_t*>(base+offset_header_block);
-    metadisk_t* diskmeta  = reinterpret_cast<metadisk_t*>(base+offset_meta_block);
-    char*       typenames = reinterpret_cast<char*>(base+offset_typename_block);
-    char*       labels    = reinterpret_cast<char*>(base+offset_label_block);
-    char*       scalars   = reinterpret_cast<char*>(base+offset_scalar_block);
-    char*       fields    = reinterpret_cast<char*>(base+offset_field_block);
-    uint32_t*   crc       = reinterpret_cast<uint32_t*>(base+offset_crc_block);
-    //char*       padding   = reinterpret_cast<char*>(base+offset_padding_block);
-
-    /*** header ***/
-    memset(header,0,sizeof(header_t));
-    header->required.magic = htonl(magic_frame);
-    header->required.version = htonl(s_version);
-
-    header->required.framesize_lo = htonl(lobytes(framesize));
-    header->required.framesize_hi = htonl(hibytes(framesize));
-
-    header->size_header_block = htonl(size_header_block);
-    header->unused0 = 0;
-    uint64_t lrosetta = assemble64(s_lrosetta_lo,s_lrosetta_hi);
-    header->irosetta = s_irosetta;
-    header->frosetta = s_frosetta;
-
-    header->drosetta_lo = lobytes(s_drosetta);
-    header->drosetta_hi = hibytes(s_drosetta);
-    header->lrosetta_lo = lobytes(lrosetta);
-    header->lrosetta_hi = hibytes(lrosetta);
-
-    header->endianism = htonl(machineEndianism());
-    header->nlabels = htonl(meta.size());
-    header->size_meta_block = htonl(size_meta_block);
-    header->size_typename_block = htonl(size_typename_block);
-
-    header->size_label_block = htonl(size_label_block);
-    header->size_scalar_block = htonl(size_scalar_block);
-    header->size_field_block_lo = htonl(lobytes(size_field_block));
-    header->size_field_block_hi = htonl(hibytes(size_field_block));
-
-    header->size_crc_block = htonl(size_crc_block);
-    header->size_padding_block = htonl(size_padding_block);
-    header->unused1 = 0;
-    header->unused2 = 0;
-
-    std::map<std::string,unsigned> typemap;
-
-    for (MetaList::const_iterator m=meta.begin(); m!=meta.end(); ++m) {
-
-      if (typemap.find(m->typecode)==typemap.end()) {
-        unsigned code=typemap.size();
-        typemap[m->typecode]=code;
-        typenames=std::copy(m->typecode.begin(), m->typecode.end(), typenames);
-        *typenames++ = 0;
-      }
-
-      diskmeta->type = htonl( typemap[m->typecode] );
-      diskmeta->elementsize = htonl( m->elementsize );
-      diskmeta->count_lo = htonl( lobytes( m->count ));
-      diskmeta->count_hi = htonl( hibytes( m->count ));
-      diskmeta++;
-
-      labels=std::copy(m->label.begin(), m->label.end(), labels);
-      *labels++ = 0;
-
-      uint64_t nbytes = m->count*m->elementsize;
-      if (m->count <= 1) {
-        memcpy( scalars, m->bytes, nbytes );
-        scalars += alignInteger( nbytes, s_alignsize );
-      } else {
-        memcpy( fields, m->bytes, nbytes );
-        fields += alignInteger( nbytes, s_alignsize );
-      }
-    }
-    *crc = fletcher(reinterpret_cast<uint16_t*>(base),offset_crc_block/2);
-  }
-}
-
-void write_all( int fd, const char * buf, ssize_t count ) {
-    while (count) {
-        ssize_t n = ::write(fd, buf, count);
-        if (n<0) {
-            if (errno==EINTR) continue;
-            throw std::runtime_error(strerror(errno));
-        }
-        buf += n;
-        count -= n;
-    }
-}
-
-bool DtrWriter::init(const std::string &path) {
-
-  dtr=path;
-  try {
-    m_directory=path;
-    char cwd[4096];
-
-    while(m_directory.size() > 0 && m_directory[m_directory.size()-1] == s_sep) {
-      m_directory.erase(m_directory.size()-1);
-    }
-
-    if ( m_directory[0] != s_sep) {
-      if (! ::getcwd(cwd,sizeof(cwd))) {
-        throw std::runtime_error(strerror(errno));
-      }
-      m_directory = std::string(cwd) + s_sep + m_directory;
-    }
-
-    recursivelyRemove(m_directory);
-    ::DDmkdir(m_directory,0777,0, 0);
-
-    // craft an empty metadata frame
-    std::vector<meta_t> meta;
-    std::vector<char> bytes;
-    construct_frame( meta, bytes );
-
-    {
-      std::string metadata_file = m_directory + s_sep + "metadata";
-      FILE *fd = fopen(metadata_file.c_str(), "wb");
-      fwrite( &bytes[0], bytes.size(), 1, fd );
-      fclose(fd);
-    }
-
-    // start writing timekeys file */
-    std::string timekeys_path = dtr + s_sep + "timekeys";
-    timekeys_file = fopen( timekeys_path.c_str(), "wb" );
-    if (!timekeys_file) {
-      fprintf(stderr, "Opening timekeys failed: %s\n", strerror(errno));
-      return false;
-    } else {
-      key_prologue_t prologue[1];
-      prologue->magic = htonl(magic_timekey);
-      prologue->frames_per_file = htonl(frames_per_file);
-      prologue->key_record_size = htonl(sizeof(key_record_t));
-      fwrite( prologue, sizeof(key_prologue_t), 1, timekeys_file );
-    }
-  }
-  catch (std::exception &e) {
-    fprintf(stderr, "%s\n", e.what());
-    return false;
-  }
-  return true;
-}
-
-int DtrWriter::next(const molfile_timestep_t *ts) {
-
-  try {
-    static const char *format = "WRAPPED_V_2";
-    static const char *title = "written by VMD";
-    float box[9];
-    write_homebox( ts, box );
-
-    double time = ts->physical_time;
-
-    /* require increasing times (DESRESCode#1053) */
-    if (last_time != HUGE_VAL && time <= last_time) {
-      fprintf(stderr, 
-          "dtrplugin: framesets require increasing times. previous %e, current %e\n", 
-          last_time, time);
-      return MOLFILE_ERROR;
-    }
-
-    std::vector<meta_t> meta;
-    meta.push_back( 
-        meta_t( "FORMAT", "char", sizeof(char), strlen(format), format ));
-    meta.push_back( 
-        meta_t( "TITLE", "char", sizeof(char), strlen(title), title ));
-    meta.push_back( 
-        meta_t( "CHEMICAL_TIME", "double", sizeof(double), 1, &time));
-    meta.push_back( 
-        meta_t( "UNITCELL", "float", sizeof(float), 9, box ));
-    meta.push_back( 
-        meta_t( "POSITION", "float", sizeof(float), 3*natoms, ts->coords ));
-    if (ts->velocities) meta.push_back(
-        meta_t( "VELOCITY", "float", sizeof(float), 3*natoms, ts->velocities ));
-#if defined(DESRES_READ_TIMESTEP2)
-    meta.push_back(
-        meta_t( "ENERGY", "double", sizeof(double), 1, &ts->total_energy ));
-    meta.push_back(
-        meta_t( "POT_ENERGY", "double", sizeof(double), 1, &ts->potential_energy ));
-    meta.push_back(
-        meta_t( "KIN_ENERGY", "double", sizeof(double), 1, &ts->kinetic_energy ));
-    meta.push_back(
-        meta_t( "EX_ENERGY", "double", sizeof(double), 1, &ts->extended_energy ));
-    meta.push_back(
-        meta_t( "TEMPERATURE", "double", sizeof(double), 1, &ts->temperature));
-    meta.push_back(
-        meta_t( "PRESSURE", "double", sizeof(double), 1, &ts->pressure));
-#endif
-
-    std::vector<char> base;
-    construct_frame(meta, base);
-    uint64_t framesize = base.size();
-    uint64_t keys_in_file = nwritten % frames_per_file;
-
-    if (!keys_in_file) {
-      if (frame_fd>0) ::close(frame_fd);
-
-      framefile_offset = 0;
-      std::string filepath=framefile(dtr, nwritten, frames_per_file, 0, 0);
-      frame_fd = open(filepath.c_str(),O_WRONLY|O_CREAT|O_BINARY,0666);
-      if (frame_fd<0) throw std::runtime_error(strerror(errno));
-    }
-
-    // write the data to disk
-    write_all( frame_fd, &base[0], framesize );
-
-    // add an entry to the keyfile list
-    key_record_t timekey;
-    timekey.time_lo = htonl(lobytes(time));
-    timekey.time_hi = htonl(hibytes(time));
-    timekey.offset_lo = htonl(lobytes(framefile_offset));
-    timekey.offset_hi = htonl(hibytes(framefile_offset));
-    timekey.framesize_lo = htonl(lobytes(framesize));
-    timekey.framesize_hi = htonl(hibytes(framesize));
-
-    if (fwrite(&timekey, sizeof(timekey), 1, timekeys_file)!=1) {
-      fprintf(stderr, "Writing timekey failed\n");
-      return MOLFILE_ERROR;
-    }
-
-#if defined(_MSC_VER) || defined(__MINGW32__)
-    _commit(frame_fd);
-#else
-    fsync(frame_fd);
-#endif
-    fflush(timekeys_file);
-#if defined(_MSC_VER) || defined(__MINGW32__)
-    _commit(fileno(timekeys_file));
-#else
-    fsync(fileno(timekeys_file));
-#endif
-
-    ++nwritten;
-    framefile_offset += framesize;
-  } 
-  catch (std::exception &e) {
-    fprintf(stderr, "Write failed: %s\n",e.what());
-    return MOLFILE_ERROR;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-DtrWriter::~DtrWriter() {
-  if (frame_fd>0) ::close(frame_fd);
-  if (timekeys_file) fclose(timekeys_file);
-}
-
-/* compressed form: first write a -1 to indicate the new format.  Then
- * write number of ranges n, followed by (start, count) pairs. */
-std::ostream& operator<<(std::ostream& out, const metadata_t& meta) {
-    out << meta.invmass.size() << ' ';
-    if (meta.invmass.size()) {
-        out.write( (const char *)&meta.invmass[0], meta.invmass.size()*sizeof(meta.invmass[0]));
-    }
-    return out;
-}
-
-std::istream& operator>>(std::istream& in, metadata_t& meta) {
-    uint32_t sz;
-    char c;
-    in >> sz;
-    in.get(c);
-    meta.invmass.resize(sz);
-    if (sz) {
-        in.read((char *)&meta.invmass[0], sz*sizeof(meta.invmass[0]));
-    }
-    return in;
-}
-
-std::ostream& DtrReader::dump(std::ostream &out) const {
-  bool has_meta = meta!=NULL;
-  out << SERIALIZED_VERSION << ' '
-      << dtr << ' '
-      << natoms << ' '
-      << with_velocity << ' '
-      << owns_meta << ' '
-      << has_meta << ' ';
-  if (owns_meta && has_meta) {
-      out << *meta;
-  }
-  /* write raw m_ndir values so that we don't read them from .ddparams
-   * if they haven't been read yet */
-  out << m_ndir1 << ' '
-      << m_ndir2 << ' ';
-  keys.dump(out);
-  return out;
-}
-std::istream& DtrReader::load(std::istream &in) {
-  char c;
-  bool has_meta;
-  std::string version;
-  in >> version;
-  if (badversion(version)) {
-    fprintf(stderr, "Bad version string\n");
-    in.setstate( std::ios::failbit );
-    return in;
-  }
-  in >> dtr
-     >> natoms
-     >> with_velocity
-     >> owns_meta
-     >> has_meta;
-  if (owns_meta && has_meta) {
-    delete meta;
-    meta = new metadata_t;
-    in.get(c);
-    in >> *meta;
-  }
-  in >> m_ndir1
-     >> m_ndir2;
-  in.get(c);
-  keys.load(in);
-  return in;
-}
-
-std::ostream& StkReader::dump(std::ostream &out) const {
-  out << dtr << ' '
-      << framesets.size() << ' ';
-  for (size_t i=0; i<framesets.size(); i++) framesets[i]->dump(out);
-  return out;
-}
-
-std::istream& StkReader::load(std::istream &in) {
-  in >> dtr;
-  size_t size; in >> size; framesets.resize(size);
-  char c; in.get(c);
-  with_velocity=false;
-  for (size_t i=0; i<framesets.size(); i++) {
-    delete framesets[i];
-    framesets[i] = new DtrReader;
-    framesets[i]->load(in);
-    if (i>0) framesets[i]->set_meta(framesets[0]->get_meta());
-    if (i==0) with_velocity=framesets[i]->with_velocity;
-  }
-  if (framesets.size()) natoms=framesets[0]->natoms;
-  return in;
-}
-
-///////////////////////////////////////////////////////////////////
-//
-// Plugin Interface
-//
-// ////////////////////////////////////////////////////////////////
-
-static void *
-open_file_read( const char *filename, const char *filetype, int *natoms ) {
-
-  FrameSetReader *h = NULL;
-  std::string fname;
-
-  // check for .stk file
-  if (StkReader::recognizes(filename)) {
-    h = new StkReader;
-
-  } else {
-    h = new DtrReader;
-    // check for "clickme.dtr"
-    fname=filename;
-    std::string::size_type pos = fname.rfind( "clickme.dtr" );
-    if (pos != std::string::npos) {
-      fname.resize(pos);
-      filename = fname.c_str();
-    }
-  }
-
-  if (!h->init(filename)) {
-    delete h;
-    return NULL;
-  }
-  *natoms = h->natoms;
-  return h;
-}
-
-static int 
-read_timestep_metadata(void *v, molfile_timestep_metadata *m) {
-  FrameSetReader* handle = reinterpret_cast<FrameSetReader*>(v);
-  m->has_velocities = handle->has_velocities();
-  m->count = handle->size();
-  return MOLFILE_SUCCESS;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  return h->next(ts);
-}
-
-#if defined(DESRES_READ_TIMESTEP2)
-static int read_timestep2(void *v, ssize_t n, molfile_timestep_t *ts) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  return h->frame(n, ts);
-}
-
-static molfile_ssize_t read_times(void *v, 
-                                  molfile_ssize_t start, 
-                                  molfile_ssize_t count,
-                                  double * times) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  return h->times(start, count, times);
-}
-#endif
-
-static void close_file_read( void *v ) {
-  FrameSetReader *h = reinterpret_cast<FrameSetReader *>(v);
-  delete h;
-}
-
-static void *open_file_write(const char *path, const char *type, int natoms) {
-  DtrWriter *h = new DtrWriter(natoms);
-  if (!h->init(path)) {
-    delete h;
-    h=NULL;
-  }
-  return h;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  DtrWriter *h = reinterpret_cast<DtrWriter *>(v);
-  return h->next(ts);
-}
-
-static void close_file_write( void * v ) {
-  DtrWriter *h = reinterpret_cast<DtrWriter *>(v);
-  delete h;
-}
-
-
-static molfile_plugin_t desmond;
-
-VMDPLUGIN_API int VMDPLUGIN_init (void) {
-  /* Plugin for desmond trajectory files */
-  ::memset(&desmond,0,sizeof(desmond));
-  desmond.abiversion = vmdplugin_ABIVERSION;
-  desmond.type = MOLFILE_PLUGIN_TYPE;
-  desmond.name = "dtr";
-  desmond.prettyname = "DESRES Trajectory";
-  desmond.author = "D.E. Shaw Research";
-  desmond.majorv = 4;
-  desmond.minorv = 1;
-  desmond.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-
-  desmond.filename_extension = "dtr,dtr/,stk,atr,atr/";
-  desmond.open_file_read = open_file_read;
-  desmond.read_timestep_metadata = read_timestep_metadata;
-  desmond.read_next_timestep = read_next_timestep;
-#if defined(DESRES_READ_TIMESTEP2)
-  desmond.read_timestep2 = read_timestep2;
-  desmond.read_times = read_times;
-#endif
-  desmond.close_file_read = close_file_read;
-
-  desmond.open_file_write = open_file_write;
-  desmond.write_timestep = write_timestep;
-  desmond.close_file_write = close_file_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  cb(v,reinterpret_cast<vmdplugin_t*>(&desmond));
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#if defined(TEST_DTRPLUGIN)
-
-int main(int argc, char *argv[]) {
-
-  /* check input arguments */
-  if (argc != 3) {
-    fprintf(stderr, "Usage: %s input.dtr output.dtr\n", argv[0]);
-    return 1;
-  }
-  int natoms;
-  
-  /* read in all frames */
-  void *handle = open_file_read( argv[1], "dtr", &natoms);
-  printf("got %d atoms\n", natoms);
-  molfile_timestep_t ts[1];
-  std::vector<float> timesteps;
-  do {
-    timesteps.resize( timesteps.size()+3*natoms );
-    ts->coords = &timesteps[ timesteps.size() - 3*natoms ];
-    ts->velocities = NULL;
-  } while (read_next_timestep(handle, natoms, ts)==MOLFILE_SUCCESS);
-  int nframes = timesteps.size()/(3*natoms) - 1;
-
-  printf("read %d steps\n", nframes );
-  close_file_read(handle);
-
-  /* write out all frames */
-  handle = open_file_write( argv[2], "dtr", natoms);
-  if (!handle) return 1;
-  ts->coords = &timesteps[0];
-  for (int i=0; i<nframes; i++) {
-    if (write_timestep( handle, ts )!=MOLFILE_SUCCESS) {
-      fprintf(stderr, "failed to write timestep %d/%d\n", i+1, nframes);
-      return 1;
-    }
-    ts->coords += 3*natoms;
-  }
-  printf("wrote %d steps\n", nframes);
-  close_file_write(handle);
-
-  /* now try to read it back in */
-  int new_natoms;
-  handle = open_file_read( argv[2], "dtr", &new_natoms);
-  if (handle) return 1;
-  if (new_natoms != natoms) {
-    fprintf(stderr, "number of atoms changed: %d -> %d\n", natoms, new_natoms);
-    return 1;
-  }
-  close_file_read(handle);
-  return 0;
-}
-
-#endif
-
-#if defined(TEST_DTR_DUMP)
-int main(int argc, char *argv[]) {
-
-  StkReader src, dst;
-  src.init(argv[1]);
-
-  std::ostringstream out;
-  src.dump(out);
-  assert(out);
-
-  std::istringstream in(out.str());
-  dst.load(in);
-  assert(in);
-
-  return 0;
-}
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dtrplugin.hxx b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dtrplugin.hxx
deleted file mode 100644
index 87820cc199a23ae8a3fb21e6f90968e636d391ba..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dtrplugin.hxx
+++ /dev/null
@@ -1,342 +0,0 @@
-//
-// Version info for VMD plugin tree:
-//   $Id: dtrplugin.hxx,v 1.5 2016/11/06 19:16:52 johns Exp $
-//
-// Version info for last sync with D. E. Shaw Research:
-//  //depot/desrad/main/sw/libs/molfile/plugins/dtrplugin.hxx#13
-//
-
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#ifndef MOLFILE_DTRPLUGIN_HXX
-#define MOLFILE_DTRPLUGIN_HXX
-
-#if defined(_MSC_VER)
-#ifndef DESRES_WIN32
-#define DESRES_WIN32
-#endif
-#endif
-
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#ifdef DESRES_WIN32
-#include <io.h>
-#include <direct.h>
-#include <fcntl.h>
-#include <windows.h>
-
-typedef int int32_t;
-typedef unsigned char uint8_t;
-typedef unsigned int uint32_t;
-#if 1
-typedef unsigned __int64 uint64_t;    // This also works with MVSC6
-#else
-typedef unsigned long long uint64_t;
-#endif
-typedef unsigned short uint16_t;
-#if !defined(__MINGW32__)
-typedef unsigned int ssize_t;
-typedef int mode_t;
-#endif
-#define mkdir(a,b) _mkdir(a)
-#define rmdir(a)   _rmdir(a)
-#define ftello(a)  ftell(a)
-#else
-#define O_BINARY 0
-#include <inttypes.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
-
-#include <molfile_plugin.h>
-
-#include <vector>
-#include <string>
-#include <stdexcept>
-
-
-namespace desres { namespace molfile {
-  
-  const char * dtr_serialized_version();
-
-  struct key_record_t {
-    uint32_t time_lo;       /* Time associated with this file (low bytes). */
-    uint32_t time_hi;       /* Time associated with this file (high bytes). */
-    uint32_t offset_lo;     /* Zero in the 1 frame/file case (low bytes) */
-    uint32_t offset_hi;     /* Zero in the 1 frame/file case (high bytes) */
-    uint32_t framesize_lo;  /* Number of bytes in frame (low bytes) */
-    uint32_t framesize_hi;  /* Number of bytes in frame (high bytes) */
-
-    double time() const;
-    uint64_t offset() const;
-    uint64_t size() const;
-
-  };
-
-  class Timekeys {
-
-      double    m_first;        /* last time in the key list */
-      double    m_interval;     /* representative time interval between keys */
-      uint64_t  m_framesize;    /* size of all frames */
-      size_t    m_size;         /* number of non-overlapping frames */
-      size_t    m_fullsize;     /* total number of frames */
-      uint32_t  m_fpf;          /* frames per file */
-
-      /* storage for keys until compressed, or if not compressible */
-      std::vector<key_record_t> keys;
-
-    public:
-      Timekeys() 
-      : m_first(0), m_interval(0), m_framesize(0), 
-        m_size(0), m_fullsize(0), m_fpf(0) {}
-
-      bool init( const std::string& path );
-
-      uint32_t framesperfile() const { return m_fpf; }
-
-      bool is_compact() const { return keys.size()==0; }
-
-      size_t size() const { return m_size; }
-      size_t full_size() const { return m_fullsize; }
-
-      void truncate( size_t nframes ) { m_size = nframes; }
-
-      void restore_full_size() { m_size = m_fullsize; }
-
-      key_record_t operator[](uint64_t i) const;
-
-      void dump( std::ostream& out ) const;
-      void load( std::istream& in  );
-  };
-
-  class DtrReader;
-
-  class FrameSetReader {
-  protected:
-    std::string dtr;
-
-  public:
-    uint32_t natoms;
-    bool with_velocity;
-
-    FrameSetReader()
-    : natoms(0), with_velocity(false)
-    {}
-
-    virtual ~FrameSetReader() {}
-
-    bool has_velocities() const { return with_velocity; }
-
-    const std::string &path() const { return dtr; }
-
-    // initialize all members from frameset at given path.  Return success.
-    // If changed is provided, set to true/false if timekeys were/were not
-    // reloaded.
-    virtual bool init(const std::string &path, int * changed = NULL) = 0;
-
-    // number of frames
-    virtual ssize_t size() const = 0;
-
-    // read the next frame.  If ts is NULL, skip it.  If there are no more
-    // frames to read, return MOLFILE_EOF.  Otherwise, fill in coordinates
-    // in ts->coords, velocities in ts->velocities if ts->velocities is 
-    // non-NULL, and return MOLFILE_SUCCESS if all goes well.
-    virtual int next(molfile_timestep_t *ts) = 0;
-
-    // Get the DtrReader component corresponding to frame n.  Change
-    // n to the local index within the returned dtr.
-    virtual const DtrReader * component(ssize_t &n) const = 0;
-
-    // number of framesets
-    virtual ssize_t nframesets() const = 0;
-
-    // nth frameset 
-    virtual const DtrReader * frameset(ssize_t n) const = 0;
-
-    // read a specified frame.
-    virtual int frame(ssize_t n, molfile_timestep_t *ts) const = 0;
-
-    // read up to count times beginning at index start into the provided space;
-    // return the number of times actually read.
-    virtual ssize_t times(ssize_t start, ssize_t count, double * times) const = 0;
-
-    virtual std::ostream& dump(std::ostream &out) const = 0;
-    virtual std::istream& load(std::istream &in) = 0;
-  };
-
-  struct metadata_t {
-      std::vector<float>    invmass;
-  };
-
-  class DtrReader : public FrameSetReader {
-    mutable int m_ndir1;
-    mutable int m_ndir2;
-    ssize_t m_curframe;
-
-    metadata_t * meta;
-    bool owns_meta;
-
-    bool eof() const { return m_curframe >= (ssize_t)keys.size(); }
-
-  public:
-    DtrReader() 
-    : m_ndir1(-1), m_ndir2(-1), m_curframe(0),
-      meta(NULL), owns_meta(false) {}
-
-    virtual ~DtrReader() {
-      set_meta(NULL);
-    }
-
-    Timekeys keys;
-
-    // lazy-loaded DDparams
-    int ndir1() const;
-    int ndir2() const;
-
-    /* meta and owns_meta are initially set to NULL and false.  In init(), 
-     * if meta is NULL and owns_meta is false, we try to read the meta 
-     * from the metadata frame (an expensive operation), in which case 
-     * owns_meta becomes true, whether or not meta was actually read.
-     * Otherwise, we leave those values alone.  In the destructor, we delete 
-     * meta if we own it.  The StkReader class can share the meta between 
-     * DtrReader instances in the following way: if the meta it has to share
-     * is NULL, it should set owns_meta to true in the DtrReader instances,
-     * so that the DtrReaders don't keep searching for their own meta.  If
-     * the meta it has to share is non-NULL, it should set owns_meta to 
-     * false so that the meta pointer doesn't get double-freed.
-     */
-    metadata_t * get_meta() const { return meta; }
-    void set_meta(metadata_t * ptr) {
-      if (meta && owns_meta) delete meta;
-      if (ptr) {
-        meta = ptr;
-        owns_meta = false;
-      } else {
-        meta = NULL;
-        owns_meta = true;
-      }
-    }
-
-    ssize_t curframe() const { return m_curframe; }
-
-    uint32_t framesperfile() const { return keys.framesperfile(); }
-
-    virtual bool init(const std::string &path, int * changed=NULL);
-    virtual ssize_t size() const { return keys.size(); }
-    virtual ssize_t times(ssize_t start, ssize_t count, double * times) const;
-
-    virtual int next(molfile_timestep_t *ts);
-
-    virtual const DtrReader * component(ssize_t &n) const {
-      return this;
-    }
-
-    virtual ssize_t nframesets() const { return 1; }
-    virtual const DtrReader * frameset(ssize_t n) const {
-        if (n!=0) throw std::runtime_error("bad index");
-        return this;
-    }
-
-    virtual int frame(ssize_t n, molfile_timestep_t *ts) const;
-
-
-    // path for frame at index.  Empty string on not found.
-    std::string framefile(ssize_t n) const;
-
-    // read a frame from supplied bytes
-    int frame_from_bytes( const void *buf, uint64_t len,
-                          molfile_timestep_t *ts ) const;
-
-    std::ostream& dump(std::ostream &out) const;
-    std::istream& load(std::istream &in);
-  };
-
-  struct DtrWriter {
-    std::string dtr;
-    std::string m_directory;
-    const uint32_t natoms;
-    int frame_fd;        // for writing
-    uint32_t frames_per_file;
-    uint64_t framefile_offset;
-    uint64_t nwritten;
-    double last_time;
-    FILE * timekeys_file;
-
-    explicit DtrWriter(uint32_t natoms_) 
-    : natoms(natoms_), frame_fd(0), frames_per_file(256), framefile_offset(0),
-      nwritten(0), last_time(HUGE_VAL), timekeys_file(NULL)
-    {}
-
-    ~DtrWriter();
-
-    // initialize for writing at path
-    bool init(const std::string &path);
-
-    // write another frame.  Return MOLFILE_SUCCESS or MOLFILE_ERROR.
-    int next(const molfile_timestep_t *ts);
-  };
-
-  class StkReader : public FrameSetReader {
-    std::vector<DtrReader*> framesets;
-    size_t curframeset;
-
-  public:
-    StkReader() : curframeset(0) {}
-    StkReader(DtrReader *reader);
-    ~StkReader();
-    virtual bool init(const std::string &path, int * changed=NULL);
-    virtual ssize_t size() const;
-    virtual ssize_t times(ssize_t start, ssize_t count, double * times) const;
-    virtual int next(molfile_timestep_t *ts);
-    virtual int frame(ssize_t n, molfile_timestep_t *ts) const;
-    virtual const DtrReader * component(ssize_t &n) const;
-
-    virtual ssize_t nframesets() const { return framesets.size(); }
-    virtual const DtrReader * frameset(ssize_t n) const {
-        return framesets.at(n);
-    }
-
-    static bool recognizes(const std::string &path);
-
-    std::ostream& dump(std::ostream &out) const;
-    std::istream& load(std::istream &in);
-  };
-} }
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dxplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dxplugin.C
deleted file mode 100644
index 0eb9bfc1e598e86adb809d345420a88730b498fd..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/dxplugin.C
+++ /dev/null
@@ -1,486 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: dxplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.43 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-/* 
- * DX potential maps
- *
- * Format of the file is:
- * # Comments
- * .
- * .
- * .
- * object 1 class gridpositions counts xn yn zn
- * origin xorg yorg zorg
- * delta xdel 0 0
- * delta 0 ydel 0
- * delta 0 0 zdel
- * object 2 class gridconnections counts xn yn zn
- * object 3 class array type double rank 0 items { xn*yn*zn } [binary] data follows
- * f1 f2 f3
- * f4 f5 f6 f7 f8 f9
- * .
- * .
- * .
- * object "Dataset name" class field
- 
- * Where xn, yn, and zn are the number of data points along each axis;
- * xorg, yorg, and zorg is the origin of the grid, assumed to be in angstroms;
- * xdel, ydel, and zdel are the scaling factors to convert grid units to
- * angstroms.
- *
- * Grid data follows, with a single or multiple values per line (maximum 
- * allowed linelength is hardcoded into the plugin with ~2000 chars), 
- * ordered z fast, y medium, and x slow.
- *
- * Note that the ordering of grid data in VMD's VolumetricData class
- * is transposed, i.e. x changes fastest and z slowest! 
- * The file reading and writing routines perform the transpose.
- *
- * If the optional keyword 'binary' is present, the data is expected to
- * be in binary, native endian, single precision IEEE-754 floating point format.
- *
- * Note: this plugin was written to read the OpenDX files created by the
- * APBS program, and thus supports only files that are writting in this style.
- * the full OpenDX data format is extremely powerful, complex, and flexible.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-#include "largefiles.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define LINESIZE 2040
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-  int isBinary; 
-} dx_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *dxgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Unexpected end-of-file.\n");
-    return NULL;
-  } else if (ferror(stream)) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static void *open_dx_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  dx_t *dx;
-  char inbuf[LINESIZE];
-  int xsize, ysize, zsize;
-  float orig[3], xdelta[3], ydelta[3], zdelta[3];
-  int isBinary = 0;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* skip comments */
-  do {
-    if (dxgets(inbuf, LINESIZE, fd) == NULL) 
-      return NULL;
-  } while (inbuf[0] == '#');
-
-  /* get the number of grid points */
-  if (sscanf(inbuf, "object 1 class gridpositions counts %d %d %d", &xsize, &ysize, &zsize) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading grid dimensions.\n");
-    return NULL;
-  }
-
-  /* get the cell origin */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "origin %e %e %e", orig, orig+1, orig+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading grid origin.\n");
-    return NULL;
-  }
-
-  /* get the cell dimensions */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "delta %e %e %e", xdelta, xdelta+1, xdelta+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading cell x-dimension.\n");
-    return NULL;
-  }
-
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "delta %e %e %e", ydelta, ydelta+1, ydelta+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading cell y-dimension.\n");
-    return NULL;
-  }
-
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (sscanf(inbuf, "delta %e %e %e", zdelta, zdelta+1, zdelta+2) != 3) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading cell z-dimension.\n");
-    return NULL;
-  }
-
-  /* skip the next line of the header (described at the beginning of
-   * the code), which aren't utilized by APBS-produced DX files.  */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  /* The next line tells us whether to expect ascii or binary format.
-   * We scan for the word 'binary' somewhere in the line, and if it's found
-   * we assume binary.
-   */
-  if (dxgets(inbuf, LINESIZE, fd) == NULL)
-    return NULL;
-  if (strstr(inbuf, "binary")) {
-      isBinary = 1;
-  }
- 
-  /* allocate and initialize the dx structure */
-  dx = new dx_t;
-  dx->fd = fd;
-  dx->vol = NULL;
-  dx->isBinary = isBinary;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  dx->nsets = 1; /* this file contains only one data set */
-
-  dx->vol = new molfile_volumetric_t[1];
-  memset(dx->vol, 0, sizeof(molfile_volumetric_t));
-  strcpy(dx->vol[0].dataname, "DX map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    dx->vol[0].origin[i] = orig[i];
-    dx->vol[0].xaxis[i] = xdelta[i] * ((xsize-1 > 0) ? (xsize-1) : 1);
-    dx->vol[0].yaxis[i] = ydelta[i] * ((ysize-1 > 0) ? (ysize-1) : 1);
-    dx->vol[0].zaxis[i] = zdelta[i] * ((zsize-1 > 0) ? (zsize-1) : 1);
-  }
-
-  dx->vol[0].xsize = xsize;
-  dx->vol[0].ysize = ysize;
-  dx->vol[0].zsize = zsize;
-
-  /* DX files contain no color information. Taken from edmplugin.C */
-  dx->vol[0].has_color = 0;
-
-  return dx;
-}
-
-static int read_dx_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  dx_t *dx = (dx_t *)v;
-  *nsets = dx->nsets; 
-  *metadata = dx->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_binary_dx_data(dx_t *dx, int set, float *datablock) {
-    
-  int i, j, k;
-  int xsize = dx->vol[0].xsize;
-  int ysize = dx->vol[0].ysize;
-  int zsize = dx->vol[0].zsize;
-  int xysize = xsize * ysize;
-  size_t total = xysize * zsize;
-  float *tmp = (float *)malloc(total*sizeof(float));
-  if (fread(tmp, sizeof(float), total, dx->fd) != total) {
-    vmdcon_printf(VMDCON_ERROR, "dxplugin) Failed to read %d binary floats\n", total);
-    free(tmp);
-    return MOLFILE_ERROR;
-  }
-  // take the transpose - nasty
-  int ind = 0;
-  for (i=0; i<xsize; i++) {
-      for (j=0; j<ysize; j++) {
-          for (k=0; k<zsize; k++) {
-              datablock[k * xysize + j*xsize + i] = tmp[ind++];
-          }
-      }
-  }
-  free( tmp );
-  return MOLFILE_SUCCESS;
-}
-
-static int read_dx_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  dx_t *dx = (dx_t *)v;
-  FILE *fd = dx->fd;
-  char inbuf[LINESIZE];
-  char *p;
-  float grid;
-  int x, y, z, xsize, ysize, zsize, xysize, count, total, i, line;
-
-  if (dx->isBinary)
-    return read_binary_dx_data(dx, set, datablock);
-
-  xsize = dx->vol[0].xsize;
-  ysize = dx->vol[0].ysize;
-  zsize = dx->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  /* Read the values from the file */
-  x = y = z = line = 0;
-  for (count = 0; count < total;) {
-    ++line;
-    p=dxgets(inbuf, LINESIZE, fd);
-    if (p == NULL) {
-      vmdcon_printf(VMDCON_ERROR, "dxplugin) Error reading grid data.\n");
-      vmdcon_printf(VMDCON_ERROR, "dxplugin) line: %d. item: %d/%d. last data: %s\n", 
-              line, count, total, inbuf);
-      return MOLFILE_ERROR;
-    }
-
-    // chop line into whitespace separated tokens and parse them one by one.
-    while (*p != '\n' && *p != '\0') {
-
-      // skip over whitespace and try to parse non-blank as number
-      while (*p != '\0' && (*p == ' ' || *p == '\t' || *p == '\n')) ++p;
-      i = sscanf(p, "%e", &grid);
-      if (i < 0) break; // end of line/string. get a new one.
-      
-      // a 0 return value means non-parsable as number.
-      if (i == 0) {
-        vmdcon_printf(VMDCON_ERROR, "dxplugin) Error parsing grid data.\n");
-        vmdcon_printf(VMDCON_ERROR, "dxplugin) line: %d. item: %d/%d. data %s\n", 
-                line, count, total, p);
-        return MOLFILE_ERROR;
-      }
-
-      // success! add to dataset.
-      if (i == 1) {
-        ++count;
-        datablock[x + y*xsize + z*xysize] = grid;
-        z++;
-        if (z >= zsize) {
-          z = 0; y++;
-          if (y >= ysize) {
-            y = 0; x++;
-          }
-        }
-      }
-
-      // skip over the parsed text and search for next blank.
-      while (*p != '\0' && *p != ' ' && *p != '\t' && *p != '\n') ++p;
-    }
-  }
-  
-  char dxname[256];
-  while (dxgets(inbuf, LINESIZE, dx->fd)) {
-    if (sscanf(inbuf, "object \"%[^\"]\" class field", dxname) == 1) {
-      // a dataset name has been found; override the default
-      strcpy(dx->vol[0].dataname, dxname);
-      break;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_dx_read(void *v) {
-  dx_t *dx = (dx_t *)v;
-  
-  fclose(dx->fd);
-  if (dx->vol != NULL)
-    delete [] dx->vol; 
-  delete dx;
-}
-
-static void *open_dx_write(const char *filepath, const char *filetype,
-        int natoms) {
-
-    FILE *fd = fopen(filepath, "wb");
-    if (!fd) {
-        vmdcon_printf(VMDCON_ERROR, 
-                      "dxplugin) Could not open path '%s' for writing.\n",
-                      filepath);
-    }
-    return fd;
-}
-
-static void close_dx_write(void *v) {
-    if (v) {
-        fclose((FILE *)v);
-    }
-}
-
-/*
- *
-# Data from APBS
-# 
-# POTENTIAL (kT/e)
-# 
-object 1 class gridpositions counts 129 129 129
-origin -3.075250e+01 -3.848600e+01 -2.908250e+01
-delta 4.687500e-01 0.000000e+00 0.000000e+00
-delta 0.000000e+00 6.250000e-01 0.000000e+00
-delta 0.000000e+00 0.000000e+00 4.687500e-01
-object 2 class gridconnections counts 129 129 129
-object 3 class array type double rank 0 items 2146689 data follows
-
-*/
-static int write_dx_data(void *v, molfile_volumetric_t *metadata,
-        float *datablock, float *colorblock) {
-
-    int i, j, k, count;
-    FILE *fd = (FILE *)v;
-    const int xsize = metadata->xsize;
-    const int ysize = metadata->ysize;
-    const int zsize = metadata->zsize;
-    const int xysize = xsize * ysize;
-    const int total = xysize * zsize;
-
-    double xdelta[3], ydelta[3], zdelta[3];
-    for (i=0; i<3; i++) {
-      xdelta[i] = metadata->xaxis[i]/(xsize - 1);
-      ydelta[i] = metadata->yaxis[i]/(ysize - 1);
-      zdelta[i] = metadata->zaxis[i]/(zsize - 1);
-    }
-
-    fprintf(fd, "# Data from VMD\n");
-    fprintf(fd, "# %s\n", metadata->dataname);
-    fprintf(fd, "object 1 class gridpositions counts %d %d %d\n",
-            xsize, ysize, zsize);
-    fprintf(fd, "origin %g %g %g\n", 
-            metadata->origin[0], metadata->origin[1], metadata->origin[2]);
-    fprintf(fd, "delta %g %g %g\n", 
-            xdelta[0], xdelta[1], xdelta[2]);
-    fprintf(fd, "delta %g %g %g\n", 
-            ydelta[0], ydelta[1], ydelta[2]);
-    fprintf(fd, "delta %g %g %g\n", 
-            zdelta[0], zdelta[1], zdelta[2]);
-    fprintf(fd, "object 2 class gridconnections counts %d %d %d\n",
-            xsize, ysize, zsize);
-
-    int useBinary = (getenv("VMDBINARYDX") != NULL);
-    fprintf(fd, "object 3 class array type double rank 0 items %d %sdata follows\n", total, useBinary ? "binary " : "");
-    count = 0;
-    for (i=0; i<xsize; i++) {
-        for (j=0; j<ysize; j++) {
-            for (k=0; k<zsize; k++) {
-                if (useBinary) {
-                    fwrite(datablock + k*xysize + j*xsize + i, sizeof(float),
-                            1, fd);
-                } else {
-                    fprintf(fd, "%g ", datablock[k*xysize + j*xsize + i]);
-                    if (++count == 3) {
-                        fprintf(fd, "\n");
-                        count = 0;
-                    }
-                }
-            }
-        }
-    }
-    if (!useBinary && count) 
-      fprintf(fd, "\n");
-
-    // Replace any double quotes (") by single quotes (') in the 
-    // dataname string to make sure that we don't prematurely
-    // terminate the string in the dx file.
-    char *squotes = new char[strlen(metadata->dataname)+1];
-    strcpy(squotes, metadata->dataname);
-    char *s = squotes;
-    // while(s=strchr(s, '"')) *s = '\'';
-    while(1) { 
-      s=strchr(s, '"'); 
-      if (s) { 
-        *s = '\'';
-      } else { 
-        break;
-      }
-    }
-
-    // Print last line
-    fprintf(fd, "object \"%s\" class field\n", squotes);
-    delete [] squotes;
-
-    fflush(fd);
-    return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t dxplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&dxplugin, 0, sizeof(molfile_plugin_t));
-  dxplugin.abiversion = vmdplugin_ABIVERSION;
-  dxplugin.type = MOLFILE_PLUGIN_TYPE;
-  dxplugin.name = "dx";
-  dxplugin.prettyname = "DX";
-  dxplugin.author = "Eamon Caddigan, Justin Gullingsrud, John Stone, Leonardo Trabuco";
-  dxplugin.majorv = 2;
-  dxplugin.minorv = 0;
-  dxplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  dxplugin.filename_extension = "dx";
-  dxplugin.open_file_read = open_dx_read;
-  dxplugin.read_volumetric_metadata = read_dx_metadata;
-  dxplugin.read_volumetric_data = read_dx_data;
-  dxplugin.close_file_read = close_dx_read;
-#if vmdplugin_ABIVERSION > 9
-  dxplugin.open_file_write = open_dx_write;
-  dxplugin.write_volumetric_data = write_dx_data;
-  dxplugin.close_file_write = close_dx_write;
-#endif
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&dxplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/edmplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/edmplugin.C
deleted file mode 100644
index b1d70b1b8cde7eb9f97821f5d9df8503c84e4139..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/edmplugin.C
+++ /dev/null
@@ -1,571 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: edmplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-
-#ifndef NAN //not a number
-  const float NAN = sqrtf(-1.f); //need some kind of portable NAN definition
-#endif
-
-#define TOLERANCE 1e-4
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} edm_t;
-
-static void eatline(FILE * fd) {
-  char readbuf[1025];
-  fgets(readbuf, 1024, fd);    // go on to next line
-}  
-
-static void *open_edm_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  edm_t *edm;
-  int ntitle, na, nb, nc, xsize, ysize, zsize;
-  int amin, amax, bmin, bmax, cmin, cmax;
-  float a, b, c, alpha, beta, gamma;
-  float xdelta, ydelta, zdelta;
-  float alpha1, beta1, gamma1;
-  float xaxis[3], yaxis[3], zaxis[3], z1, z2, z3;
-  int i, convcnt;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-
-  edm = new edm_t;
-  edm->fd = fd;
-  edm->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-
-  edm->vol = new molfile_volumetric_t[1];
- 
-  edm->nsets = 1; // this EDM file contains only one data set
-
-  // read in EDM file header information
-  eatline(edm->fd);               // skip first header line 
-
-  convcnt = fscanf(edm->fd, "%d", &ntitle); // read number of title lines
-  if (convcnt != 1) {
-    printf("edmplugin) failed to read in title line count\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-    
-  eatline(edm->fd);               // go on to next line
-
-  // skip past title and comment lines in header
-  for (i=0; i<ntitle; i++) {
-    eatline(edm->fd);             // skip a line
-  }
-
-  // read in the box dimensions and grid spacing deltas
-  convcnt = fscanf(edm->fd, "%d %d %d %d %d %d %d %d %d",
-         &na, &amin, &amax, &nb, &bmin, &bmax, &nc, &cmin, &cmax);
-  if (convcnt != 9) {
-    printf("edmplugin) failed to read in box dimensions\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-
-  eatline(edm->fd);               // go on to next line
-  
-  // calculate number of samples in each dimension
-  xsize = amax - amin + 1;    
-  ysize = bmax - bmin + 1;    
-  zsize = cmax - cmin + 1;    
-  edm->vol[0].xsize = xsize;
-  edm->vol[0].ysize = ysize;
-  edm->vol[0].zsize = zsize;
-  edm->vol[0].has_color = 0;
-
-  // read in 6 values for unit cell box orientation 
-  convcnt = fscanf(edm->fd, "%f %f %f %f %f %f", 
-                   &a, &b, &c, &alpha, &beta, &gamma);
-  if (convcnt != 6) {
-    printf("edmplugin) failed to read in box lengths and angles\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-  eatline(edm->fd);            // go on to next line
-
-  // find box coordinates 
-  xdelta = a / (float) na;
-  ydelta = b / (float) nb;
-  zdelta = c / (float) nc;
-
-  strcpy(edm->vol[0].dataname, "X-PLOR Electron Density Map");
-
-  // convert degrees to radians
-  alpha1 = 3.14159265358979323846 * alpha / 180.0;
-  beta1  = 3.14159265358979323846 *  beta / 180.0;
-  gamma1 = 3.14159265358979323846 * gamma / 180.0;
-
-  // calculate non-orthogonal unit cell coordinates
-  xaxis[0] = xdelta;
-  xaxis[1] = 0;
-  xaxis[2] = 0;
-
-  yaxis[0] = cos(gamma1) * ydelta;
-  yaxis[1] = sin(gamma1) * ydelta;
-  yaxis[2] = 0;
-
-  z1 = cos(beta1);
-  z2 = (cos(alpha1) - cos(beta1)*cos(gamma1)) / sin(gamma1);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  zaxis[0] = z1 * zdelta;
-  zaxis[1] = z2 * zdelta;
-  zaxis[2] = z3 * zdelta;
-
-  edm->vol[0].origin[0] = xaxis[0] * amin + yaxis[0] * bmin + zaxis[0] * cmin;
-  edm->vol[0].origin[1] = yaxis[1] * bmin + zaxis[1] * cmin;
-  edm->vol[0].origin[2] = zaxis[2] * cmin;
-
-  edm->vol[0].xaxis[0] = xaxis[0] * (xsize-1);
-  edm->vol[0].xaxis[1] = 0;
-  edm->vol[0].xaxis[2] = 0;
-
-  edm->vol[0].yaxis[0] = yaxis[0] * (ysize-1);
-  edm->vol[0].yaxis[1] = yaxis[1] * (ysize-1);
-  edm->vol[0].yaxis[2] = 0;
-
-  edm->vol[0].zaxis[0] = zaxis[0] * (zsize-1);
-  edm->vol[0].zaxis[1] = zaxis[1] * (zsize-1);
-  edm->vol[0].zaxis[2] = zaxis[2] * (zsize-1);
-
-  // Check that the EDM file is stored in the "ZYX" format we expect,
-  // and return NULL if it is not a supported file type.
-  char planeorder[4];
-  memset(planeorder, 0, sizeof(planeorder));
-  convcnt = fscanf(edm->fd, "%3s", planeorder);
-  if (convcnt != 1) {
-    printf("edmplugin) failed to read in plane order\n");
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-
-  if (strcmp(planeorder, "ZYX")) { 
-    printf("edmplugin) unsupported plane ordering %s\n", planeorder);
-    fclose(edm->fd);
-    delete [] edm->vol;
-    delete edm;
-    return NULL;
-  }
-  eatline(edm->fd);               // go on to next line
-
-  return edm;
-}
-
-static int read_edm_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  edm_t *edm = (edm_t *)v;
-  *nsets = edm->nsets; 
-  *metadata = edm->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_edm_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  edm_t *edm = (edm_t *)v;
-  float * cell = datablock;
-  int z, sentinel, convcnt;
-  char readbuf[16];
- 
-  int xsize = edm->vol[0].xsize;
-  int ysize = edm->vol[0].ysize;
-  int zsize = edm->vol[0].zsize;
-
-  // number of lines of text per slice
-  int nperslice = xsize * ysize;
-  int nlines = (int)(nperslice / 6.0);
-  if ((nlines * 6) < nperslice) {
-    nlines++;
-  }
-
-  for (z=0; z<zsize; z++) {
-    int c;
-    eatline(edm->fd);                // Eat the Z-plane index and throw away
-
-    // read one plane of data, one cell at a time
-    for (c=0; c<nperslice; c++) {
-      convcnt = fscanf(edm->fd, "%f", cell);
-      if (convcnt != 1) {
-        printf("edmplugin) failed reading cell data\n");
-        printf("edmplugin) cell %d of %d, slice %d\n", c, nperslice, z);
-        return MOLFILE_ERROR; // bad file format encountered
-      }
-      cell++;
-    }
-    eatline(edm->fd);                // go on to next line
-  }
-
-  // read the -9999 end-of-file sentinel record
-  sentinel = 0;
-  fgets(readbuf, 13, edm->fd);
-  sscanf(readbuf, "%d", &sentinel);  
-  if (sentinel != -9999) {
-    printf("edmplugin) EOF sentinel != -9999\n");
-    // return MOLFILE_ERROR; // bad file format encountered, no sentinel record
-  }
- 
-  return MOLFILE_SUCCESS;
-}
-
-static void close_edm_read(void *v) {
-  edm_t *edm = (edm_t *)v;
-
-  fclose(edm->fd);
-  delete [] edm->vol; 
-  delete edm;
-}
-
-static void *open_edm_write(const char *filepath, const char *filetype, int natoms) {
-
-  FILE *fd = fopen(filepath, "w");
-  if (!fd) {
-    fprintf(stderr, "edmplugin) Could not open path '%s' for writing.\n",
-      filepath);
-  }
-  return fd;
-}
-
-static void close_edm_write(void *v) {
-  if (v) {
-    fclose((FILE *)v);
-  }
-}
-
-// XXX - The following interpolation code is duplicated from situsplugin.C
-//       (which is in turn duplicated from VMD). The only difference is that
-//       we are returning zeroes instead of NANs for out-of-range queries
-//       in the code below. These routines should be made available from 
-//       a centralized place to all molfile plugins, eliminating code 
-//       duplication.
-
-/// return voxel, after safely clamping index to valid range
-float edm_voxel_value_safe(int x, int y, int z, const int xsize, const int ysize, const int zsize, const float *data) {
-  int xx, yy, zz; 
-  xx = (x > 0) ? ((x < xsize) ? x : xsize-1) : 0;
-  yy = (y > 0) ? ((y < ysize) ? y : ysize-1) : 0;
-  zz = (z > 0) ? ((z < zsize) ? z : zsize-1) : 0;
-  int index = zz*xsize*ysize + yy*xsize + xx;
-  return data[index];
-}
-
-/// return interpolated value from 8 nearest neighbor voxels
-float edm_voxel_value_interpolate(float xv, float yv, float zv, const int xsize, const int ysize, const int zsize, const float *data) {
-  int x = (int) xv;
-  int y = (int) yv;
-  int z = (int) zv;
-  // fractional offset
-  float xf = xv - x;
-  float yf = yv - y;
-  float zf = zv - z;
-  float xlerps[4];
-  float ylerps[2];
-  float tmp;
-
-  tmp = edm_voxel_value_safe(x, y, z, xsize, ysize, zsize, data);
-  xlerps[0] = tmp + xf*(edm_voxel_value_safe(x+1, y, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = edm_voxel_value_safe(x, y+1, z, xsize, ysize, zsize, data);
-  xlerps[1] = tmp + xf*(edm_voxel_value_safe(x+1, y+1, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = edm_voxel_value_safe(x, y, z+1, xsize, ysize, zsize, data);
-  xlerps[2] = tmp + xf*(edm_voxel_value_safe(x+1, y, z+1, xsize, ysize, zsize, data) - tmp);
-
-  tmp = edm_voxel_value_safe(x, y+1, z+1, xsize, ysize, zsize, data);
-  xlerps[3] = tmp + xf*(edm_voxel_value_safe(x+1, y+1, z+1, xsize, ysize, zsize, data) - tmp);
-
-  ylerps[0] = xlerps[0] + yf*(xlerps[1] - xlerps[0]);
-  ylerps[1] = xlerps[2] + yf*(xlerps[3] - xlerps[2]);
-
-  return ylerps[0] + zf*(ylerps[1] - ylerps[0]);
-}
-
-/// return interpolated value of voxel, based on atomic coords.
-/// XXX need to account for non-orthog. cells
-float edm_voxel_value_interpolate_from_coord(float xpos, float ypos, float zpos, const float *origin, const float *xdelta, const float *ydelta, const float *zdelta, const int xsize, const int ysize, const int zsize, float *data) {
-  xpos = (xpos-origin[0])/xdelta[0];
-  ypos = (ypos-origin[1])/ydelta[1];
-  zpos = (zpos-origin[2])/zdelta[2];
-  int gx = (int) xpos; // XXX this is wrong for non-orthog cells.
-  int gy = (int) ypos;
-  int gz = (int) zpos;
-
-//  if (gx < 0 || gx >= xsize) return NAN;
-//  if (gy < 0 || gy >= ysize) return NAN;
-//  if (gz < 0 || gz >= zsize) return NAN;
-
-  // Pad with zeroes
-  if (gx < 0 || gx >= xsize) return 0;
-  if (gy < 0 || gy >= ysize) return 0;
-  if (gz < 0 || gz >= zsize) return 0;
-    
-  return edm_voxel_value_interpolate(xpos, ypos, zpos, xsize, ysize, zsize, data);
-
-}
-
-static int write_edm_data(void *v, molfile_volumetric_t *metadata, float *datablock, float *colorblock) {
-
-  FILE *fd = (FILE *)v;
-  const int xsize = metadata->xsize;
-  const int ysize = metadata->ysize;
-  const int zsize = metadata->zsize;
-
-  float xaxis[3], yaxis[3], zaxis[3];
-  float xdelta[3], ydelta[3], zdelta[3];
-  float origin[3], porigin[3];
-
-  int i, j, k;
-
-  int na, amin, amax, nb, bmin, bmax, nc, cmin, cmax;
-  float a, b, c, alpha, beta, gamma;
-
-  for (i=0; i<3; i++) {
-    origin[i] = metadata->origin[i];
-    xaxis[i] = metadata->xaxis[i];
-    yaxis[i] = metadata->yaxis[i];
-    zaxis[i] = metadata->zaxis[i];
-    xdelta[i] = xaxis[i]/(xsize - 1);
-    ydelta[i] = yaxis[i]/(ysize - 1);
-    zdelta[i] = zaxis[i]/(zsize - 1);
-  }
-
-  // The origin and the box length must be multiples of the grid spacing,
-  // so we pad the box accordingly, keeping the same grid spacing and 
-  // resampling the map.
-
-  // For now, we will only write orthonogal cells
-  if (fabs(xaxis[1]) > TOLERANCE || fabs(xaxis[2]) > TOLERANCE ||
-      fabs(yaxis[0]) > TOLERANCE || fabs(yaxis[2]) > TOLERANCE ||
-      fabs(zaxis[0]) > TOLERANCE || fabs(zaxis[1]) > TOLERANCE) {
-    fprintf(stderr, "edmplugin) Could not write X-PLOR file: only orthogonal cells are currently supported.\n");
-    return MOLFILE_ERROR;
-  }
-
-  amin = (int) floorf(origin[0]/xdelta[0]);
-  bmin = (int) floorf(origin[1]/ydelta[1]);
-  cmin = (int) floorf(origin[2]/zdelta[2]);
-
-  porigin[0] = amin * xdelta[0];
-  porigin[1] = bmin * ydelta[1];
-  porigin[2] = cmin * zdelta[2];
-
-  amax = (int) ceilf((xaxis[0]+origin[0])/xdelta[0]);
-  bmax = (int) ceilf((yaxis[1]+origin[1])/ydelta[1]);
-  cmax = (int) ceilf((zaxis[2]+origin[2])/zdelta[2]);
-
-  na = amax - amin + 1;
-  nb = bmax - bmin + 1;
-  nc = cmax - cmin + 1;
-
-  // The new cell axes may be slightly larger than the original ones
-  a = na*xdelta[0];
-  b = nb*ydelta[1];
-  c = nc*zdelta[2];
-
-  // Assuming the cell is orthognal
-  alpha = beta = gamma = 90;
-
-  // Write header
-  fprintf(fd,"\n 2 !NTITLE\n"); // number of title lines
-  fprintf(fd,"REMARKS FILENAME=\"\"\n");
-  fprintf(fd,"REMARKS created by VMD\n");
-
-  // Write the box dimensions and grid spacing deltas
-  fprintf(fd,"%d %d %d %d %d %d %d %d %d\n", na, amin, amax, nb, bmin, bmax,
-                                             nc, cmin, cmax);
-  fprintf(fd,"%g %g %g %g %g %g\n", a, b, c, alpha, beta, gamma);
-
-  // Write plane order
-  fprintf(fd,"ZYX\n");
-
-  // Copy voldata to a padded array
-  int psize = na*nb*nc;
-  int pxysize = na*nb;
-
-  // Resample map
-  float *pdata = (float*) malloc(psize*sizeof(float));
-  for (i=0; i<na; i++) {
-    float xpos = porigin[0] + i*xdelta[0];
-    for (j=0; j<nb; j++) {
-      float ypos = porigin[1] + j*ydelta[1];
-      for (k=0; k<nc; k++) {
-        float zpos = porigin[2] + k*zdelta[2];
-        pdata[i + j*na + k*pxysize] = edm_voxel_value_interpolate_from_coord(xpos, ypos, zpos, origin, xdelta, ydelta, zdelta, xsize, ysize, zsize, datablock);
-      }
-    }
-  }
-
-  // Write each xy slice separately
-  int count = 0;
-  for (k=0; k<nc; k++) {
-    if (count % 6) fprintf(fd, "\n");
-    fprintf(fd, "%8d\n", k);
-    count=0;
-    for (j=0; j<nb; j++) {
-      for (i=0; i<na; i++) {
-        fprintf(fd, "%12.5e", pdata[k*pxysize + j*na + i]);
-        if (++count % 6 == 0)
-          fprintf(fd, "\n");
-      }
-    }
-  }
-  if (count % 6) fprintf(fd, "\n");
-
-  // Write footer
-  int sentinel = -9999;
-  fprintf(fd, "%8d\n", sentinel);
-
-  // Calculate average and standard deviation
-  double avg = 0;
-  double stddev = 0;
-  double sum = 0;
-  double sum2 = 0;
-  for (i=0; i<psize; i++) {
-    sum += pdata[i];
-    sum2 += pdata[i]*pdata[i];
-  }
-  avg = sum/(double)psize;
-  stddev = psize/(psize-1) * sqrt(sum2/psize - avg*avg);
-  fprintf(fd, "%g %g\n", avg, stddev);
-
-  free(pdata);
-
-  fflush(fd);
-  return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "edm";
-  plugin.prettyname = "XPLOR Electron Density Map";
-  plugin.author = "John Stone, Leonardo Trabuco";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cns,edm,xplor";
-  plugin.open_file_read = open_edm_read;
-  plugin.read_volumetric_metadata = read_edm_metadata;
-  plugin.read_volumetric_data = read_edm_data;
-  plugin.close_file_read = close_edm_read;
-#if vmdplugin_ABIVERSION > 9
-  plugin.open_file_write = open_edm_write;
-  plugin.write_volumetric_data = write_edm_data;
-  plugin.close_file_write = close_edm_write;
-#endif
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
-#ifdef TEST_EDMPLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-  void *v;
-  int i, nsets, set;
-  molfile_volumetric_t * meta;
-
-  while (--argc) {
-    ++argv;
-    v = open_edm_read(*argv, "edm", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_edm_read failed for file %s\n", *argv);
-      return 1;
-    }
-
-    // try loading the EDM metadata now
-    if (read_edm_metadata(v, &nsets, &meta)) {
-      return 1; // failed to load edm file
-    }
-
-    for (set=0; set<nsets; set++) {
-      printf("Loading volume set: %d\n", set);   
-      
-      int elements = meta[set].xsize * meta[set].ysize * meta[set].zsize;
-      printf("   Grid Elements: %d\n", elements);
-      printf(" Grid dimensions: X: %d Y: %d Z: %d\n", 
-             meta[set].xsize, meta[set].ysize, meta[set].zsize);
-
-      float * voldata = (float *) malloc(sizeof(float) * elements);
-      float * coldata = NULL;
-
-      if (meta[set].has_color) {
-        coldata = (float *) malloc(sizeof(float) * elements * 3);
-      }
-
-      // try loading the EDM data sets now
-      if (read_edm_data(v, set, voldata, coldata)) {
-        return 1; // failed to load edm file
-      }
-
-      printf("First 6 elements:\n   ");
-      for (i=0; i<6; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-
-      printf("Last 6 elements:\n   ");
-      for (i=elements - 6; i<elements; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-    }
-
-    close_edm_read(v);
-  }
-  return 0;
-}
-
-#endif
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/endianswap.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/endianswap.h
deleted file mode 100644
index 06af6c2040b867ba957afdd7cf9433c3df6be89d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/endianswap.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: endianswap.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Byte swapping routines used in various plugins
- *   There are two versions of each routine, one that's safe to use in
- *   all cases (but is slow) and one that is only safe to use on memory 
- *   addresses that are aligned to the word size that's being byte-swapped
- *   but are much much much faster.  Use the aligned versions of these
- *   routines whenever possible.  The 'ndata' length count parameters and
- *   internal loops should be safe to use on huge memory arrays on 64-bit
- *   machines.
- *
- ***************************************************************************/
-
-#ifndef ENDIAN_SWAP_H
-#define ENDIAN_SWAP_H
-
-/* works on unaligned 2-byte quantities */
-static void swap2_unaligned(void *v, long ndata) {
-  long i;
-  char * dataptr = (char *) v;
-  char tmp;
-
-  for (i = 0; i < ndata-1; i += 2) {
-    tmp = dataptr[i];
-    dataptr[i] = dataptr[i+1];
-    dataptr[i+1] = tmp;
-  }
-}
-
-
-/* works on unaligned 4-byte quantities */
-static void swap4_unaligned(void *v, long ndata) {
-  long i;
-  char *dataptr;
-  char tmp;
-
-  dataptr = (char *) v; 
-  for (i=0; i<ndata; i++) {
-    tmp = dataptr[0];
-    dataptr[0] = dataptr[3];
-    dataptr[3] = tmp;
-    tmp = dataptr[1];
-    dataptr[1] = dataptr[2];
-    dataptr[2] = tmp;
-    dataptr += 4;
-  }
-}
-
-
-/* works on unaligned 8-byte quantities */
-static void swap8_unaligned(void *v, long ndata) {
-  char *data = (char *) v;
-  long i;
-  char byteArray[8];
-  char *bytePointer;
-
-  for (i=0; i<ndata; i++) {
-    bytePointer = data + (i<<3);
-    byteArray[0]  =  *bytePointer;
-    byteArray[1]  =  *(bytePointer+1);
-    byteArray[2]  =  *(bytePointer+2);
-    byteArray[3]  =  *(bytePointer+3);
-    byteArray[4]  =  *(bytePointer+4);
-    byteArray[5]  =  *(bytePointer+5);
-    byteArray[6]  =  *(bytePointer+6);
-    byteArray[7]  =  *(bytePointer+7);
-
-    *bytePointer     = byteArray[7];
-    *(bytePointer+1) = byteArray[6];
-    *(bytePointer+2) = byteArray[5];
-    *(bytePointer+3) = byteArray[4];
-    *(bytePointer+4) = byteArray[3];
-    *(bytePointer+5) = byteArray[2];
-    *(bytePointer+6) = byteArray[1];
-    *(bytePointer+7) = byteArray[0];
-  }
-}
-
-
-/* Only works with aligned 2-byte quantities, will cause a bus error */
-/* on some platforms if used on unaligned data.                      */
-static void swap2_aligned(void *v, long ndata) {
-  short *data = (short *) v;
-  long i;
-  short *N; 
-
-  for (i=0; i<ndata; i++) {
-    N = data + i;
-    *N=(((*N>>8)&0xff) | ((*N&0xff)<<8));  
-  }
-}
-
-
-/* Only works with aligned 4-byte quantities, will cause a bus error */
-/* on some platforms if used on unaligned data.                      */
-static void swap4_aligned(void *v, long ndata) {
-  int *data = (int *) v;
-  long i;
-  int *N;
-  for (i=0; i<ndata; i++) {
-    N = data + i;
-    *N=(((*N>>24)&0xff) | ((*N&0xff)<<24) | 
-        ((*N>>8)&0xff00) | ((*N&0xff00)<<8));
-  }
-}
-
-
-/* Only works with aligned 8-byte quantities, will cause a bus error */
-/* on some platforms if used on unaligned data.                      */
-static void swap8_aligned(void *v, long ndata) {
-  /* Use int* internally to prevent bugs caused by some compilers */
-  /* and hardware that would potentially load data into an FP reg */
-  /* and hose everything, such as the old "jmemcpy()" bug in NAMD */
-  int *data = (int *) v;  
-  long i;
-  int *N; 
-  int t0, t1;
-
-  for (i=0; i<ndata; i++) {
-    N = data + (i<<1);
-    t0 = N[0];
-    t0=(((t0>>24)&0xff) | ((t0&0xff)<<24) | 
-        ((t0>>8)&0xff00) | ((t0&0xff00)<<8));
-
-    t1 = N[1];
-    t1=(((t1>>24)&0xff) | ((t1&0xff)<<24) | 
-        ((t1>>8)&0xff00) | ((t1&0xff00)<<8));
-
-    N[0] = t1; 
-    N[1] = t0; 
-  }
-}
-
-#if 0
-/* Other implementations that might be faster in some cases */
-
-/* swaps the endianism of an eight byte word. */
-void mdio_swap8(double *i) {
-        char c;
-        char *n;
-        n = (char *) i;
-        c = n[0];
-        n[0] = n[7];
-        n[7] = c;
-        c = n[1];
-        n[1] = n[6];
-        n[6] = c;
-        c = n[2];
-        n[2] = n[5];
-        n[5] = c;
-        c = n[3];
-        n[3] = n[4];
-        n[4] = c;
-}
-
-#endif
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fastio.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fastio.h
deleted file mode 100644
index 3be0b4f4da2921249b52286b9e430496c616461d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fastio.h
+++ /dev/null
@@ -1,613 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: fastio.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   This is a simple abstraction layer for system-dependent I/O calls
- * that allow plugins to do binary I/O using the fastest possible method.
- *
- * This code is intended for use by binary trajectory reader plugins that
- * work with multi-gigabyte data sets, reading only binary data.
- *
- ***************************************************************************/
-
-#define FIO_READ    0x01
-#define FIO_WRITE   0x02
-#define FIO_DIRECT  0x04 /* emulate Unix O_DIRECT flag */
- 
-/* Compiling on windows */
-#if defined(_MSC_VER) || defined(__MINGW32__)
-
-#if 1 
-/* use native Windows I/O calls */
-#define FASTIO_NATIVEWIN32 1
-
-#include <stdio.h>
-#include <string.h>
-#include <windows.h>
-
-typedef HANDLE fio_fd;
-typedef LONGLONG fio_size_t;
-typedef void * fio_caddr_t;
-
-typedef struct {
-  fio_caddr_t iov_base;
-  int iov_len;
-} fio_iovec;
-
-
-#define FIO_SEEK_CUR  FILE_CURRENT
-#define FIO_SEEK_SET  FILE_BEGIN
-#define FIO_SEEK_END  FILE_END
-
-static int fio_win32convertfilename(const char *filename, char *newfilename, int maxlen) {
-  int i;
-  int len=strlen(filename);
- 
-  if ((len + 1) >= maxlen)
-    return -1;
-   
-  for (i=0; i<len; i++) {
-    if (filename[i] == '/')
-      newfilename[i] = '\\';
-    else
-      newfilename[i] = filename[i];
-  }
-  newfilename[len] = '\0'; /* NUL terminate the string */
-
-  return 0;
-}
-
-static int fio_open(const char *filename, int mode, fio_fd *fd) {
-  HANDLE fp;
-  char winfilename[8192];
-  DWORD access;
-  DWORD sharing;
-  LPSECURITY_ATTRIBUTES security;
-  DWORD createmode;
-  DWORD flags;
-
-  if (fio_win32convertfilename(filename, winfilename, sizeof(winfilename)))
-    return -1;  
-
-  access = 0;
-  if (mode & FIO_READ)
-    access |= GENERIC_READ;
-  if (mode & FIO_WRITE)
-    access |= GENERIC_WRITE;
-#if 0
-  access = FILE_ALL_ACCESS; /* XXX hack if above modes fail */
-#endif
-#if 1
-  if (mode & FIO_DIRECT)
-    flags = FILE_FLAG_NO_BUFFERING;
-  else
-    flags = FILE_ATTRIBUTE_NORMAL;
-#else
-  if (mode & FIO_DIRECT)
-    return -1; /* not supported yet */
-#endif
-
-  sharing = 0;       /* disallow sharing with other processes  */
-  security = NULL;   /* child processes don't inherit anything */
-
-  /* since we never append, blow away anything that's already there */
-  if (mode & FIO_WRITE)
-    createmode = CREATE_ALWAYS;
-  else 
-    createmode = OPEN_EXISTING;
-
-  fp = CreateFile(winfilename, access, sharing, security, 
-                  createmode, flags, NULL);
-
-  if (fp == NULL) {
-    return -1;
-  } else {
-    *fd = fp;
-    return 0;
-  }
-}
-
-
-static int fio_fclose(fio_fd fd) {
-  BOOL rc;
-  rc = CloseHandle(fd);
-  if (rc) 
-    return 0;
-  else 
-    return -1;
-}
-
-static fio_size_t fio_fread(void *ptr, fio_size_t size, 
-                            fio_size_t nitems, fio_fd fd) {
-  BOOL rc;
-  DWORD len;
-  DWORD readlen;
-
-  len = size * nitems;
-
-  rc = ReadFile(fd, ptr, len, &readlen, NULL);
-  if (rc) {
-    if (readlen == len)
-      return nitems;
-    else 
-      return 0;
-  } else {
-    return 0;
-  }
-}
-
-static fio_size_t fio_readv(fio_fd fd, const fio_iovec * iov, int iovcnt) {
-  int i;
-  fio_size_t len = 0; 
-
-  for (i=0; i<iovcnt; i++) {
-    fio_size_t rc = fio_fread(iov[i].iov_base, iov[i].iov_len, 1, fd);
-    if (rc != 1)
-      break;
-    len += iov[i].iov_len;
-  }
-
-  return len;
-}
-
-static fio_size_t fio_fwrite(void *ptr, fio_size_t size, 
-                             fio_size_t nitems, fio_fd fd) {
-  BOOL rc;
-  DWORD len;
-  DWORD writelen;
-
-  len = size * nitems; 
- 
-  rc = WriteFile(fd, ptr, len, &writelen, NULL);
-  if (rc) {
-    if (writelen == len)
-      return nitems;
-    else
-      return 0;
-  } else {
-    return 0;
-  }
-}
-
-static fio_size_t fio_fseek(fio_fd fd, fio_size_t offset, int whence) {
-#if 1
-  /* code that works with older MSVC6 compilers */
-  LONGLONG finaloffset;
-  LARGE_INTEGER bigint;
-  LARGE_INTEGER finalint;
-
-  bigint.QuadPart = offset;
-  finalint = bigint;      /* set the high part, which will be overwritten */
-  finalint.LowPart = SetFilePointer(fd, bigint.LowPart, &finalint.HighPart, whence);
-  if (finalint.LowPart == -1) {
-    /* if (finalint.LowPart == INVALID_SET_FILE_POINTER) { */
-    /* INVALID_SET_FILE_POINTER is a possible "ok" low order result when */
-    /* working with 64-bit offsets, so we have to also check the system  */
-    /* error value for this thread to be sure */
-    if (GetLastError() != ERROR_SUCCESS) {
-      return -1;
-    }
-  } 
-
-  finaloffset = finalint.QuadPart;
-  return 0;
-#else
-  BOOL rc;
-  LONGLONG finaloffset;
-
-  /* SetFilePointerEx() only exists with new .NET compilers */
-  rc = SetFilePointerEx(fd, offset, &finaloffset, whence);
-
-  if (rc) 
-    return 0;
-  else
-    return -1;
-#endif
-}
-
-static fio_size_t fio_ftell(fio_fd fd) {
-  /* code that works with older MSVC6 compilers */
-  LONGLONG finaloffset;
-  LARGE_INTEGER bigint;
-  LARGE_INTEGER finalint;
-
-  bigint.QuadPart = 0;
-  finalint = bigint;      /* set the high part, which will be overwritten */
-
-  finalint.LowPart = SetFilePointer(fd, bigint.LowPart, &finalint.HighPart, FILE_CURRENT);
-  if (finalint.LowPart == -1) {
-    /* if (finalint.LowPart == INVALID_SET_FILE_POINTER) { */
-    /* INVALID_SET_FILE_POINTER is a possible "ok" low order result when */
-    /* working with 64-bit offsets, so we have to also check the system  */
-    /* error value for this thread to be sure */
-    if (GetLastError() != ERROR_SUCCESS) {
-      return -1;
-    }
-  }
-
-  finaloffset = finalint.QuadPart;
-
-  return finaloffset;
-}
-
-
-#else
-
-/* Version for machines with plain old ANSI C  */
-
-#include <stdio.h>
-#include <string.h>
-
-typedef FILE * fio_fd;
-typedef size_t fio_size_t;  /* MSVC doesn't uinversally support ssize_t */
-typedef void * fio_caddr_t; /* MSVC doesn't universally support caddr_t */
-
-typedef struct {
-  fio_caddr_t iov_base;
-  int iov_len;
-} fio_iovec;
-
-#define FIO_SEEK_CUR SEEK_CUR
-#define FIO_SEEK_SET SEEK_SET
-#define FIO_SEEK_END SEEK_END
-
-static int fio_open(const char *filename, int mode, fio_fd *fd) {
-  char * modestr;
-  FILE *fp;
-
-  if (mode & FIO_READ) 
-    modestr = "rb";
-
-  if (mode & FIO_WRITE) 
-    modestr = "wb";
-
-  if (mode & FIO_DIRECT)
-    return -1; /* not supported yet */
- 
-  fp = fopen(filename, modestr);
-  if (fp == NULL) {
-    return -1;
-  } else {
-    *fd = fp;
-    return 0;
-  }
-}
-
-static int fio_fclose(fio_fd fd) {
-  return fclose(fd);
-}
-
-static fio_size_t fio_fread(void *ptr, fio_size_t size, 
-                            fio_size_t nitems, fio_fd fd) {
-  return fread(ptr, size, nitems, fd);
-}
-
-static fio_size_t fio_readv(fio_fd fd, const fio_iovec * iov, int iovcnt) {
-  int i;
-  fio_size_t len = 0; 
-
-  for (i=0; i<iovcnt; i++) {
-    fio_size_t rc = fread(iov[i].iov_base, iov[i].iov_len, 1, fd);
-    if (rc != 1)
-      break;
-    len += iov[i].iov_len;
-  }
-
-  return len;
-}
-
-static fio_size_t fio_fwrite(void *ptr, fio_size_t size, 
-                             fio_size_t nitems, fio_fd fd) {
-  return fwrite(ptr, size, nitems, fd);
-}
-
-static fio_size_t fio_fseek(fio_fd fd, fio_size_t offset, int whence) {
-  return fseek(fd, offset, whence);
-}
-
-static fio_size_t fio_ftell(fio_fd fd) {
-  return ftell(fd);
-}
-#endif /* plain ANSI C */
-
-#else 
-
-/* Version for UNIX machines */
-#if defined(__linux)
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE            /* required for O_DIRECT */
-#endif
-#endif
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-typedef int fio_fd;
-typedef off_t fio_size_t;      /* off_t is 64-bits with LFS builds */
-
-/*
- * Enable use of kernel readv() if available and reliable
- *
- * Note: Some Linux implementations incorporate readv() code in libc 
- * that does userspace copying of I/O vectors to internal temporary
- * buffers in order to meet the atomicity requirements of the POSIX standard.
- * Such copies make the use of vectorized I/O APIs much less useful for
- * large trajectory files because the internal buffer allocations can fail
- * badly when performing large aggregate I/O operations.  It may be that
- * other implementations of vector I/O have similar problems, and in these
- * cases it is probably best not to use it at all, and to fall back to 
- * non-vectorized I/O APIs to avoid such extra copies.
- */
-#if defined(__sun) || defined(__APPLE_CC__) || defined(__linux)
-#define USE_KERNEL_READV 1
-#endif
-
-typedef void * fio_caddr_t;
-
-#if defined(USE_KERNEL_READV)
-#include <errno.h>
-#include <sys/uio.h>
-typedef struct iovec fio_iovec;
-#else
-
-typedef struct {
-  fio_caddr_t iov_base;
-  int iov_len;
-} fio_iovec;
-#endif
-
-#define FIO_SEEK_CUR SEEK_CUR
-#define FIO_SEEK_SET SEEK_SET
-#define FIO_SEEK_END SEEK_END
-
-static int fio_open(const char *filename, int mode, fio_fd *fd) {
-  int nfd;
-  int oflag = 0;
-  
-  if (mode & FIO_READ) 
-    oflag = O_RDONLY;
-
-  if (mode & FIO_WRITE) 
-    oflag = O_WRONLY | O_CREAT | O_TRUNC;
-
-#if defined(__linux)
-  /* enable direct I/O, requires block-aligned buffers and I/O sizes */
-  if (mode & FIO_DIRECT)
-    oflag |= O_DIRECT;
-#else
-  if (mode & FIO_DIRECT)
-    return -1; /* not supported yet */
-#endif
-
-  nfd = open(filename, oflag, 0666);
-  if (nfd < 0) {
-    return -1;
-  } else {
-    *fd = nfd;
-    return 0;
-  }
-}
-
-static int fio_fclose(fio_fd fd) {
-  return close(fd);
-}
-
-static fio_size_t fio_fread(void *ptr, fio_size_t size, 
-                            fio_size_t nitems, fio_fd fd) {
-  fio_size_t i;
-  fio_size_t len = 0; 
-  fio_size_t cnt = 0;
-
-#if 1
-  /*
-   * On Linux individual calls to read() can end up doing short reads when
-   * reading more than 2GB in a single read call, even on 64-bit machines.  
-   * For large structures, e.g. 240M-atoms or larger, we have to use a loop
-   * to continue reading into the memory buffer until completion.
-   */ 
-  for (i=0; i<nitems; i++) {
-    fio_size_t szleft = size;
-    fio_size_t rc = 0;
-    for (szleft=size; szleft > 0; szleft -= rc) {
-      rc = read(fd, ((char*) ptr) + (cnt*size) + (size-szleft), szleft);
-       if (rc == 0) {
-          return cnt;  /* end of file scenario */
-       }
-//      if (rc != szleft) {
-//        printf("fio_fread(): rc %ld  sz: %ld\n", rc, szleft);
-//      }
-      if (rc < 0) {
-        printf("fio_fread(): rc %ld  sz: %ld\n", rc, size);
-        perror("  perror fio_fread(): ");
-        break;
-      }
-    }
-    len += rc;
-    cnt++;
-  }
-#else
-  for (i=0; i<nitems; i++) {
-    fio_size_t rc = read(fd, (void*) (((char *) ptr) + (cnt * size)), size);
-    if (rc != size) {
-//      printf("fio_fread(): rc %ld  sz: %ld\n", rc, size);
-//      perror("  perror fio_fread(): ");
-      break;
-    }
-    len += rc;
-    cnt++;
-  }
-#endif
-
-  return cnt;
-}
-
-static fio_size_t fio_readv(fio_fd fd, const fio_iovec * iov, int iovcnt) {
-  fio_size_t len;
-  int i;
-
-#if 0
-  fio_size_t tlen;
-  for (tlen=0,i=0; i<iovcnt; i++) {
-    tlen += iov[i].iov_len;
-  }
-
-#if defined(USE_KERNEL_READV)
-  len = readv(fd, iov, iovcnt);
-  if (len != tlen) {
-    printf("fio_readv(): readv() rc: %ld  sz: %ld\n", len, tlen);
-    printf("fio_readv(): readv() errno %d\n", errno);
-  }
-
-  if ((len < 0 && errno == ENOSYS) ||
-      (len != tlen && errno == EINVAL)) 
-#endif
-  {
-    /* XXX this loop doesn't meet the atomicity requirements of
-     *     real POSIX readv(), since we don't need that feature 
-     */
-    len = 0; 
-    for (i=0; i<iovcnt; i++) {
-      void *ptr = iov[i].iov_base;
-      fio_size_t sz = iov[i].iov_len;
-      fio_size_t szleft = sz;
-      fio_size_t rc=0;
-
-      for (szleft=sz; szleft > 0; szleft -= rc) {
-        rc = read(fd, ((char*) ptr)+(sz-szleft), szleft);
-        if (rc == 0) {
-          return len;  /* end of file scenario */
-        }
-        if (rc != szleft) {
-          printf("fio_readv(): read() rc %ld  sz: %ld\n", rc, szleft);
-        }
-        if (rc < 0) {
-          printf("fio_readv(): read() rc %ld  sz: %ld\n", rc, szleft);
-          perror("  perror fio_readv(): ");
-          break;
-        }
-      }
-      len += iov[i].iov_len;
-    }
-  }
-#else
-#if defined(USE_KERNEL_READV)
-  len = readv(fd, iov, iovcnt);
-  if (len < 0 && errno == ENOSYS)
-#endif
-  {
-    /* XXX this loop doesn't meet the atomicity requirements of
-     *     real POSIX readv(), since we don't need that feature 
-     */
-    len = 0; 
-    for (i=0; i<iovcnt; i++) {
-      fio_size_t rc = read(fd, iov[i].iov_base, iov[i].iov_len);
-      if (rc != iov[i].iov_len)
-        break;
-      len += iov[i].iov_len;
-    }
-  }
-#endif
-
-  return len;
-}
-
-static fio_size_t fio_fwrite(void *ptr, fio_size_t size, 
-                             fio_size_t nitems, fio_fd fd) {
-  fio_size_t i;
-  fio_size_t len = 0; 
-  fio_size_t cnt = 0;
-
-#if 1
-  /*
-   * On Linux individual calls to write() can end up doing short writes when
-   * writing more than 2GB in a single write call, even on 64-bit machines.  
-   * For large structures, e.g. 240M-atoms or larger, we have to use a loop
-   * to continue writing the memory buffer until completion.
-   */ 
-  int writecalls=0;
-  for (i=0; i<nitems; i++) {
-    fio_size_t szleft = size;
-    fio_size_t rc = 0;
-    for (szleft=size; szleft > 0; szleft -= rc) {
-      fio_size_t writesz = szleft;
-
-#if 0
-      /* On some kernel versions write calls beyond 2GB may not do */
-      /* a partial write and may just return an error immediately. */
-      /* Clamp maximum write size to 1GB per write call.           */
-      if (writesz > (1024L * 1024L * 1024L))
-        writesz = (1024L * 1024L * 1024L);
-#endif
-
-      writecalls++;
-      rc = write(fd, ((char*) ptr)+(size-szleft), writesz);
-      if (rc < 0) {
-        printf("fio_fwrite(): rc %ld  sz: %ld  szleft: %ld  calls: %d\n", 
-               rc, size, szleft, writecalls);
-        perror("  perror fio_fwrite(): ");
-        return cnt;
-      }
-    }
-    len += rc;
-    cnt++;
-  }
-#else
-  for (i=0; i<nitems; i++) {
-    fio_size_t rc = write(fd, ptr, size);
-    if (rc != size) {
-      printf("fio_fwrite(): rc %ld  sz: %ld\n", rc, size);
-      perror("  perror fio_fwrite(): ");
-      break;
-    }
-    len += rc;
-    cnt++;
-  }
-#endif
-
-  return cnt;
-}
-
-static fio_size_t fio_fseek(fio_fd fd, fio_size_t offset, int whence) {
- if (lseek(fd, offset, whence) >= 0)
-   return 0;  /* success (emulate behavior of fseek) */
- else 
-   return -1; /* failure (emulate behavior of fseek) */
-}
-
-static fio_size_t fio_ftell(fio_fd fd) {
-  return lseek(fd, 0, SEEK_CUR);
-}
-
-#endif
-
-
-/* higher level routines that are OS independent */
-
-static int fio_write_int32(fio_fd fd, int i) {
-  return (fio_fwrite(&i, 4, 1, fd) != 1);
-}
-
-static int fio_read_int32(fio_fd fd, int *i) {
-  return (fio_fread(i, 4, 1, fd) != 1);
-}
-
-static int fio_write_str(fio_fd fd, const char *str) {
-  int len = strlen(str);
-  return (fio_fwrite((void *) str, len, 1, fd) != 1);
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fortread.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fortread.h
deleted file mode 100644
index 6fad94d80f7eb2ac7b53086509d13965f9d72699..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fortread.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: fortread.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.10 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Unformatted and formatted fortran file reading routines for
- *   use in various plugins to simplify dealing with fortran i/o quirks.
- ***************************************************************************/
-
-#ifndef FORTREAD_H
-#define FORTREAD_H
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "endianswap.h"
-
-#define FORT_RECLEN_32BIT 4
-#define FORT_RECLEN_64BIT 8
-
-/*
- * consume a record length marker
- */
-static int fort_eat_recmark(FILE *ifp, int recmarklen) {
-  int tmp;
-  if (recmarklen == FORT_RECLEN_64BIT) {
-    if (fread(&tmp, 4, 1, ifp) != 1) 
-      return -1;
-    if (fread(&tmp, 4, 1, ifp) != 1) 
-      return -1;
-  } else {
-    if (fread(&tmp, 4, 1, ifp) != 1) 
-      return -1;
-  }
-
-  return 0;
-}
-
-/*
- * Determine endianness and length of Fortran 
- * record length markers within unformatted binary files.
- */
-static int fort_get_endian_reclen(int reclen, int word0, int word1, 
-                                  int *swap, int *recmarklen) {
-  /* check for 32-bit record length markers */
-  if (reclen == word0) {
-    *swap=0;
-    *recmarklen=FORT_RECLEN_32BIT;
-    return 0;
-  } else {
-    int tmp = word0;
-    swap4_aligned(&tmp, 1);   
-    if (tmp == reclen) {
-      *swap=0;
-      *recmarklen=FORT_RECLEN_32BIT;
-      return 0;
-    }
-  }
-  
-  /* check for 64-bit record length markers */ 
-  if (reclen == (word0+word1)) {
-    *swap=0;
-    *recmarklen=FORT_RECLEN_64BIT;
-  } else {
-    int tmp0=word0;
-    int tmp1=word1;
-    swap4_aligned(&tmp0, 1);   
-    swap4_aligned(&tmp1, 1);   
-    *swap=1;
-    *recmarklen=FORT_RECLEN_64BIT;
-  }
-    
-  return -1; /* completely unrecognized record length marker */
-}
-
-
-
-/*  Unformatted reads.
- *
- *   Each function reads the next record from the file (provided it contains
- *   no more than n elements), optionally swapping its contents before
- *   writing it into dest. 
- *   Returns the number of elements on success, 0 on failure.
- *
- *   TODO: These should perhaps rewind the file to the beginning of the
- *   record on failure.
- */
-
-/* Only works with aligned four-byte quantities, swap4_aligned() will */
-/* cause a bus error on sume platforms if used on unaligned data      */
-static int fortread_4(void *dest, int n, int swap, FILE *fd) {
-  int dataBegin, dataEnd, count;
-
-  if (fread(&dataBegin, sizeof(int), 1, fd) != 1) return 0;
-  if (swap) swap4_aligned(&dataBegin, 1);
-  if ((dataBegin <= 0) || (n < dataBegin/4)) return 0;
-
-  count = fread(dest, 4, dataBegin/4, fd);
-  if (count != dataBegin/4) return 0;
-  if (swap) swap4_aligned(dest, dataBegin/4);
-
-  if (fread(&dataEnd, sizeof(int), 1, fd) != 1) return 0;
-  if (swap) swap4_aligned(&dataBegin, 1);
-  if (dataEnd != dataBegin) return 0;
-
-  return count;
-}
-
-/* Formatted reads:
- *
- * copy at most 'len' characters from source to target. 
- *
- * leading white space is skipped over but counts towards 'len'.
- * the copy stops at first whitspace or a '\0'.
- * unlike strncpy(3) the result will always be \0 terminated.
- *
- * intended for copying (short) strings from formatted fortran  
- * i/o files that must not contain whitespace (e.g. residue names, 
- * atom name/types etc. in .pdb, .psf and alike.). 
- */
-static void strnwscpy(char *target, const char *source, const int len) {
-  int i, c;
-
-  for (i=0, c=0; i<len; ++i) {
-    if (*source == '\0' || (c > 0 && *source == ' ')) {
-      break;
-    }
-
-    if (*source == ' ') { 
-      source++;
-    } else {
-      *target++ = *source++;
-      c++;
-    }
-  }
-  *target = '\0';
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fs4plugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fs4plugin.C
deleted file mode 100644
index bb6e79bd42909722659f8a0339c701fde5c9487b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/fs4plugin.C
+++ /dev/null
@@ -1,374 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: fs4plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * fsfour format density maps
- *
- * More info for this format can be found at 
- * <http://www.csb.yale.edu/userguides/datamanip/phases/FSFOUR.html>
- *
- * Old versions of the cns2fsfour and ccp2fsfour utilities produced a
- * slightly broken variant of this format, omitting the data that isn't used
- * by XTalView. This plugin currently reads these files, but the cell
- * dimensions will be incorrect.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-#include "fortread.h"
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int swap;
-  int f, m, s, x, y, z; // indecies mapping fast-medium-slow to x-y-z
-  float scale;
-  molfile_volumetric_t *vol;
-} fs4_t;
-
-
-static void *open_fs4_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  fs4_t *fs4;
-  FILE *fd;
-  float header[32], scale, fmsCellSize[3], alpha, beta, gamma, z1, z2, z3;
-  int dataBegin, blocksize, geom[16], fmsGridSize[3], norn, swap=0;
-
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "fs4plugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // Use the first four-byte integer in the file to determine the file's
-  // byte-order
-  fread(&dataBegin, sizeof(int), 1, fd);
-  if (dataBegin > 255) {
-    // check if the bytes need to be swapped
-    swap4_aligned(&dataBegin, 1);
-    if (dataBegin <= 255) {
-      swap = 1;
-    } else {
-      fprintf(stderr, "fs4plugin) Cannot read file: header block is too large.\n");
-      return NULL;
-    }
-  }
-
-  // Read the header
-  rewind(fd);
-  blocksize = fortread_4(header, 32, swap, fd);
-
-  // Handle files produced by old versions of (cns|ccp)2fsfour
-  if (blocksize == 28) {
-    printf("fs4plugin) Recognized %s cns2fsfour map.\n", 
-        swap ? "opposite-endian" : "same-endian");
-
-    // Read the geometry block
-    blocksize = fortread_4(geom, 16, swap, fd);
-    if (blocksize != 7) {
-      fprintf(stderr, "fs4plugin) Incorrect size for geometry block.\n");
-      return NULL;
-    }
-
-    fmsGridSize[0] = geom[0];
-    fmsGridSize[1] = geom[1];
-    fmsGridSize[2] = geom[2];
-    norn = geom[4];
-
-    // Warn about assumptions
-    printf("fs4plugin) Warning: file does not contain unit cell lengths or angles.\n");
-
-    scale = 50.0;
-    fmsCellSize[0] = 1.0;
-    fmsCellSize[1] = 1.0;
-    fmsCellSize[2] = 1.0;
-    alpha = 90.0;
-    beta = 90.0;
-    gamma = 90.0;
-  }
-
-  // Handle standard fsfour files
-  else if (blocksize == 31) {
-    printf("fs4plugin) Recognize standard fsfour map.\n");
-
-    fmsCellSize[0] = header[21];
-    fmsCellSize[1] = header[22];
-    fmsCellSize[2] = header[23];
-    alpha = header[24];
-    beta = header[25];
-    gamma = header[26];
-    
-    // Skip the symmetry block if one present
-    blocksize = fortread_4(geom, 16, swap, fd);
-    if (blocksize == 9) {
-      printf("fs4plugin) Skipping symmetry block.\n");
-      blocksize = fortread_4(geom, 16, swap, fd);
-    }
-
-    // Read the geometry block
-    if (blocksize != 13) {
-      fprintf(stderr, "fs4plugin) Incorrect size for geometry block.\n");
-      return NULL;
-    }
-
-    fmsGridSize[0] = geom[0];
-    fmsGridSize[1] = geom[1];
-    fmsGridSize[2] = geom[2];
-
-    scale = *((float *) geom + 3);
-    if (scale == 0) {
-      scale = 50;
-    }
-
-    norn = geom[4];
-    if ((norn < 0) || (norn > 2)) {
-      fprintf(stderr, "fs4plugin) norn out of range.\n");
-      return NULL;
-    }
-  }
-
-  // Unrecognized format
-  else {
-    fprintf(stderr, "fs4plugin) Unrecognized map format.\n");
-    return NULL;
-  }
-
-  // Convert degrees to radians
-  alpha *= M_PI / 180.0;
-  beta  *= M_PI / 180.0;
-  gamma *= M_PI / 180.0;
-
-  // Warn about assumptions
-  printf("fs4plugin) Warning: file does not contain molecule center.\nCentering at <0, 0, 0>\n");
-
-  // Allocate and initialize the fs4 structure
-  fs4 = new fs4_t;
-  fs4->fd = fd;
-  fs4->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  fs4->nsets = 1; // this file contains only one data set
-  fs4->swap = swap;
-  fs4->scale = scale;
-  if (norn == 0) {
-    // x fast, z medium, y slow
-    fs4->x = 0;
-    fs4->y = 2;
-    fs4->z = 1;
-    fs4->f = 0;
-    fs4->m = 2;
-    fs4->s = 1;
-  }
-  else if (norn == 1) {
-    // y fast, z medium, x slow
-    fs4->x = 2;
-    fs4->y = 0;
-    fs4->z = 1;
-    fs4->f = 1;
-    fs4->m = 2;
-    fs4->s = 0;
-  }
-  else { // norn ==2
-    // x fast, y medium, z slow
-    fs4->x = 0;
-    fs4->y = 1;
-    fs4->z = 2;
-    fs4->f = 0;
-    fs4->m = 1;
-    fs4->s = 2;
-  }
-
-  fs4->vol = new molfile_volumetric_t[1];
-  strcpy(fs4->vol[0].dataname, "Fsfour Electron Density Map");
-
-  // Place the origin at {0 0 0}
-  fs4->vol[0].origin[0] = 0.0;
-  fs4->vol[0].origin[1] = 0.0;
-  fs4->vol[0].origin[2] = 0.0;
-
-  fs4->vol[0].xaxis[0] = fmsCellSize[0];
-  fs4->vol[0].xaxis[1] = 0.0;
-  fs4->vol[0].xaxis[2] = 0.0;
-
-  fs4->vol[0].yaxis[0] = cos(gamma) * fmsCellSize[1];
-  fs4->vol[0].yaxis[1] = sin(gamma) * fmsCellSize[1];
-  fs4->vol[0].yaxis[2] = 0.0;
- 
-  z1 = cos(beta);
-  z2 = (cos(alpha) - cos(beta)*cos(gamma)) / sin(gamma);
-  z3 = sqrt(1.0 - z1*z1 - z2*z2);
-  fs4->vol[0].zaxis[0] = z1 * fmsCellSize[2];
-  fs4->vol[0].zaxis[1] = z2 * fmsCellSize[2];
-  fs4->vol[0].zaxis[2] = z3 * fmsCellSize[2];
-
-  fs4->vol[0].xsize = fmsGridSize[fs4->x];
-  fs4->vol[0].ysize = fmsGridSize[fs4->y];
-  fs4->vol[0].zsize = fmsGridSize[fs4->z];
-
-  fs4->vol[0].has_color = 0;
-
-  return fs4;
-}
-
-
-static int read_fs4_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  fs4_t *fs4 = (fs4_t *)v;
-  *nsets = fs4->nsets; 
-  *metadata = fs4->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_fs4_data(void *v, int set, float *dstBlock, 
-                         float *colorblock) {
-  fs4_t *fs4 = (fs4_t *) v;
-  int *srcBlock, index;
-  int col, row, plane, colSize, rowSize, planeSize;
-  int xyzGridSize[3], xyzIndexIncrement[3];
-
-  xyzGridSize[0] = fs4->vol[0].xsize;
-  xyzGridSize[1] = fs4->vol[0].ysize;
-  xyzGridSize[2] = fs4->vol[0].zsize;
-  xyzIndexIncrement[0] = 1;
-  xyzIndexIncrement[1] = xyzGridSize[0];
-  xyzIndexIncrement[2] = xyzGridSize[0] * xyzGridSize[1];
-
-  colSize = xyzGridSize[fs4->f];
-  rowSize = xyzGridSize[fs4->m];
-  planeSize = xyzGridSize[fs4->s];
-
-  srcBlock = new int[colSize];
-
-  index = 0;
-  for (plane = 0; plane < planeSize; plane++) {
-    for (row = 0; row < rowSize; row++) {
-
-      // Read one row of data
-      if (fortread_4(srcBlock, colSize, fs4->swap, fs4->fd) != colSize) {
-        fprintf(stderr, "fs4plugin) Error reading data: incorrect record size.\n");
-        delete [] srcBlock;
-        return MOLFILE_ERROR;
-      }
-
-      for (col = 0; col < colSize; col++) {
-        dstBlock[index] = (float) srcBlock[col] / fs4->scale;
-        index += xyzIndexIncrement[fs4->f];
-      }
-
-      index += xyzIndexIncrement[fs4->m] - colSize*xyzIndexIncrement[fs4->f];
-    } // end for (row)
-
-    index += xyzIndexIncrement[fs4->s] - rowSize*xyzIndexIncrement[fs4->m];
-  } // end for (plane)
-
-  delete [] srcBlock;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_fs4_read(void *v) {
-  fs4_t *fs4 = (fs4_t *)v;
-
-  fclose(fs4->fd);
-  if (fs4->vol != NULL)
-    delete [] fs4->vol; 
-  delete fs4;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "fs";
-  plugin.prettyname = "FS4 Density Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "fs,fs4";
-  plugin.open_file_read = open_fs4_read;
-  plugin.read_volumetric_metadata = read_fs4_metadata;
-  plugin.read_volumetric_data = read_fs4_data;
-  plugin.close_file_read = close_fs4_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-#ifdef TEST_FS4_PLUGIN
-
-int main(int argc, char **argv) {
-  fs4_t *fs4;
-  int natoms;
-  char *filetype;
-  float *datablock;
-  
-  while (--argc) {
-    ++argv;
-
-    fs4 = (fs4_t*) open_fs4_read(*argv, "fs", &natoms);
-    if (!fs4) {
-      fprintf(stderr, "open_fs4_read failed for file %s\n", *argv);
-      return 1;
-    }
-
-    printf("a:\t%f\nb:\t%f\nc:\t%f\n",
-           fs4->vol[0].xaxis[0], fs4->vol[0].yaxis[1], fs4->vol[0].zaxis[2]);
-    printf("ncol:\t%d\nnrow:\t%d\nnplane:\t%d\n", 
-           fs4->vol[0].xsize, fs4->vol[0].ysize, fs4->vol[0].zsize);
-
-    datablock = new float[fs4->vol[0].xsize * fs4->vol[0].ysize * 
-                          fs4->vol[0].zsize];
-
-    if (read_fs4_data(fs4, 0, datablock, NULL) != 0) {
-      fprintf(stderr, "read_fs4_data failed for file %s\n", *argv);
-      return 1;
-    }
-
-    delete [] datablock;
-  }
-
-  return 0;
-}
-
-# endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gamessplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gamessplugin.c
deleted file mode 100644
index 77ae2ada8d77e12a13456e68a058a4c83a4b926b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gamessplugin.c
+++ /dev/null
@@ -1,4885 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gamessplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.211 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* *******************************************************
- *
- *          G A M E S S     P L U G I N 
- *
- * Read GAMESS-US log files.
- * This file reader is fairly robust and should be able to 
- * parse GAMESS logfiles from a wide range of versions
- * (2000-2009 tested). 
- * From the variety of data that can be found in GAMESS
- * logfiles we read coordinates, basis set, wavefunctions, 
- * gradients, hessian, charges, frequencies and a number 
- * of data describing the type of calculation.
- *
- * ********************************************************/
-
-
-/**********************************************************
-
- 
-FUNCTION CALL CHAIN
-===================
-
-Below is an overview about the hierarchy of function calls.
-Not all functions or possible branches are listed but the
-general picture is covered.
-
-The top level consists of functions defined by the 
-molfile_plugin interface: First VMD calls open_gamess_read()
-then it requests information about atoms and topology using 
-read_gamess_structure(). Note that no coordinates are provided
-at this step. Timestep independent data such as info about the
-calculation method or the basis set are provided through 
-read_gamess_rundata(). Since the allocation of these
-arrays populated for this purpose is done by VMD rather than
-the plugin, VMD needs to know the sizes beforehand. This is 
-achieved by calling read_qm_metadata() before read_qm_rundata().
-
-Next, in order to obtain the info for all timesteps VMD will call
-read_timestep_metadata(), read_qm_timestep_metadata(), and
-read_timestep() repeatedly until read_timestep() returns
-MOLFILE_ERROR indicating the end of the trajectory.
-Here too, the metadata are transferred before the main chunk
-of data.
-
-Finally, VMD calls close_gamess_read() which frees the temporary
-memory used by the plugin and closes the file.
-
-
-VMD
- |__ open_gamess_read()
- |    |__ parse_static_data()
- |        |__ get_proc_mem()
- |        |__ get_basis_options()
- |        |__ get_runtitle()
- |        |__ get_contrl()
- |        |__ get_input_structure()
- |        |    |__ get_coordinates()
- |        |
- |        |__ get_basis()
- |        |    |__ read_shell_primitives()
- |        |    |__ fill_basis_arrays()
- |        |
- |        |__ get_basis_stats()
- |        |__ get_properties_input()
- |        |__ get_int_coords()
- |        |__ get_symmetry()
- |        |__ get_guess_options()
- |        |__ get_mcscf()
- |        |__ analyze_traj()
- |        |__ read_first_frame()
- |        |    |__get_traj_frame()
- |        |        |__get_coordinates()
- |        |        |__get_scfdata()
- |        |        |__check_add_wavefunctions()
- |        |        |   |__add_wavefunction()
- |        |        |   |__get_wavefunction()
- |        |        |   |   |__read_coeff_block()
- |        |        |   |       |__angular_momentum_expon()
- |        |        |   |
- |        |        |   |__del_wavefunction()
- |        |        |
- |        |        |__get_population()
- |        |        |__get_gradient()
- |        |
- |        |__ get_final_properties()
- |             |__ get_population()
- |             |__ get_esp_charges()
- |             |__ get_final_gradient()
- |             |__ get_int_hessian()
- |             |__ get_cart_hessian()
- |             |__ get_normal_modes()
- |             |__ read_localized_orbitals()
- |        
- |
- |__ read_gamess_structure()
- |
- |__ read_gamess_metadata()
- |
- |__ read_gamess_rundata()
- |
- |
- |  DO:                         <----.
- |__ read_timestep_metadata()        |
- |__ read_qm_timestep_metadata()     |
- |__ read_timestep()                 |
- |                                   |
- |  WHILE(FRAMES)               -----' 
- |
- |
- |__ close_gamess_read()
-
- 
-
-PARSING STRATEGY
-================
-
-Because we potentially have to read quite a bit into the
-logfile in order to obtain the number of atoms required by 
-open_gamess_read(), we just parse the whole file and store 
-all timestep independent data. This process is managed by 
-parse_static_data(). Some of the static data are at the end
-of the file. Function analyze_traj() find the end of the
-trajectory and records the file pointer for the beginning
-of each frame. Thus, reading the frames when they are requested 
-later by read_timestep() is much faster without having to  
-keep large amountss of data in memory.
-
-
-**********************************************************/
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-
-#include "qmplugin.h"
-#include "unit_conversion.h"
-#include "periodic_table.h"
-
-#define ANGSTROM 0
-#define BOHR     1
-
-
-/* #define DEBUGGING 1 */
-
-/*
- * Error reporting macro for use in DEBUG mode
- */
-
-#ifdef DEBUGGING
-#define PRINTERR fprintf(stderr, "\n In file %s, line %d: \n %s \n \n", \
-                            __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-
-
-#define NOTFOUND 0
-#define FOUND    1
-#define STOPPED  2
-
-
-#define GAMESSUNKNOWN      0
-#define GAMESSPRE20050627  1
-#define GAMESSPOST20050627 2
-#define FIREFLY8PRE6695    3
-#define FIREFLY8POST6695   4
-
-/* Data specific to parsing GAMESS files */
-typedef struct 
-{
-  int  version; /* here we track the GAMESS versions, since the
-                 * file format has changed with 
-                 * version 27 JUN 2005 (R2);
-                 * version = 1  : pre-27 JUN 2005 (R2)
-                 * version = 2  : 27 JUN 2005 (R2) or later
-                 * version = 0  : version unrecognized;
-                 *                file will not be read */
-
-  int have_pcgamess; /* this flag is set to 1 if the output
-                      * file is recognized as a PC Gamess output
-                      * file; we might need to introduce a few
-                      * switches in the code depending on if
-                      * the log file is plain Gamess or PC Gamess
-                      */
-
-  int have_fmo;      /* set to 1 if this is an FMO calculation */
-
-} gmsdata;
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-/* this routine is the main gamess log file
- * parser responsible for static, i.e. 
- * non-trajectory information */
-static int parse_static_data(qmdata_t *, int *);
-
-/* for debugging */
-static void print_input_data(qmdata_t *);
-
-/* this routine checks if the current run is an
- * actual GAMESS run; returns true/false */
-static int have_gamess(qmdata_t *, gmsdata *);
-
-/* this function reads the number of processors requested */
-static int get_proc_mem(qmdata_t *, gmsdata *);
-
-/* Parse the $BASIS options*/
-static int get_basis_options(qmdata_t *);
-
-/* Determine the run title line */
-static int get_runtitle(qmdata_t *);
-
-/* Read the input atom definitions and geometry */
-static int get_input_structure(qmdata_t *data, gmsdata *gms);
-
-/* Read basis set and orbital statistics such as
- * # of shells, # of A/B orbitals, # of electrons, 
- * multiplicity and total charge */
-static int get_basis_stats(qmdata_t *);
-
-/* Read the contrl group for firefly calc and check for
- * supported RUNTYPes. Terminate the plugin
- * if an unsupported one is encountered. */
-static int get_contrl_firefly(qmdata_t *);
-
-/* Read the contrl group and check for
- * supported RUNTYPes. Terminate the plugin
- * if an unsupported one is encountered. */
-static int get_contrl(qmdata_t *);
-
-/* Read input parameters regarding calculation of 
- * certain molecular properties such as electrostatic
- * moments and the MEP. */
-static int get_properties_input(qmdata_t *);
-
-/* Read symmetry point group and highest axis */
-static int get_symmetry(qmdata_t *);
-
-/* Read in the $GUESS options */
-static int get_guess_options(qmdata_t *);
-
-/* Read MCSCF data */
-static int get_mcscf(qmdata_t *data);
-
-/* the function get_initial_info provides the atom number,
- * coordinates, and atom types and stores them
- * temporarily. */ 
-static int get_final_properties (qmdata_t *);
-
-/* Read atom coordinate block */
-static int get_coordinates(FILE *file, qm_atom_t **atoms, int unit,
-                           int *numatoms);
-
-/* Read coordinates from $FMOXYZ section in the INPUT CARD
- * listing at the beginning of the file. */
-static int get_fmoxyz(FILE *file, qm_atom_t **atoms, int unit,
-                      int *numatoms);
-
-/* Read the basis set data */
-static int get_basis (qmdata_t *);
-
-/* Read all primitives for the current shell */
-static int read_shell_primitives(qmdata_t *, prim_t **prim,
-                                 char *shelltype, int icoeff, int pcgamess);
-
-/* convert shell type from char to int */
-static int shelltype_int(char type);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(qmdata_t *);
-
-/* Read the first trajectory frame. */
-static int read_first_frame(qmdata_t *);
-
-/* Read next trajectory frame. */
-static int get_traj_frame(qmdata_t *, qm_atom_t *, int);
-
-/* returns 1 if the optimization has converged */
-static int analyze_traj(qmdata_t *, gmsdata *);
-
-/* read the number of scf iterations and the scf energies
- * for the current timestep. */
-static int get_scfdata(qmdata_t *, qm_timestep_t *);
-
-/* Reads a set of wavefunctions for the current timestep.
- * (typically alpha and beta spin wavefunctions) */
-static int check_add_wavefunctions(qmdata_t *data,
-                                   qm_timestep_t *ts);
-
-/* Parse the wavefunction. */
-static int get_wavefunction(qmdata_t *, qm_timestep_t *, qm_wavefunction_t *);
-
-/* Read the wavefunction coefficients. */
-static int read_coeff_block(FILE *file, int wavef_size,
-                              float *wave_coeff, int *angular_momentum);
-
-/* Read localized orbitals (Boys/Ruedenberg/Pipek) */
-static int read_localized_orbitals(qmdata_t *data);
-
-/* Read population analysis (Mulliken and Lowdin charges) */
-static int get_population(qmdata_t *, qm_timestep_t *);
-
-/* Read the energy gradient for each atom. */
-static int get_gradient(qmdata_t *, qm_timestep_t *ts);
-
-/* Read energy gradient from final traj step. */
-static int get_final_gradient(qmdata_t *, qm_timestep_t *ts);
-
-/* Read ESP charges. */
-static int get_esp_charges(qmdata_t *data);
-
-/* For runtyp=HESSIAN, this subroutine scans the file for 
- * the hessian matrix in internal coordinates 
- * as well as the internal coordinate information */
-static int get_int_coords(qmdata_t *);
-
-/* get Hessian matrix in internal coordinates */
-static int get_int_hessian(qmdata_t *);
-
-/* For runtyp=HESSIAN, this subroutine scans the file for 
- * the cartesian hessian matrix */ 
-static int get_cart_hessian(qmdata_t *);
-
-/* For runtyp=HESSIAN, this subroutine reads the frequencies
- * and intensities of the normal modes */
-static int get_normal_modes(qmdata_t *);
-
-
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the GAMESS logfile and get the number
- * of atoms.
- * We are also reading all the static (i.e. non-trajectory)
- * data here since we have to parse a bit to get the atom count
- * anyway. These data will then be provided to VMD by
- * read_gamess_metadata() and read_gamess_rundata().
- *
- * *************************************************************/
-static void *open_gamess_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  qmdata_t *data = NULL;
-  gmsdata *gms;
-
-  /* open the input file */
-  fd = fopen(filename, "rb");
- 
-  if (!fd) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* allocate and initialize main data structure */
-  data = init_qmdata();
-
-  /* make sure memory was allocated properly */
-  if (data == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* allocate GAMESS specific data */
-  gms = (gmsdata *)calloc(1,sizeof(gmsdata));
-  data->format_specific_data = gms;
-
-  gms->version = 0;
-  gms->have_pcgamess = 0;
-  gms->have_fmo = 0;
-
-
-  /* store file pointer and filename in gamess struct */
-  data->file = fd;
-
-
-  /* check if the file is GAMESS format; if yes
-   * parse it, if no exit */
-  if (have_gamess(data, gms)==TRUE) {
-    if (gms->have_pcgamess) {
-      printf("gamessplugin) Warning: PC GAMESS/FIREFLY is not yet fully supported!\n");
-    //  return NULL;
-    }
-    /* if we're dealing with an unsupported GAMESS
-     * version, we better quit */
-    if (gms->version==GAMESSUNKNOWN) {
-      printf("gamessplugin) GAMESS version %s not supported. \n",
-             data->version_string);
-      return NULL;
-    }
-
-    /* get the non-trajectory information from the log file */    
-    if (parse_static_data(data, natoms) == FALSE) 
-      return NULL;
-  }
-  else {
-    printf("gamessplugin) This seems to not be a GAMESS logfile.\n");
-    return NULL;
-  }
-
-  return data;
-}
-
-
-/************************************************************
- * 
- * Provide VMD with the structure of the molecule, i.e the
- * atoms coordinates names, etc.
- *
- *************************************************************/
-static int read_gamess_structure(void *mydata, int *optflags, 
-                      molfile_atom_t *atoms) 
-{
-  qmdata_t *data = (qmdata_t *)mydata;
-  qm_atom_t *cur_atom;
-  molfile_atom_t *atom;
-  int i = 0;
- 
-  /* optional atomic number provided */
-  *optflags = MOLFILE_ATOMICNUMBER;
-  /*  if (data->have_mulliken) 
-   *optflags |= MOLFILE_CHARGE;*/
-
-  /* all the information I need has already been read in
-   * via the initial scan and I simply need to copy 
-   * everything from the temporary arrays into the 
-   * proper VMD arrays.
-   * Since there are no atom names in the GAMESS output
-   * I use the atom type here --- maybe there is a better
-   * way to do this !!?? */
-
-  /* get initial pointer for atom array */
-  cur_atom = data->atoms;
-
-  for(i=0; i<data->numatoms; i++) {
-    atom = atoms+i;
-    strncpy(atom->name, cur_atom->type, sizeof(atom->name)); 
-    strncpy(atom->type, cur_atom->type, sizeof(atom->type));
-    strncpy(atom->resname,"", sizeof(atom->resname)); 
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->atomicnumber = cur_atom->atomicnum;
-#ifdef DEBUGGING
-    printf("gamessplugin) atomicnum[%d] = %d\n", i, atom->atomicnumber);
-#endif
-
-    /* if (data->have_mulliken)
-      atom->charge = data->qm_timestep->mulliken_charges[i];
-    */
-    cur_atom++;
-  }
- 
-  return MOLFILE_SUCCESS; 
-}
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_gamess_metadata(void *mydata, 
-    molfile_qm_metadata_t *metadata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  if (data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    metadata->ncart = (3*data->numatoms);
-    metadata->nimag = data->nimag;             
-   
-    if (data->have_internals) {
-      metadata->nintcoords = data->nintcoords; 
-    } else {
-      metadata->nintcoords = 0;
-    }
-  }
-  else {
-    metadata->ncart = 0;
-    metadata->nimag = 0;
-    metadata->nintcoords = 0;
-  }
-
-  /* orbital data */
-  metadata->num_basis_funcs = data->num_basis_funcs;
-  metadata->num_basis_atoms = data->num_basis_atoms;
-  metadata->num_shells      = data->num_shells;
-  metadata->wavef_size      = data->wavef_size;  
-
-#if vmdplugin_ABIVERSION > 11
-  /* system and run info */
-  metadata->have_sysinfo = 1;
-
-  /* hessian info */
-  metadata->have_carthessian = data->have_cart_hessian;
-  metadata->have_inthessian  = data->have_int_hessian;
-
-  /* normal mode info */
-  metadata->have_normalmodes = data->have_normal_modes;
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_gamess_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i, j;
-  int ncart;
-  molfile_qm_hessian_t *hessian_data = &qm_data->hess;
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-  molfile_qm_sysinfo_t *sys_data     = &qm_data->run;
-
-  /* fill in molfile_qm_hessian_t */
-  if (data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    ncart = 3*data->numatoms;
-
-    /* Hessian matrix in cartesian coordinates */
-    if (data->have_cart_hessian) {
-      for (i=0; i<ncart; i++) {
-        for (j=0; j<=i; j++) {
-          hessian_data->carthessian[ncart*i+j] = data->carthessian[ncart*i+j];
-          hessian_data->carthessian[ncart*j+i] = data->carthessian[ncart*i+j];
-        }
-      }
-    }
-
-    /* Hessian matrix in internal coordinates */
-    if (data->have_int_hessian) {
-      for (i=0; i<(data->nintcoords)*(data->nintcoords); i++) {
-        hessian_data->inthessian[i] = data->inthessian[i];
-      }
-    }
-
-    /* wavenumbers, intensities, normal modes */
-    if (data->have_normal_modes) {
-      for (i=0; i<ncart*ncart; i++) {
-        hessian_data->normalmodes[i] = data->normal_modes[i];
-      }
-      for (i=0; i<ncart; i++) {
-        hessian_data->wavenumbers[i] = data->wavenumbers[i];
-        hessian_data->intensities[i] = data->intensities[i];
-      }
-    }
-
-    /* imaginary modes */
-    for (i=0; i<data->nimag; i++) {
-      /*printf("imag_modes[%d]=%d\n", i, data->imag_modes[i]);*/
-      hessian_data->imag_modes[i] = data->imag_modes[i];
-    }
-  }
-
-  /* fill in molfile_qm_sysinfo_t */
-  sys_data->runtype = data->runtype;
-  sys_data->scftype = data->scftype;
-  sys_data->nproc   = data->nproc;
-  sys_data->num_electrons  = data->num_electrons;
-  sys_data->totalcharge    = data->totalcharge;
-  sys_data->num_occupied_A = data->num_occupied_A;
-  sys_data->num_occupied_B = data->num_occupied_B;
-  sys_data->status         = data->status;
-
-
-  strncpy(sys_data->basis_string, data->basis_string,
-          sizeof(sys_data->basis_string));
-
-  sys_data->memory = 0; /* XXX fixme */
-
-  strncpy(sys_data->runtitle, data->runtitle, sizeof(sys_data->runtitle));
-  strncpy(sys_data->geometry, data->geometry, sizeof(sys_data->geometry));
-  strncpy(sys_data->version_string, data->version_string,
-          sizeof(sys_data->version_string));
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->num_basis_atoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-      basis_data->atomic_number[i] = data->atomicnum_per_basisatom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_types[i] = data->shell_types[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-
-    for (i=0; i<3*data->wavef_size; i++) {
-      basis_data->angular_momentum[i] = data->angular_momentum[i];
-    }
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-
-
-#if vmdplugin_ABIVERSION > 11
-
-/***********************************************************
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***********************************************************
- * Provide QM metadata for next timestep. 
- * This actually triggers reading the entire next timestep
- * since we have to parse the whole timestep anyway in order
- * to get the metadata. So we store the read data locally
- * and hand them to VMD when requested by read_timestep().
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  int have = 0;
-
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  meta->count = -1; /* Don't know the number of frames yet */
-
-  if (data->num_frames_read > data->num_frames_sent) {
-    have = 1;
-  }
-  else if (data->num_frames_read < data->num_frames) {
-    /*printf("gamessplugin) Probing timestep %d\n", data->num_frames_read);*/
-
-    have = get_traj_frame(data, data->atoms, data->numatoms);
-  }
-
-  if (have) {
-    int i;
-    qm_timestep_t *cur_ts;
-
-    /* get a pointer to the current qm timestep */
-    cur_ts = data->qm_timestep+data->num_frames_sent;
-    
-    for (i=0; (i<MOLFILE_MAXWAVEPERTS && i<cur_ts->numwave); i++) {
-      meta->num_orbitals_per_wavef[i] = cur_ts->wave[i].num_orbitals;
-      meta->has_occup_per_wavef[i]    = cur_ts->wave[i].has_occup;
-      meta->has_orben_per_wavef[i]    = cur_ts->wave[i].has_orben;
-    }
-    meta->wavef_size      = data->wavef_size;
-    meta->num_wavef       = cur_ts->numwave;
-    meta->num_scfiter     = cur_ts->num_scfiter;
-    meta->num_charge_sets = cur_ts->have_mulliken +
-      cur_ts->have_lowdin + cur_ts->have_esp;
-    if (cur_ts->gradient) meta->has_gradient = TRUE;
-
-  } else {
-    meta->has_gradient = FALSE;
-    meta->num_scfiter  = 0;
-    meta->num_orbitals_per_wavef[0] = 0;
-    meta->has_occup_per_wavef[0] = FALSE;
-    meta->num_wavef = 0;
-    meta->wavef_size = 0;
-    meta->num_charge_sets = 0;
-    data->trajectory_done = TRUE;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * This function provides the data of the next timestep.
- * Here we actually don't read the data from file, that had
- * to be done already upon calling read_timestep_metadata().
- * Instead we copy the stuff from the local data structure
- * into the one's provided by VMD.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-			 molfile_qm_timestep_t *qm_ts) 
-{
-  qmdata_t *data = (qmdata_t *)mydata;
-  qm_timestep_t *cur_ts;
-  int offset;
-  int i = 0;
-  int num_charge_sets = 0;
-
-  if (data->trajectory_done == TRUE) return MOLFILE_ERROR;
-
-
-  /* copy the coordinates */
-  for (i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = data->atoms[i].x;
-    ts->coords[3*i+1] = data->atoms[i].y;
-    ts->coords[3*i+2] = data->atoms[i].z; 
-  }    
-  
-  /* get a convenient pointer to the current qm timestep */
-  cur_ts = data->qm_timestep+data->num_frames_sent;
-
-  /* store the SCF energies */
-  for (i=0; i<cur_ts->num_scfiter; i++) {
-    qm_ts->scfenergies[i] = cur_ts->scfenergies[i];
-  }
-
-  /* store gradients */
-  if (cur_ts->gradient) {
-    for (i=0; i<3*natoms; i++) {
-      qm_ts->gradient[i] = cur_ts->gradient[i];
-    }
-  }
-
-  /* store charge sets*/
-  if (cur_ts->have_mulliken) {
-    offset = num_charge_sets*data->numatoms;
-    for (i=0; i<data->numatoms; i++) {
-      qm_ts->charges[offset+i] = cur_ts->mulliken_charges[i];
-    }
-    qm_ts->charge_types[num_charge_sets] = MOLFILE_QMCHARGE_MULLIKEN;
-    num_charge_sets++;
-  }
-
-  if (cur_ts->have_lowdin) {
-    offset = num_charge_sets*data->numatoms;
-    for (i=0; i<data->numatoms; i++) {
-      qm_ts->charges[offset+i] = cur_ts->lowdin_charges[i];
-    }
-    qm_ts->charge_types[num_charge_sets] = MOLFILE_QMCHARGE_LOWDIN;
-    num_charge_sets++;
-  }
-  if (cur_ts->have_esp) {
-    offset = num_charge_sets*data->numatoms;
-    for (i=0; i<data->numatoms; i++) {
-      qm_ts->charges[offset+i] = cur_ts->esp_charges[i];
-    }
-    qm_ts->charge_types[num_charge_sets] = MOLFILE_QMCHARGE_ESP;
-    num_charge_sets++;
-  }
-
-
-  /* store the wave function and orbital energies */
-  if (cur_ts->wave) {
-    for (i=0; i<cur_ts->numwave; i++) {
-      qm_wavefunction_t *wave = &cur_ts->wave[i];
-      qm_ts->wave[i].type         = wave->type;
-      qm_ts->wave[i].spin         = wave->spin;
-      qm_ts->wave[i].excitation   = wave->exci;
-      qm_ts->wave[i].multiplicity = wave->mult;
-      qm_ts->wave[i].energy       = wave->energy;
-      strncpy(qm_ts->wave[i].info, wave->info, MOLFILE_BUFSIZ);
-
-      if (wave->wave_coeffs) {
-        memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-               wave->num_orbitals*data->wavef_size*sizeof(float));
-      }
-      if (wave->orb_energies) {
-        memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-               wave->num_orbitals*sizeof(float));
-      }
-      if (wave->has_occup) {
-        memcpy(qm_ts->wave[i].occupancies, wave->orb_occupancies,
-               wave->num_orbitals*sizeof(float));
-      }
-    }
-  }
-
-  if (data->runtype == MOLFILE_RUNTYPE_ENERGY || 
-      data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    /* We have only a single point */
-    data->trajectory_done = TRUE;
-  }
-
-  data->num_frames_sent++;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-/**********************************************************
- *
- * close file and free memory
- *
- **********************************************************/
-static void close_gamess_read(void *mydata) {
-
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->atoms);
-  free(data->basis);
-  free(data->shell_types);
-  free(data->atomicnum_per_basisatom);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->bonds);
-  free(data->angles);
-  free(data->dihedrals);
-  free(data->impropers);
-  free(data->internal_coordinates);
-  free(data->bond_force_const);
-  free(data->angle_force_const);
-  free(data->dihedral_force_const);
-  free(data->improper_force_const);
-  free(data->inthessian);
-  free(data->carthessian);
-  free(data->wavenumbers);
-  free(data->intensities);
-  free(data->normal_modes);
-  free(data->imag_modes);
-  free(data->angular_momentum);
-  free(data->filepos_array);
-
-  if (data->basis_set) {
-    for(i=0; i<data->num_basis_atoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  for (i=0; i<data->num_frames; i++) {
-    free(data->qm_timestep[i].scfenergies);
-    free(data->qm_timestep[i].gradient);
-    free(data->qm_timestep[i].mulliken_charges);
-    free(data->qm_timestep[i].lowdin_charges);
-    free(data->qm_timestep[i].esp_charges);
-    for (j=0; j<data->qm_timestep[i].numwave; j++) {
-      free(data->qm_timestep[i].wave[j].wave_coeffs);
-      free(data->qm_timestep[i].wave[j].orb_energies);
-      free(data->qm_timestep[i].wave[j].orb_occupancies);
-    }
-    free(data->qm_timestep[i].wave);
-  }
-  free(data->qm_timestep);
-  free(data->format_specific_data);
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-
-/********************************************************
- *
- * Main gamess log file parser responsible for static,  
- * i.e. non-trajectory information.
- *
- ********************************************************/
-static int parse_static_data(qmdata_t *data, int *natoms) 
-{
-  /* Cast GAMESS specific data */
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-
-
-  /* Read # of procs and amount of requested memory */
-  get_proc_mem(data, gms);
-
-  /* Read the $BASIS options */
-  if (!get_basis_options(data))   return FALSE;
-
-  /* Read the run title */
-  if (!get_runtitle(data))        return FALSE;
-
-  /* Read the $CONTRL group;
-   * It actually appears after the basis stats in the
-   * output file but we jump ahead and read it here
-   * because we need the units (ANGS/BOHR) before
-   * reading the input structure. */
-  if (gms->have_pcgamess){
-    if (!get_contrl_firefly(data))          return FALSE;
-  }
-  else {
-    if (!get_contrl(data))          return FALSE;
-  }
-
-  /* Read the input atom definitions and geometry */
-  if (!get_input_structure(data, gms)) return FALSE;
-
-  /* Read the basis set */
-  if (!get_basis(data))           return FALSE; 
-
-  /* Read the number of orbitals, electrons, 
-   * charge, multiplicity, ... */
-  if (!get_basis_stats(data))     return FALSE;
-
-  /* Read input parameters regarding calculation of 
-   * certain molecular properties such as electrostatic
-   * moments and the MEP. */
-  if (!get_properties_input(data)) return FALSE;
-
-  /* Read internal coordinates */
-  get_int_coords(data);
-
-  /* Read symmetry point group and highest axis */
-  if (!get_symmetry(data))         return FALSE;
-
-  /* Read the $GUESS options */
-  get_guess_options(data);
-
-  if (data->scftype==MOLFILE_SCFTYPE_MCSCF) {
-    if (!get_mcscf(data))          return FALSE;
-  }
-
-  /* Find the end of the trajectory and count the
-   * frames on the way.
-   * If no regular end is found we won't find any
-   * properties to read and return. */
-  if (!analyze_traj(data, gms)) {
-    printf("gamessplugin) WARNING: Truncated or abnormally terminated file!\n\n");
-  }
-
-
-  /* provide VMD with the proper number of atoms */
-  *natoms = data->numatoms;
-
-  /* Read the first frame*/
-  read_first_frame(data);
-
-  /* Read the properties at the end of a calculation */
-  get_final_properties(data);
-
-#ifdef DEBUGGING 
-  printf("gamessplugin) num_frames_read = %d\n", data->num_frames_read);
-  printf("gamessplugin) num_frames_sent = %d\n", data->num_frames_sent);
-
-  /* Test print the parsed data in same format as logfile */
-  print_input_data(data);
-#endif
-
-  return TRUE;
-}
-
-
-#define TORF(x) (x ? "T" : "F")
-
-static void print_input_data(qmdata_t *data) {
-  int i, j, k;
-  int primcount=0;
-  int shellcount=0;
-
-  printf("\nDATA READ FROM FILE:\n\n");
-  printf(" %10s WORDS OF MEMORY AVAILABLE\n", data->memory);
-  printf("\n");
-  printf("     BASIS OPTIONS\n");
-  printf("     -------------\n");
-  printf("%s\n", data->basis_string);
-  printf("\n\n\n");
-  printf("     RUN TITLE\n");
-  printf("     ---------\n");
-  printf(" %s\n", data->runtitle);
-  printf("\n");
-  printf(" THE POINT GROUP OF THE MOLECULE IS %s\n", "XXX");
-  printf(" THE ORDER OF THE PRINCIPAL AXIS IS %5i\n", 0);
-  printf("\n");
-  printf(" YOUR FULLY SUBSTITUTED Z-MATRIX IS\n");
-  printf("\n");
-  printf(" THE MOMENTS OF INERTIA ARE (AMU-ANGSTROM**2)\n");
-  printf(" IXX=%10.3f   IYY=%10.3f   IZZ=%10.3f\n", 0.0, 0.0, 0.0);
-  printf("\n");
-  printf(" ATOM      ATOMIC                      COORDINATES (BOHR)\n");
-  printf("           CHARGE         X                   Y                   Z\n");
-  for (i=0; i<data->numatoms; i++) {
-    printf(" %-8s %6d", data->atoms[i].type, data->atoms[i].atomicnum);
-    
-    printf("%17.10f",   ANGS_TO_BOHR*data->atoms[i].x);
-    printf("%20.10f",   ANGS_TO_BOHR*data->atoms[i].y);
-    printf("%20.10f\n", ANGS_TO_BOHR*data->atoms[i].z);
-  }
-  printf("\n");
-  printf("     ATOMIC BASIS SET\n");
-  printf("     ----------------\n");
-  printf(" THE CONTRACTED PRIMITIVE FUNCTIONS HAVE BEEN UNNORMALIZED\n");
-  printf(" THE CONTRACTED BASIS FUNCTIONS ARE NOW NORMALIZED TO UNITY\n");
-  printf("\n");
-  printf("  SHELL TYPE  PRIMITIVE        EXPONENT          CONTRACTION COEFFICIENT(S)\n");
-  printf("\n");
-
-#if 0
-  for (i=0; i<data->numatoms; i++) {
-    printf("%-8s\n\n", data->atoms[i].type);
-    printf("\n");
-    printf("nshells=%d\n", data->num_shells_per_atom[i]);
-
-    for (j=0; j<data->num_shells_per_atom[i]; j++) {
-      printf("nprim=%d\n", data->num_prim_per_shell[shellcount]);
-
-      for (k=0; k<data->num_prim_per_shell[shellcount]; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j, data->shell_types[shellcount],
-               primcount+1, data->basis[2*primcount], data->basis[2*primcount+1]);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-#endif
-  printf("gamessplugin) =================================================================\n");
-  for (i=0; i<data->num_basis_atoms; i++) {
-    printf("%-8s (%10s)\n\n", data->atoms[i].type, data->basis_set[i].name);
-    printf("\n");
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j,
-               data->basis_set[i].shell[j].type,
-               primcount+1,
-               data->basis_set[i].shell[j].prim[k].exponent,
-               data->basis_set[i].shell[j].prim[k].contraction_coeff);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-  printf("\n");
-  printf(" TOTAL NUMBER OF BASIS SET SHELLS             =%5d\n", data->num_shells);
-  printf(" NUMBER OF CARTESIAN GAUSSIAN BASIS FUNCTIONS =%5d\n", data->wavef_size);
-  printf(" NUMBER OF ELECTRONS                          =%5d\n", data->num_electrons);
-  printf(" CHARGE OF MOLECULE                           =%5d\n", data->totalcharge);
-  printf(" SPIN MULTIPLICITY                            =%5d\n", data->multiplicity);
-  printf(" NUMBER OF OCCUPIED ORBITALS (ALPHA)          =%5d\n", data->num_occupied_A);
-  printf(" NUMBER OF OCCUPIED ORBITALS (BETA )          =%5d\n", data->num_occupied_B);
-  printf(" TOTAL NUMBER OF ATOMS                        =%5i\n", data->numatoms);
-  printf("\n");
-}
-
-
-
-/**********************************************************
- *
- * this subroutine checks if the provided files is
- * actually a GAMESS file;
- *
- **********************************************************/
-static int have_gamess(qmdata_t *data, gmsdata *gms) 
-{
-  char word[3][BUFSIZ];
-  char buffer[BUFSIZ];
-  char versionstr[BUFSIZ];
-  int day, year;
-  char month[BUFSIZ], rev[BUFSIZ];
-  int i = 0;
-  int program;
-  int ver,build;
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-
-  /* check if the file is GAMESS format */
-  program = goto_keyline(data->file,
-                          "PC GAMESS version",
-                          "GAMESS VERSION =", 
-                          "Firefly version",NULL);
-  if (program==1) {
-    gms->have_pcgamess = 1;
-    gms->version = 1;
-    strcpy(data->version_string, "PC GAMESS ");
-  } else if (program==2) {
-    gms->have_pcgamess = 0;
-    strcpy(data->version_string, "GAMESS ");
-  } else if (program==3) {
-    gms->have_pcgamess = 1;
-    gms->version = FIREFLY8PRE6695;
-    strcpy(data->version_string, "Firefly ");
-  } else {
-    printf("gamessplugin) This is no GAMESS/PCGAMESS/Firefly logfile!\n");
-    return FALSE;
-  }
-
-  GET_LINE(buffer, data->file);
-
-  if (gms->have_pcgamess) {
-    if (strstr(buffer,"version") != NULL) {
-      strncpy(versionstr, strstr(buffer,"version")+8, 16);
-      *strchr(versionstr, ' ') = '\0';
-      sscanf(buffer, "%*s %*s %*s %*s %*s %*s %d", &build);
-      sscanf(versionstr, "%1d%*s", &ver);
-      printf("gamessplugin) Firefly build = %d %d\n", 
-         ver,build);
-      if (ver >= 8 && build >= 6695)
-        gms->version = FIREFLY8POST6695;
-      else
-        gms->version = FIREFLY8PRE6695;
-    }
-  } else {
-    /* extract the version number if possible; otherwise
-     * return empty string */
-    if (strstr(buffer,"=") != NULL) {
-      strncpy(versionstr, strstr(buffer,"=")+2, 16);
-      versionstr[16] = '\0';
-    }
-    
-    /* determine if we're dealing with pre-"27 JUN 2005"
-     * version */
-    sscanf(versionstr, "%d %s %d %s", &day, month, &year, rev);
-    
-    if ( ( year >= 2006 ) ||
-         ( year == 2005 && !strcmp(month,"JUN") ) ||
-         ( year == 2005 && !strcmp(month,"NOV") ) ||
-         ( year == 2005 && !strcmp(month,"DEC") ) )
-      {
-        gms->version = GAMESSPOST20050627;
-      } else { 
-        gms->version = GAMESSPRE20050627;
-      }
-  }
-
-  strcat(data->version_string, versionstr);
-
-  printf("gamessplugin) Version = %s\n", 
-         data->version_string);
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * this subroutine reads the number of procs and the amount
- * of memory requested
- *
- **********************************************************/
-static int get_proc_mem(qmdata_t *data, gmsdata *gms) {
-
-  char word[4][BUFSIZ];
-  char buffer[BUFSIZ];
-  char *temp;
-  int nproc;
-  int i;
-
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  rewind(data->file);
-
-  
-  /* scan for the number of processors; here we need
-   * distinguish between vanilla Gamess and PC Gamess */
-  if (gms->have_pcgamess == 1) {
-    /* XXX for now we fake ncpu = 1 until we know exactly
-     *     how the output format looks like */
-    nproc = 1;
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s %d %s",&word[0][0],&nproc,&word[1][0]);
-        if (!strcmp(&word[0][0],"PARALLEL") &&
-               !strcmp(&word[0][1],"RUNNING")) {
-            sscanf(buffer,"%*s %*s %*s %*s %*s %d %*s %*s",&nproc);
-            break;
-        }
-      } while (strcmp(&word[0][0],"ECHO") || 
-               strcmp(&word[1][0],"THE") );
-
-  }
-  else {
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s %d %s",&word[0][0],&nproc,&word[1][0]);
-
-      if (!strcmp(&word[0][0],"Initiating") &&
-          !strcmp(&word[1][0],"compute")) {
-        break;
-      }
-
-      else if (!strcmp(&word[0][0],"Initiating") &&
-               !strcmp(&word[1][0],"processes")) {
-        break;
-      }
-
-      /* Some versions */
-      else if (!strcmp(&word[0][0],"PARALLEL") &&
-               !strcmp(&word[0][1],"RUNNING")) {
-        sscanf(buffer,"%*s %*s %*s %*s %d %*s",&nproc);
-        break;
-      }
-
-    } while (strcmp(&word[0][0],"ECHO") || 
-             strcmp(&word[1][0],"THE") );
-  }
-  
-  /* store the number of processors */
-  data->nproc = nproc;
-
-  
-  /* scan for the amount of memory requested */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-
-  } while( strcmp(&word[0][0],"$SYSTEM") || 
-           strcmp(&word[1][0],"OPTIONS") );
-
-  eatline(data->file, 1);
-
-
-  /* next line contains the amount of memory requested,
-   * vanilla Gamess and PC Gamess need separate treatment */
-  if (gms->have_pcgamess == 1) {
-    GET_LINE(buffer, data->file);
-
-    /* store it */
-    if ((temp = strstr(buffer,"MEMORY=")+8)==NULL) return FALSE;
-    strncpy(data->memory,trimright(temp),sizeof(data->memory));
-  }
-  else {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s %s %s",&word[0][0],&word[1][0],&word[2][0]);
-
-    /* store it */
-    strncpy(data->memory,&word[2][0],sizeof(data->memory));
-  }
-
-  printf("gamessplugin) GAMESS used %d compute processes \n", nproc);
-  printf("gamessplugin) GAMESS used %s words of memory \n", data->memory);
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Extract the $BASIS options
- *
- **********************************************************/
-static int get_basis_options(qmdata_t *data) {
-
-  char buffer[BUFSIZ];
-  char diffuse[BUFSIZ];
-  char polarization[BUFSIZ];
-  int ngauss;
-
-  buffer[0] = '\0';
-  diffuse[0] = '\0';
-  polarization[0] = '\0';
-
-  /* The $BASIS section is somewhere at the beginning of
-   * the file. Rewind to be sure not to miss it. */
-  rewind(data->file);
-
-  /* start scanning */
-  if (pass_keyline(data->file, "BASIS OPTIONS",
-                    "RUN TITLE") != FOUND) {
-    /* No Basis options section found
-     * (basis was entered explicitly) */
-    return TRUE;
-  }
-
-  eatline(data->file, 1);
-
-
-  /* the first string in the current line contains the
-   * GBASIS used; copy it over into the gbasis variable
-   * of qmdata_t */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer," GBASIS=%s IGAUSS= %d", data->gbasis, &ngauss);
- 
-
-  /* in case we're using a pople style basis set, i.e. 
-   * GBASIS=N311,N31,N21 or STO we also scan for the number 
-   * of gaussians, as well as p,d,f and diffuse functions
-   * and use this info to assemble a "basis set string" */
-  if ( !strncmp(data->gbasis,"N311",sizeof(data->gbasis)) ||
-       !strncmp(data->gbasis,"N31",sizeof(data->gbasis)) ||
-       !strncmp(data->gbasis,"N21",sizeof(data->gbasis)) ||
-       !strncmp(data->gbasis,"STO",sizeof(data->gbasis)) ) 
-  {
-    int npfunc, ndfunc, nffunc;
-    int diffs=FALSE, diffsp=FALSE;
-    char torf;
-
-    /* the next line gives us the d,f and diffuse sp
-     * functions */
-    GET_LINE(buffer, data->file);
-    if (sscanf(buffer," NDFUNC= %d NFFUNC= %d DIFFSP= %c",
-               &ndfunc, &nffunc, &torf) != 3) {
-      sscanf(buffer," NDFUNC= %d DIFFSP= %c", &ndfunc, &torf);
-    }
-
-    /* convert GAMESS' .TRUE./.FALSE. for DIFFSP into 1/0 */
-    if (torf=='T') diffsp = TRUE;
-
-
-    /* the next line gives us the p and diffuse s
-     * functions */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer," NPFUNC= %d DIFFS= %c", &npfunc, &torf);
-
-    /* convert GAMESS' .TRUE./.FALSE. for DIFFSP into 1/0 */
-    if (torf=='T') diffs = TRUE;
-
-
-    /* now we need some logic to assemble this info into
-     * some nice looking string a la "6-31G*" */
-
-    /* create the diffuse function string */
-    if (diffs && diffsp) {
-    	strncpy(diffuse,"++",sizeof(diffuse));
-    }
-    else if (diffsp) {
-    	strncpy(diffuse,"+",sizeof(diffuse));
-    }
-    else {
-    	strncpy(diffuse,"",sizeof(diffuse));
-    }
-
-
-    /* create the polarization function string */
-    if (npfunc>0 && ndfunc>0 && nffunc>0) {
-      sprintf(polarization, "(%dp,%dd,%df)", npfunc, ndfunc, nffunc);
-    } else if (npfunc>0 && ndfunc>0) {
-      sprintf(polarization, "(%dp,%dd)", npfunc, ndfunc);
-    }
-    else if (npfunc>0) {
-      sprintf(polarization, "(%dp)", npfunc);
-    }
-    else if (ndfunc>0) {
-      sprintf(polarization, "(%dd)", ndfunc);
-    } 
-    else {
-      strncpy(polarization, "", sizeof(polarization));
-    } 
-
-    /* assemble the bits */ 
-    if (!strcmp(data->gbasis, "STO")) {
-      sprintf(data->basis_string, "STO-%dG%s%s",
-              ngauss, diffuse, polarization);
-    }
-    else {
-      sprintf(data->basis_string, "%d-%s%sG%s",
-              ngauss, (data->gbasis+1), diffuse, 
-              polarization);
-    }      
-  }
-
-  /* cc-pVnZ and cc-pCVnZ */
-  else if (!strncmp(data->gbasis, "CC",  2)) {
-    strcpy(data->basis_string, "cc-p");
-    if (strlen(data->gbasis)==4 && data->gbasis[3]=='C') {
-      strcat(data->basis_string, "C");
-    }
-    strcat(data->basis_string, "V");
-    strncat(data->basis_string, &data->gbasis[2], 1);
-    strcat(data->basis_string, "Z");
-  }
-
-  /* aug-cc-pVnZ and aug-cc-pCVnZ */
-  else if (!strncmp(data->gbasis, "ACC", 3)) {
-    strcpy(data->basis_string, "aug-cc-p");
-    if (strlen(data->gbasis)==5 && data->gbasis[4]=='C') {
-      strcat(data->basis_string, "C");
-    }
-    strcat(data->basis_string, "V");
-    strncat(data->basis_string, &data->gbasis[3], 1);
-    strcat(data->basis_string, "Z");
-  }
-
-  /* for non Pople style basis sets we just use the GBASIS
-   * for the basis string;
-   * TODO: make the basis_string more comprehensive for non
-   *       pople-style basis sets */
-  else {
-    strncpy(data->basis_string,data->gbasis,
-            sizeof(data->basis_string));
-  }
-
-  return TRUE;
-}
-
-
-
-/**********************************************************
- *
- * Extract the run title line
- *
- **********************************************************/
-static int get_runtitle(qmdata_t *data) {
-
-  char buffer[BUFSIZ];
-
-  if (pass_keyline(data->file, "RUN TITLE",
-                   "THE POINT GROUP") != FOUND) {
-    /* This is most likely a broken file, but who knows. 
-     * Since we don't really care about the title string
-     * we go on here without error. */
-    data->runtitle[0] = '\0';
-    return TRUE;
-  }
-
-  GET_LINE(buffer, data->file);
-  strncpy(data->runtitle,trimright(buffer),sizeof(data->runtitle));
-
-  return TRUE;
-} 
-
-
-/**********************************************************
- *
- * Read the input atom definitions and geometry
- *
- **********************************************************/
-static int get_input_structure(qmdata_t *data, gmsdata *gms) {
-  char buffer[BUFSIZ];
-  char units[BUFSIZ];
-  int numatoms = -1;
-  int bohr;
-  long filepos;
-  filepos = ftell(data->file);
-
-  /* See if we find the "ATOM      ATOMIC ..." line before 
-   * any of the three stopstrings mrking the beginning of
-   * possible following sections. */
-  if (goto_keyline(data->file,
-         "ATOM      ATOMIC                      COORDINATES (",
-         "INTERNUCLEAR DISTANCES",
-         "ATOMIC BASIS SET",
-         "$CONTRL OPTIONS", NULL) == FOUND) {
-
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, " ATOM      ATOMIC  %*s  %s", units);
-    eatline(data->file, 1);
-
-  } else {
-    /* This is probably an FMO calc.; if so, set flag. */
-    fseek(data->file, filepos, SEEK_SET);
-    if (pass_keyline(data->file,
-                     "The Fragment Molecular Orbital (FMO) method.", 
-                     NULL)) {
-      gms->have_fmo = 1;
-      printf("gamessplugin) Fragment Molecular Orbital (FMO) method.\n");
-    }
-
-    /* We didn't find the normal input section.
-     * Let's see i we can find coordinates for the first
-     * frame of a trajectory. */
-    fseek(data->file, filepos, SEEK_SET);
-    if (pass_keyline(data->file,
-                      "BEGINNING GEOMETRY SEARCH POINT NSERCH=   0",
-                      NULL) &&
-        goto_keyline(data->file, "COORDINATES OF ALL ATOMS", NULL)) {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer, " COORDINATES OF ALL ATOMS ARE %s", units);
-      eatline(data->file, 2);
-
-    } else {
-      /* As last resort look for FMO coordinates in the
-       * INPUT CARD section: */
-
-      /* But first we have to get the units from the $CONTRL section */
-      rewind(data->file);
-      if (!pass_keyline(data->file, "$CONTRL OPTIONS", NULL)) {
-        printf("gamessplugin) Missing $CONTRL OPTIONS section!\n");
-        return FALSE;
-      }
-      goto_keyline(data->file, "UNITS =", NULL);
-      GET_LINE(buffer, data->file);
-      sscanf(strstr(buffer, "UNITS ="), "%s", units);
-      bohr = !strcmp(units, "BOHR");
-      
-      /* Find beginning of $FMOXYZ input card */
-      rewind(data->file);
-      if (!pass_keyline(data->file, "INPUT CARD> $fmoxyz", 
-                        "INPUT CARD> $FMOXYZ")) {
-        printf("gamessplugin) No atom coordinates found!\n");
-        return FALSE;
-      }
-            
-      /* Read the $FMOXYZ coordinates */     
-      if (!get_fmoxyz(data->file, &data->atoms, bohr, &numatoms)) {
-        printf("gamessplugin) Could not read coordinates from $FMOXYZ input!\n");
-        return FALSE;
-      } else {
-        printf("gamessplugin) Fragment Molecular Orbital (FMO) method.\n");
-        gms->have_fmo = 1;
-        data->numatoms = numatoms;
-        return TRUE;
-      }
-    }
-  }
-
-  /* If we reached this point we have found either a regular
-   * input coordinate block or the coordinate block of the
-   * first trajectory frame. */
-
-  /* test if coordinate units are Bohr */
-  bohr = !strcmp(units, "(BOHR)");
-
-  /* Read the coordinate block */
-  if (get_coordinates(data->file, &data->atoms, bohr, &numatoms))
-    data->num_frames_read = 0;
-  else {
-    printf("gamessplugin) Bad atom coordinate block!\n");
-    return FALSE;
-  }
-
-  fseek(data->file, filepos, SEEK_SET);
-
-  /* store number of atoms in data structure */
-  data->numatoms = numatoms;
-
-  return TRUE; 
-}
-
-
-/**********************************************************
- *
- * Read an atom coordinate block.
- *
- * Example:
- *  F         9.0    3.04259     -0.07605       0.00000
- *  N         7.0    0.03017      0.38347       0.00000
- * ...
- *
- **********************************************************/
-static int get_coordinates(FILE *file, qm_atom_t **atoms, int unit,
-                           int *numatoms) {
-  int i = 0;
-  int growarray = 0;
-
-  if (*numatoms<0) {
-    *atoms = (qm_atom_t*)calloc(1, sizeof(qm_atom_t));
-    growarray = 1;
-  }
-
-  /* Read in the coordinates until an empty line is reached.
-   * We expect 5 entries per line */
-  while (1) {
-    char buffer[BUFSIZ];
-    char atname[BUFSIZ];
-    float atomicnum;
-    float x,y,z, dum;
-    int n;
-    qm_atom_t *atm;
-
-    GET_LINE(buffer, file);
-
-    /* For FMO there is an additional atom index in the
-     * second column. Try both variants: */
-    n = sscanf(buffer,"%s %f %f %f %f %f",atname,&dum,&atomicnum,&x,&y,&z);
-    if (n!=6) {
-      n = sscanf(buffer,"%s %f %f %f %f",atname,&atomicnum,&x,&y,&z);
-    }
-    if (n!=5 && n!=6) break;
-
-    if (growarray && i>0) {
-      *atoms = (qm_atom_t*)realloc(*atoms, (i+1)*sizeof(qm_atom_t));
-    }
-    atm = (*atoms)+i;
-
-    strncpy(atm->type, atname, sizeof(atm->type));
-    atm->atomicnum = floor(atomicnum+0.5); /* nuclear charge */
-    /*printf("coor: %s %d %f %f %f\n", atm->type, atm->atomicnum, x, y, z);*/
-   
-    /* if coordinates are in Bohr convert them to Angstrom */
-    if (unit==BOHR) {
-      x *= BOHR_TO_ANGS;
-      y *= BOHR_TO_ANGS;
-      z *= BOHR_TO_ANGS;
-    }
-    
-    atm->x = x;
-    atm->y = y;
-    atm->z = z; 
-    i++;
-  }
-
-  /* If file is broken off in the middle of the coordinate block 
-   * we cannot use this frame. */
-  if (*numatoms>=0 && *numatoms!=i) {
-    (*numatoms) = i;
-    return FALSE;
-  }
-
-  (*numatoms) = i;
-  return TRUE;
-}
-
-
-/* Read coordinates from $FMOXYZ section in the INPUT CARD
- * listing at the beginning of the file. This is a method
- * of last resort used only for FMO calculations where no
- * coordinates are printed. */
-static int get_fmoxyz(FILE *file, qm_atom_t **atoms, int unit,
-                           int *numatoms) {
-  int i = 0;
-  int growarray = 0;
-
-  if (*numatoms<0) {
-    *atoms = (qm_atom_t*)calloc(1, sizeof(qm_atom_t));
-    growarray = 1;
-  }
-
-  /* Read in the coordinates until an empty line is reached.
-   * We expect 5 entries per line */
-  while (1) {
-    char buffer[BUFSIZ];
-    char atname[BUFSIZ], element[BUFSIZ];
-    float x,y,z;
-    int n;
-    qm_atom_t *atm;
-
-    GET_LINE(buffer, file);
-
-    /* skip " INPUT CARD>" at the beginning of the line */
-    n = sscanf(buffer+12,"%s %s %f %f %f",atname,element,&x,&y,&z);
-
-    if (n!=5) break;
-
-    if (growarray && i>0) {
-      *atoms = (qm_atom_t*)realloc(*atoms, (i+1)*sizeof(qm_atom_t));
-    }
-    atm = (*atoms)+i;
-
-    strncpy(atm->type, atname, sizeof(atm->type));
-    if (isalpha(element[0]))
-      atm->atomicnum = get_pte_idx_from_string(element);
-    else if (isdigit(element[0])) 
-      atm->atomicnum = floor(element[0]+0.5); /* nuclear charge */
-    else break;
-
-    /* If coordinates are in Bohr convert them to Angstrom */
-    if (unit==BOHR) {
-      x *= BOHR_TO_ANGS;
-      y *= BOHR_TO_ANGS;
-      z *= BOHR_TO_ANGS;
-    }
-    
-    atm->x = x;
-    atm->y = y;
-    atm->z = z; 
-    i++;
-  }
-
-  /* If file is broken off in the middle of the coordinate block 
-   * we cannot use this frame. */
-  if (*numatoms>=0 && *numatoms!=i) return FALSE;
-
-  (*numatoms) = i;
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Read data from the $CONTRL card from FIREFLY
- *
- **********************************************************/
-static int get_contrl_firefly(qmdata_t *data) {
-
-  char word[3][BUFSIZ];
-  char buffer[BUFSIZ];
-  char *temp;
-  long filepos;
-  filepos = ftell(data->file);
-
-  word[0][0] = '\0';
-  word[1][0] = '\0';
-  word[2][0] = '\0';
-  buffer[0] = '\0';
-
-  //printf("gamessplugin) Getting CONTRL group data for Firefly \n");
-
-  /* start scanning; currently we support
-   * RUNTYP = ENERGY, OPTIMIZE, SADPOINT, HESSIAN, SURFACE */
-  if (!pass_keyline(data->file, "$CONTRL OPTIONS", NULL)) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  eatline(data->file, 1);
-
-  /* current line contains SCFTYP, RUNTYP, EXETYP info; scan it */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-
-  /* check for supported RUNTYPs */
-  if      (!strcmp(&word[1][0],"RUNTYP=ENERGY")) {
-    data->runtype = MOLFILE_RUNTYPE_ENERGY;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=OPTIMIZE")) {
-    data->runtype = MOLFILE_RUNTYPE_OPTIMIZE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SADPOINT")) {
-    data->runtype = MOLFILE_RUNTYPE_SADPOINT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=HESSIAN")) {
-    data->runtype = MOLFILE_RUNTYPE_HESSIAN;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SURFACE")) {
-    data->runtype = MOLFILE_RUNTYPE_SURFACE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=GRADIENT")) {
-    data->runtype = MOLFILE_RUNTYPE_GRADIENT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=MEX")) {
-    data->runtype = MOLFILE_RUNTYPE_MEX;
-  }
-  else {
-#ifdef DEBUGGING
-    printf("gamessplugin) The %s is currently not supported \n",
-           &word[1][0]);
-#endif
-    data->runtype = MOLFILE_RUNTYPE_UNKNOWN;
-  }
-  printf("gamessplugin) File generated via %s \n",&word[1][0]);
-
-
-  /* determine SCFTYP */
-  if (!strcmp(&word[0][0],"SCFTYP=RHF")) {
-    data->scftype = MOLFILE_SCFTYPE_RHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=UHF")) {
-    data->scftype = MOLFILE_SCFTYPE_UHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=ROHF")) {
-    data->scftype = MOLFILE_SCFTYPE_ROHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=GVB")) {
-    data->scftype = MOLFILE_SCFTYPE_GVB;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=MCSCF")) {
-    data->scftype = MOLFILE_SCFTYPE_MCSCF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=NONE")) {
-    data->scftype = MOLFILE_SCFTYPE_NONE;
-  }
-  else {
-    /* if we don't find a supported SCFTYP we bomb out; this
-     * might be a little drastic */
-    printf("gamessplugin) %s is currently not supported \n",
-           &word[0][0]);
-    return FALSE;
-  }
-  printf("gamessplugin) Type of wavefunction used %s \n",
-         &word[0][0]);
-
-  /* scan for MPLEVL, LOCAL and UNITS; */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s %*s %s",&word[0][0],&word[1][0],&word[2][0]);
-  data->mplevel = atoi(&word[1][0]);
-
-  /* scan for MULT, ICHARG and MAXIT; */
-  GET_LINE(buffer, data->file);
-  //sscanf(buffer,"%*s %*s %*s %*s %s %s",&word[0][0],&word[1][0]);
-
-  /* find the coordinate type in next line */
-  while ( (temp=strstr(buffer,"COORD =")) == NULL ) {
-    GET_LINE(buffer, data->file);;
-  }
-  strncpy(data->geometry, trimright(temp+7), sizeof(data->geometry)); 
-  printf("gamessplugin) Coordinate type used is %s \n", data->geometry);
-
-  while ( (temp=strstr(buffer,"CITYP =")) == NULL ) {
-    GET_LINE(buffer, data->file);;
-  }
-  strncpy(buffer, trimright(temp+7), 8); 
-
-  /* determine CITYP */
-  if      (!strcmp(buffer,"NONE"))  data->citype = CI_NONE;
-  else if (!strcmp(buffer,"CIS"))   data->citype = CI_CIS;
-  else if (!strcmp(buffer,"ALDET")) data->citype = CI_ALDET;
-  else if (!strcmp(buffer,"ORMAS")) data->citype = CI_ORMAS;
-  else if (!strcmp(buffer,"GUGA"))  data->citype = CI_GUGA;
-  else if (!strcmp(buffer,"FSOCI")) data->citype = CI_FSOCI;
-  else if (!strcmp(buffer,"GENCI")) data->citype = CI_GENCI;
-  else                                    data->citype = CI_UNKNOWN;
-  printf("gamessplugin) CI method %s \n",buffer);
-
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %*s",&word[0][0]);
-
-  /* scan for DFTTYP, TDDFT info; */
-  if (!strncmp(&word[0][0],"DFTTYP=", 7)) {
-    printf("gamessplugin) Density functional used is %s \n",&word[0][7]);
-    GET_LINE(buffer, data->file);
-  }
-
-
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Read data from the $CONTRL card from GAMESS
- *
- **********************************************************/
-static int get_contrl(qmdata_t *data) {
-
-  char word[3][BUFSIZ];
-  char buffer[BUFSIZ];
-  char *temp;
-  long filepos;
-  filepos = ftell(data->file);
-
-  word[0][0] = '\0';
-  word[1][0] = '\0';
-  word[2][0] = '\0';
-  buffer[0] = '\0';
-
-
-  /* start scanning; currently we support
-   * RUNTYP = ENERGY, OPTIMIZE, SADPOINT, HESSIAN, SURFACE */
-  if (!pass_keyline(data->file, "$CONTRL OPTIONS", NULL)) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  eatline(data->file, 1);
-
-  /* current line contains SCFTYP, RUNTYP, EXETYP info; scan it */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-
-  /* check for supported RUNTYPs */
-  if      (!strcmp(&word[1][0],"RUNTYP=ENERGY")) {
-    data->runtype = MOLFILE_RUNTYPE_ENERGY;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=OPTIMIZE")) {
-    data->runtype = MOLFILE_RUNTYPE_OPTIMIZE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SADPOINT")) {
-    data->runtype = MOLFILE_RUNTYPE_SADPOINT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=HESSIAN")) {
-    data->runtype = MOLFILE_RUNTYPE_HESSIAN;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=SURFACE")) {
-    data->runtype = MOLFILE_RUNTYPE_SURFACE;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=GRADIENT")) {
-    data->runtype = MOLFILE_RUNTYPE_GRADIENT;
-  }
-  else if (!strcmp(&word[1][0],"RUNTYP=MEX")) {
-    data->runtype = MOLFILE_RUNTYPE_MEX;
-  }
-  else {
-#ifdef DEBUGGING
-    printf("gamessplugin) The %s is currently not supported \n",
-           &word[1][0]);
-#endif
-    data->runtype = MOLFILE_RUNTYPE_UNKNOWN;
-  }
-  printf("gamessplugin) File generated via %s \n",&word[1][0]);
-
-
-  /* determine SCFTYP */
-  if (!strcmp(&word[0][0],"SCFTYP=RHF")) {
-    data->scftype = MOLFILE_SCFTYPE_RHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=UHF")) {
-    data->scftype = MOLFILE_SCFTYPE_UHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=ROHF")) {
-    data->scftype = MOLFILE_SCFTYPE_ROHF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=GVB")) {
-    data->scftype = MOLFILE_SCFTYPE_GVB;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=MCSCF")) {
-    data->scftype = MOLFILE_SCFTYPE_MCSCF;
-  }
-  else if (!strcmp(&word[0][0],"SCFTYP=NONE")) {
-    data->scftype = MOLFILE_SCFTYPE_NONE;
-  }
-  else {
-    /* if we don't find a supported SCFTYP we bomb out; this
-     * might be a little drastic */
-    printf("gamessplugin) %s is currently not supported \n",
-           &word[0][0]);
-    return FALSE;
-  }
-  printf("gamessplugin) Type of wavefunction used %s \n",
-         &word[0][0]);
-
-  /* scan for MPLEVL, CITYP, CCTYP, VBTYP info; */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s %s %*s %s",&word[0][0],&word[1][0],&word[2][0]);
-
-  if (!strcmp(&word[0][0],"MPLEVL=")) {
-    /* Moller-Plesset perturbation level */
-    printf("gamessplugin) MP perturbation level %s \n",&word[1][0]);
-    data->mplevel = atoi(&word[1][0]);
-
-    /* determine CITYP */
-    if      (!strcmp(&word[2][0],"=NONE"))  data->citype = CI_NONE;
-    else if (!strcmp(&word[2][0],"=CIS"))   data->citype = CI_CIS;
-    else if (!strcmp(&word[2][0],"=ALDET")) data->citype = CI_ALDET;
-    else if (!strcmp(&word[2][0],"=ORMAS")) data->citype = CI_ORMAS;
-    else if (!strcmp(&word[2][0],"=GUGA"))  data->citype = CI_GUGA;
-    else if (!strcmp(&word[2][0],"=FSOCI")) data->citype = CI_FSOCI;
-    else if (!strcmp(&word[2][0],"=GENCI")) data->citype = CI_GENCI;
-    else                                    data->citype = CI_UNKNOWN;
-    printf("gamessplugin) CI method %s \n",&word[2][1]);
-
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s %s",&word[0][0],&word[1][0]);
-  }
-
-  /* scan for DFTTYP, TDDFT info; */
-  if (!strncmp(&word[0][0],"DFTTYP=", 7)) {
-    printf("gamessplugin) Density functional used is %s \n",&word[0][7]);
-    GET_LINE(buffer, data->file);
-  }
-
-
-  /* find the coordinate type in next line */
-  while ( (temp=strstr(buffer,"COORD =")) == NULL ) {
-    GET_LINE(buffer, data->file);;
-  }
-  strncpy(data->geometry, trimright(temp+7), sizeof(data->geometry)); 
-  printf("gamessplugin) Coordinate type used is %s \n", data->geometry);
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE;
-}
-
-
-/* Read input parameters regarding calculation of 
- * certain molecular properties such as electrostatic
- * moments and the MEP. */
-static int get_properties_input(qmdata_t *data) {
-  /* TODO!! */
-  return TRUE;
-}
-
-
-/* Read symmetry point group and highest axis.
- * Currently these values are not used yet, but if this
- * section was not found the file is corrupt. */
-static int get_symmetry(qmdata_t *data) {
-  char buffer[BUFSIZ];
-  char *sep, tmp[BUFSIZ];
-
-  //will need to go back somewhat in future to
-  //check for XMCQDPT calculation
-  long filepos = ftell(data->file);
-
-  if (goto_keyline(data->file, "THE POINT GROUP IS",
-		    "1 ELECTRON INTEGRALS", NULL) != FOUND) {
-    printf("gamessplugin) No symmetry info found!\n");
-    return FALSE;
-  }
-
-  GET_LINE(buffer, data->file);
-  sscanf(buffer," THE POINT GROUP IS %s", data->pointgroup);
-
-  sep = strchr(data->pointgroup, ',');
-  if (sep) *sep = '\0';
-  trimright(data->pointgroup);
-
-  sep = strstr(buffer, "NAXIS=") + 6;
-  strncpy(tmp, sep, 2); tmp[2] = '\0';
-  data->naxis = atoi(tmp);
-
-  sep = strstr(buffer, "ORDER=") + 6;
-  sscanf(sep, "%d", &data->order);
-
-  printf("gamessplugin) Point group = %s, naxis = %d, order = %d\n",
-         data->pointgroup, data->naxis, data->order);
-
-  fseek(data->file, filepos, SEEK_SET);
-
-  return TRUE;
-}
-
-
-/* Read MCSCF input data */
-static int get_mcscf(qmdata_t *data) {
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-  char buffer[BUFSIZ];
-  char *temp;
-  long filepos;
-  int tmp;
-
-  filepos = ftell(data->file);
-
-  if (gms->have_pcgamess){
-      if (pass_keyline(data->file,"XMCQDPT INPUT PARAMETERS",
-                        "DONE SETTING UP THE RUN") != FOUND) {
-         //STANDARD MCSCF in GAMESS
-         if(pass_keyline(data->file, "MCSCF CALCULATION",
-                       "ITER     TOTAL ENERGY") != FOUND)
-                return FALSE;
-
-          if (goto_keyline(data->file, "-CORE-    -INTERNAL-  -EXTERNAL-",
-                           "ITER     TOTAL ENERGY", NULL) != FOUND)
-            return FALSE;
-
-          while ( (temp=strstr(buffer,"NFZC=")) == NULL ) {
-            GET_LINE(buffer, data->file);
-          }
-          strncpy(buffer, trimright(temp+6), 5); 
-          sscanf(buffer, "%d", &data->mcscf_num_core);
-
-          while ( (temp=strstr(buffer,"NMCC=")) == NULL ) {
-            GET_LINE(buffer, data->file);
-          }
-          strncpy(buffer, trimright(temp+6), 5); 
-          sscanf(buffer, "%d", &tmp);
-          data-> mcscf_num_core += tmp;
-          printf("gamessplugin) Number of MCSCF core orbitals = %d\n",
-             data->mcscf_num_core);
-      }
-      else{
-          //XMCQDPT
-          while ( (temp=strstr(buffer,"# OF FROZEN CORE ORBITALS")) == NULL ) {
-            GET_LINE(buffer, data->file);
-          }
-          sscanf(buffer, "%*s %*s %*s %*s %*s %*s %d",&data->mcscf_num_core);
-
-          GET_LINE(buffer,data->file);
-          sscanf(buffer, "%*s %*s %*s %*s %*s %*s %d",&tmp);
-          data->mcscf_num_core += tmp;
-          printf("gamessplugin) Number of MCSCF core orbitals = %d\n",
-             data->mcscf_num_core);
-          printf("gamessplugin) XMCQDPT2 not supported.\n");
-          //set scftype to none since XMCQDPT2 not supported
-          data->scftype = MOLFILE_SCFTYPE_NONE;
-
-      } 
-  } 
-  else {
-      if (pass_keyline(data->file, "MCSCF CALCULATION",
-                       "ITER     TOTAL ENERGY") != FOUND)
-        return FALSE;
-
-      if (goto_keyline(data->file, "NUMBER OF CORE ORBITALS",
-                       "ITER     TOTAL ENERGY", NULL) != FOUND)
-        return FALSE;
-
-      GET_LINE(buffer, data->file);
-      sscanf(buffer," NUMBER OF CORE ORBITALS          = %d",
-             &data->mcscf_num_core);
-
-      printf("gamessplugin) Number of MCSCF core orbitals = %d\n",
-         data->mcscf_num_core);
-  }
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE;
-}
-
-
-/* Read the first trajectory frame. */
-static int read_first_frame(qmdata_t *data) {
-  /* The angular momentum is populated in get_wavefunction 
-   * which is called by get_traj_frame(). We have obtained
-   * the array size wavef_size already from the basis set
-   * statistics */
-  data->angular_momentum = (int*)calloc(3*data->wavef_size, sizeof(int));
-
-  /* Try reading the first frame. 
-   * If there is only one frame then also read the
-   * final wavefunction. */
-  if (!get_traj_frame(data, data->atoms, data->numatoms)) {
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-/******************************************************
- *
- * Reads the info printed after the geometry search
- * has finished or whatever analysis was done in a 
- * single point run, e.g. ESP charges, Hessian, etc.
- * Rewinds to the beginning of the search when done,
- * because we read this part at in the initial phase
- * and might have to look for additional timesteps
- * later.
- *
- ******************************************************/
-static int get_final_properties(qmdata_t *data) {
-  qm_timestep_t *ts;
-  long filepos;
-  filepos = ftell(data->file);
-  ts = data->qm_timestep + data->num_frames-1;
-
-  /* Go to end of trajectory */
-  fseek(data->file, data->end_of_traj, SEEK_SET);
-
-  printf("gamessplugin) Reading final properties section (timestep %d):\n",
-         data->num_frames-1);
-  printf("gamessplugin) ===============================================\n");
-
-  /* Read population analysis (Mulliken and Lowdin charges),
-   * but only if wasn't read already (while parsing the first
-   * timestep). */
-  if (!ts->have_mulliken && get_population(data, ts)) {
-    printf("gamessplugin) Mulliken charges found\n");
-  }
-
-  if (get_esp_charges(data)) {
-    printf("gamessplugin) ESP charges found\n");
-  } 
-
-  if (data->runtype == MOLFILE_RUNTYPE_GRADIENT ||
-      data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    if (get_final_gradient(data, ts)) {
-      printf("gamessplugin) Final gradient found\n");
-    }
-  }
-
-
-  if (data->runtype == MOLFILE_RUNTYPE_HESSIAN) {
-    /* try reading the hessian matrix in internal and
-     * cartesian coordinates as well as the internal
-     * coordinates together with their associated
-     * force constants */
-    
-    if (!get_int_hessian(data)) {
-      printf("gamessplugin) No internal Hessian matrix found.\n");
-    }
-    if (!get_cart_hessian(data)) {
-      printf("gamessplugin) \n");
-      printf("gamessplugin) Could not determine the cartesian \n");
-      printf("gamessplugin) Hessian matrix!! \n");
-      printf("gamessplugin) \n");
-    }
-
-    /* read the wavenumbers, intensities of the normal modes 
-     * as well as the modes themselves */
-    if (!get_normal_modes(data)) {
-      printf("gamessplugin) \n");
-      printf("gamessplugin) No normal modes found.\n");
-      printf("gamessplugin) \n");
-    }
-  }
-
-  /* Read localized orbitals if there are any */
-  read_localized_orbitals(data);
-
-
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE; 
-}
-
-
-/* Read localized orbitals (Boys/Ruedenberg/Pipek) */
-static int read_localized_orbitals(qmdata_t *data) {
-  int i;
-  qm_timestep_t *ts;
-  qm_wavefunction_t *wavef;
-
-  /* Move past the listing of the canonical MOs */
-  pass_keyline(data->file, "ENERGY COMPONENTS", NULL);
-
-  ts = data->qm_timestep + data->num_frames-1;
-
-  for (i=0; i<2; i++) {
-    wavef = add_wavefunction(ts);
-
-    if (get_wavefunction(data, ts, wavef) == FALSE ||
-        (wavef->type!=MOLFILE_WAVE_BOYS &&
-         wavef->type!=MOLFILE_WAVE_PIPEK &&
-         wavef->type!=MOLFILE_WAVE_RUEDEN)) {
-      del_wavefunction(ts);
-      return FALSE;
-    }
-    else {
-      char typestr[64];
-      if (wavef->spin==SPIN_ALPHA) {
-        strcpy(typestr, "alpha");
-      }
-      else if (wavef->spin==SPIN_BETA) {
-        strcpy(typestr, "beta");
-      }
-      wavef->mult = data->multiplicity;
-      wavef->energy = ts->scfenergies[ts->num_scfiter-1];
-
-      printf("gamessplugin) Localized orbitals (%s) found for timestep %d\n",
-             typestr, data->num_frames-1);
-    }
-  }
-
-  return TRUE;
-}
-
-
-
-/********************************************************
- *
- * Read basis set and orbital statistics such as
- * # of shells, # of A/B orbitals, # of electrons, 
- * multiplicity and total charge
- *
- ********************************************************/
-static int get_basis_stats(qmdata_t *data) {
-
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-
-  char buffer[BUFSIZ];
-  char word[7][BUFSIZ];
-  int i;
-
-  buffer[0] = '\0';
-  for (i=0; i<7; i++) word[i][0] = '\0';
-
-  /* look for the orbital/charge/... info section */
-  if(gms->have_pcgamess){
-    if (!pass_keyline(data->file, "TOTAL NUMBER OF SHELLS", NULL)){
-        printf("ERROR!\n");
-        return FALSE;
-     }
-      /* # cartesian gaussian function = wavefunction size */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %d",
-             &(data->wavef_size));
-
-      /* number of electrons */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->num_electrons));
-
-      /* charge of the molecule */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->totalcharge));
-
-      /* Multiplicity of the molecule.
-       * Multiplicity is actually defined per wavefunction
-       * but in some cases where there's only one wavefunction
-       * in the output or they all have the same multiplicity
-       * it will not be printed with the wavefunction.
-       * Thus we use this one as default value. */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %d",
-             &(data->multiplicity));
-
-      /* number of A orbitals */
-      /* Note the different number of items per line for A/B orbitals
-       * due to "(ALPHA)" and "(BETA )" !! */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_A)); 
-        
-      /* number of B orbitals */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_B)); 
-
-  }
-  else {
-    if (!pass_keyline(data->file, "TOTAL NUMBER OF BASIS", NULL))
-        return FALSE;
-
-      /* # cartesian gaussian function = wavefunction size */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %*s %d",
-             &(data->wavef_size));
-
-      /* number of electrons */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->num_electrons));
-
-      /* charge of the molecule */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %d",
-             &(data->totalcharge));
-
-      /* Multiplicity of the molecule.
-       * Multiplicity is actually defined per wavefunction
-       * but in some cases where there's only one wavefunction
-       * in the output or they all have the same multiplicity
-       * it will not be printed with the wavefunction.
-       * Thus we use this one as default value. */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %d",
-             &(data->multiplicity));
-
-      /* number of A orbitals */
-      /* Note the different number of items per line for A/B orbitals
-       * due to "(ALPHA)" and "(BETA )" !! */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_A)); 
-        
-      /* number of B orbitals */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*s %*s %*s %*s %*s %*s %*s %d",
-             &(data->num_occupied_B)); 
-  }
-
-
-  printf("gamessplugin) Number of Electrons: %d \n",
-      data->num_electrons);
-
-  printf("gamessplugin) Charge of Molecule : %d \n",
-      data->totalcharge);
-
-  printf("gamessplugin) Multiplicity of Wavefunction: %d \n",
-      data->multiplicity);
-
-  printf("gamessplugin) Number of occupied A / B orbitals: %d / %d \n",\
-      data->num_occupied_A, data->num_occupied_B);
-
-  printf("gamessplugin) Number of gaussian basis functions: %d \n",\
-      data->wavef_size);
-
- 
-  return TRUE;
-}
-
-
-
-/*******************************************************
- *
- * Reads in the $GUESS options.
- *
- * ******************************************************/
-static int get_guess_options(qmdata_t *data)
-{
-  char word[BUFSIZ];
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(data->file);
-
-  /* initialize buffers */
-  buffer[0] = '\0';
-  word[0]   = '\0';
-
-  /* parse for GUESS field */
-  if (pass_keyline(data->file, "GUESS OPTIONS",
-                   "2 ELECTRON INTEGRALS") != FOUND) {
-    printf("gamessplugin) No GUESS OPTIONS found.\n");
-    fseek(data->file, filepos, SEEK_SET);
-
-    /* This section id not mandatory, there are a few
-       calculation types the don't print it, so we
-       always return TRUE*/
-    return TRUE;
-  }
-
-  /* next line contains all we need */
-  eatline(data->file, 1);
-  GET_LINE(buffer, data->file);
-  sscanf(buffer," GUESS %s NORB",&word[0]);
-
-  /* the first character is '=', we skip it */
-  strncpy(data->guess,&word[1], sizeof(data->guess));
-
-  printf("gamessplugin) Run was performed with GUESS = %s \n",
-	  data->guess);
-
- /* Since this block occurs in the middle of first frame
-  * we need to rewind. */
-  fseek(data->file, filepos, SEEK_SET);
-
-  return TRUE;
-}
-
-
-
-/*******************************************************
- *
- * Read the basis set data into hierarchical structures.
- * L-shells are expanded into an S-shell and a P-shell.
- *
- * ******************************************************/
-int get_basis(qmdata_t *data) {
-
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-
-  char buffer[BUFSIZ];
-  char word[4][BUFSIZ];
-  int i = 0; 
-  int success = 0;
-  int numread, numshells;
-  shell_t *shell;
-  long filepos;
-
-  if (!strcmp(data->gbasis, "MNDO") ||
-      !strcmp(data->gbasis, "AM1")  ||
-      !strcmp(data->gbasis, "PM3")) {
-    /* Semiempirical methods are based on STOs.
-     * The only parameter we need for orbital rendering
-     * are the exponents zeta for S, P, D,... shells for
-     * each atom. Since GAMESS doesn't print these values
-     * we skip reading the basis set and hardcode the
-     * parameters in tables in VMD. */
-    return TRUE;
-  }
-
-  /* Search for "ATOMIC BASIS SET" line */
-  if (pass_keyline(data->file, "ATOMIC BASIS SET", 
-                    "$CONTRL OPTIONS") !=FOUND ) {
-    printf("gamessplugin) No basis set found!\n");
-
-    return FALSE;
-  }
-
-  /* initialize buffers */
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-  
-
-  /* skip the next 5 lines */
-  eatline(data->file, 5);
-
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  data->basis_set = (basis_atom_t*)calloc(data->numatoms, sizeof(basis_atom_t));
-
-
-  i = 0; /* basis atom counter */
-
-  do {
-    prim_t *prim = NULL;
-    char shelltype;
-    int numprim = 0;
-    int icoeff = 0;
-    filepos = ftell(data->file);
-    GET_LINE(buffer, data->file);
-      
-    /* Count the number of relevant words in the line. */
-    numread = sscanf(buffer,"%s %s %s %s",&word[0][0], &word[1][0],
-           &word[2][0], &word[3][0]);
-
-    switch (numread) {
-      case 1:
-        /* Next atom */
-        strcpy(data->basis_set[i].name, &word[0][0]);
-
-        /* skip initial blank line */
-        eatline(data->file, 1);
-
-        /* read the basis set for the current atom */
-        shell = (shell_t*)calloc(1, sizeof(shell_t)); 
-        numshells = 0;
-
-        do {
-          filepos = ftell(data->file);
-          numprim = read_shell_primitives(data, &prim, &shelltype, icoeff, gms->have_pcgamess);
-
-          if (numprim>0) {
-            /* make sure we have eiter S, L, P, D, F or G shells */
-            if ( (shelltype!='S' && shelltype!='L' && shelltype!='P' && 
-                  shelltype!='D' && shelltype!='F' && shelltype!='G') ) {
-              printf("gamessplugin) WARNING ... %c shells are not supported \n", shelltype);
-            }
-            
-            /* create new shell */
-            if (numshells) {
-              shell = (shell_t*)realloc(shell, (numshells+1)*sizeof(shell_t));
-            }
-            shell[numshells].numprims = numprim;
-            /* assign a numeric shell type */
-            shell[numshells].type = shelltype_int(shelltype);
-            shell[numshells].prim = prim;
-            data->num_basis_funcs += numprim;
-
-            /* We split L-shells into one S and one P-shell.
-             * I.e. for L-shells we have to go back read the shell again
-             * this time using the second contraction coefficients. */
-            if (shelltype=='L' && !icoeff) {
-              fseek(data->file, filepos, SEEK_SET);
-              icoeff++;
-            } else if (shelltype=='L' && icoeff) {
-              shell[numshells].type = SP_P_SHELL;
-              icoeff = 0;  /* reset the counter */
-            }
-
-            numshells++;
-          }
-        } while (numprim);
-
-        /* store shells in atom */
-        data->basis_set[i].numshells = numshells;
-        data->basis_set[i].shell = shell;
-
-        /* Update total number of basis functions */
-        data->num_shells += numshells;
-        i++;
-
-        /* go back one line so that we can read the name of the
-         * next atom */
-        fseek(data->file, filepos, SEEK_SET);
-
-        break;
-
-      case 4:
-        /* this is the very end of the basis set */
-        if(gms->have_pcgamess){
-            if (!strcmp(&word[0][0],"TOTAL")  &&
-                !strcmp(&word[1][0],"NUMBER") && 
-                !strcmp(&word[2][0],"OF")     &&
-                !strcmp(&word[3][0],"SHELLS")) {
-              success = 1;
-              /* go back one line so that get_basis_stats()
-                 can use this line as a keystring. */
-              fseek(data->file, filepos, SEEK_SET);
-            }
-        }
-        else {
-            if (!strcmp(&word[0][0],"TOTAL")  &&
-                !strcmp(&word[1][0],"NUMBER") && 
-                !strcmp(&word[2][0],"OF")     &&
-                !strcmp(&word[3][0],"BASIS")) {
-              success = 1;
-              /* go back one line so that get_basis_stats()
-                 can use this line as a keystring. */
-              fseek(data->file, filepos, SEEK_SET);
-            }
-        }
-        break;
-    }
-
-  } while (!success);
-
-
-  printf("gamessplugin) Parsed %d uncontracted basis functions for %d atoms.\n",
-         data->num_basis_funcs, i);
-
-  data->num_basis_atoms = i;
-
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- *
- * Convert shell type from char to int.
- *
- ************************************************ */
-static int shelltype_int(char type) {
-  int shelltype;
-
-  switch (type) {
-    case 'L':
-      /* SP_P shells are assigned in get_basis() */
-      shelltype = SP_S_SHELL;
-      break;
-    case 'S':
-      shelltype = S_SHELL;
-      break;
-    case 'P':
-      shelltype = P_SHELL;
-      break;
-    case 'D':
-      shelltype = D_SHELL;
-      break;
-    case 'F':
-      shelltype = F_SHELL;
-      break;
-    case 'G':
-      shelltype = G_SHELL;
-      break;
-    default:
-      shelltype = UNK_SHELL;
-      break;
-  }
-
-  return shelltype;
-}
-
-
-
-/******************************************************
- *
- * Populate the flat arrays containing the basis
- * set data.
- *
- ******************************************************/
-static int fill_basis_arrays(qmdata_t *data) {
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0;
-
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_types;
-  int *atomicnum_per_basisatom;
-
-  /* Count the total number of primitives which
-   * determines the size of the basis array. */
-  for(i=0; i<data->num_basis_atoms; i++) {
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      primcount += data->basis_set[i].shell[j].numprims;
-    }
-  }
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per basis function, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  basis = (float *)calloc(2*primcount,sizeof(float));
-
-  /* make sure memory was allocated properly */
-  if (basis == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  shell_types = (int *)calloc(data->num_shells, sizeof(int));
-  
-  /* make sure memory was allocated properly */
-  if (shell_types == NULL) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  num_shells_per_atom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_shells_per_atom == NULL) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  num_prim_per_shell = (int *)calloc(data->num_shells, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (num_prim_per_shell == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  atomicnum_per_basisatom = (int *)calloc(data->num_basis_atoms, sizeof(int));
-
-  /* make sure memory was allocated properly */
-  if (atomicnum_per_basisatom == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* store pointers in struct qmdata_t */
-  data->basis = basis;
-  data->shell_types = shell_types;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell = num_prim_per_shell;
-  data->atomicnum_per_basisatom = atomicnum_per_basisatom;
-
-  /* Go through all basis set atoms and try to assign the
-   * atomic numbers. The basis set atoms are specified by 
-   * name strings (the same as in the coordinate section,
-   * except for FMO calcs.) and we try to match the names
-   * from the two lists. The basis set atom list is symmetry
-   * unique while the coordinate atom list is complete.*/
-  primcount = 0;
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int found = 0;
-
-    /* For this basis atom find a matching atom from the
-     * coordinate atom list. */
-    for(j=0; j<data->numatoms; j++) {
-      char basisname[BUFSIZ];
-      strcpy(basisname, data->basis_set[i].name);
-
-      /* for FMO calculations we have to strip the "-n" tail
-       * of the basis atom name. */
-      if (gms->have_fmo) {
-        *strchr(basisname, '-') = '\0';
-      }
-
-      if (!strcmp(data->atoms[j].type, basisname)) {
-        found = 1;
-        break;
-      }
-    }
-    if (!found) {
-      printf("gamessplugin) WARNING: Couldn't find atomic number for basis set atom %s\n",
-             data->basis_set[i].name);
-      data->basis_set[i].atomicnum = 0;
-      atomicnum_per_basisatom[i] = 0;
-    } else {
-      /* assign atomic number */
-      data->basis_set[i].atomicnum = data->atoms[j].atomicnum;
-      atomicnum_per_basisatom[i]   = data->atoms[j].atomicnum;
-    }
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_types[shellcount] = data->basis_set[i].shell[j].type;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * read all primitives for the current shell
- *
- ******************************************************/
-static int read_shell_primitives(qmdata_t *data, prim_t **prim, char *shelltype,
-                                 int icoeff, int pcgamess) {
-  char buffer[BUFSIZ];
-  float exponent = 0.0; 
-  float contract[2] = {0.0, 0.0};
-  int shell, success;
-  int primcounter = 0;
-  (*prim) = (prim_t*)calloc(1, sizeof(prim_t));
-
-  do {
-    GET_LINE(buffer, data->file);
-      if (pcgamess)
-        success = sscanf(buffer,"%d %c %*s %f %f %*s %*s %f", &shell,
-                       shelltype,
-                       &exponent, &contract[0], &contract[1]); 
-
-      else
-        success = sscanf(buffer,"%d %c %*s %f %f %f", &shell,
-                       shelltype,
-                       &exponent, &contract[0], &contract[1]); 
-
-    /* store in basis array and increase the counter */ 
-    switch (success) {
-      case 4:
-        if (primcounter) {
-          *prim = (prim_t*)realloc(*prim, (primcounter+1)*sizeof(prim_t));
-        }
-
-        /* store exponent */
-        (*prim)[primcounter].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[primcounter].contraction_coeff = contract[0];
-        
-        primcounter++;
-        break;
-
-      case 5:
-        if (primcounter) {
-          *prim = (prim_t*)realloc(*prim, (primcounter+1)*sizeof(prim_t));
-        }
-
-        /* store exponent */
-        (*prim)[primcounter].exponent = exponent;
-          
-        /* store coefficient */
-        (*prim)[primcounter].contraction_coeff = contract[icoeff];
-        
-        primcounter++;
-        break;
-
-      case -1:
-        /* otherwise it's an empty line which represents the end of the shell */
-        break;
-
-      case 1:
-        /* the user had given the next atom a numeric name */
-        success = -1;
-        break;
-    }
-
-  } while(success>0);
-
-  if (!primcounter) free(*prim);
-
-  return primcounter;
-}
-
-
-
-/******************************************************
- *
- * this function extracts the trajectory information
- * from the output file
- *
- * *****************************************************/
-static int get_traj_frame(qmdata_t *data, qm_atom_t *atoms,
-                          int natoms) {
-  gmsdata *gms = (gmsdata *)data->format_specific_data;
-  qm_timestep_t *cur_ts;
-  char buffer[BUFSIZ];
-  char word[BUFSIZ];
-  int units;
-  buffer[0] = '\0';
-  word[0]   = '\0';
-
-  printf("gamessplugin) Timestep %d:\n", data->num_frames_read);
-  printf("gamessplugin) ============\n");
-
-  fseek(data->file, data->filepos_array[data->num_frames_read], SEEK_SET);
-
-  /* Read the coordinate block */
-  if (data->runtype==MOLFILE_RUNTYPE_OPTIMIZE ||
-      data->runtype==MOLFILE_RUNTYPE_SADPOINT) {
-    goto_keyline(data->file, "COORDINATES OF ALL ATOMS", NULL);
-    /* get the units */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, " COORDINATES OF ALL ATOMS ARE %s", word);
-    units = !strcmp(word, "(BOHR)");
-    eatline(data->file, 2);
-
-    if (!get_coordinates(data->file, &data->atoms, units, &natoms)) {
-      printf("gamessplugin) Couldn't find coordinates for timestep %d\n", data->num_frames_read);
-    }
-  }
-  else if (data->runtype==MOLFILE_RUNTYPE_SURFACE) {
-    if (pass_keyline(data->file, "HAS ENERGY VALUE",
-                     "...... END OF ONE-ELECTRON INTEGRALS ......")
-        == FOUND) {
-      /* Read the coordinate block following 
-       * ---- SURFACE MAPPING GEOMETRY ---- */
-      int i, n;
-      for (i=0; i<natoms; i++) {
-        char atname[BUFSIZ];
-        float x,y,z;
-        GET_LINE(buffer, data->file);
-        n = sscanf(buffer,"%s %f %f %f", atname, &x,&y,&z);
-        if (n!=4 || strcmp(atname, data->atoms[i].type)) break;
-        data->atoms[i].x = x;
-        data->atoms[i].y = y;
-        data->atoms[i].z = z;
-      }
-      if (i!=natoms) {
-        printf("gamessplugin) Couldn't read surface mapping geometry for timestep %d\n", data->num_frames_read);
-      }
-    }
-    else {
-      /* Read the coordinate block following 
-       * ATOM      ATOMIC                      COORDINATES (BOHR) */
-      goto_keyline(data->file, "ATOM      ATOMIC", NULL);
-      /* get the units */
-      GET_LINE(buffer, data->file);
-      sscanf(buffer, " ATOM      ATOMIC                      COORDINATES %s", word);
-      units = !strcmp(word, "(BOHR)");
-      eatline(data->file, 1);
-      
-      if (!get_coordinates(data->file, &data->atoms, units, &natoms)) {
-        printf("gamessplugin) Couldn't find coordinates for timestep %d\n", data->num_frames_read);
-      }
-    }
-  }
-  /* XXX could merge this with OPTIMIZE/SADPOINT */
-  else if (data->runtype==MOLFILE_RUNTYPE_MEX) {
-    int numuniqueatoms = natoms;
-    goto_keyline(data->file, "COORDINATES OF SYMMETRY UNIQUE ATOMS", NULL);
-    /* get the units */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, " COORDINATES OF SYMMETRY UNIQUE ATOMS ARE %s", word);
-    units = !strcmp(word, "(BOHR)");
-    eatline(data->file, 2);
-    if (!get_coordinates(data->file, &data->atoms, units, &numuniqueatoms)) {
-      printf("gamessplugin) Expanding symmetry unique coordinates for timestep %d\n", data->num_frames_read);
-
-      /* Create images of symmetry unique atoms so that we have
-       * the full coordinate set. */
-      symmetry_expand(&data->atoms, numuniqueatoms, natoms,
-                      data->pointgroup, data->naxis);
-    }
-  }
-
-  /* For FMO calculations we read the coordinates only
-   * because the wavefunctions are printed per fragment
-   * and VMD requires that there's a wavefunction present
-   * for each atom.
-   * A possible workaround would be to pad the wavefunctions
-   * accordingly and add a wavefunction for each fragment. */
-  if (gms->have_fmo) {
-    data->num_frames_read++;
-    return TRUE;
-  }
-
-  /* get a convenient pointer to the current qm timestep */
-  cur_ts = data->qm_timestep + data->num_frames_read;
-
-  /* read the SCF energies */
-  if (get_scfdata(data, cur_ts) == FALSE) {
-    printf("gamessplugin) Couldn't find SCF iterations for timestep %d\n",
-           data->num_frames_read);
-  }
-
-  /* Try reading canonical alpha/beta wavefunction */
-  check_add_wavefunctions(data, cur_ts);
-
-
-  /* Read population analysis (Mulliken and Lowdin charges)
-   * only if wasn't read already while parsing the final
-   * property section. Otherwise we would potentially 
-   * overwrite the data with empty fields. */
-  if (!cur_ts->have_mulliken &&
-      get_population(data, cur_ts)) {
-    printf("gamessplugin) Mulliken/Loewdin charges found\n");
-  }
-
-  if (data->citype==CI_GUGA) {
-    if (pass_keyline(data->file, "CI DENSITY MATRIX AND NATURAL ORBITALS",
-                       "GRADIENT (HARTREE/BOHR)")) {
-      int i, numstates=0, state;
-      qm_wavefunction_t *wave_ci;
-      goto_keyline(data->file, "NUMBER OF STATES", NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer, " NUMBER OF STATES = %d", &numstates);
-      printf("gamessplugin) Number of CI states = %d\n", numstates);
-
-      for (i=0; i<numstates; i++) {
-        float cienergy = 0.f;
-        goto_keyline(data->file, "CI EIGENSTATE", NULL);
-        GET_LINE(buffer, data->file);
-        sscanf(buffer," CI EIGENSTATE %d %*s %*s %*s %f", &state, &cienergy);
-        printf("gamessplugin) CI energy[%d] = %f\n", state-1, cienergy);
-
-        wave_ci = add_wavefunction(cur_ts);
-
-        if (get_wavefunction(data, cur_ts, wave_ci) == FALSE) {
-          del_wavefunction(cur_ts);
-          break;
-        }
-        else {
-          /* canon =-1;*/
-          wave_ci->exci = state-1;
-          wave_ci->energy = cienergy;
-          wave_ci->mult = data->multiplicity;
-
-          printf("gamessplugin) Found %d CI natural orbitals for excited state %d, mult=%d\n",
-                 wave_ci->num_orbitals, state-1, wave_ci->mult);
-        }
-      }
-    }
-  }
-  else if (data->citype==CI_CIS) {
-    if (pass_keyline(data->file,
-                     "USING DAVIDSON ALGORITHM TO FIND CIS EIGENVALUES",
-                     NULL)) {
-      int i, numstates=0, state;
-      qm_wavefunction_t *wave_ci;
-      float *state_energies, *state_spinquant;
-      goto_keyline(data->file, "NUMBER OF STATES REQUESTED", NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer, " NUMBER OF STATES REQUESTED = %d", &numstates);
-      printf("gamessplugin) Number of CIS states = %d\n", numstates);
-
-      /* For CIS only the wavefunction for the excited state 
-       * (specified by IROOT in $CIS group) will be printed.
-       * Here we read in the energies for all states, and store 
-       * the energy for the selected state in its wavefunction */
-      state_energies  = calloc(numstates+1, sizeof(float));
-      state_spinquant = calloc(numstates+1, sizeof(float));
-      goto_keyline(data->file, "RHF REFERENCE ENERGY  =", NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer, " RHF REFERENCE ENERGY  = %f", &state_energies[0]);
-      state_spinquant[0] = 1.f;
-
-      for (i=1; i<=numstates; i++) {
-        goto_keyline(data->file, "EXCITED STATE", NULL);
-        GET_LINE(buffer, data->file);
-        trimleft(buffer);
-        sscanf(buffer, " EXCITED STATE %*d  ENERGY= %f  S = %f",
-               &state_energies[i], &state_spinquant[i]);
-      }
-
-      goto_keyline(data->file,
-                   "CIS NATURAL ORBITAL OCCUPATION NUMBERS FOR EXCITED STATE",
-                   NULL);
-      GET_LINE(buffer, data->file);
-      trimleft(buffer);
-      sscanf(buffer,
-             " CIS NATURAL ORBITAL OCCUPATION NUMBERS FOR EXCITED STATE %d",
-             &state);
-      
-      wave_ci = add_wavefunction(cur_ts);
-
-      if (get_wavefunction(data, cur_ts, wave_ci) == FALSE) {
-        del_wavefunction(cur_ts);
-      }
-      else {
-        wave_ci->exci = state;
-        wave_ci->energy = state_energies[state];
-        wave_ci->mult = 2*(int)state_spinquant[state]+1;
-        printf("gamessplugin) Found %d CIS natural orbitals for excited state %d\n",
-               wave_ci->num_orbitals, state);
-      }
-
-      free(state_energies);
-      free(state_spinquant);
-    }
-  }
-
-
-  /* Read the energy gradients (=forces on atoms) */
-  if (get_gradient(data, cur_ts)) {
-    printf("gamessplugin) Energy gradient found.\n");
-  }
-
-
-  /* If this is the last frame of the trajectory and the file
-   * wasn't truncated and the program didn't terminate
-   * abnormally then read the final wavefunction. */
-  if ((data->runtype == MOLFILE_RUNTYPE_OPTIMIZE ||
-       data->runtype == MOLFILE_RUNTYPE_SADPOINT) &&
-      (data->num_frames_read+1 == data->num_frames &&
-       (data->status == MOLFILE_QMSTATUS_UNKNOWN || 
-        data->status == MOLFILE_QMSTATUS_OPT_CONV ||
-        data->status == MOLFILE_QMSTATUS_OPT_NOT_CONV))) {
-
-    /* We need to jump over the end of the trajectory because 
-     * this is also the keystring for get_wavefunction() to
-     * bail out. */
-    if (data->status == MOLFILE_QMSTATUS_OPT_CONV || 
-        data->status == MOLFILE_QMSTATUS_OPT_NOT_CONV) {
-      fseek(data->file, data->end_of_traj, SEEK_SET);
-    }
-
-    /* Try to read final wavefunction and orbital energies
-     * A preexisting canonical wavefunction for this timestep
-     * with the same characteristics (spin, exci, info) will
-     * be overwritten by the final wavefuntion if it has more
-     * orbitals. */
-    check_add_wavefunctions(data, cur_ts);
-  }
-
-
-  /* For MCSCF optimized orbitals no occupancies are given
-   * but since their occupancies are identical to the ones
-   * from natural orbitals we can use those. The natural 
-   * orbitals are always listed right before the optimized
-   * ones so we simply copy the data over. */
-  if (cur_ts->numwave>=2 &&
-      cur_ts->wave[cur_ts->numwave-1].type==MOLFILE_WAVE_MCSCFOPT &&
-      cur_ts->wave[cur_ts->numwave-2].type==MOLFILE_WAVE_MCSCFNAT) {
-    int i;
-    qm_wavefunction_t *waveopt = &cur_ts->wave[cur_ts->numwave-1];
-    qm_wavefunction_t *wavenat = &cur_ts->wave[cur_ts->numwave-2];
-    waveopt->orb_occupancies = (float *)calloc(waveopt->num_orbitals,
-                                               sizeof(float));
-    /* Only the core and active natural orbitals are listed. 
-     * We copy the occupancies for these orbitals and pad the
-     * rest with zeros. */
-    for (i=0; i<wavenat->num_orbitals; i++) {
-      waveopt->orb_occupancies[i] = wavenat->orb_occupancies[i];
-    }
-    for (i=wavenat->num_orbitals; i<waveopt->num_orbitals; i++) {
-      waveopt->orb_occupancies[i] = 0.f;
-    }
-    waveopt->has_occup = TRUE;
-  }
-
-
-  data->num_frames_read++;
-
-  return TRUE;
-}
-
-
-/* Analyze the trajectory.
- * Read the parameters controlling geometry search and
- * find the end of the trajectory, couinting the frames
- * on the way. Store the filepointer for the beginning of
- * each frame in *filepos_array. */
-static int analyze_traj(qmdata_t *data, gmsdata *gms) {
-  char buffer[BUFSIZ], nserch[BUFSIZ];
-  char *line;
-  long filepos;
-  filepos = ftell(data->file);
-
-  data->filepos_array = (long* )calloc(1, sizeof(long ));
-
-  if (data->runtype==MOLFILE_RUNTYPE_OPTIMIZE ||
-      data->runtype==MOLFILE_RUNTYPE_SADPOINT) {
-    pass_keyline(data->file,
-                   "PARAMETERS CONTROLLING GEOMETRY SEARCH", NULL);
-    eatline(data->file, 2);
-
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, "NSTEP  = %d", &data->max_opt_steps);
-    eatline(data->file, 3);
-    GET_LINE(buffer, data->file);
-    sscanf(buffer, "OPTTOL = %f", &data->opt_tol);
-
-    /* The $STATP options are followed by the coordinates 
-     * but we can skip them here because we rewind after
-     * get_guess_options() and try to read them in
-     * get_traj_frame(). */
-  }
-  else if (data->runtype==MOLFILE_RUNTYPE_SURFACE) {
-    if (pass_keyline(data->file,
-                     "POTENTIAL SURFACE MAP INPUT", NULL)) {
-      
-      int coord1[2];
-      int mplevel1=-1, mplevel2=-1, nstep1;
-      float origin1, disp1;
-      char runtype1[BUFSIZ], runtype2[BUFSIZ];
-      char scftype1[BUFSIZ], scftype2[BUFSIZ];
-      char dfttype1[BUFSIZ], dfttype2[BUFSIZ];
-      char citype1[BUFSIZ],  citype2[BUFSIZ];
-      char cctype1[BUFSIZ],  cctype2[BUFSIZ];
-      char *tmp;
-      int n;
-        
-      eatline(data->file, 1);
-
-      GET_LINE(buffer, data->file);
-      n=sscanf(buffer, " JOB 1 IS RUNTYP=%s SCFTYP=%s CITYP=%s",
-               runtype1, scftype1, citype1);
-      if (n==3) {
-        GET_LINE(buffer, data->file);
-        sscanf(buffer, " MPLEVL= %d CCTYP=%s, DFTTYP=%s\n",
-               &mplevel1, dfttype1, cctype1);
-        GET_LINE(buffer, data->file);
-      }
-      n=sscanf(buffer, " JOB 2 IS RUNTYP=%s SCFTYP=%s CITYP=%s",
-               runtype2, scftype2, citype2);
-      if (n==3) {
-        GET_LINE(buffer, data->file);
-        sscanf(buffer, " MPLEVL= %d CCTYP=%s, DFTTYP=%s\n",
-               &mplevel2, dfttype2, cctype2);
-        GET_LINE(buffer, data->file);
-      }
-
-      sscanf(buffer, " COORD 1 LYING ALONG ATOM PAIR %d %d",
-             coord1, coord1+1);
-      GET_LINE(buffer, data->file);
-      tmp = strstr(buffer, "ORIGIN=") + 7;
-      sscanf(tmp, "%f", &origin1);
-      tmp = strstr(buffer, "DISPLACEMENT=") + 13;
-      sscanf(tmp, "%f", &disp1);
-      tmp = strstr(buffer, "AND") + 3;
-      sscanf(tmp, "%d STEPS.", &nstep1);
-      printf("gamessplugin) origin=%f, displacement=%f nstep=%d\n", origin1, disp1, nstep1);
-    }
-  }
-  else if (data->runtype==MOLFILE_RUNTYPE_MEX) {
-    char scftype1[BUFSIZ];
-    char scftype2[BUFSIZ];
-    rewind(data->file);
-    if (!pass_keyline(data->file, "$MEX OPTIONS", NULL)) {
-      printf("gamessplugin) No $MEX OPTIONS found!\n");
-      return FALSE;
-    }
-    eatline(data->file, 2);
-    GET_LINE(buffer, data->file);
-    sscanf(strstr(buffer, "SCF1    =")+7, "%s", scftype1);
-    sscanf(strstr(buffer, "SCF2   =")+7, "%s", scftype2);
-    printf("gamessplugin) MEX SCF1=%s SCF2=%s\n", scftype1, scftype2);
-
-  }
-  else {
-    /* We have just one frame */
-    data->num_frames = 1;
-    pass_keyline(data->file, "1 ELECTRON INTEGRALS",
-                 "ENERGY COMPONENTS");
-    data->filepos_array[0] = ftell(data->file);
-
-    /* Check wether SCF has converged */
-    if (pass_keyline(data->file,
-                     "SCF IS UNCONVERGED, TOO MANY ITERATIONS",
-                     "ENERGY COMPONENTS")==FOUND) {
-      printf("gamessplugin) SCF IS UNCONVERGED, TOO MANY ITERATIONS\n");
-      data->status = MOLFILE_QMSTATUS_SCF_NOT_CONV;
-    } else {
-      data->status = MOLFILE_QMSTATUS_OPT_CONV;
-      fseek(data->file, data->filepos_array[0], SEEK_SET);
-    }
-
-    pass_keyline(data->file, "ENERGY COMPONENTS", NULL);
-    data->end_of_traj = ftell(data->file);
-
-    /* Allocate memory for the frame */
-    data->qm_timestep = (qm_timestep_t *)calloc(1, sizeof(qm_timestep_t));
-    memset(data->qm_timestep, 0, sizeof(qm_timestep_t));
-    
-    return TRUE;
-  }
-
-  printf("gamessplugin) Analyzing trajectory...\n");
-  data->status = MOLFILE_QMSTATUS_UNKNOWN;
-
-  while (1) {
-    if (!fgets(buffer, sizeof(buffer), data->file)) break;
-    line = trimleft(buffer);
-
-    /* at this point we have to distinguish between
-     * pre="27 JUN 2005 (R2)" and "27 JUN 2005 (R2)"
-     * versions since the output format for geometry
-     * optimizations has changed */
-    if (gms->version==FIREFLY8POST6695){
-      strcpy(nserch, "NSERCH=");
-    }
-    else if (gms->version==FIREFLY8PRE6695) {
-      strcpy(nserch, "1NSERCH=");
-    }
-    else if (gms->version==GAMESSPRE20050627) {
-      strcpy(nserch, "1NSERCH=");
-    }
-    else if (gms->version==GAMESSPOST20050627) {
-      strcpy(nserch, "BEGINNING GEOMETRY SEARCH POINT NSERCH=");
-    }
-
-    if (strstr(line, nserch) ||
-        strstr(line, "---- SURFACE MAPPING GEOMETRY") ||
-        strstr(line, "MINIMUM ENERGY CROSSING POINT SEARCH") ||
-        (data->runtype==MOLFILE_RUNTYPE_MEX && strstr(line, "NSERCH=")==line)) {
-      printf("gamessplugin) %s", line);
-
-      if (data->num_frames > 0) {
-        data->filepos_array = (long*)realloc(data->filepos_array,
-                                (data->num_frames+1)*sizeof(long));
-      }
-      data->filepos_array[data->num_frames] = ftell(data->file);
-      if (data->runtype==MOLFILE_RUNTYPE_SURFACE) {
-        int ret = goto_keyline(data->file,
-                               "ATOM      ATOMIC", "HAS ENERGY VALUE",
-                               "---- SURFACE MAPPING GEOMETRY ----", NULL);
-        if (ret>0 && ret<3 &&
-            (have_keyline(data->file, "...... END OF ONE-ELECTRON INTEGRALS ......",
-                          "---- SURFACE MAPPING GEOMETRY ----") ||
-             have_keyline(data->file, "... DONE WITH POTENTIAL SURFACE SCAN",
-                          "---- SURFACE MAPPING GEOMETRY ----"))) {
-          data->num_frames++;          
-        }
-      }
-      else if (pass_keyline(data->file, "COORDINATES OF",
-                            "BEGINNING GEOMETRY SEARCH POINT NSERCH=")==FOUND)
-      {
-        /* Make sure that we have at least a complete coordinate
-           block in order to consider this a new frame. */
-        if (have_keyline(data->file, "INTERNUCLEAR DISTANCES",
-                         "1 ELECTRON INTEGRALS") ||
-            have_keyline(data->file, "1 ELECTRON INTEGRALS",
-                         "BEGINNING GEOMETRY SEARCH POINT NSERCH=")) {
-          data->num_frames++;
-        }
-      }
-    }
-    else if (strstr(line, "***** EQUILIBRIUM GEOMETRY LOCATED") ||
-             strstr(line, "... DONE WITH POTENTIAL SURFACE SCAN")) {
-      printf("gamessplugin) ==== End of trajectory (%d frames) ====\n",
-             data->num_frames);
-      data->status = MOLFILE_QMSTATUS_OPT_CONV;
-      break;
-    }
-    else if (strstr(line, "***** FAILURE TO LOCATE STATIONARY POINT,")) {
-      printf("gamessplugin) %s\n", line);
-      if (strstr(strchr(line, ','), "SCF HAS NOT CONVERGED")) {
-        data->status = MOLFILE_QMSTATUS_SCF_NOT_CONV;
-        break;
-      }
-      else if (strstr(strchr(line, ','), "TOO MANY STEPS TAKEN")) {
-        data->status = MOLFILE_QMSTATUS_OPT_NOT_CONV;
-        break;
-      }
-    }
-  }
-  
-  data->end_of_traj = ftell(data->file);
-  fseek(data->file, filepos, SEEK_SET);
-
-  if (data->status == MOLFILE_QMSTATUS_UNKNOWN) {
-    /* We didn't find any of the regular key strings,
-     * the run was most likely broken off and we have an
-     * incomplete file. */
-    data->status = MOLFILE_QMSTATUS_FILE_TRUNCATED;
-  }
-
-
-  /* Allocate memory for all frames */
-  data->qm_timestep = (qm_timestep_t *)calloc(data->num_frames,
-                                              sizeof(qm_timestep_t));
-  memset(data->qm_timestep, 0, data->num_frames*sizeof(qm_timestep_t));
-
-
-  if (data->status == MOLFILE_QMSTATUS_SCF_NOT_CONV ||
-      data->status == MOLFILE_QMSTATUS_FILE_TRUNCATED) {
-    return FALSE;  
-  }
-
-  return TRUE;
-}
-
-
-/***************************************************************
- *
- * Read the number of scf iterations and the scf energies
- * for the current timestep. 
- * Assumes that the file pointer is somewhere before this:
- * ITER EX DEM     TOTAL ENERGY        E CHANGE  DENSITY CHANGE    DIIS ERROR
- * 1  0  0      -39.7266993475   -39.7266993475   0.000000118   0.000000000
- * 2  1  0      -39.7266991566     0.0000001909   0.000000032   0.000000000
- * ...
- * then it reads the block up to the next blank line.
- * The second argument is a pointer to the qm timestep you want to
- * store the data in. Memory for the scfenergies will be
- * allocated.
- *
- ***************************************************************/
-static int get_scfdata(qmdata_t *data, qm_timestep_t *ts) {
-  char buffer[BUFSIZ];
-  char word[3][BUFSIZ];
-  long filepos;
-  int i, epos = -1;
-  int numread, numiter=0, dum, dum2;
-  char *line;
-  float dumf;
-  filepos = ftell(data->file);
-
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  if (!goto_keyline(data->file, "ITER EX", "ITER     TOTAL",
-                     "ITER    TOTAL", NULL)) {
-    fseek(data->file, filepos, SEEK_SET);
-    ts->num_scfiter = 0;
-    return FALSE;
-  }
-
-  /* determine in which column the energy is stored */
-  GET_LINE(buffer, data->file);
-  numread = sscanf(buffer, "%*s %s %s %s",
-                   &word[0][0], &word[1][0], &word[2][0]);
-  for (i=0; i<numread; i++) {
-    if (!strcmp(&word[i][0], "TOTAL")) epos = i+1;
-  }
-   
-  if (epos<0) {
-    fseek(data->file, filepos, SEEK_SET);
-    ts->num_scfiter = 0;
-    return FALSE;
-  }
-
-  /* store current file position since we first have to count
-   * the iterations */
-  filepos = ftell(data->file);
-
-  /* read until the next blank line and count the iterations */
-  do {
-    GET_LINE(buffer, data->file);
-    line = trimleft(buffer);
-    numread = sscanf(line,"%d %d %*d %*f", &dum, &dum2);
-    if (numread==2) numiter++;
-  } while (strlen(line)>2);
-
-  printf("gamessplugin) %d SCF iterations\n", numiter);
-
-  /* go back and read energies */
-  fseek(data->file, filepos, SEEK_SET);
-  
-
-  /* allocate memory for scfenergy array */
-  ts->scfenergies = (double *)calloc(numiter,sizeof(double));
-  
-  i=0;
-  do {
-    GET_LINE(buffer, data->file);
-    line = trimleft(buffer);
-    numread = sscanf(line,"%d %f %*i %*f", &dum, &dumf);
-    if (numread==2) {
-      switch (epos) {
-      case 1:
-        sscanf(buffer,"%*d %lf", ts->scfenergies+i);
-        break;
-      case 2:
-        sscanf(buffer,"%*d %*d %lf", ts->scfenergies+i);
-        break;
-      case 3:
-        sscanf(buffer,"%*d %*d %*d %lf", ts->scfenergies+i);
-        break;
-      }
-      i++;
-    }
-  } while (strlen(line)>2);
-
-#if 0
-  for (i=0; i<numiter; i++) {
-    printf("scfenergies[%d] = %f\n", i, ts->scfenergies[i]);
-  }
-#endif
-
-  ts->num_scfiter = numiter;
-  
-  return TRUE;
-}
-
-
-/*********************************************************
- *
- * Reads a set of wavefunctions for the current timestep.
- * These are typically the alpha and beta spin wavefunctions
- * or the MCSCF natural and optimized orbitals or the GVB
- * canonical orbitals and geminal pairs.
- *
- **********************************************************/
-static int check_add_wavefunctions(qmdata_t *data,
-                                   qm_timestep_t *ts) {
-  qm_wavefunction_t *wavef;
-  int i, n=1;
-
-  if (data->scftype==MOLFILE_SCFTYPE_UHF || 
-      data->scftype==MOLFILE_SCFTYPE_GVB ||
-      data->scftype==MOLFILE_SCFTYPE_MCSCF) {
-    /* Try to read second wavefunction
-     * (spin beta or GI orbitals or MCSCF optimized orbs) */
-    n = 2;
-  }
-
-  for (i=0; i<n; i++) {
-    /* Allocate memory for new wavefunction */
-    wavef = add_wavefunction(ts);
-
-    /* Try to read wavefunction and orbital energies */
-    if (get_wavefunction(data, ts, wavef) == FALSE) {
-      /* Free the last wavefunction again. */
-      del_wavefunction(ts);
-#ifdef DEBUGGING
-      printf("gamessplugin) No canonical wavefunction present for timestep %d\n", data->num_frames_read);
-#endif
-      break;
-
-    } else {
-      char action[32];
-      char spinstr[32];
-      strcpy(spinstr, "");
-      if (data->scftype==MOLFILE_SCFTYPE_UHF) {
-        if (wavef->spin==SPIN_BETA) {
-          strcat(spinstr, "spin  beta, ");
-        } else {
-          strcat(spinstr, "spin alpha, ");
-        }
-      }
-      
-      /* The last SCF energy is the energy of this electronic state */
-      if (ts->scfenergies) {
-        wavef->energy = ts->scfenergies[ts->num_scfiter-1];
-      } else {
-        wavef->energy = 0.f;
-      }
-      
-      /* Multiplicity */
-      wavef->mult = data->multiplicity;
-      
-
-      /* String telling wether wavefunction was added, updated
-       * or ignored. */
-      strcpy(action, "added");
-
-      /* If there exists a canonical wavefunction of the same spin
-       * we'll replace it */
-      if (ts->numwave>1 && wavef->type==MOLFILE_WAVE_CANON) {
-        int i, found =-1;
-        for (i=0; i<ts->numwave-1; i++) {
-          if (ts->wave[i].type==wavef->type &&
-              ts->wave[i].spin==wavef->spin &&
-              ts->wave[i].exci==wavef->exci &&
-              !strncmp(ts->wave[i].info, wavef->info, MOLFILE_BUFSIZ)) {
-            found = i;
-            break;
-          }
-        }
-        if (found>=0) {
-          /* If the new wavefunction has more orbitals we 
-           * replace the old one for this step. */
-          if (wavef->num_orbitals > 
-              ts->wave[found].num_orbitals) {
-            /* Replace existing wavefunction for this step */
-            replace_wavefunction(ts, found);
-            sprintf(action, "%d updated", found);
-          } else {
-            /* Delete last wavefunction again */
-            del_wavefunction(ts);
-            sprintf(action, "matching %d ignored", found);
-          }
-          wavef = &ts->wave[ts->numwave-1];
-        }
-      }
-
-      printf("gamessplugin) Wavefunction %s (%s):\n", action, wavef->info);
-      printf("gamessplugin)   %d orbitals, %sexcitation %d, multiplicity %d\n",
-             wavef->num_orbitals, spinstr, wavef->exci, wavef->mult);
-    }
-  }
-
-  return i;
-}
-
-
-/*********************************************************
- *
- * Finds the next wavefunction, determines its type by
- * analyzing the keystring and reads in the wavefunction
- * coefficients.
- *
- **********************************************************/
-static int get_wavefunction(qmdata_t *data, qm_timestep_t *ts,
-                            qm_wavefunction_t *wf)
-{
-  float *orb_enocc;
-  float *wave_coeff;
-  char buffer[BUFSIZ];
-  char word[6][BUFSIZ];
-  int num_orbitals = 0;
-  int i = 0, num_values = 0;
-  long filepos;
-  char *line;
-  int have_orbenocc = 0;
-  int n[5];
-
-  buffer[0] = '\0';
-  for (i=0; i<6; i++) word[i][0] = '\0';
-
-  if (wf == NULL) {
-    PRINTERR;	    
-    return FALSE;
-  }
-
-  wf->has_occup = FALSE;
-  wf->has_orben = FALSE;
-  wf->type = MOLFILE_WAVE_UNKNOWN;
-  wf->spin = SPIN_ALPHA;
-  wf->exci = 0;
-  strncpy(wf->info, "unknown", MOLFILE_BUFSIZ);
-
-  /*
-   * Scan for something like this:
-
-          ------------------
-          MOLECULAR ORBITALS     <<--- sometimes EIGENVECTORS
-          ------------------
-
-                      1          2          3          4          5
-                  -11.0297    -0.9121    -0.5205    -0.5205    -0.5205  <<-- orbital energies (or occupancies)                     A          A          A          A          A   
-    1  C  1  S    0.991925   0.221431   0.000006  -0.000001   0.000002
-    2  C  1  S    0.038356  -0.627585  -0.000021   0.000003  -0.000006
-    3  C  1  X    0.000000  -0.000004   0.338169  -0.030481  -0.460283
-     ...
-
-                     6          7          8          9
-                    0.7192     0.7192     0.7193     0.7611
-                     A          A          A          A   
-    1  C  1  S    0.000028   0.000012   0.000092   0.252320
-    2  C  1  S   -0.000183  -0.000077  -0.000594  -1.632834
-    3  C  1  X   -0.890147   0.062618   0.654017  -0.000154
-      ...
-
-
-     ----------------------------------------------------------------
-     PROPERTY VALUES FOR THE RHF   SELF-CONSISTENT FIELD WAVEFUNCTION
-     ----------------------------------------------------------------
-  * 
-  */
-
-  /* Remember position in order to go back if no wave function was found */
-  filepos = ftell(data->file);
-
-  do {
-    GET_LINE(buffer, data->file);
-
-    line = trimleft(trimright(buffer));
-
-    if      (!strcmp(line, "----- ALPHA SET -----")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-      pass_keyline(data->file, "EIGENVECTORS", NULL);
-    }
-    else if (!strcmp(line, "----- BETA SET -----")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      wf->spin = SPIN_BETA;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-      pass_keyline(data->file, "EIGENVECTORS", NULL);
-    }
-    else if (!strcmp(line, "****** BETA ORBITAL LOCALIZATION *****")) {
-      wf->spin = SPIN_BETA;
-    }
-    else if (!strcmp(line, "EIGENVECTORS")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "MOLECULAR ORBITALS")) {
-      wf->type = MOLFILE_WAVE_CANON;
-      strncpy(wf->info, "canonical", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "THE BOYS LOCALIZED ORBITALS ARE")) {
-      wf->type = MOLFILE_WAVE_BOYS;
-      strncpy(wf->info, "Boys localized", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "THE PIPEK-MEZEY POPULATION LOCALIZED ORBITALS ARE")) {
-      wf->type = MOLFILE_WAVE_PIPEK;
-      strncpy(wf->info, "Pipek-Mezey localized", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "EDMISTON-RUEDENBERG ENERGY LOCALIZED ORBITALS")) {
-      wf->type = MOLFILE_WAVE_RUEDEN;
-      strncpy(wf->info, "Ruedenberg localized", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "GI ORBITALS")) {
-      wf->type = MOLFILE_WAVE_GEMINAL;
-      strncpy(wf->info, "GVB geminal pairs", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "MCSCF NATURAL ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFNAT;
-      strncpy(wf->info, "MCSCF natural orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "MCSCF OPTIMIZED ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFOPT;
-      strncpy(wf->info, "MCSCF optimized orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "NATURAL ORBITALS IN ATOMIC ORBITAL BASIS")) {
-      wf->type = MOLFILE_WAVE_CINATUR;
-      strncpy(wf->info, "CI natural orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "CIS NATURAL ORBITALS")) {
-      wf->type = MOLFILE_WAVE_CINATUR;
-      strncpy(wf->info, "CIS natural orbitals", MOLFILE_BUFSIZ);
-    }
-    // FOR PCGAMESS/FIREFLY
-    else if (!strcmp(line, "-MCHF- NATURAL ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFNAT;
-      strncpy(wf->info, "MCSCF natural orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "-MCHF- OPTIMIZED ORBITALS")) {
-      wf->type = MOLFILE_WAVE_MCSCFOPT;
-      strncpy(wf->info, "MCSCF optimized orbitals", MOLFILE_BUFSIZ);
-    }
-    else if (!strcmp(line, "ZERO-ORDER QDPT NATURAL ORBITALS")){
-      //Not yet implemented
-    }
-
-  } while(wf->type==MOLFILE_WAVE_UNKNOWN &&
-          strcmp(line, "ENERGY COMPONENTS") &&
-          strcmp(line, "***** EQUILIBRIUM GEOMETRY LOCATED *****") &&
-          strcmp(line, "**** THE GEOMETRY SEARCH IS NOT CONVERGED! ****"));
-
-  /* If we reach the last line of the rhf section without finding 
-   * one of the keywords marking the beginning of a wavefunction
-   * table then we return.*/
-  if (wf->type==MOLFILE_WAVE_UNKNOWN) {
-#ifdef DEBUGGING
-    printf("gamessplugin) get_wavefunction(): No wavefunction found!\n");
-#endif
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* Reserve space for arrays storing wavefunction and orbital
-   * energies. we reserve the max. space (num_orbitals==wavef_size)
-   * for now and realloc later if, we have less orbitals. */
-  wave_coeff = (float *)calloc(data->wavef_size*data->wavef_size,
-                                  sizeof(float)); 
-  //printf("gamessplugin) wave_coeff() allocated\n");
-
-  if (wave_coeff == NULL) {
-    PRINTERR;	    
-    return FALSE;
-  }
-
-  /* orbital energies/occupancies */  
-  orb_enocc = (float *)calloc(data->wavef_size, sizeof(float));
-  //printf("gamessplugin) orb_enocc() allocated\n");
-
-  if (orb_enocc == NULL) {
-    free(orb_enocc);
-    PRINTERR; 
-    return FALSE;
-  }
-
-
-  /* store the coeficient pointer */
-  wf->wave_coeffs  = wave_coeff;
-
-  /* depending on the wavefunction type the line after the
-     orbital index stores the orbital occupancies or energies */
-  if (wf->type == MOLFILE_WAVE_CINATUR  ||
-      wf->type == MOLFILE_WAVE_MCSCFNAT) {
-    wf->orb_occupancies = orb_enocc;
-    wf->has_occup = TRUE;
-  } else {
-    wf->orb_energies    = orb_enocc;
-    wf->has_orben = TRUE;
-  }
-
-  /* skip the next line which here is typically "-------" */
-  eatline(data->file, 1);
-
-
-  while (1) {
-    int nr, over=0;
-    float coeff[5], enocc[5];
-
-    if (wf->type == MOLFILE_WAVE_GEMINAL) {
-      /* Skip over "PAIR x" header line */
-      pass_keyline(data->file, "PAIR ", NULL);
-    }
-
-    eatwhitelines(data->file);
-    filepos = ftell(data->file);
-
-    /* Parse the orbital indexes */
-    GET_LINE(buffer, data->file);
-    num_values = sscanf(buffer, "%d %d %d %d %d",
-                          &n[0], &n[1], &n[2], &n[3], &n[4]);
-
-    /* If there are no orbital indexes then this must be the
-     * end of the wavefunction coefficient table. */
-    if (!num_values) {
-      fseek(data->file, filepos, SEEK_SET);
-      break;
-    }
-
-    eatwhitelines(data->file);
-
-    /* Read first line of orbital energies/occupancies */
-    filepos = ftell(data->file);
-    GET_LINE(buffer, data->file);
-    have_orbenocc = sscanf(buffer,"%f %f %f %f %f", &enocc[0],
-                        &enocc[1], &enocc[2], &enocc[3], &enocc[4]);
-
-    /* Make sure this is not the first line containing coeffs */
-    nr = sscanf(buffer, " 1 %*s 1 %*s %f %f %f %f %f",
-               &coeff[0], &coeff[1], &coeff[2], &coeff[3], &coeff[4]);
-    if (nr==num_values) have_orbenocc = 0;
-
-    if (have_orbenocc) {
-      /* store the orbital energies in the appropriate arrays 
-       * read them until we encounter an empty string */
-      for(i=0; i<num_values; i++) {
-        orb_enocc[i] = enocc[i];
-      }
-      
-
-      /* If we are in the first block we have to distinguish 
-         between energies and occupancies */
-      if (wf->type  == MOLFILE_WAVE_MCSCFNAT &&
-          orb_enocc == wf->orb_occupancies   &&
-          enocc[0] <= 0.f) {
-        wf->orb_occupancies = NULL;
-        wf->has_occup = FALSE;
-        wf->orb_energies    = orb_enocc;
-        wf->has_orben = TRUE;
-      }
-
-      /* increase orbital energy pointer */
-      orb_enocc = orb_enocc+5;
-    }      
-    else {
-      /* No orbital energies present, go back one line */
-      fseek(data->file, filepos, SEEK_SET);
-    }
-
-    num_orbitals += num_values;
-
-    /* Find first line containing coefficients */
-    filepos = ftell(data->file);
-    while (fgets(buffer, sizeof(buffer), data->file)) {
-      trimleft(buffer);
-      if (strstr(line, "ENERGY COMPONENTS") ||
-          strstr(line, "---") ||
-          strstr(line, "...")) {
-        over = 1; break;
-      }
-
-      nr = sscanf(buffer, " 1 %*s 1 %*s %f %f %f %f %f",
-             &coeff[0], &coeff[1], &coeff[2], &coeff[3], &coeff[4]);
-      if (nr==num_values) break;
-      filepos = ftell(data->file);
-    }
-    fseek(data->file, filepos, SEEK_SET);
-
-    if (over) break;
-
-
-    /* Read the wave function coefficient block for up to 5
-     * orbitals per line. */
-    if (!read_coeff_block(data->file, data->wavef_size,
-                          wave_coeff, data->angular_momentum)) {
-      printf("gamessplugin) Wavefunction coefficient block truncated or ill formatted!\n");
-      data->status = MOLFILE_QMSTATUS_FILE_TRUNCATED;
-      return FALSE;
-    }
-
-
-    /* move wavefunction pointer to start of next five orbitals */
-    if (wf->type == MOLFILE_WAVE_GEMINAL) {
-      wave_coeff = wave_coeff + 2*data->wavef_size;
-    } else {
-      wave_coeff = wave_coeff + 5*data->wavef_size;
-    }
-  }
-
-
-  if (!num_orbitals) {
-    printf("gamessplugin) No orbitals in wavefunction!\n");
-    return FALSE;
-  }
-
-  /* resize the array to the actual number of read orbitals */
-  if (data->wavef_size!=num_orbitals) {
-
-    if (wf->has_occup) {
-      wf->orb_occupancies = (float *)realloc(wf->orb_occupancies,
-               num_orbitals*sizeof(float));
-    }
-    if (wf->has_orben) {
-      wf->orb_energies = (float *)realloc(wf->orb_energies,
-               num_orbitals*sizeof(float));
-    }
-
-    wf->wave_coeffs  = (float *)realloc(wf->wave_coeffs, data->wavef_size*
-					num_orbitals*sizeof(float)); 
-  }
-
-  /* In case MCSCF natural orbitals are present, then GAMESS
-     prints the orbital energy for the core orbitals and the
-     occupancy for the other orbitals. We zero out the non-core
-     energies to prevent confusion. The orbital occupancies 
-     are read separately elsewhere. */
-  if (wf->type == MOLFILE_WAVE_MCSCFNAT &&
-      wf->has_orben == TRUE ) {
-    wf->orb_occupancies = (float *)calloc(num_orbitals, sizeof(float));
-
-    for (i=0; i<data->mcscf_num_core; i++) {
-      wf->orb_occupancies[i] = 2.f;
-    }
-
-    for (i=data->mcscf_num_core; i<num_orbitals; i++) {
-      wf->orb_occupancies[i] = wf->orb_energies[i];
-      wf->orb_energies[i] = 0.f;
-    }
-
-    wf->has_occup = TRUE;
-  }
-
-
-  /* store the number of orbitals read in */
-  wf->num_orbitals  = num_orbitals;
-
-  return TRUE;
-}
-
-
-/* Read the wave function coefficient block for up to 5
- * orbitals per line:
- *  1  C  1  S    0.989835   0.155361   0.000000  -0.214258   0.000000
- *  2  C  1  S    0.046228  -0.548915   0.000000   0.645267   0.000000
- *  3  C  1  X    0.000000   0.000000   1.030974   0.000000   0.000000
- */
-static int read_coeff_block(FILE *file, int wavef_size,
-                            float *wave_coeff, int *angular_momentum) {
-  int i, j;
-  int truncated = 0;
-  char buffer[BUFSIZ];
-
-  /* Read a line with coefficients for up to 5 orbitals
-   * for each cartesian basis function. */
-  for (i=0; i<wavef_size; i++) {
-    char type[BUFSIZ];
-    float coeff[5];
-    int num_values = 0;
-    
-    GET_LINE(buffer, file);
-    
-    /* read in the wavefunction coefficients for 5
-     * orbitals at a time line by line */
-    num_values = sscanf(buffer,"%*5i%*4s%*2i%4s %f %f %f %f %f", 
-                        type, &coeff[0], &coeff[1], &coeff[2],
-                        &coeff[3], &coeff[4]);
-    
-    if (num_values==0) {
-      /* The file must have been truncated! */
-      truncated = 1;
-      break;
-    }
-
-    angular_momentum_expon(&angular_momentum[3*i], type);
-   
-    /* Each orbital has data->wavef_size entries, 
-     * hence we have to use this number as offset when storing 
-     * them in groups of five. */
-    for (j=0 ; j<num_values-1; j++) {
-      wave_coeff[j*wavef_size+i] = coeff[j];
-    }
-  }
-  
-  if (truncated) return 0;
-  
-  return 1;
-}
-
-/* Read the population analysis section.
- * Currently we parse only the Mulliken and Lowdin charges
- * but we might want to add support for population analysis. */
-static int get_population(qmdata_t *data, qm_timestep_t *ts) {
-  int i;
-  char buffer[BUFSIZ];
-  long filepos;
-  ts->have_mulliken = FALSE;
-  ts->have_lowdin   = FALSE;
-  filepos = ftell(data->file);
-
-  if (pass_keyline(data->file,
-                     "TOTAL MULLIKEN AND LOWDIN ATOMIC POPULATIONS",
-                     "NSERCH=") != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* Read Mulliken charges if present */
-  ts->mulliken_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (!ts->mulliken_charges) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  ts->lowdin_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (!ts->lowdin_charges) {
-    free(ts->mulliken_charges);
-    ts->mulliken_charges = NULL;
-    PRINTERR; 
-    return FALSE;
-  }
-  
-  eatline(data->file, 1);
-  
-  for (i=0; i<data->numatoms; i++) {
-    int n;
-    float mullpop, mullcharge, lowpop, lowcharge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*i %*s %f %f %f %f",
-                   &mullpop, &mullcharge, &lowpop, &lowcharge);
-    if (n!=4) {
-      free(ts->mulliken_charges);
-      free(ts->lowdin_charges);
-      ts->mulliken_charges = NULL;
-      ts->lowdin_charges   = NULL;
-      return FALSE;
-    }
-    ts->mulliken_charges[i] = mullcharge;
-    ts->lowdin_charges[i]   = lowcharge;
-  }
-
-  if (i!=data->numatoms) {
-    free(ts->mulliken_charges);
-    free(ts->lowdin_charges);
-    ts->mulliken_charges = NULL;
-    ts->lowdin_charges   = NULL;
-    return FALSE;
-  }
-
-  ts->have_mulliken = TRUE;
-  ts->have_lowdin   = TRUE;
-  return TRUE;
-}
-
-
-/* Read ESP charges.
- * XXX Right now we don't distinguish between different type of
- * ESP-style charges (CHELPG, CONNOLLY, GEODESIC). 
- * This could be solved by reading in the PTSEL keyword in
- * the $PDC group. */
-static int get_esp_charges(qmdata_t *data) {
-  int i;
-  char buffer[BUFSIZ];
-  long filepos;
-  /* Store charges in last timestep */
-  qm_timestep_t *ts = &data->qm_timestep[data->num_frames-1];
-
-  ts->have_esp = FALSE;
-  filepos = ftell(data->file);
-
-  if (pass_keyline(data->file,
-           "ATOM                CHARGE    E.S.D.",
-           "...... END OF PROPERTY EVALUATION ") != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* Read ESP charges if present */
-  ts->esp_charges = 
-    (double *)calloc(data->numatoms, sizeof(double));
-
-  if (ts->esp_charges == NULL) {
-    PRINTERR; 
-    return FALSE;
-  }
-
-  eatline(data->file, 1);
-
-  for (i=0; i<data->numatoms; i++) {
-    int n;
-    double charge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*s %lf ", &charge);
-    if (n!=1) return FALSE;
-    ts->esp_charges[i] = charge;
-  }
-
-  if (i!=data->numatoms) {
-    
-    return FALSE;
-  }
-
-  ts->have_esp = TRUE;
-  return TRUE;
-}
-
-
-/* Read the energy gradient (=force) for each atom */
-static int get_gradient(qmdata_t *data, qm_timestep_t *ts) {
-  int numgrad=0;
-  int numread;
-  char buffer[BUFSIZ];
-  long filepos;
-
-  buffer[0] = '\0';
-
-  /* remember position in order to go back if no forces were found */
-  filepos = ftell(data->file);
-
-  /* look for GRADIENT section */
-  if (goto_keyline(data->file, "GRADIENT (HARTREE",
-                "***** EQUILIBRIUM GEOMETRY LOCATED", 
-                " BEGINNING GEOMETRY SEARCH", NULL) != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  eatline(data->file, 4);
-
-  ts->gradient = (float *)calloc(3*data->numatoms, sizeof(float));
-
-  if (ts->gradient == NULL) {
-    PRINTERR;	    
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* read the gradient table */
-  do {
-    int i;
-    float dx, dy, dz;
-    GET_LINE(buffer, data->file);
-    numread = sscanf(buffer, "%d %*s %*f %f %f %f", &i, &dx, &dy, &dz);
-    if (numread==4) {
-      ts->gradient[3*(i-1)  ] = dx;
-      ts->gradient[3*(i-1)+1] = dy;
-      ts->gradient[3*(i-1)+2] = dz;
-      numgrad++;
-    }
-  } while(numread==4);
-
-  if (numgrad!=data->numatoms) {
-    printf("gamessplugin) Found %d gradients for %d atoms!\n",
-           numgrad, data->numatoms);
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-
-/* Read energy gradients from final step
- * (different format in final step) */
-static int get_final_gradient(qmdata_t *data, qm_timestep_t *ts) {
-  int numgrad=0;
-  int numread;
-  char buffer[BUFSIZ];
-  long filepos;
-
-  /* remember position in order to go back at the end */
-  filepos = ftell(data->file);
-
-  if (pass_keyline(data->file,
-                   "ATOM                 E'X", NULL) != FOUND) {
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  ts->gradient = (float *)calloc(3*data->numatoms, sizeof(float));
-
-  if (ts->gradient == NULL) {
-    PRINTERR;	    
-    fseek(data->file, filepos, SEEK_SET);
-    return FALSE;
-  }
-
-  /* read the gradient table */
-  do {
-    int i;
-    float dx, dy, dz;
-    GET_LINE(buffer, data->file);
-    numread = sscanf(buffer, "%d %*s %f %f %f", &i, &dx, &dy, &dz);
-    if (numread==4) {
-      ts->gradient[3*(i-1)  ] = dx;
-      ts->gradient[3*(i-1)+1] = dy;
-      ts->gradient[3*(i-1)+2] = dz;
-      numgrad++;
-    }
-  } while(numread==4);
-
-  /* go back to where search started */
-  fseek(data->file, filepos, SEEK_SET);
-
-  if (numgrad!=data->numatoms) {
-    printf("gamessplugin) Number of gradients != number of atoms!\n");
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-
-/***********************************************************
- *
- * Read in wavenumbers and intensities of the normal modes
- *
- **********************************************************/
-static int get_normal_modes(qmdata_t *data) {
-  char buffer[BUFSIZ];
-  int i = 0, k = 0, j = 0;
-  double entry[6]; 
-  char *token;
-
-  if (!pass_keyline(data->file, "NORMAL COORDINATE ANALYSIS", NULL)) {
-    return FALSE;
-  }
-
-  /* initialize array */
-  memset(entry, 0, sizeof(entry));
-
-    
-  /* allocate memory for arrays */
-  data->wavenumbers = 
-    (float *)calloc(data->numatoms*3,sizeof(float));
-  if (data->wavenumbers==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  data->intensities = 
-    (float *)calloc(data->numatoms*3,sizeof(float));
-  if (data->intensities==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  data->imag_modes = 
-    (int *)calloc(data->numatoms*3,sizeof(int));
-  if (data->imag_modes==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  data->normal_modes = 
-    (float *)calloc((data->numatoms*3)*(data->numatoms*3),
-		     sizeof(float));
-  if (data->normal_modes==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* Example:
-   *                       1           2           3           4           5
-   *    FREQUENCY:      4805.54 I   1793.00 I   1317.43 I      2.13        1.99
-   * REDUCED MASS:      1.09875     1.00796     1.18876     1.04129     1.03921
-   * IR INTENSITY:    105.04109     2.80788     3.07217     0.01689     0.01587
-   *
-   * 1   CARBON       X  0.00000000  0.00000000 -0.11767262 -0.05407389  0.00000000
-   *                  Y  0.00000000 -0.00345200  0.00000000  0.00000000 -0.05241437
-   *                  Z -0.08676597  0.00000000  0.00000000  0.00000000  0.00000000
-   */
-  for (i=0; i<ceil(data->numatoms*3/5.f); i++) {
-    int numread = 0;
-
-    if (!goto_keyline(data->file, "FREQUENCY:", NULL)) {
-      break;
-    }
-    GET_LINE(buffer, data->file);
-
-    /* Scan the frequencies; 
-     * If there are imaginary modes present then the
-     * frequency is followed by the 'I' which represents
-     * an additional char token in the line. */
-
-    /* Skip first token "FREQUENCY:" */
-    token = strtok(buffer, " \t\r\n");
-    
-    /* Walk through the remaining tokens */
-    while ((token = strtok(NULL, " \t\r\n")) != NULL) {
-      /* Check if token is 'I'.
-       * If yes, mark previous mode as imaginary. */
-      if (*token=='I') {
-        data->imag_modes[data->nimag] = numread-1;
-        data->nimag++;
-      } else {
-        /* save only the first 5 modes - there NEVER should
-         * be more in any case, but just to make sure
-         * we don't overrun the array */
-        if (numread<5) {
-          data->wavenumbers[i*5+numread] = atof(token);
-          numread++;
-        }
-      }
-    }
-
-    eatline(data->file, 1);
-
-    /* Read the IR INTENSITIES */
-    GET_LINE(buffer, data->file);
-    numread = sscanf(buffer,"%*s %*s %lf %lf %lf %lf %lf", &entry[0],
-                     &entry[1], &entry[2], &entry[3], &entry[4]);
- 
-    for (k=0; k<numread; k++) {
-      data->intensities[i*5+k] = entry[k]; 
-    }
-
-    eatline(data->file, 1);
-
-    /* Read the normal mode vectors */
-    for (k=0; k<data->numatoms; k++) {
-      /* x */
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*s %*s %*s %lf %lf %lf %lf %lf",
-             &entry[0], &entry[1], &entry[2], &entry[3], &entry[4]);
-
-      for (j=0; j<numread; j++) {
-        data->normal_modes[3*k + (i*5+j)*3*data->numatoms] = 
-          entry[j];
-      }
-
-      /* y */
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*s %lf %lf %lf %lf %lf", &entry[0],
-                       &entry[1],&entry[2], &entry[3],&entry[4]);
-
-      for (j=0; j<numread; j++) {
-        data->normal_modes[(3*k+1) + (i*5+j)*3*data->numatoms] =
-          entry[j];
-      }
-
-      /* z */
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*s %lf %lf %lf %lf %lf", &entry[0],
-                       &entry[1], &entry[2], &entry[3],&entry[4]);
-
-      for (j=0; j<numread; j++) {
-        data->normal_modes[(3*k+2) + (i*5+j)*3*data->numatoms] = 
-          entry[j];
-      }
-    }
-  }
-
-
-  /* Chop unused part of imag_modes array */
-  data->imag_modes = 
-    (int *)realloc(data->imag_modes, data->nimag*sizeof(int));
-
-/*   free(token); */
-
-  data->have_normal_modes = TRUE;
-  printf("gamessplugin) Successfully scanned normal modes (%d imag.)\n", data->nimag);
-
-  return TRUE;
-}
-
-
-
-/***********************************************************
- *
- * Read the cartesian hessian matrix 
- * XXX Does not read blocks with less than 6 entries correctly!
- *
- * *********************************************************/
-static int get_cart_hessian(qmdata_t *data)
-{
-  char buffer[BUFSIZ];
-  int i,j,k;
-  float entry[6]; 
-
-  buffer[0] = '\0';
-  memset(entry, 0, sizeof(entry));
-
-  /* at this point we need to rewind the file, since
-   * in case that there is no internal Hessian stuff the
-   * previous call to get_int_coords scanned the file
-   * until EOF */
-  rewind(data->file);
-
-  if (pass_keyline(data->file,
-                   "CARTESIAN FORCE CONSTANT MATRIX",
-                   NULL) != FOUND) {
-    return FALSE;
-  }
-
-  /* skip next 5 lines */
-  eatline(data->file, 5);
-
-
-  /* reserve memory for array; 
-   * NOTE: this is a lower triangular matrix, but for now
-   * we save it in an square matrix of dim(3Nx3N) to 
-   * facilitate element access */
-  data->carthessian = 
-    (double *)calloc((data->numatoms*3)*(data->numatoms*3),
-		     sizeof(double));
-
-  
-  /* make sure memory was allocated properly */
-  if (data->carthessian == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* start scanning; the cartesian hessian matrix is a lower
-   * triangular matrix, organized in rows of 6 */
-
-  /* read blocks with complete rows of 6 */
-  for (i=0; i<(int)ceil(data->numatoms/2.f); i++) {
-    for (j=0; j<(data->numatoms*3)-(i*6); j++) {
-      GET_LINE(buffer, data->file);
- 
-      if (j%3==0) {
-        sscanf(buffer,"%*s %*s %*c %f %f %f %f %f %f",
-               &entry[0],&entry[1],
-               &entry[2],&entry[3],&entry[4],&entry[5]);
-      }
-      else {
-        sscanf(buffer,"%*1s %f %f %f %f %f %f",
-               &entry[0],&entry[1],&entry[2],&entry[3],&entry[4],
-               &entry[5]);
-      }
-
-
-      /* save entries (lower triangular matrix) in a 
-       * square matrix */
-      for (k=0; k<=(j<5 ? j : 5); k++) {
-        data->carthessian[(j+i*6)*3*data->numatoms + (k+i*6)] =
-          entry[k];
-      }
-    }
-
-    /* skip the four lines separating the data blocks */
-    eatline(data->file, 4);
-  }
-
-  printf("gamessplugin) Scanned Hessian in CARTESIAN coordinates\n");
-
-  data->have_cart_hessian = TRUE;
-
-  return TRUE;
-}
-  
-  
-  
-/***********************************************************
- *
- * Read the internal coordinates and rewind to the file
- * position where we started the search.
- *
- **********************************************************/
-static int get_int_coords(qmdata_t *data) {
-
-  char word[BUFSIZ];
-  char buffer[BUFSIZ];
-  long filepos, beginning;
-  int first, second, third, fourth;
-  double value;
-  int n, i = 0, j = 0, k = 0, l = 0;
-
-  /* remember current filepos so we can jump back */
-  beginning = ftell(data->file);
-
-  if (pass_keyline(data->file, "INTERNAL COORDINATES",
-                   "1 ELECTRON INTEGRALS") != FOUND) {
-    printf("gamessplugin) No internal coordinates found.\n");
-    fseek(data->file, beginning, SEEK_SET);
-    return FALSE;
-  }
-
-  /* skip next 5 lines */
-  eatline(data->file, 5);
-
-  /* remember current filepos so we can jump back */
-  filepos = ftell(data->file);
-
-  /* scan the next line */
-  GET_LINE(buffer, data->file);
-  n = sscanf(buffer,"%*s %s", word); 
-
-  /* read line by line */
-  while (n!=-1) {
-    /* start counting the number of internal coordinates */
-    data->nintcoords++;
-
-    /* count the number of bonds, angles, dihedrals */
-    if (!strcmp(word,"STRETCH")) {
-      data->nbonds++;
-    }
-    else if (!strcmp(word,"BEND")) {
-      data->nangles++;
-    }
-    else if (!strcmp(word,"TORSION")) {
-      data->ndiheds++;
-    }
-    else if (!strcmp(word,"PLA.BEND")) {
-      data->nimprops++;
-    }
-
-    /* scan next line */
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*s %s", word); 
-  }
-
-  /* now that we know the number of bonds, angles, etc.
-   * we can read and store the internal coordinates */
-  fseek(data->file, filepos, SEEK_SET);
-
-
-  /* reserve memory for the arrays storing the internal
-   * coordinates and their values */
-  data->bonds = (int *)calloc(2*data->nbonds,sizeof(int));
-  data->angles = (int *)calloc(3*data->nangles,sizeof(int));
-  data->dihedrals = (int *)calloc(4*data->ndiheds,sizeof(int));
-  data->impropers = (int *)calloc(4*data->nimprops,sizeof(int));
-  data->internal_coordinates = (double *)calloc(data->nintcoords,
-	sizeof(double));
-
-
-  /* check if we have sufficient memory available */
-  if ( (data->bonds == NULL) || 
-       (data->angles == NULL) ||
-       (data->dihedrals == NULL) || 
-       (data->internal_coordinates == NULL)) 
-  {
-    PRINTERR; 
-    return FALSE;
-  }
-
-
-  /* now start going through the internal coordinates
-   * and save them in the appropriate arrays; here
-   * I drop all safety check since we went through
-   * this part of the file already once and should
-   * be good */
- 
-  /* scan the STRETCHES */
-  for (i=0; i<data->nbonds; i++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %lf", &first, &second, &value);
-
-    *(data->bonds+2*i)   = first;
-    *(data->bonds+2*i+1) = second;
-    *(data->internal_coordinates+i) = value;
-  }
-
-  /* scan the BENDS */
-  for (j=0; j<data->nangles; j++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %d %lf",
-           &first, &second, &third, &value);
-
-    *(data->angles+3*j)   = first;
-    *(data->angles+3*j+1) = second;
-    *(data->angles+3*j+2) = third;
-    *(data->internal_coordinates+i+j) = value;
-  }
-
-  /* scan the TORSIONS */
-  for (k=0; k<data->ndiheds; k++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %d %d %lf",
-           &first, &second, &third, &fourth, &value);
-
-    *(data->dihedrals+4*k)   = first;
-    *(data->dihedrals+4*k+1) = second;
-    *(data->dihedrals+4*k+2) = third;
-    *(data->dihedrals+4*k+3) = fourth;
-    *(data->internal_coordinates+i+j+k) = value;
-  }
-
-  /* scan the IMPROPERS */
-  for (l=0; l<data->nimprops; l++) {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s %*s %d %d %d %d %lf",
-           &first, &second, &third, &fourth, &value);
-
-    *(data->impropers+4*l)   = first;
-    *(data->impropers+4*l+1) = second;
-    *(data->impropers+4*l+2) = third;
-    *(data->impropers+4*l+3) = fourth;
-    *(data->internal_coordinates+i+j+k+l) = value;
-  }
-
-  /* Since the internal coordinate section can appear
-   * before or after the symmetry section we have to
-   * jump back to the beginning of the search. */
-  fseek(data->file, beginning, SEEK_SET);
-
-  printf("gamessplugin) Scanned %d INTERNAL coordinates \n",
-         data->nintcoords);
-  printf("gamessplugin)    %d BONDS \n",data->nbonds);
-  printf("gamessplugin)    %d ANGLES \n",data->nangles);
-  printf("gamessplugin)    %d DIHEDRALS \n",data->ndiheds);
-  printf("gamessplugin)    %d IMPROPERS \n",data->nimprops);
-
-  data->have_internals = TRUE;
-  return TRUE;
-}
-
-
-
-/***********************************************************
- *
- * Read the the Hessian in internal coordinates
- *
- **********************************************************/
-static int get_int_hessian(qmdata_t *data) {
-  char buffer[BUFSIZ];
-  double hess[5];
-  int i = 0, j = 0, k = 0, l = 0;
-
-  memset(hess, 0, sizeof(hess));
-
-  if (pass_keyline(data->file,
-                   "HESSIAN MATRIX IN INTERNAL COORDINATES",
-                   "ENERGY GRADIENT") != FOUND) {
-    return FALSE;
-  }
-  if (pass_keyline(data->file,
-                     "UNITS ARE HARTREE/",
-                     "ENERGY GRADIENT") != FOUND) {
-    return FALSE;
-  }
-
-  eatline(data->file, 3);
-  
-  /* reserve memory for inthessian array */
-  data->inthessian = 
-    (double *)calloc((data->nintcoords)*(data->nintcoords),
-		     sizeof(double));
-
-
-  /* make sure memory was allocated properly */
-  if (data->inthessian == NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  /* start scanning; GAMESS organized the output of the
-   * internal HESSIAN in rows of 5 */
-
-  /* read blocks with complete rows of 5 */
-  for (i=0; i<(int)ceil(data->nintcoords/5.f); i++) {
-    for (j=0; j<data->nintcoords; j++) {
-      int numread = 0;
-
-      GET_LINE(buffer, data->file);
-      numread = sscanf(buffer,"%*d %lf %lf %lf %lf %lf", &hess[0], 
-             &hess[1], &hess[2], &hess[3], &hess[4]);
-
-      /* save entries */
-      for (k=0; k<numread; k++) { 
-        data->inthessian[j*data->nintcoords + i*5+k] = hess[k];
-      }
-    }
-
-    /* skip the two lines separating the matrix entries 
-     * and scan next line */
-    eatline(data->file, 2);
-
-    GET_LINE(buffer, data->file);
-  }
-
-#if 0
-  /* read the remaining block with less then 5 rows
-   * if present */
-  remaining_blocks = data->nintcoords%5;
-  
-  if (remaining_blocks!=0) {
-    for (j=0; j<data->nintcoords; j++) {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%*d %lf %lf %lf %lf %lf", &hess[0], 
-             &hess[1], &hess[2], &hess[3], &hess[4]);
-
-      for (k=0; k<remaining_blocks; k++) { 
-        *(data->inthessian+(j*data->nintcoords)+(i*5)+k) = hess[k];
-      }
-    }
-  }
-#endif
-
-  printf("gamessplugin) Scanned Hessian in INTERNAL coordinates\n");
-
-  /* finally, dump the diagonal elements of the hessian into the
-   * force constant arrays, after converting the units 
-   * appropriately;
-   * BONDS are in HARTREE/BOHR**2
-   * ANGLES,DIHEDRALS,IMPROPERS are in HARTREE/RADIAN**2 */
-  
-  /* allocate dynamic arrays */
-  data->bond_force_const = 
-    (double *)calloc(data->nbonds, sizeof(double));
-
-  if (data->bond_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  data->angle_force_const =
-    (double *)calloc(data->nangles, sizeof(double));
-
-  if (data->angle_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  data->dihedral_force_const =
-    (double *)calloc(data->ndiheds, sizeof(double));
-
-  if (data->dihedral_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-
-  data->improper_force_const =
-    (double *)calloc(data->nimprops, sizeof(double));
-
-  if (data->improper_force_const==NULL) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  /* scan the bonds */
-  for (i=0; i<data->nbonds; i++) {
-    data->bond_force_const[i] = 
-      data->inthessian[(i*data->nintcoords)+i] * 
-      HARTREE_TO_KCAL / BOHR_TO_ANGS / BOHR_TO_ANGS;
-
-    printf("%3d (BOND) %2d - %2d : %f\n", i, 
-           data->bonds[2*i], data->bonds[2*i+1],
-           data->bond_force_const[i]);
-  }
-  
-  /* scan the angles */
-  for (j=i; j<i+(data->nangles); j++) {
-    data->angle_force_const[j-i] = 
-      data->inthessian[j*data->nintcoords + j] * HARTREE_TO_KCAL;
-    
-    printf("%3d (ANGLE) %2d - %2d - %2d : %f\n", j,
-           data->angles[3*(j-i)], data->angles[3*(j-i)+1], 
-           data->angles[3*(j-i)+2], 
-           data->angle_force_const[j-i]);
-  }
-
-  /* scan the dihedrals */
-  for (k=j; k<j+(data->ndiheds); k++) {
-    data->dihedral_force_const[k-j] = 
-      data->inthessian[k*data->nintcoords + k] * HARTREE_TO_KCAL;
-    
-    printf("%3d (DIHEDRAL) %2d - %2d - %2d - %2d : %f \n", k,
-           data->dihedrals[4*(k-j)  ], data->dihedrals[4*(k-j)+1],
-           data->dihedrals[4*(k-j)+2], data->dihedrals[4*(k-j)+3],
-           data->dihedral_force_const[k-j]);
-  }
-
-  /* scan the impropers */
-  for (l=k; l<k+(data->nimprops); l++) {
-    data->improper_force_const[l-k] = 
-      data->inthessian[l*data->nintcoords + l] * HARTREE_TO_KCAL;
-    
-    printf("%3d (IMPROPERS) %2d - %2d - %2d - %2d : %f \n", l,
-           data->impropers[4*(l-k)  ], data->impropers[4*(l-k)+1],
-           data->impropers[4*(l-k)+2], data->impropers[4*(l-k)+3],
-           data->improper_force_const[l-k]);
-  }
-
-  data->have_int_hessian = TRUE;
-  return TRUE;
-}
-
-
-#if 0
-
-/************************************************************
- *
- * this function animates a given normal mode by means of
- * generating mod_num_frames frames away from the equilibrium
- * structure in a direction given by the hessiane 
- *
- ************************************************************/
-static int animate_normal_mode(qmdata_t *data, int mode)
-{
-  mode_data *animated_mode = data->animated_mode;
-  float *normal_modes = data->normal_modes;
-  float scale = animated_mode->mode_scaling;
-  int i = 0, k = 0; 
-  int l = 0, m = 0;
-  int natoms = data->numatoms;
-  int num_frames = animated_mode->mode_num_frames;
-
-  /* first sweep to max of interval */
-  for ( k = 0; k < num_frames+1; ++k)
-  {
-    for ( i = 0; i < natoms; ++i)
-    {
-      *(animated_mode->mode_frames+(k*natoms*3)+(3*i)) = 
-	  (data->atoms+i)->x * (1+( k*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i)))));
-
-      *(animated_mode->mode_frames+(k*natoms*3)+(3*i+1)) = 
-	  (data->atoms+i)->y * (1+( k*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+1)))));
-
-      *(animated_mode->mode_frames+(k*natoms*3)+(3*i+2)) = 
-	  (data->atoms+i)->z * (1+( k*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+2)))));
-    }
-  }
-
-
-  /* second sweep all the way back to min of interval */
-  for ( l = 0; l < 2*num_frames+1; ++l)
-  {
-    for ( i = 0; i < natoms; ++i)
-    {
-      *(animated_mode->mode_frames+((l+k)*natoms*3)+(3*i)) = 
-	  (data->atoms+i)->x * (1+((int)(num_frames-l)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i)))));
-
-      *(animated_mode->mode_frames+((l+k)*natoms*3)+(3*i+1)) = 
-	  (data->atoms+i)->y * (1+((int)(num_frames-l)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+1)))));
-
-      *(animated_mode->mode_frames+((l+k)*natoms*3)+(3*i+2)) = 
-	  (data->atoms+i)->z * (1+((int)(num_frames-l)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+2)))));
-    }
-  }
-
-
-  /* third sweep back to the native starting structure */
-  for ( m = 0; m < num_frames+1; ++m)
-  {
-    for ( i = 0; i < natoms; ++i)
-    {
-      *(animated_mode->mode_frames+((l+k+m)*natoms*3)+(3*i)) = 
-	  (data->atoms+i)->x * (1+((int)(m-num_frames)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i)))));
-
-      *(animated_mode->mode_frames+((l+k+m)*natoms*3)+(3*i+1)) = 
-	  (data->atoms+i)->y * (1+((int)(m-num_frames)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+1)))));
-
-      *(animated_mode->mode_frames+((l+k+m)*natoms*3)+(3*i+2)) = 
-	  (data->atoms+i)->z * (1+((int)(m-num_frames)*scale * 
-	  (*(normal_modes+(mode*natoms*3)+(3*i+2)))));
-    }
-  }
-
-  printf("gamessplugin) Successfully animated mode %d \n", mode);
-
-  return TRUE;
-}
-#endif
-
-
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "gamess";
-  plugin.prettyname = "GAMESS";
-  plugin.author = "Jan Saam, Markus Dittrich, Johan Strumpfer";
-  plugin.majorv = 1;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "log";
-  plugin.open_file_read = open_gamess_read;
-  plugin.read_structure = read_gamess_structure;
-  plugin.close_file_read = close_gamess_read;
-
-  plugin.read_qm_metadata = read_gamess_metadata;
-  plugin.read_qm_rundata  = read_gamess_rundata;
-
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-  plugin.read_timestep = read_timestep;
-#endif
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gaussianplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gaussianplugin.c
deleted file mode 100644
index 1e29af7b45408dc9fdba9606fd98ac8179a771cc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gaussianplugin.c
+++ /dev/null
@@ -1,2262 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-
-/* *******************************************************
- *
- *          Gaussian Logfile Reader Plugin
- *
- * This plugin allows VMD to read Gaussian log files.
- * The main purpose is to import Wavefunction data.
- * It is modeled after the corresponding GAMESS plugin.
- *
- * ********************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-#include <math.h>
-
-#include "gaussianplugin.h"
-#include "periodic_table.h"
-#include "unit_conversion.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
- 
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifndef GAUSSIAN_DEBUG
-#define GAUSSIAN_DEBUG 0
-#endif
-#define GAUSSIAN_BASIS_DEBUG 1
-
-#if GAUSSIAN_DEBUG
-#define PRINTERR vmdcon_printf(VMDCON_ERROR,                            \
-                               "\n In file %s, line %d: \n %s \n \n",   \
-                               __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/*
- * Error reporting macro for the multiple fgets calls in
- * the code
- */
-#if GAUSSIAN_DEBUG
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE ;   \
-    else fprintf(stderr,"%s:%d %s",__FILE__, __LINE__, x)
-#else
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-#endif
-
-/* make sure pointers are NULLed after free(3)ing them. */
-#define SAFE_FREE(ptr) free(ptr); ptr=NULL
-/* calloc with test of success */
-#define SAFE_CALLOC(ptr,type,count)                                 \
-  ptr = (type *)calloc(count,sizeof(type));                         \
-  if (ptr == NULL) {                                                \
-    PRINTERR;                                                       \
-    return MOLFILE_ERROR;                                           \
-  }
-
-#define UNK_SHELL -666
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL  -2
-#define SP_P_SHELL  -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-#define I_SHELL 6
-
-#define SPIN_ALPHA 0
-#define SPIN_BETA  1
-
-#define STATUS_UNKNOWN       -1
-#define STATUS_CONVERGED      0
-#define STATUS_SCF_NOT_CONV   1
-#define STATUS_TOO_MANY_STEPS 2
-#define STATUS_BROKEN_OFF     3
-
-static const char *runtypes[] = { 
-  "(unknown)", "ENERGY", "OPTIMIZE", "SADPOINT", "HESSIAN", 
-  "SURFACE", "DYNAMICS", "PROPERTIES", NULL};
-
-static const char *scftypes[] = { 
-  "(unknown)", "RHF", "UHF", "ROHF", "GVB", "MCSCF", "FF", NULL };
-
-
-/* ######################################################## */
-/* declaration/documentation of internal (static) functions */
-/* ######################################################## */
-
-/** Top level gaussian log file parser. Responsible 
- *  for static, i.e. non-trajectory information. */
-static int parse_static_data(gaussiandata *, int *);
-
-/** Check if the current run is an actual Gaussian run; 
- *  returns true/false */
-static int have_gaussian(gaussiandata *);
-
-/** Get number of processors requested and amount of memory used. */
-static int get_proc_mem(gaussiandata *);
-
-/** Get basis set statistics */
-static int get_basis_options(gaussiandata *);
-
-/** Determine the run's title text. */
-static int get_runtitle(gaussiandata *);
-
-/** Read the input atom definitions.  */
-static int get_input_structure(gaussiandata *);
-/** Read coordinates */
-static int get_coordinates(FILE *file, qm_atom_t *atoms, int numatoms);
-/** Read internal orientation coordinates */
-static int get_int_coordinates(FILE *file, qm_atom_t *atoms, int numatoms);
-
-/** Read and parse the Route section of the input. */
-static int get_contrl(gaussiandata *);
-
-/** the function get_initial_info provides the atom number,
- *  coordinates, and atom types and stores them temporarily. */ 
-static int get_final_info(gaussiandata *);
-
-/* in the function get_basis we parse the basis function section to
- * determine the number of basis functions and contraction
- * coefficients. For Pople/Huzinaga style basis sets these numbers are in
- * principle fixed, and could hence be provided by the the plugin
- * itself; however, the user might define his own basis/contraction
- * coeffients and hence reading them from the input file seem to be
- * more general. We can still override it with an "internal" basis
- * set */
-static int get_basis(gaussiandata *);
-
-/* this function replaces the basis set data from the log file with
- * with the equivalent data read from an internal basis set data base.
- * for simplicity we use the same format as gaussian. the basis set
- * data is expected to be in $VMDDIR/basis/<basis-set-name>.gbs. */
-static int get_internal_basis(gaussiandata *);
-
-/* convert shell symmetry type from char to int */
-static int shellsymm_int(char *symm);
-
-/* Populate the flat arrays containing the basis set data */
-static int fill_basis_arrays(gaussiandata *);
-
-static int read_first_frame(gaussiandata *);
-
-/* this subroutine scans the output file for
- * the trajectory information */
-static int get_traj_frame(gaussiandata *);
-
-/* returns 1 if the optimization has converged */
-static int find_traj_end(gaussiandata *);
-
-/* this function parses the input file for the final
- * wavefunction and stores it in the appropriate arrays; */
-static int get_wavefunction(gaussiandata *, qm_timestep_t *);
-
-/** read in mulliken charges */
-static int get_population(gaussiandata *, qm_timestep_t *);
-
-/* turn fortran double precision 'D' exponents into c parsable 'E's */
-static void fix_fortran_exp(char *string) {
-  while (*string) {
-    if ( (*string == 'D') || (*string == 'd')) *string='e';
-    ++string;
-  }
-}
-
-/* ######################################################## */
-/* Functions that are needed by the molfile_plugin          */
-/* interface to provide VMD with the parsed data            */
-/* ######################################################## */
-
-
-/***************************************************************
- *
- * Called by VMD to open the Gaussian logfile and get the number
- * of atoms.
- * We are also reading all the static (i.e. non-trajectory)
- * data here since we have to parse a bit to get the atom count
- * anyway. These data will then be provided to VMD by
- * read_gaussian_metadata() and read_gaussian_rundata().
- *
- * *************************************************************/
-static void *open_gaussian_read(const char *filename, 
-                  const char *filetype, int *natoms) {
-
-  FILE *fd;
-  gaussiandata *data;
-  
-  /* open the input file */
-  fd = fopen(filename, "rb");
-  if (fd == NULL) {
-    PRINTERR;
-    return NULL;
-  }
-
-  /* set up main data structure */
-  data = (gaussiandata *) calloc(1,sizeof(gaussiandata));
-  if (data == NULL) return NULL;
-  
-  data->runtyp = RUNTYP_UNKNOWN;
-  data->scftyp = SCFTYP_UNKNOWN;
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* check if the file is Gaussian format; 
-   * if yes parse it, if not exit */
-  if (have_gaussian(data)==TRUE) {
-    /* if we're dealing with an unsupported Gaussian
-     * version, we better quit. so far we tested g98(g94?),g03 */
-    if ((data->version < 19940000) || (data->version > 20040000)) {
-      vmdcon_printf(VMDCON_ERROR,
-                    "gaussianplugin) Gaussian version %s is not "
-                    "(yet) supported. Bailing out.\n",
-                    data->version_string);
-      free(data);
-      return NULL;
-    }
-
-    /* get the non-trajectory information from the log file */    
-    if (parse_static_data(data, natoms) == FALSE) {
-      free(data);
-      return NULL;
-    }
-  }
-  else {
-    free(data);
-    return NULL;
-  }
-
-  return data;
-}
-
-
-/************************************************************
- * 
- * Provide VMD with the structure of the molecule, i.e the
- * atoms coordinates names, etc.
- *
- *************************************************************/
-static int read_gaussian_structure(void *mydata, int *optflags, 
-                      molfile_atom_t *atoms) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  molfile_atom_t *atom;
-  int i = 0;
- 
-  /* optional data from PTE */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS;
-
-  if (data->have_mulliken) 
-    *optflags |= MOLFILE_CHARGE;
-
-  /* all the information I need has already been read in
-   * via the initial scan and I simply need to copy 
-   * everything from the temporary arrays into the 
-   * proper VMD arrays. */
-
-  /* get initial pointer for atom array */
-  cur_atom = data->initatoms;
-
-  for(i=0; i<data->numatoms; i++) {
-    atom = atoms+i;
-    strncpy(atom->name, cur_atom->type, sizeof(atom->name)); 
-    strncpy(atom->type, get_pte_label(cur_atom->atomicnum), sizeof(atom->type));
-    strncpy(atom->resname,"QM", sizeof(atom->resname)); 
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    atom->atomicnumber = cur_atom->atomicnum;
-    atom->radius = get_pte_vdw_radius(cur_atom->atomicnum);
-    /* XXX; check for isotopes. should be possible to read. */
-    atom->mass   = get_pte_mass(cur_atom->atomicnum);  
-    if (data->have_mulliken)
-      atom->charge = data->qm_timestep->mulliken_charges[i];
-
-    cur_atom++;
-  }
- 
-  return MOLFILE_SUCCESS; 
-}
-
-
-/*****************************************************
- *
- * provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available
- *
- *****************************************************/
-static int read_gaussian_metadata(void *mydata, 
-    molfile_qm_metadata_t *gaussian_metadata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-
-  gaussian_metadata->ncart = 0;
-  gaussian_metadata->nimag = 0;
-  gaussian_metadata->nintcoords = 0;
-
-  /* orbital data */
-  gaussian_metadata->num_basis_funcs = data->num_basis_funcs;
-  gaussian_metadata->num_basis_atoms = data->num_basis_atoms;
-  gaussian_metadata->num_shells      = data->num_shells;
-  gaussian_metadata->wavef_size      = data->wavef_size;  
-
-#if vmdplugin_ABIVERSION > 11
-  gaussian_metadata->have_sysinfo = 1;
-  
-  /* charges */
-  gaussian_metadata->have_esp = 0;
-  gaussian_metadata->have_carthessian = 0;
-  gaussian_metadata->have_internals   = 0;
-  gaussian_metadata->have_normalmodes = FALSE;
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_gaussian_rundata(void *mydata, molfile_qm_t *qm_data) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-
-  molfile_qm_basis_t   *basis_data   = &qm_data->basis;
-  molfile_qm_sysinfo_t *sys_data     = &qm_data->run;
-
-  /* fill in molfile_qm_sysinfo_t */
-  sys_data->nproc = data->nproc;
-  sys_data->memory = data->memory; 
-  sys_data->runtype = data->runtyp;
-  sys_data->scftype = data->scftyp;
-  sys_data->totalcharge = data->totalcharge;
-/*  sys_data->multiplicity = data->multiplicity; */
-  sys_data->num_electrons = data->num_electrons;
-  sys_data->num_occupied_A = data->occ_orbitals_A;
-  sys_data->num_occupied_B = data->occ_orbitals_B;
-
-  strncpy(sys_data->basis_string, data->basis_string,
-          sizeof(sys_data->basis_string));
-  
-  strncpy(sys_data->runtitle, data->runtitle, sizeof(sys_data->runtitle));
-  strncpy(sys_data->geometry, data->geometry, sizeof(sys_data->geometry));
-  strncpy(sys_data->version_string, data->version_string,
-          sizeof(sys_data->version_string));
-
-#if vmdplugin_ABIVERSION > 11
-  /* fill in molfile_qm_basis_t */
-  if (data->num_basis_funcs) {
-    memcpy(basis_data->num_shells_per_atom, data->num_shells_per_atom, 
-           data->num_basis_atoms*sizeof(int));
-    memcpy(basis_data->num_prim_per_shell, data->num_prim_per_shell, 
-           data->num_shells*sizeof(int));
-    memcpy(basis_data->shell_symmetry, data->shell_symmetry, 
-           data->num_shells*sizeof(int));
-    memcpy(basis_data->basis, data->basis, 2*data->num_basis_funcs*sizeof(float));
-    memcpy(basis_data->angular_momentum, data->angular_momentum, 
-           3*data->wavef_size*sizeof(int));
-  }
-#endif
- 
-  return MOLFILE_SUCCESS;
-}
-
-
-#if vmdplugin_ABIVERSION > 11
-
-/***********************************************************
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***********************************************************
- * Provide QM metadata for next timestep. 
- * This actually triggers reading the entire next timestep
- * since we have to parse the whole timestep anyway in order
- * to get the metadata. So we store the read data locally
- * and hand them to VMD when requested by read_timestep().
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  int i, have = 0;
-  gaussiandata *data = (gaussiandata *)mydata;
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) read_qm_timestep_metadata(): %d/%d/%d\n",
-                data->num_frames, 
-                data->num_frames_read,
-                data->num_frames_sent);
-#endif
-
-  meta->count = -1; /* Don't know the number of frames yet */
-  meta->has_gradient = 0;
-
-  if (data->num_frames_read > data->num_frames_sent) {
-    have = 1;
-  } else if (data->num_frames_read < data->num_frames) {
-#if GAUSSIAN_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "gaussianplugin) Probing timestep %d\n",
-                  data->num_frames_read);
-#endif
-    have = get_traj_frame(data);
-  }
-
-  if (have) {
-    /* get a pointer to the current qm timestep */
-    qm_timestep_t *cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-#if GAUSSIAN_DEBUG
-    vmdcon_printf(VMDCON_INFO,
-                  "gaussianplugin) Approved timestep %d\n", 
-                  data->num_frames_sent);
-#endif
-    meta->num_scfiter  = cur_qm_ts->num_scfiter;
-    for (i=0; (i<MAX_NUM_WAVE && i<cur_qm_ts->numwave); i++) { 
-#if GAUSSIAN_DEBUG
-      vmdcon_printf(VMDCON_INFO,
-                    "gaussianplugin) num_orbitals_per_wavef[%d/%d]=%d\n",
-                    i+1, cur_qm_ts->numwave, cur_qm_ts->wave[i].num_orbitals);
-#endif
-      meta->num_orbitals_per_wavef[i] = cur_qm_ts->wave[i].num_orbitals;
-    }
-    meta->num_wavef  = cur_qm_ts->numwave;
-    meta->wavef_size = data->wavef_size;
-  } else {
-    meta->num_scfiter  = 0;
-    meta->num_orbitals_per_wavef[0] = 0;
-    meta->num_wavef = 0;
-    meta->wavef_size = 0;
-
-    data->end_of_trajectory = TRUE;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * This function provides the data of the next timestep.
- * Here we actually don't read the data from file, that had
- * to be done already upon calling read_timestep_metadata().
- * Instead we copy the stuff from the local data structure
- * into the one's provided by VMD.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-			 molfile_qm_timestep_t *qm_ts) 
-{
-  gaussiandata *data = (gaussiandata *)mydata;
-  qm_atom_t *cur_atom;
-  int i = 0;
-  qm_timestep_t *cur_qm_ts;
-
-  if (data->end_of_trajectory == TRUE) return MOLFILE_ERROR;
-
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO,
-                "gaussianplugin) Sending timestep %d\n", 
-                data->num_frames_sent);
-#endif
-
-  /* initialize pointer for temporary arrays */
-  cur_atom = data->initatoms; 
-  
-  /* copy the coordinates */
-  for(i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = cur_atom->x;
-    ts->coords[3*i+1] = cur_atom->y;
-    ts->coords[3*i+2] = cur_atom->z; 
-    cur_atom++;
-  }    
-  
-  /* get a convenient pointer to the current qm timestep */
-  cur_qm_ts = data->qm_timestep+data->num_frames_sent;
-
-  /* store the SCF energies */
-  for (i=0; i<cur_qm_ts->num_scfiter; i++) {
-    qm_ts->scfenergies[i] = cur_qm_ts->scfenergies[i];
-  }
-
-  /* store the wave function and orbital energies */
-  if (cur_qm_ts->wave) {
-    for (i=0; i<cur_qm_ts->numwave; i++) {
-      qm_wavefunction_t *wave = &cur_qm_ts->wave[i];
-      if (wave->wave_coeffs && wave->orb_energies) {
-        memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-               wave->num_orbitals*data->wavef_size*sizeof(float));
-        memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-               wave->num_orbitals*sizeof(float));
-      }
-    }
-  }
-
-  if (data->runtyp == RUNTYP_ENERGY || data->runtyp == RUNTYP_HESSIAN) {
-    /* We have only a single point */
-    data->end_of_trajectory = TRUE;
-  }
-
-  data->num_frames_sent++;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-/** Clean up when done and free all memory 
- *  to avoid memory leaks.
- *
- **********************************************************/
-static void close_gaussian_read(void *mydata) {
-
-  gaussiandata *data = (gaussiandata *)mydata;
-  int i, j;
-  fclose(data->file);
-
-  free(data->file_name);
-  free(data->initatoms);
-  free(data->basis);
-  free(data->shell_symmetry);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->mulliken_charges);
-  free(data->internal_coordinates);
-  free(data->wavenumbers);
-  free(data->intensities);
-  free(data->normal_modes);
-  free(data->angular_momentum);
-
-  if (data->basis_set) {
-    for(i=0; i<data->numatoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  for (i=0; i<data->num_frames_read; i++) {
-    free(data->qm_timestep[i].scfenergies);
-    free(data->qm_timestep[i].gradient);
-    free(data->qm_timestep[i].mulliken_charges);
-    for (j=0; j<data->qm_timestep[i].numwave; j++) {
-      free(data->qm_timestep[i].wave[j].wave_coeffs);
-      free(data->qm_timestep[i].wave[j].orb_energies);
-/*       free(data->qm_timestep[i].wave[j].occupancies); */
-    }
-    free(data->qm_timestep[i].wave);
-  }
-  free(data->qm_timestep);
-  
-  free(data);
-}
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-
-/********************************************************
- *
- * Main gaussian log file parser responsible for static,  
- * i.e. non-trajectory information.
- *
- ********************************************************/
-static int parse_static_data(gaussiandata *data, int *natoms) 
-{
-  /* Read # of procs and amount of requested memory */
-  if (!get_proc_mem(data))        return FALSE;
-
-  /* Read the basis options */
-  if (!get_basis_options(data))   return FALSE;
-
-  /* Read the route section and try to determine
-   * the job type. exit if unsupported. */
-  if (!get_contrl(data))          return FALSE;
-
-  /* Read the run title */
-  if (!get_runtitle(data))        return FALSE;
-
-  /* Read the input atom definitions and geometry */
-  if (!get_input_structure(data)) return FALSE;
-  /* provide VMD with the proper number of atoms */
-  *natoms = data->numatoms;
-  /* read first set of coordinates and basis set data */
-  read_first_frame(data);
-  
-  /* */
-  get_final_info(data);
-
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) found %d QM data frames.\n", data->num_frames);
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) num_frames_read = %d\n", data->num_frames_read);
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) num_frames_sent = %d\n", data->num_frames_sent);
-#endif
-  return TRUE;
-}
-
-/**********************************************************
- *
- * this subroutine checks if the provided files is
- * actually a Gaussian file;
- *
- **********************************************************/
-static int have_gaussian(gaussiandata *data) 
-{
-  char word[4][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ];
-  char *ptr;
-  int i = 0;
- 
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  /* check if the file is Gaussian format 
-   * Gaussian output typically begins with:
-   * 'Entering Gaussian System' */
-  i=0; /* check only the first 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    ++i;
-  } while( (strcmp(word[0],"Entering") || 
-            strcmp(word[1],"Gaussian") || 
-            strcmp(word[2],"System,")) && (i<100) );
-  if (i>=100) return FALSE;
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) Analyzing Gaussian log file: %s\n",data->file_name);
-  
-  /* now read on until we find the block of text with encoded version
-   * number and compile date. */
-  i=0; /* check only the next 100 lines */
-  do {
-    GET_LINE(buffer, data->file);
-    buffer[20] = '\0';          /* length of the version block varies. */
-  } while ( (i<100) && strcmp(buffer,
-      " *******************"));
-  if (i>=100) return FALSE;
-
-  /* one more line... */
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s%s%s%s",word[0],word[1],
-         word[2],word[3]);
-
-  data->version = atoi(word[1]) * 10000;
-  if (data->version > 700000) {
-      data->version += 19000000;
-  } else {
-      data->version += 20000000;
-  }
-  strcpy(data->version_string,word[2]);
-
-  ptr=strrchr(word[2],'-');
-  if (ptr != NULL) { 
-      /* extract revision and patchlevel from G##Rev%.## word.*/
-      ptr += 7;
-      i =  (*ptr) - 'A' + 1;
-      data->version += i*100;
-      ++ptr; ++ptr;
-      data->version += atoi(ptr);
-  }
-  
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Gaussian version = %s  (Version code: %d)\n",
-                data->version_string, data->version);
-  vmdcon_printf(VMDCON_INFO,
-                "gaussianplugin) Compiled on      = %s \n", word[3]);
-
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * this subroutine reads the number of procs and the amount
- * of memory requested
- *
- **********************************************************/
-static int get_proc_mem(gaussiandata *data) {
-
-  char word[5][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ];
-  int nproc,maxmem;
-  int i, link;
-
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  rewind(data->file);
-
-  /* set some defaults */
-  nproc = 1;
-  maxmem = -1;
-  
-  do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s%s%s%*s%s%*s%*s%*s%*s%*s%s",
-             word[0],word[1],word[2],word[3],word[4]);
-
-      /* max dynamical memory. */ 
-      if ((strcmp(word[0],"Leave") == 0) &&
-          (strcmp(word[1],"Link")  == 0)) {
-        link = atoi(word[2]);
-        /* gaussian uses real*8 words internally. convert to MByte. */
-        if (link > 1) maxmem=atoi(word[4])/128/1024;
-      }
-
-      /* number of SMP cpus */
-      if ( (strcmp(word[0],"Will") == 0) &&
-           (strcmp(word[1],"use")  == 0) &&
-           (strcmp(word[2],"up")  == 0) ) {
-        nproc = atoi(word[3]);
-      }
-
-      /* detect if have read too far */ 
-      if (((strcmp(word[0],"Standard") == 0) ||
-           (strcmp(word[0],"Z-Matrix") == 0) ||
-           (strcmp(word[0],"Input") == 0) ) &&
-          (strcmp(word[1],"orientation:")  == 0)) {
-        /* can not detect memory used */
-        maxmem=0;
-      }
-  } while (maxmem < 0);
-
-  /* store findings */
-  data->nproc = nproc;
-  data->memory = maxmem;
-  if (maxmem) 
-    vmdcon_printf(VMDCON_INFO, 
-                  "gaussianplugin) Gaussian used %2d SMP process(es), "
-                  "% 6d Mbytes of memory \n", nproc, maxmem);
-
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Extract basis set options
- *
- **********************************************************/
-static int get_basis_options(gaussiandata *data) {
-
-  char word[5][MOLFILE_BUFSIZ];
-  char buffer[BUFSIZ], *ptr;
-  int i = 0, nfunc, nprim, nume_a, nume_b;
-
-  buffer[0] = '\0';
-  for (i=0; i<3; i++) word[i][0] = '\0';
-
-  /* to be safe let's rewind the file */
-  rewind(data->file);
-
-  /* scanning for basis set string */
-  nume_a=-1;
-  nfunc=-1;
-  nprim=-1;
-  do {
-    GET_LINE(buffer, data->file);
-    i=sscanf(buffer,"%s%s%s",word[0],word[1],word[2]);
-    if (i==3) {
-
-      if ( (strcmp(word[0],"Standard") == 0) &&
-           (strcmp(word[1],"basis:") == 0) ) {
-
-        ptr = &buffer[0] + strlen(buffer) - 1;
-        while(*ptr==' ') --ptr;
-        *ptr='\0';
-        strncpy(data->gbasis, word[2], 10);
-        strncpy(data->basis_string, buffer+17, MOLFILE_BUFSIZ);
-
-        /* make sure gbasis is uppercase. */
-        ptr=data->gbasis;
-        for (;*ptr;++ptr) *ptr=toupper(*ptr);
-
-      } else if ( (strcmp(word[0],"General") == 0) &&
-                  (strcmp(word[1],"basis") == 0) ) {
-
-        /* General basis read from cards */
-
-        ptr = &buffer[0] + strlen(buffer) - 1;
-        while(*ptr==' ') --ptr;
-        *ptr='\0';
-
-        strncpy(data->gbasis, "GEN", 4);
-        strncpy(data->basis_string, buffer, MOLFILE_BUFSIZ);
-      
-      } else if ( (strcmp(word[0],"AO") == 0) 
-                  && (strcmp(word[1],"basis") == 0) ) {
-        /* inline basis definition. count number of atomic basis 
-         * functions and primitive gaussians */
-        int numcenter, numgauss, numbasis, numshell;
-        numcenter=numgauss=numbasis=numshell=0;
-        GET_LINE(buffer, data->file);
-        do {
-          int numprim=0;
-          ++numcenter;
-          do {
-            /* angular momentum, number of primitive gaussians
-             * and first entry */
-            GET_LINE(buffer, data->file);
-            i=sscanf(buffer,"%s%d",word[0], &numprim);
-            if (i==2) {
-              ++numshell;
-              if (strcmp(word[0],"S") == 0) {
-                numbasis += 1;    /* simple s-shell*/
-                numgauss += numprim;
-              } else if (strcmp(word[0],"P") == 0) {
-                numbasis += 3;    /* simple p-shell */
-                numgauss += numprim;
-              } else if (strcmp(word[0],"SP") == 0) {
-                numbasis += 1+3;  /* combined sp-shell, stored individually */
-                numgauss += 2*numprim;
-                numshell += 1;
-              } else if (strcmp(word[0],"D") == 0) {
-                numbasis += 6;    /* cartesian d-shell. pure will be converted */
-                numgauss += numprim;
-              } else if (strcmp(word[0],"SPD") == 0) {
-                numbasis += 1+3+6; /* combined s,p,d shell */
-                numgauss += 3*numprim;
-                numshell += 2;
-              } else if (strcmp(word[0],"F") == 0) {
-                numbasis += 10;   /* cartesian f-shell. pure will be converted */
-                numgauss += numprim;
-              } else if (strcmp(word[0],"G") == 0) {
-                numbasis += 15;   /* cartesian g-shell. pure will be converted */
-                numgauss += numprim;
-              } else {
-                vmdcon_printf(VMDCON_ERROR, "gaussianplugin) support for %s-"
-                              "shells is not yet programmed.\n", word[0]);
-                return MOLFILE_ERROR;
-              }
-            } else if (i==1) {
-              if (strcmp(word[0],"****") == 0) {
-                break;
-              }
-            } else {
-              return MOLFILE_ERROR;
-            }
-            /* skip over lines with primitives */
-            for (i=0; i < numprim; ++i) 
-              GET_LINE(buffer, data->file);
-
-#if GAUSSIAN_DEBUG
-            vmdcon_printf(VMDCON_INFO, "numcenter:% 4d  numbasis:% 4d  numgauss:% 4d  "
-                    "numshell:% 4d\n", numcenter, numbasis, numgauss, numshell);
-#endif        
-          } while (strcmp(word[0],"****"));
-          GET_LINE(buffer, data->file);
-          i=sscanf(buffer,"%s%s",word[0], word[1]);
-        } while (i == 2);
-        data->wavef_size = numbasis;
-        data->num_shells = numshell;
-        data->num_basis_funcs = numgauss;
-        data->num_basis_atoms = numcenter;
-      } else {
-        i=sscanf(buffer,"%d%s%s%d%s",&nfunc,word[0],word[1],
-                 &nprim,word[2]);
-        if (i==5) {
-          if ((strncmp(word[0],"basis",5) == 0)     &&
-              (strncmp(word[1],"functions",9) == 0) &&
-              (strncmp(word[2],"primitive",9) == 0) ) {
-            GET_LINE(buffer, data->file);
-            sscanf(buffer,"%d%s%s%d%s",&nume_a,word[0],word[1],
-                   &nume_b,word[2]);
-          }
-        }
-      }
-    }
-  } while (nume_a < 0);
-
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) %d shells with %d/%d basis functions, "
-                "%d/%d primitive gaussians\n", data->num_shells,
-                nfunc, data->wavef_size, nprim, data->num_basis_funcs);
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) %d QM atoms with %d alpha electrons, "
-                "%d beta electron\n", data->num_basis_atoms, nume_a, nume_b);
-
-  data->num_orbitals   = nfunc;
-  data->occ_orbitals_A = nume_a;
-  data->occ_orbitals_B = nume_b;
-  data->num_electrons  = nume_a + nume_b;
-  data->multiplicity   = (nume_a+nume_b)/2-(nume_a>nume_b?nume_b:nume_a)+1;
-  
-  return TRUE;
-}
-
-
-/**********************************************************
- *
- * Extract the run title line
- *
- **********************************************************/
-static int get_runtitle(gaussiandata *data) {
-
-  char buffer[BUFSIZ];
-  char *temp;
-  size_t offs;
-  
-  /* look for RUN TITLE section */
-  do {
-    GET_LINE(buffer, data->file);
-  } while (strncmp(buffer," -", 2) );
-  
-  GET_LINE(buffer, data->file);
-  do {
-    char s; 
-
-    offs=strlen(buffer);
-    temp=&buffer[offs];
-
-    while (*temp == '\n' || *temp == '\r' || *temp == '\0') --temp;
-    s = *temp;
-    fgets(temp,BUFSIZ-offs,data->file);
-    *temp = s;
-  } while ( strncmp(temp+1,"--",2) );
-
-  offs=strlen(buffer);
-  temp=&buffer[offs-1];
-  while (*temp == '-' || *temp == '\n' || *temp == '\r') --temp;
-  ++temp;  *temp='\0';
-  strncpy(data->runtitle,buffer,sizeof(data->runtitle));
-  
-  return TRUE;
-} 
-
-
-/* Read the input atom definitions and geometry */
-static int get_input_structure(gaussiandata *data) {
-  char buffer[BUFSIZ];
-  char word[4][MOLFILE_BUFSIZ];
-  int i, numatoms;
-
-  buffer[0] = '\0';
-  for (i=0; i<4; i++) word[i][0] = '\0';
-  
-  GET_LINE(buffer, data->file);
-  sscanf(buffer,"%s%s",word[0],word[1]);
-  
-  if ( ( (strcmp(word[0],"Symbolic") == 0) &&
-         (strcmp(word[1],"Z-matrix:") == 0) ) ||
-       ( (strcmp(word[0],"Redundant") == 0) &&
-         (strcmp(word[1],"internal") == 0)  ) || 
-       ( (strcmp(word[0],"Z-Matrix") == 0) &&
-         (strcmp(word[1],"taken") == 0) ) ) {
-
-    /* skip over line with checkpoint file name */
-    if ( ( (strcmp(word[0],"Redundant") == 0) &&
-           (strcmp(word[1],"internal") == 0)  ) || 
-         ( (strcmp(word[0],"Z-Matrix") == 0) &&
-           (strcmp(word[1],"taken") == 0) ) ) {
-      GET_LINE(buffer, data->file);
-    }
-      
-    /* charge and multiplicity */
-    GET_LINE(buffer, data->file);
-    sscanf(buffer,"%*s%*s%d%*s%*s%d", &(data->totalcharge),
-           &(data->multiplicity));
-
-    /* parse coordinates from input */
-    numatoms=0;
-    data->initatoms=NULL;
-    i=1;
-    do {
-      char *ptr;
-      qm_atom_t *atm;
-      
-      i=1;
-      GET_LINE(buffer, data->file);
-      ptr = strtok(buffer," ,\t\n");
-      
-      if (ptr == NULL) break;
-      if (strcmp(ptr, "Variables:") == 0) break;
-      if (strcmp(ptr, "Recover") == 0) break;
-      if (strcmp(ptr, "The") == 0) break;
-      if (strcmp(ptr, "Leave") == 0) break;
-      
-      /* for now we only read the atom label */
-      data->initatoms=realloc(data->initatoms,(numatoms+1)*sizeof(qm_atom_t));
-      atm = data->initatoms + numatoms;
-      strncpy(atm->type, ptr, sizeof(atm->type));
-      atm->atomicnum=get_pte_idx(ptr);
-      ++numatoms;
-    } while ( i >= 0 );
-    /* TODO */
-  } else {
-    vmdcon_printf(VMDCON_ERROR,
-                  "gaussianplugin) ERROR, cannot parse input coordinates.\n");
-    return FALSE;
-  }
-  
-  /* store number of atoms in data structure */
-  data->numatoms = numatoms;
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Atoms: %d   Charge: %d   Multiplicity: %d\n", 
-                numatoms, data->totalcharge, data->multiplicity);
-  return TRUE; 
-}
-
-
-/**********************************************************
- *
- * Read data from the Route section.
- *
- * XXX: there currently do not seem to be any provisions
- * XXX: for multi-step jobs, i.e. jobs that either have
- * XXX: multiple run types in one calculations or perform 
- * XXX: several calculation steps subsequently...
- *
- **********************************************************/
-static int get_contrl(gaussiandata *data) {
-
-  char buffer[BUFSIZ];
-  const char *vmdbasis;
-  char *temp;
-  size_t offs;
-
-  buffer[0] = '\0';
-  rewind(data->file);
-  
-  /* try to find route section. */
-  do {
-    GET_LINE(buffer, data->file);
-  } while( strncmp(buffer," #", 2) );
-
-  /* append to string in buffer until we reach the end of 
-   * the route section. this way we'll have the whole info
-   * in one long string.
-   * Gaussian writes this out with format (x,A70), so 
-   * joining lines need some special tricks.  */
-  do {
-    char s; 
-
-    offs=strlen(buffer);
-    temp=&buffer[offs];
-
-    while (*temp == '\n' || *temp == '\r' || *temp == '\0') --temp;
-    s = *temp;
-    fgets(temp,BUFSIZ-offs,data->file);
-    *temp = s;
-  } while ( strncmp(temp+1,"--",2) );
-
-  offs=strlen(buffer);
-  temp=&buffer[offs-1];
-  while (*temp == '-' || *temp == '\n' || *temp == '\r') --temp;
-
-  /* some more magic is required.
-   * make sure we are zero terminated and have a trailing blank.
-   * the latter allows to search for keywords with strstr without
-   * getting false positives on keyword strings that are contained
-   * in other keywords */
-  ++temp;  *temp=' '; ++temp; *temp='\0';
-
-  /* convert to upper case */
-  temp=&buffer[0];
-  while (*temp++) *temp = toupper(*temp);
-
-  /* now we are ready to look for useful information */
-
-  /* will we have wavefunction output? */
-  if (strstr(buffer," IOP(6/7=3) ")) {
-    data->have_wavefunction=TRUE;
-  } else {
-    data->have_wavefunction=FALSE;
-  }
-
-  /* is there a basis set in "input format" */
-  if (strstr(buffer," GFINPUT ")) {
-    data->have_basis=TRUE;
-  } else {
-    data->have_basis=FALSE;
-  }
-
-  /* cartesian d-basis functions */
-  if (strstr(buffer," 6D ")) {
-    data->have_cart_basis |= 1;
-  }
-  /* cartesian f-basis functions */
-  if (strstr(buffer," 10F ")) {
-    data->have_cart_basis |= 2;
-  }
-  /* pure d-basis functions */
-  if (strstr(buffer," 5D ")) {
-    data->have_cart_basis &= ~1;
-  }
-  /* pure f-basis functions */
-  if (strstr(buffer," 7F ")) {
-    data->have_cart_basis &= ~2;
-  }
-
-  /* find scf calculation type. XXX: might be safer to detect from output. */
-  if ((strstr(buffer," ROHF/")) ||
-      (strstr(buffer," ROHF ")) ||
-      (strstr(buffer," ROMP"))) {
-    data->scftyp = SCFTYP_ROHF;
-  } else if (data->multiplicity != 1) {
-    data->scftyp = SCFTYP_UHF;
-  } else {
-    data->scftyp = SCFTYP_RHF;
-  }
-        
-  /* for semi-empirical, we set the basis to valence-STO-3G. */
-  if ((strstr(buffer," AM1/")) ||
-      (strstr(buffer," AM1 ")) ||
-      (strstr(buffer," PM3/")) ||
-      (strstr(buffer," PM3 ")) ||
-      (strstr(buffer," MNDO/")) ||
-      (strstr(buffer," MNDO "))) {
-
-    vmdbasis = getenv("VMDDEFBASISSET");
-    if (vmdbasis == NULL) 
-      vmdbasis = "VSTO-3G";
-    
-    if(strlen(data->gbasis) == 0)
-      strncpy(data->gbasis, vmdbasis, sizeof(data->gbasis));
-
-    if(strlen(data->basis_string) == 0) {
-      strncpy(data->basis_string, "Internal ", sizeof(data->basis_string));
-      strncat(data->basis_string, vmdbasis, sizeof(data->basis_string) - 10);
-
-      if(data->have_cart_basis & 1)
-        strcat(data->basis_string," 6D");
-      else
-        strcat(data->basis_string," 5D");
-      if(data->have_cart_basis & 2)
-        strcat(data->basis_string," 10F");
-      else
-        strcat(data->basis_string," 7F");
-    }
-  }
-
-  /* find run type. XXX: might be safer to detect from output. */
-  data->runtyp = RUNTYP_ENERGY;  /* default */
-  if ((strstr(buffer," FOPT ")) || 
-      (strstr(buffer," FOPT=")) ||
-      (strstr(buffer," FOPT(")) ||
-      (strstr(buffer," OPT=")) ||
-      (strstr(buffer," OPT(")) ||
-      (strstr(buffer," OPT "))) {
-    data->runtyp = RUNTYP_OPTIMIZE;
-  } 
-  if (strstr(buffer," FREQ ")) {
-    data->runtyp = RUNTYP_HESSIAN;
-  }
-  if (strstr(buffer," SCAN ")) {
-    data->runtyp = RUNTYP_SURFACE;
-  }
-        
-  /* make sure we have some basis set string
-   * and allow to set it from within VMD. */
-  vmdbasis = getenv("VMDDEFBASISSET");
-  if(strlen(data->gbasis) == 0) {
-    if (vmdbasis == NULL) {
-      strncpy(data->gbasis, "(unknown)", sizeof(data->gbasis));
-      strncpy(data->basis_string, "(unknown)", sizeof(data->basis_string));
-    } else {
-      strncpy(data->gbasis, vmdbasis, sizeof(data->gbasis));
-      strncpy(data->basis_string, "Internal ", sizeof(data->basis_string));
-      strncat(data->basis_string, vmdbasis, sizeof(data->basis_string) - 10);
-
-      if(data->have_cart_basis & 1)
-        strcat(data->basis_string," 6D");
-      else
-        strcat(data->basis_string," 5D");
-      if(data->have_cart_basis & 2)
-        strcat(data->basis_string," 10F");
-      else
-        strcat(data->basis_string," 7F");
-    }
-  }
-
-  /* TODO: add more. e.g. Opt=(ModRedundant), IRC */
-
-  /* print (some of) our findings */
-  vmdcon_printf(VMDCON_INFO, "gaussianplugin) Run-type: %s, SCF-type: %s\n",
-                runtypes[data->runtyp], scftypes[data->scftyp]);
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) using %s basis set.\n", data->basis_string);
-  
-  return TRUE;
-}
-
-static int read_first_frame(gaussiandata *data) {
-  data->qm_timestep = NULL;
-
-  /* the angular momentum is populated in get_wavefunction 
-   * which is called by get_traj_frame(). We have obtained
-   * the array size wavef_size already from the basis set
-   * statistics */
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) preparing for %d atomic basis functions "
-                "per wavefunction.\n", data->wavef_size);
-  SAFE_CALLOC(data->angular_momentum,int,3*data->wavef_size);
-
-  if (!get_traj_frame(data)) {
-    return FALSE;
-  }
-
-  data->num_frames = 1;
-  return TRUE;
-}
-
-/******************************************************
- *
- * Reads the info printed after the geometry search
- * has finished or whatever analysis was done in a 
- * single point run, e.g. ESP charges, Hessian, etc.
- * Rewinds to the beginning of the search when done,
- * because we read this part at in the initial phase
- * and might have to look for additional timesteps
- * later.
- *
- ******************************************************/
-static int get_final_info(gaussiandata *data) {
-  long filepos;
-  filepos = ftell(data->file);
-
-  if (data->runtyp == RUNTYP_OPTIMIZE || 
-      data->runtyp == RUNTYP_SADPOINT ||
-      data->runtyp == RUNTYP_SURFACE) {
-    /* Try to advance to the end of the geometry
-     * optimization. If no regular end is found we
-     * won't find any propertiies to read and return. */
-    if (!find_traj_end(data)) return FALSE;
-  }
-
-  if (data->runtyp == RUNTYP_HESSIAN || data->runtyp == RUNTYP_SURFACE) {
-    vmdcon_printf(VMDCON_WARN, "gaussianplugin) this run type is not fully supported\n");
-  }
-    
-  fseek(data->file, filepos, SEEK_SET);
-  return TRUE; 
-}
-
-
-static int get_coordinates(FILE *file, qm_atom_t *atoms, int numatoms) {
-  char buffer[BUFSIZ];
-  int atomicnum;
-  float x,y,z;
-  int i,n;
-
-  /* we look for:
-                              Input orientation:                          
- ---------------------------------------------------------------------
- Center     Atomic     Atomic              Coordinates (Angstroms)
- Number     Number      Type              X           Y           Z
- ---------------------------------------------------------------------
-   */
-  do {
-    GET_LINE(buffer, file);
-  } while ((strstr(buffer,"Input orientation:") == NULL) &&
-           (strstr(buffer,"Z-Matrix orientation:") == NULL));
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  
-  for (i=0; i < numatoms; ++i) {
-    GET_LINE(buffer, file);
-    n = sscanf(buffer,"%*d%d%*d%f%f%f",&atomicnum,&x,&y,&z);
-    if (n!=4) return FALSE;
-    atoms[i].x=x;
-    atoms[i].y=y;
-    atoms[i].z=z;
-  }
-  return TRUE;
-}
-
-/** same as get_coordinates, but we look for coordinates 
-    in internal orientation */
-static int get_int_coordinates(FILE *file, qm_atom_t *atoms, int numatoms) {
-  char buffer[BUFSIZ];
-  int atomicnum;
-  float x,y,z;
-  int i,n;
-
-  /* we look for:
-                              Standard orientation:                          
- ---------------------------------------------------------------------
- Center     Atomic     Atomic              Coordinates (Angstroms)
- Number     Number      Type              X           Y           Z
- ---------------------------------------------------------------------
-   */
-  do {
-    GET_LINE(buffer, file);
-  } while ((strstr(buffer,"Standard orientation:") == NULL) &&
-           (strstr(buffer,"Z-Matrix orientation:") == NULL));
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  GET_LINE(buffer, file);
-  
-  for (i=0; i < numatoms; ++i) {
-    GET_LINE(buffer, file);
-    n = sscanf(buffer,"%*d%d%*d%f%f%f",&atomicnum,&x,&y,&z);
-    if (n!=4) return FALSE;
-    atoms[i].x=x;
-    atoms[i].y=y;
-    atoms[i].z=z;
-  }
-  return TRUE;
-}
-
-
-
-/*******************************************************
- *
- * this function reads in the basis set data 
- *
- * ******************************************************/
-/* typical data looks like this: 
- ****
-   <atomnum> 0
-   <shellsymm> <#prims> <scalefactor> 0.0
-   <#prims> lines of <coeff(i)> <exp(i>
-   <shellsymm> <#prims> <scalefactor> 0.0
-   <#prims> lines of <coeff(i)> <exp(i>
-    ...
- ****    
-
-  1 0
- S   6 1.00       0.000000000000
-      0.1941330000D+05  0.1851598923D-02
-      0.2909420000D+04  0.1420619174D-01
-      0.6613640000D+03  0.6999945928D-01
-      0.1857590000D+03  0.2400788603D+00
-      0.5919430000D+02  0.4847617180D+00
-      0.2003100000D+02  0.3351998050D+00
- SP   6 1.00       0.000000000000
-      0.3394780000D+03 -0.2782170105D-02  0.4564616191D-02
-      0.8101010000D+02 -0.3604990135D-01  0.3369357188D-01
-      0.2587800000D+02 -0.1166310044D+00  0.1397548834D+00
-      0.9452210000D+01  0.9683280364D-01  0.3393617168D+00
-      0.3665660000D+01  0.6144180231D+00  0.4509206237D+00
-      0.1467460000D+01  0.4037980152D+00  0.2385858009D+00
- */
-
-int get_basis(gaussiandata *data) {
-
-  char buffer[BUFSIZ];
-  char word[3][MOLFILE_BUFSIZ];
-  int i; 
-
-  /* no point in searching through the log file,
-   * if we cannot have this information */
-  if (!data->have_basis) return FALSE;
-
-  /* search for characteristic line. but only in the next 1000 lines */
-  i=0;
-  if(data->version < 20030000) {            /* g98 */
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-      ++i;
-    } while( (strcmp(word[0],"Basis") || 
-              strcmp(word[1],"set"))  && (i<1000) );
-  } else {                                  /* g03 */
-    do {
-      GET_LINE(buffer, data->file);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-      ++i;
-    } while( (strcmp(word[0],"AO") || 
-              strcmp(word[1],"basis"))  && (i<1000) );
-  }
-  if (i>=1000) {
-    /* flag that we have no basis set data */
-    data->num_shells_per_atom=NULL;
-    data->have_basis=FALSE;
-    return MOLFILE_ERROR;
-  }
-  
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  SAFE_CALLOC(data->basis_set,basis_atom_t,data->num_basis_atoms);
-
-  for (i=0; i< data->num_basis_atoms; ++i) {
-    int numshells, numprim;
-    int numread, ishell;
-    float scalef;
-    shell_t *shell;
-    
-    /* this line should be '<atomindex> 0'. gaussian allows much more
-     * flexible input (it is a zero terminated list of indices or labels), 
-     * but upon writing to the log files there is exactly one basis set 
-     * specification per atom. */
-    GET_LINE(buffer, data->file);
-    if (atoi(buffer) != (i+1) ) {
-      vmdcon_printf(VMDCON_WARN, 
-                    "gaussianplugin) basis set atom counter mismatch: %d vs %s\n",
-                    atoi(buffer), i+1);
-      SAFE_FREE(data->basis_set);
-      data->num_shells_per_atom=NULL;
-      return MOLFILE_ERROR;
-    }
-    strncpy(data->basis_set[i].name,data->gbasis,10);
-    
-    numshells=0;
-    shell=NULL;
-    GET_LINE(buffer, data->file);
-    while( strncmp(buffer," ****",5) ) {
-      int n;
-
-      numread=sscanf(buffer,"%s%d%f",word[0],&numprim,&scalef);
-      if (numread == 3) {
-#if GAUSSIAN_DEBUG && GAUSSIAN_BASIS_DEBUG
-        vmdcon_printf(VMDCON_INFO, "gaussianplugin) atom: %d, element: %s, shell: %d "
-                      "%s-type shell, %d primitives, scalefactor %f\n", i,
-                      get_pte_label(data->initatoms[i].atomicnum), numshells+1, 
-                      word[0], numprim, scalef);
-#endif
-        ;
-      } else {
-        vmdcon_printf(VMDCON_WARN, 
-                      "gaussianplugin) basis set parse error: %s",buffer);
-        free(data->basis_set);
-        data->have_basis=FALSE;
-        data->basis_set=NULL;
-        data->num_shells_per_atom=NULL;
-        return FALSE;
-      }
-      ishell=numshells;
-      ++numshells;
-      shell=realloc(shell,numshells*sizeof(shell_t));
-      shell[ishell].numprims=numprim;
-      shell[ishell].symmetry=shellsymm_int(word[0]);
-      shell[ishell].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      if (shell[ishell].symmetry == SP_S_SHELL) {
-        ++numshells;
-        shell=realloc(shell,numshells*sizeof(shell_t));
-        shell[ishell+1].numprims=numprim;
-        shell[ishell+1].symmetry=SP_P_SHELL;
-        shell[ishell+1].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      }
-
-      for (n=0; n<numprim; ++n) {
-        GET_LINE(buffer, data->file);
-        sscanf(buffer,"%s%s%s", word[0],word[1],word[2]);
-        fix_fortran_exp(word[0]);
-        shell[ishell].prim[n].exponent=atof(word[0])*scalef*scalef;
-        fix_fortran_exp(word[1]);
-        shell[ishell].prim[n].contraction_coeff=atof(word[1]);
-        if (shell[ishell].symmetry == SP_S_SHELL) {
-          shell[ishell+1].prim[n].exponent=shell[ishell].prim[n].exponent;
-          fix_fortran_exp(word[2]);
-          shell[ishell+1].prim[n].contraction_coeff=atof(word[2]);
-        }
-      }
-      GET_LINE(buffer, data->file);
-    }
-
-    /* store shells in atom */
-    data->basis_set[i].numshells = numshells;
-    data->basis_set[i].shell = shell;
-  }
-
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Parsed %d uncontracted basis functions with %d shells.\n",
-                data->num_basis_funcs, data->num_shells);
-
-#if GAUSSIAN_DEBUG
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int j,k,primcount,shellcount;
-    primcount=0;
-    shellcount=0;
-    
-    printf("%-8s (%10s)\n\n", data->initatoms[i].type, data->basis_set[i].name);
-    printf("\n");
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        printf("%6d   %d %7d %22f%22f\n", j,
-               data->basis_set[i].shell[j].symmetry,
-               primcount+1,
-               data->basis_set[i].shell[j].prim[k].exponent,
-               data->basis_set[i].shell[j].prim[k].contraction_coeff);
-        primcount++;
-      }
-
-      printf("\n");
-      shellcount++;
-    }
-  }
-#endif
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  return fill_basis_arrays(data);
-}
-
-
-/*******************************************************
- *
- * this function reads in the basis set data from 
- * <basis>.gbs or $VMDDIR/basis/<basis>.gbs
- *
- * ******************************************************/
-int get_internal_basis(gaussiandata *data) {
-
-  char *vmddir = NULL;
-  FILE *fp;
-  char buffer[BUFSIZ];
-  char word[3][MOLFILE_BUFSIZ];
-  char filepath[256];
-  int  i,n; 
-
-  /* no point in adding a basis set if we already have this information */
-  if (data->have_basis) return TRUE;
-
-  /* try to open basis set database file. */
-  sprintf(filepath,"%s.gbs",data->gbasis);
-  fp=fopen(filepath,"rb");
-  if (fp == NULL) {
-    vmddir=getenv("VMDDIR");
-    if (vmddir == NULL) {
-      vmddir="/usr/local/lib/vmd";
-    }
-    sprintf(filepath,"%s/basis/%s.gbs",vmddir,data->gbasis);
-    fp=fopen(filepath,"rb");
-  }
-  
-  if (fp == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "gaussianplugin) failed to read basis set "
-                  "from data base file %s\n", filepath);
-    data->num_shells_per_atom=NULL;
-    data->have_basis=FALSE;
-    return FALSE;
-  } else {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) reading basis set "
-                  "from data base file %s\n", filepath);
-  }
-  
-  /* Allocate space for the basis for all atoms */
-  /* When the molecule is symmetric the actual number atoms with
-   * a basis set could be smaller */
-  SAFE_CALLOC(data->basis_set,basis_atom_t,data->num_basis_atoms);
-
-  for (i=0; i < data->num_basis_atoms; ++i) {
-    int numshells, numprim;
-    int numread, ishell;
-    float scalef;
-    shell_t *shell;
-    
-    /* search for the characteristic first line starting with '****'. */
-    rewind(fp);
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      sscanf(buffer,"%s%s",word[0],word[1]);
-    } while(strcmp(word[0],"****"));
-  
-    /* search for an entry for the current atom in the format '<name> 0'. */
-    do {
-      fgets(buffer, sizeof(buffer), fp);
-      if (feof(fp)) {
-        free(data->basis_set);
-        data->basis_set=NULL;
-        data->num_shells_per_atom=NULL;
-        data->have_basis=FALSE;
-        vmdcon_printf(VMDCON_ERROR, "gaussianplugin) EOF in data base "
-                      "file %s while looking for element %s.\n", filepath, 
-                      get_pte_label(data->initatoms[i].atomicnum), buffer);
-        fclose(fp);
-        return FALSE;
-      }
-      n=sscanf(buffer,"%s%s",word[0],word[1]);
-    } while ( (n != 2) || strcmp(word[1],"0") ||
-              (strcmp(word[0],get_pte_label(data->initatoms[i].atomicnum))) );
-    
-    strncpy(data->basis_set[i].name,data->gbasis,sizeof(data->gbasis));
-    
-    numshells=0;
-    shell=NULL;
-
-    /* read basis set until end of element */
-    do {
-
-      fgets(buffer, sizeof(buffer), fp);
-      if (strstr(buffer,"****")) break;
-      if (ferror(fp)) {
-        vmdcon_printf(VMDCON_ERROR, "gaussianplugin) read error in data "
-                      "base file %s while reading basis of element %s.\n", 
-                      filepath, get_pte_label(data->initatoms[i].atomicnum));
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      numread=sscanf(buffer,"%s%d%f",word[0],&numprim,&scalef);
-      if (numread == 3) {
-#if GAUSSIAN_DEBUG && GAUSSIAN_BASIS_DEBUG
-        vmdcon_printf(VMDCON_INFO, "gaussianplugin) atom: %d, element: %s, shell: %d "
-                      "%s-type shell, %d primitives, scalefactor %f\n", i,
-                      get_pte_label(data->initatoms[i].atomicnum), numshells+1, 
-                      word[0], numprim, scalef);
-#endif
-        ;
-      } else {
-        vmdcon_printf(VMDCON_WARN, 
-                      "gaussianplugin) basis set parse error: %s",buffer);
-        free(data->basis_set);
-        data->basis_set=NULL;
-        return FALSE;
-      }
-
-      ishell=numshells;
-      ++numshells;
-      shell=realloc(shell,numshells*sizeof(shell_t));
-      shell[ishell].numprims=numprim;
-      shell[ishell].symmetry=shellsymm_int(word[0]);
-      shell[ishell].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      if (shell[ishell].symmetry == SP_S_SHELL) {
-        ++numshells;
-        shell=realloc(shell,numshells*sizeof(shell_t));
-        shell[ishell+1].numprims=numprim;
-        shell[ishell+1].symmetry=SP_P_SHELL;
-        shell[ishell+1].prim = (prim_t *)calloc(numprim,sizeof(prim_t));
-      }
-
-      for (n=0; n<numprim; ++n) {
-        fgets(buffer, sizeof(buffer), fp);
-        if (ferror(fp)) {
-          vmdcon_printf(VMDCON_ERROR, "gaussianplugin) read error in data "
-                        "base file %s while reading basis of element %s.\n", 
-                        filepath, get_pte_label(data->initatoms[i].atomicnum));
-          free(data->basis_set);
-          data->basis_set=NULL;
-          return FALSE;
-        }
-        sscanf(buffer,"%s%s%s", word[0],word[1],word[2]);
-        fix_fortran_exp(word[0]);
-        shell[ishell].prim[n].exponent=atof(word[0])*scalef*scalef;
-        fix_fortran_exp(word[1]);
-        shell[ishell].prim[n].contraction_coeff=atof(word[1]);
-        if (shell[ishell].symmetry == SP_S_SHELL) {
-          shell[ishell+1].prim[n].exponent=shell[ishell].prim[n].exponent;
-          fix_fortran_exp(word[2]);
-          shell[ishell+1].prim[n].contraction_coeff=atof(word[2]);
-        }
-      }
-    } while(1);
-
-  
-    /* store shells in atom */
-    data->basis_set[i].numshells = numshells;
-    data->basis_set[i].shell = shell;
-    
-    /* store the total number of basis functions */
-    data->num_shells += numshells;
-  }
-
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Parsed %d uncontracted basis functions. \n",
-                data->num_basis_funcs);
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  data->have_basis = TRUE;
-  return fill_basis_arrays(data);
-}
-
-
-/**************************************************
- *
- * Convert shell symmetry type from char to int.
- *
- ************************************************ */
-static int shellsymm_int(char *symm) {
-  int shell_symmetry;
-
-  switch (toupper(symm[0])) {
-    case 'S':
-      if (symm[1] == '\0') {
-        shell_symmetry = S_SHELL;
-      } else if (toupper(symm[1]) == 'P') {
-        if (symm[2] == '\0') {
-          shell_symmetry = SP_S_SHELL;
-        } else if (toupper(symm[1]) == 'D') {
-          shell_symmetry = SPD_S_SHELL;
-        } else {
-          shell_symmetry = UNK_SHELL;
-        } 
-      } else {
-        shell_symmetry = UNK_SHELL;
-      }
-      break;
-    case 'L':
-      shell_symmetry = SP_S_SHELL;
-      break;
-    case 'M': 
-      shell_symmetry = SP_P_SHELL;
-      break;
-    case 'P':
-      shell_symmetry = P_SHELL;
-      break;
-    case 'D':
-      shell_symmetry = D_SHELL;
-      break;
-    case 'F':
-      shell_symmetry = F_SHELL;
-      break;
-    case 'G':
-      shell_symmetry = G_SHELL;
-      break;
-    default:
-      shell_symmetry = UNK_SHELL;
-      break;
-  }
-
-  return shell_symmetry;
-}
-
-
-/** Populate the flat arrays containing the basis set data. */
-static int fill_basis_arrays(gaussiandata *data) {
-  int i, j, k;
-  int shellcount, primcount;
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_symmetry;
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per primitive gaussian, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  SAFE_CALLOC(basis,float,2*data->num_basis_funcs);
-  SAFE_CALLOC(num_shells_per_atom,int,data->num_basis_atoms);
-  SAFE_CALLOC(shell_symmetry,int,data->num_shells);
-  SAFE_CALLOC(num_prim_per_shell,int,data->num_shells);
-
-  /* place pointers into struct gaussiandata */
-  data->basis = basis;
-  data->shell_symmetry = shell_symmetry;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell  = num_prim_per_shell;
-
-  shellcount=primcount=0;
-  
-  for(i=0; i<data->num_basis_atoms; i++) {
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_symmetry[shellcount] = data->basis_set[i].shell[j].symmetry;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-  return TRUE;
-}
-
-
-
-/** this function extracts the trajectory information
- *  from the output file */
-static int get_traj_frame(gaussiandata *data) {
-  qm_timestep_t *cur_qm_ts;
-  int i;
-  long fpos;
-  char buffer[BUFSIZ];
-  char word[MOLFILE_BUFSIZ];  
-  buffer[0] = '\0';
-  word[0] = '\0';
-
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Timestep %d: =======================\n", 
-                data->num_frames_read);
-#endif
-
-  fpos=ftell(data->file);       /* XXX: */
-  if (!get_coordinates(data->file, data->initatoms, data->numatoms)) {
-    vmdcon_printf(VMDCON_WARN, 
-                  "gaussianplugin) Couldn't find input orientation coordinates"
-                  " for timestep %d\n", data->num_frames_read);
-    vmdcon_printf(VMDCON_WARN, 
-                  "gaussianplugin) Trying internal coordinates instead.\n");
-
-    fseek(data->file, fpos, SEEK_SET); /* XXX: */
-    if(!get_int_coordinates(data->file, data->initatoms, data->numatoms)) {
-      vmdcon_printf(VMDCON_ERROR, 
-                    "gaussianplugin) Couldn't find any coordinates.\n", 
-                    data->num_frames_read);
-      return FALSE;
-    } 
-  }
-  
-  /* allocate more memory for the timestep array */
-  data->qm_timestep = 
-    (qm_timestep_t *)realloc(data->qm_timestep, 
-                             (data->num_frames_read+1)*sizeof(qm_timestep_t));
-
-  /* get a convenient pointer to the current qm timestep and clear it. */
-  cur_qm_ts = data->qm_timestep+data->num_frames_read;
-  memset(cur_qm_ts, 0, sizeof(qm_timestep_t));
-
-  /* XXX: this is a guess only. we need to know this for certain */
-  cur_qm_ts->numwave = 1;
-  if (data->scftyp == SCFTYP_UHF)
-    cur_qm_ts->numwave = 2;
-
-  /* Read the basis set. if available */
-  if (data->num_frames_read == 0) {
-    get_basis(data);
-    get_internal_basis(data);
-  }
-  
-  SAFE_CALLOC(cur_qm_ts->wave,qm_wavefunction_t,cur_qm_ts->numwave);
-  for (i=0; i < cur_qm_ts->numwave; ++i) {
-    cur_qm_ts->wave[i].idtag = i;
-    SAFE_CALLOC(cur_qm_ts->wave[i].orb_indices,int,data->wavef_size);
-    SAFE_CALLOC(cur_qm_ts->wave[i].orb_energies,float,data->wavef_size);
-    SAFE_CALLOC(cur_qm_ts->wave[i].occupancies,float,data->wavef_size);
-    SAFE_CALLOC(cur_qm_ts->wave[i].wave_coeffs,float,
-                data->wavef_size*data->wavef_size);
-  }
-  
-  /* Try to read wavefunction and orbital energies */
-  if (get_wavefunction(data, cur_qm_ts) == FALSE) {
-    vmdcon_printf(VMDCON_WARN, "gaussianplugin) No wavefunction present for timestep %d\n", data->num_frames_read);
-    /* free storage */
-    for (i=0; i < cur_qm_ts->numwave; ++i) {
-      free(cur_qm_ts->wave[i].wave_coeffs);
-      free(cur_qm_ts->wave[i].orb_energies);
-      free(cur_qm_ts->wave[i].occupancies);
-    }
-    free(cur_qm_ts->wave);
-    cur_qm_ts->wave=NULL;
-    cur_qm_ts->numwave=0;
-  } else {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) Wavefunction found for timestep %d\n", data->num_frames_read);
-  }
-
-#if 0
-  if (get_population(data, cur_qm_ts)) {
-    vmdcon_printf(VMDCON_INFO, "gaussianplugin) Mulliken charges found\n");
-  }
-#endif
-
-  data->num_frames_read++;
-
-  return TRUE;
-}
-
-
-/* Look for the "EQUILIBRIUM GEOMETRY LOCATED" line thereby
- * advancing the file pointer so that the final info block
- * can be parsed.
- * If we don't find this line before the next geometry
- * the file pointer will be set back to where the search
- * started. */
-static int find_traj_end(gaussiandata *data) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(data->file);
-
-  while (1) {
-    if (!fgets(buffer, sizeof(buffer), data->file)) break;
-
-    if (strstr(buffer, "Berny optimization.")) {
-      data->num_frames++;
-    } else if (strstr(buffer, "Optimization completed.")) {
-#if GAUSSIAN_DEBUG
-      vmdcon_printf(VMDCON_INFO, "gaussianplugin) ==== End of trajectory. ====\n");
-#endif
-      data->opt_status = STATUS_CONVERGED;
-      return TRUE;
-    } else if (strstr(buffer, "Optimization stopped.")) {
-#if GAUSSIAN_DEBUG
-      vmdcon_printf(VMDCON_INFO, "gaussianplugin) ==== End of trajectory. ====\n");
-#endif
-      data->opt_status = STATUS_TOO_MANY_STEPS;
-      return TRUE;
-    } else if (strstr(buffer, "Convergence failure -- run terminated.")) {
-      data->opt_status = STATUS_SCF_NOT_CONV;
-      return FALSE;
-    } 
-  }
-
-  /* We didn't find any of the regular key strings,
-   * the run was most likely broken off and we have an
-   * incomplete file. */
-  data->opt_status = STATUS_BROKEN_OFF;
-
-  fseek(data->file, filepos, SEEK_SET);
-  return FALSE;  
-}
-
-/*********************************************************
- *
- * this function reads the actual wavefunction, which is
- * punched at the end of the log file
- *
- **********************************************************/
-static int get_wavefunction(gaussiandata *data, qm_timestep_t *ts)
-{
-  long filepos;
-  char buffer[BUFSIZ];
-  char word[6][MOLFILE_BUFSIZ];
-  float *orb_erg, *orb_occ;
-  int orbital_counter;
-  int i, j, num_values, num_orbs, *orb_idx;
-  qm_wavefunction_t *wf;
-  
-  i=j=num_values=num_orbs=orbital_counter=0;
-
-  buffer[0] = '\0';
-  for (i=0; i<6; i++) word[i][0] = '\0';
-
-  wf = ts->wave;
-  if (wf == NULL || ts->numwave == 0) {
-    PRINTERR;
-    return FALSE;
-  }
-
-  /* no point in searching for wavefunction info, if there cannot be any. */
-  if (!data->have_wavefunction) return FALSE;
-  
-  /* default values. to be changed if needed */
-  wf->type = MOLFILE_WAVE_CANON;
-  wf->spin = SPIN_ALPHA;
-  wf->cartesian = 1;
-  orb_erg = wf->orb_energies;
-  orb_occ = wf->occupancies;
-  orb_idx = wf->orb_indices;
-  
-  /*
-   * the following output requires  IOP(6/7=3) in the route section.
-   *
-   * Scan for something like this (g98 closed shell):
-     Molecular Orbital Coefficients
-                           1         2         3         4         5
-                           O         O         O         O         O
-     EIGENVALUES --    -7.61925  -7.61868  -0.88486  -0.63877  -0.55750
-   1 1   B  1S          0.71623  -0.69260  -0.13195  -0.12199   0.00000
-   2        2S          0.01884  -0.01744   0.20755   0.19054   0.00000
-   3        2PX         0.00000   0.00000   0.00000   0.00000   0.24930
-
-   * or this (g03 closed shell):
-
-     Molecular Orbital Coefficients
-                           1         2         3         4         5
-                       (SGG)--O  (SGU)--O  (SGG)--O  (PIU)--O  (PIU)--O
-     EIGENVALUES --    -1.30558  -1.16543  -0.63335  -0.56287  -0.51096
-   1 1   O  1S          0.68764   0.70168   0.16476   0.00000   0.00000
-   2        1PX         0.00000   0.00000   0.00000   0.70711   0.00000
-   3        1PY         0.00000   0.00000   0.00000   0.00000   0.70711
-
-
-   * or this (g03 open shell):
-
-   Alpha Molecular Orbital Coefficients
-                           1         2         3         4         5
-                       (SGG)--O  (SGU)--O  (SGG)--O  (SGU)--O  (PIU)--O
-     EIGENVALUES --   -20.82303 -20.82274  -1.55752  -1.30463  -0.78343
-   1 1   O  1S          0.70309   0.70312  -0.15839  -0.17089   0.00000
-   2        2S          0.01545   0.01540   0.38998   0.42214   0.00000
-
-
-   */
-
-  /* remember position in order to go back if no wave function was found */
-  filepos = ftell(data->file);
-
-  do {
-    GET_LINE(buffer, data->file);
-    /* check if we searched too far. XXX need more tests here. */
-    if (strstr(buffer,"Input orientation") ) {
-      fseek(data->file, filepos, SEEK_SET);
-      return FALSE;
-    }
-  } while(!strstr(buffer,"Molecular Orbital Coefficients"));
-
-  while (orbital_counter < data->num_orbitals) {
-    /* read up to line of orbital energies */
-    GET_LINE(buffer, data->file);           /* orbital index */
-    num_orbs = sscanf(buffer,"%s%s%s%s%s",word[0],word[1],word[2],word[3],word[4]);
-    /* XXX: we need to keep track of these numbers, since the wavefunction may
-            have only a subset of orbitals, and we want to know where the 
-            frontier orbitals are located. with the similarity reordering 
-            in VMD this information will be essential, if somebody compares 
-            the .log file and the orbital rep. */
-
-    GET_LINE(buffer, data->file); /* occupied or virtual orbital (+ orbital symm) */
-    sscanf(buffer,"%s%s%s%s%s", word[0],word[1],word[2],word[3],word[4]);
-    for (i=0; i<num_orbs; i++) {
-      j=strlen(word[i]);
-      orb_occ[i] = (word[i][j-1] == 'O') ? 1.0f : 0.0f;
-    }
-    
-    GET_LINE(buffer, data->file); /* eigenvalues */
-    sscanf(buffer,"%*s%*s%s%s%s%s%s",word[0],word[1],word[2],word[3],word[4]);
-    for (i=0; i<num_orbs; i++) 
-      orb_erg[i] = atof(word[i]);
-      
-    /* step counters and pointers */
-    orb_erg += num_orbs;
-    orb_occ += num_orbs;
-
-    /* now read in the wavefunction */
-    for (i=0; i<data->num_orbitals; i++) {
-      int xexp=0, yexp=0, zexp=0;
-
-      /* read in the wavefunction coefficients for up 
-       * to 5 orbitals at a time line by line */
-      GET_LINE(buffer, data->file);
-      num_values = sscanf(buffer+12,"%4s%s%s%s%s%s", 
-                          word[0], word[1], word[2],
-                          word[3], word[4], word[5]);
-
-      /* handle magenetic quantum number. in cartesian basis the
-       * labels are: S, PX, PY, PZ, DXX, DXY, DXZ, DYY, DYZ, DZZ, ...*/
-      for (j=1; j<strlen(word[0]); j++) {
-        switch (word[0][j]) {
-          case 'X':
-            xexp++;
-            break;
-          case 'Y':
-            yexp++;
-            break;
-          case 'Z':
-            zexp++;
-            break;
-            /* if we have pure d/f-functions the nomenclature changes to 
-             * 'D 0', 'D-1', 'D+1', 'D-2', 'D+2' */
-          case '+': /* fallthrough */
-          case '-': /* fallthrough */
-          case '0': /* fallthrough */
-          case '1': /* fallthrough */
-          case '2': /* fallthrough */
-            if (wf->cartesian) {
-              wf->cartesian=0;    /* flag it, so we can convert it later. */
-              vmdcon_printf(VMDCON_ERROR, "gaussianplugin) pure basis function "
-                            "detected: '%s'. those are not supported yet. bailing out...\n", word[0]);
-              return FALSE;
-            }
-            break;
-          default:
-            /* do nothing */
-            break;
-        }
-      }
-      data->angular_momentum[3*i  ] = xexp;
-      data->angular_momentum[3*i+1] = yexp;
-      data->angular_momentum[3*i+2] = zexp;
-#if GAUSSIAN_DEBUG && GAUSSIAN_BASIS_DEBUG && 0
-      vmdcon_printf(VMDCON_INFO,"%s:%d orbitals %d/%d/%d/%d  shell %d/%d/%s: %d %d %d\n", 
-                    __FILE__, __LINE__, i, data->num_orbitals, num_orbs, orbital_counter, 
-                    i, data->wavef_size, word[0], xexp, yexp, zexp);
-#endif
-
-      /* each orbital has data->wavef_size entries when converted to 
-       * cartesian spherical harmonics. to ease conversion we use this 
-       * number as offset when storing them in groups. */
-      for (j=0 ; j<num_orbs; j++) {
-        wf->wave_coeffs[(orbital_counter+j)*data->wavef_size+i] = atof(&word[j+1][0]);
-      }
-    }
-    orbital_counter += num_orbs;
-  }
-
-  /* store the number of orbitals read in */
-  wf->num_orbitals = orbital_counter;
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Number of orbitals scanned: %d \n",
-                orbital_counter);
-  return TRUE;
-}
-
-/* Read the population analysis section.
- * Currently we parse only the Mulliken charges
- * but we might want to add support for populations
- * and for Lowdin analysis. */
-static int get_population(gaussiandata *data, qm_timestep_t *ts) {
-#if 0
-  int i;
-  char buffer[BUFSIZ];
-  data->have_mulliken = FALSE;
-
-
-  /* Read Mulliken charges if present */
-  ts->mulliken_charges = 
-    (double *)calloc(data->num_basis_atoms, sizeof(double));
-
-  if (!ts->mulliken_charges) {
-    PRINTERR; 
-    return FALSE;
-  }
-  
-  for (i=0; i<data->num_basis_atoms; i++) {
-    int n;
-    float mullpop, mullcharge, lowpop, lowcharge;
-    GET_LINE(buffer, data->file);
-    n = sscanf(buffer,"%*i%*s%f%f%f%f",
-               &mullpop, &mullcharge, &lowpop, &lowcharge);
-    if (n!=4) return FALSE;
-    ts->mulliken_charges[i] = mullcharge;
-  }
-
-  if (i!=data->numatoms) return FALSE;
-
-  data->have_mulliken = TRUE;
-
-#if GAUSSIAN_DEBUG
-  vmdcon_printf(VMDCON_INFO, 
-                "gaussianplugin) Number of orbitals scanned: %d \n",
-                orbital_counter);
-#endif
-
-#endif
-  return TRUE;
-}
-
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "gaussian";
-  plugin.prettyname = "Gaussian Logfile (g94,g98,g03)";
-  plugin.author = "Axel Kohlmeyer, Markus Dittrich, Jan Saam";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "log";
-  plugin.open_file_read = open_gaussian_read;
-  plugin.read_structure = read_gaussian_structure;
-  plugin.close_file_read = close_gaussian_read;
-
-  plugin.read_qm_metadata = read_gaussian_metadata;
-  plugin.read_qm_rundata  = read_gaussian_rundata;
-
-#if vmdplugin_ABIVERSION > 11
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-  plugin.read_timestep = read_timestep;
-#endif
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int numatoms, i, j, optflags;
-  molfile_atom_t *atoms;
-  molfile_timestep_t timestep;
-  molfile_metadata_t metadata;
-  molfile_timestep_metadata_t ts_metadata;
-  molfile_qm_timestep_metadata_t qm_ts_metadata;
-  molfile_qm_metadata_t qm_metadata;
-  molfile_qm_timestep_t qm_ts;
-    
-  void *v;
-
-  while (--argc) {
-    ++argv;
-    v = open_gaussian_read(*argv, "log", &numatoms);
-    if (!v) {
-      fprintf(stderr, "open_gaussian_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_gaussian_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", numatoms);
-    atoms = (molfile_atom_t *)malloc(sizeof(molfile_atom_t)*numatoms);
-    read_gaussian_structure(v,&optflags, atoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*numatoms);
-    
-    while (1) {
-      memset(&ts_metadata, 0, sizeof(molfile_timestep_metadata_t));
-      read_timestep_metadata(v, &ts_metadata);
-      memset(&qm_metadata, 0, sizeof(molfile_qm_metadata_t));
-      read_qm_timestep_metadata(v, &qm_ts_metadata);
-      qm_ts.scfenergies = (double *)malloc(qm_ts_metadata.num_scfiter*sizeof(double));
-      qm_ts.wave        = (molfile_qm_wavefunction_t *)malloc(qm_ts_metadata.num_wavef
-                                                              *sizeof(molfile_qm_wavefunction_t));
-      memset(qm_ts.wave, 0, qm_ts_metadata.num_wavef*sizeof(molfile_qm_wavefunction_t));
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        qm_ts.wave[j].wave_coeffs = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]
-                                                     * qm_ts_metadata.wavef_size * sizeof(float));
-        qm_ts.wave[j].orbital_energies = (float *) malloc(qm_ts_metadata.num_orbitals_per_wavef[j]*sizeof(float));
-      }
-      qm_ts.gradient = (float *) malloc(3*numatoms*sizeof(float));
-      if (read_timestep(v, numatoms, &timestep, &qm_metadata, &qm_ts)) break;
-      /* do something with data */
-      /* XXX */
-
-      free(qm_ts.gradient);
-      for (j=0; (j<10 && j<qm_ts_metadata.num_wavef); j++) {
-        free(qm_ts.wave[j].wave_coeffs);
-        free(qm_ts.wave[j].orbital_energies);
-      }
-      free(qm_ts.wave);
-      free(qm_ts.scfenergies);
-      i++;
-    }
-    fprintf(stderr, "ended read_timestep on frame %d\n", i);
-    close_gaussian_read(v);
-  }
-  return 0;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gaussianplugin.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gaussianplugin.h
deleted file mode 100644
index 51f6490e63e8f97984e31a760719b5122e20d45f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gaussianplugin.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gaussianplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.10 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-/*******************************************************************
- * 
- *  headerfile for the gaussianplugin
- *  
- ******************************************************************/
-
-#ifndef GAUSSIANPLUGIN_H
-#define GAUSSIANPLUGIN_H
-
-#include <stdio.h>
-#include "molfile_plugin.h"
-
-/* define macros for true/false to make code 
-* look somewhat nicer; the macro DONE signals
-* that we're done with reading an should return
-* with what we have */
-#define FALSE 0
-#define TRUE  1
-
-/** macros describing the RUNTYP */
-#define RUNTYP_UNKNOWN    0     /**< not set.  */
-#define RUNTYP_ENERGY     1     /**< total energy, single point run  */
-#define RUNTYP_OPTIMIZE   2     /**< geometry optimization  */
-#define RUNTYP_SADPOINT   3     /**< transition state search  */
-#define RUNTYP_HESSIAN    4     /**< frequency calculation  */
-#define RUNTYP_SURFACE    5     /**< potential energy scan  */
-#define RUNTYP_DYNAMICS   6     /**< molecular dynamics or monte carlo  */
-#define RUNTYP_PROPERTIES 7     /**< wavefunction analysis  */
-
-/** macros defining the SCFTYP */
-#define SCFTYP_UNKNOWN 0        /**< not set. */
-#define SCFTYP_RHF   1          /**< closed shell or restricted wfn.  */
-#define SCFTYP_UHF   2          /**< open shell or unrestricted wfn.  */
-#define SCFTYP_ROHF  3          /**< restricted open shell wfn.  */
-#define SCFTYP_GVB   4          /**< generalized valence bond wfn. */
-#define SCFTYP_MCSCF 5          /**< multi-configuration SCF.  */
-#define SCFTYP_FF    6          /**< force field calculation.  */
-
-/** XXX: check if this can go away. */
-#define MAX_NUM_WAVE 10
-
-typedef struct {
-  float exponent;
-  float contraction_coeff;
-} prim_t;
-
-
-typedef struct {
-  int symmetry;                 /* symmetry of this shell (S, P, D, ...) */
-  int numprims;                 /* number of primitive basis functions */
-  prim_t *prim;                 /* array of primitives */
-} shell_t;
-
-
-/** Basis set definition for one atom */
-typedef struct {
-  char name[20];                /* atom name or type (pseudopotentialfile?) */
-  int atomicnum;                /* atomic number (nuclear charge XXX) */
-  int numshells;
-  shell_t *shell;
-} basis_atom_t;
-
-
-/** structure for storing temporary values read in 
- * from the gaussian output file */
-typedef struct 
-{
-  char type [8];                /* atom type H,N,O ..... */
-  int atomicnum;                /* index in PTE. */
-  float x,y,z;                  /* coordinates of atom i */
-} qm_atom_t;
-
-
-typedef struct {
-  int   idtag;              /**< unique tag to identify this wavefunction over the trajectory */
-  int   type;               /**< CANONICAL, LOCALIZED, OTHER */
-  int   spin;               /**< 0 for alpha, 1 for beta */
-  int   cartesian;          /**< 1 if cartesian, 0 if pure  */
-  int   excitation;         /**< 0 for ground state, 1,2,3,... for excited states */
-  char info[MOLFILE_BUFSIZ]; /**< string for additional type info */
-
-  int   num_orbitals;       /**< number of orbitals that were really 
-                             *   present in the output for this step */
-  int   *orb_indices;       /**< list of orbital indices for wavefunction */
-  float *occupancies;       /**< list of orbital occupancies for wavefunction */
-  float *orb_energies;      /**< list of orbital energies for wavefunction */
-  float *wave_coeffs;       /**< expansion coefficients for wavefunction in the
-                             *   form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */
-} qm_wavefunction_t;
-
-
-typedef struct {
-  qm_wavefunction_t *wave;  /**<  */
-  int numwave;              /**< number of independent wavefunctions  */
-  int num_orbitals;         /**< number of orbitals per wavefunction  */
-  int num_scfiter;          /**< number of SCF iterations for this step */
-  double *scfenergies;      /* scfenergies per trajectory point 
-                             * XXX: how about post-HF calculations?
-                             *      we have the HF, MP2, CASSCF, CCS,
-                             *      CCSD, CCSD(T) energies... */
-
-  double *mulliken_charges; /* per-atom Mulliken charges */
-  double *lowdin_charges;   /* per-atom Lowdin charges */
-  double *esp_charges;      /* per-atom esp charges */
-  double *npa_charges;      /* per-atom npa charges */
-
-  float *gradient;          /* energy gradient for each atom */
-} qm_timestep_t;
-
-
-/** main gaussian plugin data structure */
-typedef struct 
-{
-  FILE *file;
-  int numatoms;
-  int runtyp;        /* run type of this job as int for internal use */
-  char gbasis[20];   /* canonicalized basis set string
-                        for loading and external basis set. */
-
-  char basis_string[MOLFILE_BUFSIZ]; /* basis name as "nice" string */
-
-  char runtitle[MOLFILE_BUFSIZ];  /* title/info section of run */
-
-  char geometry[MOLFILE_BUFSIZ];  /* either UNIQUE, CART or ZMP/ZMTMPC */
-  char guess[MOLFILE_BUFSIZ];    /* type of guess method used */
-
-  char version_string[MOLFILE_BUFSIZ]; /* full version string of binary used for run */
-  int  version;  /* gaussian version code;
-                  * canonicalized and set up for integer comparisons.
-                  * here we keep track the exact Gaussian version,
-                  * since the log file format keeps changing all
-                  * the time. 
-                  * Format is Year/Revision/Patchlevel: YYYYRRPP
-                  * with:
-                  * YYYY: g94 -> 1994, g98 -> 1998, g03 -> 2003
-                  *   RR: A -> 1, B -> 2, C ->3, ...
-                  *   PP: 01, 02, 03, ...
-                  *
-                  *   Example: G03RevB.04 -> 20030204
-                  *
-                  *   version = 0  => unknown/unreadable version. 
-                  */
-
-  char *file_name;
-
-  /******************************************************
-   * new API functions
-   *****************************************************/
-
-  int  scftyp;              /* UHF, RHF, ROHF, as in for 
-                             * internal use*/
-  char scftyp_string[MOLFILE_BUFSIZ]; /* scftyp as string. XXX: remove */
-  int totalcharge;              /* Total charge of the system */
-  int multiplicity;             /* Multiplicity of the system */
-  int num_electrons;            /* Number of electrons */
-  int nimag;                    /* Number of imaginary frequencies */
-  int *nimag_modes;             /* List of imaginary modes */
-
-  float *wavenumbers;          /* rotational and translational DoF are
-                                 * included, but can be removed due to
-                                 * their zero frequencies */
-  float *intensities;          /* Intensities of spectral lines */
-
-  float *normal_modes;         /* the normal modes themselves */
-
-  int nproc;                    /* Number processors used */
-  int memory;                   /* Amount of memory used in MBytes */
-
-  int have_wavefunction; /** TRUE/FALSE flag indicating if we should
-                          *  try searching for wavefunction data.
-                          *  Gaussian needs IOP(6/7=3) to do this.
-                          *  if it is not set, we can save time searching.
-                          *  should help a lot with large log files... */
-
-  int have_basis;        /** TRUE/FALSE flag initially indicating if we 
-                          *  should try searching for basis set data.
-                          *  Gaussian needs GFINPUT to print the data in a 
-                          *  form that we can parse. If it is not set, we 
-                          *  can save time searching. Should help a lot 
-                          *  with large log files. If there is no basis in
-                          *  the log, we try reading the basis set from
-                          *  a local database. After initial parse it indicates
-                          *  whether basis set data is available.
-                          */
-
-  int have_cart_basis;   /** flag indicating if we have a cartesian
-                          *  basis set. this is additive.
-                          *  0 = none (can only visualize up to P)
-                          *  1 = have cartesian (6 instead of 5) d-functions)
-                          *  2 = have cartesian (10 instead of 7) f-functions)
-                          *  4 = have cartesian (XX instead of X) g-functions)
-                          *  basis transferred to VMD is always cartesian,
-                          *  so wavefunctions expanded in pure atomic orbitals
-                          *  will have to be converted.
-                          */
-
-  /* arrays with atom charges */
-  double *mulliken_charges; 
-  int   have_mulliken; 
-
-  int have_normal_modes; /** TRUE/FALSE flag indicating if we
-			  * could properly read normal modes,
-			  * wavenumbers and intensities. */
-
-  /******************************************************
-   * internal coordinate stuff
-   *****************************************************/
-
-  int have_internals;  /* TRUE/FALSE flag indicating if we
-                        * could properly read the internal
-                        * coordinates + internal hessian */
-
-  int have_cart_hessian; /* TRUE/FALSE flag indicating if the
-                          * cartesian Hessian matrix could
-                          * be read from the output file */
-
-  int nintcoords;    /* Number of internal coordinates */
-  int nbonds;        /* Number of bonds */
-  int nangles;       /* Number of angles */
-  int ndiheds;       /* Number of dihedrals */
-  int nimprops;      /* Number of impropers */
-
-  int *bonds;        /* bond list (atom tuples) */
-  int *angles;       /* angle list (atom triples) */
-  int *dihedrals;    /* dihedral list (atom quadrupels) */
-  int *impropers;    /* improper list (atom quadrupels) */
-
-  double *internal_coordinates; /* value of internal coordinates */ 
-  
-  /*******************************************************
-   * end internal coordinate stuff
-   *******************************************************/
-
-  double *carthessian;  /* Hessian matrix in cartesian coordinates,
-                         * dimension (3*numatoms)*(3*numatoms),
-                         * single array of floats 
-                         * (row(1),row(2),...,row(numatoms))
-                         */
-
-  double *inthessian;  /* Hessian matrix in internal coordinates,
-                        * dimension nintcoords*nintcoords,
-                        * single array of floats 
-                        * (row(1),row(2),...,row(nintcoords))
-                        */
-
-  /*********************************************************
-   * END OF NEW API data members
-   *********************************************************/
-
-  /* this array of floats stores the contraction coefficients
-   * and exponents for the basis functions:
-   * { exp(1), c-coeff(1), exp(2), c-coeff(2), .... }
-   * This holds also for double-zeta basis functions with
-   * exp(i) = exp(j) and c-coeff(i) != c-coeff(j). */
-  float *basis;
-
-  basis_atom_t *basis_set;
-
-  int num_basis_funcs;          /** total number of primitive basis functions */
-  int num_basis_atoms;          /** total number of atoms with basis functions */
-
-  /** atomic number per atom in basis set */
-  int *atomicnum_per_basisatom;
-
-  /** the total number of atomic shells */
-  int num_shells;
-  /** number of shells per atom i */
-  int *num_shells_per_atom;
-  /** number of primitives in shell i */
-  int *num_prim_per_shell;
-  /** symmetry type of each shell */
-  int *shell_symmetry; 
-
-  /** number of occupied spin alpha and beta orbitals */
-  int occ_orbitals_A;
-  int occ_orbitals_B;
-
-  /** Max. rank of the wave_function matrix.
-   * While the actual number of MOs present can be different
-   * for each frame, this is the maximum number of 
-   * possible occupied and virtual orbitals. */
-  int wavef_size;
-  int num_orbitals;      /* number of orbitals in file. can be less if pure WF. */
-
-  /** Array of length 3*num_wave_f containing the exponents 
-   *  describing the cartesian components of the angular momentum. 
-   *  E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}. */
-  int *angular_momentum;
-
-  /** this flag tells if the geometry search converged */
-  int converged;
-  int opt_status;
-
-  /* the structure qm_atom_t was defined to read in data from
-   * the Gaussian output file and store it temporarily;
-   * it is then copied into the VMD specific arrays at the
-   * appropriate point in time;
-   * this was partially implemented since the output file does
-   * not, e.g., contain the number of atoms per se. One rather
-   * has to count them by hand - at that point one could as 
-   * well already read in the initial coordinates, atom types ...
-   * which is not really supported by the way the VMD provided
-   * function are arranged....this implementation could of
-   * course be changed later..... */
-  qm_atom_t *initatoms;
-
-  /** initial cell info (in cpmd notation)":
-   * a, b/a, c/a, cos(alpha), cos(beta), cos(gamma) */
-  float initcell[6];
-
-  /** per timestep data like wavefunctions and scf iterations */
-  qm_timestep_t *qm_timestep;
-
-  /** number of trajectory points; single point corresponds to 1 */
-  int num_frames;
-  int num_frames_sent;
-  int num_frames_read;
-
-  int end_of_trajectory;
-
-} gaussiandata;
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/graspplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/graspplugin.C
deleted file mode 100644
index e907be556c119db2918f37059e48baef7fd1ee0e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/graspplugin.C
+++ /dev/null
@@ -1,520 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: graspplugin.C,v $
- *      $Author: johns $       $:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Reader for GRASP binary surface files
- * The file format is briefly described at these two sites:
- *   http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.1
- *   http://www.msg.ucsf.edu/local/programs/grasp/html/Appendix%20A.html
- */
-
-//Modified by Biol. Angel H. Jiménez Pardo and Luis Rosales Leòn
-//Visualisation Department
-//DGSCA
-//Universidad Nacional Autònoma de Mèxico UNAM
-//2006
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-/// Define variables by the name of Grasp property  
-
-#define POTENTIALS    1
-#define CURVATURES    2
-#define DISTANCES     4
-#define PROPERTY_1    8
-#define PROPERTY_2   16
-#define VERTEXCOLOR  32
-#define GLOBALCOLOR  64
-
-/// Define other variables
-typedef float COLOUR [3]; 
-typedef float COLOUR [3];
-typedef unsigned int SHORTWORD;
-typedef float VECTOR [3];
-
-/// Grasp structure
-typedef struct {
-  SHORTWORD flag, nvert;
-  COLOUR clo, cmd, chi, colors;
-  VECTOR range;
-} GRASSP;
-
-/// plugin data handle
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} grasp_t;
-
-
-/// Sets colour
-void Set_Colour(float *c, float r, float g, float b) {
-  *(c+0)=r;
-  *(c+1)=g;
-  *(c+2)=b;
-} //Set_Colour end
-
-
-/// Combines colour
-void ClinComb2(float c[], float k1, float c1[], float k2, float c2[]) {
-  (c)[0]=(k1)*(c1)[0] + (k2)*(c2)[0];
-  (c)[1]=(k1)*(c1)[1] + (k2)*(c2)[1];
-  (c)[2]=(k1)*(c1)[2] + (k2)*(c2)[2];
-} //ClinComb2 end
-
-
-/// Gets properties
-void Get_Property_Values(GRASSP *grassp, float *properties, float *colores, int nvert) {
-  long  i;
-  const char *name[] = {"potential","curvature","distance","property1","property2"};
-  SHORTWORD  index;
-  int k=0, j=0;
-  float  val, weight, min, mid, max, midmin, maxmid;
-  val = weight = min = mid = max = midmin = maxmid = 0.0;
-
-  //Range values
-  grassp->range[0]=-1000.0;
-  grassp->range[1]= 0.0;
-  grassp->range[2]= 1000.0;
-
-  ///Checks
-  index = (SHORTWORD)( (log((double) grassp->flag) / log(2.0)) + 0.5 );
-
-  ///ojo aqui le quite el  !
-  if ((grassp->flag)!=POTENTIALS) {
-    if (index <= 4)
-      printf("graspplugin) No data available for '%s' option\n", name[index]);
-    else 
-      printf("graspplugin) out of range property, flag: %d index: %d\n", grassp->flag, index);
-    printf("graspplugin) Will use white color instead\n");
-    grassp->flag = GLOBALCOLOR;
-    Set_Colour(grassp->clo, 1, 1, 1);
-  } else {
-    printf("graspplugin) Getting %s values.\n", name[index]);
-  }
-
-  /// init max values 
-  max=  0.01;  /* should be > 0 */
-  min= -0.01;  /* should be < 0 */
-
-  // Get values
-  for(i=0; i < nvert; i++) {
-    if (properties[i] < min)
-      min= properties[i];
-    else if(properties[i] > max)
-      max= properties[i];
-  }
-
-  // cut properties that are out of specified range
-  if (min < grassp->range[0] || max > grassp->range[2]) {
-    for(i=0; i < nvert; i++) {
-      if(properties[i] < grassp->range[0])
-        properties[i]= grassp->range[0];
-      else if(properties[i] > grassp->range[2])
-        properties[i]= grassp->range[2];
-    }
-  } else {
-    // or reset range
-    grassp->range[0] = min;
-    grassp->range[2] = max;
-  }
-
-  // check mid value 
-  if (grassp->range[1] <= grassp->range[0] || 
-      grassp->range[1] >= grassp->range[2])
-   grassp->range[1] = (grassp->range[0] + grassp->range[2]) / 2;
-
-  printf("graspplugin) Computing colors for range %g,%g,%g\n", 
-         grassp->range[0], grassp->range[1], grassp->range[2]);
-
-  // Prepare color interpolation parameters
-  min = grassp->range[0];
-  mid = grassp->range[1];
-  max = grassp->range[2];
-  midmin = mid-min;
-  maxmid = max-mid;
-
-  // Create color for each vertex and copies to a vector
-  k=0;
-  for (i=0; i < nvert; i++) {
-    val = properties[i];
-    if (val <= mid) {
-      weight = (midmin) ? (val-min)/midmin : 0;  
-      ClinComb2(grassp->colors, 1-weight, grassp->clo, weight, grassp->cmd);
-      for(j=0; j<=2; j++) {
-        *(colores+k)=grassp->colors[j];
-        k++;
-      }
-    } else {
-      weight = (maxmid) ? (val-mid)/maxmid : 0;
-      ClinComb2(grassp->colors, 1-weight, grassp->cmd, weight, grassp->chi);
-      for (j=0; j<=2; j++) {
-        *(colores+k)=grassp->colors[j];
-        k++;
-      }       
-    }
-    // clean up 
-  }
-} // Get_Property_Values end
-
-
-/// Reads line3
-void line3 (FILE * infile, GRASSP * grassp) {
-  char line3 [81];
-  fread(line3, 1, 80, infile);
-
-  grassp->flag=0;
-  int i=0;
-  if (line3 [0]==',') i++;
-  while (i<80 && line3[i]!=' ') {
-#if 0
-    // XXX the rest of the code doesn't properly process flags yet, so
-    // there's no point in setting them currently.
-    if(!strncmp(line3+i, "potentials", 10))   grassp->flag |= POTENTIALS;
-    if(!strncmp(line3+i, "curvature",   9))   grassp->flag |= CURVATURES;
-    if(!strncmp(line3+i, "distances",   9))   grassp->flag |= DISTANCES;
-    if(!strncmp(line3+i, "gproperty",   9))   grassp->flag |= PROPERTY_1;
-    if(!strncmp(line3+i, "g2property", 10))   grassp->flag |= PROPERTY_2;
-    if(!strncmp(line3+i, "vertexcolor",11))   grassp->flag |= VERTEXCOLOR;
-#endif
-    i++;
-  }
-
-  // Assign default property colors
-  if (grassp->flag > 0 && grassp->flag < VERTEXCOLOR) {
-    switch (grassp->flag ) {
-      case POTENTIALS:
-        Set_Colour(grassp->clo, 1.0, 0.0, 0.0 );
-        Set_Colour(grassp->cmd, 1.0, 1.0, 1.0 );
-        Set_Colour(grassp->chi, 0.0, 0.0, 1.0 );
-        break;
-
-      case CURVATURES:
-        Set_Colour(grassp->clo, 0.5, 0.5, 0.5 );
-        Set_Colour(grassp->cmd, 1.0, 1.0, 1.0 );
-        Set_Colour(grassp->chi, 0.0, 1.0, 0.0 );
-        break;
-
-     case DISTANCES:
-       Set_Colour(grassp->clo, 1.0, 1.0, 1.0 );
-       Set_Colour(grassp->cmd, 0.0, 0.0, 1.0 );
-       Set_Colour(grassp->chi, 1.0, 0.0, 0.0 );
-       break;
-
-     default: // Global color
-       Set_Colour(grassp->clo, 1.0, 0.0, 0.0 );
-       Set_Colour(grassp->cmd, 0.5, 0.0, 0.5 );
-       Set_Colour(grassp->chi, 0.0, 0.0, 1.0 );
-       break;
-   }
- }
-
- if (!grassp->flag)
-   grassp->flag = GLOBALCOLOR; 
-} //line3 end
-
-
-// check endianness
-static int is_little_endian(void) {
-  int x=1;
-  return *((char *)&x);
-}   
-
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  grasp_t *grasp;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-  grasp = new grasp_t;
-  grasp->fd = fd;
-  grasp->graphics = NULL;
-  *natoms = 0;
-  return grasp;
-}
-
-
-static int read_rawgraphics(void *v, int *nelem, 
-    const molfile_graphics_t **data) {
-  grasp_t *grasp = (grasp_t *)v;
-  FILE *infile = grasp->fd;
-
-  // Reverse engineering is your friend, and combined with FORTRAN code, voila!
-  // od -c shows the header starts off:
-  // \0  \0  \0   P   f   o   r   m   a   t   =   2
-  // and according to ungrasp, this is a 1 for grasp versions 1.0
-  // and 1.1, and 2 for grasp version 1.2
-  // Also, the header lines are of length 80 characters + 4 header chars
-  // + 4 trailer chars
-  // The 4 bytes at the beginning/end are standard Fortran array trash
-
-  /// Pointers grassp type
-  GRASSP datax;
-   
-  char trash[4];
-#define TRASH fread(trash, 4, 1, infile)
-  char line[81];
-
-  // FIRST LINE OF HEADER; contains format type
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  // make sure it says 'format='
-  if (strncmp(line, "format=", 7) != 0) {
-    printf("graspplugin) First characters of file don't look like a GRASP file\n");
-    return MOLFILE_ERROR;
-  }
-  TRASH;
-
-  // next char should be a 0 or 1
-  char gfiletype = line[7];
-  if (gfiletype == '1') {
-    gfiletype = 1;
-  } else if (gfiletype == '2') {
-    gfiletype = 2;
-  } else {
-    printf("graspplugin) GRASP file is in format %c, but only '1' or '2' is supported\n", gfiletype);
-    return MOLFILE_ERROR;
-  }
-
-  // SECOND LINE: contains "vertices,accessibles,normals,triangles"
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  TRASH;
-
-  // THIRD LINE: contains (0 or more of)?
-  //  "potentials,curvature,distances,gproperty,g2property,vertexcolor
-  TRASH; 
-  line3(infile, &datax);/// Reads line 3
-  TRASH;
-
-  // FOURTH LINE stores vertices, triangles, gridsize, lattice spacing
-  int nvert, ntriangles, gridsize;
-  float lattice;
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  TRASH;
-  sscanf(line, "%d%d%d%f", &nvert, &ntriangles, &gridsize, &lattice);
-
-  /// Stores color
-  float *colores = new float [3*nvert];
-
-  // FIFTH LINE stores the center (x,y,z) position
-  float center[3];
-  TRASH; 
-  fread(line, 1, 80, infile); 
-  TRASH;
-  sscanf(line, "%f%f%f", center, center+1, center+2);
-
-  float *vertex = new float[3 * nvert];
-  float *access = new float[3 * nvert];
-  float *normal = new float[3 * nvert];
-  int *triangle = new int[3 * ntriangles];
-  float *properties = new float[3* nvert];
-
-  if (!vertex || !access || !normal || !triangle || !properties) {
-    delete [] vertex;
-    delete [] access;
-    delete [] normal;
-    delete [] triangle;
-    delete [] properties;
-    printf("graspplugin) Failed vertex/access/normal/triangle allocations.\n");
-    return MOLFILE_ERROR;
-  }
-
-  // ungrasp says:
-  //    if (filetype.eq.1) then integer*2
-  //    if (filetype.eq.2) then integer*4
-
-  // And read them in.  Who needs error checking?
-  TRASH; 
-  fread(vertex, 3 * sizeof(float), nvert, infile); 
-  TRASH;
-  TRASH; 
-  fread(access, 3 * sizeof(float), nvert, infile); 
-  TRASH;
-  TRASH; 
-  fread(normal, 3 * sizeof(float), nvert, infile); 
-  TRASH;
- 
-  if (is_little_endian()) {
-    swap4_aligned(vertex, 3*nvert);
-    swap4_aligned(access, 3*nvert);
-    swap4_aligned(normal, 3*nvert);
-  }
-
-  if (gfiletype == 2) {
-    TRASH; 
-    fread(triangle, 3 * sizeof(int), ntriangles, infile); 
-    TRASH;
-    TRASH;
-    fread(properties, 3 * sizeof(float), nvert, infile);
-    if (is_little_endian()) {
-      swap4_aligned(triangle, 3*ntriangles);
-      swap4_aligned(properties, 3*nvert);
-    }
-  } else {
-#if 1
-    int i;
-    short *striangle = new short[3 * ntriangles];
-    if (!striangle) {
-      delete [] vertex;
-      delete [] access;
-      delete [] normal;
-      delete [] triangle;
-      delete [] properties;
-      printf("graspplugin) Failed short triangle allocation.\n");
-      return MOLFILE_ERROR;
-    }
-
-    TRASH;
-    fread(striangle, sizeof(short), 3 * ntriangles, infile);
-    TRASH;
-    TRASH;
-    fread(properties, sizeof(float), 3 * nvert, infile);
-    
-    if (is_little_endian()) {
-    swap2_aligned(striangle, 3 * ntriangles);
-    swap4_aligned(properties, 3*nvert);}
-    
-    for (i=0; i<3*ntriangles; i++) {
-      triangle[i] = striangle[i];
-    }
-    delete [] striangle;  
-    
-#else
-    // do it the slow way (converting from short to int)
-    int i;
-    short tmp[3];
-    TRASH;
-    for (i=0; i<ntriangles; i++) {
-      fread(tmp, sizeof(short), 3, infile);
-      if (is_little_endian()) swap2_aligned(tmp, 3);
-      triangle[3*i+0] = tmp[0];
-      triangle[3*i+1] = tmp[1];
-      triangle[3*i+2] = tmp[2];
-    }
-    TRASH;
-    TRASH;
-    fread(properties, sizeof(float), 3 * nvert, infile);
-      if (is_little_endian())
-      swap4_aligned(properties, 3*nvert);
-
-#endif
-  }   
-  
-  /// Gets properties:  potentials, curvature, distances, gproperty, g2property or vertexcolor 
-  Get_Property_Values(&datax, properties, colores, nvert);
-  
-  // And draw things
-  grasp->graphics = new molfile_graphics_t[3*ntriangles];
-  int vert1, vert2, vert3;
-
-  for (int tri_count = 0; tri_count < ntriangles; tri_count++) {
-    vert1 = triangle[3*tri_count+0] - 1;  // from 1-based FORTRAN
-    vert2 = triangle[3*tri_count+1] - 1;  // to 0-based C++
-    vert3 = triangle[3*tri_count+2] - 1;
-
-    if (vert1 <      0 || vert2 <      0 || vert3 <      0 ||
-        vert1 >= nvert || vert2 >= nvert || vert3 >= nvert) {
-      printf("graspplugin) Error, out-of-range vertex index, aborting.\n"); 
-      delete [] vertex;
-      delete [] access;
-      delete [] normal;
-      delete [] triangle;
-      delete [] properties;
-      return MOLFILE_ERROR;
-    }
-
-    grasp->graphics[2*tri_count  ].type = MOLFILE_TRINORM;
-    grasp->graphics[2*tri_count+1].type = MOLFILE_NORMS;
-    grasp->graphics[2*tri_count+2].type = MOLFILE_COLOR;
-    
-    float *tridata =  grasp->graphics[2*tri_count  ].data;
-    float *normdata = grasp->graphics[2*tri_count+1].data;
-    float *colordata = grasp->graphics[2*tri_count+2].data;
-        
-    memcpy(tridata  , vertex+3*vert1, 3*sizeof(float));
-    memcpy(tridata+3, vertex+3*vert2, 3*sizeof(float));
-    memcpy(tridata+6, vertex+3*vert3, 3*sizeof(float));
-    
-    memcpy(normdata  , normal+3*vert1, 3*sizeof(float));
-    memcpy(normdata+3, normal+3*vert2, 3*sizeof(float));
-    memcpy(normdata+6, normal+3*vert3, 3*sizeof(float));
-    
-    memcpy(colordata  , properties+3*vert1, 3*sizeof(float));
-    memcpy(colordata+3, properties+3*vert2, 3*sizeof(float));
-    memcpy(colordata+6, properties+3*vert3, 3*sizeof(float));
-  } 
-
-  *nelem = 2*ntriangles;
-  *data = grasp->graphics;
-
-  delete [] triangle;
-  delete [] normal;
-  delete [] access;
-  delete [] vertex;
-  delete [] properties;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  grasp_t *grasp = (grasp_t *)v;
-  fclose(grasp->fd);
-  delete [] grasp->graphics;
-  delete grasp;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "grasp";
-  plugin.prettyname = "GRASP";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 8;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "srf,SRF,grasp";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/grdplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/grdplugin.C
deleted file mode 100644
index 5732a03ceb8553633ce982b0a0dc22d36ea89b02..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/grdplugin.C
+++ /dev/null
@@ -1,271 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: grdplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.17 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * "unformatted" binary potential map, as used by Grasp and DelPhi
- *
- * Format (fortran): 
- * character*20 uplbl
- * character*10 nxtlbl,character*60 toplbl
- * real*4 phi(n,n,n)
- * character*16 botlbl
- * real*4 scale,oldmid(3)
- *
- * Where n is the length in grid units of each edge of the grid.
- *
- * More information can be found at:
- * <http://honiglab.cpmc.columbia.edu/grasp/grasp_contents.html#A.2>
- * <http://trantor.bioc.columbia.edu/delphi/doc/file_format.html>
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int ndata;
-  int swap;
-  molfile_volumetric_t *vol;
-} grd_t;
-
-
-static void *open_grd_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  grd_t *grd;
-  char uplbl[21], nxtlbl[11], toplbl[61];
-  int swap, recordSize, gridSize, iGrid;
-  float scale, midX, midY, midZ;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "grdplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Check byte order. The first four bytes of the file always make up the
-   * integer 20.
-   */
-  if (fread(&recordSize, 4, 1, fd) != 1) {
-    fprintf(stderr, "grdplugin) Error reading file header: uplbl.\n");
-    return NULL;
-  }
-  if (recordSize == 20) {
-    swap = 0;
-  }
-  else {
-    swap4_aligned(&recordSize, 1);
-    if (recordSize == 20) {
-      swap = 1;
-    }
-    else {
-      fprintf(stderr, "grdplugin) Improperly formatted file header: uplbl.\n");
-      return NULL;
-    }
-  }
-  
-  /* Check for a valid phimap 
-   * XXX - Some programs write gibberish for this record, don't worry about
-   * its contents
-   * character*20 uplbl
-   */
-  if ( (fread(uplbl, 1, 20, fd) != 20) ||
-       (fread(&recordSize, 4, 1, fd) != 1) ) {
-    fprintf(stderr, "grdplugin) Error: uplbl does not match.\n");
-    return NULL;
-  }
-
-  /* Read in the next record:
-   * character*10 nxtlbl, character*60 toplbl 
-   * The labels themselves are currently ignored, but they may be useful in
-   * the future.
-   */ 
-  if (fread(&recordSize, 4, 1, fd) != 1) {
-    fprintf(stderr, "grdplugin) Error reading file header: nxtlbl.\n");
-    return NULL;
-  }
-  if (swap) {
-    swap4_aligned(&recordSize, 1);
-  }
-  if (recordSize != 70) {
-    fprintf(stderr, "grdplugin) Improperly formatted file header: nxtlbl.\n");
-    return NULL;
-  }
-  if ( (fread(nxtlbl, 1, 10, fd) != 10) ||
-       (fread(toplbl, 1, 60, fd) != 60) ||
-       (fread(&recordSize, 4, 1, fd) != 1) ) {
-    fprintf(stderr, "grdplugin) Error reading nxtlbl.\n");
-    return NULL;
-  }
-  
-  /* Find the number of data points in the file
-   * The next integer gives the number of bytes used to store the data.
-   */
-  if (fread(&recordSize, 4, 1, fd) != 1) {
-    fprintf(stderr, "grdplugin) Error reading file header: grid.\n");
-    return NULL;
-  }
-  if (swap) {
-    swap4_aligned(&recordSize, 1);
-  }
-  iGrid = recordSize / 4;
-
-  /* Find the length in grid units of the edge of the cube, make sure it's
-   * an integer 
-   */
-  gridSize = (int) (pow((double) iGrid, (double) 1.0/3.0) + 0.5);
-  if ((gridSize*gridSize*gridSize) != iGrid) {
-    fprintf(stderr, "grdplugin) Error: non-cube grid.\n");
-    return NULL;
-  }
-
-  /* Read the scale and midpoint coordinates from the end of the file.
-   */
-  if ( (fseek(fd, -20, SEEK_END) != 0) ||
-       (fread(&scale, sizeof(float), 1, fd) != 1) ||
-       (fread(&midX, sizeof(float), 1, fd) != 1) ||
-       (fread(&midY, sizeof(float), 1, fd) != 1) ||
-       (fread(&midZ, sizeof(float), 1, fd) != 1) ) {
-    fprintf(stderr, "grdplugin) Error reading scale and midpoint.\n");
-    return NULL;
-  }
-  if (swap) {
-    swap4_aligned(&scale, 1);
-    swap4_aligned(&midX, 1);
-    swap4_aligned(&midY, 1);
-    swap4_aligned(&midZ, 1);
-  }
-
-  /* Allocate and initialize the grd structure */
-  grd = new grd_t;
-  grd->fd = fd;
-  grd->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  grd->nsets = 1; /* this file contains only one data set */
-  grd->ndata = iGrid;
-  grd->swap = swap;
-
-  grd->vol = new molfile_volumetric_t[1];
-  strcpy(grd->vol[0].dataname, "PHIMAP Electron Density Map");
-
-  /* <midX, midY, midZ> is the middle point of the grid. */
-  grd->vol[0].origin[0] = -0.5*(gridSize+1.0) / scale + midX;
-  grd->vol[0].origin[1] = -0.5*(gridSize+1.0) / scale + midY;
-  grd->vol[0].origin[2] = -0.5*(gridSize+1.0) / scale + midZ;
-
-  grd->vol[0].xaxis[0] = gridSize / scale;
-  grd->vol[0].xaxis[1] = 0;
-  grd->vol[0].xaxis[2] = 0;
-
-  grd->vol[0].yaxis[0] = 0;
-  grd->vol[0].yaxis[1] = gridSize / scale;
-  grd->vol[0].yaxis[2] = 0;
-
-  grd->vol[0].zaxis[0] = 0;
-  grd->vol[0].zaxis[1] = 0;
-  grd->vol[0].zaxis[2] = gridSize / scale;
-
-  grd->vol[0].xsize = gridSize;
-  grd->vol[0].ysize = gridSize;
-  grd->vol[0].zsize = gridSize;
-
-  grd->vol[0].has_color = 0;
-
-  return grd;
-}
-
-static int read_grd_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  grd_t *grd = (grd_t *)v;
-  *nsets = grd->nsets; 
-  *metadata = grd->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_grd_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  grd_t *grd = (grd_t *)v;
-  int ndata = grd->ndata;
-  FILE *fd = grd->fd;
-
-  /* Skip the header */
-  fseek(fd, 110, SEEK_SET);
-
-  /* Read the densities. Order for file is x fast, y medium, z slow */
-  if (fread(datablock, sizeof(float), ndata, fd) != (unsigned int) ndata) {
-    fprintf(stderr, "grdplugin) Error reading grid data.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (grd->swap) {
-    swap4_aligned(datablock, ndata);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_grd_read(void *v) {
-  grd_t *grd = (grd_t *)v;
-
-  fclose(grd->fd);
-  if (grd->vol != NULL)
-    delete [] grd->vol; 
-  delete grd;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "grd";
-  plugin.prettyname = "GRASP,Delphi Binary Potential Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "phi,grd";
-  plugin.open_file_read = open_grd_read;
-  plugin.read_volumetric_metadata = read_grd_metadata;
-  plugin.read_volumetric_data = read_grd_data;
-  plugin.close_file_read = close_grd_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gridplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gridplugin.C
deleted file mode 100644
index fd1d9532c13ec772763400d898d7f1d53800dc42..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gridplugin.C
+++ /dev/null
@@ -1,234 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gridplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.15 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Binary potential map format used by Molecular Discovery GRID, 
- * UHBD, and other packages.
- *
- * Files begin with a 160-byte formatted fortran header.
- * For each plane in the grid, there is a 12-byte formatted fortran record
- * giving the grid coordinates, followed by a nx*ny*4 byte formatted fortran
- * record with the grid data.
- *
- * The header has the following format (addresses in bytes):
- * header[0..71]:     char * 72, grid title
- * header[72..79]:    float * 2, grid clearance and cutoff energy (unused by
- *                    VMD)
- * header[80..99]:    unknown
- * header[100..111]:  int * 3, number of planes in each direction
- * header[112..127]:  float * 4, grid spacing in angstroms, followed by grid
- *                    origin
- * header[128..151]:  float * 6, VDW radius, neff, alph, q, emin, rmin
- *                    (unused by VMD)
- * header[152..159]:  int * 2, jd, ja (unused by VMD)
- *
- * XXX - Not sure if slicing order is the same in every file. Also, other
- * values from plane metadata seem to have no use -- I'm probably missing
- * something. 
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-#include "fortread.h"
-
-typedef struct {
-  FILE *fd;
-  int swap;
-  molfile_volumetric_t *vol;
-} grid_t;
-
-
-static void *open_grid_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  grid_t *grid;
-  float header[64], ra, rx, ry, rz;
-  int dataBegin, swap, blocksize, nnx, nny, nnz;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "gridplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // Use the first four-byte integer in the file to determine the file's
-  // byte-order
-  fread(&dataBegin, sizeof(int), 1, fd);
-  if ( (dataBegin > 255) || (dataBegin < 0) ) {
-    // check if the bytes need to be swapped
-    swap4_aligned(&dataBegin, 1);
-    if (dataBegin <= 255) {
-      swap = 1;
-    } else {
-      fprintf(stderr, "gridplugin) Cannot read file: header block is too large.\n");
-      return NULL;
-    }
-  }
-  else {
-    swap = 0;
-  }
-
-  // Read the header
-  rewind(fd);
-  blocksize = fortread_4(header, 64, swap, fd);
-
-  if (blocksize != 40) {
-    fprintf(stderr, "gridplugin) Incorrect header size.\n");
-    return NULL;
-  }
-
-  // number of planes in each dimension
-  nnx = ((int *)header)[25];
-  nny = ((int *)header)[26];
-  nnz = ((int *)header)[27];
-
-  // grid spacing in angstroms
-  ra = header[28];
-
-  // reference point for grid position
-  rx = header[29];
-  ry = header[30];
-  rz = header[31];
-
-  // Allocate and initialize the structure 
-  grid = new grid_t;
-  grid->fd = fd;
-  grid->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  grid->swap = swap;
-
-  grid->vol = new molfile_volumetric_t[1];
-  strcpy(grid->vol[0].dataname, "GRID Electron Density Map");
-
-  // XXX - origin seems to be shifted by one grid point in each direction
-  // from the reference point. 
-  grid->vol[0].origin[0] = rx + ra;
-  grid->vol[0].origin[1] = ry + ra;
-  grid->vol[0].origin[2] = rz + ra;
-
-  grid->vol[0].xaxis[0] = nnx * ra;
-  grid->vol[0].xaxis[1] = 0;
-  grid->vol[0].xaxis[2] = 0;
-
-  grid->vol[0].yaxis[0] = 0;
-  grid->vol[0].yaxis[1] = nny * ra;
-  grid->vol[0].yaxis[2] = 0;
-
-  grid->vol[0].zaxis[0] = 0;
-  grid->vol[0].zaxis[1] = 0;
-  grid->vol[0].zaxis[2] = nnz * ra;
-
-  grid->vol[0].xsize = nnx;
-  grid->vol[0].ysize = nny;
-  grid->vol[0].zsize = nnz;
-
-  grid->vol[0].has_color = 0;   // This file has no color
-
-  return grid;
-}
-
-static int read_grid_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  grid_t *grid = (grid_t *)v;
-  *nsets = 1;                   // This file contains only one data set.
-  *metadata = grid->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_grid_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  grid_t *grid = (grid_t *)v;
-  int planeHeader[3], planeSize, i, z;
-  float *planeData;
-
-  planeSize = grid->vol[0].xsize * grid->vol[0].ysize;
-
-  planeData = new float[planeSize];
-
-  for (i = 0; i < grid->vol[0].zsize; i++) {
-    // read the plane metadata
-    if (fortread_4(planeHeader, 3, grid->swap, grid->fd) != 3) {
-      fprintf(stderr, "gridplugin) Error reading plane metadata.\n");
-      delete [] planeData;
-      return MOLFILE_ERROR;
-    }
-    z = planeHeader[0] - 1;
-
-    // read the plane data
-    if (fortread_4(planeData, planeSize, grid->swap, grid->fd) != planeSize) {
-      fprintf(stderr, "gridplugin) Error reading plane data.\n");
-      delete [] planeData;
-      return MOLFILE_ERROR;
-    }
-
-    // copy the plane data to the datablock
-    memcpy(datablock + z*planeSize, planeData, planeSize * sizeof(float));
-  }
-
-  delete [] planeData;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_grid_read(void *v) {
-  grid_t *grid = (grid_t *)v;
-
-  fclose(grid->fd);
-  if (grid->vol != NULL)
-    delete [] grid->vol; 
-  delete grid;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "grid";
-  plugin.prettyname = "GRID,UHBD Binary Potential Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "grid";
-  plugin.open_file_read = open_grid_read;
-  plugin.read_volumetric_metadata = read_grid_metadata;
-  plugin.read_volumetric_data = read_grid_data;
-  plugin.close_file_read = close_grid_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gromacsplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gromacsplugin.C
deleted file mode 100644
index f4a9e8c7bfe4be7e4f1895460bd1e6e72b28f88e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/gromacsplugin.C
+++ /dev/null
@@ -1,808 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: gromacsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.52 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "Gromacs.h"
-#include "molfile_plugin.h"
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#ifndef M_PI
-#define M_PI           3.14159265358979323846
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-typedef struct {
-  md_file *mf;
-  int natoms;
-  int step;
-  float timeval;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-} gmxdata;
-
-static void convert_vmd_box_for_writing(const molfile_timestep_t *ts, float *x, float *y, float *z)
-{
-//     const float sa = sin((double)ts->alpha/180.0*M_PI);
-    const float ca = cos((double)ts->alpha/180.0*M_PI);
-    const float cb = cos((double)ts->beta/180.0*M_PI);
-    const float cg = cos((double)ts->gamma/180.0*M_PI);
-    const float sg = sin((double)ts->gamma/180.0*M_PI);
-
-    x[0] = ts->A / ANGS_PER_NM;
-    y[0] = 0.0;
-    z[0] = 0.0;
-    x[1] = ts->B*cg / ANGS_PER_NM; // ts->B*ca when writing trr?!
-    y[1] = ts->B*sg / ANGS_PER_NM; // ts->B*sa when writing trr?!
-    z[1] = 0.0;
-    x[2] = ts->C*cb / ANGS_PER_NM;
-    y[2] = (ts->C / ANGS_PER_NM)*(ca - cb*cg)/sg;
-    z[2] = (ts->C / ANGS_PER_NM)*sqrt((double)(1.0 + 2.0*ca*cb*cg
-                               - ca*ca - cb*cb - cg*cg)/(1.0 - cg*cg));
-}
-
-static void *open_gro_read(const char *filename, const char *,
-    int *natoms) {
-
-    md_file *mf;
-    md_header mdh;
-    gmxdata *gmx;
-
-    mf = mdio_open(filename, MDFMT_GRO);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-
-    // read in the header data (careful not to rewind!)
-    if (gro_header(mf, mdh.title, MAX_MDIO_TITLE,
-    &mdh.timeval, &mdh.natoms, 0) < 0) {
-        fprintf(stderr, "gromacsplugin) Cannot read header fromm '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-            // XXX should free the file handle...
-        return NULL;
-    }
-    *natoms = mdh.natoms;
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = mdh.natoms;
-    gmx->meta = new molfile_metadata_t;
-    memset(gmx->meta,0,sizeof(molfile_metadata_t));
-    strncpy(gmx->meta->title, mdh.title, 80);
-    gmx->timeval = mdh.timeval;
-    return gmx;
-}
-
-static int read_gro_structure(void *mydata, int *optflags,
-    molfile_atom_t *atoms) {
-
-  md_atom ma;
-  char buf[MAX_GRO_LINE + 1];
-  gmxdata *gmx = (gmxdata *)mydata;
-
-  *optflags = MOLFILE_NOOPTIONS; // no optional data
-
-  // read in each atom and add it into the molecule
-  for (int i = 0; i < gmx->natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    if (gro_rec(gmx->mf, &ma) < 0) {
-      fprintf(stderr, "gromacsplugin) Error reading atom %d from file, %s\n",
-              i+1, mdio_errmsg(mdio_errno()));
-      return MOLFILE_ERROR;
-    }
-    strcpy(atom->name, ma.atomname);
-    strcpy(atom->type, ma.atomname);
-    strcpy(atom->resname, ma.resname);
-    atom->resid = atoi(ma.resid);
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  if (mdio_readline(gmx->mf, buf, MAX_GRO_LINE + 1, 0) < 0) {
-    fprintf(stderr, "gromacsplugin) Warning, error reading box, %s\n",
-            mdio_errmsg(mdio_errno()));
-  }
-
-  rewind(gmx->mf->f);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_gro_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  gmxdata *gmx = (gmxdata *)v;
-  *metadata = gmx->meta;
-  return MOLFILE_SUCCESS;
-}
-
-static int read_gro_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  gmxdata *gmx = (gmxdata *)v;
-  md_ts mdts;
-  memset(&mdts, 0, sizeof(md_ts));
-  mdts.natoms = natoms;
-
-  if (mdio_timestep(gmx->mf, &mdts) < 0)
-    return MOLFILE_ERROR;
-  if (ts) {
-    memcpy(ts->coords, mdts.pos, 3 * sizeof(float) * gmx->natoms);
-    if (mdts.box) {
-      ts->A = mdts.box->A;
-      ts->B = mdts.box->B;
-      ts->C = mdts.box->C;
-      ts->alpha = mdts.box->alpha;
-      ts->beta = mdts.box->beta;
-      ts->gamma = mdts.box->gamma;
-    }
-  }
-  mdio_tsfree(&mdts);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_gro_read(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx->meta;
-  delete gmx;
-}
-
-// open file for writing
-static void *open_gro_write(const char *filename, const char *filetype,
-    int natoms) {
-
-    md_file *mf;
-    gmxdata *gmx;
-
-    mf = mdio_open(filename, MDFMT_GRO, MDIO_WRITE);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = natoms;
-    gmx->step   = 0;
-    gmx->meta = new molfile_metadata_t;
-    memset(gmx->meta,0,sizeof(molfile_metadata_t));
-    gmx->meta->title[0] = '\0';
-
-    return gmx;
-}
-
-static int write_gro_structure(void *v, int optflags,
-    const molfile_atom_t *atoms) {
-
-  gmxdata *gmx = (gmxdata *)v;
-  int natoms = gmx->natoms;
-  gmx->atomlist = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-  memcpy(gmx->atomlist, atoms, natoms*sizeof(molfile_atom_t));
-
-  return MOLFILE_SUCCESS;
-}
-
-static int write_gro_timestep(void *v, const molfile_timestep_t *ts) {
-  gmxdata *gmx = (gmxdata *)v;
-  const molfile_atom_t *atom;
-  const float *pos, *vel;
-  float x[3], y[3], z[3];
-  int i;
-
-  if (gmx->natoms == 0)
-    return MOLFILE_SUCCESS;
-
-  atom = gmx->atomlist;
-  pos = ts->coords;
-  vel = ts->velocities;
-
-  /* The title cannot be written */
-/*  fprintf(gmx->mf->f, "%s", gmx->meta->title);*/
-  /* Write a dummy title instead */
-  fprintf(gmx->mf->f, "generated by VMD");
-#if vmdplugin_ABIVERSION > 10
-  fprintf(gmx->mf->f, ", t= %f", ts->physical_time);
-#endif
-  fprintf(gmx->mf->f, "\n");
-
-  fprintf(gmx->mf->f, "%d\n", gmx->natoms);
-  for (i=0; i<gmx->natoms; i++)
-  {
-     fprintf(gmx->mf->f, "%5d%-5s%5s%5d%8.3f%8.3f%8.3f",
-             atom->resid, atom->resname, atom->name, i+1,
-             pos[0] / ANGS_PER_NM, pos[1] / ANGS_PER_NM, pos[2] / ANGS_PER_NM);
-     if(vel)
-     {
-         fprintf(gmx->mf->f, "%8.4f%8.4f%8.4f", vel[0] / ANGS_PER_NM, vel[1] / ANGS_PER_NM, vel[2] / ANGS_PER_NM);
-         vel += 3;
-     }
-     fprintf(gmx->mf->f, "\n");
-     ++atom;
-     pos += 3;
-  }
-  convert_vmd_box_for_writing(ts, x, y, z);
-  fprintf(gmx->mf->f, "%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n", x[0], y[1], z[2], y[0], z[0], x[1], z[1], x[2], y[2]);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_gro_write(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  free(gmx->atomlist);
-  delete gmx->meta;
-  delete gmx;
-}
-
-
-static void *open_g96_read(const char *filename, const char *,
-    int *natoms) {
-
-    md_file *mf;
-    md_header mdh;
-    char gbuf[MAX_G96_LINE + 1];
-
-    mf = mdio_open(filename, MDFMT_G96);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-
-        // read in the header data
-        if (g96_header(mf, mdh.title, MAX_MDIO_TITLE, &mdh.timeval) < 0) {
-            fprintf(stderr, "gromacsplugin) Cannot read header from '%s', %s\n",
-                    filename, mdio_errmsg(mdio_errno()));
-            return NULL;
-        }
-
-        // First, look for a timestep block
-        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0) {
-            fprintf(stderr, "gromacsplugin) Cannot read header from '%s', %s\n",
-                    filename, mdio_errmsg(mdio_errno()));
-            return NULL;
-        }
-        if (!strcasecmp(gbuf, "TIMESTEP")) {
-            // Read in the value line and the END line, and the next
-            if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0 ||
-                mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0 ||
-                mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0) {
-              fprintf(stderr, "gromacsplugin) Cannot read header from '%s', %s\n",
-                      filename, mdio_errmsg(mdio_errno()));
-              return NULL;
-            }
-        }
-        if (strcasecmp(gbuf, "POSITION") && strcasecmp(gbuf, "REFPOSITION")) {
-          fprintf(stderr, "gromacsplugin) No structure information in file %s\n", filename);
-          return NULL;
-        }
-        *natoms = g96_countatoms(mf);
-
-        gmxdata *gmx = new gmxdata;
-        memset(gmx,0,sizeof(gmxdata));
-        gmx->mf = mf;
-        gmx->natoms = *natoms; 
-        return gmx;
-}
-
-static int read_g96_structure(void *mydata, int *optflags,
-    molfile_atom_t *atoms) {
-
-    char gbuf[MAX_G96_LINE + 1];
-    gmxdata *gmx = (gmxdata *)mydata;
-    md_atom ma;
-    md_file *mf = gmx->mf;
-
-    *optflags = MOLFILE_NOOPTIONS; // no optional data
-
-        for (int i = 0; i < gmx->natoms; i++) {
-            molfile_atom_t *atom = atoms+i;
-            if (g96_rec(mf, &ma) < 0) {
-                fprintf(stderr, "gromacsplugin) Error reading atom %d from file, %s\n",
-                  i+1, mdio_errmsg(mdio_errno()));
-                return MOLFILE_ERROR;
-            }
-            strcpy(atom->name, ma.atomname);
-            strcpy(atom->type, ma.atomname);
-            strcpy(atom->resname, ma.resname);
-            atom->resid = atoi(ma.resid);
-            atom->chain[0] = '\0';
-            atom->segid[0] = '\0';
-        }
-
-        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0) {
-            fprintf(stderr, "gromacsplugin) Warning, error reading END record, %s\n",
-                mdio_errmsg(mdio_errno()));
-        }
-
-            // ... another problem: there may or may not be a VELOCITY
-            // block or a BOX block, so we need to read one line beyond
-            // the POSITION block to determine this. If neither VEL. nor
-            // BOX are present we've read a line too far and infringed
-            // on the next timestep, so we need to keep track of the
-            // position now for a possible fseek() later to backtrack.
-            long fpos = ftell(mf->f);
-
-            // Now we must read in the velocities and the box, if present
-            if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) >= 0) {
-
-                // Is there a velocity block present ?
-                if (!strcasecmp(gbuf, "VELOCITY") || !strcasecmp(gbuf, "VELOCITYRED")) {
-                        // Ignore all the coordinates - VMD doesn't use them
-                        for (;;) {
-                                if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                                        return MOLFILE_ERROR;
-                                if (!strcasecmp(gbuf, "END")) break;
-                        }
-
-                        // Again, record our position because we may need
-                        // to fseek here later if we read too far.
-                        fpos = ftell(mf->f);
-
-                        // Go ahead and read the next line.
-                        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                    return MOLFILE_ERROR;
-                }
-
-                // Is there a box present ?
-                if (!strcasecmp(gbuf, "BOX")) {
-                        // Ignore the box coordinates at this time.
-                        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                    return MOLFILE_ERROR;
-                        if (mdio_readline(mf, gbuf, MAX_G96_LINE + 1) < 0)
-                    return MOLFILE_ERROR;
-                        if (strcasecmp(gbuf, "END"))
-                    return MOLFILE_ERROR;
-                }
-                else {
-                        // We have read too far, so fseek back to the
-                        // last known safe position so we don't return
-                        // with the file pointer set infringing on the
-                        // next timestep data.
-                        fseek(mf->f, fpos, SEEK_SET);
-                }
-        }
-        else {
-            // Go ahead and rewind for good measure
-            fseek(mf->f, fpos, SEEK_SET);
-        }
-        rewind(mf->f);
-        return MOLFILE_SUCCESS;
-}
-
-static int read_g96_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-
-  gmxdata *gmx = (gmxdata *)v;
-  md_ts mdts;
-  memset(&mdts, 0, sizeof(md_ts));
-  mdts.natoms = natoms;
-
-  if (mdio_timestep(gmx->mf, &mdts) < 0)
-    return MOLFILE_ERROR;
-  if (ts) {
-    memcpy(ts->coords, mdts.pos, 3 * sizeof(float) * gmx->natoms);
-    if (mdts.box) {
-      ts->A = mdts.box->A;
-      ts->B = mdts.box->B;
-      ts->C = mdts.box->C;
-      ts->alpha = mdts.box->alpha;
-      ts->beta = mdts.box->beta;
-      ts->gamma = mdts.box->gamma;
-    }
-  }
-  mdio_tsfree(&mdts);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_g96_read(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx;
-}
-
-
-//
-// TRR and XTC files
-//
-
-static void *open_trr_read(const char *filename, const char *filetype,
-    int *natoms) {
-
-    md_file *mf;
-    md_header mdh;
-    gmxdata *gmx;
-    int format;
-
-    if (!strcmp(filetype, "trr"))
-      format = MDFMT_TRR;
-    else if (!strcmp(filetype, "trj"))
-      format = MDFMT_TRJ;
-    else if (!strcmp(filetype, "xtc"))
-      format = MDFMT_XTC;
-    else
-      return NULL;
-
-    mf = mdio_open(filename, format);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    if (mdio_header(mf, &mdh) < 0) {
-        mdio_close(mf);
-        fprintf(stderr, "gromacsplugin) Cannot read header fromm '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    *natoms = mdh.natoms;
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = mdh.natoms;
-    return gmx;
-}
-
-static int read_trr_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  gmxdata *gmx = (gmxdata *)v;
-  md_ts mdts;
-  memset(&mdts, 0, sizeof(md_ts));
-  mdts.natoms = natoms;
-
-  if (mdio_timestep(gmx->mf, &mdts) < 0) {
-    if (mdio_errno() == MDIO_EOF || mdio_errno() == MDIO_IOERROR) {
-      // XXX Lame, why does mdio treat IOERROR like EOF?
-      return MOLFILE_ERROR;
-    }
-    fprintf(stderr, "gromacsplugin) Error reading timestep, %s\n",
-            mdio_errmsg(mdio_errno()));
-    return MOLFILE_ERROR;
-  }
-  if (mdts.natoms != natoms) {
-    fprintf(stderr, "gromacsplugin) Timestep in file contains wrong number of atoms\n");
-    fprintf(stderr, "gromacsplugin) Found %d, expected %d\n", mdts.natoms, natoms);
-    mdio_tsfree(&mdts);
-    return MOLFILE_ERROR;
-  }
-
-  if (ts) {
-    memcpy(ts->coords, mdts.pos, 3 * sizeof(float) * gmx->natoms);
-    if (mdts.box) {
-      ts->A = mdts.box->A;
-      ts->B = mdts.box->B;
-      ts->C = mdts.box->C;
-      ts->alpha = mdts.box->alpha;
-      ts->beta = mdts.box->beta;
-      ts->gamma = mdts.box->gamma;
-    }
-  }
-  mdio_tsfree(&mdts);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_trr_read(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx;
-}
-
-// open file for writing
-static void *open_trr_write(const char *filename, const char *filetype,
-    int natoms) {
-
-    md_file *mf;
-    gmxdata *gmx;
-    int format;
-
-    if (!strcmp(filetype, "trr"))
-      format = MDFMT_TRR;
-    else if (!strcmp(filetype, "xtc"))
-      format = MDFMT_XTC;
-    else
-      return NULL;
-
-    mf = mdio_open(filename, format, MDIO_WRITE);
-    if (!mf) {
-        fprintf(stderr, "gromacsplugin) Cannot open file '%s', %s\n",
-                filename, mdio_errmsg(mdio_errno()));
-        return NULL;
-    }
-    gmx = new gmxdata;
-    memset(gmx,0,sizeof(gmxdata));
-    gmx->mf = mf;
-    gmx->natoms = natoms;
-    // set some parameters for the output stream:
-    // start at step 0, convert to big-endian, write single precision.
-    gmx->step   = 0;
-    gmx->mf->rev = host_is_little_endian();
-    gmx->mf->prec = sizeof(float);
-    return gmx;
-}
-
-// write a trr timestep. the file format has a header with each record
-static int write_trr_timestep(void *mydata, const molfile_timestep_t *ts)
-{
-  const float nm=0.1;
-
-  gmxdata *gmx = (gmxdata *)mydata;
-
-  // determine and write header from structure info.
-  // write trr header. XXX: move this to Gromacs.h ??
-  if (gmx->mf->fmt == MDFMT_TRR) {
-    int i;
-
-    if ( put_trx_int(gmx->mf, TRX_MAGIC)            // ID
-         || put_trx_string(gmx->mf, "GMX_trn_file") // version
-         || put_trx_int(gmx->mf, 0)                 // ir_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // e_size (ignored)
-         || put_trx_int(gmx->mf, 9*sizeof(float))   // box
-         || put_trx_int(gmx->mf, 0)                 // vir_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // pres_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // top_size (ignored)
-         || put_trx_int(gmx->mf, 0)                 // sym_size (ignored)
-         || put_trx_int(gmx->mf, 3*sizeof(float)*gmx->natoms) // coordinates
-         || put_trx_int(gmx->mf, 0)                 // no velocities
-         || put_trx_int(gmx->mf, 0)                 // no forces
-         || put_trx_int(gmx->mf, gmx->natoms)       // number of atoms
-         || put_trx_int(gmx->mf, gmx->step)         // current step number
-         || put_trx_int(gmx->mf, 0)                 // nre (ignored)
-         || put_trx_real(gmx->mf, 0.1*gmx->step)    // current time. (dummy value: 0.1)
-         || put_trx_real(gmx->mf, 0.0))             // current lambda
-      return MOLFILE_ERROR;
-
-    // set up box according to the VMD unitcell conventions.
-    // the a-vector is collinear with the x-axis and
-    // the b-vector is in the xy-plane.
-    const float sa = sin((double)ts->alpha/180.0*M_PI);
-    const float ca = cos((double)ts->alpha/180.0*M_PI);
-    const float cb = cos((double)ts->beta/180.0*M_PI);
-    const float cg = cos((double)ts->gamma/180.0*M_PI);
-    const float sg = sin((double)ts->gamma/180.0*M_PI);
-    float box[9];
-    box[0] = ts->A;    box[1] = 0.0;      box[2] = 0.0;
-    box[3] = ts->B*ca; box[4] = ts->B*sa; box[5] = 0.0;
-    box[6] = ts->C*cb; box[7] = ts->C*(ca - cb*cg)/sg;
-    box[8] = ts->C*sqrt((double)(1.0 + 2.0*ca*cb*cg
-                                 - ca*ca - cb*cb - cg*cg)/(1.0 - cg*cg));
-
-    for (i=0; i<9; ++i) {
-      if (put_trx_real(gmx->mf, box[i]*nm))
-        return MOLFILE_ERROR;
-    }
-#ifdef TEST_TRR_PLUGIN
-    fprintf(stderr, "gromacsplugin) box is:\n %f %f %f\n %f %f %f\n %f %f %f\n\n",
-            box[0], box[1], box[2], box[3], box[4], box[5], box[6], box[7], box[8]);
-#endif
-
-    // write coordinates
-    for (i=0; i<(3*gmx->natoms); ++i) {
-      if (put_trx_real(gmx->mf, ts->coords[i]*nm))
-        return MOLFILE_ERROR;
-    }
-  } else {
-    fprintf(stderr, "gromacsplugin) only .trr is supported for writing\n");
-    return MOLFILE_ERROR;
-  }
-
-  ++ gmx->step;
-  return MOLFILE_SUCCESS;
-  }
-
-
-static void close_trr_write(void *v) {
-  gmxdata *gmx = (gmxdata *)v;
-  mdio_close(gmx->mf);
-  delete gmx;
-}
-
-#define GROMACS_PLUGIN_MAJOR_VERSION 1
-#define GROMACS_PLUGIN_MINOR_VERSION 2 
-
-//
-// plugin registration stuff below
-//
-
-static molfile_plugin_t gro_plugin;
-static molfile_plugin_t g96_plugin;
-static molfile_plugin_t trr_plugin;
-static molfile_plugin_t xtc_plugin;
-static molfile_plugin_t trj_plugin;
-
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  // GRO plugin init
-  memset(&gro_plugin, 0, sizeof(molfile_plugin_t));
-  gro_plugin.abiversion = vmdplugin_ABIVERSION;
-  gro_plugin.type = MOLFILE_PLUGIN_TYPE;
-  gro_plugin.name = "gro";
-  gro_plugin.prettyname = "Gromacs GRO";
-  gro_plugin.author = "David Norris, Justin Gullingsrud, Magnus Lundborg";
-  gro_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  gro_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  gro_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  gro_plugin.filename_extension = "gro";
-  gro_plugin.open_file_read = open_gro_read;
-  gro_plugin.read_structure = read_gro_structure;
-  gro_plugin.read_next_timestep = read_gro_timestep;
-  gro_plugin.close_file_read = close_gro_read;
-  gro_plugin.open_file_write = open_gro_write;
-  gro_plugin.write_structure = write_gro_structure;
-  gro_plugin.write_timestep = write_gro_timestep;
-  gro_plugin.close_file_write = close_gro_write;
-  gro_plugin.read_molecule_metadata = read_gro_molecule_metadata;
-
-  // G96 plugin init
-  memset(&g96_plugin, 0, sizeof(molfile_plugin_t));
-  g96_plugin.abiversion = vmdplugin_ABIVERSION;
-  g96_plugin.type = MOLFILE_PLUGIN_TYPE;
-  g96_plugin.name = "g96";
-  g96_plugin.prettyname = "Gromacs g96";
-  g96_plugin.author = "David Norris, Justin Gullingsrud";
-  g96_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  g96_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  g96_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  g96_plugin.filename_extension = "g96";
-  g96_plugin.open_file_read = open_g96_read;
-  g96_plugin.read_structure = read_g96_structure;
-  g96_plugin.read_next_timestep = read_g96_timestep;
-  g96_plugin.close_file_read = close_g96_read;
-
-  // TRR plugin
-  memset(&trr_plugin, 0, sizeof(molfile_plugin_t));
-  trr_plugin.abiversion = vmdplugin_ABIVERSION;
-  trr_plugin.type = MOLFILE_PLUGIN_TYPE;
-  trr_plugin.name = "trr";
-  trr_plugin.prettyname = "Gromacs TRR Trajectory";
-  trr_plugin.author = "David Norris, Justin Gullingsrud, Axel Kohlmeyer";
-  trr_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  trr_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  trr_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  trr_plugin.filename_extension = "trr";
-  trr_plugin.open_file_read = open_trr_read;
-  trr_plugin.read_next_timestep = read_trr_timestep;
-  trr_plugin.close_file_read = close_trr_read;
-  trr_plugin.open_file_write = open_trr_write;
-  trr_plugin.write_timestep = write_trr_timestep;
-  trr_plugin.close_file_write = close_trr_write;
-
-  // XTC plugin 
-  memset(&xtc_plugin, 0, sizeof(molfile_plugin_t));
-  xtc_plugin.abiversion = vmdplugin_ABIVERSION;
-  xtc_plugin.type = MOLFILE_PLUGIN_TYPE;
-  xtc_plugin.name = "xtc";
-  xtc_plugin.prettyname = "Gromacs XTC Compressed Trajectory";
-  xtc_plugin.author = "David Norris, Justin Gullingsrud";
-  xtc_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  xtc_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  xtc_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  xtc_plugin.filename_extension = "xtc";
-  xtc_plugin.open_file_read = open_trr_read;
-  xtc_plugin.read_next_timestep = read_trr_timestep;
-  xtc_plugin.close_file_read = close_trr_read;
-
-  // TRJ plugin
-  memset(&trj_plugin, 0, sizeof(molfile_plugin_t));
-  trj_plugin.abiversion = vmdplugin_ABIVERSION;
-  trj_plugin.type = MOLFILE_PLUGIN_TYPE;
-  trj_plugin.name = "trj";
-  trj_plugin.prettyname = "Gromacs TRJ Trajectory";
-  trj_plugin.author = "David Norris, Justin Gullingsrud";
-  trj_plugin.majorv = GROMACS_PLUGIN_MAJOR_VERSION;
-  trj_plugin.minorv = GROMACS_PLUGIN_MINOR_VERSION;
-  trj_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  trj_plugin.filename_extension = "trj";
-  trj_plugin.open_file_read = open_trr_read;
-  trj_plugin.read_next_timestep = read_trr_timestep;
-  trj_plugin.close_file_read = close_trr_read;
-
-  return 0;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&gro_plugin);
-  (*cb)(v, (vmdplugin_t *)&g96_plugin);
-  (*cb)(v, (vmdplugin_t *)&trr_plugin);
-  (*cb)(v, (vmdplugin_t *)&trj_plugin);
-  (*cb)(v, (vmdplugin_t *)&xtc_plugin);
-  return 0;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return 0;
-}
-
-
-#ifdef TEST_G96_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-
-  molfile_timestep_t timestep;
-  void *v;
-  int i;
-
-  if (argc < 2) return 1;
-  while (--argc) {
-    ++argv;
-    v = open_g96_read(*argv, "g96", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_g96_read failed for file %s\n", *argv);
-      return 1;
-    }
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    i = 0;
-    while(!read_g96_timestep(v, natoms, &timestep)) {
-      ++i;
-    }
-    fprintf(stderr, "ended read_g96_timestep on step %d\n", i);
-    free(timestep.coords);
-    close_g96_read(v);
-  }
-  return 0;
-}
-
-#endif
-
-#ifdef TEST_TRR_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms;
-
-  molfile_timestep_t timestep;
-  void *v, *w;
-  int i;
-
-  if (argc != 3) return 1;
-  v = open_trr_read(argv[1], "trr", &natoms);
-  if (!v) {
-    fprintf(stderr, "open_trr_read failed for file %s\n", argv[1]);
-    return 1;
-  }
-  timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-  w = open_trr_write(argv[2], "trr", natoms);
-  if (!w) {
-    fprintf(stderr, "open_trr_write failed for file %s\n", argv[2]);
-    return 1;
-  }
-
-  i = 0;
-  while(!read_trr_timestep(v, natoms, &timestep)) {
-    ++i;
-    if (write_trr_timestep(w, &timestep)) {
-      fprintf(stderr, "write error\n");
-      return 1;
-    }
-  }
-
-  fprintf(stderr, "ended read_trr_timestep on step %d\n", i);
-  free(timestep.coords);
-  close_trr_read(v);
-  close_trr_write(w);
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hash.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hash.c
deleted file mode 100644
index 03584fa00addcc31049d2ca4f329dcf8c6129848..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hash.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: hash.c,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for strings, contributed by John Stone,
- *   derived from his ray tracer code.
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "hash.h"
-
-#define HASH_LIMIT 0.5
-
-/** hash table node data structure */
-typedef struct hash_node_t {
-  int data;                           /* data in hash node */
-  const char * key;                   /* key for hash lookup */
-  struct hash_node_t *next;           /* next node in hash chain */
-} hash_node_t;
-
-/*
- *  hash() - Hash function returns a hash number for a given key.
- *
- *  tptr: Pointer to a hash table
- *  key: The key to create a hash number for
- */
-static int hash(const hash_t *tptr, const char *key) {
-  int i=0;
-  int hashvalue;
- 
-  while (*key != '\0')
-    i=(i<<3)+(*key++ - '0');
- 
-  hashvalue = (((i*1103515249)>>tptr->downshift) & tptr->mask);
-  if (hashvalue < 0) {
-    hashvalue = 0;
-  }    
-
-  return hashvalue;
-}
-
-/*
- *  hash_init() - Initialize a new hash table.
- *
- *  tptr: Pointer to the hash table to initialize
- *  buckets: The number of initial buckets to create
- */
-VMDEXTERNSTATIC void hash_init(hash_t *tptr, int buckets) {
-
-  /* make sure we allocate something */
-  if (buckets==0)
-    buckets=16;
-
-  /* initialize the table */
-  tptr->entries=0;
-  tptr->size=2;
-  tptr->mask=1;
-  tptr->downshift=29;
-
-  /* ensure buckets is a power of 2 */
-  while (tptr->size<buckets) {
-    tptr->size<<=1;
-    tptr->mask=(tptr->mask<<1)+1;
-    tptr->downshift--;
-  } /* while */
-
-  /* allocate memory for table */
-  tptr->bucket=(hash_node_t **) calloc(tptr->size, sizeof(hash_node_t *));
-
-  return;
-}
-
-/*
- *  rebuild_table() - Create new hash table when old one fills up.
- *
- *  tptr: Pointer to a hash table
- */
-static void rebuild_table(hash_t *tptr) {
-  hash_node_t **old_bucket, *old_hash, *tmp;
-  int old_size, h, i;
-
-  old_bucket=tptr->bucket;
-  old_size=tptr->size;
-
-  /* create a new table and rehash old buckets */
-  hash_init(tptr, old_size<<1);
-  for (i=0; i<old_size; i++) {
-    old_hash=old_bucket[i];
-    while(old_hash) {
-      tmp=old_hash;
-      old_hash=old_hash->next;
-      h=hash(tptr, tmp->key);
-      tmp->next=tptr->bucket[h];
-      tptr->bucket[h]=tmp;
-      tptr->entries++;
-    } /* while */
-  } /* for */
-
-  /* free memory used by old table */
-  free(old_bucket);
-
-  return;
-}
-
-/*
- *  hash_lookup() - Lookup an entry in the hash table and return a pointer to
- *    it or HASH_FAIL if it wasn't found.
- *
- *  tptr: Pointer to the hash table
- *  key: The key to lookup
- */
-VMDEXTERNSTATIC int hash_lookup(const hash_t *tptr, const char *key) {
-  int h;
-  hash_node_t *node;
-
-
-  /* find the entry in the hash table */
-  h=hash(tptr, key);
-  for (node=tptr->bucket[h]; node!=NULL; node=node->next) {
-    if (!strcmp(node->key, key))
-      break;
-  }
-
-  /* return the entry if it exists, or HASH_FAIL */
-  return(node ? node->data : HASH_FAIL);
-}
-
-/*
- *  hash_insert() - Insert an entry into the hash table.  If the entry already
- *  exists return a pointer to it, otherwise return HASH_FAIL.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to insert into the hash table
- *  data: A pointer to the data to insert into the hash table
- */
-VMDEXTERNSTATIC int hash_insert(hash_t *tptr, const char *key, int data) {
-  int tmp;
-  hash_node_t *node;
-  int h;
-
-  /* check to see if the entry exists */
-  if ((tmp=hash_lookup(tptr, key)) != HASH_FAIL)
-    return(tmp);
-
-  /* expand the table if needed */
-  while (tptr->entries>=HASH_LIMIT*tptr->size)
-    rebuild_table(tptr);
-
-  /* insert the new entry */
-  h=hash(tptr, key);
-  node=(struct hash_node_t *) malloc(sizeof(hash_node_t));
-  node->data=data;
-  node->key=key;
-  node->next=tptr->bucket[h];
-  tptr->bucket[h]=node;
-  tptr->entries++;
-
-  return HASH_FAIL;
-}
-
-/*
- *  hash_delete() - Remove an entry from a hash table and return a pointer
- *  to its data or HASH_FAIL if it wasn't found.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to remove from the hash table
- */
-VMDEXTERNSTATIC int hash_delete(hash_t *tptr, const char *key) {
-  hash_node_t *node, *last;
-  int data;
-  int h;
-
-  /* find the node to remove */
-  h=hash(tptr, key);
-  for (node=tptr->bucket[h]; node; node=node->next) {
-    if (!strcmp(node->key, key))
-      break;
-  }
-
-  /* Didn't find anything, return HASH_FAIL */
-  if (node==NULL)
-    return HASH_FAIL;
-
-  /* if node is at head of bucket, we have it easy */
-  if (node==tptr->bucket[h])
-    tptr->bucket[h]=node->next;
-  else {
-    /* find the node before the node we want to remove */
-    for (last=tptr->bucket[h]; last && last->next; last=last->next) {
-      if (last->next==node)
-        break;
-    }
-    last->next=node->next;
-  }
-
-  /* free memory and return the data */
-  data=node->data;
-  free(node);
-
-  return(data);
-}
-
-
-/*
- * inthash_entries() - return the number of hash table entries.
- *
- */
-VMDEXTERNSTATIC int hash_entries(hash_t *tptr) {
-  return tptr->entries;
-}
-
-
-
-
-/*
- * hash_destroy() - Delete the entire table, and all remaining entries.
- * 
- */
-VMDEXTERNSTATIC void hash_destroy(hash_t *tptr) {
-  hash_node_t *node, *last;
-  int i;
-
-  for (i=0; i<tptr->size; i++) {
-    node = tptr->bucket[i];
-    while (node != NULL) { 
-      last = node;   
-      node = node->next;
-      free(last);
-    }
-  }     
-
-  /* free the entire array of buckets */
-  if (tptr->bucket != NULL) {
-    free(tptr->bucket);
-    memset(tptr, 0, sizeof(hash_t));
-  }
-}
-
-/*
- *  alos() - Find the average length of search.
- *
- *  tptr: Pointer to a hash table
- */
-static float alos(hash_t *tptr) {
-  int i,j;
-  float alos=0;
-  hash_node_t *node;
-
-
-  for (i=0; i<tptr->size; i++) {
-    for (node=tptr->bucket[i], j=0; node!=NULL; node=node->next, j++);
-    if (j)
-      alos+=((j*(j+1))>>1);
-  } /* for */
-
-  return(tptr->entries ? alos/tptr->entries : 0);
-}
-
-
-/*
- *  hash_stats() - Return a string with stats about a hash table.
- *
- *  tptr: A pointer to the hash table
- */
-VMDEXTERNSTATIC char * hash_stats(hash_t *tptr) {
-  static char buf[1024];
-
-  sprintf(buf, "%u slots, %u entries, and %1.2f ALOS",
-    (int)tptr->size, (int)tptr->entries, alos(tptr));
-
-  return(buf);
-}
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hash.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hash.h
deleted file mode 100644
index 49a9e69b34f783e214749dbc12f6f211a8ef3abc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hash.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: hash.h,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for strings, contributed by John Stone,
- *   derived from his ray tracer code.
- ***************************************************************************/
-#ifndef HASH_H
-#define HASH_H
-
-/** hash table top level data structure */
-typedef struct hash_t {
-  struct hash_node_t **bucket;      /* array of hash nodes */
-  int size;                         /* size of the array */
-  int entries;                      /* number of entries in table */
-  int downshift;                    /* shift count, used in hash function */
-  int mask;                         /* used to select bits for hashing */
-} hash_t;
-
-#define HASH_FAIL -1
-
-#if defined(VMDPLUGIN_STATIC)
-#define VMDEXTERNSTATIC static
-#include "hash.c"
-#else
-
-#define VMDEXTERNSTATIC 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** initialize hash table for first use */
-void hash_init(hash_t *, int);
-
-/** lookup a string key in the hash table returning its integer key */
-int hash_lookup (const hash_t *, const char *);
-
-/** insert a string into the hash table, along with an integer key */
-int hash_insert (hash_t *, const char *, int);
-
-/** delete an string from the hash table, given its string name */
-int hash_delete (hash_t *, const char *);
-
-/** return the number of entries in the has table */
-int hash_entries(hash_t *);
-
-/** destroy the hash table completely, deallocate memory */
-void hash_destroy(hash_t *);
-
-/** print hash table vital stats */
-char *hash_stats (hash_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hoomdplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hoomdplugin.c
deleted file mode 100644
index c492a76b24c86ca6883a824a540d407b772825c4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/hoomdplugin.c
+++ /dev/null
@@ -1,2504 +0,0 @@
-/***************************************************************************
- *
- * HOOMD and HOOMD-blue style XML format data/topology file reader and writer
- *
- * Copyright (c) 2009 Axel Kohlmeyer <akohlmey@gmail.com>
- *
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: hoomdplugin.c,v $
- *      $Author: akohlmey $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2011/12/06 04:57:12 $
- *
- ***************************************************************************/
-
-/*
- * HOOMD-blue xml topology/trajectory file format:
- *
- * http://codeblue.umich.edu/hoomd-blue/doc/page_xml_file_format.html
- *
- * NOTES: 
- * - all XML elements are converted to lowercase before parsing, so case 
- *   will be ignored on reading. on writing only lowercase will be written.
- * - attributes are in general optional, but it is recommended to provide 
- *   them all. the plugin will print an informational message if it inserts 
- *   a missing attribute with a default value and a warning message if it 
- *   encounters a yet unknown attribute.
- * - units attributes are deprecated and always ignored.
- * - the angle, dihedral, improper nodes are only supported for 
- *   version 1.1 files. in files with no version attribute to hoomd_xml 
- *   or version 1.0 those nodes will be ignored.
- * - accelerations nodes appear in version 1.2. The molfile API
- *   has no method to pass them on, so they are currently ignored.
- * - charge nodes are only supported for version 1.3 and later files. 
- *   in files with no version attribute to hoomd_xml, version 1.0,
- *   or version 1.2, those nodes will be ignored.
- * - body nodes are supported starting with version 1.4. The body 
- *   value is mapped to the "resid" field in molfile.
- * - as of version 1.4 also the "vizsigma" attribute to the 
- *   configuration node is honored. It provides a scaling factor
- *   for the radius of particles and can be overridded by the 
- *   VMDHOOMDSIGMA environment variable. Both are ignored, however,
- *   if a diameter node is present.
- *
- ***************************************************
-
-<?xml version ="1.0" encoding ="UTF-8" ?>
-<hoomd_xml version="1.4">
-  <!-- comments -->
-  <configuration time_step="0" dimensions="3" vizsigma="0.5" ntypes="2">
-    <box  lx="49.914" ly= "49.914" lz="49.914" />
-    <position>
-      3.943529 4.884501 12.317140
-      3.985539 5.450660 13.107670
-      3.521055 6.212838 13.516340
-    </position>
-    <type num="6">
-      CT
-      CM
-      BB
-      TRP
-      LEU
-      WS
-    </type>
-    <bond num="10">
-      CT-CM 0 1
-      CM-CT 1 2
-      BB-TRP 3 4
-      BB-BB  3 5
-      BB-LEU 5 6
-      BB-BB  5 7
-      BB-TRP 7 8
-      BB-BB  7 9
-      BB-LEU 9 10
-      BB-BB  9 3
-    </bond>
-    <angle num="9">
-      CT-CM-CT   0  1  2
-      BB-BB-TRP  9  3  4
-      BB-BB-TRP  5  3  4
-      BB-BB-LEU  3  5  6
-      BB-BB-BB   3  5  7
-      BB-BB-TRP  5  7  8
-      BB-BB-BB   5  7  9
-      BB-BB-LEU  7  9 10
-      BB-BB-BB   7  9  3
-    </angle>
-    <diameter num="3">
-      1.0 1.0 2.0
-    </diameter>
-    <mass num="3">
-      1.0 1.0 2.0
-    </mass>
-    <charge num="3">
-      -1.0 -1.0 2.0
-    </charge>
-    <body num="3">
-      -1 0 0
-    </charge>
-    <wall>
-      <coord ox="1.0" oy="2.0" oz="3.0" nx="4.0" ny="5.0" nz="6.0"/>
-      <coord ox="7.0" oy="8.0" oz="9.0" nx="10.0" ny="11.0" nz="-12.0"/>
-    </wall>
-  </configuration>
-</hoomd>
-
-****************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#include <math.h>
-#include <errno.h>
-#include "molfile_plugin.h"
-
-#include "periodic_table.h"
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-/* XXX: it is a bit annoying to have to resolve to an external XML 
- * library for parsing. XML is messy and expat is plain c and makes
- * life much easier. perhaps a portable internal xml parser would 
- * do as well, but the one used in hoomd is in c++ and requires to 
- * the the whole file into memory as one gian string. :-( */
-#include <expat.h>
-
-/*! hoomd file format version that this plugin supports.
- *  it will refuse to load file formats with higher major
- *  version and print a warning on higher minor version.
- *  written files will be in exactly this version.
- */
-#define HOOMD_FORMAT_MAJV 1
-#define HOOMD_FORMAT_MINV 4
-
-#define SMALL    1.0e-7f        /*! arbitrary small number. "almost zero"  */
-
-/* numeric and symbolic representations of the supported xml nodes */
-#define HOOMD_NONE      0       /**< undefined            */
-#define HOOMD_XML       1       /**< toplevel tag         */
-#define HOOMD_CONFIG    2       /**< timestep tag         */
-#define HOOMD_BOX       3       /**< box dimensions tag   */
-#define HOOMD_POS       4       /**< coordinates tag      */
-#define HOOMD_IMAGE     5       /**< image counter tag    */
-#define HOOMD_VEL       6       /**< velocities tag       */
-#define HOOMD_TYPE      7       /**< atom type tag        */
-#define HOOMD_BODY      8       /**< body number tag      */
-#define HOOMD_MASS      9       /**< atom mass tag        */
-#define HOOMD_CHARGE   10       /**< atom diameter tag    */
-#define HOOMD_DIAMETER 11       /**< atom diameter tag    */
-#define HOOMD_BOND     12       /**< bond section tag     */
-#define HOOMD_ANGLE    13       /**< angle section tag    */
-#define HOOMD_DIHEDRAL 14       /**< dihedral section tag */
-#define HOOMD_IMPROPER 15       /**< improper section tag */
-#define HOOMD_WALL     16       /**< wall description     */
-#define HOOMD_COORD    17       /**< wall coordinate tag  */
-#define HOOMD_ACCEL    18       /**< accelerations tag    */
-#define HOOMD_ORIENT   19       /**< orientation tag      */
-#define HOOMD_UNKNOWN  20       /**< unknown tag          */
-#define HOOMD_NUMTAGS  21       /**< number of known tags */
-
-/* This list has to stay consistend with the defines above */
-static const char *hoomd_tag_name[HOOMD_NUMTAGS] = {
-  "(none)", "hoomd_xml", "configuration", "box", /*  0 -  3 */
-  "position", "image", "velocity",               /*  4 -  6 */
-  "type", "body", "mass", "charge", "diameter",  /*  7 - 11 */
-  "bond", "angle", "dihedral", "improper",       /* 12 - 15 */
-  "wall", "coord", "acceleration", "orientation",/* 16 - 19 */
-  "(error)"                                      /* 20 -    */
-};
-
-/*! maximum XML element nesting level supported */
-#define HOOMD_MAXDEPTH 5
-
-typedef struct {
-  FILE *fp;
-  XML_Parser p;
-  void *buffer;
-  int parsedepth;
-  int parse_error;
-  int currtag[HOOMD_MAXDEPTH+1];
-  int counter;
-  int majv, minv;
-  int optflags;
-  int numframe;
-  int doneframe;
-  int numdims;
-  int numatoms;
-  int numtypes;
-  int numbonds;
-  int numangles;
-  int numdihedrals;
-  int numimpropers;
-  int numbondtypes;
-  int numangletypes;
-  int numdihedraltypes;
-  int numimpropertypes;
-  int *from;
-  int *to;
-  int *bondtype;
-  int *angle;
-  int *dihedral;
-  int *improper;
-  int *angletype;
-  int *dihedraltype;
-  int *impropertype;
-  char **bondtypename;
-  char **angletypename;
-  char **dihedraltypename;
-  char **impropertypename;
-  char *filename;
-  float mysigma;
-  int *imagecounts;
-  molfile_atom_t *atomlist;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-  molfile_timestep_t ts;
-} hoomd_data_t;
-
-/* forward declaration */
-static molfile_plugin_t plugin;
-
-/*
- * Error reporting macro for use in DEBUG mode
- */
-#ifndef HOOMD_DEBUG
-#define HOOMD_DEBUG 0
-#endif
-#if HOOMD_DEBUG
-#define PRINTERR vmdcon_printf(VMDCON_ERROR,                            \
-                               "\n In file %s, line %d: \n %s \n \n",   \
-                               __FILE__, __LINE__, strerror(errno))
-#else
-#define PRINTERR (void)(0)
-#endif
-
-/* make sure pointers are NULLed after free(3)ing them. */
-#define SAFE_FREE(ptr) free(ptr); ptr=NULL
-/* calloc with test of success */
-#define SAFE_CALLOC(ptr,type,count)       \
-ptr = (type *)calloc(count,sizeof(type)); \
-  if (ptr == NULL) {                      \
-                                          \
-    PRINTERR;                             \
-    return MOLFILE_ERROR;                 \
-  }
-
-/*! convert string to upper case */
-static void make_lower(char *s) 
-{
-  while (*s) {
-    *s = tolower(*s);
-    ++s;
-  }
-}
-
-/*! find string in a NULL terminated list of strings.
- * grow storage and append if needed. return the index. */
-static int addstring(char ***list, const char *key) 
-{
-  int i=0;
-  char **p = *list;
-
-  for (; p[i] != NULL;) {
-    if (strcmp(p[i], key) == 0)
-      return i;
-    ++i;
-  }
-  
-  *list        = realloc(*list, (i+2)*sizeof(char *));
-  (*list)[i]   = strdup(key);
-  (*list)[i+1] = NULL;
-  
-  return i;
-}
-
-
-/*! copy attribute/value pairs and convert to lowercase */
-#define XML_ATTR_COPY(a,n,k,v)                          \
-  strncpy(k, a[n],   sizeof(k)-1); make_lower(k);       \
-  strncpy(v, a[n+1], sizeof(v)-1); make_lower(value)
-
-/*! warning about unknown attribute */
-#define XML_UNK_ATTR(e,k,v)                                         \
-  vmdcon_printf(VMDCON_WARN, "hoomdplugin) ignoring unknown "       \
-                " attribute %s='%s' for element %s\n", k, v, e);
-
-
-/*! element handler for XML file format. 
- * this function is called whenever a new XML element is encountered.
- * this is a companion function to xml_end_tag(). We have to record
- * the nesting level of XML elements, so that we can we can return to
- * the previous element's state. hoomd doesn't use this property yet,
- * but may do so in the future.
- *
- * @param data  data structure with information on this file.
- * @param elmt  name of the XML element
- * @param attr  list of attributes and their values as strings.
- *              the order is attr1, val1, attr2, val2, ... 
- */
-static void xml_new_tag(void *data, 
-                        const XML_Char *elmt, 
-                        const XML_Char **attr)
-{
-  int i, mytag;
-  hoomd_data_t *d=data;
-  char element[MOLFILE_BUFSIZ];
-  char key[MOLFILE_BUFSIZ];
-  char value[MOLFILE_BUFSIZ];
-  
-
-  if (d == NULL) return;
-
-  d->parsedepth ++;
-
-#if HOOMD_DEBUG
-  for (i=0; i < d->parsedepth; ++i) {
-    printf(">");
-  }
-  printf("%s",elmt);
-  for (i=0;attr[i]; i+=2) {
-    printf(" %s='%s'",attr[i],attr[i+1]);
-  }
-  printf("\n");
-#endif
-
-  strncpy(element, elmt, sizeof(element)-1);
-  make_lower(element);
-
-  /* convert text mode tags to numbers and parse attributes. */
-  mytag = HOOMD_UNKNOWN;
-  for (i=0; i < HOOMD_NUMTAGS; ++i) {
-    if (strcmp(elmt, hoomd_tag_name[i]) == 0) {
-      mytag = i;
-      break;
-    }
-  }
-  d->currtag[d->parsedepth] = mytag;
-  d->counter = 0;
-   
-  switch (mytag) {
-
-    case HOOMD_XML:             /* root node */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if(strcmp(key,"version") == 0) {
-          d->majv = atoi(strtok(value, "."));
-          d->minv = atoi(strtok(NULL,  "."));
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      if (d->majv < 0) {
-        vmdcon_printf(VMDCON_INFO, "hoomdplugin) No version attribute found "
-                      "on <%s> element assuming version=\"1.0\"\n", 
-                      hoomd_tag_name[HOOMD_XML] );
-        d->majv = 1;
-        d->minv = 0;
-      }
-      break;
-
-    case HOOMD_CONFIG:          /* new frame */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if(strcmp(key,"time_step") == 0) {
-#if vmdplugin_ABIVERSION > 10
-          d->ts.physical_time = atof(value);
-#else 
-          ;
-#endif
-        } else if(strcmp(key,"natoms") == 0) {
-          d->numatoms = atoi(value);
-        } else if(strcmp(key,"ntypes") == 0) {
-          d->numtypes = atoi(value);
-        } else if(strcmp(key,"dimensions") == 0) {
-          if (d->majv == 1 && d->minv < 2) {
-            vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found dimensions "
-                          "attribute in a pre-1.2 version format file. "
-                          "Ignoring it...\n");
-          } else {
-            d->numdims = atoi(value);
-          }
-        } else if(strcmp(key,"vizsigma") == 0) {
-          if (d->majv == 1 && d->minv < 4) {
-            vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found vizsigma "
-                          "attribute in a pre-1.4 version format file. "
-                          "Ignoring it...\n");
-          } else {
-            d->mysigma = atof(value);
-          }
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_BOX:             /* new box dimensions */
-      /* hoomd only supports orthogonal boxes at the moment */
-      d->ts.A     = d->ts.B    = d->ts.C     = 0.0f;
-      d->ts.alpha = d->ts.beta = d->ts.gamma = 90.0f;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-        } else if(strcmp(key,"lx") == 0) {
-          d->ts.A = atof(value);
-        } else if(strcmp(key,"ly") == 0) {
-          d->ts.B = atof(value);
-        } else if(strcmp(key,"lz") == 0) {
-          d->ts.C = atof(value);
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-      case HOOMD_POS:             /* coordinates */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          if (d->numatoms < 1) {
-            d->numatoms = atoi(value); /* number of positions. */
-          }
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_VEL:             /* velocities */
-#if vmdplugin_ABIVERSION > 10
-      d->ts_meta.has_velocities = 1;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key, "units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          ;                     /* XXX: number of velocities. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-#endif
-      break;
-
-    case HOOMD_BODY:            /* body/resid tag */
-      if (d->majv == 1 && d->minv < 4) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                      "a pre-1.4 version format file. Ignoring it...\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-          if (strcmp(key,"num") == 0) {
-            ;                     /* XXX: number of body tags. use for check. */
-          } else {
-            XML_UNK_ATTR(element, key, value);
-          }
-        }
-      }
-      break;
-
-    case HOOMD_MASS:            /* atom mass */
-      d->optflags |= MOLFILE_MASS;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          ;                     /* XXX: number of masses. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_CHARGE:          /* atom charge */
-      if (d->majv == 1 && d->minv < 3) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found charge "
-                          "section in a pre-1.3 version format file. "
-                          "Ignoring it...\n");
-      } else {
-        d->optflags |= MOLFILE_CHARGE;
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-          if (strcmp(key,"units") == 0) {
-            ;                     /* ignore */
-          } else if (strcmp(key,"num") == 0) {
-            ;                     /* XXX: number of masses. use for check. */
-          } else {
-            XML_UNK_ATTR(element, key, value);
-          }
-        }
-      }
-      break;
-
-    case HOOMD_DIAMETER:          /* particle diameter */
-      d->optflags |= MOLFILE_RADIUS;
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                     /* ignore */
-        } else if (strcmp(key,"num") == 0) {
-          ;                     /* XXX: number of diameters. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_IMAGE:           /* fallthrough */
-    case HOOMD_TYPE:            /* fallthrough */
-    case HOOMD_BOND:
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"num") == 0) {
-          ;                 /* XXX: number of atom types. use for check. */
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    /* angle type definitions */
-    case HOOMD_ANGLE:           /* fallthrough */
-    case HOOMD_DIHEDRAL:        /* fallthrough */
-    case HOOMD_IMPROPER:
-      if (d->majv == 1 && d->minv < 1) {
-        if ( ((mytag == HOOMD_ANGLE) && (d->numangles < -1)) ||
-             ((mytag == HOOMD_DIHEDRAL) && (d->numdihedrals < -1)) ||
-             ((mytag == HOOMD_IMPROPER) && (d->numimpropers < -1)) ) {
-          vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                        "a pre-1.1 version format file. Ignoring it...\n",
-                        hoomd_tag_name[mytag]);
-        } else {
-          for (i=0; attr[i]; i+=2) {
-            XML_ATTR_COPY(attr, i, key, value);
-            if (strcmp(key,"num") == 0) {
-              ;                 /* XXX: number of angles. use for check. */
-            } else {
-              XML_UNK_ATTR(element, key, value);
-            }
-          }
-        }
-      }
-      break;
-
-    case HOOMD_WALL:            /* wall section */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        XML_UNK_ATTR(element, key, value);
-      }
-      break;
-
-    case HOOMD_COORD:           /* wall coordinate */
-      for (i=0; attr[i]; i+=2) {
-        XML_ATTR_COPY(attr, i, key, value);
-        if (strcmp(key,"units") == 0) {
-          ;                       /* ignore */
-        } else if(strcmp(key,"ox") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"oy") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"oz") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"nx") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"ny") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else if(strcmp(key,"nz") == 0) {
-          ; /* do nothing. we don't do anything with walls, yet.*/
-        } else {
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_ACCEL:
-      if (d->majv == 1 && d->minv < 2) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                        "a pre-1.2 version format file. Ignoring it...\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-            if (strcmp(key,"num") == 0) {
-              ;                 /* XXX: number of accelerations. use for check. */
-            } else {
-              XML_UNK_ATTR(element, key, value);
-            }
-          XML_UNK_ATTR(element, key, value);
-        }
-      }
-      break;
-
-    case HOOMD_ORIENT:            /* orientation tag */
-      if (d->majv == 1 && d->minv < 4) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Found <%s> section in "
-                      "a pre-1.4 version format file. Ignoring it...\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        for (i=0; attr[i]; i+=2) {
-          XML_ATTR_COPY(attr, i, key, value);
-          if (strcmp(key,"num") == 0) {
-            ;                     /* XXX: number of orientation tags. use for check. */
-          } else {
-            XML_UNK_ATTR(element, key, value);
-          }
-        }
-      }
-      break;
-
-    default:
-      d->currtag[d->parsedepth] = HOOMD_UNKNOWN;
-      vmdcon_printf(VMDCON_WARN, "hoomdplugin) Ignoring unknown XML "
-                    "element: %s.\n", element);
-      break;
-  }
-}
-
-/*! end of element handler for xml document. */
-static void xml_end_tag(void *data, const XML_Char *elmt)
-{
-  hoomd_data_t *d=data;
-  int mytag;
-
-  if (d == NULL) return;
-
-  mytag = d->currtag[d->parsedepth];
-  switch (mytag) {
-
-    case HOOMD_CONFIG:
-      d->doneframe=1;
-      break;
-
-    case HOOMD_TYPE:
-      /* store number of atoms the first time we read this section and
-       * if it has not yet been passed on at the <configuration> tag.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to parse this more than once. */
-      if (d->numatoms < 0) {    
-        d->numatoms = d->counter;
-      }
-      break;
-
-    case HOOMD_XML:             /* fallthrough. */
-    case HOOMD_BOX:             /* fallthrough. */
-    case HOOMD_IMAGE:           /* fallthrough. */
-    case HOOMD_WALL:            /* fallthrough. */
-    case HOOMD_COORD:           /* fallthrough. */
-    case HOOMD_ACCEL:           /* fallthrough. */
-    case HOOMD_ORIENT:          /* fallthrough. */
-      ;                         /* nothing to do */
-      break;
-
-    case HOOMD_POS:
-      /* assign the number of atoms if it has not been done before */
-      if ( (d->counter > 0) && (d->numatoms < 0) ) {
-        d->numatoms = d->counter/3;
-      }                         /* fallthrough */
-      
-    case HOOMD_VEL:
-      if ( (d->counter > 0) && (d->numatoms > 0) && (d->counter != (3*d->numatoms)) ) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Inconsistent %s data. Expected %d, but "
-                      "got %d items.\n", hoomd_tag_name[mytag], 3*d->numatoms, d->counter);
-        d->parse_error = 1;
-      }
-      break;
-
-    case HOOMD_MASS:            /* fallthrough. */
-    case HOOMD_CHARGE:          /* fallthrough. */
-    case HOOMD_BODY:            /* fallthrough. */
-    case HOOMD_DIAMETER:
-      if ( (d->counter > 0) && (d->numatoms > 0) && (d->counter != d->numatoms) )  {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Inconsistent %s data. Expected %d, but "
-                      "got %d items.\n", hoomd_tag_name[mytag], d->numatoms, d->counter);
-        d->parse_error = 1;
-      }
-      
-      break;
-
-    case HOOMD_BOND:
-      /* store number of bonds the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numbonds < 0) {
-        d->numbonds = d->counter/3; /* three 'words' per bond */
-      }
-      break;
-
-    case HOOMD_ANGLE:
-      /* store number of angles the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numangles < 0) {
-        if (d->majv == 1 && d->minv > 0) { /* angle only valid from version 1.1 on */
-          d->numangles = d->counter/4;    /* four 'words' per angle */
-        } else {
-          d->numangles = 0;
-        }
-      }
-      break;
-
-    case HOOMD_DIHEDRAL:
-      /* store number of dihedrals the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numdihedrals < 0) {
-        if (d->majv == 1 && d->minv > 0) { /* dihedral only valid from version 1.1 on */
-          d->numdihedrals = d->counter/5;    /* four 'words' per dihedral */
-        } else {
-          d->numdihedrals = 0;
-        }
-      }
-      break;
-
-    case HOOMD_IMPROPER:
-      /* store number of impropers the first time we read this section.
-       * VMD (currently) assumes that this doesn't change, so we
-       * don't have to do this more than once. */
-      if (d->numimpropers < 0) {
-        if (d->majv == 1 && d->minv > 0) { /* improper only valid from version 1.1 on */
-          d->numimpropers = d->counter/5;    /* four 'words' per improper */
-        } else {
-          d->numimpropers = 0;
-        }
-      }
-      break;
-
-    default: 
-      if (mytag < HOOMD_NUMTAGS) {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) No end handler for HOOMD tag '%s'.\n",
-                      hoomd_tag_name[mytag]);
-      } else {
-        vmdcon_printf(VMDCON_WARN, "hoomdplugin) Unknown HOOMD tag id: '%d'.\n", mytag);
-      }
-      
-      break;
-  }
-
-  d->currtag[d->parsedepth] = HOOMD_NONE;
-  d->parsedepth--;
-  d->counter=0;
-#if HOOMD_DEBUG
-  printf("end of tag %s. parsedepth=%d\n",elmt,d->parsedepth);
-#endif
-}
-
-/*! content data handler for xml document */
-static void xml_data_block(void *data, const XML_Char *s, int len) 
-{
-  hoomd_data_t *d =NULL; 
-  int i,lmax, mytag;
-
-  d = (hoomd_data_t *)data;
-  if (d == NULL) return;          /* XXX: bug in program */
-  if (d->parsedepth < 1) return;  /* not yet within XML block */
-  if (d->parsedepth > HOOMD_MAXDEPTH) return;  /* too much nesting */
-  if (len < 1) return;
-
-  mytag = d->currtag[d->parsedepth];
-  switch (mytag) {
-    
-    case HOOMD_TYPE:
-
-      /* count the number of atoms by counting the types */
-      if (d->numatoms < 0) {
-        char buffer[1024];
-        char *p;
-        lmax=1023;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      } else { 
-        /* assign atom types the second time we parse the first frame */
-        if (d->numframe < 2) {
-          char buffer[1024];
-          char *p;
-          molfile_atom_t *atom;
-          
-          if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-          lmax=1023;
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            atom=d->atomlist + d->counter;
-            if (atom == NULL) return;
-
-            strncpy(atom->name, p, sizeof(atom->name));
-            strncpy(atom->type, p, sizeof(atom->type));
-            atom->atomicnumber = get_pte_idx(atom->type);
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_BOND:
-      /* count the number of bonds by counting the types */
-      if ((d->numbonds < 0) || (d->numframe < 2)) {
-        char buffer[1024];
-        char *p;
-        int idx, num, n;
-        lmax=1023;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          num = d->counter / 3;
-          if (d->numbonds > 0) {
-            i=d->counter % 3;
-            if (i == 0) {
-              n = d->numbondtypes;
-              idx=addstring(&(d->bondtypename), p);
-              if (idx < 0)
-                d->parse_error = 1;
-              if (idx >= n)
-                d->numbondtypes=idx+1;
-              d->bondtype[num] = idx;
-
-              /* CAVEAT: atom indices start at 1 here. psf style. XXX */
-            } else if (i == 1) { 
-              d->from[num] = atoi(p) + 1;
-            } else if (i == 2) {
-              d->to[num] = atoi(p) + 1;
-            }
-          }
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_ANGLE:
-      if (d->majv == 1 && d->minv > 0) {  /* angle is only valid from version 1.1 on */
-        /* count the number of angles by counting the types */
-        if ((d->numangles < 0) || (d->numframe < 2)) {
-          char buffer[1024];
-          char *p;
-          int idx, num, n;
-          lmax=1023;
-        
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            num = d->counter / 4;
-            if (d->numangles > 0) {
-              i=d->counter % 4;
-              if (i == 0) {
-                n = d->numangletypes;
-                idx=addstring(&(d->angletypename), p);
-                if (idx < 0)
-                  d->parse_error = 1;
-                if (idx >= n)
-                  d->numangletypes=idx+1;
-                d->angletype[num] = idx;
-
-                /* CAVEAT: atom indices have to start at 1 here. psf style. XXX */
-              } else if (i == 1) { 
-                d->angle[3*num  ] = atoi(p) + 1;
-              } else if (i == 2) {
-                d->angle[3*num+1] = atoi(p) + 1;
-              } else if (i == 3) {
-                d->angle[3*num+2] = atoi(p) + 1;
-              }
-            }
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_DIHEDRAL:
-      if (d->majv == 1 && d->minv > 0) {  /* dihedral is only valid from version 1.1 on */
-        /* count the number of dihedrals by counting the types */
-        if ((d->numdihedrals < 0) || (d->numframe < 2)) {
-          char buffer[1024];
-          char *p;
-          int idx, num, n;
-          lmax=1023;
-        
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            num = d->counter / 5;
-            if (d->numdihedrals > 0) {
-              i=d->counter % 5;
-              if (i == 0) {
-                n = d->numdihedraltypes;
-                idx=addstring(&(d->dihedraltypename), p);
-                if (idx < 0)
-                  d->parse_error = 1;
-                if (idx >= n)
-                  d->numdihedraltypes=idx+1;
-                d->dihedraltype[num] = idx;
-
-                /* CAVEAT: atom indices start at 1 here. psf style. XXX */
-              } else if (i == 1) { 
-                d->dihedral[4*num  ] = atoi(p) + 1;
-              } else if (i == 2) {
-                d->dihedral[4*num+1] = atoi(p) + 1;
-              } else if (i == 3) {
-                d->dihedral[4*num+2] = atoi(p) + 1;
-              } else if (i == 4) {
-                d->dihedral[4*num+3] = atoi(p) + 1;
-              }
-            }
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_IMPROPER:
-      if (d->majv == 1 && d->minv > 0) {  /* improper is only valid from version 1.1 on */
-        /* count the number of impropers by counting the types */
-        if ((d->numimpropers < 0) || (d->numframe < 2)) {
-          char buffer[1024];
-          char *p;
-          int idx, num, n;
-          lmax=1023;
-        
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            num = d->counter / 5;
-            if (d->numimpropers > 0) {
-              i=d->counter % 5;
-              if (i == 0) {
-                n = d->numimpropertypes;
-                idx=addstring(&(d->impropertypename), p);
-                if (idx < 0)
-                  d->parse_error = 1;
-                if (idx >= n)
-                  d->numimpropertypes=idx+1;
-                d->impropertype[num] = idx;
-
-                /* CAVEAT: atom indices start at 1 here. psf style. XXX */
-              } else if (i == 1) { 
-                d->improper[4*num  ] = atoi(p) + 1;
-              } else if (i == 2) {
-                d->improper[4*num+1] = atoi(p) + 1;
-              } else if (i == 3) {
-                d->improper[4*num+2] = atoi(p) + 1;
-              } else if (i == 4) {
-                d->improper[4*num+3] = atoi(p) + 1;
-              }
-            }
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_DIAMETER:
-      /* set radius, from diameter block. radius = 0.5*diameter. */
-      if (d->numatoms > 0) {
-        char buffer[1024];
-        char *p;
-        molfile_atom_t *atom;
-          
-        if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-        lmax=1023;
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          atom=d->atomlist + d->counter;
-          if (atom == NULL) return;
-
-          atom->radius = 0.5 * atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_MASS:
-      /* set mass. */
-      if (d->numatoms > 0) {
-        char buffer[1024];
-        char *p;
-        molfile_atom_t *atom;
-          
-        if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-        lmax=1023;
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          atom=d->atomlist + d->counter;
-          if (atom == NULL) return;
-
-          atom->mass = atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_BODY:
-      /* set resid from <body> tag. */
-      if (d->numatoms > 0) {
-        char buffer[1024];
-        char *p;
-        molfile_atom_t *atom;
-          
-        if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-        lmax=1023;
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          atom=d->atomlist + d->counter;
-          if (atom == NULL) return;
-
-          atom->resid = atoi(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    case HOOMD_CHARGE:
-      /* set charge. */
-      if (d->majv == 1 && d->minv > 2) {  /* charge is only valid from version 1.2 on */
-        if (d->numatoms > 0) {
-          char buffer[1024];
-          char *p;
-          molfile_atom_t *atom;
-          
-          if (len==1 && ((*s == ' ') || (*s == '\n') || (*s == '\t'))) return;
-
-          lmax=1023;
-          if (len < lmax) lmax=len;
-          memcpy(buffer,s,lmax);
-          buffer[lmax]='\0';
-
-          p=strtok(buffer," \t\n");
-          while (p) {
-            atom=d->atomlist + d->counter;
-            if (atom == NULL) return;
-
-            atom->charge = atof(p);
-            d->counter ++;
-            p=strtok(NULL," \t\n");
-          }
-        }
-      }
-      break;
-      
-    case HOOMD_POS:
-      /* only try to read coordinates. if there is storage for them. */
-      if (d->ts.coords) {
-        char buffer[1024];
-        int lmax=1023;
-        char *p;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          if (d->counter < (3 * d->numatoms))
-            d->ts.coords[d->counter] = atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-        
-      }
-      break;
-
-#if vmdplugin_ABIVERSION > 10
-    case HOOMD_VEL:
-      if ((d->numatoms > 0) && (d->ts.velocities != NULL)) {
-        char buffer[1024];
-        int lmax=1023;
-        char *p;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          if (d->counter < (3 * d->numatoms))
-            d->ts.velocities[d->counter] = atof(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-#endif
-      
-    case HOOMD_IMAGE:
-      if ((d->numatoms > 0) && (d->imagecounts != NULL)) {
-        char buffer[1024];
-        int lmax=1023;
-        char *p;
-        
-        if (len < lmax) lmax=len;
-        memcpy(buffer,s,lmax);
-        buffer[lmax]='\0';
-
-        p=strtok(buffer," \t\n");
-        while (p) {
-          d->imagecounts[d->counter] = atoi(p);
-          d->counter ++;
-          p=strtok(NULL," \t\n");
-        }
-      }
-      break;
-      
-    default:
-      break;
-  }
-}
-
-/*! comment handler */
-static void xml_comment(void *data, const XML_Char *s)
-{
-  hoomd_data_t *d=data;
-  if (d==NULL) return;
-#if HOOMD_DEBUG
-  printf("COMMENT: %s. parsedepth=%d\n", (char *)s, d->parsedepth);
-#endif
-}
-
-/*! run the XML parser to read the next line */
-static int hoomd_parse_line(hoomd_data_t *data)
-{   
-  int done, len;
-      
-  data->buffer = XML_GetBuffer(data->p, MOLFILE_BIGBUFSIZ);
-  done = (NULL == fgets(data->buffer,MOLFILE_BIGBUFSIZ,data->fp));
-
-  if (!done) 
-    len=strlen(data->buffer);
-  else
-    len=0;
-      
-  if (ferror(data->fp)) {
-    vmdcon_printf(VMDCON_ERROR, "hoomdplugin) problem reading HOOMD"
-                  " data file '%s'\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  if (! XML_ParseBuffer(data->p, len, done)) {
-    vmdcon_printf(VMDCON_ERROR, 
-                  "hoomdplugin) XML syntax error at line %d:\n%s\n",
-                  XML_GetCurrentLineNumber(data->p),
-                  XML_ErrorString(XML_GetErrorCode(data->p)));
-    return MOLFILE_ERROR;
-  }
-      
-  if (data->parse_error > 0) {
-    vmdcon_printf(VMDCON_ERROR, 
-                  "hoomdplugin) XML data parse error at line %d.\n",
-                  XML_GetCurrentLineNumber(data->p));
-    return MOLFILE_ERROR;
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-
-
-/*! open the file and validate that it is indeed a HOOMD file.
- *  we also need to count the number of atoms, so we instead
- *  parse the whole first configuration including bonding info
- *  and so on and store it for later use. */
-  static void *open_hoomd_read(const char *filename, const char *filetype, 
-                               int *natoms) {
-    FILE *fp;
-    XML_Parser p;
-    hoomd_data_t *data;
-
-    fp = fopen(filename, "rb");
-    if (!fp) return NULL;
-  
-    data = (hoomd_data_t *)calloc(1,sizeof(hoomd_data_t));
-    if (data) {
-      
-      data->counter       =  0;
-      data->numatoms      = -1;
-      data->numtypes      = -1;
-      data->numbonds      = -1;
-      data->numangles     = -1;
-      data->numdihedrals  = -1;
-      data->numimpropers  = -1;
-      data->numframe      = -1;
-      data->numbondtypes  = -1;
-      data->numangletypes = -1;
-      data->numdihedraltypes = -1;
-      data->numimpropertypes = -1;
-      data->bondtype      = NULL;
-      data->bondtypename  = NULL;
-      data->angle         = NULL;
-      data->angletype     = NULL;
-      data->angletypename = NULL;
-      data->dihedral         = NULL;
-      data->dihedraltype     = NULL;
-      data->dihedraltypename = NULL;
-      data->dihedral         = NULL;
-      data->dihedraltype     = NULL;
-      data->dihedraltypename = NULL;
-      data->parse_error   =  0;
-      
-      data->majv     = -1;
-      data->minv     = -1;
-
-      data->optflags = MOLFILE_NOOPTIONS;
-      /* scaling factor for guessed diameters */
-      data->mysigma  = 1.0f;
-    
-      p = XML_ParserCreate(NULL);
-      if (!p) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Could not create XML"
-                      " parser for HOOMD-blue data file '%s'\n", filename);
-        SAFE_FREE(data);
-        fclose(fp);
-        return NULL;
-      }
-    
-      XML_SetElementHandler(p, xml_new_tag, xml_end_tag);
-      XML_SetCommentHandler(p, xml_comment);
-      XML_SetCharacterDataHandler(p, xml_data_block);
-      XML_SetUserData(p,data);
-      data->p  = p;
-      data->fp = fp;
-      data->filename = strdup(filename);
-
-      /* loop through file until we have parsed the first configuration */
-      do {
-        if (MOLFILE_ERROR == hoomd_parse_line(data)) {
-          vmdcon_printf(VMDCON_ERROR, "hoomdplugin) XML Parse error "
-                      "while reading HOOMD-blue data file '%s'\n", filename);
-          XML_ParserFree(data->p);
-          data->p = NULL;
-          SAFE_FREE(data->filename);
-          fclose(data->fp);
-          SAFE_FREE(data);
-          return NULL;
-        }
-      } while (!feof(fp) && !data->doneframe);
-
-      if ( data->majv > HOOMD_FORMAT_MAJV ) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Encountered incompatible "
-                      "HOOMD-blue data file format version '%d.%d.\n", 
-                      data->majv, data->minv);
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) This plugin supports only "
-                      "HOOMD-blue data files up to version '%d.%d'.\n",
-                      HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV);
-        XML_ParserFree(data->p);
-        data->p = NULL;
-        SAFE_FREE(data->filename);
-        fclose(data->fp);
-        SAFE_FREE(data);
-        return NULL;
-      } else {
-        if ( (data->majv == HOOMD_FORMAT_MAJV) && 
-             (data->minv > HOOMD_FORMAT_MINV) ) {
-          vmdcon_printf(VMDCON_WARN, "hoomdplugin) Encountered newer HOOMD-blue "
-                        "data file format version '%d.%d'.\n",
-                        data->majv, data->minv);
-          vmdcon_printf(VMDCON_WARN, "hoomdplugin) This plugin supports HOOMD-blue "
-                        "data files up to version '%d.%d'. Continuing...\n", 
-                        HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV);
-        }
-      }
-
-      if (data->numatoms < 0) {
-        vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Could not determine "
-                      "number of atoms in HOOMD-blue data file '%s'\n", filename);
-        XML_ParserFree(data->p);
-        data->p = NULL;
-        SAFE_FREE(data->filename);
-        fclose(data->fp);
-        SAFE_FREE(data);
-        return NULL;
-      }
-
-      /* reset parsing */
-      XML_ParserFree(p);
-      data->p = NULL;
-      rewind(fp);
-    
-      data->counter  = 0;
-      data->numframe = 0;
-      *natoms=data->numatoms;
-    }
-  
-    return data;
-  }
-
-static int read_hoomd_structure(void *mydata, int *optflags, 
-                                molfile_atom_t *atoms) {
-  molfile_atom_t *a;
-  XML_Parser p;
-  const char *envvar;
-  int i;
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  
-  data->parsedepth = 0;
-  data->counter    = 0;
-  data->numframe   = 0;
-  data->doneframe  = 0;
-  data->atomlist   = atoms;
-  SAFE_CALLOC(data->imagecounts,   int,   3*data->numatoms);
-  SAFE_CALLOC(data->bondtypename,  char*, 1);  /* is grown on demand */
-  SAFE_CALLOC(data->angletypename, char*, 1);  /* is grown on demand */
-  SAFE_CALLOC(data->dihedraltypename, char*, 1);  /* is grown on demand */
-  SAFE_CALLOC(data->impropertypename, char*, 1);  /* is grown on demand */
-  if (data->numbonds > 0) {
-    SAFE_CALLOC(data->from,      int, data->numbonds);
-    SAFE_CALLOC(data->to,        int, data->numbonds);
-    SAFE_CALLOC(data->bondtype,  int, data->numbonds);
-  }
-  if (data->numangles > 0) {
-    SAFE_CALLOC(data->angle,     int, data->numangles * 3);
-    SAFE_CALLOC(data->angletype, int, data->numangles);
-  }
-  if (data->numdihedrals > 0) {
-    SAFE_CALLOC(data->dihedral,     int, data->numdihedrals * 4);
-    SAFE_CALLOC(data->dihedraltype, int, data->numdihedrals);
-  }
-  if (data->numimpropers > 0) {
-    SAFE_CALLOC(data->improper,     int, data->numimpropers * 4);
-    SAFE_CALLOC(data->impropertype, int, data->numimpropers);
-  }
-  SAFE_CALLOC(data->ts.coords,float,3*data->numatoms);
-  data->ts.A = data->ts.B = data->ts.C = 0.0f;
-  data->ts.alpha = data->ts.beta = data->ts.gamma = 90.0f;
-  
-#if vmdplugin_ABIVERSION > 10
-  data->ts_meta.count = -1;
-  data->ts_meta.has_velocities = 0;
-  SAFE_CALLOC(data->ts.velocities,float,3*data->numatoms);
-#endif
-  p = XML_ParserCreate(NULL);
-  if (!p) {
-    vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Could not create XML"
-                  " parser for HOOMD-blue data file '%s'\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  XML_SetElementHandler(p, xml_new_tag, xml_end_tag);
-  XML_SetCommentHandler(p, xml_comment);
-  XML_SetCharacterDataHandler(p,xml_data_block);
-  XML_SetUserData(p,data);
-  data->p = p;
-
-  /* initialize atomdata with typical defaults */
-  for (i=0, a=atoms; i < data->numatoms; ++i, ++a) {
-    a->radius =  1.0f;
-    a->mass =    1.0f;
-    a->resname[0]='\0';
-    a->resid=0;
-    a->segid[0]='\0';
-    a->chain[0]='\0';
-  }
-    
-  /* read the first configuration again, but keep the data this time. */
-  do {
-    if (MOLFILE_ERROR == hoomd_parse_line(data)) {
-      XML_ParserFree(data->p);
-      data->p = NULL;
-      return MOLFILE_ERROR;
-    } 
-  } while (!feof(data->fp) && !data->doneframe);
-
-  /* allow overriding hardcoded sigma values from environment */
-  envvar = getenv("VMDHOOMDSIGMA");
-  if (envvar) data->mysigma = atof(envvar);
-
-  /* fix up settings */
-  for (i=0, a=atoms; i < data->numatoms; ++i, ++a) {
-
-    if (!(data->optflags & MOLFILE_RADIUS)) {
-      /* use vizsigma parameter to adjust guessed particle radii,
-         but only for xml files that don't have a diameter section. */
-      a->radius = data->mysigma * get_pte_vdw_radius(a->atomicnumber);
-    }
-
-    if (!(data->optflags & MOLFILE_MASS)) {
-      /* guess atom mass, if not provided */
-      a->mass = get_pte_mass(a->atomicnumber);
-    }
-  }
-  *optflags = data->optflags | MOLFILE_RADIUS | MOLFILE_MASS;
-    
-  data->numframe=1;
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 10
-/***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  
-  meta->count = -1;
-  meta->has_velocities = data->ts_meta.has_velocities;
-  if (meta->has_velocities) {
-    vmdcon_printf(VMDCON_INFO, "hoomdplugin) Importing velocities.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-
-#if vmdplugin_ABIVERSION > 14
-static int read_hoomd_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                            float **bondorder, int **bondtype, 
-                            int *nbondtypes, char ***bondtypename) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *nbonds = data->numbonds;
-  *bondorder = NULL;
-
-  if (data->numbonds > 0) {
-    *fromptr      = data->from;
-    *toptr        = data->to;
-    *bondtype     = data->bondtype;
-    *nbondtypes   = data->numbondtypes;
-    *bondtypename = data->bondtypename;
-  } else {
-    *fromptr      = NULL;
-    *toptr        = NULL;
-    *bondtype     = NULL;
-    *nbondtypes   = 0;
-    *bondtypename = NULL;
-    vmdcon_printf(VMDCON_WARN,
-                  "hoomdplugin) no bonds defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_hoomd_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                            float **bondorder) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *nbonds = data->numbonds;
-  *bondorder = NULL;
-
-  if (data->numbonds > 0) {
-    *fromptr      = data->from;
-    *toptr        = data->to;
-  } else {
-    *fromptr      = NULL;
-    *toptr        = NULL;
-    vmdcon_printf(VMDCON_WARN,
-                  "hoomdplugin) no bonds defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-#if vmdplugin_ABIVERSION > 15
-static int read_hoomd_angles(void *v, int *numangles, int **angles, 
-                             int **angletypes, int *numangletypes, 
-                             char ***angletypenames, int *numdihedrals,
-                             int **dihedrals, int **dihedraltypes, 
-                             int *numdihedraltypes, char ***dihedraltypenames,
-                             int *numimpropers, int **impropers, 
-                             int **impropertypes, int *numimpropertypes, 
-                             char ***impropertypenames, int *numcterms, 
-                             int **cterms, int *ctermcols, int *ctermrows) {
-                               
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *numangles         = 0;
-  *angles            = NULL;
-  *angletypes        = NULL;
-  *numangletypes     = 0;
-  *angletypenames    = NULL;
-  *numdihedrals      = 0;
-  *dihedrals         = NULL;
-  *dihedraltypes     = NULL;
-  *numdihedraltypes  = 0;
-  *dihedraltypenames = NULL;
-  *numimpropers      = 0;
-  *impropers         = NULL;
-  *impropertypes     = NULL;
-  *numimpropertypes  = 0;
-  *impropertypenames = NULL;
-  *numcterms         = 0;           /* hoomd does not support CMAP */
-  *cterms            = NULL;
-  *ctermrows         = 0;
-  *ctermcols         = 0;
-  
-  if (data->numangles > 0) {
-    *numangles      = data->numangles;
-    *angles         = data->angle;
-    *angletypes     = data->angletype;
-    *numangletypes  = data->numangletypes;
-    *angletypenames = data->angletypename;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no angles defined in data file.\n");
-  }
-  if (data->numdihedrals > 0) {
-    *numdihedrals      = data->numdihedrals;
-    *dihedrals         = data->dihedral;
-    *dihedraltypes     = data->dihedraltype;
-    *numdihedraltypes  = data->numdihedraltypes;
-    *dihedraltypenames = data->dihedraltypename;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no dihedrals defined in data file.\n");
-  }
-  if (data->numimpropers > 0) {
-    *numimpropers      = data->numimpropers;
-    *impropers         = data->improper;
-    *impropertypes     = data->impropertype;
-    *numimpropertypes  = data->numimpropertypes;
-    *impropertypenames = data->impropertypename;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no impropers defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_hoomd_angles(void *v, int *numangles, int **angles, 
-                             double **angleforces, int *numdihedrals, 
-                             int **dihedrals, double **dihedralforces,
-                             int *numimpropers, int **impropers, 
-                             double **improperforces, int *numcterms,
-                             int **cterms, int *ctermcols, int *ctermrows,  
-                             double **ctermforces) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  *numangles      = 0;
-  *angles         = NULL;
-  *angleforces    = NULL;
-  *numdihedrals   = 0;          /* we currently only support angles. */
-  *dihedrals      = NULL;
-  *dihedralforces = NULL;
-  *numimpropers   = 0;
-  *impropers      = NULL;
-  *improperforces = NULL;
-  *numcterms      = 0;
-  *cterms         = NULL;
-  *ctermrows      = 0;
-  *ctermcols      = 0;
-  *ctermforces    = NULL;
-  
-  if (data->numangles > 0) {
-    *numangles      = data->numangles;
-    *angles         = data->angle;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no angles defined in data file.\n");
-  }
-  if (data->numdihedrals > 0) {
-    *numdihedrals      = data->numdihedrals;
-    *dihedrals         = data->dihedral;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no dihedrals defined in data file.\n");
-  }
-  if (data->numimpropers > 0) {
-    *numimpropers      = data->numimpropers;
-    *impropers         = data->improper;
-  } else {
-    vmdcon_printf(VMDCON_INFO,
-                  "hoomdplugin) no impropers defined in data file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static int read_hoomd_timestep(void *mydata, int natoms, 
-                               molfile_timestep_t *ts) {
-  int i;
-  hoomd_data_t *data;
-  
-  data=(hoomd_data_t *)mydata;
-
-  if (data->parse_error) return MOLFILE_ERROR;
-  if (data->p == NULL) return MOLFILE_ERROR;
-  
-  if (data->numframe > 1) {
-    /* read the next configuration. */
-    data->doneframe =  0;
-    do {
-      if (MOLFILE_ERROR == hoomd_parse_line(data)) {
-        XML_ParserFree(data->p);
-        data->p = NULL;
-        return MOLFILE_ERROR;
-      } 
-      if (data->parse_error) return MOLFILE_ERROR;
-    } while (!feof(data->fp) && !data->doneframe);
-    if (feof(data->fp)) return MOLFILE_ERROR;
-  }
-  data->numframe++;
-  
-  if (ts != NULL) { 
-    /* only save coords if we're given a timestep pointer, */
-    /* otherwise assume that VMD wants us to skip past it. */
-    for (i=0; i<natoms; ++i) {
-      ts->coords[3*i+0] = data->ts.coords[3*i+0]
-        + data->ts.A * data->imagecounts[3*i+0];
-      ts->coords[3*i+1] = data->ts.coords[3*i+1]
-        + data->ts.B * data->imagecounts[3*i+1];
-      ts->coords[3*i+2] = data->ts.coords[3*i+2]
-        + data->ts.C * data->imagecounts[3*i+2];
-    }
-#if vmdplugin_ABIVERSION > 10    
-    /* copy velocities */
-    if (ts->velocities != NULL) {
-      for (i=0; i<natoms; ++i) {
-        ts->velocities[3*i+0] = data->ts.velocities[3*i+0];
-        ts->velocities[3*i+1] = data->ts.velocities[3*i+1];
-        ts->velocities[3*i+2] = data->ts.velocities[3*i+2];
-      }
-    }
-#endif
-    ts->A = data->ts.A;
-    ts->B = data->ts.B;
-    ts->C = data->ts.C;
-    ts->alpha = data->ts.alpha;
-    ts->beta  = data->ts.beta;
-    ts->gamma = data->ts.gamma;
-  }
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_hoomd_read(void *mydata) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  int i;
-  
-  if (data->p != NULL) XML_ParserFree(data->p);
-
-  fclose(data->fp);
-
-  SAFE_FREE(data->imagecounts);
-  SAFE_FREE(data->from);
-  SAFE_FREE(data->to);
-  SAFE_FREE(data->bondtype);
-  for (i=0; i < data->numbondtypes; ++i) {
-    SAFE_FREE(data->bondtypename[i]);
-  }
-  SAFE_FREE(data->bondtypename);
-  SAFE_FREE(data->angle);
-  SAFE_FREE(data->angletype);
-  for (i=0; i < data->numangletypes; ++i) {
-    SAFE_FREE(data->angletypename[i]);
-  }
-  SAFE_FREE(data->angletypename);
-  SAFE_FREE(data->dihedral);
-  SAFE_FREE(data->dihedraltype);
-  for (i=0; i < data->numdihedraltypes; ++i) {
-    SAFE_FREE(data->dihedraltypename[i]);
-  }
-  SAFE_FREE(data->dihedraltypename);
-  SAFE_FREE(data->improper);
-  SAFE_FREE(data->impropertype);
-  for (i=0; i < data->numimpropertypes; ++i) {
-    SAFE_FREE(data->impropertypename[i]);
-  }
-  SAFE_FREE(data->impropertypename);
-  SAFE_FREE(data->ts.coords);
-  SAFE_FREE(data->ts.velocities);
-  SAFE_FREE(data->filename);
-  SAFE_FREE(data);
-}
-
-/*! open hoomd data file for writing.
- * this will also write the XML identfier tag and the opening 
- * <hoomd> and <configuration> elements */
-static void *open_hoomd_write(const char *filename, const char *filetype, 
-                              int natoms) {
-  FILE *fd;
-  hoomd_data_t *data;
-  time_t mytime;
-
-  mytime = time(NULL);
-  
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    vmdcon_printf(VMDCON_ERROR, "hoomdplugin) Unable to open HOOMD-blue data file %s "
-                  "for writing\n", filename);
-    return NULL;
-  }
-  
-  data = (hoomd_data_t *)malloc(sizeof(hoomd_data_t));
-  data->numatoms = natoms;
-  data->filename = strdup(filename);
-  data->fp   = fd;
-  data->atomlist      = NULL;
-  data->numbonds      = 0;
-  data->to            = NULL;
-  data->from          = NULL;
-  data->bondtype      = NULL;
-  data->numbondtypes  = 0;
-  data->bondtypename  = NULL;
-  data->numangles     = 0;
-  data->angle         = NULL;
-  data->angletype     = NULL;
-  data->numangletypes = 0;
-  data->angletypename = NULL;
-  data->numdihedrals     = 0;
-  data->dihedral         = NULL;
-  data->dihedraltype     = NULL;
-  data->numdihedraltypes = 0;
-  data->dihedraltypename = NULL;
-  data->numimpropers     = 0;
-  data->improper         = NULL;
-  data->impropertype     = NULL;
-  data->numimpropertypes = 0;
-  data->impropertypename = NULL;
-  data->numframe      = 0;
-  data->imagecounts   = (int *)malloc(sizeof(int)*3*(data->numatoms));
-
-  fputs("<?xml version =\"1.0\" encoding =\"UTF-8\" ?>\n",fd);
-  fprintf(fd,"<%s version=\"%d.%d\">\n", hoomd_tag_name[HOOMD_XML],
-          HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV);
-  fprintf(fd, "<!-- generated by VMD on: %s", ctime(&mytime));
-  fprintf(fd, " %s plugin v%d.%d by %s -->\n", plugin.prettyname,
-          plugin.majorv, plugin.minorv, plugin.author);
-
-  fprintf(data->fp,"<%s time_step=\"%d\" natoms=\"%d\">\n",
-          hoomd_tag_name[HOOMD_CONFIG], data->numframe, data->numatoms);
-
-  return data;
-}
-
-
-/* some macros for consistency and convenience */
-#define SECTION_OPEN(tag,num) \
-  fprintf(data->fp, "<%s num=\"%d\">\n", hoomd_tag_name[tag], num)
-
-#define SECTION_CLOSE(tag) \
-  fprintf(data->fp, "</%s>\n", hoomd_tag_name[tag])
-  
-#define SECTION_WRITE_ATOMIC(tag,fmt,val) \
-  SECTION_OPEN(tag,numatoms);             \
-  for (i=0; i < numatoms; ++i)            \
-    fprintf(data->fp,fmt, val);           \
-  SECTION_CLOSE(tag)
-
-/*! write topology data to hoomd data file.
- */
-static int write_hoomd_structure(void *mydata, int optflags, 
-                                 const molfile_atom_t *atoms) {
-  int i, numatoms;
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  numatoms = data->numatoms;
-
-
-  /* write fields we know about */
-  /* required by molfile: */
-  SECTION_WRITE_ATOMIC(HOOMD_TYPE,"%s\n",atoms[i].type);
-  SECTION_WRITE_ATOMIC(HOOMD_BODY,"%d\n",atoms[i].resid);
-
-  /* optional: */
-  if (optflags & MOLFILE_RADIUS) {
-    SECTION_WRITE_ATOMIC(HOOMD_DIAMETER,"%f\n",2.0f*atoms[i].radius);
-  }
-  
-  if (optflags & MOLFILE_MASS) {
-    SECTION_WRITE_ATOMIC(HOOMD_MASS,"%f\n",atoms[i].mass);
-  }
-  
-  if (optflags & MOLFILE_CHARGE) {
-    SECTION_WRITE_ATOMIC(HOOMD_CHARGE,"%f\n",atoms[i].charge);
-  }
-  
-  if ((data->numbonds > 0) && (data->from != NULL) && (data->to != NULL)) {
-    SECTION_OPEN(HOOMD_BOND, data->numbonds);
-    if (data->bondtype != NULL) {
-      if (data->bondtypename != NULL) {
-        /* case 1: symbolic bond types available */
-        for (i=0; i < data->numbonds; ++i) {
-          if (data->bondtype[i] < 0) {
-            /* case 1a: symbolic bond types not assigned */
-            fprintf(data->fp,"unkown %d %d\n", data->from[i]-1, data->to[i]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d\n", data->bondtypename[data->bondtype[i]],
-                    data->from[i]-1, data->to[i]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical bond types available */
-        for (i=0; i < data->numbonds; ++i) {
-          fprintf(data->fp,"bondtype%d %d %d\n", data->bondtype[i], 
-                  data->from[i]-1, data->to[i]-1);
-        }
-      }
-    } else {
-      /* case 3: no bond type info available. */
-      for (i=0; i < data->numbonds; ++i) {
-        fprintf(data->fp,"bond %d %d\n", data->from[i]-1, data->to[i]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_BOND);
-  }
-  
-  if ( (data->numangles > 0) && (data->angle != NULL) ) {
-    SECTION_OPEN(HOOMD_ANGLE,data->numangles);
-    if (data->angletype != NULL) {
-      if (data->angletypename != NULL) {
-        /* case 1: symbolic angle types available */
-        for (i=0; i < data->numangles; ++i) {
-          if (data->angletype[i] < 0) {
-            /* case 1a: symbolic angle types not assigned */
-            fprintf(data->fp,"unkown %d %d %d\n", data->angle[3*i]-1, 
-                    data->angle[3*i+1]-1, data->angle[3*i+2]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d %d\n", 
-                    data->angletypename[data->angletype[i]], 
-                    data->angle[3*i]-1, data->angle[3*i+1]-1, 
-                    data->angle[3*i+2]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical angle types available */
-        for (i=0; i < data->numangles; ++i) {
-          fprintf(data->fp,"angletype%d %d %d %d\n", 
-                  data->angletype[i], data->angle[3*i]-1, 
-                  data->angle[3*i+1]-1, data->angle[3*i+2]-1);
-        }
-      }
-    } else {
-      /* case 3: no angle type info available. */
-      for (i=0; i < data->numangles; ++i) {
-        fprintf(data->fp,"angle %d %d %d\n", data->angle[3*i]-1, 
-                data->angle[3*i+1]-1, data->angle[3*i+2]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_ANGLE);
-  }
-
-  if ( (data->numdihedrals > 0) && (data->dihedral != NULL) ) {
-    SECTION_OPEN(HOOMD_DIHEDRAL, data->numdihedrals);
-    if (data->dihedraltype != NULL) {
-      if (data->dihedraltypename != NULL) {
-        /* case 1: symbolic dihedral types available */
-        for (i=0; i < data->numdihedrals; ++i) {
-          if (data->dihedraltype[i] < 0) {
-            /* case 1a: symbolic dihedral types not assigned */
-            fprintf(data->fp,"unkown %d %d %d %d\n", data->dihedral[4*i]-1, 
-                    data->dihedral[4*i+1]-1, data->dihedral[4*i+2]-1,
-                    data->dihedral[4*i+3]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d %d %d\n", 
-                    data->dihedraltypename[data->dihedraltype[i]], 
-                    data->dihedral[4*i]-1,   data->dihedral[4*i+1]-1, 
-                    data->dihedral[4*i+2]-1, data->dihedral[4*i+3]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical dihedral types available */
-        for (i=0; i < data->numdihedrals; ++i) {
-          fprintf(data->fp,"dihedraltype%d %d %d %d %d\n", 
-                  data->dihedraltype[i],   data->dihedral[4*i]-1, 
-                  data->dihedral[4*i+1]-1, data->dihedral[4*i+2]-1,
-                  data->dihedral[4*i+3]-1);
-        }
-      }
-    } else {
-      /* case 3: no dihedral type info available. */
-      for (i=0; i < data->numdihedrals; ++i) {
-        fprintf(data->fp,"dihedral %d %d %d %d\n", 
-                data->dihedral[4*i]-1,   data->dihedral[4*i+1]-1, 
-                data->dihedral[4*i+2]-1, data->dihedral[4*i+3]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_DIHEDRAL);
-  }
-
-  if ( (data->numimpropers > 0) && (data->improper != NULL) ) {
-    SECTION_OPEN(HOOMD_IMPROPER, data->numimpropers);
-    if (data->impropertype != NULL) {
-      if (data->impropertypename != NULL) {
-        /* case 1: symbolic improper types available */
-        for (i=0; i < data->numimpropers; ++i) {
-          if (data->impropertype[i] < 0) {
-            /* case 1a: symbolic improper types not assigned */
-            fprintf(data->fp,"unkown %d %d %d %d\n", data->improper[4*i]-1, 
-                    data->improper[4*i+1]-1, data->improper[4*i+2]-1,
-                    data->improper[4*i+3]-1);
-          } else {
-            fprintf(data->fp,"%s %d %d %d %d\n", 
-                    data->impropertypename[data->impropertype[i]], 
-                    data->improper[4*i]-1,   data->improper[4*i+1]-1, 
-                    data->improper[4*i+2]-1, data->improper[4*i+3]-1);
-          }
-        }
-      } else {
-        /* case 2: only numerical improper types available */
-        for (i=0; i < data->numimpropers; ++i) {
-          fprintf(data->fp,"impropertype%d %d %d %d %d\n", 
-                  data->impropertype[i],   data->improper[4*i]-1, 
-                  data->improper[4*i+1]-1, data->improper[4*i+2]-1,
-                  data->improper[4*i+3]-1);
-        }
-      }
-    } else {
-      /* case 3: no improper type info available. */
-      for (i=0; i < data->numimpropers; ++i) {
-        fprintf(data->fp,"improper %d %d %d %d\n", 
-                data->improper[4*i]-1,   data->improper[4*i+1]-1, 
-                data->improper[4*i+2]-1, data->improper[4*i+3]-1);
-      }
-    }
-    SECTION_CLOSE(HOOMD_IMPROPER);
-  }
-  return MOLFILE_SUCCESS;
-}
-/* clean up, part 1 */
-#undef SECTION_WRITE_ATOMIC
-
-
-#if vmdplugin_ABIVERSION > 14
-static int write_hoomd_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                             float *bondorder, int *bondtype, 
-                             int nbondtypes, char **bondtypename) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-  int i;
-
-  data->numbonds=0;
-  data->numbondtypes=0;
-  data->bondtype=NULL;
-
-  /* save info until we actually write out the structure data */
-  if ( (nbonds > 0) && (fromptr != NULL) && (toptr != NULL) ) {
-    data->numbonds = nbonds;
-    SAFE_CALLOC(data->from, int, nbonds);
-    memcpy(data->from, fromptr, nbonds * sizeof(int));
-    SAFE_CALLOC(data->to,   int, nbonds);
-    memcpy(data->to,   toptr,   nbonds * sizeof(int));
-    if (bondtype != NULL) {
-      SAFE_CALLOC(data->bondtype, int, nbonds);
-      memcpy(data->bondtype, bondtype, nbonds * sizeof(int));
-    }
-  }
-  if (nbondtypes > 0) {
-    data->numbondtypes=nbondtypes;
-    if (bondtypename != NULL) {
-      SAFE_CALLOC(data->bondtypename, char *, nbondtypes+1);
-      for (i=0; i < nbondtypes; ++i) {
-        data->bondtypename[i] = strdup(bondtypename[i]);
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int write_hoomd_bonds(void *v, int nbonds, int *fromptr, int *toptr, float *bondorder) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-
-  data->numbonds=0;
-  data->numbondtypes=0;
-  data->bondtype=NULL;
-
-  /* save info until we actually write out the structure data */
-  if ( (nbonds > 0) && (fromptr != NULL) && (toptr != NULL) ) {
-    data->numbonds = nbonds;
-    SAFE_CALLOC(data->from, int, nbonds);
-    memcpy(data->from, fromptr, nbonds * sizeof(int));
-    SAFE_CALLOC(data->to,   int, nbonds);
-    memcpy(data->to,   toptr,   nbonds * sizeof(int));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-#if vmdplugin_ABIVERSION > 15
-static int write_hoomd_angles(void * v, int numangles, const int *angles,
-                              const int *angletypes, int numangletypes,
-                              const char **angletypenames, int numdihedrals, 
-                              const int *dihedrals, const int *dihedraltypes,
-                              int numdihedraltypes, const char **dihedraltypenames,
-                              int numimpropers, const int *impropers, 
-                              const int *impropertypes, int numimpropertypes, 
-                              const char **impropertypenames, int numcterms, 
-                              const int *cterm, int ctermcols, int ctermrows) {
-  hoomd_data_t *data = (hoomd_data_t *)v;
-  int i;
-  
-  /* save info until we actually write out the structure file */
-  data->numangles    = numangles;
-  data->numdihedrals = numdihedrals;
-  data->numimpropers = numimpropers;
-
-  if (data->numangles > 0) {
-    SAFE_CALLOC(data->angle, int, 3*data->numangles);
-    memcpy(data->angle, angles, 3*(data->numangles)*sizeof(int));
-  }
-  if (data->numdihedrals > 0) {
-    SAFE_CALLOC(data->dihedral, int, 4*data->numdihedrals);
-    memcpy(data->dihedral, dihedrals, 4*(data->numdihedrals)*sizeof(int));
-  }
-  if (data->numimpropers > 0) {
-    SAFE_CALLOC(data->improper, int, 4*data->numimpropers);
-    memcpy(data->improper, impropers, 4*(data->numimpropers)*sizeof(int));
-  }
-
-  if (angletypes != NULL) {
-    SAFE_CALLOC(data->angletype, int, data->numangles);
-    memcpy(data->angletype, angletypes, (data->numangles)*sizeof(int));
-  }
-  if (dihedraltypes != NULL) {
-    SAFE_CALLOC(data->dihedraltype, int, data->numdihedrals);
-    memcpy(data->dihedraltype, dihedraltypes, (data->numdihedrals)*sizeof(int));
-  }
-  if (impropertypes != NULL) {
-    SAFE_CALLOC(data->impropertype, int, data->numimpropers);
-    memcpy(data->impropertype, impropertypes, (data->numimpropers)*sizeof(int));
-  }
-
-  data->numangletypes = numangletypes;
-  if (data->numangletypes > 0) {
-    if (angletypenames != NULL) {
-      SAFE_CALLOC(data->angletypename, char *, (data->numangletypes)+1);
-      for (i=0; i < data->numangletypes; ++i) {
-        data->angletypename[i] = strdup(angletypenames[i]);
-      }
-    }
-  }
-  data->numdihedraltypes = numdihedraltypes;
-  if (data->numdihedraltypes > 0) {
-    if (dihedraltypenames != NULL) {
-      SAFE_CALLOC(data->dihedraltypename, char *, (data->numdihedraltypes)+1);
-      for (i=0; i < data->numdihedraltypes; ++i) {
-        data->dihedraltypename[i] = strdup(dihedraltypenames[i]);
-      }
-    }
-  }
-
-  data->numimpropertypes = numimpropertypes;
-  if (data->numimpropertypes > 0) {
-    if (impropertypenames != NULL) {
-      SAFE_CALLOC(data->impropertypename, char *, (data->numimpropertypes)+1);
-      for (i=0; i < data->numimpropertypes; ++i) {
-        data->impropertypename[i] = strdup(impropertypenames[i]);
-      }
-    }
-  }
-
-#if 0                           /* the rest is not yet supported. */
-  data->numcterms    = numcterms;
-  if (data->numcterms > 0) {
-
-    data->cterms = (int *) malloc(8*data->numcterms*sizeof(int));
-    memcpy(data->cterms, cterms, 8*data->numcterms*sizeof(int));
-  }
-#endif
-  return MOLFILE_SUCCESS;
-}
-
-#else
-static int write_hoomd_angles(void * v, int numangles, const int *angles,
-                        const double *angleforces, int numdihedrals, 
-                        const int *dihedrals, const double *dihedralforces,
-                        int numimpropers, const int *impropers, 
-                        const double *improperforces, int numcterms,   
-                        const int *cterms, int ctermcols, int ctermrows, 
-                        const double *ctermforces) {
-    hoomd_data_t *data = (hoomd_data_t *)v;
-  /* save info until we actually write out the structure file */
-  data->numangles    = numangles;
-  if (data->numangles > 0) {
-    data->angle = (int *) malloc(3*data->numangles*sizeof(int));
-    memcpy(data->angle, angles, 3*data->numangles*sizeof(int));
-  }
-
-  data->numdihedrals = numdihedrals;
-  data->numimpropers = numimpropers;
-  data->numcterms    = numcterms;
-
-  if (data->numdihedrals > 0) {
-    data->dihedrals = (int *) malloc(4*data->numdihedrals*sizeof(int));
-    memcpy(data->dihedrals, dihedrals, 4*data->numdihedrals*sizeof(int));
-  }
-  
-    data->impropers = (int *) malloc(4*data->numimpropers*sizeof(int));
-    memcpy(data->impropers, impropers, 4*data->numimpropers*sizeof(int));
-  }
-#if 0                           /* XXX not yet supported. */
-  if (data->numcterms > 0) {
-
-    data->cterms = (int *) malloc(8*data->numcterms*sizeof(int));
-    memcpy(data->cterms, cterms, 8*data->numcterms*sizeof(int));
-  }
-#endif
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-
-static int write_hoomd_timestep(void *mydata, const molfile_timestep_t *ts) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata; 
-  const float *pos;
-  float px, py, pz;
-  int i, *img, numatoms;
-  numatoms = data->numatoms;
-
-  if (data->numframe != 0) {
-    fprintf(data->fp,"<%s time_step=\"%d\" natoms=\"%d\" dimensions=\"3\">\n", 
-            hoomd_tag_name[HOOMD_CONFIG],
-#if vmdplugin_ABIVERSION > 10
-            (int)(ts->physical_time+0.5f),
-#else
-            data->numframe,
-#endif
-            numatoms);
-  }
-
-  fprintf(data->fp, "<%s lx=\"%f\" ly=\"%f\" lz=\"%f\" />\n", 
-          hoomd_tag_name[HOOMD_BOX], ts->A, ts->B, ts->C);
-
-#define HOOMD_CONV_POS(crd, box, p, i)  \
-  if (fabsf(box) > SMALL) {            \
-    float tmp;                          \
-    tmp = floorf(crd / box + 0.5f);     \
-    p =  crd - tmp*box;                 \
-    i = (int) tmp;                      \
-  } else {                              \
-    p = crd;                            \
-    i = 0.0f;                           \
-  }
-
-  SECTION_OPEN(HOOMD_POS, numatoms);
-  pos = ts->coords;
-  img = data->imagecounts;
-  for (i = 0; i < numatoms; ++i) {
-    HOOMD_CONV_POS(*pos, ts->A, px, *img);
-    ++pos; ++img;
-    HOOMD_CONV_POS(*pos, ts->B, py, *img);
-    ++pos; ++img;
-    HOOMD_CONV_POS(*pos, ts->C, pz, *img);
-    ++pos; ++img;
-
-    fprintf(data->fp, "%.6f %.6f %.6f\n", px, py, pz);
-  }
-  SECTION_CLOSE(HOOMD_POS);
-
-  /* only print image section if we have (some) box info. */
-  if ( (fabsf(ts->A)+fabsf(ts->B)+fabsf(ts->C)) > SMALL) {
-    SECTION_OPEN(HOOMD_IMAGE,numatoms);
-    img = data->imagecounts;
-    for (i = 0; i < numatoms; ++i) {
-      fprintf(data->fp, "%d %d %d\n", img[0], img[1], img[2]);
-      img += 3;
-    }
-    SECTION_CLOSE(HOOMD_IMAGE);
-  }
-
-#if vmdplugin_ABIVERSION > 10
-  if (ts->velocities != NULL) {
-    const float *vel;
-
-    SECTION_OPEN(HOOMD_VEL, numatoms);
-    vel = ts->velocities;
-    for (i = 0; i < numatoms; ++i) {
-      fprintf(data->fp, "%.6f %.6f %.6f\n", vel[0], vel[1], vel[2]);
-      vel += 3;
-    }
-    SECTION_CLOSE(HOOMD_VEL);
-  }
-#endif
-
-  SECTION_CLOSE(HOOMD_CONFIG);
-  data->numframe ++;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_hoomd_write(void *mydata) {
-  hoomd_data_t *data = (hoomd_data_t *)mydata;
-  int i;
-  
-  /* we have not yet written any positions, so the configuration tag is still open. */
-  if (data->numframe == 0) {
-    SECTION_CLOSE(HOOMD_CONFIG);
-  }
-  
-
-  SECTION_CLOSE(HOOMD_XML);
-  fclose(data->fp);
-
-  if (data->numbonds > 0) {
-    free(data->from);
-    free(data->to);
-    if (data->bondtype != NULL) {
-      free(data->bondtype);
-    }
-  }
-  if (data->numbondtypes > 0) {
-    if (data->bondtypename != NULL) {
-      for (i=0; i < data->numbondtypes; ++i) {
-        free(data->bondtypename[i]);
-      }
-      free(data->bondtypename);
-    }
-  }
-  
-  if (data->numangles > 0) {
-    free(data->angle);
-    if (data->angletype != NULL) {
-      free(data->angletype);
-    }
-  }
-  if (data->numangletypes > 0) {
-    if (data->angletypename != NULL) {
-      for (i=0; i < data->numangletypes; ++i) {
-        free(data->angletypename[i]);
-      }
-      free(data->angletypename);
-    }
-  }
-
-  if (data->numdihedrals > 0) {
-    free(data->dihedral);
-    if (data->dihedraltype != NULL) {
-      free(data->dihedraltype);
-    }
-  }
-  if (data->numdihedraltypes > 0) {
-    if (data->dihedraltypename != NULL) {
-      for (i=0; i < data->numdihedraltypes; ++i) {
-        free(data->dihedraltypename[i]);
-      }
-      free(data->dihedraltypename);
-    }
-  }
-
-  if (data->numimpropers > 0) {
-    free(data->improper);
-    if (data->impropertype != NULL) {
-      free(data->impropertype);
-    }
-  }
-  if (data->numimpropertypes > 0) {
-    if (data->impropertypename != NULL) {
-      for (i=0; i < data->numimpropertypes; ++i) {
-        free(data->impropertypename[i]);
-      }
-      free(data->impropertypename);
-    }
-  }
-
-  
-  if (data->atomlist) {
-    free(data->atomlist);
-  }
-  free(data->imagecounts);
-  free(data->filename);
-  free(data);
-}
-/* cleanup, part 2 */
-#undef SECTION_OPEN
-#undef SECTION_CLOSE
-
-/* registration stuff */
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "hoomd";
-  plugin.prettyname = "HOOMD-blue XML File";
-  plugin.author = "Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 10;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "xml";
-
-  plugin.open_file_read = open_hoomd_read;
-  plugin.read_structure = read_hoomd_structure;
-  plugin.read_bonds = read_hoomd_bonds;
-  plugin.read_next_timestep = read_hoomd_timestep;
-  plugin.close_file_read = close_hoomd_read;
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-#endif
-
-  plugin.open_file_write = open_hoomd_write;
-  plugin.write_bonds = write_hoomd_bonds;
-#if vmdplugin_ABIVERSION > 9
-  plugin.read_angles = read_hoomd_angles;
-  plugin.write_angles = write_hoomd_angles;
-#endif
-  plugin.write_structure = write_hoomd_structure;
-  plugin.write_timestep = write_hoomd_timestep;
-  plugin.close_file_write = close_hoomd_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  molfile_atom_t *atoms;
-  void *v, *w;
-  int i, natoms, nbonds, optflags;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-  int nbondtypes, nangletypes, ndihtypes, nimptypes;
-  int nangles, ndihedrals, nimpropers, ncterms;
-  int ctermrows, ctermcols;
-  int *from, *to, *bondtype, *angles, *angletype, *dihedrals, *dihedraltype;
-  int *impropers, *impropertype, *cterms;
-#if vmdplugin_ABIVERSION < 16
-  double *angleforces, *dihedralforces, *improperforces, *ctermforces;
-#endif
-  float *order;
-  char **btnames, **atnames, **dtnames, **itnames;
-
-  bondtype=NULL;
-  btnames=NULL;
-  nbondtypes=0;
-  nangletypes=0;
-
-  VMDPLUGIN_init();
-  
-  while (--argc) {
-    ++argv;
-    v = open_hoomd_read(*argv, "hoomd", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_hoomd_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_hoomd_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    atoms=(molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-    if (read_hoomd_structure(v, &optflags, atoms) != MOLFILE_SUCCESS) return 1;
-#if vmdplugin_ABIVERSION > 14
-    read_hoomd_bonds(v, &nbonds, &from, &to, &order, &bondtype, &nbondtypes, &btnames);
-
-    read_hoomd_angles(v, &nangles, &angles, &angletype, &nangletypes, &atnames, 
-                      &ndihedrals, &dihedrals, &dihedraltype, &ndihtypes, &dtnames, 
-                      &nimpropers, &impropers, &impropertype, &nimptypes, &itnames,
-                      &ncterms, &cterms, &ctermcols, &ctermrows);
-#else
-    read_hoomd_bonds(v, &nbonds, &from, &to, &order);
-#if vmdplugin_ABIVERSION > 9
-    read_hoomd_angles(v, &nangles, &angles, &angleforces, &ndihedrals, 
-                      &dihedrals, &dihedralforces, &nimpropers, &impropers, 
-                      &improperforces, &ncterms, &cterms, &ctermcols, 
-                      &ctermrows, &ctermforces);
-#endif
-#endif
-    fprintf(stderr, "found: %d atoms, %d bonds, %d bondtypes, %d angles, "
-            "%d angletypes\nfound: %d dihedrals, %d impropers, %d cterms\n", 
-            natoms, nbonds, nbondtypes, nangles, nangletypes, ndihedrals,
-            nimpropers, ncterms);
-
-    fputs("ATOMS:\n", stderr);
-    for(i=0; (i<20) && (i<natoms); ++i) {
-      fprintf(stderr,"%05d: %s/%s %d\n",i+1,atoms[i].name, 
-              atoms[i].type, atoms[i].atomicnumber);
-    }
-
-    fputs("BONDS:\n", stderr);
-    if (nbonds > 0) {
-      if (bondtype && nbondtypes > 0) {
-        for(i=0; (i<20) && (i<nbonds);++i) {
-          fprintf(stderr,"%05d: %s/%d %d %d\n", i+1, btnames[bondtype[i]], 
-                  bondtype[i], from[i], to[i]);
-        }
-      } else {
-        for(i=0;(i<20) && (i<nbonds);++i) {
-          fprintf(stderr,"%05d: %d %d\n",i+1,from[i], to[i]);
-        }
-      }
-    }
-    
-#if vmdplugin_ABIVERSION > 9
-    fputs("ANGLES:\n", stderr);
-    if (nangles > 0) {
-      if (angletype && nangletypes > 0) {
-        for(i=0; (i<20) && (i<nangles);++i) {
-          fprintf(stderr,"%05d: %s/%d %d %d %d\n", i+1, atnames[angletype[i]], 
-                  angletype[i], angles[3*i], angles[3*i+1], angles[3*i+2]);
-        }
-      } else {
-        for(i=0;(i<20) && (i<nangles);++i) {
-          fprintf(stderr,"%05d: %d %d %d\n",i+1, angles[3*i], 
-                  angles[3*i+1], angles[3*i+2]);
-        }
-      }
-    }
-#endif
-    
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-#if vmdplugin_ABIVERSION > 10
-    /* XXX: this should be tested at each time step. */
-    timestep.velocities = NULL;
-    read_timestep_metadata(v,&ts_meta);
-    if (ts_meta.has_velocities) {
-      fprintf(stderr, "found timestep velocities metadata.\n");
-    }
-    timestep.velocities = (float *) malloc(3*natoms*sizeof(float));
-#endif
-
-    while (!read_hoomd_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-    if (argc < 2) {
-      w = open_hoomd_write("test.xml","hoomd",natoms);
-#if vmdplugin_ABIVERSION > 14
-      write_hoomd_bonds(w, nbonds, from, to, NULL, bondtype, nbondtypes, btnames);
-#else
-      write_hoomd_bonds(w, nbonds, from, to, NULL);
-#endif
-#if vmdplugin_ABIVERSION > 9
-#if vmdplugin_ABIVERSION > 15
-      write_hoomd_angles(w, nangles, angles, angletype, nangletypes, atnames, 
-                         ndihedrals, dihedrals, dihedraltype, ndihtypes, dtnames, 
-                         nimpropers, impropers, impropertype, nimptypes, itnames,
-                         ncterms, cterms, ctermcols, ctermrows);
-#else
-      write_hoomd_angles(w, nangles, angles, NULL, ndihedrals, dihedrals, NULL,
-                         nimpropers, impropers, NULL, ncterms, cterms, 
-                         ctermcols, ctermrows, NULL);
-#endif
-#endif
-      write_hoomd_structure(w, optflags, atoms);
-      write_hoomd_timestep(w, &timestep);
-      close_hoomd_write(w);
-      fprintf(stderr, "done with writing hoomd file test.xml.\n");
-    }
-    close_hoomd_read(v);
-    
-    free(atoms);
-    free(timestep.coords);
-#if vmd_ABIVERSION > 10
-    free(timestep.velocities);
-#endif
-  }
-  VMDPLUGIN_fini();
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/inthash.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/inthash.c
deleted file mode 100755
index 661aeb20a54c22b93d63e165f9b08cb691809a1b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/inthash.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: inthash.c,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for ints, contributed by John Stone,
- *   derived from his ray tracer code.
- * NOTES: - this can only used for _positive_ data values (HASH_FAIL is -1)
- *        - this code is slightly modified from the version in VMD
- *          so that both, the string hash and the int hash can be used.
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "inthash.h"
-
-#define HASH_LIMIT 0.5
-
-/** hash table node data structure */
-typedef struct inthash_node_t {
-  int data;                           /* data in hash node */
-  int key;                            /* key for hash lookup */
-  struct inthash_node_t *next;        /* next node in hash chain */
-} inthash_node_t;
-
-/*
- *  inthash() - Hash function returns a hash number for a given key.
- *
- *  tptr: Pointer to a hash table
- *  key: The key to create a hash number for
- */
-static int inthash(const inthash_t *tptr, int key) {
-  int hashvalue;
-
-  hashvalue = (((key*1103515249)>>tptr->downshift) & tptr->mask);
-  if (hashvalue < 0) {
-    hashvalue = 0;
-  }    
-
-  return hashvalue;
-}
-
-/*
- *  inthash_init() - Initialize a new hash table.
- *
- *  tptr: Pointer to the hash table to initialize
- *  buckets: The number of initial buckets to create
- */
-VMDEXTERNSTATIC void inthash_init(inthash_t *tptr, int buckets) {
-
-  /* make sure we allocate something */
-  if (buckets==0)
-    buckets=16;
-
-  /* initialize the table */
-  tptr->entries=0;
-  tptr->size=2;
-  tptr->mask=1;
-  tptr->downshift=29;
-
-  /* ensure buckets is a power of 2 */
-  while (tptr->size<buckets) {
-    tptr->size<<=1;
-    tptr->mask=(tptr->mask<<1)+1;
-    tptr->downshift--;
-  } /* while */
-
-  /* allocate memory for table */
-  tptr->bucket=(inthash_node_t **) calloc(tptr->size, sizeof(inthash_node_t *));
-
-  return;
-}
-
-/*
- *  rebuild_table_int() - Create new hash table when old one fills up.
- *
- *  tptr: Pointer to a hash table
- */
-static void rebuild_table_int(inthash_t *tptr) {
-  inthash_node_t **old_bucket, *old_hash, *tmp;
-  int old_size, h, i;
-
-  old_bucket=tptr->bucket;
-  old_size=tptr->size;
-
-  /* create a new table and rehash old buckets */
-  inthash_init(tptr, old_size<<1);
-  for (i=0; i<old_size; i++) {
-    old_hash=old_bucket[i];
-    while(old_hash) {
-      tmp=old_hash;
-      old_hash=old_hash->next;
-      h=inthash(tptr, tmp->key);
-      tmp->next=tptr->bucket[h];
-      tptr->bucket[h]=tmp;
-      tptr->entries++;
-    } /* while */
-  } /* for */
-
-  /* free memory used by old table */
-  free(old_bucket);
-
-  return;
-}
-
-/*
- *  inthash_lookup() - Lookup an entry in the hash table and return a pointer to
- *    it or HASH_FAIL if it wasn't found.
- *
- *  tptr: Pointer to the hash table
- *  key: The key to lookup
- */
-VMDEXTERNSTATIC int inthash_lookup(const inthash_t *tptr, int key) {
-  int h;
-  inthash_node_t *node;
-
-
-  /* find the entry in the hash table */
-  h=inthash(tptr, key);
-  for (node=tptr->bucket[h]; node!=NULL; node=node->next) {
-    if (node->key == key)
-      break;
-  }
-
-  /* return the entry if it exists, or HASH_FAIL */
-  return(node ? node->data : HASH_FAIL);
-}
-
-/*
- *  inthash_insert() - Insert an entry into the hash table.  If the entry already
- *  exists return a pointer to it, otherwise return HASH_FAIL.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to insert into the hash table
- *  data: A pointer to the data to insert into the hash table
- */
-VMDEXTERNSTATIC int inthash_insert(inthash_t *tptr, int key, int data) {
-  int tmp;
-  inthash_node_t *node;
-  int h;
-
-  /* check to see if the entry exists */
-  if ((tmp=inthash_lookup(tptr, key)) != HASH_FAIL)
-    return(tmp);
-
-  /* expand the table if needed */
-  while (tptr->entries>=HASH_LIMIT*tptr->size)
-    rebuild_table_int(tptr);
-
-  /* insert the new entry */
-  h=inthash(tptr, key);
-  node=(struct inthash_node_t *) malloc(sizeof(inthash_node_t));
-  node->data=data;
-  node->key=key;
-  node->next=tptr->bucket[h];
-  tptr->bucket[h]=node;
-  tptr->entries++;
-
-  return HASH_FAIL;
-}
-
-/*
- *  inthash_delete() - Remove an entry from a hash table and return a pointer
- *  to its data or HASH_FAIL if it wasn't found.
- *
- *  tptr: A pointer to the hash table
- *  key: The key to remove from the hash table
- */
-VMDEXTERNSTATIC int inthash_delete(inthash_t *tptr, int key) {
-  inthash_node_t *node, *last;
-  int data;
-  int h;
-
-  /* find the node to remove */
-  h=inthash(tptr, key);
-  for (node=tptr->bucket[h]; node; node=node->next) {
-    if (node->key == key)
-      break;
-  }
-
-  /* Didn't find anything, return HASH_FAIL */
-  if (node==NULL)
-    return HASH_FAIL;
-
-  /* if node is at head of bucket, we have it easy */
-  if (node==tptr->bucket[h])
-    tptr->bucket[h]=node->next;
-  else {
-    /* find the node before the node we want to remove */
-    for (last=tptr->bucket[h]; last && last->next; last=last->next) {
-      if (last->next==node)
-        break;
-    }
-    last->next=node->next;
-  }
-
-  /* free memory and return the data */
-  data=node->data;
-  free(node);
-
-  return(data);
-}
-
-
-/*
- * inthash_entries() - return the number of hash table entries.
- *
- */
-VMDEXTERNSTATIC int inthash_entries(inthash_t *tptr) {
-  return tptr->entries;
-}
-
-
-/*
- * inthash_destroy() - Delete the entire table, and all remaining entries.
- * 
- */
-VMDEXTERNSTATIC void inthash_destroy(inthash_t *tptr) {
-  inthash_node_t *node, *last;
-  int i;
-
-  for (i=0; i<tptr->size; i++) {
-    node = tptr->bucket[i];
-    while (node != NULL) { 
-      last = node;   
-      node = node->next;
-      free(last);
-    }
-  }     
-
-  /* free the entire array of buckets */
-  if (tptr->bucket != NULL) {
-    free(tptr->bucket);
-    memset(tptr, 0, sizeof(inthash_t));
-  }
-}
-
-/*
- *  alos_int() - Find the average length of search.
- *
- *  tptr: Pointer to a hash table
- */
-static float alos_int(inthash_t *tptr) {
-  int i,j;
-  float alos_int=0;
-  inthash_node_t *node;
-
-
-  for (i=0; i<tptr->size; i++) {
-    for (node=tptr->bucket[i], j=0; node!=NULL; node=node->next, j++);
-    if (j)
-      alos_int+=((j*(j+1))>>1);
-  } /* for */
-
-  return(tptr->entries ? alos_int/tptr->entries : 0);
-}
-
-
-/*
- *  inthash_stats() - Return a string with stats about a hash table.
- *
- *  tptr: A pointer to the hash table
- */
-VMDEXTERNSTATIC char * inthash_stats(inthash_t *tptr) {
-  static char buf[1024];
-
-  sprintf(buf, "%u slots, %u entries, and %1.2f ALOS",
-    (int)tptr->size, (int)tptr->entries, alos_int(tptr));
-
-  return(buf);
-}
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/inthash.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/inthash.h
deleted file mode 100755
index b4c9e0e6e5e2b2d4cd2a6c8982be40532fdcd02a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/inthash.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: inthash.h,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.4 $      $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   A simple hash table implementation for ints, contributed by John Stone,
- *   derived from his ray tracer code.
- * NOTES: - this can only used for _positive_ data values (HASH_FAIL is -1)
- *        - this code is slightly modified from the version in VMD
- *          so that both, the string hash and the int hash can be used.
- ***************************************************************************/
-#ifndef INTHASH_H
-#define INTHASH_H
-
-/** hash table top level data structure */
-typedef struct inthash_t {
-  struct inthash_node_t **bucket;        /* array of hash nodes */
-  int size;                           /* size of the array */
-  int entries;                        /* number of entries in table */
-  int downshift;                      /* shift cound, used in hash function */
-  int mask;                           /* used to select bits for hashing */
-} inthash_t;
-
-#define HASH_FAIL -1
-
-#if defined(VMDPLUGIN_STATIC)
-#define VMDEXTERNSTATIC static
-#include "inthash.c"
-#else
-
-#define VMDEXTERNSTATIC 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** initialize hash table for first use */
-void inthash_init(inthash_t *, int);
-
-/** lookup a string key in the hash table returning its integer key */
-int inthash_lookup(const inthash_t *, int);
-
-/** insert a string into the hash table, along with an integer key */
-int inthash_insert(inthash_t *, int, int);
-
-/** delete an string from the hash table, given its string name */
-int inthash_delete(inthash_t *, int);
-
-/** return the number of entries in the hash table */
-int inthash_entries(inthash_t *);
-
-/** destroy the hash table completely, deallocate memory */
-void inthash_destroy(inthash_t *);
-
-/** print hash table vital stats */
-char *inthash_stats(inthash_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/jsplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/jsplugin.c
deleted file mode 100644
index 50a3f1b0b52226c4ed03a567ea5f91c0e2b68f5d..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/jsplugin.c
+++ /dev/null
@@ -1,2157 +0,0 @@
-/***************************************************************************
- *cr                                                                       
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the           
- *cr                        University of Illinois                       
- *cr                         All Rights Reserved                        
- *cr                                                                   
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: jsplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.77 $       $Date: 2016/11/30 23:28:53 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   This plugin implements a high-performance binary molecular structure
- *   and trajectory storage format.  This file format currently uses a simple 
- *   non-redundant hash table approach for compression of per-atom
- *   character strings, properties, and tags.  Trajectory data is stored 
- *   with a file structure that avoids the need to transpose or convert
- *   dense blocks of cartesian coordinates into the most commonly used
- *   interleaved  x/y/z ordering.  The file structure also enables zero-copy 
- *   vectorized I/O methods to be used high-performance reads for 
- *   visualization and analysis with reduced operating system overhead.
- *   The plugin optionally supports the use of a block-based file structure
- *   and block-aligned memory buffers for direct I/O that bypasses the 
- *   OS filesystem buffer caches for multi-gigabyte-per-second read rates
- *   from SSD RAID arrays.
- *
- *   At present, only VMD, NAMD, and psfgen make use of this format.
- *   It started out as a test/example code and is slowly becoming
- *   more robust and featureful.
- *
- *   We should be able to implement a selective read approach that gathers
- *   discontiguous blocks of the trajectory using the POSIX lio_listio()
- *   APIs.  On Unix we currently use I/O wrappers that are based on the 
- *   lseek() and readv() APIs.  By using lio_listio() we could eliminate
- *   the separate lseek calls and service multiple timestep reads in a 
- *   single request, even included cases with discontiguous requests.
- *
- *   VMD test results for Linux host with an 8-way RAID0 of commodity 
- *   Intel 510 SSDs with SATA III 6Gbit/sec interfaces:
- *     Non-direct I/O using standard readv(): 1203 MB/sec
- *     Direct I/O, readv(), 4KB blocked file: 2130 MB/sec
- *
- *  Standalone test binary compilation flags for 64-bit Linux:
- *  cc -O3 -m64 -I../../include -DTEST_JSPLUGIN jsplugin.c \
- *    -o ~/bin/readjs -lm
- *  
- *  Standalone test binary compilation flags for 64-bit Linux w/ CUDA:
- *  cc -O3 -m64 -I../../include -I/usr/local/encap/cuda-4.0/include \
- *    -DTEST_JSPLUGIN -DENABLECUDATESTS jsplugin.c \
- *    -o ~/bin/readjs -L/usr/local/encap/cuda-4.0/lib64 -lcudart -lm
- *
- *  Standalone test binary compilation flags for Solaris:
- *  cc -fast -xarch=v9a -I../../include -DTEST_JSPLUGIN jsplugin.c \
- *    -o ~/bin/readjs -lm
- *
- *  Profiling flags for Solaris:
- *  cc -xpg -fast -xarch=v9a -g -I../../include -DTEST_JSPLUGIN jsplugin.c \
- *    -o ~/bin/readjs -lm
- *
- ***************************************************************************/
-
-#define INFOMSGS  1
-
-#if 1
-#define ENABLEJSSHORTREADS 1
-#endif
-
-#define VMDPLUGIN_STATIC
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-#include "fastio.h"       /* must come before others, for O_DIRECT...   */
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "hash.h"
-#include "endianswap.h"
-#include "molfile_plugin.h"
-
-
-/* allocate memory and return a pointer that is aligned on a given   */
-/* byte boundary, to be used for page- or sector-aligned I/O buffers */
-/* We use this if posix_memalign() is not available...               */
-#if 1 /* sizeof(unsigned long) == sizeof(void*) */
-#define myintptrtype unsigned long
-#elif 1   /* sizeof(size_t) == sizeof(void*) */
-#define myintptrtype size_t
-#else
-#define myintptrtype uintptr_t  /* C99 */
-#endif
-/*
- * XXX On MSVC we get warnings about type conversions for 
- *     size_t vs. fio_size_t
- */
-static void *alloc_aligned_ptr(size_t sz, size_t blocksz, void **unalignedptr) {
-  /* pad the allocation to an even multiple of the block size */
-  size_t padsz = (sz + (blocksz - 1)) & (~(blocksz - 1));
-  void * ptr = malloc(padsz + blocksz);
-  *unalignedptr = ptr;
-  return (void *) ((((myintptrtype) ptr) + (blocksz-1)) & (~(blocksz-1)));
-}
-
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#define JSHEADERSTRING   "JS Binary Structure and Trajectory File Format"                
-#define JSMAGICNUMBER    0x31337
-#define JSENDIANISM      0x12345678
-
-#define JSMAJORVERSION   2
-#define JSMINORVERSION   15
-
-#define JSNFRAMESOFFSET  (strlen(JSHEADERSTRING) + 20)
-
-#define JSNOERR             0
-#define JSBADFILE           1
-#define JSBADFORMAT         2
-
-
-/* Threshold atom count beyond which block-based I/O is used by default */
-/* The overhead from block-alignment padding bytes becomes essentially  */
-/* inconsequential (< 1%) for structures with more than 50,000 atoms.   */
-#define JSBLOCKIO_THRESH    50000
-
-
-/* Option flag macros and their meanings */
-#define JSOPT_NOOPTIONS     0x00000000  /* no structure, only coords    */
-
-/* Timesteps are block-size padded and page- or sector-aligned for      */
-/* direct I/O, using  OS-specific APIs that completely bypass the OS    */
-/* kernel filesystem buffer cache.                                      */
-/* The use of direct I/O APIs can raise performance tremendously on     */
-/* high-end RAIDs.  Tests on an 8-way RAID0 of Intel 510 SSDs raise the */
-/* peak I/O rate from 1100 MB/sec up to 2020 MB/sec with direct I/O.    */
-#define JSOPT_TS_BLOCKIO    0x10000000
-
-/* large data blocks */
-#define JSOPT_STRUCTURE     0x00000001  /* file contains structure data */
-#define JSOPT_BONDS         0x00000002  /* file contains bond info      */
-#define JSOPT_BONDORDERS    0x00000004  /* file contains bond orders    */
-#define JSOPT_ANGLES        0x00000008  /* file contains angle info     */
-#define JSOPT_CTERMS        0x00000010  /* file contains cross-terms    */
-
-/* optional per-atom fields */
-#define JSOPT_OCCUPANCY     0x00000100  /* file contains occupancy      */
-#define JSOPT_BFACTOR       0x00000200  /* file contains b-factor       */
-#define JSOPT_MASS          0x00000400  /* file contains masses         */
-#define JSOPT_CHARGE        0x00000800  /* file contains charges        */
-#define JSOPT_RADIUS        0x00001000  /* file contains radii          */
-#define JSOPT_ATOMICNUMBER  0x00002000  /* file contains atomic numbers */
-
-typedef struct {
-  int verbose;                 /* flag to enable console info output    */
-  fio_fd fd;                   /* main file descriptor                  */
-  long natoms;                 /* handle uses a long type for natoms to */
-                               /* help force promotion of file offset   */
-                               /* arithmetic to long types              */
-
-#if JSMAJORVERSION > 1
-  int parsed_structure;        /* flag indicating structure is parsed   */
-  char *path;                  /* path to file                          */
-
-  /* info for block-based direct I/O */ 
-  int directio_enabled;        /* block-based direct I/O is available   */
-  fio_fd directio_fd;          /* block-based direct I/O using O_DIRECT */
-  int directio_block_size;     /* block size to use for direct ts I/O   */
-  void *directio_ucell_ptr;    /* unaligned unit cell buffer ptr        */
-  void *directio_ucell_blkbuf; /* block-aligned unit cell buffer pt r   */
-
-  /* timestep file offset, block padding, and stride information */
-  fio_size_t ts_file_offset;   /* file offset to first timestep         */
-  fio_size_t ts_crd_sz;        /* size of TS coordinates                */
-  fio_size_t ts_crd_padsz;     /* size of TS block-padded coordinates   */
-  fio_size_t ts_ucell_sz;      /* size of TS unit cell                  */
-  fio_size_t ts_ucell_padsz;   /* size of TS block-padded unit cell     */
-  
-  /* structure info */
-  int optflags;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-
-  /* bond info */
-  int nbonds;
-  int *bondfrom;
-  int *bondto;
-  float *bondorders;
-
-  /* angle/dihedral/improper/cross-term info */
-  int numangles, *angles;
-  int numdihedrals, *dihedrals;
-  int numimpropers, *impropers;
-  int numcterms, *cterms;
-#endif
-
-  /* trajectory info */
-  int nframes;
-  double tsdelta;
-  int reverseendian;
-  int with_unitcell;
-
-} jshandle;
-
-
-/* Use block-based I/O by default when writing structures larger */
-/* than JSBLOCKIO_THRESH atoms, or when directed by the user and */
-/* not otherwise prohibited...                                   */
-static int js_blockio_check_and_set(jshandle *js) {
-  if ((getenv("VMDJSNOBLOCKIO") == NULL) && 
-      ((js->natoms > JSBLOCKIO_THRESH) || getenv("VMDJSBLOCKIO"))) {
-    js->optflags |= JSOPT_TS_BLOCKIO;
-    js->directio_block_size = MOLFILE_DIRECTIO_MIN_BLOCK_SIZE; 
-  }
-}
-
-
-static void *open_js_read(const char *path, const char *filetype, int *natoms) {
-  jshandle *js;
-  int jsmagicnumber, jsendianism, jsmajorversion, jsminorversion;
-  struct stat stbuf;
-  char strbuf[1024];
-  int tmpnatoms=0;
-
-  if (!path) return NULL;
-
-  /* See if the file exists, and get its size */
-  memset(&stbuf, 0, sizeof(struct stat));
-  if (stat(path, &stbuf)) {
-    printf("jsplugin) Could not access file '%s'.\n", path);
-    perror("jsplugin) stat: ");
-/*    return NULL; */
-  }
-
-  js = (jshandle *)malloc(sizeof(jshandle));
-  memset(js, 0, sizeof(jshandle));
-  js->verbose = (getenv("VMDJSVERBOSE") != NULL);
-#if JSMAJORVERSION > 1
-  js->parsed_structure=0;
-  js->directio_block_size=1;
-  js->directio_ucell_ptr = NULL;
-  js->directio_ucell_blkbuf = NULL;
-
-  js->directio_enabled=0;
-  js->ts_file_offset=0;
-  js->ts_crd_sz=0;
-  js->ts_ucell_sz=0;
-  js->ts_crd_padsz=0;
-  js->ts_ucell_padsz=0;
-#endif
-
-  if (fio_open(path, FIO_READ, &js->fd) < 0) {
-    printf("jsplugin) Could not open file '%s' for reading.\n", path);
-    free(js);
-    return NULL;
-  }
-
-  /* emit header information */
-  fio_fread(strbuf, strlen(JSHEADERSTRING), 1, js->fd);
-  strbuf[strlen(JSHEADERSTRING)] = '\0';
-  if (strcmp(strbuf, JSHEADERSTRING)) {
-    printf("jsplugin) Bad trajectory header!\n");
-    printf("jsplugin) Read string: %s\n", strbuf);
-    fio_fclose(js->fd);
-    free(js);
-    return NULL;
-  }
-
-  fio_read_int32(js->fd, &jsmagicnumber);
-  fio_read_int32(js->fd, &jsendianism);
-  fio_read_int32(js->fd, &jsmajorversion);
-  fio_read_int32(js->fd, &jsminorversion);
-  fio_read_int32(js->fd, &tmpnatoms); /* handle-internal natoms is a long */
-  fio_read_int32(js->fd, &js->nframes);
-  if ((jsmagicnumber != JSMAGICNUMBER) || (jsendianism != JSENDIANISM)) {
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) opposite endianism file, enabling byte swapping\n");
-#endif
-    js->reverseendian = 1;
-    swap4_aligned(&jsmagicnumber, 1);
-    swap4_aligned(&jsendianism, 1);
-    swap4_aligned(&jsmajorversion, 1);
-    swap4_aligned(&jsminorversion, 1);
-    swap4_aligned(&tmpnatoms, 1); /* handle-internal natoms is a long */
-    swap4_aligned(&js->nframes, 1);
-  } else {
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) native endianism file\n");
-#endif
-  }
-
-  if ((jsmagicnumber != JSMAGICNUMBER) || (jsendianism != JSENDIANISM)) {
-    fio_fclose(js->fd);
-    free(js);
-    return NULL;
-  }
- 
-  if (jsmajorversion != JSMAJORVERSION) {
-    printf("jsplugin) major version mismatch\n");
-    printf("jsplugin)   file version: %d\n", jsmajorversion);
-    printf("jsplugin)   plugin version: %d\n", JSMAJORVERSION);
-    fio_fclose(js->fd);
-    free(js);
-    return NULL;
-  }
-
-  /* Copy integer natoms to handle natoms, which is a long. */
-  /* The handle natoms uses long to help force promotion of */
-  /* integer file offset calculations to long types...      */
-  js->natoms = tmpnatoms;
-  *natoms = tmpnatoms;
-
-  /* copy path if we succeeded in opening the file */
-  js->path = (char *) calloc(strlen(path)+1, 1);
-  strcpy(js->path, path);
-
-  return js;
-}
-
-
-#if JSMAJORVERSION > 1
-
-/* Compute the file offset for the first timestep and move */
-/* the file pointer to the correct position to read/write  */
-/* the first timestep.  Takes care of block alignment when */
-/* needed.                                                 */ 
-static int js_calc_timestep_blocking_info(void *mydata) {
-  fio_size_t ts_block_offset, bszmask;
-  jshandle *js = (jshandle *) mydata;
-  int iorc=0;
-
-  /* Record the current file offset so we can use it to */
-  /* compute the absolute offset to the first timestep. */
-  js->ts_file_offset = fio_ftell(js->fd);
-
-  /* pad current offset to the start of the next block  */ 
-  bszmask = js->directio_block_size - 1;
-  ts_block_offset = (js->ts_file_offset + bszmask) & (~bszmask);
-
-#if defined(INFOMSGS)
-  if (js->verbose) {
-    printf("jsplugin) TS block size %ld  curpos: %ld  blockpos: %ld\n", 
-           (long) js->directio_block_size, 
-           (long) js->ts_file_offset, 
-           (long) ts_block_offset);
-  }
-#endif
-
-  /* seek to the first block of the first timestep */
-  js->ts_file_offset = ts_block_offset;
-  if (js->directio_enabled)
-    iorc = fio_fseek(js->directio_fd, js->ts_file_offset, FIO_SEEK_SET);
-  else
-    iorc = fio_fseek(js->fd, js->ts_file_offset, FIO_SEEK_SET);
-  if (iorc < 0) {
-    perror("jsplugin) fseek(): ");
-  }
-
-  /* compute timestep block padding/skipping for both */
-  /* coordinate blocks and unit cell blocks           */
-  js->ts_crd_sz = js->natoms * 3L * sizeof(float);
-  js->ts_crd_padsz = (js->ts_crd_sz + bszmask) & (~bszmask);
-
-  js->ts_ucell_sz = 6L * sizeof(double);
-  js->ts_ucell_padsz = (js->ts_ucell_sz + bszmask) & (~bszmask);
-
-  /* allocate TS unit cell buffer in an aligned, block-size-multiple buffer */
-  /* unaligned unit cell buffer ptr */
-#if defined(USE_POSIX_MEMALIGN)
-  if (posix_memalign((void**) &js->directio_ucell_ptr, 
-      js->directio_block_size, js->ts_ucell_padsz)) {
-    printf("jsplugin) Couldn't allocate aligned unit cell block buffer!\n");
-  }
-  /* the returned pointer is already block-aligned, and can free() */
-  js->directio_ucell_blkbuf = js->directio_ucell_ptr;
-#else
-  js->directio_ucell_blkbuf = (float *) 
-    alloc_aligned_ptr(js->ts_ucell_padsz, js->directio_block_size, 
-                      (void**) &js->directio_ucell_ptr);
-#endif
-
-#if defined(INFOMSGS)
-  if (js->verbose) {
-    printf("jsplugin) TS crds sz: %ld psz: %ld  ucell sz: %ld psz: %ld\n",
-           (long) js->ts_crd_sz,
-           (long) js->ts_crd_padsz, 
-           (long) js->ts_ucell_sz, 
-           (long) js->ts_ucell_padsz);
-  }
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_js_structure(void *mydata, int *optflags,
-                             molfile_atom_t *atoms) {
-  jshandle *js = (jshandle *) mydata;
-  long i;
-
-  if (optflags != NULL)
-    *optflags = MOLFILE_NOOPTIONS; /* set to no options until we read them */
-
-  /* read flags data from the file */
-  fio_read_int32(js->fd, &js->optflags); 
-  if (js->reverseendian)
-    swap4_aligned(&js->optflags, 1);
-
-#if defined(INFOMSGS)
-  if (js->verbose)
-    printf("jsplugin) read option flags: %0x08x\n", js->optflags);
-#endif
-
-  /* Check to see if block-based trajectory I/O is used  */
-  /* and read in the block size for this file.           */
-  if (js->optflags & JSOPT_TS_BLOCKIO) {
-    fio_fread(&js->directio_block_size, sizeof(int), 1, js->fd);
-    if (js->reverseendian)
-      swap4_aligned(&js->directio_block_size, 1);
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) Block-based I/O enabled: block size %d bytes\n", 
-             js->directio_block_size);
-    }
-#endif
-
-    /* Check to ensure that we can handle the block size used by the */
-    /* file we are reading.  We may use variable block sizes in      */
-    /* the future as more high-end filesystems begin to support      */
-    /* 8KB, 16KB, or larger block sizes for enhanced sequential I/O  */
-    /* performance on very large files.                              */
-    if (js->directio_block_size > MOLFILE_DIRECTIO_MAX_BLOCK_SIZE) {
-      printf("jsplugin) File block size exceeds jsplugin block size limit.\n");
-      printf("jsplugin) Direct I/O unavailable for file '%s'\n", js->path);
-    } else {
-      if (fio_open(js->path, FIO_READ | FIO_DIRECT, &js->directio_fd) < 0) {
-        printf("jsplugin) Direct I/O unavailable for file '%s'\n", js->path);
-      } else {
-        js->directio_enabled = 1;
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin) Direct I/O enabled for file '%s'\n", js->path);
-        }
-#endif
-      } 
-    }
-  }
-
-#if defined(ENABLEJSSHORTREADS)
-  /* test code for an implementation that does short reads that */
-  /* skip bulk solvent, useful for faster loading of very large */
-  /* structures                                                 */
-  if (getenv("VMDJSMAXATOMIDX") != NULL) {
-    long maxatomidx = atoi(getenv("VMDJSMAXATOMIDX"));
-    if (maxatomidx < 0)
-      maxatomidx = 0;
-    if (maxatomidx >= js->natoms)
-      maxatomidx = js->natoms - 1;
-
-    printf("jsplugin) Short-reads of timesteps enabled: %ld / %ld atoms (%.2f%%)\n",
-           maxatomidx, js->natoms, 100.0*(maxatomidx+1) / ((double) js->natoms));
-  }
-#endif
-
-  /* Mark the handle to indicate we've parsed the structure.             */
-  /* If any errors occur after this point, they are likely fatal anyway. */
-  js->parsed_structure = 1;
-
-  /* determine whether or not this file contains structure info or not */
-  if (js->optflags & JSOPT_STRUCTURE) {
-    int numatomnames, numatomtypes, numresnames, numsegids, numchains;
-    char **atomnames = NULL;
-    char **atomtypes = NULL;
-    char **resnames = NULL;
-    char **segids = NULL;
-    char **chains = NULL;
-    short *shortbuf = NULL; /* temp buf for decoding atom records */
-    int *intbuf = NULL;     /* temp buf for decoding atom records */
-    float *fltbuf = NULL;   /* temp buf for decoding atom records */
- 
-    /* read in block of name string table sizes */
-    fio_read_int32(js->fd, &numatomnames); 
-    fio_read_int32(js->fd, &numatomtypes); 
-    fio_read_int32(js->fd, &numresnames);
-    fio_read_int32(js->fd, &numsegids);
-    fio_read_int32(js->fd, &numchains); 
-    if (js->reverseendian) {
-      swap4_aligned(&numatomnames, 1);
-      swap4_aligned(&numatomtypes, 1);
-      swap4_aligned(&numresnames, 1);
-      swap4_aligned(&numsegids, 1);
-      swap4_aligned(&numchains, 1);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) reading string tables...\n");
-      printf("jsplugin) %d %d %d %d %d\n",
-             numatomnames, numatomtypes, numresnames, numsegids, numchains);
-    }
-#endif
-
-    /* skip forward to first TS if the caller gives us NULL ptrs */
-    if (optflags == NULL && atoms == NULL) {
-      size_t offset=0;
-      offset += numatomnames * (16L * sizeof(char));
-      offset += numatomtypes * (16L * sizeof(char));
-      offset += numresnames  * (8L * sizeof(char));
-      offset += numsegids    * (8L * sizeof(char));
-      offset += numchains    * (2L * sizeof(char));
-      offset += js->natoms * sizeof(short); /* atom name indices    */
-      offset += js->natoms * sizeof(short); /* atom type indices    */
-      offset += js->natoms * sizeof(short); /* residue name indices */
-      offset += js->natoms * sizeof(short); /* segment name indices */
-      offset += js->natoms * sizeof(short); /* chain name indices   */
-      offset += js->natoms * sizeof(int);   /* residue indices      */
-      
-      /* optional per-atom fields */
-      if (js->optflags & JSOPT_OCCUPANCY)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_BFACTOR)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_MASS)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_CHARGE)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_RADIUS)
-        offset += js->natoms * sizeof(float); 
-      if (js->optflags & JSOPT_ATOMICNUMBER)
-        offset += js->natoms * sizeof(int);
-
-      fio_fseek(js->fd, offset, FIO_SEEK_CUR);
-      offset=0;
-
-      /* these require actually seeking as we process... */
-      if (js->optflags & JSOPT_BONDS) {
-        fio_fread(&js->nbonds, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->nbonds, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d bonds...\n", js->nbonds);
-        }
-#endif
-
-        offset += 2L * js->nbonds * sizeof(int);
-        if (js->optflags & JSOPT_BONDORDERS)
-          offset += js->nbonds * sizeof(float);
-
-        fio_fseek(js->fd, offset, FIO_SEEK_CUR);
-        offset=0;
-      }
-
-      if (js->optflags & JSOPT_ANGLES) {
-        fio_fread(&js->numangles, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numangles, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d angles...\n", js->numangles);
-        }
-#endif
-        fio_fseek(js->fd, sizeof(int)*3L*js->numangles, FIO_SEEK_CUR);
-
-        fio_fread(&js->numdihedrals, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numdihedrals, 1);
-#if defined(INFOMSGS)
-        printf("jsplugin)   %d dihedrals...\n", js->numdihedrals);
-#endif
-        fio_fseek(js->fd, sizeof(int)*4L*js->numdihedrals, FIO_SEEK_CUR);
-
-        fio_fread(&js->numimpropers, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numimpropers, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d impropers...\n", js->numimpropers);
-        }
-#endif
-        fio_fseek(js->fd, sizeof(int)*4L*js->numimpropers, FIO_SEEK_CUR);
-      }
-
-      if (js->optflags & JSOPT_CTERMS) {
-        fio_fread(&js->numcterms, sizeof(int), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(&js->numcterms, 1);
-#if defined(INFOMSGS)
-        if (js->verbose) {
-          printf("jsplugin)   %d cterms...\n", js->numcterms);
-        }
-#endif
-        fio_fseek(js->fd, sizeof(int)*8L*js->numcterms, FIO_SEEK_CUR);
-      }
-  
-      /* record the file offset for the first timestep */
-      js_calc_timestep_blocking_info(js);
-
-      return MOLFILE_SUCCESS;
-    }
-
-
-    /* allocate string tables */
-    atomnames = (char **) malloc(numatomnames * sizeof(char *));
-    atomtypes = (char **) malloc(numatomtypes * sizeof(char *));
-    resnames  = (char **) malloc(numresnames  * sizeof(char *));
-    segids    = (char **) malloc(numsegids    * sizeof(char *));
-    chains    = (char **) malloc(numchains    * sizeof(char *));
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom names...\n");
-#endif
-
-    /* read in the string tables */
-    for (i=0; i<numatomnames; i++) {
-      atomnames[i] = (char *) malloc(16L * sizeof(char));
-      fio_fread(atomnames[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom types...\n");
-#endif
-    for (i=0; i<numatomtypes; i++) {
-      atomtypes[i] = (char *) malloc(16L * sizeof(char));
-      fio_fread(atomtypes[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   residue names...\n");
-#endif
-    for (i=0; i<numresnames; i++) {
-      resnames[i] = (char *) malloc(8L * sizeof(char));
-      fio_fread(resnames[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   segment names...\n");
-#endif
-    for (i=0; i<numsegids; i++) {
-      segids[i] = (char *) malloc(8L * sizeof(char));
-      fio_fread(segids[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   chain names...\n");
-#endif
-    for (i=0; i<numchains; i++) {
-      chains[i] = (char *) malloc(2L * sizeof(char));
-      fio_fread(chains[i], 2L * sizeof(char), 1, js->fd);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) reading numeric field tables...\n");
-#endif
-    /* read in all of the atom fields */
-    shortbuf = (short *) malloc(js->natoms * sizeof(short));
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom name indices...\n");
-#endif
-    /* read in atom names */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].name, atomnames[shortbuf[i]]);
-    }
-    for (i=0; i<numatomnames; i++)
-      free(atomnames[i]);
-    free(atomnames);
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   atom type indices...\n");
-#endif
-    /* read in atom types */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].type, atomtypes[shortbuf[i]]);
-    }
-    for (i=0; i<numatomtypes; i++)
-      free(atomtypes[i]);
-    free(atomtypes);
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   residue name indices...\n");
-#endif
-    /* read in resnames */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].resname, resnames[shortbuf[i]]);
-    }
-    for (i=0; i<numresnames; i++)
-      free(resnames[i]);
-    free(resnames);
-    
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   segment name indices...\n");
-#endif
-    /* read in segids */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].segid, segids[shortbuf[i]]);
-    }
-    for (i=0; i<numsegids; i++)
-      free(segids[i]);
-    free(segids);
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   chain name indices...\n");
-#endif
-    /* read in chains */
-    fio_fread(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    if (js->reverseendian)
-      swap2_aligned(shortbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      strcpy(atoms[i].chain, chains[shortbuf[i]]);
-    }
-    for (i=0; i<numchains; i++)
-      free(chains[i]);
-    free(chains);
-
-    if (shortbuf != NULL) {
-      free(shortbuf);
-      shortbuf=NULL;
-    }
-
-    /* 
-     * read in integer data blocks 
-     */
-    intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin)   residue indices...\n");
-#endif
-    /* read in resid */
-    fio_fread(intbuf, js->natoms * sizeof(int), 1, js->fd);
-    if (js->reverseendian)
-      swap4_aligned(intbuf, js->natoms);
-    for (i=0; i<js->natoms; i++) {
-      atoms[i].resid = intbuf[i];
-    }    
-     
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-
-#if defined(INFOMSGS)
-    if (js->verbose)
-      printf("jsplugin) reading optional per-atom tables...\n");
-#endif
-    /*
-     * read in optional single-precision float data blocks
-     */ 
-    if (js->optflags & (JSOPT_OCCUPANCY | JSOPT_BFACTOR | 
-        JSOPT_MASS | JSOPT_RADIUS | JSOPT_CHARGE)) 
-      fltbuf = (float *) malloc(js->natoms * sizeof(float));
-
-    /* read in optional data if it exists */
-    if (js->optflags & JSOPT_OCCUPANCY) {
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   occupancy...\n");
-#endif
-      *optflags |= MOLFILE_OCCUPANCY;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].occupancy = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_BFACTOR) {
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   bfactor...\n");
-#endif
-      *optflags |= MOLFILE_BFACTOR;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].bfactor = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_MASS) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   mass...\n");
-#endif
-      *optflags |= MOLFILE_MASS;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].mass = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_CHARGE) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   charge...\n");
-#endif
-      *optflags |= MOLFILE_CHARGE;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].charge = fltbuf[i];
-      }    
-    }
-
-    if (js->optflags & JSOPT_RADIUS) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   radius...\n");
-#endif
-      *optflags |= MOLFILE_RADIUS;
-      fio_fread(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(fltbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].radius = fltbuf[i];
-      }    
-    }
-
-    if (fltbuf != NULL) {
-      free(fltbuf);
-      fltbuf=NULL;
-    }
-
-    /*
-     * read in optional integer data blocks
-     */ 
-    if (js->optflags & JSOPT_ATOMICNUMBER)
-      intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-    if (js->optflags & JSOPT_ATOMICNUMBER) { 
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   atomic number...\n");
-#endif
-      *optflags |= MOLFILE_ATOMICNUMBER;
-      fio_fread(intbuf, js->natoms * sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(intbuf, js->natoms);
-      for (i=0; i<js->natoms; i++) {
-        atoms[i].atomicnumber = intbuf[i];
-      }    
-    }
-
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-
-    /*
-     * read in bonds and fractional bond orders
-     */ 
-    if (js->optflags & JSOPT_BONDS) {
-      fio_fread(&js->nbonds, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->nbonds, 1);
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d bonds...\n", js->nbonds);
-#endif
-
-      js->bondfrom = (int *) malloc(js->nbonds * sizeof(int));
-      js->bondto = (int *) malloc(js->nbonds * sizeof(int));
-      fio_fread(js->bondfrom, js->nbonds * sizeof(int), 1, js->fd);
-      fio_fread(js->bondto, js->nbonds * sizeof(int), 1, js->fd);
-      if (js->reverseendian) {
-        swap4_aligned(js->bondfrom, js->nbonds);
-        swap4_aligned(js->bondto, js->nbonds);
-      }
-
-      if (js->optflags & JSOPT_BONDORDERS) {
-#if defined(INFOMSGS)
-        if (js->verbose)
-          printf("jsplugin)   bond orders...\n");
-#endif
-        js->bondorders = (float *) malloc(js->nbonds * sizeof(float));
-        fio_fread(js->bondorders, js->nbonds * sizeof(float), 1, js->fd);
-        if (js->reverseendian)
-          swap4_aligned(js->bondorders, js->nbonds);
-      }
-    }
-
-    if (js->optflags & JSOPT_ANGLES) {
-      fio_fread(&js->numangles, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numangles, 1);
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d angles...\n", js->numangles);
-#endif
-      js->angles = (int *) malloc(3L * js->numangles * sizeof(int));
-      fio_fread(js->angles, sizeof(int)*3L*js->numangles, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->angles, 3L*js->numangles);
-
-      fio_fread(&js->numdihedrals, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numdihedrals, 1);
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d dihedrals...\n", js->numdihedrals);
-#endif
-      js->dihedrals = (int *) malloc(4L * js->numdihedrals * sizeof(int));
-      fio_fread(js->dihedrals, sizeof(int)*4L*js->numdihedrals, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->dihedrals, 4L*js->numdihedrals);
-
-      fio_fread(&js->numimpropers, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numimpropers, 1);
-      js->impropers = (int *) malloc(4L * js->numimpropers * sizeof(int));
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d impropers...\n", js->numimpropers);
-#endif
-      fio_fread(js->impropers, sizeof(int)*4L*js->numimpropers, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->impropers, 4L*js->numimpropers);
-    }
-    if (js->optflags & JSOPT_CTERMS) {
-      fio_fread(&js->numcterms, sizeof(int), 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(&js->numcterms, 1);
-      js->cterms = (int *) malloc(8L * js->numcterms * sizeof(int));
-#if defined(INFOMSGS)
-      if (js->verbose)
-        printf("jsplugin)   %d cterms...\n", js->numcterms);
-#endif
-      fio_fread(js->cterms, sizeof(int)*8L*js->numcterms, 1, js->fd);
-      if (js->reverseendian)
-        swap4_aligned(js->cterms, 8L*js->numcterms);
-    }
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) final optflags: %08x\n", *optflags);
-      printf("jsplugin) structure information complete\n");
-    }
-#endif
-
-    /* record the file offset for the first timestep */
-    js_calc_timestep_blocking_info(js);
-
-    return MOLFILE_SUCCESS;
-  }
-
-#if defined(INFOMSGS)
-  if (js->verbose)
-    printf("jsplugin) no structure information available\n");
-#endif
-
-  /* record the file offset for the first timestep */
-  js_calc_timestep_blocking_info(js);
-
-  /* else, we have no structure information */
-  return MOLFILE_NOSTRUCTUREDATA;
-}
-
-
-static int read_js_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                         float **bondorder, int **bondtype, 
-                         int *nbondtypes, char ***bondtypename) {
-  jshandle *js = (jshandle *)v;
-
-  *nbonds = 0;
-  *fromptr = NULL;
-  *toptr = NULL;
-  *bondorder = NULL;
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  if (js->optflags & JSOPT_BONDS) {
-    *nbonds = js->nbonds;
-    *fromptr = js->bondfrom;
-    *toptr = js->bondto;
-
-    if (js->optflags & JSOPT_BONDORDERS) {
-      *bondorder = js->bondorders;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int read_js_angles(void *v, int *numangles, int **angles, 
-                          int **angletypes, int *numangletypes, 
-                          char ***angletypenames, int *numdihedrals,
-                          int **dihedrals, int **dihedraltypes, 
-                          int *numdihedraltypes, char ***dihedraltypenames,
-                          int *numimpropers, int **impropers, 
-                          int **impropertypes, int *numimpropertypes, 
-                          char ***impropertypenames, int *numcterms, 
-                          int **cterms, int *ctermcols, int *ctermrows) {
-  jshandle *js = (jshandle *)v;
-
-  /* initialize data to zero */
-  *numangles         = 0;
-  *angles            = NULL;
-  *angletypes        = NULL;
-  *numangletypes     = 0;
-  *angletypenames    = NULL;
-  *numdihedrals      = 0;
-  *dihedrals         = NULL;
-  *dihedraltypes     = NULL;
-  *numdihedraltypes  = 0;
-  *dihedraltypenames = NULL;
-  *numimpropers      = 0;
-  *impropers         = NULL;
-  *impropertypes     = NULL;
-  *numimpropertypes  = 0;
-  *impropertypenames = NULL;
-  *numcterms         = 0;
-  *cterms            = NULL;
-  *ctermrows         = 0;
-  *ctermcols         = 0;
-
-  *numangles = js->numangles;
-  *angles = js->angles;
-
-  *numdihedrals = js->numdihedrals;
-  *dihedrals = js->dihedrals;
-
-  *numimpropers = js->numimpropers;
-  *impropers = js->impropers;
-
-  *numcterms = js->numcterms;
-  *cterms = js->cterms;
-  *ctermcols = 0;
-  *ctermrows = 0;
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_js_angles(void *v,
-               int *numangles,    int **angles,    double **angleforces,
-               int *numdihedrals, int **dihedrals, double **dihedralforces,
-               int *numimpropers, int **impropers, double **improperforces,
-               int *numcterms,    int **cterms,
-               int *ctermcols,    int *ctermrows,  double **ctermforces) {
-  jshandle *js = (jshandle *)v;
-
-  *numangles = js->numangles;
-  *angles = js->angles;
-  *angleforces = NULL;
-
-  *numdihedrals = js->numdihedrals;
-  *dihedrals = js->dihedrals;
-  *dihedralforces = NULL;
-
-  *numimpropers = js->numimpropers;
-  *impropers = js->impropers;
-  *improperforces = NULL;
-
-  *numcterms = js->numcterms;
-  *cterms = js->cterms;
-  *ctermcols = 0;
-  *ctermrows = 0;
-  *ctermforces = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-#endif
-
-
-static int read_js_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  jshandle *js = (jshandle *)v;
-  fio_size_t framelen;
-
-#if JSMAJORVERSION > 1
-  /* If we haven't yet read (or skipped) the structure data, then we    */
-  /* need to begin by skipping past it before we try to read the        */
-  /* first timestep.  In the case of files with block-aligned timesteps,*/
-  /* this will also get our file pointer to the right block-aligned     */
-  /* location.                                                          */
-  if (!js->parsed_structure)
-    read_js_structure(v, NULL, NULL);
-#endif
-
-  /* compute total read/seek size of timestep */
-  framelen = js->ts_crd_padsz + js->ts_ucell_padsz;
-
-  /* if we have a valid ts pointer, read the timestep, otherwise skip it */ 
-  if (ts != NULL) {
-    fio_size_t readlen; 
-    fio_iovec iov[2];
-
-    /* set unit cell pointer to the TS block-aligned buffer area */
-    double *unitcell = (double *) js->directio_ucell_blkbuf;
-
-    unitcell[0] = unitcell[2] = unitcell[5] = 1.0f;
-    unitcell[1] = unitcell[3] = unitcell[4] = 90.0f;
-
-#if defined(ENABLEJSSHORTREADS)
-    /* test code for an implementation that does short reads that */
-    /* skip bulk solvent, useful for faster loading of very large */
-    /* structures                                                 */
-    if (getenv("VMDJSMAXATOMIDX") != NULL) {
-      fio_size_t bszmask;
-      long maxatompadsz, skipatompadsz;
-
-      long maxatomidx = atoi(getenv("VMDJSMAXATOMIDX"));
-      if (maxatomidx < 0)
-        maxatomidx = 0;
-      if (maxatomidx >= js->natoms)
-        maxatomidx = js->natoms - 1;
-
-      /* pad max read to the start of the next block  */
-      bszmask = js->directio_block_size - 1;
-      maxatompadsz = ((maxatomidx*3L*sizeof(float)) + bszmask) & (~bszmask);
-      skipatompadsz = js->ts_crd_padsz - maxatompadsz;
-
-      readlen=0;
-      if (js->directio_enabled) {
-        if (fio_fread(ts->coords, maxatompadsz, 1, js->directio_fd) == 1)
-          readlen = maxatompadsz;
-        if (fio_fseek(js->directio_fd, skipatompadsz, FIO_SEEK_CUR) == 0)
-          readlen += skipatompadsz;
-        if (fio_fread(unitcell, js->ts_ucell_padsz, 1, js->directio_fd) == 1)
-          readlen += js->ts_ucell_padsz;
-      } else {
-        if (fio_fread(ts->coords, maxatompadsz, 1, js->fd) == 1)
-          readlen = maxatompadsz;
-        if (fio_fseek(js->fd, skipatompadsz, FIO_SEEK_CUR) == 0)
-          readlen += skipatompadsz;
-        if (fio_fread(unitcell, js->ts_ucell_padsz, 1, js->fd) == 1)
-          readlen += js->ts_ucell_padsz;
-      }
-
-#if 0
-      /* clear all non-read atom coords to zeros */
-      memset(ts->coords+3L*maxatomidx,0,3L*sizeof(float)*(js->natoms-maxatomidx));
-#endif
-
-    }  else {
-#endif
- 
-    /* setup the I/O vector */
-    iov[0].iov_base = (fio_caddr_t) ts->coords;   /* read coordinates    */
-    iov[0].iov_len  = js->ts_crd_padsz;
-    iov[1].iov_base = (fio_caddr_t) unitcell;     /* read PBC unit cell  */
-    iov[1].iov_len  = js->ts_ucell_padsz;
-
-#if 1
-    /* Use fall-back code instead of readv():                            */
-    /*  Some platforms implement readv() as user level code in libc,     */
-    /*  and due to POSIX atomicity requirements for readv()/writev(),    */
-    /*  they may copy data to internal temp buffers, which can kill      */
-    /*  performance, and in cases when doing single I/O ops on large,    */
-    /*  buffers, e.g. > 2GB, can fail with shorts reads or writes...     */
-    /*  On such platforms it is best to avoid using readv()/writev()...  */
-    {
-      int readcnt = 0;
-      readlen = 0;
-      if (js->directio_enabled) {
-        readcnt =  fio_fread(iov[0].iov_base, iov[0].iov_len, 1, js->directio_fd);
-        readcnt += fio_fread(iov[1].iov_base, iov[1].iov_len, 1, js->directio_fd);
-      } else {
-        readcnt =  fio_fread(iov[0].iov_base, iov[0].iov_len, 1, js->fd);
-        readcnt += fio_fread(iov[1].iov_base, iov[1].iov_len, 1, js->fd);
-      }
-
-      /* if both records read correctly, then the reads are okay */
-      if (readcnt == 2)
-        readlen = framelen;
-    }
-#else
-    /* Do all of the reads with a single syscall, for peak efficiency.   */
-    /* On smart kernels, readv() causes only one context switch, and     */
-    /* can effeciently scatter the reads to the various buffers.         */
-    if (js->directio_enabled)
-      readlen = fio_readv(js->directio_fd, &iov[0], 2); 
-    else
-      readlen = fio_readv(js->fd, &iov[0], 2); 
-#endif
-
-#if defined(ENABLEJSSHORTREADS)
-   }
-#endif 
- 
-    /* check the number of read bytes versus what we expected */
-    if (readlen != framelen) {
-      if (readlen < 0) {
-        perror("jsplugin) fio_readv(): ");
-      } else if (readlen != 0) {
-        printf("jsplugin) mismatched read: %ld, expected %ld\n", 
-               (long) readlen, (long) framelen);
-      }
-
-      return MOLFILE_EOF;
-    }
-
-    /* perform byte swapping if necessary */
-    if (js->reverseendian) {
-      swap4_aligned(ts->coords, js->natoms * 3L);
-      swap8_aligned(unitcell, 6);
-    }
-
-    /* copy unit cell values into VMD */
-    ts->A = unitcell[0];
-    ts->B = unitcell[1];
-    ts->C = unitcell[2];
-    ts->alpha = 90.0 - asin(unitcell[3]) * 90.0 / M_PI_2;
-    ts->beta  = 90.0 - asin(unitcell[4]) * 90.0 / M_PI_2;
-    ts->gamma = 90.0 - asin(unitcell[5]) * 90.0 / M_PI_2;
-  } else {
-    /* skip this frame, seek to the next frame */
-    if (js->directio_enabled) {
-      if (fio_fseek(js->directio_fd, framelen, FIO_SEEK_CUR)) 
-        return MOLFILE_EOF;
-    } else {
-      if (fio_fseek(js->fd, framelen, FIO_SEEK_CUR)) 
-        return MOLFILE_EOF;
-    }
-  }
- 
-  return MOLFILE_SUCCESS;
-}
- 
-
-static void close_js_read(void *v) {
-  jshandle *js = (jshandle *)v;
-  fio_fclose(js->fd);
-
-#if JSMAJORVERSION > 1
-  if (js->path)
-    free(js->path);
-
-  if (js->directio_enabled)
-    fio_fclose(js->directio_fd);
-
-  if (js->directio_ucell_ptr)
-    free(js->directio_ucell_ptr);
-
-  if (js->bondfrom)
-    free(js->bondfrom);
-  if (js->bondto)
-    free(js->bondto);
-  if (js->bondorders)
-    free(js->bondorders);
-
-  /* free angle data */
-  if (js->angles != NULL)
-    free(js->angles);
-  if (js->dihedrals != NULL)
-    free(js->dihedrals);
-  if (js->impropers != NULL)
-    free(js->impropers);
-  if (js->cterms)
-    free(js->cterms);
-#endif
-
-  free(js);
-}
-
-
-static void *open_js_write(const char *path, const char *filetype, int natoms) {
-  jshandle *js;
-
-  js = (jshandle *) malloc(sizeof(jshandle));
-  memset(js, 0, sizeof(jshandle));
-#if JSMAJORVERSION > 1
-  js->parsed_structure=0;
-  js->directio_block_size=1;
-  js->directio_ucell_ptr = NULL;
-  js->directio_ucell_blkbuf = NULL;
-
-  js->directio_enabled=0;
-  js->ts_file_offset=0;
-  js->ts_crd_sz=0;
-  js->ts_ucell_sz=0;
-  js->ts_crd_padsz=0;
-  js->ts_ucell_padsz=0;
-#endif
-
-  if (fio_open(path, FIO_WRITE, &js->fd) < 0) {
-    printf("jsplugin) Could not open file %s for writing\n", path);
-    free(js);
-    return NULL;
-  }
-
-  js->natoms = natoms;
-  js->with_unitcell = 1;
-
-  /* emit header information */
-  fio_write_str(js->fd, JSHEADERSTRING);
-  fio_write_int32(js->fd, JSMAGICNUMBER);
-  fio_write_int32(js->fd, JSENDIANISM);
-  fio_write_int32(js->fd, JSMAJORVERSION);
-  fio_write_int32(js->fd, JSMINORVERSION);
-
-  /* write number of atoms */
-  fio_write_int32(js->fd, natoms);
-
-  /* write number of frames, to be updated later */
-  js->nframes = 0;
-  fio_write_int32(js->fd, js->nframes);
-
-  return js;
-}
-
-
-#if JSMAJORVERSION > 1
-
-static int write_js_structure(void *mydata, int optflags,
-                              const molfile_atom_t *atoms) {
-  jshandle *js = (jshandle *) mydata;
-  long i;
-
-  /* use block-based I/O by default when writing structures larger */
-  /* than JSBLOCKIO_THRESH atoms, or when directed by the user     */
-  js_blockio_check_and_set(js);
-
-  js->optflags |= JSOPT_STRUCTURE;
-
-  if (optflags & MOLFILE_OCCUPANCY)
-    js->optflags |= JSOPT_OCCUPANCY;
-
-  if (optflags & MOLFILE_BFACTOR)
-    js->optflags |= JSOPT_BFACTOR;
-
-  if (optflags & MOLFILE_BFACTOR)
-    js->optflags |= JSOPT_BFACTOR;
-
-  if (optflags & MOLFILE_MASS)
-    js->optflags |= JSOPT_MASS;
-
-  if (optflags & MOLFILE_CHARGE)
-    js->optflags |= JSOPT_CHARGE;
- 
-  if (optflags & MOLFILE_RADIUS)
-    js->optflags |= JSOPT_RADIUS;
-
-  if (optflags & MOLFILE_ATOMICNUMBER)
-    js->optflags |= JSOPT_ATOMICNUMBER;
-
-  /* write flags data to the file */
-  fio_write_int32(js->fd, js->optflags); 
-printf("jsplugin) writing option flags: %0x08x\n", js->optflags);
-
-  /* Check to see if block-based trajectory I/O is used  */
-  /* and write out the block size for this file.         */
-  if (js->optflags & JSOPT_TS_BLOCKIO) {
-    fio_fwrite(&js->directio_block_size, sizeof(int), 1, js->fd);
-    printf("jsplugin) Block-based I/O enabled: block size %d bytes\n", 
-           js->directio_block_size);
-  }
-
-printf("jsplugin) writing structure...\n");
-  /* determine whether or not this file contains structure info or not */
-  if (js->optflags & JSOPT_STRUCTURE) {
-    int numatomnames, numatomtypes, numresnames, numsegids, numchains;
-    char **atomnames = NULL;
-    char **atomtypes = NULL;
-    char **resnames = NULL;
-    char **segids = NULL;
-    char **chains = NULL;
-    short *shortbuf = NULL; /* temp buf for encoding atom records */
-    int *intbuf = NULL;     /* temp buf for encoding atom records */
-    float *fltbuf = NULL;   /* temp buf for encoding atom records */
-
-    hash_t tmphash;         /* temporary hash table */
-    hash_t atomnamehash;
-    hash_t atomtypehash;
-    hash_t resnamehash;
-    hash_t segidhash;
-    hash_t chainhash;
-    int hashcnt;
-
-
-printf("jsplugin) counting atom names, types, etc...\n");
-    /* generate hash tables to count the number of unique strings */
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].name, 0);
-    numatomnames = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].type, 0);
-    numatomtypes = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].resname, 0);
-    numresnames = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].segid, 0);
-    numsegids = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
-
-    hash_init(&tmphash, 127);
-    for (i=0; i<js->natoms; i++)
-      hash_insert(&tmphash, atoms[i].chain, 0);
-    numchains = hash_entries(&tmphash);
-    hash_destroy(&tmphash);
- 
-printf("jsplugin) writing unique string counts...\n");
-printf("jsplugin) %d %d %d %d %d\n",
-       numatomnames, numatomtypes, numresnames, numsegids, numchains);
-
-    /* write block of name string table sizes */
-    fio_write_int32(js->fd, numatomnames); 
-    fio_write_int32(js->fd, numatomtypes); 
-    fio_write_int32(js->fd, numresnames);
-    fio_write_int32(js->fd, numsegids);
-    fio_write_int32(js->fd, numchains); 
-
-printf("jsplugin) writing string tables...\n");
-
-    atomnames = (char **) malloc(numatomnames * sizeof(char *));
-    atomtypes = (char **) malloc(numatomtypes * sizeof(char *));
-    resnames = (char **) malloc(numresnames * sizeof(char *));
-    segids = (char **) malloc(numsegids * sizeof(char *));
-    chains = (char **) malloc(numchains * sizeof(char *));
-
-printf("jsplugin)   atom names...\n");
-    /* generate and write out the string tables */
-    hash_init(&atomnamehash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&atomnamehash, atoms[i].name, hashcnt) == HASH_FAIL) {
-        atomnames[hashcnt] = (char *) calloc(1, 16L * sizeof(char));
-        strcpy(atomnames[hashcnt], atoms[i].name);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numatomnames; i++) {
-      fio_fwrite(atomnames[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   atom types...\n");
-    hash_init(&atomtypehash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&atomtypehash, atoms[i].type, hashcnt) == HASH_FAIL) {
-        atomtypes[hashcnt] = (char *) calloc(1, 16L * sizeof(char));
-        strcpy(atomtypes[hashcnt], atoms[i].type);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numatomtypes; i++) {
-      fio_fwrite(atomtypes[i], 16L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   residue names...\n");
-    hash_init(&resnamehash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&resnamehash, atoms[i].resname, hashcnt) == HASH_FAIL) {
-        resnames[hashcnt] = (char *) calloc(1, 8L * sizeof(char));
-        strcpy(resnames[hashcnt], atoms[i].resname);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numresnames; i++) {
-      fio_fwrite(resnames[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   segment names...\n");
-    hash_init(&segidhash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&segidhash, atoms[i].segid, hashcnt) == HASH_FAIL) {
-        segids[hashcnt] = (char *) calloc(1, 8L * sizeof(char));
-        strcpy(segids[hashcnt], atoms[i].segid);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numsegids; i++) {
-      fio_fwrite(segids[i], 8L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin)   chain names...\n");
-    hash_init(&chainhash, 127);
-    for (hashcnt=0,i=0; i<js->natoms; i++) {
-      /* add a new string table entry for hash inserts that don't yet exist */
-      if (hash_insert(&chainhash, atoms[i].chain, hashcnt) == HASH_FAIL) {
-        chains[hashcnt] = (char *) calloc(1, 2L * sizeof(char));
-        strcpy(chains[hashcnt], atoms[i].chain);
-        hashcnt++;
-      }
-    }
-    for (i=0; i<numchains; i++) {
-      fio_fwrite(chains[i], 2L * sizeof(char), 1, js->fd);
-    }
-
-
-printf("jsplugin) writing numeric field tables...\n");
-    /* write out all of the atom fields */
-    shortbuf = (short *) malloc(js->natoms * sizeof(short));
-
-    /* write out atom names */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&atomnamehash, atoms[i].name);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    /* write out atom types */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&atomtypehash, atoms[i].type);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    /* write out resnames */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&resnamehash, atoms[i].resname);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-    
-    /* write out segids */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&segidhash, atoms[i].segid);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    /* write out chains */
-    for (i=0; i<js->natoms; i++) {
-      shortbuf[i] = hash_lookup(&chainhash, atoms[i].chain);
-    }    
-    fio_fwrite(shortbuf, js->natoms * sizeof(short), 1, js->fd);
-
-    if (shortbuf != NULL) {
-      free(shortbuf);
-      shortbuf=NULL;
-    }
-
-    /* done with hash tables */
-    hash_destroy(&atomnamehash);
-    hash_destroy(&atomtypehash);
-    hash_destroy(&resnamehash);
-    hash_destroy(&segidhash);
-    hash_destroy(&chainhash);
-
-
-    /* 
-     * write out integer data blocks 
-     */
-    intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-printf("jsplugin)   residue indices...\n");
-    /* write out resid */
-    for (i=0; i<js->natoms; i++) {
-      intbuf[i] = atoms[i].resid;
-    }    
-    fio_fwrite(intbuf, js->natoms * sizeof(int), 1, js->fd);
-     
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-printf("jsplugin) writing optional per-atom tables...\n");
-    /*
-     * write out optional single-precision float data blocks
-     */ 
-    if (js->optflags & (JSOPT_OCCUPANCY | JSOPT_BFACTOR | 
-        JSOPT_MASS | JSOPT_RADIUS | JSOPT_CHARGE)) 
-      fltbuf = (float *) malloc(js->natoms * sizeof(float));
-
-    /* write out optional data if it exists */
-
-    if (js->optflags & JSOPT_OCCUPANCY) {
-printf("jsplugin)   writing occupancy...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].occupancy;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_BFACTOR) {
-printf("jsplugin)   writing bfactor...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].bfactor;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_MASS) { 
-printf("jsplugin)   writing mass...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].mass;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_CHARGE) { 
-printf("jsplugin)   writing charge...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].charge;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (js->optflags & JSOPT_RADIUS) { 
-printf("jsplugin)   writing radius...\n");
-      for (i=0; i<js->natoms; i++) {
-        fltbuf[i] = atoms[i].radius;
-      }    
-      fio_fwrite(fltbuf, js->natoms * sizeof(float), 1, js->fd);
-    }
-
-    if (fltbuf != NULL) {
-      free(fltbuf);
-      fltbuf=NULL;
-    }
-
-
-    /*
-     * write out optional integer data blocks
-     */ 
-    if (js->optflags & JSOPT_ATOMICNUMBER)
-      intbuf = (int *) malloc(js->natoms * sizeof(int));
-
-    if (js->optflags & JSOPT_ATOMICNUMBER) { 
-printf("jsplugin)   writing atomic number...\n");
-      for (i=0; i<js->natoms; i++) {
-        intbuf[i] = atoms[i].atomicnumber;
-      }    
-      fio_fwrite(intbuf, js->natoms * sizeof(int), 1, js->fd);
-    }
-
-    if (intbuf != NULL) {
-      free(intbuf);
-      intbuf = NULL;
-    }
-
-
-    /*
-     * write out bonds and fractional bond orders
-     */ 
-    if (js->optflags & JSOPT_BONDS) {
-printf("jsplugin) writing bonds...\n");
-      fio_fwrite(&js->nbonds, sizeof(int), 1, js->fd);
-      fio_fwrite(js->bondfrom, js->nbonds * sizeof(int), 1, js->fd);
-      fio_fwrite(js->bondto, js->nbonds * sizeof(int), 1, js->fd);
-
-      if (js->optflags & JSOPT_BONDORDERS) {
-printf("jsplugin) writing bond orders...\n");
-        fio_fwrite(js->bondorders, js->nbonds * sizeof(float), 1, js->fd);
-      }
-    }
-
-    /*
-     * write out angles/dihedrals/impropers/cross-terms
-     */
-    if (js->optflags & JSOPT_ANGLES) {
-printf("jsplugin) writing angles/dihedrals/impropers...\n");
-      fio_fwrite(&js->numangles, sizeof(int), 1, js->fd);
-      fio_fwrite(js->angles, sizeof(int)*3L*js->numangles, 1, js->fd);
-
-      fio_fwrite(&js->numdihedrals, sizeof(int), 1, js->fd);
-      fio_fwrite(js->dihedrals, sizeof(int)*4L*js->numdihedrals, 1, js->fd);
-
-      fio_fwrite(&js->numimpropers, sizeof(int), 1, js->fd);
-      fio_fwrite(js->impropers, sizeof(int)*4L*js->numimpropers, 1, js->fd);
-    }
-    if (js->optflags & JSOPT_CTERMS) {
-printf("jsplugin) writing cross-terms\n");
-      fio_fwrite(&js->numcterms, sizeof(int), 1, js->fd);
-      fio_fwrite(js->cterms, sizeof(int)*8L*js->numcterms, 1, js->fd);
-    }
-
-    /* update the file offset for the first timestep */
-    js_calc_timestep_blocking_info(js);
-
-    return MOLFILE_SUCCESS;
-  }
-
-  /* update the file offset for the first timestep */
-  js_calc_timestep_blocking_info(js);
-
-  /* else, we have no structure information */
-  return MOLFILE_NOSTRUCTUREDATA;
-}
-
-
-static int write_js_bonds(void *mydata, int nbonds, int *fromptr, int *toptr, 
-                          float *bondorder,  int *bondtype, 
-                          int nbondtypes, char **bondtypename) {
-  jshandle *js = (jshandle *) mydata;
-
-#if defined(INFOMSGS)
-    if (js->verbose) {
-      printf("jsplugin) write_js_bonds():\n");
-      printf("jsplugin) storing bond info for writing...\n");
-      printf("jsplugin) %d %d\n", nbonds, nbondtypes);
-    }
-#endif
-
-  if (nbonds > 0 && fromptr != NULL && toptr != NULL) {
-    js->optflags |= JSOPT_BONDS; 
-
-    /* save bond info until we actually write out the structure file */
-    js->nbonds = nbonds;
-    js->bondfrom = (int *) malloc(nbonds * sizeof(int));
-    memcpy(js->bondfrom, fromptr, nbonds * sizeof(int));
-    js->bondto = (int *) malloc(nbonds * sizeof(int));
-    memcpy(js->bondto, toptr, nbonds * sizeof(int));
-
-    if (bondorder != NULL) {
-      js->optflags |= JSOPT_BONDORDERS;
-      js->bondorders = (float *) malloc(nbonds * sizeof(float));
-      memcpy(js->bondorders, bondorder, nbonds * sizeof(float));
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int write_js_angles(void * v, int numangles, const int *angles,
-                           const int *angletypes, int numangletypes,
-                           const char **angletypenames, int numdihedrals, 
-                           const int *dihedrals, const int *dihedraltype,
-                           int numdihedraltypes, const char **dihedraltypenames,
-                           int numimpropers, const int *impropers, 
-                           const int *impropertypes, int numimpropertypes, 
-                           const char **impropertypenames, int numcterms, 
-                           const int *cterms, int ctermcols, int ctermrows) {
-  jshandle *js = (jshandle *) v;
-
-  /* save info until we actually write out the structure file */
-  js->numangles = numangles;
-  js->numdihedrals = numdihedrals;
-  js->numimpropers = numimpropers;
-  js->numcterms = numcterms;
-
-#if defined(INFOMSGS)
-  if (js->verbose) {
-    printf("jsplugin) write_js_angles():\n");
-    printf("jsplugin) storing angles/dihedrals/impropers for writing...\n");
-    printf("jsplugin) %d %d %d %d\n",
-           numangles, numdihedrals, numimpropers, numcterms);
-  }
-#endif
-
-  if (js->numangles > 0 || js->numdihedrals > 0 || js->numimpropers > 0) {
-    js->optflags |= JSOPT_ANGLES;
-
-    js->angles = (int *) malloc(3L*js->numangles*sizeof(int));
-    memcpy(js->angles, angles, 3L*js->numangles*sizeof(int));
-    js->dihedrals = (int *) malloc(4L*js->numdihedrals*sizeof(int));
-    memcpy(js->dihedrals, dihedrals, 4L*js->numdihedrals*sizeof(int));
-    js->impropers = (int *) malloc(4L*js->numimpropers*sizeof(int));
-    memcpy(js->impropers, impropers, 4L*js->numimpropers*sizeof(int));
-  }
-  if (js->numcterms > 0) {
-    js->optflags |= JSOPT_CTERMS;
-
-    js->cterms = (int *) malloc(8L*js->numcterms*sizeof(int));
-    memcpy(js->cterms, cterms, 8L*js->numcterms*sizeof(int));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int write_js_angles(void * v,
-        int numangles,    const int *angles,    const double *angleforces,
-        int numdihedrals, const int *dihedrals, const double *dihedralforces,
-        int numimpropers, const int *impropers, const double *improperforces,
-        int numcterms,   const int *cterms,
-        int ctermcols, int ctermrows, const double *ctermforces) {
-  jshandle *js = (jshandle *) v;
-
-  /* save info until we actually write out the structure file */
-  js->numangles = numangles;
-  js->numdihedrals = numdihedrals;
-  js->numimpropers = numimpropers;
-  js->numcterms = numcterms;
-
-  if (js->numangles > 0 || js->numdihedrals > 0 || js->numimpropers > 0) {
-    js->optflags |= JSOPT_ANGLES;
-
-    js->angles = (int *) malloc(3L*js->numangles*sizeof(int));
-    memcpy(js->angles, angles, 3L*js->numangles*sizeof(int));
-    js->dihedrals = (int *) malloc(4L*js->numdihedrals*sizeof(int));
-    memcpy(js->dihedrals, dihedrals, 4L*js->numdihedrals*sizeof(int));
-    js->impropers = (int *) malloc(4L*js->numimpropers*sizeof(int));
-    memcpy(js->impropers, impropers, 4L*js->numimpropers*sizeof(int));
-  }
-  if (js->numcterms > 0) {
-    js->optflags |= JSOPT_CTERMS;
-
-    js->cterms = (int *) malloc(8L*js->numcterms*sizeof(int));
-    memcpy(js->cterms, cterms, 8L*js->numcterms*sizeof(int));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-#endif
-
-
-static int write_js_timestep(void *v, const molfile_timestep_t *ts) { 
-  jshandle *js = (jshandle *)v;
-  double *unitcell=NULL;
-
-  /* If no structure data was written and this is the first timestep */
-  /* we must complete writing the file header and performing the     */
-  /* seek to the next filesystem block and VM-page boundary when     */
-  /* using direct I/O APIs...                                        */
-  if (js->directio_ucell_blkbuf == NULL) {
-    printf("jsplugin) no structure data, writing timesteps only...\n");
-
-    /* use block-based I/O by default when writing structures larger */
-    /* than JSBLOCKIO_THRESH atoms, or when directed by the user     */
-    js_blockio_check_and_set(js);
-
-    /* write flags data to the file */
-    fio_write_int32(js->fd, js->optflags); 
-    printf("jsplugin) writing option flags: %0x08x\n", js->optflags);
-
-    /* Check to see if block-based trajectory I/O is used  */
-    /* and write out the block size for this file.         */
-    if (js->optflags & JSOPT_TS_BLOCKIO) {
-      fio_fwrite(&js->directio_block_size, sizeof(int), 1, js->fd);
-      printf("jsplugin) Block-based I/O enabled: block size %d bytes\n", 
-             js->directio_block_size);
-    }
-
-    /* update the file offset for the first timestep */
-    js_calc_timestep_blocking_info(js);
-  }
-
-  /* set unit cell pointer to the TS block-aligned buffer area */
-  unitcell = (double *) js->directio_ucell_blkbuf;
-
-  js->nframes++; /* increment frame count written to the file so far */
-
-  unitcell[0] = ts->A;
-  unitcell[1] = ts->B;
-  unitcell[2] = ts->C;
-  unitcell[3] = sin((M_PI_2 / 90.0) * (90.0 - ts->alpha));
-  unitcell[4] = sin((M_PI_2 / 90.0) * (90.0 - ts->beta));
-  unitcell[5] = sin((M_PI_2 / 90.0) * (90.0 - ts->gamma));
-
-  /* coordinates for all atoms */
-  if (fio_fwrite(ts->coords, js->ts_crd_padsz, 1, js->fd) != 1) {
-    printf("jsplugin) Error writing timestep coords!\n");;
-    return MOLFILE_ERROR;
-  }
-
-  /* PBC unit cell info */ 
-  if (fio_fwrite(unitcell, js->ts_ucell_padsz, 1, js->fd) != 1) {
-    printf("jsplugin) Error writing timestep unit cell!\n");;
-    return MOLFILE_ERROR;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_js_write(void *v) {
-  jshandle *js = (jshandle *)v;
-
-  /* update the trajectory header information */
-  fio_fseek(js->fd, JSNFRAMESOFFSET, FIO_SEEK_SET);
-  fio_write_int32(js->fd, js->nframes);
-  fio_fseek(js->fd, 0, FIO_SEEK_END);
-
-  fio_fclose(js->fd);
-
-#if JSMAJORVERSION > 1
-  if (js->directio_ucell_ptr)
-    free(js->directio_ucell_ptr);
-
-  if (js->bondfrom)
-    free(js->bondfrom);
-  if (js->bondto)
-    free(js->bondto);
-  if (js->bondorders)
-    free(js->bondorders);
-
-  if (js->angles)
-    free(js->angles);
-  if (js->dihedrals)
-    free(js->dihedrals);
-  if (js->impropers)
-    free(js->impropers);
-  if (js->cterms)
-    free(js->cterms);
-#endif
-
-  free(js);
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "js";
-  plugin.prettyname = "js";
-  plugin.author = "John Stone";
-  plugin.majorv = JSMAJORVERSION;
-  plugin.minorv = JSMINORVERSION;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "js";
-  plugin.open_file_read = open_js_read;
-#if JSMAJORVERSION > 1
-  plugin.read_structure = read_js_structure;
-  plugin.read_bonds = read_js_bonds;
-  plugin.read_angles = read_js_angles;
-#endif
-  plugin.read_next_timestep = read_js_timestep;
-  plugin.close_file_read = close_js_read;
-  plugin.open_file_write = open_js_write;
-#if JSMAJORVERSION > 1
-  plugin.write_structure = write_js_structure;
-  plugin.write_bonds = write_js_bonds;
-  plugin.write_angles = write_js_angles;
-#endif
-  plugin.write_timestep = write_js_timestep;
-  plugin.close_file_write = close_js_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-  
-#ifdef TEST_JSPLUGIN
-
-#include <sys/time.h>
-
-#if defined(ENABLECUDATESTS)
-#include <cuda_runtime.h>
-#endif
-
-/* get the time of day from the system clock, and store it (in seconds) */
-double time_of_day(void) {
-#if defined(_MSC_VER)
-  double t;
-
-  t = GetTickCount();
-  t = t / 1000.0;
-
-  return t;
-#else
-  struct timeval tm;
-  struct timezone tz;
-
-  gettimeofday(&tm, &tz);
-  return((double)(tm.tv_sec) + (double)(tm.tv_usec)/1000000.0);
-#endif
-}
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  float *coords=NULL;
-  float *aligncoords=NULL;
-  void *v;
-  jshandle *js;
-  long i, natoms, sz, blocksz;
-  float sizeMB =0.0, totalMB = 0.0;
-  double starttime, endtime, totaltime = 0.0;
-  int do_io = 1;
-
-  printf("Standalone tests for JS plugin:\n");
-  
-  if (getenv("VMDJSNOIO") != NULL)
-    do_io = 0;
-
-  if (do_io)
-    printf("  Timestep disk I/O enabled.\n");
-  else
-    printf("  Timestep disk I/O DISABLED.\n");
-
-#if defined(ENABLECUDATESTS)
-  printf("  CUDA GPU support compiled in.\n");
-
-  // If the code is compiled with CUDA support, we benchmark 
-  // host I/O immediately followed by host-GPU copies of each timestep
-  cudaError_t crc;
-  int maxatomidx=-1;
-  int devcount;
-  float *devptr=NULL;
-  crc = cudaGetDeviceCount(&devcount);
-
-  printf("  GPU device count: %d\n", devcount);
-  if (devcount==0)
-    printf("  No GPU devices, continuing with host only...\n");
-
-  // Only do the CUDA tests if asked to
-  if (getenv("VMDJSCUDATESTS") == NULL) {
-    devcount = 0;
-    printf("  GPU tests disabled.\n");
-    printf("  Enable GPU tests with VMDJSCUDATESTS env variable\n");
-  } else {
-    printf("  Disable GPU tests by unsetting VMDJSCUDATESTS env variable\n");
-  }
-
-#if defined(ENABLEJSSHORTREADS)
-  /* test code for an implementation that does short reads that */
-  /* skip bulk solvent, useful for faster loading of very large */
-  /* structures                                                 */
-  if (getenv("VMDJSMAXATOMIDX") != NULL) {
-    fio_size_t bszmask;
-
-    maxatomidx = atoi(getenv("VMDJSMAXATOMIDX"));
-    if (maxatomidx < 0)
-      maxatomidx = 0;
-    if (maxatomidx >= js->natoms)
-      maxatomidx = js->natoms - 1;
-
-    printf("jsplugin) Short-copies of GPU timesteps enabled: %d / %d atoms (%.2f%%)\n",
-           maxatomidx, js->natoms, 100.0*(maxatomidx+1) / ((float) js->natoms));
-  }
-#endif
-#endif
-
-
-  while (--argc) {
-    ++argv; 
-    natoms = 0;
-    v = open_js_read(*argv, "js", &natoms);
-    if (!v) {
-      printf("jsplugin) open_js_read failed for file %s\n", *argv);
-      return 1;
-    }
-    js = (jshandle *)v;
-    sizeMB = ((natoms * 3.0) * js->nframes * 4.0) / (1024.0 * 1024.0);
-    totalMB += sizeMB; 
-    printf("jsplugin) file: %s\n", *argv);
-    printf("jsplugin)   %d atoms, %d frames, size: %6.1fMB\n", natoms, js->nframes, sizeMB);
-
-    starttime = time_of_day();
-
-    /* ensure we have a large enough allocation so we can align */
-    /* the starting pointer to a blocksz page boundary          */
-    blocksz = MOLFILE_DIRECTIO_MIN_BLOCK_SIZE;
-    sz = 3L*sizeof(float)*natoms + blocksz;
-    aligncoords = (float *) alloc_aligned_ptr(sz, blocksz, (void**) &coords);
-    timestep.coords = aligncoords;
-
-#if defined(ENABLECUDATESTS)
-    if (crc == cudaSuccess && devcount > 0) {
-      printf("jsplugin) allocating GPU memory buffer for CUDA tests...\n");
-      crc = cudaMalloc((void**) &devptr, sz);
-      if (crc != cudaSuccess) {
-        printf("Failed to allocate GPU buffer!\n");
-        return -1;
-      }
-    }
-#endif
-
-    /* loop over all timesteps ... */
-    for (i=0; i<js->nframes; i++) {
-      if (do_io) {
-        int rc = read_js_timestep(v, natoms, &timestep);
-        if (rc) {
-          printf("jsplugin) error in read_js_timestep on frame %d\n", i);
-          /* return 1; */
-        }
-      }
-
-#if defined(ENABLECUDATESTS)
-      if (crc == cudaSuccess && devcount > 0) {
-        size_t bsz = (maxatomidx >= 0) ? (maxatomidx+1) : natoms;
-        bsz *= 3L*sizeof(float);
-        crc = cudaMemcpy(devptr, timestep.coords, bsz, cudaMemcpyHostToDevice);
-      }
-#endif
-    }
-
-#if defined(ENABLECUDATESTS)
-    /* wait for any pending GPU calls to complete */
-    cudaThreadSynchronize();
-#endif
-
-    endtime = time_of_day();
-    close_js_read(v);
-
-#if defined(ENABLECUDATESTS)
-    if (crc == cudaSuccess && devcount > 0) {
-      cudaFree(devptr);
-    }
-#endif
-    free(coords);
-
-    totaltime += endtime - starttime;
-    printf("jsplugin)  Time: %5.1f seconds\n", endtime - starttime);
-    printf("jsplugin)  Speed: %5.1f MB/sec, %5.1f timesteps/sec\n", sizeMB / (endtime - starttime), (js->nframes / (endtime - starttime)));
-  }
-  printf("jsplugin) Overall Size: %6.1f MB\n", totalMB);
-  printf("jsplugin) Overall Time: %6.1f seconds\n", totaltime);
-  printf("jsplugin) Overall Speed: %5.1f MB/sec\n", totalMB / totaltime);
-  return 0;
-}
-      
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/lammpsplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/lammpsplugin.c
deleted file mode 100644
index f8408f66b982a50f3b7dd3b60a01f02b72034ba5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/lammpsplugin.c
+++ /dev/null
@@ -1,1689 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: lammpsplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.49 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  LAMMPS atom style dump file format:
- *    ITEM: TIMESTEP
- *      %d (timestep number)
- *    ITEM: NUMBER OF ATOMS
- *      %d (number of atoms)
- *    ITEM: BOX BOUNDS
- *      %f %f (boxxlo, boxxhi)
- *      %f %f (boxylo, boxyhi)
- *      %f %f (boxzlo, boxzhi)
- *    ITEM: ATOMS
- *      %d %d %f %f %f  (atomid, atomtype, x, y, z)
- *      ...
- * newer LAMMPS versions have instead
- *    ITEM: ATOMS id x y z
- *      %d %d %f %f %f  (atomid, atomtype, x, y, z)
- *      ...
- * also triclinic boxes are possible:
- *    ITEM: BOX BOUNDS xy xz yz
- *      %f %f %f (boxxlo, boxxhi, xy)
- *      %f %f %f (boxylo, boxyhi, xz)
- *      %f %f %f (boxzlo, boxzhi, yz)
- * 
- * as of 11 April 2011 box bounds always include periodicity settings.
- *    ITEM: BOX BOUNDS pp pp pp xy xz yz
- * instead of p (periodic) also f (fixed), s (shrinkwrap) and m (shrinkwrap 
- *         with minimum) are possible boundaries.
- *
- * SPECIAL NOTICE: these are box _boundaries_ not lengths.
- *                 the dimensions of the box still need to 
- *                 be calculated from them and xy,xz,yz.
- *
- * the newer format allows to handle custom dumps with velocities
- * and other features that are not yet in VMD and the molfile API.
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include "molfile_plugin.h"
-
-#include "periodic_table.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define VMDPLUGIN_STATIC
-#include "hash.h"
-#include "inthash.h"
-
-#ifndef LAMMPS_DEBUG
-#define LAMMPS_DEBUG 0
-#endif
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#ifndef MIN
-#define MIN(A,B) ((A) < (B) ? (A) : (B))
-#endif
-#ifndef MAX
-#define MAX(A,B) ((A) > (B) ? (A) : (B))
-#endif
-
-/* small magnitude floating point number */
-#define SMALL 1.0e-12f
-
-/* maximum supported length of line for line buffers */
-#define LINE_LEN 1024
-
-/* lammps item keywords */
-#define KEY_ATOMS "NUMBER OF ATOMS"
-#define KEY_BOX   "BOX BOUNDS"
-#define KEY_DATA  "ATOMS"
-#define KEY_TSTEP "TIMESTEP"
-
-/* lammps coordinate data styles */
-#define LAMMPS_COORD_NONE       0x000U
-#define LAMMPS_COORD_WRAPPED    0x001U
-#define LAMMPS_COORD_SCALED     0x002U
-#define LAMMPS_COORD_IMAGES     0x004U
-#define LAMMPS_COORD_UNWRAPPED  0x008U
-#define LAMMPS_COORD_UNKNOWN    0x010U
-#define LAMMPS_COORD_VELOCITIES 0x020U
-#define LAMMPS_COORD_FORCES     0x040U
-#define LAMMPS_COORD_DIPOLE     0x080U
-#define LAMMPS_COORD_TRICLINIC  0x100U
-
-/** flags to indicate the property stored in a custom lammps dump */
-#define LAMMPS_MAX_NUM_FIELDS 64
-enum lammps_attribute {
-  LAMMPS_FIELD_UNKNOWN=0,
-  LAMMPS_FIELD_ATOMID, LAMMPS_FIELD_MOLID,  LAMMPS_FIELD_TYPE,
-  LAMMPS_FIELD_POSX,   LAMMPS_FIELD_POSY,   LAMMPS_FIELD_POSZ, 
-  LAMMPS_FIELD_POSXS,  LAMMPS_FIELD_POSYS,  LAMMPS_FIELD_POSZS,
-  LAMMPS_FIELD_POSXU,  LAMMPS_FIELD_POSYU,  LAMMPS_FIELD_POSZU,
-  LAMMPS_FIELD_POSXSU, LAMMPS_FIELD_POSYSU, LAMMPS_FIELD_POSZSU,
-  LAMMPS_FIELD_IMGX,   LAMMPS_FIELD_IMGY,   LAMMPS_FIELD_IMGZ,
-  LAMMPS_FIELD_VELX,   LAMMPS_FIELD_VELY,   LAMMPS_FIELD_VELZ,
-  LAMMPS_FIELD_FORX,   LAMMPS_FIELD_FORY,   LAMMPS_FIELD_FORZ,
-  LAMMPS_FIELD_CHARGE, LAMMPS_FIELD_RADIUS, LAMMPS_FIELD_DIAMETER,
-  LAMMPS_FIELD_ELEMENT,LAMMPS_FIELD_MASS,   LAMMPS_FIELD_QUATW,
-  LAMMPS_FIELD_QUATI,  LAMMPS_FIELD_QUATJ,  LAMMPS_FIELD_QUATK,
-  LAMMPS_FIELD_MUX,    LAMMPS_FIELD_MUY,    LAMMPS_FIELD_MUZ,
-  LAMMPS_FIELD_USER0,  LAMMPS_FIELD_USER1,  LAMMPS_FIELD_USER2,
-  LAMMPS_FIELD_USER3,  LAMMPS_FIELD_USER4,  LAMMPS_FIELD_USER5,
-  LAMMPS_FIELD_USER6,  LAMMPS_FIELD_USER7,  LAMMPS_FIELD_USER8,
-  LAMMPS_FILED_USER9
-};
-
-typedef enum lammps_attribute l_attr_t;
-
-/* for transparent reading of .gz files */
-#ifdef _USE_ZLIB
-#include <zlib.h>
-#define FileDesc gzFile
-#define myFgets(buf,size,fd) gzgets(fd,buf,size)
-#define myFprintf gzprintf
-#define myFopen gzopen
-#define myFclose gzclose
-#define myRewind gzrewind
-#else
-#define FileDesc FILE*
-#define myFprintf fprintf
-#define myFopen fopen
-#define myFclose fclose
-#define myFgets(buf,size,fd) fgets(buf,size,fd)
-#define myRewind rewind
-#endif
-
-typedef struct {
-  FileDesc file;
-  FILE *fp;
-  char *file_name;
-  int *atomtypes;
-  int numatoms;
-  int maxatoms;
-  int nstep;
-  unsigned int coord_data; /* indicate type of coordinate data   */
-  float dip2atoms;         /* scaling factor for dipole to atom data */
-  float dumx,dumy,dumz;    /* location of dummy/disabled atoms */
-  int numfields;           /* number of data fields present */
-  l_attr_t field[LAMMPS_MAX_NUM_FIELDS]; /* type of data fields in dumps */
-  inthash_t *idmap;        /* for keeping track of atomids */
-  int fieldinit;           /* whether the field mapping was initialized */
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-} lammpsdata;
-
-/* merge sort for integer atom id map: merge function */
-static void id_merge(int *output, int *left, int nl, int *right, int nr)
-{
-    int i,l,r;
-    i = l = r = 0;
-    while ((l < nl) && (r < nr)) {
-        if (left[l] < right[r])
-            output[i++] = left[l++];
-        else
-            output[i++] = right[r++];
-    }
-    while (l < nl)
-        output[i++] = left[l++];
-    while (r < nr)
-        output[i++] = right[r++];
-}
-
-/* bottom up merge sort for integer atom id map: main function */
-static void id_sort(int *idmap, int num)
-{
-    int *hold;
-    int i,j,k;
-    
-    hold = (int *)malloc(num*sizeof(int));
-    if (hold == NULL) return;
-
-    for (i=1; i < num; i *=2) {
-        memcpy(hold,idmap,num*sizeof(int));
-        for (j=0; j < (num - i); j += 2*i) {
-            k =(j+2*i > num) ? num-j-i : i;
-            id_merge(idmap+j, hold+j, i, hold+j+i, k);
-        }
-    }
-    free((void *)hold);
-}
-
-/** Check a token against a list of equivalences.
- * The list has the format "toka=tok1,tokb=tok2,tokc=tok3"
- * and is split in pairs "toka=tok1" and then if "tok1" matches,
- * toka will be returned.
- * The first match or tag is returned.
- */
-static const char *remap_field(const char *tag, const char *list) 
-{
-  int i, pos, len, flag;
-  const char *ptr;
-  static char to[32], from[32];
-
-  /* no point in trying to match against NULL pointers */
-  if ((!tag) || (!list))
-    return tag;
-
-  ptr=list;
-  i=pos=flag=0;
-  len=strlen(list);
-
-  /* loop over whole string */
-  while (pos < len) {
-
-    if (flag) { /* case 1: determine the "from" string */
-      if (ptr[pos] == ',') { /* end of value */
-        from[i] = '\0';
-        if (0 == strcmp(tag,from)) { 
-          /* only return a token if it is non-NULL */
-          if (strlen(to))
-            return to;
-
-          flag=0;
-          i=0;
-        } else {
-          /* try next key */
-          flag=0;
-          i=0;
-        }
-      } else { /* copy into "from" */
-        from[i]=ptr[pos];
-        if (i<30)
-          ++i;
-      }
-    } else { /* case 2: determine the "to" string */
-
-      if (ptr[pos] == '=') { /* end of the key */
-        to[i] = '\0';
-        flag=1;
-        i=0;
-      } else if (ptr[pos] == ',') { /* incomplete entry. reset "to".*/
-        i=0;
-        flag=0;
-      } else { /* copy into "to" */
-        to[i]=ptr[pos];
-        if (i<30)
-          ++i;
-      }
-    }
-    ++pos;
-  }
-
-  /* we reached end of the list */
-  if (flag) {
-    from[i] = '\0';
-    if (0 == strcmp(tag,from)) { 
-      /* only return a token if it is non-NULL */
-      if (strlen(to))
-        return to;
-    }
-  }
-
-  return tag;
-}
-
-/** Scan the file for the next line beginning with the string "ITEM: "
- *  and returns a string containing the remainder of that line or NULL.
- *  Upon return, the file descriptor points either to the beginning 
- *  of the next line or at the first character that didn't fit into
- *  the buffer (linebuf[buflen]). */
-static char* find_next_item(FileDesc fd, char* linebuf, int buflen) {
-  char* ptr;
-
-  while(myFgets(linebuf, buflen, fd)) {
-
-    /* strip of leading whitespace */
-    ptr = linebuf;
-    while (ptr && (*ptr == ' ' || *ptr == '\t'))
-      ++ptr;
-
-    /* check if this is an "item" */
-    if(0 == strncmp(ptr, "ITEM:", 5)) {
-      ptr += 5;
-      return ptr;
-    }
-  }
-
-  return NULL;
-}
-
-/** Scan the file for the next occurence of a record of the type given
- *  in keyword.  If such a record is found, the file descriptor points
- *  to the beginning of the record content, and this function returns a
- *  pointer to the remainder of the line (EOL character or or additional
- *  data). otherwise a NULL pointer is returned.
- *  a pointer to a line buffer and its length have to be given.
- *  the return value will point to some location inside this buffer.
- */
-static char *find_item_keyword(FileDesc fd, const char* keyword,
-                               char *linebuf, int buflen) {
-  char *ptr;
-  int len;
-  
-  while(1) {
-    ptr = find_next_item(fd, linebuf, buflen);
-
-    if (ptr == NULL) 
-      break;
-    
-    while (ptr && (*ptr == ' ' || *ptr == '\t'))
-      ++ptr;
-
-#if LAMMPS_DEBUG
-    fprintf(stderr, "text=%s/%s", keyword, ptr);
-#endif
-    len = strlen(keyword);
-    if (0 == strncmp(ptr, keyword, len) ) {
-      ptr += len;
-      if (*ptr == '\0' || *ptr == ' ' || *ptr == '\n' || *ptr == '\r') {
-#if LAMMPS_DEBUG
-        fprintf(stderr, "return=%s", ptr);
-#endif
-        return ptr;
-      } else continue; /* keyword was not an exact match, try again. */
-    }
-  }
-#if LAMMPS_DEBUG
-  fprintf(stderr, "return='NULL'\n");
-#endif
-  return NULL;
-}
-
- 
-static void *open_lammps_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FileDesc fd;
-  lammpsdata *data;
-  char buffer[LINE_LEN];
-  char *ptr;
-  const char *envvar;
-  long tmp, maxatoms;
-
-  fd = myFopen(filename, "rb");
-  if (!fd) return NULL;
- 
-  data = (lammpsdata *)calloc(1, sizeof(lammpsdata));
-  data->file = fd;
-  data->file_name = strdup(filename);
-  data->dip2atoms = -1.0;
-  data->fieldinit = 0;
-  *natoms = 0;
-  maxatoms = 0;
-  
-  ptr = find_item_keyword(data->file, KEY_ATOMS,  buffer, LINE_LEN);
-  if (ptr == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Unable to find '%s' item.\n",
-                  KEY_ATOMS);
-    return NULL;
-  }
-
-  if (!myFgets(buffer, LINE_LEN, data->file)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) dump file '%s' should "
-                  "have the number of atoms after line ITEM: %s\n", 
-                  filename, KEY_ATOMS);
-    return NULL;
-  }
-
-  tmp = atol(buffer);
-  /* we currently only support 32-bit integer atom numbers */
-  if (tmp > 0x7FFFFFFF) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) dump file '%s' contains "
-                  "%ld atoms which is more than what this plugin supports.\n", 
-                  filename, tmp);
-    return NULL;
-  }
-
-  /* hack to allow trajectories with varying number of atoms.
-   * we initialize the structure to the value of LAMMPSMAXATOMS
-   * if that environment variable exists and has a larger value
-   * than the number of actual atoms in the first frame of the
-   * dump file. This way we can provision additional space and
-   * automatically support systems where atoms are lost.
-   * coordinates of atoms that are no longer present are set to
-   * either 0.0 or the content of LAMMPSDUMMYPOS.
-   */
-  envvar=getenv("LAMMPSMAXATOMS");
-  if (envvar) maxatoms = atol(envvar);
-  data->dumx = data->dumy = data->dumz = 0.0f;
-  envvar=getenv("LAMMPSDUMMYPOS");
-  if (envvar) sscanf(envvar,"%f%f%f", &(data->dumx),
-                     &(data->dumy), &(data->dumz));
-
-  if (maxatoms > tmp) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) provisioning space for up to "
-                  "%ld atoms.\n", maxatoms);
-  } else maxatoms = tmp;
-  *natoms = maxatoms;
-
-  /* hack to allow displaying dipoles as two atoms. 
-   * the presence of the environment variable toggles
-   * feature. its value is a scaling factor.
-   */
-  envvar=getenv("LAMMPSDIPOLE2ATOMS");
-  if (envvar) {
-    data->dip2atoms = (float) strtod(envvar,NULL);
-    maxatoms *= 2;
-    tmp *=2;
-  }
-  *natoms = maxatoms;
- 
-  data->maxatoms = maxatoms;  /* size of per-atom storage */
-  data->numatoms = tmp;       /* number of atoms initialized atoms */
-  data->coord_data = LAMMPS_COORD_NONE;  
-  myRewind(data->file); /* prepare for first read_timestep call */
- 
-  return data;
-}
-
-
-static int read_lammps_structure(void *mydata, int *optflags, 
-                                 molfile_atom_t *atoms) {
-  int i, j;
-  char buffer[LINE_LEN];
-  lammpsdata *data = (lammpsdata *)mydata;
-  int atomid, atomtype, needhash;
-  float x, y, z;
-  char *fieldlist;
-  molfile_atom_t thisatom;
-  const char *k;
-  int *idlist=NULL;
-  
-  /* clear atom info. */
-  *optflags = MOLFILE_NOOPTIONS; 
-  data->coord_data = LAMMPS_COORD_NONE;
-  memset(atoms, 0, data->numatoms * sizeof(molfile_atom_t));
-
-  /*  fake info for dummy atoms */
-  strcpy(thisatom.name,"@");
-  strcpy(thisatom.type,"X");
-  strcpy(thisatom.resname,"@@@");
-  strcpy(thisatom.segid,"@@@");
-  strcpy(thisatom.chain,"@");
-  thisatom.resid = -1;
-  thisatom.occupancy = -1.0;
-  thisatom.bfactor = -1.0;
-  thisatom.mass = 0.0;
-  thisatom.charge = 0.0;
-  thisatom.radius = 0.0;
-  thisatom.atomicnumber = 0;
-  for (i=data->numatoms; i < data->maxatoms; ++i)
-    memcpy(atoms+i, &thisatom, sizeof(molfile_atom_t)); 
-
-#if vmdplugin_ABIVERSION > 10
-  data->ts_meta.count = -1;
-  data->ts_meta.has_velocities = 0;
-#endif
- 
-  /* go to the beginning of the file */
-  myRewind(data->file); /* prepare for first read_timestep call */
-
-  /* find the boundary box info to determine if triclinic or not. */
-  fieldlist = find_item_keyword(data->file, KEY_BOX, buffer, LINE_LEN);
-  if (fieldlist == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-  k = myFgets(buffer, LINE_LEN, data->file);
-  if (k == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  j = sscanf(buffer, "%f%f%f", &x, &y, &z);
-  if (j == 3) {
-    data->coord_data |= LAMMPS_COORD_TRICLINIC;
-  } else if (j < 2) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* find the sections with atoms */
-  fieldlist = find_item_keyword(data->file, KEY_DATA, buffer, LINE_LEN);
-  if (fieldlist == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Couldn't find data to "
-                  "read structure from file '%s'.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-#if LAMMPS_DEBUG  
-  fprintf(stderr,"fieldlist for atoms: %s", fieldlist);
-#if 0  /* simulate old style trajectory */
-  fieldlist = strdup("\n");
-#endif
-#endif
-
-  /* parse list of fields */
-  i = 0;
-  k = strtok(fieldlist, " \t\n\r");
-  if (k == NULL) {
-    /* assume old style lammps trajectory  */
-    vmdcon_printf(VMDCON_WARN, "lammpsplugin) Found old style trajectory. "
-                  "assuming data is ordered "
-                  "'id type x|xs|xu y|ys|yu z|zs|zu [...]'.\n");
-    data->coord_data |= LAMMPS_COORD_UNKNOWN;
-  } else {
-    /* try to identify supported output types */
-    do {
-      /* hack to allow re-mapping of arbitrary fields. */
-      const char *envvar;
-      envvar=getenv("LAMMPSREMAPFIELDS");
-      if (envvar)
-        k=remap_field(k,envvar);
-      
-      if (0 == strcmp(k, "id")) {
-        data->field[i] = LAMMPS_FIELD_ATOMID;
-      } else if (0 == strcmp(k, "mol")) {
-        data->field[i] = LAMMPS_FIELD_MOLID;
-      } else if (0 == strcmp(k, "type")) {
-        data->field[i] = LAMMPS_FIELD_TYPE;
-      } else if (0 == strcmp(k, "x")) {
-        data->field[i] = LAMMPS_FIELD_POSX;
-        data->coord_data |= LAMMPS_COORD_WRAPPED;
-      } else if (0 == strcmp(k, "y")) {
-        data->field[i] = LAMMPS_FIELD_POSY;
-        data->coord_data |= LAMMPS_COORD_WRAPPED;
-      } else if (0 == strcmp(k, "z")) {
-        data->field[i] = LAMMPS_FIELD_POSZ;
-        data->coord_data |= LAMMPS_COORD_WRAPPED;
-      } else if (0 == strcmp(k, "xs")) {
-        data->field[i] = LAMMPS_FIELD_POSXS;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "ys")) {
-        data->field[i] = LAMMPS_FIELD_POSYS;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "zs")) {
-        data->field[i] = LAMMPS_FIELD_POSZS;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "xu")) {
-        data->field[i] = LAMMPS_FIELD_POSXU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-      } else if (0 == strcmp(k, "yu")) {
-        data->field[i] = LAMMPS_FIELD_POSYU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-      } else if (0 == strcmp(k, "zu")) {
-        data->field[i] = LAMMPS_FIELD_POSZU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-      } else if (0 == strcmp(k, "xus")) {
-        data->field[i] = LAMMPS_FIELD_POSXU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "yus")) {
-        data->field[i] = LAMMPS_FIELD_POSYU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "zus")) {
-        data->field[i] = LAMMPS_FIELD_POSZU;
-        data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-        data->coord_data |= LAMMPS_COORD_SCALED;
-      } else if (0 == strcmp(k, "ix")) {
-        data->field[i] = LAMMPS_FIELD_IMGX;
-        data->coord_data |= LAMMPS_COORD_IMAGES;
-      } else if (0 == strcmp(k, "iy")) {
-        data->field[i] = LAMMPS_FIELD_IMGY;
-        data->coord_data |= LAMMPS_COORD_IMAGES;
-      } else if (0 == strcmp(k, "iz")) {
-        data->field[i] = LAMMPS_FIELD_IMGZ;
-        data->coord_data |= LAMMPS_COORD_IMAGES;
-      } else if (0 == strcmp(k, "vx")) {
-        data->field[i] = LAMMPS_FIELD_VELX;
-#if vmdplugin_ABIVERSION > 10
-        data->coord_data |= LAMMPS_COORD_VELOCITIES;
-        data->ts_meta.has_velocities = 1;
-#endif
-      } else if (0 == strcmp(k, "vy")) {
-        data->field[i] = LAMMPS_FIELD_VELY;
-#if vmdplugin_ABIVERSION > 10
-        data->coord_data |= LAMMPS_COORD_VELOCITIES;
-        data->ts_meta.has_velocities = 1;
-#endif
-      } else if (0 == strcmp(k, "vz")) {
-        data->field[i] = LAMMPS_FIELD_VELZ;
-#if vmdplugin_ABIVERSION > 10
-        data->coord_data |= LAMMPS_COORD_VELOCITIES;
-        data->ts_meta.has_velocities = 1;
-#endif
-      } else if (0 == strcmp(k, "fx")) {
-        data->field[i] = LAMMPS_FIELD_FORX;
-        data->coord_data |= LAMMPS_COORD_FORCES;
-      } else if (0 == strcmp(k, "fy")) {
-        data->field[i] = LAMMPS_FIELD_FORY;
-        data->coord_data |= LAMMPS_COORD_FORCES;
-      } else if (0 == strcmp(k, "fz")) {
-        data->field[i] = LAMMPS_FIELD_FORZ;
-        data->coord_data |= LAMMPS_COORD_FORCES;
-      } else if (0 == strcmp(k, "q")) {
-        data->field[i] = LAMMPS_FIELD_CHARGE;
-        *optflags |= MOLFILE_CHARGE; 
-      } else if (0 == strcmp(k, "radius")) {
-        data->field[i] = LAMMPS_FIELD_RADIUS;
-        *optflags |= MOLFILE_RADIUS; 
-      } else if (0 == strcmp(k, "diameter")) {
-        data->field[i] = LAMMPS_FIELD_RADIUS;
-        *optflags |= MOLFILE_RADIUS; 
-      } else if (0 == strcmp(k, "element")) {
-        data->field[i] = LAMMPS_FIELD_ELEMENT;
-        *optflags |= MOLFILE_ATOMICNUMBER; 
-        *optflags |= MOLFILE_MASS; 
-        *optflags |= MOLFILE_RADIUS; 
-      } else if (0 == strcmp(k, "mass")) {
-        data->field[i] = LAMMPS_FIELD_MASS;
-        *optflags |= MOLFILE_MASS; 
-      } else if (0 == strcmp(k, "mux")) {
-        data->field[i] = LAMMPS_FIELD_MUX;
-        data->coord_data |= LAMMPS_COORD_DIPOLE;
-      } else if (0 == strcmp(k, "muy")) {
-        data->field[i] = LAMMPS_FIELD_MUY;
-        data->coord_data |= LAMMPS_COORD_DIPOLE;
-      } else if (0 == strcmp(k, "muz")) {
-        data->field[i] = LAMMPS_FIELD_MUZ;
-        data->coord_data |= LAMMPS_COORD_DIPOLE;
-      } else {
-        data->field[i] = LAMMPS_FIELD_UNKNOWN;
-      }
-      ++i;
-      data->numfields = i;
-      k = strtok(NULL," \t\n\r");
-    } while ((k != NULL) && (i < LAMMPS_MAX_NUM_FIELDS));
-  
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) New style dump with %d data "
-                  "fields. Coordinate data flags: 0x%02x\n",
-                  data->numfields, data->coord_data);
-    
-    if ( !(data->coord_data & LAMMPS_COORD_DIPOLE) && (data->dip2atoms >= 0.0f)) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) conversion of dipoles to "
-                    "two atoms requested, but no dipole data found\n");
-      free(idlist);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  idlist = (int *)malloc(data->numatoms * sizeof(int));
-
-  /* read and parse ATOMS data section to build idlist */
-  for(i=0; i<data->numatoms; i++) {
-    k = myFgets(buffer, LINE_LEN, data->file);
-
-    if (k == NULL) { 
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                    "structure from lammps dump file '%s': atom missing in "
-                    "the first timestep\n", data->file_name);
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) expecting '%d' atoms, "
-                    "found only '%d'\n", data->numatoms, i+1);
-      free(idlist);
-      return MOLFILE_ERROR;
-    }
-
-    /* if we have an old-style trajectory we have to guess what is there.
-     * this chunk of code should only be executed once. LAMMPS_COORD_UNKNOWN
-     * will be kept set until the very end or when we find that one position
-     * is outside the box. */
-    if (data->coord_data == LAMMPS_COORD_UNKNOWN) {
-      int ix, iy, iz;
-      j = sscanf(buffer, "%d%d%f%f%f%d%d%d", &atomid, &atomtype, 
-                 &x, &y, &z, &ix, &iy, &iz);
-      if (j > 4) {  /* assume id type xs ys zs .... format */
-        data->coord_data |= LAMMPS_COORD_SCALED;
-        data->numfields = 5;
-        data->field[0] = LAMMPS_FIELD_ATOMID;
-        data->field[1] = LAMMPS_FIELD_TYPE;
-        data->field[2] = LAMMPS_FIELD_POSXS;
-        data->field[3] = LAMMPS_FIELD_POSYS;
-        data->field[4] = LAMMPS_FIELD_POSZS;
-      } else {
-        vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                      "structure from lammps dump file '%s'. Unsupported "
-                      "dump file format.\n", data->file_name);
-        free(idlist);
-        return MOLFILE_ERROR;
-      }
-    }
-
-    atomid = i; /* default, if no atomid given */
-
-    /* parse the line of data and find the atom id */
-    j = 0;
-    k = strtok(buffer, " \t\n\r");
-    while ((k != NULL) && (j < data->numfields)) {
-      switch (data->field[j]) {
-
-        case LAMMPS_FIELD_ATOMID:
-          atomid = atoi(k) - 1; /* convert to 0 based list */
-          break;
-          
-        default:
-          break; /* ignore the rest */
-      }
-      ++j;
-      k = strtok(NULL, " \t\n\r");
-    }
-    if (data->dip2atoms < 0.0f) {
-      idlist[i] = atomid;
-    } else {
-      /* increment for fake second atom */
-      idlist[i] =  2*atomid;
-      ++i;
-      idlist[i] =  2*atomid+1;
-    }
-
-    /* for old-style files, we have to use some heuristics to determine
-     * if we have scaled or unscaled (absolute coordinates).
-     * we assume scaled unless proven differently, and we assume unwrapped
-     * unless we have images present. */
-    if ( (data->coord_data & LAMMPS_COORD_UNKNOWN) != 0) {
-      x=y=z=0.0f;
-      j = sscanf(buffer, "%*d%*d%f%f%f", &x, &y, &z);
-      if ((x<-0.1) || (x>1.1) || (y<-0.1) || (y>1.1) 
-          || (z<-0.1) || (x>1.1)) {
-        data->coord_data &= ~LAMMPS_COORD_UNKNOWN;
-        if ((data->coord_data & LAMMPS_COORD_IMAGES) != 0) {
-          data->coord_data |= LAMMPS_COORD_WRAPPED;
-          data->field[2] = LAMMPS_FIELD_POSX;
-          data->field[3] = LAMMPS_FIELD_POSY;
-          data->field[4] = LAMMPS_FIELD_POSZ;
-        } else {
-          data->coord_data |= LAMMPS_COORD_UNWRAPPED;
-          data->field[2] = LAMMPS_FIELD_POSXU;
-          data->field[3] = LAMMPS_FIELD_POSYU;
-          data->field[4] = LAMMPS_FIELD_POSZU;
-        }
-      }
-    }
-  }
-  data->coord_data &= ~LAMMPS_COORD_UNKNOWN;
-
-  /* pick coordinate type that we want to read and disable the rest. 
-     we want unwrapped > wrapped > scaled. */
-  if (data->coord_data & LAMMPS_COORD_UNWRAPPED) {
-    data->coord_data &= ~(LAMMPS_COORD_WRAPPED|LAMMPS_COORD_SCALED
-                          |LAMMPS_COORD_IMAGES);
-  } else if (data->coord_data & LAMMPS_COORD_WRAPPED) {
-    data->coord_data &= ~LAMMPS_COORD_SCALED;
-  } else if (!(data->coord_data & LAMMPS_COORD_SCALED)) {
-    /* we don't have any proper coordinates, not even scaled: bail out. */
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) No usable coordinate data "
-                  "found in lammps dump file '%s'.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-  
-  if (data->coord_data & LAMMPS_COORD_SCALED) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Reconstructing atomic "
-                  "coordinates from fractional coordinates and box vectors.\n");
-  } else {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Using absolute atomic "
-                  "coordinates directly.\n");
-  }
-  if (data->coord_data & LAMMPS_COORD_DIPOLE) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Detected dipole vector data.\n");
-  }
-  
-  if (data->coord_data & LAMMPS_COORD_TRICLINIC) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Detected triclinic box.\n");
-  }
-  
-#if vmdplugin_ABIVERSION > 10
-  if (data->coord_data & LAMMPS_COORD_VELOCITIES) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Importing atomic velocities.\n");
-  }
-#endif
-
-  /* sort list of atomids and figure out if we need the hash table */
-  id_sort(idlist, data->numatoms);
-  needhash=0;
-  for (i=0; i < data->numatoms; ++i)
-    if (idlist[i] != i) needhash=1;
-
-  /* set up an integer hash to keep a sorted atom id map */
-  if (needhash) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Using hash table to track "
-                  "atom identities.\n");
-    data->idmap = (inthash_t *)calloc(1, sizeof(inthash_t));
-    inthash_init(data->idmap, data->numatoms);
-    for (i=0; i < data->numatoms; ++i) {
-      if (inthash_insert(data->idmap, idlist[i], i) != HASH_FAIL) {
-        vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Duplicate atomid %d or "
-                      "unsupported dump file format.\n", idlist[i]);
-        free(idlist);
-        return MOLFILE_ERROR;
-      }
-    }
-  } else {
-    data->idmap = NULL;
-  }
-  free(idlist);
-  
-
-  /* now go back to the beginning of the file to parse it properly. */
-  myRewind(data->file); 
-
-  /* find the sections with atoms */
-  fieldlist = find_item_keyword(data->file, KEY_DATA, buffer, LINE_LEN);
-  if (fieldlist == NULL) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Couldn't find data to "
-                  "read structure from file '%s'.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-  /* read and parse ATOMS data section */
-  for(i=0; i<data->numatoms; i++) {
-    int has_element, has_mass, has_radius;
-    
-    k = myFgets(buffer, LINE_LEN, data->file);
-
-    if (k == NULL) { 
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                    "structure from lammps dump file '%s': atom missing in "
-                    "the first timestep\n", data->file_name);
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) expecting '%d' atoms, "
-                    "found only '%d'\n", data->numatoms, i+1);
-      free(idlist);
-      return MOLFILE_ERROR;
-    }
-
-    /* some defaults */
-    memset(&thisatom, 0, sizeof(molfile_atom_t)); 
-    thisatom.resid = 0; /* mapped to MolID, if present */
-    strncpy(thisatom.resname, "UNK", 4);
-    strncpy(thisatom.chain, "",1);
-    strncpy(thisatom.segid, "",1);
-    atomid = i; /* needed if there is no atomid in a custom dump. */
-    has_element = has_mass = has_radius = 0;
-
-    /* parse the line of data */
-    j = 0;
-    k = strtok(buffer, " \t\n\r");
-    while ((k != NULL) && (j < data->numfields)) {
-      int idx;
-
-      switch (data->field[j]) {
-
-        case LAMMPS_FIELD_ATOMID:
-          atomid = atoi(k) - 1; /* convert to 0 based list */
-          break;
-
-        case LAMMPS_FIELD_ELEMENT:
-          strncpy(thisatom.name, k, 16);
-          thisatom.name[15] = '\0';
-          idx = get_pte_idx(k);
-          thisatom.atomicnumber = idx;
-          has_element = 1;
-          break;
-
-        case LAMMPS_FIELD_TYPE:
-          strncpy(thisatom.type, k, 16); 
-          if (has_element == 0) {
-            /* element label has preference for name */
-            strncpy(thisatom.name, k, 16);
-            thisatom.type[15] = '\0';
-          }
-          /* WARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNING *\
-           * Don't try using the atomid as name. This will waste a _lot_ of  *
-           * memory due to names being stored in a string hashtable.         *
-           * VMD currently cannot handle changing atomids anyways. We thus   *
-           * use a hash table to track atom ids. Within VMD the atomids are  *
-           * then lost, but atoms can be identified uniquely via 'serial'    *
-           * or 'index' atom properties.
-           * WARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNINGWARNING*/
-          break;
-          
-        case LAMMPS_FIELD_MOLID:
-          thisatom.resid = atoi(k);
-          break;
-
-        case LAMMPS_FIELD_CHARGE:
-          thisatom.charge = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MASS:
-          thisatom.mass = atof(k);
-          has_mass = 1;
-          break;
-
-        case LAMMPS_FIELD_RADIUS:
-          thisatom.radius = atof(k);
-          has_radius = 1;
-          break;
-
-        case LAMMPS_FIELD_DIAMETER:
-          /* radius has preference over diameter */
-          if (has_radius == 0) {
-            thisatom.radius = 0.5*atof(k);
-            has_radius = 1;
-          }
-          break;
-
-        case LAMMPS_FIELD_UNKNOWN: /* fallthrough */
-        default:
-          break;                /* do nothing */
-      }
-      ++j;
-      k = strtok(NULL, " \t\n\r");
-    }
-
-    /* guess missing data from element name */
-    if (has_element) {
-      int idx = get_pte_idx(thisatom.name);
-      if (!has_mass)   thisatom.mass   = get_pte_mass(idx);
-      if (!has_radius) thisatom.radius = get_pte_vdw_radius(idx);
-    }
-
-    /* find position of this atom in the global list and copy its data */
-    if (data->dip2atoms < 0.0f) {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, atomid);
-      } else {
-        j = atomid;
-      }
-      memcpy(atoms+j, &thisatom, sizeof(molfile_atom_t)); 
-    } else {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, 2*atomid);
-      } else {
-        j = 2*atomid;
-      }
-      memcpy(atoms+j, &thisatom, sizeof(molfile_atom_t)); 
-      /* the fake second atom has the same data */
-      ++i;
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, 2*atomid+1);
-      } else {
-        j = 2*atomid+1;
-      }
-      memcpy(atoms+j, &thisatom, sizeof(molfile_atom_t)); 
-    }
-  }
-
-  myRewind(data->file);
-  data->fieldinit = 1;
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 10
-/***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  lammpsdata *data = (lammpsdata *)mydata;
-  
-  meta->count = -1;
-  meta->has_velocities = data->ts_meta.has_velocities;
-  if (meta->has_velocities) {
-    vmdcon_printf(VMDCON_INFO, "lammpsplugin) Importing velocities from "
-                      "custom LAMMPS dump file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-/* convert cosine of angle to degrees. 
-   bracket within -1.0 <= x <= 1.0 to avoid NaNs
-   due to rounding errors. */
-static float cosangle2deg(double val)
-{
-  if (val < -1.0) val=-1.0;
-  if (val >  1.0) val= 1.0;
-  return (float) (90.0 - asin(val)*90.0/M_PI_2);
-}
-
-static int read_lammps_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j;
-  char buffer[LINE_LEN];
-  float x, y, z, vx, vy, vz;
-  int atomid, numres, numatoms;
-  float xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, ylohi;
-  float xlo_bound, xhi_bound, ylo_bound, yhi_bound, zlo_bound, zhi_bound;
-
-  lammpsdata *data = (lammpsdata *)mydata;
-  /* we need to read/parse the structure information,
-   * even if we only want to read coordinates later */
-  if (data->fieldinit == 0) {
-    molfile_atom_t *atoms;
-    atoms = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-    read_lammps_structure(mydata,&natoms,atoms);
-    free(atoms);
-  }
-
-  /* check if there is another time step in the file. */
-  if (NULL == find_item_keyword(data->file, KEY_TSTEP, buffer, LINE_LEN)) 
-    return MOLFILE_ERROR;
- 
-  /* check if we should read or skip this step. */
-  if (!ts) return MOLFILE_SUCCESS;
-
-  /* search for the number of atoms in the timestep */
-  if (NULL==find_item_keyword(data->file, KEY_ATOMS, buffer, LINE_LEN)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Unable to find item: %s for "
-                  "current timestep in file %s.\n", KEY_ATOMS, data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-  if (!myFgets(buffer, LINE_LEN, data->file)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Premature EOF for %s.\n", data->file_name);
-    return MOLFILE_ERROR;
-  }
-
-  /* check if we have sufficient storage for atoms in this frame */
-  numatoms = atoi(buffer);
-  data->numatoms = numatoms;
-  if (data->dip2atoms < 0.0f) {
-    if (natoms < numatoms) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Too many atoms in timestep."
-                    " %d vs. %d\n", numatoms, natoms);
-      return MOLFILE_ERROR;
-    }
-  } else {
-    if (natoms/2 < numatoms) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Too many atoms in timestep."
-                    " %d vs. %d\n", numatoms, natoms/2);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  /* now read the boundary box of the timestep */
-  if (NULL == find_item_keyword(data->file, KEY_BOX, buffer, LINE_LEN)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Could not find box boundaries in timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (NULL == myFgets(buffer, LINE_LEN, data->file)) return MOLFILE_ERROR;
-  numres = sscanf(buffer,"%f%f%f", &xlo_bound, &xhi_bound, &xy);
-
-  if (NULL == myFgets(buffer, LINE_LEN, data->file)) return MOLFILE_ERROR;
-  numres += sscanf(buffer,"%f%f%f", &ylo_bound, &yhi_bound, &xz);
-
-  if (NULL == myFgets(buffer, LINE_LEN, data->file)) return MOLFILE_ERROR;
-  numres += sscanf(buffer,"%f%f%f", &zlo_bound, &zhi_bound, &yz);
-
-  xlo = xlo_bound;
-  xhi = xhi_bound;
-  ylo = ylo_bound;
-  yhi = yhi_bound;
-  zlo = zlo_bound;
-  zhi = zhi_bound;
-
-  if (data->coord_data & LAMMPS_COORD_TRICLINIC) {
-    float xdelta;
-
-    /* triclinic box. conveniently, LAMMPS makes the same assumptions
-       about the orientation of the simulation cell than VMD. so
-       hopefully no coordinate rotations or translations will be required */
-
-    if (numres != 9) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Inconsistent triclinic box specifications.\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* adjust box bounds */
-    xdelta = MIN(0.0f,xy);
-    xdelta = MIN(xdelta,xz);
-    xdelta = MIN(xdelta,xy+xz);
-    xlo -= xdelta;
-
-    xdelta = MAX(0.0f,xy);
-    xdelta = MAX(xdelta,xz);
-    xdelta = MAX(xdelta,xy+xz);
-    xhi -= xdelta;
-
-    ylo -= MIN(0.0f,yz);
-    yhi -= MAX(0.0f,yz);
-    
-  } else {
-    if (numres != 6) {
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Inconsistent orthorhombic box specifications.\n");
-      return MOLFILE_ERROR;
-    }
-    xy = 0.0f;
-    xz = 0.0f;
-    yz = 0.0f;
-  }
-
-  /* convert bounding box info to real box lengths */
-  ts->A = xhi-xlo;
-  ylohi = yhi-ylo;
-  ts->B = sqrt(ylohi*ylohi + xy*xy);
-  ts->C = sqrt((zhi-zlo)*(zhi-zlo) + xz*xz + yz*yz);
-
-  /* compute angles from box lengths and tilt factors */
-  ts->alpha = cosangle2deg((xy*xz + ylohi*yz)/(ts->B * ts->C));
-  ts->beta  = cosangle2deg(xz/ts->C);
-  ts->gamma = cosangle2deg(xy/ts->B);
-
-  /* read the coordinates */
-  if (NULL == find_item_keyword(data->file, KEY_DATA, buffer, LINE_LEN)) {
-    vmdcon_printf(VMDCON_ERROR, "lammpsplugin) could not find atom data for timestep.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* initialize all coordinates to dummy location */
-  for (i=0; i<natoms; i++) {
-    ts->coords[3*i+0] = data->dumx;
-    ts->coords[3*i+1] = data->dumy;
-    ts->coords[3*i+2] = data->dumz;
-  }
-
-#if vmdplugin_ABIVERSION > 10
-  /* initialize velocities to zero if present */
-  if (ts->velocities != NULL) memset(ts->velocities,0,3*natoms*sizeof(float));
-#endif
-
-  for (i=0; i<numatoms; i++) {
-    float ix, iy, iz, mux, muy, muz;
-    char *k;
-    
-    k = myFgets(buffer, LINE_LEN, data->file);
-
-    if (k == NULL) { 
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) Error while reading "
-                    "data from lammps dump file '%s'.\n", data->file_name);
-      vmdcon_printf(VMDCON_ERROR, "lammpsplugin) expecting '%d' atoms, "
-                    "found only '%d'\n", numatoms, i+1);
-      return MOLFILE_ERROR;
-    }
-
-    x=y=z=ix=iy=iz=vx=vy=vz=mux=muy=muz=0.0f;
-    atomid=i;
-    
-    /* parse the line of data */
-    j = 0;
-    k = strtok(buffer, " \t\n\r");
-    while ((k != NULL) && (j < data->numfields)) {
-      switch (data->field[j]) {
-
-        case LAMMPS_FIELD_ATOMID:
-          atomid = atoi(k) - 1;
-          break;
-
-        case LAMMPS_FIELD_POSX:
-          if (data->coord_data & LAMMPS_COORD_WRAPPED)
-            x = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSY:
-          if (data->coord_data & LAMMPS_COORD_WRAPPED)
-            y = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSZ:
-          if (data->coord_data & LAMMPS_COORD_WRAPPED)
-            z = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSXU:
-          if (data->coord_data & LAMMPS_COORD_UNWRAPPED)
-            x = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSYU:
-          if (data->coord_data & LAMMPS_COORD_UNWRAPPED)
-            y = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSZU:
-          if (data->coord_data & LAMMPS_COORD_UNWRAPPED)
-            z = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSXS:
-          if (data->coord_data & LAMMPS_COORD_SCALED)
-            x = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSYS:
-          if (data->coord_data & LAMMPS_COORD_SCALED)
-            y = atof(k);
-          break;
-
-        case LAMMPS_FIELD_POSZS:
-          if (data->coord_data & LAMMPS_COORD_SCALED)
-            z = atof(k);
-          break;
-
-        case LAMMPS_FIELD_IMGX:
-          if (data->coord_data & LAMMPS_COORD_IMAGES)
-            ix = atof(k);
-          break;
-
-        case LAMMPS_FIELD_IMGY:
-          if (data->coord_data & LAMMPS_COORD_IMAGES)
-            iy = atof(k);
-          break;
-
-        case LAMMPS_FIELD_IMGZ:
-          if (data->coord_data & LAMMPS_COORD_IMAGES)
-            iz = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MUX:
-          if (data->coord_data & LAMMPS_COORD_DIPOLE)
-            mux = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MUY:
-          if (data->coord_data & LAMMPS_COORD_DIPOLE)
-            muy = atof(k);
-          break;
-
-        case LAMMPS_FIELD_MUZ:
-          if (data->coord_data & LAMMPS_COORD_DIPOLE)
-            muz = atof(k);
-          break;
-
-#if vmdplugin_ABIVERSION > 10
-        case LAMMPS_FIELD_VELX:
-          vx = atof(k);
-          break;
-
-        case LAMMPS_FIELD_VELY:
-          vy = atof(k);
-          break;
-
-        case LAMMPS_FIELD_VELZ:
-          vz = atof(k);
-          break;
-#endif
-
-        default: /* do nothing */
-          break;
-      }
-
-      ++j;
-      k = strtok(NULL, " \t\n\r");
-    } 
-    
-    if (data->dip2atoms < 0.0f) {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, atomid);
-      } else {
-        j = atomid;
-      }
-    } else {
-      if (data->idmap != NULL) {
-        j = inthash_lookup(data->idmap, 2*atomid);
-      } else {
-        j = 2*atomid;
-      }
-    }
-    
-    if (data->idmap && (j == HASH_FAIL)) {
-      /* we have space in the hash table. add this atom */
-      if (inthash_entries(data->idmap) < data->maxatoms) {
-        if (data->dip2atoms < 0.0f) {
-          inthash_insert(data->idmap,atomid,i);
-          j = inthash_lookup(data->idmap,atomid);
-        } else {
-          inthash_insert(data->idmap,2*atomid,2*i);
-          inthash_insert(data->idmap,2*atomid+1,2*i+1);
-          j = inthash_lookup(data->idmap, 2*atomid);
-        }
-      } else j = -1;
-    }
-
-    if ((j < 0) || (j >= data->maxatoms)) {
-      vmdcon_printf(VMDCON_WARN, "lammpsplugin) ignoring out of range "
-                    "atom #%d with id %d\n", i, atomid);
-    } else {
-      /* copy coordinates. we may have coordinates in different
-       * formats available in custom dumps. those have been checked
-       * before and we prefer to use unwrapped > wrapped > scaled 
-       * in this order. in the second two cases, we also apply image
-       * shifts, if that data is available. unnecessary or unsupported
-       * combinations of flags have been cleared based on data in 
-       * the first frame in read_lammps_structure(). */
-      int addr = 3 * j;
-      if (data->coord_data & LAMMPS_COORD_TRICLINIC) {
-        if (data->coord_data & LAMMPS_COORD_SCALED) {
-          /* we have fractional coordinates, so they need 
-           * to be scaled accordingly. */
-          ts->coords[addr    ] = xlo + x * ts->A + y * xy + z * xz;
-          ts->coords[addr + 1] = ylo + y * ylohi + z * yz;
-          ts->coords[addr + 2] = zlo + z * (zhi-zlo);
-        } else {
-          /* ... but they can also be absolute values */
-          ts->coords[addr    ] = x;
-          ts->coords[addr + 1] = y;
-          ts->coords[addr + 2] = z;
-        }
-        if (data->coord_data & LAMMPS_COORD_IMAGES) {
-          /* we have image counter data to unwrap coordinates. */
-          ts->coords[addr    ] += ix * ts->A + iy * xy + iz * xz;
-          ts->coords[addr + 1] += iy * ylohi + iz * yz;
-          ts->coords[addr + 2] += iz * (zhi-zlo);
-        }
-      } else {
-        if (data->coord_data & LAMMPS_COORD_SCALED) {
-          /* we have fractional coordinates, so they need 
-           * to be scaled by a/b/c etc. */
-          ts->coords[addr    ] = xlo + x * ts->A;
-          ts->coords[addr + 1] = ylo + y * ts->B;
-          ts->coords[addr + 2] = zlo + z * ts->C;
-        } else {
-          /* ... but they can also be absolute values */
-          ts->coords[addr    ] = x;
-          ts->coords[addr + 1] = y;
-          ts->coords[addr + 2] = z;
-        }
-        if (data->coord_data & LAMMPS_COORD_IMAGES) {
-          /* we have image counter data to unwrap coordinates. */
-          ts->coords[addr    ] += ix * ts->A;
-          ts->coords[addr + 1] += iy * ts->B;
-          ts->coords[addr + 2] += iz * ts->C;
-        }
-      }
-        
-#if vmdplugin_ABIVERSION > 10
-      if (ts->velocities != NULL) {
-        ts->velocities[addr    ] = vx;
-        ts->velocities[addr + 1] = vy;
-        ts->velocities[addr + 2] = vz;
-      }
-#endif
-
-      /* translate and copy atom positions for dipole data */
-      if (data->dip2atoms >= 0.0f) {
-        const float sf = data->dip2atoms;
-        
-        x = ts->coords[addr    ];
-        y = ts->coords[addr + 1];
-        z = ts->coords[addr + 2];
-        ts->coords[addr    ] = x + sf*mux;
-        ts->coords[addr + 1] = y + sf*muy;
-        ts->coords[addr + 2] = z + sf*muz;
-
-        if (data->idmap != NULL) {
-          j = inthash_lookup(data->idmap, 2*atomid + 1);
-        } else {
-          j = 2*atomid + 1;
-        }
-        addr = 3*j;
-        ts->coords[addr    ] = x - sf*mux;
-        ts->coords[addr + 1] = y - sf*muy;
-        ts->coords[addr + 2] = z - sf*muz;
-#if vmdplugin_ABIVERSION > 10
-        if (ts->velocities != NULL) {
-          ts->velocities[addr    ] = vx;
-          ts->velocities[addr + 1] = vy;
-          ts->velocities[addr + 2] = vz;
-        }
-#endif
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_lammps_read(void *mydata) {
-  lammpsdata *data = (lammpsdata *)mydata;
-  myFclose(data->file);
-  free(data->file_name);
-#if LAMMPS_DEBUG
-  if (data->idmap != NULL) 
-    fprintf(stderr, "inthash stats: %s\n", inthash_stats(data->idmap));
-#endif
-  if (data->idmap != NULL) {
-    inthash_destroy(data->idmap);
-    free(data->idmap);
-  }
-  free(data);
-}
-
-static void *open_lammps_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fp;
-  lammpsdata *data;
-
-  fp = fopen(filename, "w");
-  if (!fp) { 
-    vmdcon_printf(VMDCON_ERROR, "Error) Unable to open lammpstrj file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (lammpsdata *)malloc(sizeof(lammpsdata));
-  data->numatoms = natoms;
-  data->fp = fp;
-  data->file_name = strdup(filename);
-  data->nstep = 0;
-  return data;
-}
-
-static int write_lammps_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  lammpsdata *data = (lammpsdata *)mydata;
-  int i, j;
-  hash_t atomtypehash;
-
-  hash_init(&atomtypehash,128);
-
-  /* generate 1 based lookup table for atom types */
-  for (i=0, j=1; i < data->numatoms; i++)
-    if (hash_insert(&atomtypehash, atoms[i].type, j) == HASH_FAIL)
-      j++;
-  
-  data->atomtypes = (int *) malloc(data->numatoms * sizeof(int));
-
-  for (i=0; i < data->numatoms ; i++)
-    data->atomtypes[i] = hash_lookup(&atomtypehash, atoms[i].type);
-
-  hash_destroy(&atomtypehash);
-  
-  return MOLFILE_SUCCESS;
-}
-
-static int write_lammps_timestep(void *mydata, const molfile_timestep_t *ts) {
-  lammpsdata *data = (lammpsdata *)mydata; 
-  const float *pos;
-  float xmin[3], xmax[3], xcen[3];
-  int i, tric, pbcx, pbcy, pbcz;
-
-  fprintf(data->fp, "ITEM: TIMESTEP\n");
-  fprintf(data->fp, "%d\n", data->nstep);
-  fprintf(data->fp, "ITEM: NUMBER OF ATOMS\n");
-  fprintf(data->fp, "%d\n", data->numatoms);
-
-  pos = ts->coords;
-
-  xmax[0] = xmax[1] = xmax[2] = -1.0e30f;
-  xmin[0] = xmin[1] = xmin[2] =  1.0e30f;
-  tric = pbcx = pbcy = pbcz = 0;
-
-#if defined(_MSC_VER)
-  if ((fabs(ts->alpha - 90.0f) > SMALL) ||
-      (fabs(ts->beta  - 90.0f) > SMALL) ||
-      (fabs(ts->gamma - 90.0f) > SMALL)) 
-    tric = 1;
-    if (fabs(ts->A > SMALL)) pbcx = 1;
-    if (fabs(ts->B > SMALL)) pbcy = 1;
-    if (fabs(ts->C > SMALL)) pbcz = 1;
-#else
-  if ((fabsf(ts->alpha - 90.0f) > SMALL) ||
-      (fabsf(ts->beta  - 90.0f) > SMALL) ||
-      (fabsf(ts->gamma - 90.0f) > SMALL))
-    tric = 1;
-    if (fabsf(ts->A > SMALL)) pbcx = 1;
-    if (fabsf(ts->B > SMALL)) pbcy = 1;
-    if (fabsf(ts->C > SMALL)) pbcz = 1;
-#endif  
-
-  /* find min/max coordinates to approximate lo/hi values */
-  for (i = 0; i < data->numatoms; ++i) {
-    xmax[0] = (pos[0] > xmax[0]) ? pos[0] : xmax[0];
-    xmax[1] = (pos[1] > xmax[1]) ? pos[1] : xmax[1];
-    xmax[2] = (pos[2] > xmax[2]) ? pos[2] : xmax[2];
-    xmin[0] = (pos[0] < xmin[0]) ? pos[0] : xmin[0];
-    xmin[1] = (pos[1] < xmin[1]) ? pos[1] : xmin[1];
-    xmin[2] = (pos[2] < xmin[2]) ? pos[2] : xmin[2];
-    pos += 3;
-  }
-  xcen[0] = 0.5f * (xmax[0] + xmin[0]);
-  xcen[1] = 0.5f * (xmax[1] + xmin[1]);
-  xcen[2] = 0.5f * (xmax[2] + xmin[2]);
-
-  pos = ts->coords;
-
-  if (tric == 0 ) {  /* orthogonal box */
-
-    if (pbcx) xmax[0] = xcen[0] + 0.5f*ts->A;
-    if (pbcx) xmin[0] = xcen[0] - 0.5f*ts->A;
-    if (pbcy) xmax[1] = xcen[1] + 0.5f*ts->B;
-    if (pbcy) xmin[1] = xcen[1] - 0.5f*ts->B;
-    if (pbcz) xmax[2] = xcen[2] + 0.5f*ts->C;
-    if (pbcz) xmin[2] = xcen[2] - 0.5f*ts->C;
-
-    /* flag using PBC when box length exists, else shrinkwrap BC */
-    fprintf(data->fp, "ITEM: BOX BOUNDS %s %s %s\n", pbcx ? "pp" : "ss",
-            pbcy ? "pp" : "ss", pbcz ? "pp" : "ss");
-    fprintf(data->fp, "%g %g\n", xmin[0], xmax[0]);
-    fprintf(data->fp, "%g %g\n", xmin[1], xmax[1] );
-    fprintf(data->fp, "%g %g\n", xmin[2], xmax[2] );
-
-  } else { /* triclinic box */
-
-    double lx, ly, lz, xy, xz, yz, xbnd;
-
-    lx = ts->A;
-    xy = ts->B * cos(ts->gamma/90.0*M_PI_2);
-    xz = ts->C * cos(ts->beta/90.0*M_PI_2);
-    ly = sqrt(ts->B*ts->B - xy*xy);
-    if (fabs(ly) > SMALL) 
-      yz = (ts->B*ts->C*cos(ts->alpha/90.0*M_PI_2) - xy*xz) / ly;
-    else
-      yz = 0.0;
-    lz = sqrt(ts->C*ts->C - xz*xz - yz*yz);
-
-    if (pbcx) xmax[0] = xcen[0] + 0.5f*lx;
-    if (pbcx) xmin[0] = xcen[0] - 0.5f*lx;
-    if (pbcy) xmax[1] = xcen[1] + 0.5f*ly;
-    if (pbcy) xmin[1] = xcen[1] - 0.5f*ly;
-    if (pbcz) xmax[2] = xcen[2] + 0.5f*lz;
-    if (pbcz) xmin[2] = xcen[2] - 0.5f*lz;
-
-    /* go from length to boundary */
-
-    xbnd = 0.0;
-    xbnd = (xy > xbnd) ? xy : xbnd;
-    xbnd = (xz > xbnd) ? xz : xbnd;
-    xbnd = (xy+xz > xbnd) ? (xy + xz) : xbnd;
-    xmax[0] += xbnd;
-
-    xbnd = 0.0;
-    xbnd = (xy < xbnd) ? xy : xbnd;
-    xbnd = (xz < xbnd) ? xz : xbnd;
-    xbnd = (xy+xz < xbnd) ? (xy + xz) : xbnd;
-    xmin[0] += xbnd;
-    
-    xbnd = 0.0;
-    xbnd = (yz > xbnd) ? yz : xbnd;
-    xmax[1] += xbnd;
-
-    xbnd = 0.0;
-    xbnd = (yz < xbnd) ? yz : xbnd;
-    xmin[1] += xbnd;
-
-    /* flag using PBC when box length exists, else shrinkwrap BC */
-    fprintf(data->fp, "ITEM: BOX BOUNDS %s %s %s xy xz yz\n", pbcx ? "pp" : "ss",
-            pbcy ? "pp" : "ss", pbcz ? "pp" : "ss");
-    fprintf(data->fp, "%g %g %g\n", xmin[0], xmax[0], xy);
-    fprintf(data->fp, "%g %g %g\n", xmin[1], xmax[1], xz);
-    fprintf(data->fp, "%g %g %g\n", xmin[2], xmax[2], yz);
-  }
-  
-  /* coordinates are written as unwrapped coordinates */
-  fprintf(data->fp, "ITEM: ATOMS id type xu yu zu\n");
-  for (i = 0; i < data->numatoms; ++i) {
-    fprintf(data->fp, " %d %d %g %g %g\n", 
-            i+1, data->atomtypes[i], pos[0], pos[1], pos[2]);
-    pos += 3;
-  }
-
-  data->nstep ++;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_lammps_write(void *mydata) {
-  lammpsdata *data = (lammpsdata *)mydata;
-
-  fclose(data->fp);
-  free(data->atomtypes);
-  free(data->file_name);
-  free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "lammpstrj";
-  plugin.prettyname = "LAMMPS Trajectory";
-  plugin.author = "Marco Kalweit, Axel Kohlmeyer, Lutz Maibaum, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 22;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-#ifdef _USE_ZLIB
-  plugin.filename_extension = "lammpstrj,lammpstrj.gz";
-#else
-  plugin.filename_extension = "lammpstrj";
-#endif
-  plugin.open_file_read = open_lammps_read;
-  plugin.read_structure = read_lammps_structure;
-  plugin.read_next_timestep = read_lammps_timestep;
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-#endif
-  plugin.close_file_read = close_lammps_read;
-  plugin.open_file_write = open_lammps_write;
-  plugin.write_structure = write_lammps_structure;
-  plugin.write_timestep = write_lammps_timestep;
-  plugin.close_file_write = close_lammps_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  molfile_atom_t *atoms = NULL;
-  void *v;
-  int natoms;
-  int i, j, opts;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-
-  while (--argc >=0) {
-    ++argv;
-    v = open_lammps_read(*argv, "lammps", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_lammps_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_lammps_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    atoms = (molfile_atom_t *)malloc(sizeof(molfile_atom_t)*natoms);
-    if (read_lammps_structure(v, &opts, atoms) == MOLFILE_ERROR) {
-      close_lammps_read(v);
-      continue;
-    }
-      
-    fprintf(stderr, "read_lammps_structure: options=0x%08x\n", opts);
-#if 0
-    for (i=0; i<natoms; ++i) {
-      fprintf(stderr, "atom %09d: name=%s, type=%s, resname=%s, resid=%d, segid=%s, chain=%s\n",
-                      i, atoms[i].name, atoms[i].type, atoms[i].resname, atoms[i].resid,
-                      atoms[i].segid, atoms[i].chain);
-    }
-#endif
-#if vmdplugin_ABIVERSION > 10
-    read_timestep_metadata(v,&ts_meta);
-    if (ts_meta.has_velocities) {
-      fprintf(stderr, "found timestep velocities metadata.\n");
-    }
-    timestep.velocities = (float *) malloc(3*natoms*sizeof(float));
-#endif
-    j = 0;
-    while (!read_lammps_timestep(v, natoms, &timestep)) {
-      for (i=0; i<10; ++i) {
-        fprintf(stderr, "atom %09d: type=%s, resid=%d, "
-                      "x/y/z = %.3f %.3f %.3f "
-#if vmdplugin_ABIVERSION > 10
-                      "vx/vy/vz = %.3f %.3f %.3f "
-#endif
-                      "\n",
-                      i, atoms[i].type, atoms[i].resid, 
-                      timestep.coords[3*i], timestep.coords[3*i+1], 
-                      timestep.coords[3*i+2]
-#if vmdplugin_ABIVERSION > 10
-                      ,timestep.velocities[3*i], timestep.velocities[3*i+1], 
-                      timestep.velocities[3*i+2]
-#endif
-                      );    
-      }
-      j++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", j);
-
-    close_lammps_read(v);
-  }
-#if vmdplugin_ABIVERSION > 10
-  free(timestep.velocities);
-#endif
-  free(timestep.coords);
-  free(atoms);
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/largefiles.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/largefiles.h
deleted file mode 100644
index 4495e1c2c6167c1d87f5254cbf43381584b2ff8f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/largefiles.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: largefiles.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.4 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Platform dependent defines for enabling 64-bit file I/O on 32-bit machines
- *
- ***************************************************************************/
- 
-#if defined(_AIX)
-/* Define to enable large file extensions on AIX */
-#define _LARGE_FILE
-#define _LARGE_FILES
-#else
-/* Defines which enable LFS I/O interfaces for large (>2GB) file support
- * on 32-bit machines.  These must be defined before inclusion of any
- * system headers.
- */
-#ifndef _LARGEFILE_SOURCE
-#define _LARGEFILE_SOURCE
-#endif
-#define _FILE_OFFSET_BITS 64
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/maeffplugin.cxx b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/maeffplugin.cxx
deleted file mode 100644
index 839f2a41eadf28073883df146e4b4ab96478474a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/maeffplugin.cxx
+++ /dev/null
@@ -1,2107 +0,0 @@
-//
-// Version info for VMD plugin tree:
-//   $Id: maeffplugin.cxx,v 1.28 2016/11/06 17:49:24 johns Exp $
-//
-// Version info for last sync with D. E. Shaw Research:
-//  //depot/desrad/main/sw/libs/molfile/plugins/maeffplugin.cxx#3
-//
-
-/*
-Copyright 2009, D. E. Shaw Research, LLC
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research, LLC nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#if defined(_MSC_VER)
-#ifndef DESRES_WIN32
-#define DESRES_WIN32
-#endif
-#endif
-
-#include <molfile_plugin.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <fstream>
-#include <vector>
-#include <map>
-#include <cmath>
-#include <set>
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <stdexcept>
-#include <vector>
-
-#ifdef DESRES_WIN32
-#define ssize_t int
-#define M_PI (3.1415926535897932385)
-#define M_PI_2 (1.5707963267948966192)
-
-#if defined(_MSC_VER)
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
-#endif
-
-namespace {
-
-    /*!
-     * \brief Takes a stream and returns maestro tokens.
-     * This tokenizer is built on streams and uses a small, tight
-     * finite state automata to construct a token
-     */
-    class Tokenizer {
-
-      /*! \brief Actions for the DFA token builder
-       *
-       */
-      typedef enum {
-        DONE = 0,
-        SKIPWHITE,  // 1 
-        INCOMMENT,  //  2
-        CHOOSEKIND,  // 3
-        SINGLECHAR,  // 4
-        STARTSTRING,  // 5 
-        INSTRING,  // 6
-        ESCAPE,  // 7 
-        STARTOTHER,  // 8 
-        CONTINUEOTHER  // 9
-      } action_t;
-
-      //! \brief The current character
-      char m_c;
-
-      //! \brief the stream for the file we're parsing
-      std::ifstream &m_input;
-
-      //! \brief The current token
-      char * m_token;
-
-      //! \brief number of malloc'ed bytes in m_token
-      ssize_t max_token_size;
-
-      //! \brief True iff the token is already read
-      bool m_isfresh;
-
-      //! \brief Current line in file
-      unsigned m_line;
-
-      //! \brief Line where token starts
-      unsigned m_tokenline;
-
-      //! \brief Get current character
-      /*!
-      * Returns the current character in the file
-      * @return current char
-      */
-      inline char peek() { return m_c; }
-
-      //! \brief Read a new character
-      /*!
-      * Read into the current character and update line
-      * and point information.
-      * @return (new) current char
-      */
-      inline char read() {
-        m_c = m_input.get();
-        if (m_c == '\n') m_line++;
-        return m_c;
-      }
-
-      //! \brief True if character is a token
-      /*!
-      * A few Maestro tokens are just 1 char long.  We use
-      * this test to short-circuit the tokenizer when at
-      * [, ], {, or }.
-      */
-      static bool issingle(char c) {
-        return (c == '[' || c == ']' || c == '{' || c == '}');
-      }
-
-      Tokenizer(const Tokenizer&); // No copy c'tor
-
-    public:
-
-      //! \brief Tokenizer based on a file stream
-      Tokenizer(std::ifstream &in);
-
-      //! \brief Clean up and release buffers.
-      ~Tokenizer();
-
-      //! \brief Current token under cursor
-      const char * token(bool ignore_single_character_tokens=false);
-
-      //! \brief Advance to next token
-      void next();
-
-      //! \brief Line number associated with current token
-      unsigned line() const;
-
-      //! \brief File seek point for current token
-      size_t point() const;
-
-      //! \brief Predict a particular token
-      const char * predict(const char * match="");
-
-      //! \brief Predict a value token
-      const char * predict_value();
-
-      //! \brief For while(not_a(match)) loops
-      bool not_a(const char * match=END_OF_FILE);
-
-      static const char * END_OF_FILE;
-    };
-}
-
-/*!
- * Build from an istream
- * @param input The stream to parse
- */
-Tokenizer::Tokenizer(std::ifstream &in)
-  : m_c(0),
-    m_input(in),
-    m_token(NULL),
-    max_token_size(0),
-    m_isfresh(false),
-    m_line(1),
-    m_tokenline(1)
-{
-  max_token_size = 16;
-  m_token = (char *)malloc(max_token_size);
-
-  // grab 1st token.
-  read();
-}
-
-/*!
- * The destructor cleans up any heap allocated temporaries created
- * during construction.
- */
-Tokenizer::~Tokenizer() {
-  if (m_token) free(m_token);
-}
-
-/*!
- * This routine assembles a token character-by-character.
- * At its heart is a little DFA that looks at a character
- * to determine the next state.  For instance, the DFA
- * starts in a SKIPWHITE state and stays there unless
- * it finds a comment (#) or other character.  In the
- * INCOMMENT state, it looks for end-of-line before
- * returning to SKIPWHITE.  Similarly, all tokens are
- * defined using this one-character lookahead.
- * @return The current (possibly new) token 
- */
-const char * Tokenizer::token(bool ignore_single) {
-  // -----------------------------------------------
-  // Keep returning the same token until next()
-  // is called.
-  // -----------------------------------------------
-  if (m_isfresh) return m_token;
-  
-  // -----------------------------------------------
-  // End of file simply returns an empty string
-  // -----------------------------------------------
-
-  // begin at start of token space
-  char * ptr = m_token;
-  m_isfresh = true;
-  
-  unsigned state = SKIPWHITE;
-  char c = peek();
-  bool good = false;
-  ssize_t diff;
-  while(state != DONE && c >= 0) {
-    // make sure we have space in m_token for 2 more characters
-    if ((diff = ptr-m_token) >= max_token_size-1) {
-      m_token = (char *)realloc( m_token, 2*max_token_size );
-      ptr = m_token + diff;
-      max_token_size *= 2;
-    }
-    //std::cout << int(c) << " " << state << std::endl;
-    switch(state) {
-    case SKIPWHITE:
-      // -----------------------------------------------
-      // Skip whitespace and see if its a token or a
-      // comment
-      // -----------------------------------------------
-      if (::isspace(c)) {
-        c = read();
-      } else if (c == '#') {
-        state = INCOMMENT;
-        c = read();
-      } else {
-        state = CHOOSEKIND;
-      }
-      break;
-    case INCOMMENT:
-      // -----------------------------------------------
-      // On a comment, read until end of line
-      // -----------------------------------------------
-      if (c == '\n' || c == '#') state = SKIPWHITE;
-      c = read();
-      break;
-    case CHOOSEKIND:
-      // -----------------------------------------------
-      // We []{} are single character tokens,
-      // Strings start with "
-      // Everything else starts with some other character
-      // -----------------------------------------------
-      if (issingle(c)) {
-        if (ignore_single)
-          state = STARTOTHER;
-        else  
-          state = SINGLECHAR;
-      } else if (c == '"') {
-        state = STARTSTRING;
-      } else {
-        state = STARTOTHER;
-      }
-      break;
-    case SINGLECHAR:
-      good = true;
-      m_tokenline = m_line;
-      *ptr++ = c;
-      *ptr++ = '\0';
-      read();
-      state = DONE;
-      break;
-    case STARTSTRING:
-      good = true;
-      m_tokenline = m_line;
-      *ptr++ = c;
-      read(); // Skip opening quote
-      c = peek();
-      state = INSTRING;
-      break;
-    case INSTRING:
-      if ( c == '"' ) {
-        *ptr++ = c;
-        *ptr++ = '\0';
-        state = DONE;
-      } else if ( c == '\\' ) {
-        state = ESCAPE;
-      } else {
-        *ptr++ = c;
-      }
-      c = read();
-      break;
-    case ESCAPE:
-      *ptr++ = c;
-      state = INSTRING;
-      c = read();
-      break;
-    case STARTOTHER:
-      good = true;
-      m_tokenline = m_line;
-      state = CONTINUEOTHER;
-      break;
-    case CONTINUEOTHER:
-      if (ignore_single) {
-        if (isspace(c) || c == '\n') {
-          *ptr++ = '\0';
-          state = DONE;
-        } else {
-          *ptr++ = c;
-          c = read();
-        }
-      } else {
-        if (issingle(c) || isspace(c) || c == '#' || c == '"') {
-          *ptr++ = '\0';
-          state = DONE;
-        } else {
-          *ptr++ = c;
-          c = read();
-        }
-      }
-      break;
-    }
-  }
-  
-  // -----------------------------------------------
-  // Maybe we just read trailing whitespace...
-  // -----------------------------------------------
-  if (!good) *m_token = '\0';
-  
-  return m_token;
-}
-
-/*!
- * Set state to read a new token on the next request.
- */
-void Tokenizer::next() {
-  m_isfresh = false;
-}
-
-/*!
- * Line associated with current token
- * @return The line number
- */
-unsigned Tokenizer::line() const {
-  return m_tokenline;
-}
-
-/*!
- * The predictive, recursive-descent parsers I use do a lot
- * of "I expect the next token to look like this" calls.
- * (e.g. I expect a "{" here).  This simplifies the logic
- * for that.
- * @param match
- * @return The matching token body
- */
-const char *
-Tokenizer::predict(const char * match) {
-  const char * tok = token();
-  if (strcmp(match, "") && strcmp(tok, match)) {
-    std::stringstream str;
-    str << "Line " <<line()<< " predicted '" <<std::string(match)<< "' have '"
-        << (isprint(tok[0])?tok:"<unprintable>")
-        << "'" << std::endl;
-    throw std::runtime_error(str.str());
-  }
-  next();
-  return tok;
-}
-
-const char *
-Tokenizer::predict_value() {
-    const char * tok = token(true); // ignore single char tokens here
-    if ( (tok[0] == '\0') || (strcmp(tok,":::") == 0) || (strcmp(tok,"}") == 0)) {
-        std::stringstream str;
-        str << "Line " << line() << " predicted a value token, but I have a '"
-            << (isprint(tok[0])?tok:"<unprintable>")
-            << "'" << std::endl;
-        throw std::runtime_error(str.str());
-    }
-    next();
-    return tok;
-}
-
-/*!
- * Another common pattern is replication.  So, while (not_a("}")) { ... }
- * This function makes that easy.
- * @param match Token body to try to match
- * @return True on a match, False on EOF or a non-match
- */
-bool Tokenizer::not_a(const char * match) {
-  const char * tok = token();
-  if (!strcmp(tok, END_OF_FILE)) return false; // EOF always quits
-  return strcmp(tok, match);
-}
-
-/*!
- * The special end of file token (string of length 1 containing a null byte)
- * Normal parsing will not create this character sequence, so it makes a
- * good special token.
- */
-const char * Tokenizer::END_OF_FILE = "";
-
-namespace {
-  struct element {
-    double daltons;
-    const char* abbreviation;
-    const char* name;
-  };
-}
-
-// url = "http://physics.nist.gov/cgi-bin/Elements/elInfo.pl?element=%d&context=noframes"%element
-static struct element amu[] = {
-  {1.00794,"H","Hydrogen"},
-  {4.002602,"He","Helium"},
-  {6.941,"Li","Lithium"},
-  {9.012182,"Be","Beryllium"},
-  {10.811,"B","Boron"},
-  {12.0107,"C","Carbon"},
-  {14.0067,"N","Nitrogen"},
-  {15.9994,"O","Oxygen"},
-  {18.9984032,"F","Fluorine"},
-  {20.1797,"Ne","Neon"},
-  {22.989770,"Na","Sodium"},
-  {24.3050,"Mg","Magnesium"},
-  {26.981538,"Al","Aluminum"},
-  {28.0855,"Si","Silicon"},
-  {30.973761,"P","Phosphorus"},
-  {32.065,"S","Sulfur"},
-  {35.453,"Cl","Chlorine"},
-  {39.0983,"K","Potassium"},
-  {39.948,"Ar","Argon"},
-  {40.078,"Ca","Calcium"},
-  {44.955910,"Sc","Scandium"},
-  {47.867,"Ti","Titanium"},
-  {50.9415,"V","Vanadium"},
-  {51.9961,"Cr","Chromium"},
-  {54.938049,"Mn","Manganese"},
-  {55.845,"Fe","Iron"},
-  {58.6934,"Ni","Nickel"},
-  {58.933200,"Co","Cobalt"},
-  {63.546,"Cu","Copper"},
-  {65.409,"Zn","Zinc"},
-  {69.723,"Ga","Gallium"},
-  {72.64,"Ge","Germanium"},
-  {74.92160,"As","Arsenic"},
-  {78.96,"Se","Selenium"},
-  {79.904,"Br","Bromine"},
-  {83.798,"Kr","Krypton"},
-  {85.4678,"Rb","Rubidium"},
-  {87.62,"Sr","Strontium"},
-  {88.90585,"Y","Yttrium"},
-  {91.224,"Zr","Zirconium"},
-  {92.90638,"Nb","Niobium"},
-  {95.94,"Mo","Molybdenum"},
-  {101.07,"Ru","Ruthenium"},
-  {102.90550,"Rh","Rhodium"},
-  {106.42,"Pd","Palladium"},
-  {107.8682,"Ag","Silver"},
-  {112.411,"Cd","Cadmium"},
-  {114.818,"In","Indium"},
-  {118.710,"Sn","Tin"},
-  {121.760,"Sb","Antimony"},
-  {126.90447,"I","Iodine"},
-  {127.60,"Te","Tellurium"},
-  {131.293,"Xe","Xenon"},
-  {132.90545,"Cs","Cesium"},
-  {137.327,"Ba","Barium"},
-  {138.9055,"La","Lanthanum"},
-  {140.116,"Ce","Cerium"},
-  {140.90765,"Pr","Praseodymium"},
-  {144.24,"Nd","Neodymium"},
-  {150.36,"Sm","Samarium"},
-  {151.964,"Eu","Europium"},
-  {157.25,"Gd","Gadolinium"},
-  {158.92534,"Tb","Terbium"},
-  {162.500,"Dy","Dysprosium"},
-  {164.93032,"Ho","Holmium"},
-  {167.259,"Er","Erbium"},
-  {168.93421,"Tm","Thulium"},
-  {173.04,"Yb","Ytterbium"},
-  {174.967,"Lu","Lutetium"},
-  {178.49,"Hf","Hafnium"},
-  {180.9479,"Ta","Tantalum"},
-  {183.84,"W","Tungsten"},
-  {186.207,"Re","Rhenium"},
-  {190.23,"Os","Osmium"},
-  {192.217,"Ir","Iridium"},
-  {195.078,"Pt","Platinum"},
-  {196.96655,"Au","Gold"},
-  {200.59,"Hg","Mercury"},
-  {204.3833,"Tl","Thallium"},
-  {207.2,"Pb","Lead"},
-  {208.98038,"Bi","Bismuth"},
-  {231.03588,"Pa","Protactinium"},
-  {232.0381,"Th","Thorium"},
-  {238.02891,"U","Uranium"}
-};
-
-static const int nelements = sizeof(amu)/sizeof(amu[0]);
-
-static std::pair<int, const char *> 
-find_element_by_amu(double target) {
-  int left = 0;
-  int right = nelements-1;
-
-  // -----------------------------------------------
-  // Knuth's binary search
-  // -----------------------------------------------
-  while(left <= right) {
-    int mid = (left+right)/2;
-    if (target> amu[mid].daltons) {
-      left = mid + 1;
-    } else if (target< amu[mid].daltons) {
-      right = mid - 1;
-    } else {
-      /* Exact match (unlikely) */
-      left = right = mid;
-      return std::pair<int, const char *>( left+1, amu[left].abbreviation );
-    }
-  }
-
-  // -----------------------------------------------
-  // CAUTION: at this point, the meanings of 
-  // left and right are switched (i.e. left >= right,
-  // see the while() loop above if you don't believe me!
-  // -----------------------------------------------
-  int swap = left;
-  left = right;
-  right = swap;
-
-  if (left < 0) left = right;
-  if (right > nelements-1) right = left;
-
-  if (target - amu[left].daltons < amu[right].daltons - target) {
-    return std::pair<int, const char *>( left+1, amu[left].abbreviation );
-  }
-
-  return std::pair<int, const char *>( right+1, amu[left].abbreviation );
-}
-
-static std::pair<double, const char *> 
-find_element_by_atomic_number(int target) {
-  if (target < 1) target=1;
-  if (target >= nelements) target = nelements-1;
-  return std::pair<double,const char *> ( amu[target-1].daltons,
-                                          amu[target-1].abbreviation );
-}
-
-namespace {
-
-  struct schema_t { /*GCOV-IGNORE*/
-    char type;
-    std::string attr;
-  };
-
-  struct site {
-    float mass;
-    float charge;
-    bool  pseudo;
-    site() : mass(0), charge(0), pseudo(0) {}
-  };
-
-  struct vsite {
-    int ai;             // parent atom of virtual
-    std::string funct;  // ffio_funct
-  };
-  // mapping from index in sites to entry in ffio_virtuals
-  typedef std::map<int,vsite> VirtualsMap;
-
-  struct bond_t {
-    int from, to;
-    float order;
-    bond_t() {}
-    bond_t(int f, int t, float o) : from(f), to(t), order(o) {}
-  };
-  
-  struct pos_t {
-    float x, y, z;
-    pos_t() {}
-    pos_t(float x_, float y_, float z_) : x(x_), y(y_), z(z_) {}
-  };
-  struct vel_t {
-    float x, y, z;
-    vel_t() {}
-    vel_t(float x_, float y_, float z_) : x(x_), y(y_), z(z_) {}
-  };
-
-  struct ct_data {
-    int natoms;    // number of physical atoms from m_atom block
-    int npseudos;  // number of pseudoatoms from ffio_pseudo
-
-    std::vector<molfile_atom_t> particles;
-    std::vector<pos_t>          position;
-    std::vector<vel_t>          velocity;
-    std::vector<site>           sites;
-    std::vector<bond_t>         bonds;
-
-    std::map<size_t,int> atommap, pseudomap;
-
-    VirtualsMap virtuals;
-    ct_data() : natoms(0), npseudos(0) {}
-  };
-
-  typedef std::vector<schema_t> Schema;
-  typedef std::vector<std::string> Row;
-  typedef std::map<std::string, std::string> AttrMap;
-  typedef std::map<int, ct_data> CtMap;
-
-  /*! entries in fepio_fep table */
-  struct fep_elem {
-    //! variable names correspond to fepio_fep field names
-    //!@{
-    int ti, tj;
-    int ai, aj, ak, al;
-    int am, an, ao, ap; // Allow treatment of torsion-torsion terms
-    int moiety; //!< The moiety that each mapped term belongs to.
-    fep_elem() : ti(-1), tj(-1), ai(-1), aj(-1), ak(-1), al(-1),
-                 am(-1), an(-1), ao(-1), ap(-1), moiety(-1) {}
-    //!@}
-  };
-  /*! Represnts a single table in fepio_fep */
-  typedef std::vector<fep_elem> FepList;
-  /*! Represnts the entire fepio_fep section */
-  typedef std::map<std::string, FepList > FepioMapping;
-
-  double dotprod(const double *x, const double *y) {
-    return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
-  }
-
-  void strip_whitespace(char *buf) {
-    if (!buf) return;
-    char *ptr = buf;
-    while (isspace(*ptr)) ++ptr;
-    while (*ptr && !isspace(*ptr)) {
-      *buf++ = *ptr++;
-    }
-    *buf='\0';
-  }
-
-  struct Handle {
-    std::ofstream output;
-    bool eof;
-    double A[3], B[3], C[3];        // global cell vectors
-    int optflags;
-
-    int stage1, stage2;  // alchemical stages
-    FepioMapping fepmap;
-
-    int nparticles;
-    std::vector<int> bond_from, bond_to;
-    std::vector<float> bond_order;
-    std::vector<molfile_atom_t> particles; // for writing
-    CtMap ctmap;
-
-    Handle() 
-    : eof(false), stage1(0), stage2(0), nparticles(0) {
-      for (int i=0; i<3; i++) A[i] = B[i] = C[i] = 0;
-      A[0] = 1;
-      B[1] = 1;
-      C[2] = 1;
-    }
-
-    void set_box( AttrMap &attrs ) {
-      std::string abox("chorus_box_a_");
-      std::string bbox("chorus_box_b_");
-      std::string cbox("chorus_box_c_");
-      for (int i=0; i<3; i++) {
-        char x='x'+i;
-        abox[abox.size()-1] = x;
-        bbox[bbox.size()-1] = x;
-        cbox[cbox.size()-1] = x;
-        A[i] = atof(attrs[abox].c_str());
-        B[i] = atof(attrs[bbox].c_str());
-        C[i] = atof(attrs[cbox].c_str());
-      }
-    }
-    void set_box( const molfile_timestep_t *ts) {
-      // Convert VMD's unit cell information
-      double cosBC = sin( ((90 - ts->alpha ) / 180) * M_PI );
-      double cosAC = sin( ((90 - ts->beta  ) / 180) * M_PI );
-      double cosAB = sin( ((90 - ts->gamma ) / 180) * M_PI );
-      double sinAB = cos( ((90 - ts->gamma ) / 180) * M_PI );
-
-      double Ax = ts->A;
-      double Ay = 0;
-      double Az = 0;
-      double Bx = ts->B * cosAB;
-      double By = ts->B * sinAB;
-      double Bz = 0;
-      double Cx,Cy,Cz;
-      if (sinAB != 0) {
-        Cx = cosAC;
-        Cy = (cosBC - cosAC*cosAB) / sinAB;
-        Cz = sqrt(1-Cx*Cx-Cy*Cy);
-        Cx *= ts->C;
-        Cy *= ts->C;
-        Cz *= ts->C;
-      } else {
-        Cx=Cy=Cz=0;
-      }
-      A[0] = Ax; A[1] = Ay; A[2] = Az;
-      B[0] = Bx; B[1] = By; B[2] = Bz;
-      C[0] = Cx; C[1] = Cy; C[2] = Cz;
-    }
-    void get_box( molfile_timestep_t *ts) const {
-      ts->A = sqrt(dotprod(A,A));
-      ts->B = sqrt(dotprod(B,B));
-      ts->C = sqrt(dotprod(C,C));
-
-      if (ts->A == 0 || ts->B == 0 || ts->C == 0) {
-        // bogosity in the unit cell.  Warn the user and
-        // provide 90 degree angles for all.
-        fprintf(stderr, "WARNING: Some unit cell dimensions were zero; all unit cell angles set to 90.\n");
-        ts->alpha = ts->beta = ts->gamma = 90;
-      } else {
-
-        // compute angles
-        double cosAB = dotprod(A,B)/(ts->A * ts->B);
-        double cosAC = dotprod(A,C)/(ts->A * ts->C);
-        double cosBC = dotprod(B,C)/(ts->B * ts->C);
-
-        // clamp
-        if (cosAB > 1.0) cosAB = 1.0; else if (cosAB < -1.0) cosAB = -1.0;
-        if (cosAC > 1.0) cosAC = 1.0; else if (cosAC < -1.0) cosAC = -1.0;
-        if (cosBC > 1.0) cosBC = 1.0; else if (cosBC < -1.0) cosBC = -1.0;
-
-        // convert to angles using asin to avoid nasty rounding when we are
-        // close to 90 degree angles.
-        ts->alpha = 90.0 - asin(cosBC) * 90.0 / M_PI_2; /* cosBC */
-        ts->beta  = 90.0 - asin(cosAC) * 90.0 / M_PI_2; /* cosAC */
-        ts->gamma = 90.0 - asin(cosAB) * 90.0 / M_PI_2; /* cosAB */
-      }
-    }
-  };
-
-  class Array {
-  protected:
-    Handle *h;
-    const int m_ct;
-
-  public:
-    Array(Handle *h_, int ct) : h(h_), m_ct(ct) {}
-    virtual ~Array() {}
-
-    virtual void set_schema( const Schema &schema ) {}
-    virtual void insert_row(const Row &row) {}
-
-    static void get_str(const std::string &value, char *arr, int N) {
-      if (value == "<>") return;
-      if (value.size() && value[0] == '"' && value[value.size()-1]) {
-        strncpy(arr, value.substr(1,value.size()-2).c_str(), N);
-      } else {
-        strncpy(arr, value.c_str(), N);
-      }
-      strip_whitespace(arr);
-    }
-
-    static void get_int(const std::string &value, int &ival) {
-      ival=atoi(value.c_str());
-    }
-    static void get_float(const std::string &value, float &fval) {
-      fval=atof(value.c_str());
-    }
-  };
-#define GET_STR( val_, arr_) do { get_str(val_, arr_, sizeof(arr_)); } while(0)
-
-  class AtomArray : public Array {
-    int i_name, i_resname, i_resid, i_x, i_y, i_z, i_vx, i_vy, i_vz, 
-        i_anum, i_chain, i_segid, i_charge;
-    std::vector<molfile_atom_t> &atoms;
-    std::vector<pos_t> &pos;
-    std::vector<vel_t> &vel;
-    int &natoms;
-
-  public:
-    AtomArray(Handle *h_, int ct) 
-    : Array(h_, ct),
-      i_name(-1), i_resname(-1), i_resid(-1), 
-      i_x(-1), i_y(-1), i_z(-1), 
-      i_vx(-1), i_vy(-1), i_vz(-1),
-      i_anum(-1), i_chain(-1), i_segid(-1),
-      i_charge(0),
-      atoms( h->ctmap[m_ct].particles ),
-      pos( h->ctmap[m_ct].position),
-      vel( h->ctmap[m_ct].velocity),
-      natoms( h->ctmap[m_ct].natoms )
-    {
-      h->optflags = MOLFILE_NOOPTIONS; // ensure initialization
-#if defined(DESRES_CTNUMBER)
-      h->optflags = MOLFILE_CTNUMBER;
-#endif
-    }
-
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="m_pdb_atom_name")    i_name=i;
-        else if (attr=="m_pdb_residue_name") i_resname=i;
-        else if (attr=="m_residue_number")   i_resid=i;
-        else if (attr=="m_x_coord")          i_x=i;
-        else if (attr=="m_y_coord")          i_y=i;
-        else if (attr=="m_z_coord")          i_z=i;
-        else if (attr=="ffio_x_vel")         i_vx=i;
-        else if (attr=="ffio_y_vel")         i_vy=i;
-        else if (attr=="ffio_z_vel")         i_vz=i;
-        else if (attr=="m_atomic_number")  { i_anum=i; h->optflags |= MOLFILE_ATOMICNUMBER; }
-        else if (attr=="m_chain_name")       i_chain=i;
-        else if (attr=="m_pdb_segment_name") i_segid=i;
-        else if (attr=="m_formal_charge")  { i_charge=i; h->optflags |= MOLFILE_CHARGE; }
-      }
-    }
-
-    virtual void insert_row(const Row &row) {
-      molfile_atom_t a;
-      memset(&a, 0, sizeof(molfile_atom_t));
-      if (i_name>=0)    GET_STR(row[i_name], a.name);
-      if (i_name>=0)    GET_STR(row[i_name], a.type);
-      if (i_resname>=0) GET_STR(row[i_resname], a.resname);
-      if (i_resid>=0)   get_int(row[i_resid], a.resid);
-      if (i_segid>=0)   GET_STR(row[i_segid], a.segid);
-      if (i_chain>=0)   GET_STR(row[i_chain], a.chain);
-
-#if defined(DESRES_CTNUMBER)
-      a.ctnumber = m_ct;
-#endif
-      if (i_anum>=0)    get_int(row[i_anum], a.atomicnumber);
-
-      // if we didn't get an atom name, try to get one from the atomic number.
-      bool bad_name=true;
-      for (const char *p=a.name; *p; ++p) {
-        if (!isspace(*p)) {
-          bad_name = false;
-          break;
-        }
-      }
-      if (bad_name && a.atomicnumber>0) {
-        strncpy( a.name, 
-                 find_element_by_atomic_number(a.atomicnumber).second,
-                 sizeof(a.name) );
-      }
-      
-      // if we didn't get a segid, encode the ct index.
-      if (!strlen(a.segid)) {
-        snprintf(a.segid, 4, "C%d", m_ct);
-      }
-      atoms.push_back(a);
-      natoms += 1;
-
-      pos_t pnt(0,0,0);
-      vel_t v(0,0,0);
-      if (i_x>=0 && i_y>=0 && i_z>=0) {
-        get_float(row[i_x], pnt.x);
-        get_float(row[i_y], pnt.y);
-        get_float(row[i_z], pnt.z);
-      }
-      if (i_vx>=0 && i_vy>=0 && i_vz>=0) {
-        get_float(row[i_vx], v.x);
-        get_float(row[i_vy], v.y);
-        get_float(row[i_vz], v.z);
-      }
-      pos.push_back(pnt);
-      vel.push_back(v);
-    }
-  };
-
-  class SitesArray : public Array {
-    int i_mass, i_charge, i_type;
-    std::vector<site> &sites;
-  public:
-    SitesArray(Handle *h_, int ct) 
-    : Array(h_, ct), i_mass(-1), i_charge(-1), i_type(-1),
-      sites(h->ctmap[ct].sites) 
-    {}
-
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="ffio_mass")   { i_mass=i; h->optflags |= MOLFILE_MASS;}
-        else if (attr=="ffio_charge") { i_charge=i; h->optflags |= MOLFILE_CHARGE; }
-        else if (attr=="ffio_type")   i_type=i;
-      }
-    }
-    virtual void insert_row(const Row &row) {
-      site s;
-      if (i_mass>=0) get_float(row[i_mass], s.mass);
-      if (i_charge>=0) get_float(row[i_charge], s.charge);
-      if (i_type>=0) {
-        char type[32];
-        GET_STR(row[i_type], type);
-        s.pseudo = !strcmp(type, "pseudo");
-      }
-      sites.push_back(s);
-    }
-  };
-  
-  struct BondArray : public Array {
-    int i_from, i_to, i_order;
-    std::vector<bond_t> &bonds;
-
-  public:
-    BondArray(Handle *h_, int ct)
-    : Array(h_, ct), i_from(-1), i_to(-1), i_order(-1),
-      bonds(h->ctmap[m_ct].bonds)
-    {}
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="m_from")  i_from=i;
-        else if (attr=="m_to")    i_to=i;
-        else if (attr=="m_order") i_order=i;
-      }
-    }
-    virtual void insert_row(const Row &row) {
-      if (i_from>=0 && i_to>=0) {
-        int from, to, order;
-        get_int(row[i_from], from);
-        get_int(row[i_to], to);
-        if (from < to) {
-          if (i_order>=0) get_int(row[i_order], order);
-          else            order=1;
-          bonds.push_back(bond_t( from, to, order ));
-        }
-      }
-    }
-  };
-
-  class VirtualsArray : public Array {
-    int i_index, i_ai, i_funct;
-    std::string default_funct;
-
-  public:
-    VirtualsArray(Handle *h_, int ct, const std::string &def_funct)
-    : Array(h_, ct), i_index(-1), i_ai(-1), i_funct(-1),
-      default_funct(def_funct)
-    {}
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="ffio_index")   i_index=i;
-        else if (attr=="ffio_ai")      i_ai=i;
-        else if (attr=="ffio_funct")   i_funct=i;
-      }
-    }
-    virtual void insert_row( const Row &row ) {
-      if (i_index<0 || i_ai<0) return;
-      vsite v;
-      int pseudo;
-      get_int( row[i_ai], v.ai);
-      get_int( row[i_index], pseudo );
-      v.funct = (i_funct>=0) ? row[i_funct] : default_funct;
-      h->ctmap[m_ct].virtuals[pseudo] = v;
-    }
-  };
-
-  class PseudoArray : public Array {
-    int i_x, i_y, i_z, i_vx, i_vy, i_vz;
-    int i_resname, i_chain, i_segid, i_resid;
-    std::vector<molfile_atom_t> &atoms;
-    std::vector<pos_t> &pos;
-    std::vector<vel_t> &vel;
-    int &npseudos;
-
-  public:
-    PseudoArray(Handle *h_, int ct) 
-    : Array(h_, ct),
-      i_x(-1), i_y(-1), i_z(-1), 
-      i_vx(-1), i_vy(-1), i_vz(-1),
-      i_resname(-1), i_chain(-1), i_segid(-1), i_resid(-1),
-      atoms( h->ctmap[m_ct].particles ),
-      pos( h->ctmap[m_ct].position),
-      vel( h->ctmap[m_ct].velocity),
-      npseudos( h->ctmap[m_ct].npseudos)
-    {}
-    virtual void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="ffio_x_coord")          i_x=i;
-        else if (attr=="ffio_y_coord")          i_y=i;
-        else if (attr=="ffio_z_coord")          i_z=i;
-        else if (attr=="ffio_x_vel")         i_vx=i;
-        else if (attr=="ffio_y_vel")         i_vy=i;
-        else if (attr=="ffio_z_vel")         i_vz=i;
-
-        else if (attr=="ffio_pdb_residue_name") i_resname=i;
-        else if (attr=="ffio_chain_name")       i_chain=i;
-        else if (attr=="ffio_pdb_segment_name") i_segid=i;
-        else if (attr=="ffio_residue_number")   i_resid=i;
-      }
-    }
-
-    virtual void insert_row( const Row &row ) {
-      molfile_atom_t a;
-      memset(&a, 0, sizeof(molfile_atom_t));
-
-      strcpy(a.name, "pseudo");
-      strcpy(a.type, "pseudo");
-      if (i_resname>=0) GET_STR(row[i_resname], a.resname);
-      if (i_chain>=0) GET_STR(row[i_chain], a.chain);
-      if (i_segid>=0) GET_STR(row[i_segid], a.segid);
-      if (i_resid>=0) get_int(row[i_resid], a.resid);
-
-#if defined(DESRES_CTNUMBER)
-      a.ctnumber = m_ct;
-#endif
-      atoms.push_back(a);
-      npseudos += 1;
-
-      pos_t p(0,0,0);
-      vel_t v(0,0,0);
-      if (i_x>=0 && i_y>=0 && i_z>=0) {
-        get_float(row[i_x], p.x);
-        get_float(row[i_y], p.y);
-        get_float(row[i_z], p.z);
-      }
-      if (i_vx>=0 && i_vy>=0 && i_vz>=0) {
-        get_float(row[i_vx], v.x);
-        get_float(row[i_vy], v.y);
-        get_float(row[i_vz], v.z);
-      }
-      pos.push_back(p);
-      vel.push_back(v);
-    }
-  };
-
-  class FepioArray : public Array {
-    std::string m_name;
-    int i_ai, i_aj;
-  public:
-    FepioArray(Handle *h_, int ct, const std::string &name) 
-    : Array(h_, ct), m_name(name), i_ai(-1), i_aj(-1) {}
-
-    void set_schema( const Schema &schema ) {
-      for (unsigned i=0; i<schema.size(); i++) {
-        const std::string &attr=schema[i].attr;
-        if      (attr=="fepio_ai") i_ai=i;
-        else if (attr=="fepio_aj") i_aj=i;
-      }
-    }
-    void insert_row( const Row &row ) {
-      if (i_ai<0 || i_aj<0) return;
-      fep_elem elem;
-      get_int( row[i_ai], elem.ai );
-      get_int( row[i_aj], elem.aj );
-      h->fepmap[m_name].push_back(elem);
-    }
-  };
-
-  struct Block {
-    Handle *h;
-    const std::string m_name;
-    const int m_ct;
-    bool m_full_system;
-    std::vector<Array *> m_arrays;
-
-    Block(Handle *h_, const std::string &name_, int ct) 
-    : h(h_), m_name(name_), m_ct(ct), m_full_system(false) {
-    }
-
-    virtual ~Block() {
-      for (unsigned i=0; i<m_arrays.size(); i++) delete m_arrays[i];
-    }
-
-    void set_attrs( AttrMap &attrs) {
-      if (m_name=="f_m_ct") {
-        // check for full system
-        if (attrs["ffio_ct_type"]=="full_system") {
-          m_full_system=true;
-          return;
-        }
-        if (attrs.find("chorus_box_ax")!=attrs.end()) {
-          h->set_box(attrs);
-        }
-        if (attrs.find("fepio_stage")!=attrs.end()) {
-          int stage = atoi(attrs["fepio_stage"].c_str());
-          if      (stage==1) h->stage1 = m_ct;
-          else if (stage==2) h->stage2 = m_ct;
-        }
-      }
-    }
-
-    Block new_block(const std::string &name) {
-      Block block(h, m_name + "_" + name, m_ct);
-      block.m_full_system = m_full_system;
-      return block;
-    }
-    Array& new_array(const std::string &name) {
-
-      // create array subclass based on the name
-      Array *arr=NULL;
-      if (m_full_system) {
-        arr = new Array(h, m_ct);
-
-      } else if (name=="m_atom") {
-        arr=new AtomArray(h, m_ct);
-
-      } else if (name=="ffio_pseudo") {
-        arr=new PseudoArray(h, m_ct);
-
-      } else if (name=="ffio_virtuals") {
-        arr=new VirtualsArray(h, m_ct, "virtual");
-
-      } else if (name=="ffio_polarizable") {
-        arr=new VirtualsArray(h, m_ct, "polar");
-
-      } else if (name=="ffio_sites") {
-        arr=new SitesArray(h, m_ct);
-
-      } else if (m_name=="f_m_ct_fepio_fep" && name=="fepio_atommaps") {
-        arr=new FepioArray(h, m_ct, name);
-
-      } else if (name=="m_bond") {
-        arr=new BondArray(h, m_ct);
-
-      } else {
-        arr = new Array(h, m_ct);
-      }
-      m_arrays.push_back(arr);
-      return *arr;
-    }
-  };
-
-  /// parser callbacks
-
-  Schema predict_schema(Tokenizer& tokenizer) {
-    Schema schemas;
-    while(tokenizer.not_a(":::")) {
-      schema_t schema;
-      std::string token = tokenizer.token();
-      if (token[0] != 'b' && token[0] != 'i' && token[0] != 'r' && token[0] != 's') {
-        std::stringstream str;
-        str << "Line " << tokenizer.line() << " predicted a schema, but " 
-            << token << " didn't start b_ i_ r_ or s_ ";
-        throw std::runtime_error(str.str());
-      }
-      schema.type = token[0];
-      schema.attr = token.substr(2);
-      //schema.doc  = tokenizer.optional_comment();
-      schemas.push_back(schema);
-      tokenizer.next();
-    }
-    return schemas;
-  }
-
-  void
-  predict_schema_and_values(Block& M, Tokenizer& tokenizer) {
-    Schema schema = predict_schema(tokenizer);
-    AttrMap attrs;
-    tokenizer.predict(":::");
-    for (unsigned i=0;i<schema.size();++i) {
-      std::string value = tokenizer.predict_value();
-      if (value == "<>" || value == "") continue; // use default element
-      // Strip quotes if present
-      if (value[0] == '"' && value[value.size()-1]) {
-        value = value.substr(1,value.size()-2);
-      }
-      attrs[schema[i].attr] = value;
-    }
-    M.set_attrs(attrs);
-  }
-
-  void
-  check_name(const Tokenizer& tokenizer,const std::string& name) {
-    if (name.size() > 0 && !(isalpha(name[0]) || name[0] == '_')) {
-      std::stringstream str;
-      str << "Line " << tokenizer.line() << " predicted a block name have " << name << std::endl;
-      throw std::runtime_error(str.str());
-    }
-  }
-
-  // forward declaration
-  void predict_block(Block& M, Tokenizer& tokenizer);
-
-  void predict_blockbody(Block& subblock, Tokenizer& tokenizer) {
-    tokenizer.predict("{");
-    predict_schema_and_values(subblock,tokenizer);
-    while(tokenizer.not_a("}")) {
-      predict_block(subblock,tokenizer);
-    }
-    tokenizer.predict("}");
-  }
-
-  void predict_arraybody(Array& subarray, Tokenizer& tokenizer) {
-  
-    // Read header
-    tokenizer.predict("[");
-    tokenizer.predict();
-    tokenizer.predict("]");
-    tokenizer.predict("{");
-  
-    // Read schema
-    Schema schema = predict_schema(tokenizer);
-    subarray.set_schema(schema);
-    size_t width = schema.size();
-    Row row(width);
-    tokenizer.predict(":::");
-  
-    // Read rows
-    while(tokenizer.not_a(":::")) {
-      // throw away row index
-      tokenizer.predict();
-      for(unsigned i=0;i<width;++i) {
-        row[i] = tokenizer.predict_value();
-      }
-      subarray.insert_row(row);
-    }
-  
-    tokenizer.predict(":::");
-  
-    tokenizer.predict("}");
-  }
-  
-
-  void predict_nameless_block(std::string name,Block& M, Tokenizer& tokenizer) {
-    // -----------------------------------------------
-    // May be an array
-    // -----------------------------------------------
-    std::string tok = tokenizer.token();
-    if (tok == "[") {
-      predict_arraybody(M.new_array(name),tokenizer);
-    } 
-  
-    // -----------------------------------------------
-    // Otherwise just a block
-    // -----------------------------------------------
-    else {
-      Block subblock = M.new_block(name);
-      predict_blockbody(subblock,tokenizer);
-    }
-  }
-
-/**************************************************************************/
-/* LOCAL  **************         check_name        ************************/
-
-
-  void predict_block(Block& M, Tokenizer& tokenizer) {
-    std::string name = tokenizer.predict();
-    check_name(tokenizer,name);
-    predict_nameless_block(name,M,tokenizer);
-  }
-
-  void fill_nameless( Block &block, Tokenizer& tokenizer) {
-    predict_blockbody(block,tokenizer);
-  }
-
-}
-
-
-namespace {
-
-  std::string quotify( const std::string &s, unsigned pad=0 ) {
-
-    std::string raw(s);
-    for (unsigned i=raw.size(); i<pad; i++) {
-      //printf("adding %d'th space to %s\n", (int)i, raw.c_str());
-      if (i%2) raw = raw + std::string(" ");
-      else     raw = std::string(" ") + raw;
-    }
-
-    // empty string --> quoted ""
-    if (raw == "") return "\"\"";
-
-    // Check for non-printable characters and "
-    for(std::string::iterator p=raw.begin(), en=raw.end();
-        p != en; ++p) {
-      if (isspace(*p) || !isprint(*p) || *p == '"' || *p == '<' || *p == '\\') {
-        std::string escaped(raw.begin(),p);
-        for(;p!=en;++p) {
-          // We only support space and tab
-          if (isspace(*p) && !(*p == ' ' || *p == '\t')) {
-            throw std::invalid_argument("unprintable whitespace in '" + raw + '\'');
-          }
-
-          if (*p == '"') {
-            escaped += "\\\"";
-          } else if (*p == '\\') {
-            escaped += "\\\\";
-          } else {
-            escaped += *p;
-          }
-
-        }
-        raw = '"' + escaped + '"';
-        break;
-      }
-    }
-    return raw;
-  }
-
-  void write_meta(std::ofstream &output) {
-    output << "{" << std::endl
-           << "  s_m_m2io_version" << std::endl
-           << "  :::" << std::endl
-           << "  2.0.0" << std::endl
-           << "}" << std::endl;
-  }
-  void write_ct_header( std::ofstream &output, 
-                        const double *A, const double *B, const double *C ) {
-    output << "f_m_ct {\n"
-           << "  s_m_title\n"
-           << "  r_chorus_box_ax\n"
-           << "  r_chorus_box_ay\n"
-           << "  r_chorus_box_az\n"
-           << "  r_chorus_box_bx\n"
-           << "  r_chorus_box_by\n"
-           << "  r_chorus_box_bz\n"
-           << "  r_chorus_box_cx\n"
-           << "  r_chorus_box_cy\n"
-           << "  r_chorus_box_cz\n"
-           << "  :::\n"
-           << "  \"\"\n";
-    int i;
-    for (i=0; i<3; i++) output << "  " << A[i] << std::endl;
-    for (i=0; i<3; i++) output << "  " << B[i] << std::endl;
-    for (i=0; i<3; i++) output << "  " << C[i] << std::endl;
-  }
-  void write_ct_atoms(  std::ofstream &output,
-                        const std::map<size_t,int>& atommap,
-                        const std::vector<molfile_atom_t> &atoms,
-                        const float *pos, const float *vel ) {
-
-    output << "  m_atom[" << atommap.size() << "] {\n";
-    output << "    # First column is atom index #\n";
-    output << "    i_m_mmod_type\n";
-    output << "    r_m_x_coord\n";
-    output << "    r_m_y_coord\n";
-    output << "    r_m_z_coord\n";
-    output << "    i_m_residue_number\n";
-    output << "    s_m_insertion_code\n";
-    output << "    s_m_mmod_res\n";
-    output << "    s_m_chain_name\n";
-    output << "    i_m_color\n";
-    output << "    r_m_charge1\n";
-    output << "    r_m_charge2\n";
-    output << "    s_m_pdb_residue_name\n";
-    output << "    s_m_pdb_atom_name\n";
-    output << "    s_m_grow_name\n";
-    output << "    i_m_atomic_number\n";
-    output << "    i_m_formal_charge\n";
-    output << "    i_m_visibility\n";
-    output << "    s_m_pdb_segment_name\n";
-    if (vel) {
-      output << "    r_ffio_x_vel\n";
-      output << "    r_ffio_y_vel\n";
-      output << "    r_ffio_z_vel\n";
-    }
-    output << "    :::\n";
-
-    for (std::map<size_t,int>::const_iterator i=atommap.begin(); 
-        i!=atommap.end(); ++i) {
-      const molfile_atom_t &a = atoms[i->first];
-
-      // get atomic number from mass if not provided explicitly.
-      int anum = a.atomicnumber;
-      if (anum < 1) anum = find_element_by_amu(a.mass).first;
-      // Don't write a zero-length chain
-      const char * chain = a.chain[0] ? a.chain : " ";
-      // Don't write a zero-length insertion
-      const char * insertion = a.insertion[0] ? a.insertion : " ";
-      // the other setting make Maestro happy
-      int color=2; // gray
-      int mmod=64; // mmod_type; 64="any atom"
-      switch  (anum) {
-        case 1:  color=21; mmod=48; break;  // H
-        case 3:  color=4;  mmod=11; break;  // Li+ ion
-        case 6:  color=2 ; mmod=14; break;  // C
-        case 7:  color=43; mmod=40; break;  // N
-        case 8:  color=70; mmod=23; break;  // O
-        case 9:  color=8;  mmod=56; break;  // F
-        case 11: color=4;  mmod=66; break;  // Na+ ion
-        case 12: color=4;  mmod=72; break;  // Mg2+ ion
-        case 14: color=14; mmod=60; break;  // Si
-        case 15: color=15; mmod=53; break;  // P
-        case 16: color=13; mmod=52; break;  // S
-        case 17: color=13; mmod=102; break;  // Cl- ion
-        case 19: color=4;  mmod=67; break;  // K+ ion
-        case 20: color=4;  mmod=70; break;  // Ca2+ ion
-        default: ;
-      }
-      static const std::string blank("\" \"");
-
-      output << "    " << i->second << ' '
-             << mmod << ' '       // mmod_type
-             << pos[0+3*i->first] << ' '
-             << pos[1+3*i->first] << ' '
-             << pos[2+3*i->first] << ' '
-             << a.resid << ' '
-             << quotify(insertion) << ' '   // m_insertion_code
-             << blank << ' '                // mmod_res
-             << quotify(chain) << ' '
-             << color << ' '                // m_color
-             << 0.0 << ' '                  // charge1
-             << 0.0 << ' '                  // charge2
-             << quotify(a.resname, 4) << ' '
-             << quotify(a.name) << ' '
-             << blank << ' '                // m_grow_name
-             << anum << ' '
-             << a.charge   << ' '           // formal charge
-             << 1 << ' '       // m_visibility
-             << quotify(a.segid) << ' '
-             ;
-      if (vel) {
-        output << vel[0+3*i->first] << ' '
-               << vel[1+3*i->first] << ' '
-               << vel[2+3*i->first] << ' ';
-      }
-      output 
-             << std::endl;    
-    }
-    output << "    :::\n";
-    output << "  }\n";
-  }
-
-  void write_ct_bonds( std::ofstream &output, 
-                       const std::vector<bond_t> &bonds ) {
-
-    // don't write 0-element m_bond (ev85392)
-    if (!bonds.size()) return;
-    output << "  m_bond[" << bonds.size() << "] {\n"
-           << "    i_m_from\n"
-           << "    i_m_to\n"
-           << "    i_m_order\n"
-           << "    :::\n";
-    for (unsigned i=0; i<bonds.size(); i++) {
-      output << "    " 
-             << i+1 << ' '
-             << bonds[i].from << ' '
-             << bonds[i].to << ' '
-             << (int)floorf(0.5+bonds[i].order) << "\n";
-    }
-    output << "    :::\n"
-           << "  }\n";
-  }
-
-  void write_ct_ffio_header( std::ofstream &output ) {
-    output << "  ffio_ff {\n"
-           << "    :::\n";
-  }
-  void write_ct_ffio_footer( std::ofstream &output ) {
-    output << "  }\n";
-  }
-
-  void write_ct_sites( std::ofstream &output, 
-                       const std::vector<site>& sites ) {
-
-    output << "    ffio_sites[" << sites.size() << "] {\n"
-           << "      s_ffio_type\n"
-           << "      r_ffio_charge\n"
-           << "      r_ffio_mass\n"
-           << "      :::\n";
-    for (size_t i=0; i<sites.size(); i++) {
-      output << "      " << i+1 << ' '
-             << (sites[i].pseudo ? "pseudo " : "atom ")
-             << sites[i].charge << ' '
-             << sites[i].mass << "\n";
-    }
-    output << "      :::\n";
-    output << "    }\n";
-  }
-
-  void write_ct_pseudos( std::ofstream &output,
-                         const std::map<size_t,int> &pseudos,
-                         const std::vector<molfile_atom_t> &particles,
-                         const float *pos, const float *vel ) {
-    if (!pseudos.size()) return;
-    output << "    ffio_pseudo[" << pseudos.size() << "] {\n"
-           << "      r_ffio_x_coord\n"
-           << "      r_ffio_y_coord\n"
-           << "      r_ffio_z_coord\n"
-           << "      s_ffio_pdb_residue_name\n"
-           << "      s_ffio_chain_name\n"
-           << "      s_ffio_pdb_segment_name\n"
-           << "      i_ffio_residue_number\n";
-    if (vel) output << "      r_ffio_x_vel\n"
-                    << "      r_ffio_y_vel\n"
-                    << "      r_ffio_z_vel\n";
-    output << "      :::\n";
-
-    for (std::map<size_t,int>::const_iterator i=pseudos.begin(); 
-        i!=pseudos.end(); ++i) {
-      const molfile_atom_t &a = particles[i->first];
-      output << "      " 
-             << i->second << ' '
-             << pos[0+3*i->first] << ' ' 
-             << pos[1+3*i->first] << ' ' 
-             << pos[2+3*i->first] << ' ' 
-             << quotify(a.name) << ' '
-             << quotify(a.chain) << ' '
-             << quotify(a.segid) << ' '
-             << a.resid;
-      if (vel) { 
-        output << ' ' 
-               << vel[0+3*i->first] << ' ' 
-               << vel[1+3*i->first] << ' ' 
-               << vel[2+3*i->first];
-      }
-      output << "\n";
-    }
-    output << "      :::\n";
-    output << "    }\n";
-  }
-
-  void write_ct_footer( std::ofstream &output ) {
-    output << "}\n";
-    output << "\n";
-  }
-}
-
-////// support for alchemical mae files
-
-namespace {
-#if 1
-  /*! Map m_bond records from stage2 into stage1
-   *  @param a2inv mapping from ct2 atom index to 
-   *  @param ct1 stage 1 ct
-   *  @param ct2 stage 2 ct
-   */
-  void fixup_m_bond(const std::map<int,int>& a2inv, 
-                    ct_data &ct1, ct_data &ct2) {
-
-    // go through every m_bond record in ct2 and add it to ct1 after
-    // mapping the atom indices.  
-    if (!ct2.bonds.size()) return; // nothing to do
-
-    // Keep track of the bonds we already have
-    typedef std::set<std::pair<int,int> > BondSet;
-    BondSet bondset;
-    unsigned i;
-    for (i=0; i<ct1.bonds.size(); i++) {
-      const bond_t &b = ct1.bonds[i];
-      bondset.insert(std::make_pair(b.from,b.to));
-    }
-
-    // add the others
-    for (i=0; i<ct2.bonds.size(); i++) {
-      const bond_t &b = ct2.bonds[i];
-      int from = b.from;
-      int to   = b.to;
-      std::map<int,int>::const_iterator from_iter = a2inv.find(from);
-      std::map<int,int>::const_iterator to_iter   = a2inv.find(to);
-      if (from_iter == a2inv.end() ||
-          to_iter == a2inv.end())  {
-        fprintf(stderr, "Missing entry in fepio_atommap for %d %d\n", from, to );
-        throw std::runtime_error("Bad fepio_atommap");
-      }
-      BondSet::value_type p(from_iter->second, to_iter->second);
-      if (bondset.find(p) != bondset.end()) continue;
-      bondset.insert(p);
-      ct1.bonds.push_back( bond_t( p.first, p.second, 1 ));
-    }
-  }
-#endif
-
-  /*! append alchemical forms of atoms and groups onto mapped original forms
-   * @param fm1 stage 1 ct
-   * @param fm2 stage 2 ct
-   * @param map fepio_fep map
-   */
-  void alchemical_combine( Handle *h ) {
-    // check if alchemical stages were assigned
-    if (h->stage1<1 || h->stage2<1) return;
-    fprintf(stderr, "alchemical system detected\n");
-    ct_data &stage1 = h->ctmap[h->stage1];
-    ct_data &stage2 = h->ctmap[h->stage2];
-
-    // Map perturbed ct atom numbers into combined ct numbers
-    std::map<int,int> a2_inv_map;
-    for (int i=1; i<=stage2.natoms; i++) a2_inv_map[i]=i;
-
-    // find the atom mapping
-    FepioMapping::const_iterator atoms = h->fepmap.find("fepio_atommaps");
-    if (atoms != h->fepmap.end()) {
-      for (FepList::const_iterator i=atoms->second.begin();
-          i!=atoms->second.end(); ++i) {
-        int const ai = i->ai;
-        int const aj = i->aj;
-        if (ai > 0 && aj > 0) {
-          a2_inv_map[aj] = ai;
-        } else if ( ai > 0 && aj < 0 ) {
-          // nothing to do
-	} else if ( ai < 0 && aj > 0 ) {
-	  a2_inv_map[aj] = ::abs(ai);
-
-          // copy atom to stage1
-          molfile_atom_t &atom = stage2.particles.at( aj-1 );
-#if defined(DESRES_CTNUMBER)
-          atom.ctnumber = h->stage1;
-#endif
-          stage1.particles.push_back(atom);
-          stage1.natoms += 1;
-
-          // copy site as well
-          stage1.sites.push_back( stage2.sites.at(aj-1));
-          stage1.sites[stage1.sites.size()-1].charge = 0.0;
-          
-          // copy position and velocity
-          stage1.position.push_back( stage2.position.at(aj-1) );
-          stage1.velocity.push_back( stage2.velocity.at(aj-1) );
-
-	} else {
-          fprintf(stderr, "ai(%d) and aj(%d) < 0 in atommap\n", ai, aj);
-        }
-      }
-    }
-    fixup_m_bond(a2_inv_map, stage1, stage2);
-    h->ctmap.erase(h->stage2);
-  }
-}
-
-namespace {
-
-  void *open_file_read( const char *fname, const char *ftype, int *vmdatoms) {
-
-    std::ifstream in(fname, std::ifstream::in | std::ifstream::binary );
-    if (!in) return NULL;
-
-    Handle *h = new Handle;
-    *vmdatoms = 0;
-
-    try {
-      // parse the mae file contents
-      Tokenizer tokenizer(in);
-
-      Block meta(h, "meta", 0);
-      fill_nameless( meta, tokenizer);
-      int ct=1;
-      while (tokenizer.not_a()) {
-        std::string name = tokenizer.predict();
-        Block block(h, name, ct++);
-        fill_nameless( block, tokenizer );
-      }
-      alchemical_combine(h);
-    }
-    catch (std::exception &e) {
-      fprintf(stderr, "Reading mae file failed: %s\n", e.what());
-      delete h;
-      return NULL;
-    }
-
-    // post-processing once all arrays have been read
-    for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      int natoms = i->second.natoms;
-      int npseudos = i->second.npseudos;
-      int nparticles = natoms + npseudos;
-      int nsites = i->second.sites.size();
-
-      *vmdatoms += nparticles;
-
-      if (nsites>0) {
-        // check particle/site consistency
-        if (nsites > nparticles ) {
-          fprintf(stderr, "ERROR: Too many ffio_sites records in ct %d\n", 
-              i->first);
-          delete h;
-          return NULL;
-        }
-        int nblks = nparticles / nsites;
-        int Np = npseudos / nblks;
-        int Na = natoms / nblks;
-        if (Np + Na != nsites) {
-          fprintf(stderr, "ERROR: Number of particles in ct %d not a multiple of the number of ffio_sites\n", i->first);
-          delete h;
-          return NULL;
-        }
-      }
-
-    }
-    h->nparticles = *vmdatoms;
-    return h;
-  }
-
-  int read_structure(void* v, int* optflags, molfile_atom_t *atoms) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-
-    // apply sites information
-    for (CtMap::iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      ct_data &ct = i->second;
-      int natoms = ct.natoms;
-      int npseudos = ct.npseudos;
-      int nsites = ct.sites.size();
-      int nparticles = natoms + npseudos;
-
-      if (nsites) {
-
-        int nblks = nparticles / nsites;
-        int Np = npseudos / nblks;
-        int Na = natoms / nblks;
-        int atom_number = 0;
-        int pseudo_number = natoms;
-
-        // mapping from index in site block to relative order in site block
-        std::map<int,int> pseudo_index;
-
-        for (int j=0; j<nsites; ++j) {
-          float mass = ct.sites[j].mass;
-          float charge = ct.sites[j].charge;
-
-          if (!ct.sites[j].pseudo) {
-            // regular atom
-            for(int k=0; k<nblks; ++k) {
-              int ia = atom_number + k*Na;
-              ct.particles[ia].mass = mass;
-              ct.particles[ia].charge = charge;
-            }
-            ++atom_number;
-
-          } else {
-            // pseudo
-            int n = pseudo_index.size();
-            pseudo_index[j+1] = n;
-            for(int k=0; k<nblks; ++k) {
-              int ip = pseudo_number + k*Np;
-              ct.particles[ip].mass = mass;
-              ct.particles[ip].charge = charge;
-            }
-            ++pseudo_number;
-          }
-        }
-
-        // check ffio_virtuals for pseudobonds
-        for (VirtualsMap::const_iterator v=ct.virtuals.begin();
-            v!=ct.virtuals.end(); ++v) {
-          int index = v->first;
-          int ai = v->second.ai;
-          if (ai && index) {
-            atom_number = ai - 1;
-            pseudo_number = natoms + pseudo_index[index];
-
-            for (int k=0; k<nblks; k++) {
-              int from = atom_number + k*Na;
-              int to = pseudo_number + k*Np;
-
-              // copy residue information from parent to the pseudo
-              strcpy( ct.particles[to].resname, ct.particles[from].resname );
-              strcpy( ct.particles[to].chain,   ct.particles[from].chain);
-              strcpy( ct.particles[to].segid,   ct.particles[from].segid);
-              ct.particles[to].resid = ct.particles[from].resid;
-              strncpy( ct.particles[to].type, v->second.funct.c_str(), 
-                       sizeof(ct.particles[to].type ) );
-
-              // add a pseudobond between the pseudo and the parent atom
-              ct.bonds.push_back(bond_t( from+1, to+1, 1 ));
-            }
-          }
-        }
-      }
-      memcpy( atoms, &ct.particles[0], nparticles*sizeof(molfile_atom_t) );
-      atoms += nparticles;
-    }
-
-    *optflags = h->optflags;
-#if defined(DESRES_CTNUMBER)
-    *optflags |= MOLFILE_CTNUMBER;
-#endif
-    return MOLFILE_SUCCESS;
-  }
-
-#if vmdplugin_ABIVERSION > 14
-  int read_bonds(void *v, int *nbonds, int **from, int **to, float** order,
-                 int **bondtype, int *nbondtypes, char ***bondtypename) {
-#else
-  int read_bonds(void *v, int *nbonds, int **from, int **to, float** order) {
-#endif
-    Handle *h = reinterpret_cast<Handle *>(v);
-
-    // map bonds from ct arrays to from/to/order arrays
-    int offset=0;
-    for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      const ct_data &ct = i->second;
-      for (std::vector<bond_t>::const_iterator b=i->second.bonds.begin(),
-           e=i->second.bonds.end(); b!=e; ++b) {
-        h->bond_from.push_back( b->from + offset );
-        h->bond_to.push_back( b->to + offset );
-        h->bond_order.push_back( b->order );
-      }
-      offset += ct.particles.size();
-    }
-    *nbonds = h->bond_from.size();
-    *from = &h->bond_from[0];
-    *to = &h->bond_to[0];
-    *order = &h->bond_order[0];
-#if vmdplugin_ABIVERSION > 14
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-#endif
-    return MOLFILE_SUCCESS;
-  }
-
-  int read_timestep_metadata(void *v, molfile_timestep_metadata *m) {
-    m->has_velocities = true;
-    m->count = 1;
-    return MOLFILE_SUCCESS;
-  }
-
-  int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    if (h->eof) return MOLFILE_EOF;
-
-    float *pos = ts->coords;
-    float *vel = ts->velocities;
-    for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-      const ct_data &ct = i->second;
-      unsigned nparticles = ct.position.size();
-      memcpy( pos, &ct.position[0], 3*nparticles*sizeof(float) );
-      pos += 3*nparticles;
-      if (vel) {
-        memcpy( vel, &ct.velocity[0], 3*nparticles*sizeof(float) );
-        vel += 3*nparticles;
-      }
-    }
-
-    h->get_box(ts);
-    h->eof = true;
-    return MOLFILE_SUCCESS;
-  }
-
-#if defined(DESRES_READ_TIMESTEP2)
-  int read_timestep2(void *v, ssize_t n, molfile_timestep_t *ts) {
-      Handle *h = reinterpret_cast<Handle *>(v);
-      if (n!=0) return MOLFILE_EOF;
-      bool save_eof = h->eof;
-      h->eof = false;
-      int rc = read_next_timestep(v, h->nparticles, ts);
-      h->eof = save_eof;
-      return rc;
-  }
-#endif
-
-  void close_file_read( void *v) {
-    delete reinterpret_cast<Handle *>(v);
-  }
-
-  void *open_file_write(const char *path, const char *type, int natoms) {
-    Handle *h = new Handle;
-    h->output.open(path);
-    if (!h->output) {
-      fprintf(stderr, "Could not open '%s' for writing.\n", path);
-      delete h;
-      return NULL;
-    }
-    h->nparticles = natoms;
-    h->particles.resize(natoms);
-    return h;
-  }
-
-  int write_structure(void *v, int optflags, const molfile_atom_t *atoms) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    h->optflags = optflags;
-    memcpy(&h->particles[0], atoms, h->particles.size()*sizeof(molfile_atom_t));
-
-    // assign ct for each particle, and count ct atoms and pseudos
-    std::vector<int> atom_ct(h->nparticles);
-    int last_ctnumber = -1;
-    int ct = 1;
-    for (int i=0; i<h->nparticles; i++) {
-      const molfile_atom_t &a = atoms[i];
-#if defined(DESRES_CTNUMBER)
-      if (i==0) last_ctnumber = a.ctnumber;
-      else if (a.ctnumber != last_ctnumber) {
-        last_ctnumber = a.ctnumber;
-        ++ct;
-      }
-#endif
-      atom_ct[i] = ct;
-      ct_data &data = h->ctmap[ct];
-      site s;
-      s.charge = a.charge;
-      s.mass = a.mass;
-
-      if ((optflags & MOLFILE_ATOMICNUMBER) && a.atomicnumber<1) {
-        data.pseudomap[i] = ++data.npseudos;
-        s.pseudo = true;
-      } else {
-        data.atommap[i] = ++data.natoms;
-        s.pseudo = false;
-      }
-      data.sites.push_back(s);
-    }
-
-    // add bonds to their proper ct
-    int badbonds=0, skipped=0;
-    for (unsigned b=0; b<h->bond_from.size(); b++) {
-      int from = h->bond_from[b]-1;
-      int to   = h->bond_to[b]-1;
-      float order = h->bond_order[b];
-      if (from > to) continue;
-      int ct = atom_ct[from];
-      if (ct != atom_ct[to]) {
-        ++badbonds;
-        continue;
-      }
-      // map 0-based bond index to 1-based ct index
-      ct_data &data = h->ctmap[ct];
-      // add the bond only if it's between atoms, not pseudos
-      std::map<size_t,int>::const_iterator ifrom=data.atommap.find(from);
-      std::map<size_t,int>::const_iterator ito=data.atommap.find(to);
-      if (ifrom != data.atommap.end() && ito != data.atommap.end())
-        data.bonds.push_back(bond_t(ifrom->second, ito->second, order));
-      else 
-        ++skipped;
-    }
-    if (badbonds) {
-      fprintf(stderr, "Could not store all bonds in mae file\n");
-      fprintf(stderr, "Check that no bonded atoms have different ctnumber\n");
-      return MOLFILE_ERROR;
-    }
-    if (skipped) {
-      fprintf(stderr, "Info) Skipped %d pseudobonds.\n", skipped);
-    }
-
-    return MOLFILE_SUCCESS;
-  }
-
-#if vmdplugin_ABIVERSION > 14
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order,
-                  int *bondtype, int nbondtypes, char **bondtypename) {
-#else
-  int write_bonds(void *v, int nbonds, int *from, int *to, float *order) {
-#endif
-    Handle *h = reinterpret_cast<Handle *>(v);
-    h->bond_from.resize(nbonds);
-    h->bond_to.resize(nbonds);
-    h->bond_order.resize(nbonds);
-    memcpy( &h->bond_from[0], from, nbonds*sizeof(int) );
-    memcpy( &h->bond_to[0],   to,   nbonds*sizeof(int) );
-    for (int i=0; i<nbonds; i++) h->bond_order[i] = order ? order[i] : 1;
-
-    return MOLFILE_SUCCESS;
-  }
-
-  int write_timestep(void *v, const molfile_timestep_t *ts) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    if (h->eof) {
-      fprintf(stderr, "Cannot write multiple frames to mae file\n");
-      return MOLFILE_EOF;
-    }
-    try {
-      h->set_box(ts);
-
-      write_meta(h->output);
-      for (CtMap::const_iterator i=h->ctmap.begin(); i!=h->ctmap.end(); ++i) {
-        const ct_data &data = i->second;
-        write_ct_header( h->output, h->A, h->B, h->C );
-        write_ct_atoms(  h->output, data.atommap, h->particles, ts->coords, ts->velocities );
-        write_ct_bonds(  h->output, data.bonds );
-
-        write_ct_ffio_header( h->output );
-          write_ct_sites( h->output, data.sites );
-          write_ct_pseudos( h->output, data.pseudomap, h->particles, ts->coords, ts->velocities );
-        write_ct_ffio_footer( h->output );
-
-        write_ct_footer( h->output );
-      }
-    }
-    catch (std::exception &e) {
-      fprintf(stderr, "%s", e.what());
-      return MOLFILE_ERROR;
-    }
-    return MOLFILE_SUCCESS;
-  }
-
-  void close_file_write( void *v ) {
-    Handle *h = reinterpret_cast<Handle *>(v);
-    h->output.close();
-    delete h;
-  }
-}
-
-///////////////////////////////////////////////////////////////////
-//
-// Plugin Interface
-//
-// ////////////////////////////////////////////////////////////////
-
-static molfile_plugin_t maeff;
-
-VMDPLUGIN_API int VMDPLUGIN_init (void) {
-  /* Plugin for maeff trajectory files */
-  ::memset(&maeff,0,sizeof(maeff));
-  maeff.abiversion = vmdplugin_ABIVERSION;
-  maeff.type = MOLFILE_PLUGIN_TYPE;
-  maeff.name = "mae";
-  maeff.prettyname = "Maestro File";
-  maeff.author = "D. E. Shaw Research";
-  maeff.majorv = 3;
-  maeff.minorv = 8;
-  maeff.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-
-  maeff.filename_extension = "mae,maeff,cms";
-  maeff.open_file_read = open_file_read;
-  maeff.read_structure = read_structure;
-  maeff.read_bonds = read_bonds;
-  maeff.read_timestep_metadata = read_timestep_metadata;
-  maeff.read_next_timestep = read_next_timestep;
-#if defined(DESRES_READ_TIMESTEP2)
-  maeff.read_timestep2 = read_timestep2;
-#endif
-  maeff.close_file_read = close_file_read;
-
-  maeff.open_file_write = open_file_write;
-  maeff.write_structure = write_structure;
-  maeff.write_bonds = write_bonds;
-  maeff.write_timestep = write_timestep;
-  maeff.close_file_write = close_file_write;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  cb(v,reinterpret_cast<vmdplugin_t*>(&maeff));
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-#if defined(TEST_MAEFFPLUGIN)
-
-int main(int argc, char *argv[]) {
-  if (argc != 3) {
-    fprintf(stderr, "Usage: %s input.mae output.mae\n", argv[0]);
-    return 1;
-  }
-  int natoms=0;
-  void *v = open_file_read( argv[1], "mae", &natoms);
-  if (!v) return 1;
-  // read an existing mae file
-  printf("%d atoms\n", natoms);
-  std::vector<molfile_atom_t> atoms(natoms);
-  memset(&atoms[0], 0, natoms*sizeof(molfile_atom_t));
-  int optflags=0;
-  if (read_structure(v, &optflags, &atoms[0])!=MOLFILE_SUCCESS) return 1;
-  int nbonds;
-
-  // read bonds
-  int *from, *to;
-  float *order;
-  if (read_bonds(v, &nbonds, &from, &to, &order) !=MOLFILE_SUCCESS) return 1;
-  std::vector<int> bond_from(nbonds), bond_to(nbonds);
-  std::vector<float> bond_order(nbonds);
-  memcpy(&bond_from[0], from, nbonds*sizeof(int));
-  memcpy(&bond_to[0], to, nbonds*sizeof(int));
-  memcpy(&bond_order[0], order, nbonds*sizeof(float));
-
-  // read coordinates
-  molfile_timestep_t ts[1];
-  ts->coords = new float[3*natoms];
-  ts->velocities = new float[3*natoms];
-  if (read_next_timestep(v, natoms, ts) != MOLFILE_SUCCESS) return 1;
-
-  // close
-  close_file_read(v);
-
-  // write file
-  v = open_file_write( argv[2], "mae", natoms );
-  if (!v) return 1;
-  if (write_bonds(v, nbonds, &bond_from[0], &bond_to[0], &bond_order[0]) 
-      != MOLFILE_SUCCESS) return 1;
-  if (write_structure( v, optflags, &atoms[0] ) != MOLFILE_SUCCESS) return 1;
-  if (write_timestep( v, ts ) != MOLFILE_SUCCESS ) return 1;
-  close_file_write(v);
-
-  delete [] ts->coords;
-  delete [] ts->velocities;
-
-  // make sure we can still parse the file we wrote
-  int new_natoms;
-  v = open_file_read( argv[2], "mae", &new_natoms );
-  if (!v) return 1;
-  if (new_natoms != natoms) {
-    fprintf(stderr, "number of atoms changed: %d -> %d\n", natoms, new_natoms);
-    return 1;
-  }
-  close_file_read(v);
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/main.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/main.c
deleted file mode 100644
index a2f02897a83f83818e567f5ad1577e4c74211550..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/main.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: main.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * A general main for testing plugins.  
- * Compile using: gcc main.c plugin.c -I../../include -o plugintest
- * Replace plugin.c with the plugin file you want to test.
- * Usage: plugintest <filetype> <file> [<filetype> <file>]
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-
-/* Structure and coordintes plugin */
-static molfile_plugin_t *splugin = 0;
-static molfile_plugin_t *cplugin = 0;
-static const char *sfiletype = NULL;
-static const char *cfiletype = NULL;
-
-static int register_cb(void *v, vmdplugin_t *p) {
-  if (!strcmp(p->type, MOLFILE_PLUGIN_TYPE)) {
-    if (!strcmp(p->name, sfiletype))
-      splugin = (molfile_plugin_t *)p;
-    if (!strcmp(p->name, cfiletype))
-      cplugin = (molfile_plugin_t *)p;
-  }
-  return VMDPLUGIN_SUCCESS;
-}
-
-int main(int argc, char *argv[]) {
-  const char *sfilename;
-  const char *cfilename;
-  int rc, natoms;
-  void *handle;
-  void *chandle;
-  molfile_timestep_t timestep;
-
-  if (argc != 3 && argc != 5) {
-    fprintf(stderr, "Usage: %s <filetype> <filename> [<filetype> <filename>]\n", argv[0]);
-    return 1;
-  }
-
-  if (argc == 3) {
-    sfiletype = argv[1];
-    sfilename = argv[2];
-    cfiletype = sfiletype;
-    cfilename = sfilename;
-  } else {
-    sfiletype = argv[1];
-    sfilename = argv[2];
-    cfiletype = argv[3];
-    cfilename = argv[4];
-  }
-  
-  vmdplugin_init();
-  vmdplugin_register(NULL, register_cb);
-
-  if (!splugin) {
-    fprintf(stderr, "No plugin for filetype %s was linked in!\n", sfiletype);
-    return 1;
-  }
-  if (!cplugin) {
-    fprintf(stderr, "No plugin for filetype %s was linked in!\n", cfiletype);
-    return 1;
-  }
-
-  /* Read structure */
-  if (!splugin->open_file_read) {
-    fprintf(stdout, "FAILED: No open_file_read found in structure plugin.\n");
-    return 1;
-  } 
-  handle = splugin->open_file_read(sfilename, sfiletype, &natoms);
-  if (!handle) {
-    fprintf(stderr, "FAILED: open_file_read returned NULL in structure plugin.\n");
-    return 1;
-  }
-  printf("Opened file %s; structure plugin found %d atoms\n", sfilename, natoms);
-  if (splugin->read_structure) {
-    int optflags;
-    molfile_atom_t *atoms;
-    atoms = (molfile_atom_t *)malloc(natoms * sizeof(molfile_atom_t));
-    rc = splugin->read_structure(handle, &optflags, atoms);
-    free(atoms);
-    if (rc) {
-      fprintf(stderr, "FAILED: read_structure returned %d\n", rc);
-      splugin->close_file_read(handle);
-      return 1;
-    } else {
-      printf("Successfully read atom structure information.\n");
-    }
-    if (splugin->read_bonds) {
-      int nbonds, *from, *to, *bondtype, nbondtypes;
-      float *bondorder;
-      char **bondtypename;
-      if ((rc = splugin->read_bonds(handle, &nbonds, &from, &to, 
-				   &bondorder, &bondtype, &nbondtypes, &bondtypename))) {
-        fprintf(stderr, "FAILED: read_bonds returned %d\n", rc);
-      } else {
-        printf("read_bonds read %d bonds\n", nbonds);
-      }
-    } else {
-      printf("Structure file contains no bond information\n");
-    }
-  } else {
-    fprintf(stderr, "FAILED: File contains no structure information!\n");
-    return 1;
-  }
-
-  /* Check whether we use one plugin for both structure and coords */
-  if (splugin != cplugin) {
-    splugin->close_file_read(handle);
-    int cnatoms;
-    chandle = cplugin->open_file_read(cfilename, cfiletype, &cnatoms);
-    printf("Opened coordinates file %s\n", cfilename);
-    if (cnatoms != MOLFILE_NUMATOMS_UNKNOWN && cnatoms != natoms) {
-      fprintf(stderr, "FAILED: Different number of atoms in structure file (%d) than in coordinates file (%d)!",
-	      natoms, cnatoms);
-      cplugin->close_file_read(chandle);
-      exit(1);
-    }
-  } else {
-    chandle = handle;
-  }
-
-  /* Read coordinates */
-  if (cplugin->read_next_timestep) {
-    timestep.velocities = NULL;
-    int nsteps = 0;
-    timestep.coords = (float *)malloc(3*natoms*sizeof(float));
-    while (!(rc = cplugin->read_next_timestep(chandle, natoms, &timestep)))
-      nsteps++;
-    free(timestep.coords);
-    if (rc != MOLFILE_SUCCESS) {
-      fprintf(stderr, "FAILED: read_next_timestep returned %d\n", rc);
-    } else {
-      printf("Successfully read %d timesteps\n", nsteps);
-    }
-  }
-
-  /* Close plugin(s) */
-  cplugin->close_file_read(chandle); 
-
-  vmdplugin_fini();
-  printf("Tests finished.\n");
-  return 0;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mapplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mapplugin.C
deleted file mode 100644
index d2a0b65169f1d50adf586d232446bcd283e8d119..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mapplugin.C
+++ /dev/null
@@ -1,225 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mapplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.15 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Autodock Grid Map File format plugin
- *
- * More info for this format can be found at
- * <http://www.scripps.edu/pub/olson-web/gmm/autodock/ad305/
- *  Using_AutoDock_305.21.html#pgfId=75765>
- * 
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} gridmap_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *mapgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    fprintf(stderr, "mapplugin) Unexpected end-of-file.\n");
-    returnVal = NULL;
-  }
-  else if (ferror(stream)) {
-    fprintf(stderr, "mapplugin) Error reading file.\n");
-    return NULL;
-  }
-  else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      fprintf(stderr, "mapplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static void *open_map_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  gridmap_t *map;
-  char inbuf[LINESIZE];
-
-  float spacing, midX, midY, midZ;
-  int xsize, ysize, zsize;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "mapplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Skip the header */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-
-  /* Space between grid points */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (sscanf(inbuf, "SPACING %f", &spacing) != 1)
-    return NULL;
-
-  /* Grid size in grid units */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (sscanf(inbuf, "NELEMENTS %d %d %d", &xsize, &ysize, &zsize) != 3) {
-    fprintf(stderr, "mapplugin) Cannot read NELEMENTS.\n");
-    return NULL;
-  }
-
-  /* XXX - I don't know why this is necessary */
-  xsize++;
-  ysize++;
-  zsize++;
-
-  /* Center of the cell */
-  if (mapgets(inbuf, LINESIZE, fd) == NULL) 
-    return NULL;
-  if (sscanf(inbuf, "CENTER %f %f %f", &midX, &midY, &midZ) != 3)
-    return NULL;
-
-  /* Allocate and initialize the map structure */
-  map = new gridmap_t;
-  map->fd = fd;
-  map->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  map->nsets = 1; /* this file contains only one data set */
-
-  map->vol = new molfile_volumetric_t[1];
-  strcpy(map->vol[0].dataname, "Grid Map File");
-
-  /* <midX, midY, midZ> is the middle point of the grid. */
-  map->vol[0].origin[0] = -0.5*(xsize+1.0)* spacing  + midX;
-  map->vol[0].origin[1] = -0.5*(ysize+1.0)* spacing  + midY;
-  map->vol[0].origin[2] = -0.5*(zsize+1.0)* spacing  + midZ;
-
-  map->vol[0].xaxis[0] = xsize * spacing;
-  map->vol[0].xaxis[1] = 0;
-  map->vol[0].xaxis[2] = 0;
-
-  map->vol[0].yaxis[0] = 0;
-  map->vol[0].yaxis[1] = ysize * spacing;
-  map->vol[0].yaxis[2] = 0;
-  
-  map->vol[0].zaxis[0] = 0;
-  map->vol[0].zaxis[1] = 0;
-  map->vol[0].zaxis[2] = zsize * spacing;
-
-  map->vol[0].xsize = xsize;
-  map->vol[0].ysize = ysize;
-  map->vol[0].zsize = zsize;
-
-  map->vol[0].has_color = 0;
-
-  return map;
-}
-
-static int read_map_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  gridmap_t *map = (gridmap_t *)v;
-  *nsets = map->nsets; 
-  *metadata = map->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_map_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  gridmap_t *map = (gridmap_t *)v;
-  FILE *fd = map->fd;
-  float *cellIndex;
-  char inbuf[LINESIZE];
-  int count, ndata;
-
-  cellIndex = datablock;
-  count = 0;
-  ndata = map->vol[0].xsize * map->vol[0].ysize * map->vol[0].zsize;
-
-  /* Read the densities. Order for file is x fast, y medium, z slow */
-  while (count < ndata) {
-    if (mapgets(inbuf, LINESIZE, fd) == NULL) {
-      return MOLFILE_ERROR;
-    }
-
-    *cellIndex = atof(inbuf);
-
-    cellIndex++;
-    count++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_map_read(void *v) {
-  gridmap_t *map = (gridmap_t *)v;
-
-  fclose(map->fd);
-  if (map->vol != NULL)
-    delete [] map->vol; 
-  delete map;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "map";
-  plugin.prettyname = "Autodock Grid Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "map";
-  plugin.open_file_read = open_map_read;
-  plugin.read_volumetric_metadata = read_map_metadata;
-  plugin.read_volumetric_data = read_map_data;
-  plugin.close_file_read = close_map_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mdfplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mdfplugin.C
deleted file mode 100644
index 9f01648994b20dd66b32168952ff667f8e96f40b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mdfplugin.C
+++ /dev/null
@@ -1,417 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mdfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.21 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * Molecular data file (.mdf) reader
- * Insight II, Discover, etc. structure and bond information. This plugin
- * reads only the topology section, ignoring the optional symmetry and
- * atomset sections.
- *
- * Format specification can be found at:
- * http://instinct.v24.uthscsa.edu/~hincklab/html/soft_packs/msi_docs/insight980/formats980/File_Formats_1998.html#484257
- *
- * TODO: The current code reads the file *four* times -- once on open, once
- * to read the structure, and twice to read the bonds. Perhaps these could
- * be consolidated, e.g. by counting the bonds and populating the hash
- * tables during open or read_structure.
- *
- */
-
-#include "molfile_plugin.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define VMDPLUGIN_STATIC
-#include "hash.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-#define NAMESIZE 32
-
-typedef struct {
-  FILE *file;
-  int natoms, nmols, *from, *to;
-  long mol_data_location;
-} mdfdata;
-
-// Read a line of atom data and store the values in the atom structure
-// Return 1 on success, 0 on error
-static int read_mdf_structure_line(molfile_atom_t *atom, const char *line) {
-  // Read pertinent structure information from the line
-  if ( sscanf(line, "%[^:]:%s %s %*s %*s %*d %*s %f %*d %*d %*d %f",
-              atom->resname, atom->name, atom->type, 
-              &atom->charge, &atom->occupancy) != 5 ) {
-    return 0;
-  }
-
-  // Get the resid from the resname
-  if ( sscanf(atom->resname, "%*[^_]_%d", &atom->resid) != 1 ) {
-    return 0;
-  }
-
-  // Provide defaults for missing values
-  atom->chain[0] = '\0';
-  atom->segid[0] = '\0';
-
-  return 1;
-}
-
-// Read the atom info from src and copy the connectivity record to dest.
-// Convert each record to resname_resnumber:atom form
-// Return 1 on success, 0 on error
-static int get_mdf_bonds(char *dest, const char *src) {
-  char resinfo[NAMESIZE], bond_records[LINESIZE], *curr, *next, *tmp;
-  int retval;
-
-  // Get the connectivity records
-  retval = sscanf(src, "%[^:]:%*s %*s %*s %*s %*d %*s %*f %*d %*d %*d %*f %*f %255c", resinfo, bond_records);
-  if (retval < 1) {
-    // parse error.
-    return -1;
-    // no bonds for this atom
-  } else if (retval == 1) return 0;
-  
-  // Append the bonds to the destination string, converting then to the
-  // correct format along the way.
-  dest[0] = '\0';
-  for ( curr = bond_records; (next = strchr(curr, ' ')) != NULL;
-        curr = next + 1 ) {
-    *next = '\0';
-
-    // Prepend the resname and resid to the destination atom name if it's
-    // not already present.
-    if ( strchr(curr, ':') == NULL ) {
-      strcat(dest, resinfo);
-      strcat(dest, ":");
-    }
-
-    // Remove cell/sympop/bondorder information from the bond
-    if ( ((tmp = strchr(curr, '%')) != NULL) ||
-         ((tmp = strchr(curr, '#')) != NULL) ||
-         ((tmp = strchr(curr, '/')) != NULL) ||
-         ((tmp = strchr(curr, '\n')) != NULL) ) {
-      *tmp = '\0';
-    }
-    strcat(dest, curr);
-    strcat(dest, " ");
-  }
-
-  return 1;
-}
-
-// Return the number of bond records on a line
-static int count_mdf_bonds(const char *line) {
-  char bond_records[LINESIZE];
-  int bonds = 0;
-  char *tmp;
-  
-  // no bonds or parse error
-  if ( get_mdf_bonds(bond_records, line) < 1) {
-    return 0;
-  }
-  
-  for ( tmp = bond_records; (tmp = strchr(tmp, ' ')) != NULL;
-        tmp++ ) {
-    bonds++;
-  }
-
-  return bonds;
-}
-
-// Open the file and create the mdf struct used to pass data to the other
-// functions.
-static void *open_mdf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  mdfdata *mdf;
-  long mol_data_location;
-  char line[LINESIZE]; 
-  int nmols = 0;
-
-  fd = fopen(path, "r");
-  if (!fd)
-    return NULL;
-  
-  // Find the first molecule record
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      vmdcon_printf(VMDCON_ERROR, "mdfplugin) No molecule record found in file.\n");
-      return NULL;
-    }
-  } while ( strncmp(line, "@molecule", 9) );
-
-  // Remember the location of the beginning of the molecule data
-  mol_data_location = ftell(fd);
-
-  // Count the atoms in each molecule
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, fd);
-
-    // Count atoms until a new molecule or the end of the section is reached
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') )
-        *natoms = *natoms + 1;
-      fgets(line, LINESIZE, fd);
-      if ( ferror(fd) || feof(fd) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) Error while counting atoms.\n");
-        return NULL;
-      }
-    }
-    nmols++;
-  }
-
-  // Allocate and initialize the mdf structure
-  vmdcon_printf(VMDCON_INFO, "mdfplugin) %d molecule records found in file.\n", nmols);
-  mdf = new mdfdata;
-  mdf->file = fd;
-  mdf->natoms = *natoms;
-  mdf->nmols = nmols;
-  mdf->from = NULL;
-  mdf->to = NULL;
-  mdf->mol_data_location = mol_data_location; 
-
-  return mdf;
-}
-
-// Read the atom information for each molecule, but not bonds.
-// XXX - this ignores the column records, which may cause the atom records
-// to be read incorrectly.
-static int read_mdf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  mdfdata *mdf = (mdfdata *)v;
-  char line[LINESIZE];
-  int mol_num;
-  molfile_atom_t *atom = atoms;
-
-  *optflags = MOLFILE_OCCUPANCY | MOLFILE_CHARGE;
-
-  // Seek to the first molecule record
-  fseek(mdf->file, mdf->mol_data_location, SEEK_SET);
-  line[0] = '\0';
-
-  // Read the atom structure for each molecule
-  mol_num = 0;
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, mdf->file);
-
-    // Read atom structure for the current molecule
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') ) {
-        if ( !read_mdf_structure_line(atom, line) ) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Improperly formatted atom record encountered while reading structure.\n");
-          return MOLFILE_ERROR;
-        }
-
-        // use the chain name to flag different molecules by using
-        // characters A-Z. NOTE: chain can only hold 1 char.
-        sprintf(atom->chain, "%c", ('A'+(mol_num % 26)));
-
-        atom++;
-      }
-
-      fgets(line, LINESIZE, mdf->file);
-      if ( ferror(mdf->file) || feof(mdf->file) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) File error while reading structure.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-    mol_num++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-// Create arrays of one-based bond indicies.
-static int read_mdf_bonds(void *v, int *nbonds, int **from_data, int **to_data, 
-                          float **bondorderptr, int **bondtype, 
-                          int *nbondtypes, char ***bondtypename) {
-  mdfdata *mdf = (mdfdata *)v;
-  int mol, atom, bond_count, *fromptr, *toptr, tmp_to;
-  char *curr, *next, line[LINESIZE], bond_records[LINESIZE];
-  char (*atomnames)[NAMESIZE]; // Dynamic array of cstrings
-  hash_t *hasharray;           // Array of hash tables
-
-  // Allocate and initialize the hash table for each molecule.
-  hasharray = new hash_t[mdf->nmols];
-  for (mol = 0; mol < mdf->nmols; mol++) {
-    hash_init(&hasharray[mol], 256);
-  }
-  atomnames = new char[mdf->natoms][NAMESIZE];
-
-  // Populate the hash table; key: atom name; value: one-based atom index.
-  // Count the bonds, each bond is counted twice.
-  fseek(mdf->file, mdf->mol_data_location, SEEK_SET);
-  line[0] = '\0';
-  atom = 1;
-  mol = 0;
-  bond_count = 0;
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, mdf->file);
-
-    // Read the atom names
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') ) {
-        if ( sscanf(line, "%s %*s", atomnames[atom-1]) != 1 ) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Improperly formatted atom record encountered while reading bonds.\n");
-          return MOLFILE_ERROR;
-        }
-        if ( hash_insert(&hasharray[mol], atomnames[atom-1], atom) != HASH_FAIL ) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Could not add atom to hash table.\n");
-          return MOLFILE_ERROR;
-        }
-
-        bond_count += count_mdf_bonds(line);
-        atom++;
-      }
-
-      fgets(line, LINESIZE, mdf->file);
-      if ( ferror(mdf->file) || feof(mdf->file) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) File error while reading bonds.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    mol++;
-  }
-
-  bond_count /= 2;
-  mdf->from = new int[bond_count];
-  mdf->to = new int[bond_count];
-  fromptr = mdf->from;
-  toptr = mdf->to;
-
-  // Read the molecules, storing the bond-indicies in fromptr and toprt
-  fseek(mdf->file, mdf->mol_data_location, SEEK_SET);
-  line[0] = '\0';
-  atom = 1;
-  mol = 0;
-  while ( line[0] != '#' ) {
-    fgets(line, LINESIZE, mdf->file);
-
-    // Read the bonds
-    while ( (line[0] != '@') && (line[0] != '#') ) {
-      int retval;
-
-      // Ignore blank and comment lines
-      if ( !isspace(line[0]) && (line[0] != '!') ) {
-        retval = get_mdf_bonds(bond_records, line);
-        if (retval < 0) {
-          vmdcon_printf(VMDCON_ERROR, "mdfplugin) Error reading bonds from atom data.\n");
-          return MOLFILE_ERROR;
-        }
-
-        if (retval > 0) {
-          // Read each bond in the line
-          for ( curr = bond_records; (next = strchr(curr, ' ')) != NULL; 
-                curr = next+1 ) {
-            *next = '\0';
-            tmp_to = hash_lookup(&hasharray[mol], curr);
-            if (tmp_to == HASH_FAIL) {
-              vmdcon_printf(VMDCON_ERROR, "mdfplugin) Could not find atom '%s' in hash table.\n", curr);
-              return MOLFILE_ERROR;
-            }
-            else if (tmp_to > atom) {
-              // Only count bonds to atoms greater than the current one, since
-              // each bond is listed twice
-              *fromptr = atom;
-              *toptr = tmp_to;
-              fromptr++;
-              toptr++;
-            }
-          }
-        }
-
-        atom++;
-      }
-
-      fgets(line, LINESIZE, mdf->file);
-      if ( ferror(mdf->file) || feof(mdf->file) ) {
-        vmdcon_printf(VMDCON_ERROR, "mdfplugin) File error while reading bonds.\n");
-        return MOLFILE_ERROR;
-      }
-    }
-
-    mol++;
-  }
-
-  for (mol = 0; mol < mdf->nmols; mol++) {
-    hash_destroy(&hasharray[mol]);
-  }
-  delete [] hasharray;
-  delete [] atomnames;
-
-  *nbonds = bond_count;
-  *from_data = mdf->from;
-  *to_data = mdf->to;
-  *bondorderptr = NULL; // not implemented yet
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-// Free the memory used by the mdf structure
-static void close_mdf_read(void *v) {
-  mdfdata *mdf = (mdfdata *)v;
-  if (mdf) {
-    if (mdf->file) fclose(mdf->file);
-    if (mdf->from) delete [] mdf->from;
-    if (mdf->to)   delete [] mdf->to;
-    delete mdf;
-  }
-}
-
-// Plugin Initialization
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "mdf";
-  plugin.prettyname = "InsightII MDF";
-  plugin.author = "Eamon Caddigan, Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mdf";
-  plugin.open_file_read = open_mdf_read;
-  plugin.read_structure = read_mdf_structure;
-  plugin.read_bonds = read_mdf_bonds;
-  plugin.close_file_read = close_mdf_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mmcif.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mmcif.C
deleted file mode 100644
index 1a7c73f20c3b0511c533f3ac89083390e5fe40c9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mmcif.C
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mmcif.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  mmCIF molecule file format (a subset of the STAR file format):
- *    http://mmcif.rcsb.org/mmcif-early/background/index.html#1
- *    http://mmcif.rcsb.org/mmcif-early/workshop/mmCIF-tutorials/
- *
- *  mmCIF reserved keywords: data_ loop_ global_ save_ stop_
- *
- *  STAR file syntax and rules (superset of mmCIF):
- *    http://journals.iucr.org/iucr-top/cif/standard/cifstd4.html
- *
- *  STAR syntactic entities: 
- *    Text string: string of characters bounded by blanks, single quotes (') 
- *                 double quotes ("), or by semi-colons (;) as the first 
- *                 character of a line
- *
- *    Data name:   a text string starting with an underline (_) character 
- *
- *    Data item:   a text string not starting with an underline, but preceded 
- *                 by a data name to identify it 
- * 
- *    Data loop:   a list of data names, preceded by loop_ and followed by 
- *                 a repeated list of data items 
- *
- *    Data block:  a collection of data names (looped or not) and data items 
- *                 that are preceded by a data_ code record. A data name must 
- *                 be unique within a data block. A data block is terminated 
- *                 by another data_ statement or the end of file 
- * 
- *    Data file:   a collection of data blocks; the block codes must be 
- *                 unique within a data file  
- *
- *  CIF restrictions to STAR syntax:
- *    http://journals.iucr.org/iucr-top/cif/standard/cifstd5.html
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-#include "periodic_table.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  molfile_atom_t *atomlist;
-} mmcifdata;
- 
-static void *open_mmcif_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  // XXX not finished yet
-  return NULL;
-}
-
-static int read_mmcif_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  // XXX not finished yet 
-  return MOLFILE_ERROR;
-}
-
-static int read_mmcif_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  mmcifdata *data = (mmcifdata *)mydata;
-
-  // XXX not finished yet 
-  return MOLFILE_ERROR;
-}
-    
-static void close_mmcif_read(void *mydata) {
-  mmcifdata *data = (mmcifdata *)mydata;
-  fclose(data->file);
-  free(data);
-}
-
-
-static void *open_mmcif_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  mmcifdata *data;
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    fprintf(stderr, "mmcifplugin) Error: unable to open mmcif file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (mmcifdata *)malloc(sizeof(mmcifdata));
-  data->numatoms = natoms;
-  data->file = fd;
-  return data;
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "mmcif";
-  plugin.prettyname = "mmCIF";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cif";
-  plugin.open_file_read = open_mmcif_read;
-  plugin.read_structure = read_mmcif_structure;
-  plugin.read_next_timestep = read_mmcif_timestep;
-  plugin.close_file_read = close_mmcif_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_mmcif_read(*argv, "mmcif", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_mmcif_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_mmcif_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_mmcif_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_mmcif_read(v);
-  }
-  return 0;
-}
-
-#endif
-
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mol2plugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mol2plugin.C
deleted file mode 100644
index c527043672dde08983c67f700aa97bdfaf514e79..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/mol2plugin.C
+++ /dev/null
@@ -1,609 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: mol2plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.38 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-  
-/*
- * mol2 file reader
- * More information on this format is available at
- *   http://www.tripos.com/data/support/mol2.pdf
- *   http://www.tripos.com/mol2/
- *
- *   DOCK mol2 page: 
- *     http://www.csb.yale.edu/userguides/datamanip/dock/DOCK_4.0.1/html/Manual.41.html
- *
- * This plugin currently reads the following record types:
- *  MOLECULE
- *  ATOM
- *  BOND
- *
- */
-
-#include "molfile_plugin.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-
-typedef struct {
-  FILE *file;
-  molfile_atom_t *atomlist;
-  int natoms, nbonds, optflags, coords_read;
-  int *from, *to;
-  float *bondorder;
-} mol2data;
-
-// Open the file and create the mol2 struct used to pass data to the other
-// functions.
-static void *open_mol2_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  mol2data *mol2;
-  char line[LINESIZE]; 
-  int match, nbonds, optflags;
-
-  fd = fopen(path, "r");
-  if (!fd)
-    return NULL;
-  
-  // Find and read the MOLECULE record
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      fprintf(stderr, "mol2plugin) No molecule record found in file.\n");
-      return NULL;
-    }
-  } while ( strncmp(line, "@<TRIPOS>MOLECULE", 17) );
-
-  fgets(line, LINESIZE, fd);  // Read and ignore the mol_name
-  fgets(line, LINESIZE, fd);  // Read the molecule info
-  match = sscanf(line, " %d %d", natoms, &nbonds);
-  if (match == 1) {
-    nbonds = 0;
-  }
-  else if (match != 2) {
-    fprintf(stderr, "mol2plugin) Cannot determine the number of atoms.\n");
-    return NULL;
-  }
-  fgets(line, LINESIZE, fd);  // Read and ignore the mol_type
-  fgets(line, LINESIZE, fd);  // Read the charge_type
-  if ( strncmp(line, "NO_CHARGES", 10) == 0 ) {
-    optflags = MOLFILE_NOOPTIONS;
-  }
-  else {
-    optflags = MOLFILE_CHARGE;
-  }
-
-  // Allocate and initialize the mol2 structure
-  mol2 =  (mol2data *) malloc(sizeof(mol2data));
-  memset(mol2, 0, sizeof(mol2data));
-  mol2->file = fd;
-  mol2->natoms = *natoms;
-  mol2->nbonds = nbonds;
-  mol2->optflags = optflags;
-  mol2->coords_read = 0;
-  mol2->from = NULL;
-  mol2->to = NULL;
-  mol2->bondorder = NULL;
-
-  return mol2;
-}
-
-// Read atom information, but not coordinates.
-static int read_mol2(void *v, int *optflags, molfile_atom_t *atoms) {
-  mol2data *mol2 = (mol2data *)v;
-  char line[LINESIZE]; 
-  int i, match;
-  molfile_atom_t *atom;
-
-  *optflags = mol2->optflags;
-
-  // Find and read the ATOM record
-  rewind(mol2->file);
-  do {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) No atom record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "@<TRIPOS>ATOM", 13) );
-
-  // Read the atoms
-  for (i = 0; i < mol2->natoms; i++) {
-    atom = atoms+i;
-
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) Error occurred reading atom record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    match = sscanf(line, " %*d %s %*f %*f %*f %s %d %s %f", 
-      atom->name, atom->type, &atom->resid, atom->resname, &atom->charge);
-
-    // The last three records are optional for mol2 files, supply values if
-    // any are missing. Note that these cases are meant to fall through.
-    switch (match) {
-      case 0: 
-        fprintf(stderr, "mol2plugin) Improperly formatted atom record.\n");
-        return MOLFILE_ERROR;
-
-      case 1:
-        atom->resid = 0;
-
-      case 2:
-        sprintf(atom->resname, "%d", atom->resid);
-
-      case 3:
-        atom->charge = 0.0;
-
-      default:
-        break;
-    }
-
-    // Leave these blank when not provided by the file.
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(mol2->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-
-// Create arrays of one-based bond indicies.
-static int read_mol2_bonds_aux(void *v, int *nbonds, int **fromptr, int **toptr, 
-                               float **bondorderptr) {
-  mol2data *mol2 = (mol2data *)v;
-  char line[LINESIZE], bond_type[16]; 
-  int i, match, bond_from, bond_to, bond_index, current_nbonds;
-  float curr_order;
-
-  if (mol2->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    return MOLFILE_SUCCESS;
-  }
-
-  current_nbonds = mol2->nbonds;
-
-  // Find and read the BOND record
-  rewind(mol2->file);
-  do {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) No bond record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "@<TRIPOS>BOND", 13) );
-
-  // Read the bonds
-  bond_index = 0;
-  for (i = 0; i < mol2->nbonds; i++) {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) Error occurred reading bond record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    // Move on if the next line is a header
-    if (strncmp(line, "@", 1) == 0) {
-      //Then the bonds are over
-      break;
-    }
-
-    match = sscanf(line, " %*d %d %d %s", &bond_from, &bond_to, bond_type);
-    if (match < 3) {
-      fprintf(stderr, "mol2plugin) Improperly formatted bond record.\n");
-      continue;
-    }
-    if ( strncmp(bond_type, "nc", 2) == 0 ) {
-      // Not an actual bond, don't add it to the list
-      current_nbonds--;
-    } else if ( strncmp(bond_type, "ar", 2) == 0) {
-       // Aromatic; consider it order 1.5
-       curr_order = 1.5;
-       mol2->from[bond_index] = bond_from;
-       mol2->to[bond_index] = bond_to;
-       mol2->bondorder[bond_index]=curr_order;
-       bond_index++;
-     } else {
-      // Add the bond to the list
-      curr_order=strtod(bond_type,NULL);
-      if (curr_order<1.0 || curr_order>4.0) curr_order=1;
-      //fprintf(stdout,"mol2plugin: Bond from %d to %d of order %f\n", bond_from, bond_to, curr_order);
-      fflush(stdout);
-      mol2->from[bond_index] = bond_from;
-      mol2->to[bond_index] = bond_to;
-      mol2->bondorder[bond_index]=curr_order;
-      bond_index++;
-    }
-  }
-  if (bond_index > 0) {
-    *nbonds = current_nbonds;
-    *fromptr = mol2->from;
-    *toptr = mol2->to;
-    *bondorderptr = mol2->bondorder; 
-  } else {
-    printf("mol2plugin) WARNING: no bonds defined in mol2 file\n");
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL; 
-  }
-    
-  rewind(mol2->file);
-  return MOLFILE_SUCCESS;
-}
-
-
-// Read atom coordinates
-static int read_mol2_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  mol2data *mol2 = (mol2data *)v;
-  char line[LINESIZE];
-  int i, match;
-  float x, y, z;
-
-  // Find and read the ATOM record
-  do {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-
-      //This is a problem, unless we've read at least one timestep
-      if (mol2->coords_read == 0) {
-        fprintf(stderr, "mol2plugin) No atom record found in file.\n");
-      }
-
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "@<TRIPOS>ATOM", 13) );
-
-  // Read the atoms
-  for (i = 0; i < mol2->natoms; i++) {
-    fgets(line, LINESIZE, mol2->file);
-    if ( ferror(mol2->file) || feof(mol2->file) ) {
-      fprintf(stderr, "mol2plugin) Error occurred reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-
-    match = sscanf(line, " %*d %*s %f %f %f", &x, &y, &z);
-    if (match < 3) {
-      fprintf(stderr, "mol2plugin) Improperly formatted atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (ts) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-  mol2->coords_read = 1;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void *open_mol2_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  mol2data *data;
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    fprintf(stderr, "mol2plugin) Error: unable to open mol2 file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (mol2data *) malloc(sizeof(mol2data));
-  memset(data, 0, sizeof(mol2data));
-  data->natoms = natoms;
-  data->file = fd;
-  data->nbonds = 0;
-//  data->file_name = strdup(filename);
-  return data;
-}
-
-
-static int write_mol2_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  mol2data *data = (mol2data *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->natoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->natoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-/*
-void getmol2ff(char* outputtype, const char* psftype) {
-  //fprintf(stdout,"Doing ff typing on %s\n",psftype);
-  if (strncmp(psftype,"H",1)==0) {
-    //It's a hydrogen
-    strncpy(outputtype, "H   ",4);
-    return;
-  } else if (strncmp(psftype,"C",1)==0) {
-    //It's a carbon... probably
-    if (strncmp(psftype,"C ",2)==0  || strncmp(psftype,"CA ",3)==0 || 
-        strncmp(psftype,"CPH",3)==0 || strncmp(psftype,"CPT",3)==0 || 
-        strncmp(psftype,"CC ",3)==0 || strncmp(psftype,"CD ",3)==0 || 
-        strncmp(psftype,"CN1",3)==0 || strncmp(psftype,"CN2",3)==0 || 
-        strncmp(psftype,"CN3",3)==0 || strncmp(psftype,"CN4",3)==0 || 
-        strncmp(psftype,"CN5",3)==0 || strncmp(psftype,"CNA",3)==0) {
-      strncpy(outputtype, "C.2 ",4);
-      return;
-    } else {
-      strncpy(outputtype, "C.3 ",4);
-      return;
-    }  
-  } else if (strncmp(psftype,"N",1)==0) {
-     //It"s probably nitrogen
-     if (strncmp(psftype,"NR",2)==0 || strncmp(psftype,"NH1",3)==0 || 
-         strncmp(psftype,"NH2",3)==0 || strncmp(psftype,"NC2",3)==0 || 
-         strncmp(psftype,"NY",2)==0 || 
-         (strncmp(psftype,"NN",2)==0 && strncmp(psftype,"NN6",3)!=0)) {
-       strncpy(outputtype, "N.am",4);
-       return;
-       } else {
-       strncpy(outputtype, "N.3 ",4);
-       return;
-       }
-  } else if (strncmp(psftype,"O",1)==0) {
-     //Probably an oxygen
-     if (strncmp(psftype,"OH1",3)==0 || strncmp(psftype,"OS",2)==0 || 
-         strncmp(psftype,"OT ",3)==0 || strncmp(psftype,"ON4",3)==0 || 
-         strncmp(psftype,"ON5",3)==0 || strncmp(psftype,"ON6",3)==0) {
-       strncpy(outputtype, "O.3 ",4);
-       return;
-     } else {
-       strncpy(outputtype, "O.2 ",4);
-       return;
-     } 
-  } else if (strncmp(psftype,"S",1)==0) {
-     strncpy(outputtype, "S.3 ",4);
-     return;
-  } else if (strncmp(psftype,"P",1)==0) {
-     strncpy(outputtype, "P.3 ",4);
-     return;
-  } else {
-     strncpy(outputtype, "X.  ",4);
-     return;
-  }
-}
-*/
-
-
-
-
-
-
-static int write_mol2_timestep(void *mydata, const molfile_timestep_t *ts) {
-  mol2data *data = (mol2data *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  float chrgsq;
-  int i;
-
-  // try to guess whether we have charge information.
-  chrgsq=0.0;
-  atom = data->atomlist;
-  for (i = 0; i < data->natoms; i++) {
-      chrgsq += atom->charge*atom->charge;
-      ++atom;
-  }
-
-  //print header block
-  fprintf(data->file, "@<TRIPOS>MOLECULE\n");
-  fprintf(data->file, "generated by VMD\n");
-  fprintf(data->file, " %4d %4d    1    0    0\n", data->natoms, data->nbonds);
-  fprintf(data->file, "SMALL\n");
-  // educated guess
-  if (chrgsq > 0.0001) {
-      fprintf(data->file, "USER_CHARGES\n");
-  } else {
-      fprintf(data->file, "NO_CHARGES\n");
-  }
-  fprintf(data->file, "****\n");
-  fprintf(data->file, "Energy = 0\n\n");
-  
-  //print atoms block
-  fprintf(data->file, "@<TRIPOS>ATOM\n");
-  atom = data->atomlist;
-  pos = ts->coords;
-  //char mol2fftype[5];
-  //mol2fftype[4] = '\0';
-  for (i = 0; i < data->natoms; i++) {
-#if 0
-    getmol2ff(mol2fftype, atom->type);
-    fprintf(data->file, "%7d %-4s      %8.4f  %8.4f  %8.4f %4s %4d  %3s        %8.6f\n", i+1, atom->name, pos[0], pos[1], pos[2], mol2fftype, atom->resid, atom->resname, atom->charge);
-#else
-    fprintf(data->file, "%7d %-4s      %8.4f  %8.4f  %8.4f %4s %4d  %3s        %8.6f\n", i+1, atom->name, pos[0], pos[1], pos[2], atom->type, atom->resid, atom->resname, atom->charge);
-#endif
-    ++atom; 
-    pos += 3;
-  }
-
-  //print bond info
-
-  int l=1; //number of bond record
-  printf("mol2plugin) numbonds: %d\n", data->nbonds);
-  if (data->nbonds>0) fprintf(data->file, "@<TRIPOS>BOND\n");
-  for (i=0; i<data->nbonds; i++) {
-    // For mol2, only write bonds for fromptr[i]<toptr[i]
-    // bondorder is either 1, 2, 3 or a textual representation: am,ar,du,un,nc
-    // we don't have the info for the text, so we truncate to integer.
-    if (data->bondorder != NULL) {
-      fprintf(data->file, "%5d %5d %5d %2d\n", l ,data->from[i], data->to[i],
-              (int)data->bondorder[i]);
-    } else {
-      fprintf(data->file, "%5d %5d %5d %2d\n", l ,data->from[i], data->to[i], 1);
-    }
-
-    l++;
-  } 
-
-  // Print out substructure info to keep some programs sane
-  fprintf(data->file,"\n@<TRIPOS>SUBSTRUCTURE\n");
-  fprintf(data->file,"1 ****        1 TEMP                        ");
-  fprintf(data->file,"0 ****  **** 0 ROOT\n");
-
-  return MOLFILE_SUCCESS;
-}
-
-static int write_mol2_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                            float *bondorderptr,  int *bondtype, 
-                            int nbondtypes, char **bondtypename) {
-  printf("*** RUNNING WRITE_MOL2_BONDS\n");
-  mol2data *data = (mol2data *)v;
-  data->nbonds = nbonds;
-  data->from = (int *) malloc(nbonds * sizeof(int));
-  data->to = (int *) malloc(nbonds * sizeof(int));
-  //set the pointers for use later
-  for (int i=0;i<nbonds;i++) {
-    data->from[i]=fromptr[i];
-    data->to[i]=toptr[i];
-  }
-  printf("*** I THINK nbonds is %i\n", nbonds);
-  data->nbonds = nbonds;
-  if (bondorderptr != NULL) {
-    data->bondorder = (float *) malloc(nbonds * sizeof(float));
-    for (int i=0;i<nbonds;i++) {
-      data->bondorder[i]=bondorderptr[i];
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_mol2_write(void *mydata) {
-  mol2data *data = (mol2data *)mydata;
-  if (data) {
-    if (data->file) fclose(data->file);
-    if (data->from != NULL) free(data->from);
-    data->from = NULL;
-    if (data->to != NULL)   free(data->to);
-    data->to = NULL;
-    if (data->bondorder != NULL)   free(data->bondorder);
-    data->bondorder = NULL;
-    if (data->atomlist != NULL) free(data->atomlist);
-    data->atomlist = NULL;
-    free(data);
-  }
-}
-
-//
-// Free the memory used by the mol2 structure
-static void close_mol2_read(void *v) {
-  mol2data *mol2 = (mol2data *)v;
-  if (mol2) {
-    if (mol2->file) fclose(mol2->file);
-    if (mol2->from != NULL) free(mol2->from);
-    mol2->from = NULL;
-    if (mol2->to != NULL)   free(mol2->to);
-    mol2->to = NULL;
-    if (mol2->bondorder != NULL)   free(mol2->bondorder);
-    mol2->bondorder = NULL;
-    free(mol2);
-  }
-}
-
-
-static int read_mol2_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                           float **bondorderptr, int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  mol2data *mol2 = (mol2data *)v;
-
-  /* now read bond data */
-//  *nbonds = start_psf_bonds(psf->fp);
-
-  if (mol2->nbonds > 0) {
-    mol2->from = (int *) malloc(mol2->nbonds*sizeof(int));
-    mol2->to = (int *) malloc(mol2->nbonds*sizeof(int));
-    mol2->bondorder = (float *) malloc(mol2->nbonds*sizeof(float));
-    if (mol2->from == NULL || mol2->to == NULL || mol2->bondorder == NULL) {
-      fprintf(stderr, "mol2plugin) ERROR: Failed to allocate memory for bonds\n");
-      fclose(mol2->file);
-      mol2->file = NULL;
-      return MOLFILE_ERROR;
-    }
-    if ((read_mol2_bonds_aux(mol2, nbonds, &(mol2->from), &(mol2->to), &(mol2->bondorder))) != MOLFILE_SUCCESS) {
-      fclose(mol2->file);
-      mol2->file = NULL;
-      return MOLFILE_ERROR;
-    }
-    *fromptr = mol2->from;
-    *toptr = mol2->to;
-    *bondorderptr = mol2->bondorder; 
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  } else {
-    printf("mol2plugin) WARNING: zero bonds defined in mol2 file.\n");
-    *nbonds = 0;
-    *fromptr=NULL;
-    *toptr=NULL;
-    *bondorderptr=NULL;
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "mol2";
-  plugin.prettyname = "MDL mol2";
-  plugin.author = "Peter Freddolino, Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 17;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mol2";
-  plugin.open_file_read = open_mol2_read;
-  plugin.read_structure = read_mol2;
-  plugin.read_bonds = read_mol2_bonds;
-  plugin.read_next_timestep = read_mol2_timestep;
-  plugin.close_file_read = close_mol2_read;
-  plugin.open_file_write = open_mol2_write;
-  plugin.write_structure = write_mol2_structure;
-  plugin.write_timestep = write_mol2_timestep;
-  plugin.close_file_write = close_mol2_write;
-  plugin.write_bonds = write_mol2_bonds;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/moldenplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/moldenplugin.c
deleted file mode 100644
index 1dac910f1daa2ee682c703eebc79cde48b21aa9e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/moldenplugin.c
+++ /dev/null
@@ -1,1332 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: moldenplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.40 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* This is a plugin that will read input from a MOLDEN
-** generated output file 
-** some more details will go here soon 
-** NOTE: The current version of the plugin relies
-** on the fact that the [Atom] field comes before
-** the [Geometries] field */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#include "molfile_plugin.h"
-#include "unit_conversion.h"
-#include "periodic_table.h"
-#include "qmplugin.h"
-
-
-#define ALLOCATE(array, type, size) \
-  array = (type *)calloc(size, sizeof(type)); \
-  if (array == NULL) { \
-    fprintf(stderr, "moldenplugin) Memory allocation for %s failed!\n", #array); \
-    return FALSE; \
-  }
-
-#define GET_LINE(x,y) if (!fgets(x, sizeof(x), y)) return FALSE
-
-
-/* I could use a flag already present in qmdata_t to 
- * indicate a trajectory, but I'm using moldendata_t 
- * to demonstrate the use of 
- * void *format_specific_data;
- * in qmdata_t as a means to store data specific to 
- * the plugin. 
- */
-typedef struct {
-  long filepos_atoms;   /* [ATOMS] section */
-  long filepos_geomxyz; /* [GEOMETRIES] XYZ section */
-  long filepos_gto;     /* [GTO] section */
-  long filepos_mo;      /* [MO] section */
-  char units[16];
-  int coordsonly;
-} moldendata_t;
-
-
-
-/* Read the basis set data */
-static int get_basis (qmdata_t *);
-static int shelltype_int(char *type);
-static int fill_basis_arrays(qmdata_t *data);
-
-static int read_geom_block(qmdata_t *data);
-static int read_molecular_orbitals(qmdata_t *data);
-static int read_wave_coeffs(FILE *file, qm_wavefunction_t *wave);
-static int count_orbitals(qmdata_t *data);
-
-
-/*********************************************************
- *
- * Open file and return number of atoms.
- *
- * In order to determine the # atom we have to read into
- * the [ATOMS]/[GEOMETRIES] sections where the atoms are
- * defined.
- * There can be either [ATOMS] or [GEOMETRIES] or both.
- * While [GEOMETRIES] has the # atoms as its first line,
- * we actually have to count lines in [ATOMS].
- *
- * We assume no particular order for the sections and scan
- * the entire file for the according keywords. In order to
- * save time when the section contents are actually read
- * we store the file pointers to the beginning of each
- * section in moldendata_t.
- *
- *********************************************************/
-static void *open_molden_read(const char *filename,
-                              const char *filetype,
-                              int *natoms) {
-  FILE *fd;
-  qmdata_t *data = NULL;
-  moldendata_t *moldendata;
-  char buffer[1024];
-  char keystring[20];
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  /* allocate memory for main QM data structure */
-  data = init_qmdata();
-  if (!data) return NULL;
-
-  data->file = fd;
-
-  /* allocate GAMESS specific data */
-  moldendata = (moldendata_t *)calloc(1, sizeof(moldendata_t));
-  if (!moldendata) return NULL;
-
-  data->format_specific_data = moldendata;
-
-
-  /* Read first line */
-  if (!fgets(buffer,1024,data->file)) return NULL;
-
-  /* Check if the file is MOLDEN format */
-  if (!strcmp(strtoupper(trimleft(trimright(buffer))), "[MOLDEN FORMAT]")) {
-    printf("moldenplugin) Detected MOLDEN file format!\n");
-  } else {
-    printf("moldenplugin) The file is not in MOLDEN format!\n");
-    return NULL;
-  }
-
-  eatwhitelines(data->file);
-
-
-  /* Identify the different sections. */
-  while (fgets(buffer,1024,data->file)) {
-
-    /* Get key string (ignoring empty lines) */
-    if (!sscanf(buffer, "%s", keystring)) continue;
-
-    /* Quick test avoiding the uppercase transformation */
-    if (keystring[0]!='[') continue;
-
-    /* Make keystring upper case */
-    strtoupper(keystring);
-
-    if (!strcmp(keystring, "[5D]") || !strcmp(keystring, "[5D7F]") ||
-	!strcmp(keystring, "[7F]") || !strcmp(keystring, "[5D10F]") ||
-	!strcmp(keystring, "[9G]")) {
-      printf("moldenplugin) Spherical harmonic basis found %s. \n", keystring);
-      printf("moldenplugin)   Currently VMD handles only basis sets/wave functions\n");
-      printf("moldenplugin)   with cartesian Gaussian functions.\n");
-      printf("moldenplugin)   Loading coordinates only.\n");
-      moldendata->coordsonly = 1;
-    }
-
-    if (!strcmp(keystring, "[ATOMS]")) {
-      char *s;
-      long prevline=ftell(fd);
-      printf("moldenplugin) Found [ATOMS] section ...\n");
-      moldendata->filepos_atoms = ftell(data->file);
-
-      if (!sscanf(buffer, "%*s %s", moldendata->units)) {
-        printf("moldenplugin) Missing units in [ATOMS] section!\n");
-        return NULL;
-      }
-
-      /* start counting the atoms; 
-       * read until I hit the first line that starts with a "["
-       * bracket */      
-      (*natoms) = 0; 
-      s = fgets(buffer, 1024, fd);
-
-      /* Here we assume that the [ATOMS] section goes
-       * on until the next empty line or another section
-       * starts, i.e. there is a "[" or we encounter EOF */
-      while (trimleft(buffer)[0]!='[' && s!=NULL && !iswhiteline(buffer)) {
-        (*natoms)++;
-        prevline = ftell(fd);
-        s = fgets(buffer, 1024, fd);
-      }
-      data->numatoms = *natoms;
-      data->num_frames = 1;
-
-      /* Go back to the previous line, it might contain
-       * the next keyword */
-      fseek(data->file, prevline, SEEK_SET);
-    }
-
-    else if (!strcmp(keystring, "[GEOMETRIES]")) {
-      if (!strcmp(trimright(buffer), "[GEOMETRIES] XYZ")) {
-        printf("moldenplugin) Found [GEOMETRIES] XYZ section ...\n");
-
-        moldendata->filepos_geomxyz = ftell(data->file);
-
-        /* The first line of the XYZ type [GEOMETRIES] input
-         * contains the number of atoms. */
-        if (fscanf(data->file, "%d", natoms) != 1) {
-          printf("moldenplugin) No # atoms found in [GEOMETRIES] section!\n");
-          return NULL;
-        }
-        data->numatoms = *natoms;
-
-        /* Jump back to the beginning of the section */
-        fseek(data->file, moldendata->filepos_geomxyz, SEEK_SET);
-
-        /* Count # frames */
-        data->num_frames = 0;
-        do {
-          int natm = 0;
-          fscanf(data->file, "%d", &natm);
-          if (natm!=data->numatoms) break;
-          eatline(data->file, 1);
-
-          data->filepos_array = (long*)realloc(data->filepos_array,
-                                               (data->num_frames+1)*sizeof(long));
-          data->filepos_array[data->num_frames] = ftell(data->file);
-
-          /* Skip title line + numatoms lines */
-          eatline(data->file, 1+data->numatoms);
-          if (feof(data->file)) break;
-
-          data->num_frames++;
-        } while (1);
-
-        printf("moldenplugin) Found %d frames\n", data->num_frames);
-      } else if (!strcmp(trimright(buffer), "[GEOMETRIES] ZMAT")) {
-        printf("moldenplugin) [GEOMETRIES] ZMAT not supported!\n");
-      }
-    }
-
-    else if (!strcmp(keystring,"[GTO]")) {
-      printf("moldenplugin) Found [GTO] section ...\n");
-      moldendata->filepos_gto = ftell(data->file);
-    }
-
-    else if (!strcmp(keystring,"[MO]")) {
-      printf("moldenplugin) Found [MO] section ...\n");
-      moldendata->filepos_mo = ftell(data->file);
-    }
-
-  };
-  
-  return data;
-}
-
-
-
-/*********************************************************
- *
- * Read geometry from file
- *
- * The [ATOMS] section provides atom name, atomic number
- * and coordinates while the [GEOMETRIES] XYZ section
- * provides atom type and coordinates. Trajectories can
- * only be specified using [GEOMETRIES].
- * In case we only have [GEOMETRIES] the atomic number
- * will have to be deduced from the atom name.
- *
- *********************************************************/
-static int read_molden_structure(void *mydata, int *optflags, 
-                                 molfile_atom_t *atoms) 
-{
-  int i;
-  char buffer[1024];
-  char atname[1024];
-  int num, atomicnum;
-  molfile_atom_t *atom;
-  qmdata_t *data = (qmdata_t *)mydata;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-
-  ALLOCATE(data->atoms, qm_atom_t, data->numatoms);
-
-  /* atomic number is provided by plugin.
-   * (This is required for QM plugins!) */
-  *optflags = MOLFILE_ATOMICNUMBER;
-
-  /* [ATOMS] section */
-  if (moldendata->filepos_atoms) { 
-    float unitfac = 1.f;
-
-    /* If the units are given in AU we have to convert them.       */
-    /* Note: Also recognize parenthesized units emitted by Molcas. */
-    if (!strcmp(moldendata->units, "AU") ||
-        !strcmp(moldendata->units, "(AU)")) {
-      unitfac = BOHR_TO_ANGS;
-    }
-    
-    /* Jump to beginning of [ATOMS] section. */
-    fseek(data->file, moldendata->filepos_atoms, SEEK_SET);
-
-    /* Read the atom types, names, atomic numbers
-     * as well as x,y,z coordinates */
-    for (i=0; i<data->numatoms; i++) {
-      float x,y,z;
-      atom = atoms+i;
-      
-      if (!fgets(buffer,1024,data->file)) return MOLFILE_ERROR;
-      
-      sscanf(buffer,"%s %d %d %f %f %f", atname, &num,
-             &atomicnum, &x, &y, &z);
-
-      /* populate data structure for VMD */
-      strncpy(atom->name, atname,     sizeof(atom->name)); 
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->atomicnumber = atomicnum;
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->chain[0] = '\0';
-      atom->segid[0] = '\0';
-
-      /* keep local copy */
-      strncpy(data->atoms[i].type, atname, sizeof(data->atoms[i].type));
-      data->atoms[i].atomicnum = atomicnum;
-      data->atoms[i].x = x*unitfac;
-      data->atoms[i].y = y*unitfac;
-      data->atoms[i].z = z*unitfac;
-    }
-    data->num_frames_read = 1;
-
-    return MOLFILE_SUCCESS;
-  }
-
-  /* [GEOMETRIES] XYZ section */
-  if (moldendata->filepos_geomxyz) {
-
-    /* Jump to beginning of [GEOMETRIES] section. */
-    fseek(data->file, moldendata->filepos_geomxyz, SEEK_SET);
-    eatline(data->file, 2);
-
-    /* Read block from file */
-    for (i=0; i<data->numatoms; i++) {
-      atom = atoms+i;
-      if (!fgets(buffer,1024,data->file)) return MOLFILE_ERROR;
-      sscanf(buffer,"%s %*f %*f %*f", atname);
-
-      strncpy(atom->type, atname, sizeof(atom->type));
-      strncpy(atom->name, atname, sizeof(atom->name)); 
-      atom->atomicnumber = get_pte_idx_from_string(atname);
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->chain[0] = '\0';
-      atom->segid[0] = '\0';
-      data->atoms[i].atomicnum = atom->atomicnumber;
-    }
-    data->num_frames_read = 0;
-
-    return MOLFILE_SUCCESS;
-  }
-
-  printf("Sorry, could not obtain structure information \n");
-  printf("from either the [ATOMS] or [GEOMETRIES] section! \n");
-  printf("Please check your MOLDEN output file! \n"); 
-  return MOLFILE_ERROR; 
-}
-
-
-/***********************************************************
- *
- * Read atoms for one frame from [GEOMETRIES] section.
- *
- ***********************************************************/
-static int read_geom_block(qmdata_t *data) {
-  int i;
-  char buffer[1024];
-  float x,y,z;
-
-  /* Skip title line */
-  eatline(data->file, 1);
-
-  for (i=0; i<data->numatoms; i++) {
-    if (!fgets(buffer,1024,data->file)) return 0;
-    sscanf(buffer,"%*s %f %f %f", &x, &y, &z);
-    data->atoms[i].x = x;
-    data->atoms[i].y = y;
-    data->atoms[i].z = z;
-  }
-
-  return 1;
-}
-
-
-/***********************************************************
- *
- * Provide non-QM metadata for next timestep. 
- * Required by the plugin interface.
- *
- ***********************************************************/
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  meta->count = -1;
-  meta->has_velocities = 0;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***********************************************************
- *
- * We are not reading the coefficients themselves,
- * because that could require a large amount of memory.
- *
- ***********************************************************/
-static int read_qm_timestep_metadata(void *mydata,
-                                    molfile_qm_timestep_metadata_t *meta) {
-  qmdata_t *data = (qmdata_t *)mydata;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-
-  if (data->num_frames_sent >= data->num_frames) {
-    /* All frames were sent. */
-    return MOLFILE_ERROR;
-  }
-
-  /* Can't send metadata if only coordinates were read */
-  if (moldendata->coordsonly) return MOLFILE_ERROR;
-
-  /* Count the number of cartesian basis functions in 
-     the basis set */
-  if (data->num_frames_sent == data->num_frames-1) {
-    int i;
-    qm_timestep_t *cur_ts;
-
-    if (!count_orbitals(data)) return MOLFILE_ERROR;
-
-    /* get a pointer to the current qm timestep */
-    cur_ts = data->qm_timestep;
-    
-    for (i=0; (i<MOLFILE_MAXWAVEPERTS && i<cur_ts->numwave); i++) {
-      meta->num_orbitals_per_wavef[i] = cur_ts->wave[i].num_orbitals;
-      meta->has_occup_per_wavef[i]    = cur_ts->wave[i].has_occup;
-      meta->has_orben_per_wavef[i]    = cur_ts->wave[i].has_orben;
-    }
-    meta->wavef_size   = data->wavef_size;
-    meta->num_wavef    = cur_ts->numwave;
-    meta->num_scfiter  = cur_ts->num_scfiter;
-    meta->has_gradient = FALSE;
-    meta->num_charge_sets = 0;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-
-/***********************************************************
- *
- * Provides VMD with the data of the next timestep.
- *
- ***********************************************************/
-static int read_timestep(void *mydata, int natoms, 
-       molfile_timestep_t *ts, molfile_qm_metadata_t *qm_metadata,
-                         molfile_qm_timestep_t *qm_ts) {
-  int i;
-  qmdata_t *data = (qmdata_t *)mydata;
-  qm_timestep_t *cur_ts;
-
-  if (data->num_frames_sent >= data->num_frames) {
-    /* All frames were sent. */
-    return MOLFILE_ERROR;
-  }
-
-  if (data->num_frames_sent == data->num_frames_read) {
-    /* Read next coordinate block from file */
-    fseek(data->file, data->filepos_array[data->num_frames_read], SEEK_SET);
-    read_geom_block(data);
-
-    /*printf("moldenplugin) Read frame %d\n", data->num_frames_read); */
-    data->num_frames_read++;
-  }
-
-
-  /* Copy the coordinates */
-  for (i=0; i<natoms; i++) {
-    ts->coords[3*i  ] = data->atoms[i].x;
-    ts->coords[3*i+1] = data->atoms[i].y;
-    ts->coords[3*i+2] = data->atoms[i].z; 
-  }
-
-  /*printf("moldenplugin) Sent frame %d\n", data->num_frames_sent); */
-  data->num_frames_sent++;
-
-  /* In MOLDEN the MOs are listed only for the last frame */
-  if (data->num_frames_sent == data->num_frames) {
-
-    /* get a convenient pointer to the current qm timestep */
-    cur_ts = data->qm_timestep;
-
-    read_molecular_orbitals(data);
-
-    /* store the wave function and orbital energies */
-    if (cur_ts != NULL && cur_ts->wave != NULL) {
-      for (i=0; i<cur_ts->numwave; i++) {
-        qm_wavefunction_t *wave = &cur_ts->wave[i];
-        qm_ts->wave[i].type         = wave->type;
-        qm_ts->wave[i].spin         = wave->spin;
-        qm_ts->wave[i].excitation   = wave->exci;
-        qm_ts->wave[i].multiplicity = wave->mult;
-        qm_ts->wave[i].energy       = wave->energy;
-        strncpy(qm_ts->wave[i].info, wave->info, MOLFILE_BUFSIZ);
-        
-        if (wave->wave_coeffs) {
-          memcpy(qm_ts->wave[i].wave_coeffs, wave->wave_coeffs,
-                 wave->num_orbitals*data->wavef_size*sizeof(float));
-        }
-        if (wave->orb_energies) {
-          memcpy(qm_ts->wave[i].orbital_energies, wave->orb_energies,
-                 wave->num_orbitals*sizeof(float));
-        }
-        if (wave->has_occup) {
-          memcpy(qm_ts->wave[i].occupancies, wave->orb_occupancies,
-                 wave->num_orbitals*sizeof(float));
-        }
-      }
-    }
-
-  }
-
-  return MOLFILE_SUCCESS;
-}
-  
-
-/*****************************************************
- *
- * Provide VMD with the sizes of the QM related
- * data structure arrays that need to be made
- * available.
- * Since we cannot determine the basis set meta data
- * without parsing the whole basis set section, we
- * read all basis set data here. The data is stored
- * in the qmdata_t structure for later use in
- * read_molden_rundata().
- *
- *****************************************************/
-static int read_molden_metadata(void *mydata, 
-    molfile_qm_metadata_t *metadata) {
-
-  qmdata_t *data;
-  moldendata_t *moldendata;
-  data = (qmdata_t *)mydata;
-  moldendata = (moldendata_t *)data->format_specific_data;
-
-
-  metadata->ncart = 0;
-  metadata->nimag = 0;
-  metadata->nintcoords = 0;
-
-  metadata->have_sysinfo = 0;
-  metadata->have_carthessian = 0;
-  metadata->have_inthessian = 0;
-  metadata->have_normalmodes = 0;
-
-  metadata->num_basis_funcs = 0;
-  metadata->num_basis_atoms = 0;
-  metadata->num_shells = 0;
-  metadata->wavef_size = 0;
-
-  if (!moldendata->coordsonly) {
-    /* Read the basis set */
-    if (!get_basis(data)) return MOLFILE_ERROR; 
-
-    /* orbital + basis set data */
-    metadata->num_basis_funcs = data->num_basis_funcs;
-    metadata->num_basis_atoms = data->num_basis_atoms;
-    metadata->num_shells      = data->num_shells;
-    metadata->wavef_size      = data->wavef_size;  
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/******************************************************
- * 
- * Provide VMD with the static (i.e. non-trajectory)
- * data. That means we are filling the molfile_plugin
- * data structures.
- *
- ******************************************************/
-static int read_molden_rundata(void *mydata, 
-                               molfile_qm_t *qm_data) {
-  qmdata_t *data = (qmdata_t *)mydata;
-  int i;
-  molfile_qm_hessian_t *hessian_data;
-  molfile_qm_basis_t   *basis_data;
-  molfile_qm_sysinfo_t *sys_data;
-
-  if (!qm_data) return MOLFILE_ERROR;
-
-
-  hessian_data = &qm_data->hess;
-  basis_data   = &qm_data->basis;
-  sys_data     = &qm_data->run;
-
-  sys_data->num_electrons = data->num_electrons;
-  sys_data->totalcharge = data->totalcharge;
-
-  /* Populate basis set data */
-  if (data->num_basis_funcs) {
-    for (i=0; i<data->num_basis_atoms; i++) {
-      basis_data->num_shells_per_atom[i] = data->num_shells_per_atom[i];
-      basis_data->atomic_number[i] = data->atomicnum_per_basisatom[i];
-    }
-    
-    for (i=0; i<data->num_shells; i++) {
-      basis_data->num_prim_per_shell[i] = data->num_prim_per_shell[i];
-      basis_data->shell_types[i] = data->shell_types[i];
-    }
-    
-    for (i=0; i<2*data->num_basis_funcs; i++) {
-      basis_data->basis[i] = data->basis[i];
-    }
-
-    /* If we have MOs in the file we must provide the 
-     * angular momentum exponents */
-    if (data->angular_momentum) {
-      for (i=0; i<3*data->wavef_size; i++) {
-        basis_data->angular_momentum[i] = data->angular_momentum[i];
-      }
-    }
-  }
-
-  /* fill in molfile_qm_sysinfo_t */
-  /*sys_data->runtype = data->runtype;
-  sys_data->scftype = data->scftype;
-  sys_data->nproc   = data->nproc;
-  sys_data->num_electrons  = data->num_electrons;
-  sys_data->totalcharge    = data->totalcharge;
-  sys_data->num_occupied_A = data->num_occupied_A;
-  sys_data->num_occupied_B = data->num_occupied_B;
-  sys_data->status         = data->opt_status;
-  */
-  return MOLFILE_SUCCESS;
-}
-
-
-/**********************************************************
- *
- * close file and free memory
- *
- **********************************************************/
-static void close_molden_read(void *mydata) {
-  int i, j;
-  qmdata_t *data = (qmdata_t *)mydata;
-
-  fclose(data->file);
-
-  free(data->atoms);
-  free(data->basis);
-  free(data->shell_types);
-  free(data->atomicnum_per_basisatom);
-  free(data->num_shells_per_atom);
-  free(data->num_prim_per_shell);
-  free(data->angular_momentum);
-
-  if (data->basis_set) {
-    for(i=0; i<data->num_basis_atoms; i++) {
-      for (j=0; j<data->basis_set[i].numshells; j++) {
-        free(data->basis_set[i].shell[j].prim);
-      }
-      free(data->basis_set[i].shell);
-    } 
-    free(data->basis_set);
-  }
-
-  free(data->format_specific_data);
-  free(data->filepos_array);
-
-  if (data->qm_timestep != NULL) {
-    for (j=0; j<data->qm_timestep[0].numwave; j++) {
-      free(data->qm_timestep[0].wave[j].wave_coeffs);
-      free(data->qm_timestep[0].wave[j].orb_energies);
-      free(data->qm_timestep[0].wave[j].orb_occupancies);
-    }
-    free(data->qm_timestep[0].wave);
-    free(data->qm_timestep);
-  } else {
-    printf("close_molden_read(): NULL qm_timestep!\n");
-  }
-
-  free(data);
-}
-
-
-
-/* ####################################################### */
-/*             End of API functions                        */
-/* The following functions actually do the file parsing.   */
-/* ####################################################### */
-
-
-/******************************************************
- * 
- * Format specification of the basis-set consisting of 
- * contracted Gaussian Type Orbitals.
- *
- * [GTO]
- * atom_sequence_number1 0
- * shell_label number_of_primitives 1.00
- * exponent_prim_1 contraction_coeff_1 (contraction_coeff_sp_1)
- * ...
- * <empty line>
- * atom_sequence_number2 0
- * shell_label number_of_primitives 1.00
- * exponent_prim_1 contraction_coeff_1 (contraction_coeff_1)
- * ...
- * <empty line>
- *
- * recognized shell_labels: s, p, d, f, sp, g
- *
- * For 'sp' shells two contraction coefficients must be given,
- * for both s and p functions. 
- * The 0 on the shell_number line and the 1.00 on the
- * shell_label line are no longer functional and can be
- * ignored.
- *
- * All workings with the [GTO] keyword are in Atomic Units.
- *
- ******************************************************/
-
-
-/*******************************************************
- *
- * Read the basis set data
- *
- * Format example:
- * [GTO]
- *   1 0
- *  s    2 1.00
- *   0.2738503300E+02  0.4301284983E+00
- *   0.4874522100E+01  0.6789135305E+00
- *  sp   2 1.00
- *   0.1136748200E+01  0.4947176920E-01  0.5115407076E+00
- *   0.2883094000E+00  0.9637824081E+00  0.6128198961E+00
- *
- *   2 0
- *  s    2 1.00
- *   0.1309756400E+01  0.4301284983E+00
- *   0.2331360000E+00  0.6789135305E+00
- *  ...
- *
- * qmdata_t provides hierarchical data structures for 
- * the basis set which are convenient for parsing. 
- * The molfile_plugin interface, however, requires flat
- * arrays, so after reading is done we have to populate
- * the according arrays using fill_basis_arrays().
- * 
- *******************************************************/
-static int get_basis(qmdata_t *data) {
-  char buffer[1024];
-  char shelltype[1024];
-  int atomid, numprims;
-  int i, j=0;
-  int numshells;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-
-  /* XXX already initialized in open_molden_read() */
-  data->num_shells = 0;
-  data->num_basis_funcs = 0;
-  data->num_basis_atoms = 0;
-
-  /* initialize basis set the character array */
-  memset(data->basis_string, 0, sizeof(data->basis_string));
-
-
-  /* Place file pointer on line after the [GTO] keyword. */
-  fseek(data->file, moldendata->filepos_gto, SEEK_SET);
- 
-  /* Allocate memory for the basis of all atoms. */
-  ALLOCATE(data->basis_set, basis_atom_t, data->numatoms);
-
-  /* Loop over all atoms. */
-  for (i=0; i<data->numatoms; i++) {
-
-    if (!fgets(buffer,1024,data->file)) return FALSE;
-    sscanf(buffer,"%d %*d", &atomid);
-
-    numshells = 0;
-    data->basis_set[i].shell = NULL;
-
-    /* Read an unknown number of shells */
-    while (1) {
-      shell_t *shell, *shell2=NULL;
-
-      if (!fgets(buffer,1024,data->file)) return FALSE;
-      
-      /* Empty line signifies beginning of next atom */
-      if (!strlen(trimleft(buffer))) break;
-      
-      /* Get shell type (s, p, d, f, g, sp) and # of primitives */
-      sscanf(buffer,"%s %d %*f", shelltype, &numprims);
-
-
-      /* Add new shell(s). */
-      if (!strcasecmp(shelltype, "sp")) {
-        /* Two new shells for SP */
-        data->basis_set[i].shell =
-          (shell_t*)realloc(data->basis_set[i].shell,
-                            (numshells+2)*sizeof(shell_t));
-      } else {
-        /* One new shell for non-SP */
-        data->basis_set[i].shell =
-          (shell_t*)realloc(data->basis_set[i].shell,
-                            (numshells+1)*sizeof(shell_t));
-      }
-
-      shell  = &(data->basis_set[i].shell[numshells]);
-      memset(shell, 0, sizeof(shell_t));
-      shell->numprims = numprims;
-      shell->type     = shelltype_int(shelltype);
-      shell->prim     = (prim_t*)calloc(numprims, sizeof(prim_t));
-
-      /* If this is an SP-shell we have to add as separate 
-       * S-shell and P-shell. */
-      if (!strcasecmp(shelltype, "sp")) {
-        shell->type      = SP_S_SHELL;
-        shell2 = &(data->basis_set[i].shell[numshells+1]);
-        shell2->numprims = numprims;
-        shell2->type     = SP_P_SHELL;
-        shell2->prim     = (prim_t*)calloc(numprims, sizeof(prim_t));
-      }
-
-      /* Loop over the primitives */
-      for (j=0; j<numprims; j++) {
-        int nr;
-        double expon=0.f, coeff1, coeff2=0.f;
-        if (!fgets(buffer,1024,data->file)) return FALSE;
-
-	/* MOLDEN writes the basis set coefficients using Fortran style notation 
-	 * where the exponential character is 'D' instead of 'E'. Other packages 
-	 * adhere to C-style notation. Unfortunately sscanf() won't recognize 
-	 * Fortran-style numbers. Therefore we have to read the line as string 
-	 * first, convert the numbers by replacing the 'D' and then extract the 
-	 * floats using sscanf(). */
-	fpexpftoc(buffer);
-	nr = sscanf(buffer,"%lf %lf %lf", &expon, &coeff1, &coeff2);
-        if (nr<2) {
-          printf("moldenplugin) Bad format in [GTO] section\n");
-          return FALSE;
-        }
-        shell->prim[j].exponent = expon;
-        shell->prim[j].contraction_coeff = coeff1;
-
-        /* P-shell component of SP-shell */
-        if (!strcasecmp(shelltype, "sp")) {
-          if (nr!=3) {
-            printf("moldenplugin) Bad SP-shell format in [GTO] section\n");
-            return FALSE;
-          }
-          shell2->prim[j].exponent = expon;
-          shell2->prim[j].contraction_coeff = coeff2;
-        }
-      }
-
-      /* Update # uncontracted basis functions */
-      data->num_basis_funcs += numprims;
-
-      numshells++;
-
-      /* Account for SP-shells */
-      if (!strcasecmp(shelltype, "sp")) {
-        numshells++;
-        data->num_basis_funcs += numprims;
-      }
-    }
-
-    /* Store # shells for current atom */
-    data->basis_set[i].numshells = numshells;
-
-    /* Update total number of basis functions */
-    data->num_shells += numshells;
-  }
-
-  /* As far as I know in Molden format the basis has
-   * to be specified for each individual atom, even
-   * if the types are the same. */
-  data->num_basis_atoms = data->numatoms;
-
-  /* allocate and populate flat arrays needed for molfileplugin */
-  fill_basis_arrays(data);
-
-  /* Count the number of cartesian basis functions in 
-   * the basis set */
-  data->wavef_size = 0;
-  for (i=0; i<data->num_shells; i++) {
-    switch (data->shell_types[i]) {
-    case S_SHELL:
-    case SP_S_SHELL:
-      data->wavef_size += 1;
-      break;
-    case P_SHELL:
-    case SP_P_SHELL:
-      data->wavef_size += 3;
-      break;
-    case D_SHELL:
-      data->wavef_size += 6;
-      break;
-    case F_SHELL:
-      data->wavef_size += 10;
-      break;
-    case G_SHELL:
-      data->wavef_size += 15;
-      break;
-    }
-  }
-
-  /* If we have MOs in the file we must provide the 
-   * angular momentum exponents.
-   * The order of P, D, F en G functions is as follows:
-
-   *  5D: D 0, D+1, D-1, D+2, D-2
-   *  6D: xx, yy, zz, xy, xz, yz
-
-   *  7F: F 0, F+1, F-1, F+2, F-2, F+3, F-3
-   * 10F: xxx, yyy, zzz, xyy, xxy, xxz, xzz, yzz, yyz, xyz
-
-   *  9G: G 0, G+1, G-1, G+2, G-2, G+3, G-3, G+4, G-4
-   * 15G: xxxx yyyy zzzz xxxy xxxz yyyx yyyz zzzx zzzy,
-   *      xxyy xxzz yyzz xxyz yyxz zzxy
-   */
-  ALLOCATE(data->angular_momentum, int, 3*data->wavef_size);
-
-  j=0;
-  for (i=0; i<data->num_shells; i++) {
-    switch (data->shell_types[i]) {
-    case S_SHELL:
-    case SP_S_SHELL:
-      data->angular_momentum[j  ]=0;
-      data->angular_momentum[j+1]=0;
-      data->angular_momentum[j+2]=0;
-      j += 3;
-      break;
-    case P_SHELL:
-    case SP_P_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j  ], "x");
-      angular_momentum_expon(&data->angular_momentum[j+3], "y");
-      angular_momentum_expon(&data->angular_momentum[j+6], "z");
-      j += 9;
-      break;
-    case D_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j   ], "xx");
-      angular_momentum_expon(&data->angular_momentum[j+3 ], "yy");
-      angular_momentum_expon(&data->angular_momentum[j+6 ], "zz");
-      angular_momentum_expon(&data->angular_momentum[j+9 ], "xy");
-      angular_momentum_expon(&data->angular_momentum[j+12], "xz");
-      angular_momentum_expon(&data->angular_momentum[j+15], "yz");
-      j += 18;
-      break;
-    case F_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j   ], "xxx");
-      angular_momentum_expon(&data->angular_momentum[j+3 ], "yyy");
-      angular_momentum_expon(&data->angular_momentum[j+6 ], "zzz");
-      angular_momentum_expon(&data->angular_momentum[j+9 ], "xyy");
-      angular_momentum_expon(&data->angular_momentum[j+12], "xxy");
-      angular_momentum_expon(&data->angular_momentum[j+15], "xxz");
-      angular_momentum_expon(&data->angular_momentum[j+18], "xzz");
-      angular_momentum_expon(&data->angular_momentum[j+21], "yzz");
-      angular_momentum_expon(&data->angular_momentum[j+24], "yyz");
-      angular_momentum_expon(&data->angular_momentum[j+27], "xyz");
-      j += 30;
-      break;
-    case G_SHELL:
-      angular_momentum_expon(&data->angular_momentum[j   ], "xxxx");
-      angular_momentum_expon(&data->angular_momentum[j+3 ], "yyyy");
-      angular_momentum_expon(&data->angular_momentum[j+6 ], "zzzz");
-      angular_momentum_expon(&data->angular_momentum[j+9 ], "xxxy");
-      angular_momentum_expon(&data->angular_momentum[j+12], "xxxz");
-      angular_momentum_expon(&data->angular_momentum[j+15], "yyyx");
-      angular_momentum_expon(&data->angular_momentum[j+18], "yyyz");
-      angular_momentum_expon(&data->angular_momentum[j+21], "zzzx");
-      angular_momentum_expon(&data->angular_momentum[j+24], "zzzy");
-      angular_momentum_expon(&data->angular_momentum[j+27], "xxyy");
-      angular_momentum_expon(&data->angular_momentum[j+30], "xxzz");
-      angular_momentum_expon(&data->angular_momentum[j+33], "yyzz");
-      angular_momentum_expon(&data->angular_momentum[j+36], "xxyz");
-      angular_momentum_expon(&data->angular_momentum[j+39], "yyxz");
-      angular_momentum_expon(&data->angular_momentum[j+42], "zzxy");
-      j += 45;
-      break;
-    }
-  }
-
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * Populate the flat arrays containing the basis
- * set data.
- *
- ******************************************************/
-static int fill_basis_arrays(qmdata_t *data) {
-  int i, j, k;
-  int shellcount = 0;
-  int primcount = 0;
-
-  float *basis;
-  int *num_shells_per_atom;
-  int *num_prim_per_shell;
-  int *shell_types;
-  int *atomicnum_per_basisatom;
-
-  /* Count the total number of primitives which
-   * determines the size of the basis array. */
-  for(i=0; i<data->num_basis_atoms; i++) {
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      primcount += data->basis_set[i].shell[j].numprims;
-    }
-  }
-  data->num_basis_funcs = primcount;
-
-  /* reserve space for pointer to array containing basis
-   * info, i.e. contraction coeficients and expansion 
-   * coefficients; need 2 entries per basis function, i.e.
-   * exponent and contraction coefficient; also,
-   * allocate space for the array holding the orbital symmetry
-   * information per primitive Gaussian.
-   * Finally, initialize the arrays holding the number of 
-   * shells per atom and the number of primitives per shell*/
-  ALLOCATE(basis,                   float, 2*primcount);
-  ALLOCATE(shell_types,             int,   data->num_shells);
-  ALLOCATE(num_shells_per_atom,     int,   data->num_basis_atoms);
-  ALLOCATE(num_prim_per_shell,      int,   data->num_shells);
-  ALLOCATE(atomicnum_per_basisatom, int,   data->num_basis_atoms);
-
-
-
-  /* store pointers in struct qmdata_t */
-  data->basis = basis;
-  data->shell_types = shell_types;
-  data->num_shells_per_atom = num_shells_per_atom;
-  data->num_prim_per_shell  = num_prim_per_shell;
-  data->atomicnum_per_basisatom = atomicnum_per_basisatom;
-
-  primcount = 0;
-  for (i=0; i<data->num_basis_atoms; i++) {
-    /* assign atomic number */
-    data->basis_set[i].atomicnum = data->atoms[i].atomicnum;
-    atomicnum_per_basisatom[i]   = data->atoms[i].atomicnum;
-
-    num_shells_per_atom[i] = data->basis_set[i].numshells;
-
-    for (j=0; j<data->basis_set[i].numshells; j++) {
-      shell_types[shellcount]        = data->basis_set[i].shell[j].type;
-      num_prim_per_shell[shellcount] = data->basis_set[i].shell[j].numprims;
-
-      for (k=0; k<data->basis_set[i].shell[j].numprims; k++) {
-        basis[2*primcount  ] = data->basis_set[i].shell[j].prim[k].exponent;
-        basis[2*primcount+1] = data->basis_set[i].shell[j].prim[k].contraction_coeff;
-        primcount++;
-      }
-      shellcount++;
-    }
-  } 
-
-  return TRUE;
-}
-
-
-
-/**************************************************
- *
- * Convert shell type from char to int.
- * Note that SP_P shells are assigned in get_basis()
- *
- ************************************************ */
-static int shelltype_int(char *type) {
-  int shelltype;
-  if      (!strcasecmp(type, "sp")) shelltype = SP_SHELL;
-  else if (!strcasecmp(type, "s"))  shelltype = S_SHELL;
-  else if (!strcasecmp(type, "p"))  shelltype = P_SHELL;
-  else if (!strcasecmp(type, "d"))  shelltype = D_SHELL;
-  else if (!strcasecmp(type, "f"))  shelltype = F_SHELL;
-  else if (!strcasecmp(type, "g"))  shelltype = G_SHELL;
-  else shelltype = UNK_SHELL;
-  
-  return shelltype;
-}
-
-
-/***********************************************************
- *
- * Parse through the [MO] section and count orbitals and
- * the number of wavefunction coefficients per orbital.
- *
- * Format example of [MO] section:
- *  [MO]
- *  Sym=   1a         <-- this line is optional
- * Ene=   -15.5764
- *  Spin= Alpha
- * Occup=    2.00000
- *    1        -0.00000435
- *    2         0.00005919
- *    ...
- *
- ***********************************************************/
-static int count_orbitals(qmdata_t *data) {
-  int nr;
-  int num_wave_coeff=0;
-  float orbenergy, occu;
-  char spin[1024];
-  qm_wavefunction_t *wave;
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-  int dummy1;
-  float dummy2;
-
-  /* Place file pointer after [MO] keyword in line containing "Spin". */
-  fseek(data->file, moldendata->filepos_mo, SEEK_SET);
-  if (!goto_keyline(data->file, "Spin=", NULL)) {
-    printf("moldenplugin) Couldn't find keyword 'Spin' in [MO] section!\n");
-    return FALSE;
-  }
- 
-  nr = fscanf(data->file, " Spin= %s\n", spin);
-  eatline(data->file, 1);
-
-  /* The first wavefunction should have spin alpha */
-  strtoupper(spin);
-  if (strcmp(spin, "ALPHA")) return FALSE;
-
-  /* Removed redundant count of num_wave_coeff as this is equivalent to wavef_size */
-  num_wave_coeff = data->wavef_size;
-
-  /* For pruned AOs, with only non-zero coeffs, this is redundant */
-  /*
-  if (data->wavef_size && 
-      data->wavef_size != num_wave_coeff) {
-    printf("moldenplugin) Mismatch between # wavefunction coefficients (%d)\n",
-           num_wave_coeff);
-    printf("moldenplugin) and # cart. basis functions (%d)in basis set!\n", 
-           data->wavef_size);
-    return FALSE;
-  }
-  */
-
-  /* Allocate memory for the qm_timestep frame */
-  data->qm_timestep = (qm_timestep_t *)calloc(1, sizeof(qm_timestep_t));
-
-  /* Add wavefunction for spin alpha */
-  wave = add_wavefunction(data->qm_timestep);
-
-  wave->spin = SPIN_ALPHA;
-  wave->type = MOLFILE_WAVE_UNKNOWN;
-  wave->exci = 0;
-  wave->mult = 1;
-  wave->num_coeffs = num_wave_coeff;
-
-  /* Place file pointer on line after the [MO] keyword. */
-  fseek(data->file, moldendata->filepos_mo, SEEK_SET);
-
-  /* Count MOs */
-  fscanf(data->file, " Ene= %f\n", &orbenergy);
-  fscanf(data->file, " Spin= %s\n", spin);
-  fscanf(data->file, " Occup= %f\n", &occu);
-
-  while (1) {
-    int check_reads = 2;
-    wave->num_orbitals++;
-
-    /* skip over MO coeffs */
-    while(check_reads == 2)
-    {
-      check_reads = fscanf(data->file, "%d %f", &dummy1, &dummy2);
-    }
-
-    nr  = fscanf(data->file, " Ene= %f\n", &orbenergy);
-    nr += fscanf(data->file, " Spin= %s\n", spin);
-    nr += fscanf(data->file, " Occup= %f\n", &occu);
-
-    if (nr!=3 || toupper(spin[0])!='A') 
-      break;
-  }
-  //printf("found %d MOs!\n",wave->num_orbitals);
-
-
-  /* Add wavefunction for spin beta */
-  if (!strcmp(strtoupper(spin), "BETA")) {
-    wave = add_wavefunction(data->qm_timestep);
-    wave->spin = SPIN_BETA;
-    wave->type = MOLFILE_WAVE_UNKNOWN;
-    wave->exci = 0;
-    wave->mult = 1;
-    wave->num_coeffs = num_wave_coeff;
-    wave->num_orbitals = 1;
-
-    while (1) {
-      int check_reads = 2;
-      wave->num_orbitals++;
-
-      /* skip over MO coeffs */
-      while(check_reads == 2)
-      {
-        check_reads = fscanf(data->file, "%d %f", &dummy1, &dummy2);
-      }
-
-      nr  = fscanf(data->file, " Ene= %f\n", &orbenergy);
-      nr += fscanf(data->file, " Spin= %s\n", spin);
-      nr += fscanf(data->file, " Occup= %f\n", &occu);
-
-      if (nr!=3 || toupper(spin[0])!='B' ||
-          wave->num_orbitals>=num_wave_coeff) break;
-    }
-  }
-
-  return TRUE;
-}
-
-
-static int read_molecular_orbitals(qmdata_t *data) {
-  moldendata_t *moldendata = (moldendata_t *)data->format_specific_data;
-  qm_wavefunction_t *wave;
-
-  if (!data->qm_timestep || moldendata->coordsonly) return FALSE;
-
-  /* Place file pointer on line after the [MO] keyword. */
-  fseek(data->file, moldendata->filepos_mo, SEEK_SET);
-
-  wave = &data->qm_timestep->wave[0];
-  ALLOCATE(wave->wave_coeffs, float, wave->num_coeffs*wave->num_orbitals);
-  // DEBUG
-  /*
-  printf("moldenplugin) num_coeffs   = %d\n", wave->num_coeffs);
-  printf("moldenplugin) num_orbitals = %d\n", wave->num_orbitals);
-  printf("moldenplugin) num_wave     = %d\n", data->qm_timestep->numwave);
-  */
-  
-
-  /* Read wavefunction coefficients for spin alpha */
-  if (!read_wave_coeffs(data->file, wave)) return FALSE;
-
-  if (data->qm_timestep->numwave==1) return TRUE;
-
-  /* Read wavefunction coefficients for spin beta */
-  wave = &data->qm_timestep->wave[1];
-  ALLOCATE(wave->wave_coeffs, float, wave->num_coeffs*wave->num_orbitals);
-
-  if (!read_wave_coeffs(data->file, wave)) return FALSE;
-
-  return TRUE;
-}
-
-static int read_wave_coeffs(FILE *file, qm_wavefunction_t *wave) {
-  int i, j, nr;
-  char buffer[1024];
-  int AOid;
-  float wf_coeff;
-  char keystring[10];
-  float *wave_coeffs = wave->wave_coeffs;
-
-  /* This works for pruned and unpruned (all zero coeffs are preserved) MO representaitions.
-   * Clearly this data redundancy should be avoided on systems with a few hundred atoms. */
-
-  /* set all coeffs to zero */
-  for (i=0; i<wave->num_orbitals; i++)
-    for (j=0; j<wave->num_coeffs; j++)
-        wave_coeffs[i*wave->num_coeffs + j] = 0.0;
-
-  /* each molecular orbital must have at least 1 non-zero coeff in its represenation */
-  /* eat Ene= Spin= Occup=  lines */
-  eatline(file, 3);
-  for (i=0; i<wave->num_orbitals; i++) {
-    while(1) {
-      int nr2;
-      if (!fgets(buffer,1024,file)) return FALSE;
-      nr = sscanf(buffer,"%d %f", &AOid, &wf_coeff);
-      wave_coeffs[i*wave->num_coeffs+AOid-1] = wf_coeff;
-      
-      // DEBUG
-      //printf("moldenplugin) %d,%d: %d %f\n", i, AOid-1, AOid, wave_coeffs[i*wave->num_coeffs+AOid-1]);
-      nr2 = sscanf(buffer, "%s", &keystring);
-      if(!strcmp(keystring,"Ene=")||nr2==-1) 
-        break;
-
-      if (nr==0) {
-        printf("moldenplugin) Error reading wavefunction coefficients!\n");
-        return FALSE;
-      }
-    }
-    eatline(file, 2);
-  }
-  return TRUE;
-}
-
-/*************************************************************
- *
- * plugin registration 
- *
- **************************************************************/
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "molden";
-  plugin.prettyname = "Molden";
-  plugin.author = "Markus Dittrich, Jan Saam, Alexey Titov";
-  plugin.majorv = 0;
-  plugin.minorv = 10;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "molden";
-  plugin.open_file_read = open_molden_read;
-  plugin.read_structure = read_molden_structure;
-
-  plugin.read_timestep_metadata    = read_timestep_metadata;
-  plugin.read_timestep             = read_timestep;
-  plugin.read_qm_timestep_metadata = read_qm_timestep_metadata;
-
-  plugin.read_qm_metadata = read_molden_metadata;
-  plugin.read_qm_rundata  = read_molden_rundata;
-
-  plugin.close_file_read = close_molden_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/molemeshplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/molemeshplugin.C
deleted file mode 100644
index be1715c4493632b743d318aea15162738501fd05..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/molemeshplugin.C
+++ /dev/null
@@ -1,331 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: molemeshplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  quadrilaterals are used to represent the geometry. 
- *
- *  ASCII pmesh file from mole 2.0 follows the following format. Files are case 
-insensitive
- *  and whitespace is ignored.
- *
- *  number of vertices        ()
- *  vertex v1x v1y v1z        (<v1> is the first vertex)
- *  vertex v2x v2y v2z        (vertices are given in some order)
- *  vertex v3x v3y v3z        (vertices are given as floating-point values)
- *  vertex v4x v4y v4z        (vertices are given as floating-point values)
- *  number of polygons/faces  
- *  face number               (in groups of 4?)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
- 
-#include "molfile_plugin.h"
-
-typedef struct graphics_list {
-  molfile_graphics_t gItem;
-  struct graphics_list *next;
-} molfile_graphics_list;
-
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} pmesh_t;
-
-static void *open_file_read(const char *filepath, const char *filetype, int *natoms) {
-   FILE *fd;
-   pmesh_t *pmesh;
-
-   fd = fopen(filepath, "rb");
-   if (!fd) {
-     fprintf(stderr, "molemeshplugin) Error opening file.\n");
-     return NULL;
-   }
-   pmesh = new pmesh_t;
-   pmesh->fd = fd;
-   pmesh->graphics = NULL;
-   *natoms = 0;
-   return pmesh;
-} 
-static int read_rawgraphics(void *v, int *nelem, const molfile_graphics_t **data) {
-    molfile_graphics_list *gListPtr=NULL, *tmpPtr=NULL;
-    int i=0, ntriangles=0,j=0;
-    int error=0, numVerts=0, numFacets=0, facetType=0, facet=0, tmpFacet[5];
-    pmesh_t *pmesh = (pmesh_t *)v;
-    FILE *infile = pmesh->fd;
-    char line[81];
-    float **tmpData;
-
-    // Check your head(er)
-    // "number of vertices"
-    fgets(line, 80, infile);
-    sscanf(line, "%d", &numVerts);
-    if (numVerts  < 1) {
-      fprintf(stderr, "molespmeshplugin) error: expected \"Positive Number of Vertices\".\n");
-      error = 1;
-      return MOLFILE_ERROR;
-    } else {
-     gListPtr = new molfile_graphics_list;
-     gListPtr->next = NULL;
-     gListPtr->gItem.type = MOLFILE_TRIANGLE;
-     ntriangles++;
-     tmpPtr = gListPtr;
-   }
-
-//Allocate memory for 2d array.  maybe there is a better way to do this.
-    tmpData = new float*[numVerts];
-    for (int h=0 ; h < numVerts ; h++ ) {
-         tmpData[h] = new float[3];
-    }
-
-//we know how many vertices there are read them all into tmpData[j][i]
-   for ( j=0 ; j < numVerts; j++) {
-// "first loop"
-// scan each vertex vx, vy, vz  
-    i=0;
-    fgets(line, 80, infile);
-    float t1=0.0f, t2=0.0f, t3=0.0f;
-    if ( sscanf(line, "%f %f %f", &t1, &t2, &t3) == 3 ) {
-        tmpData[j][i++] = t1;
-        tmpData[j][i++] = t2;
-        tmpData[j][i++] = t3;
-     } else if(ferror(infile)) {
-       fprintf(stderr, "molespmeshplugin) error: problem reading file\n");
-       error = 1;
-       return MOLFILE_ERROR;
-     }
-   }
-//Read in the total number of facets.  For pmesh files the next number is the total number of triangle or quadrilaterals
-//If triangles, then the next number after the total is a 4, and the next four numbers after that describe the vertex index for
-//each point of the triangle.  If the set begins with a 5 then the next 5 numbers describe the vertex number for
-//each point of the quadrilateral.  So far this reader does not support multiple/concatenated mpesh files yet.
-   fgets(line, 80, infile);
-   sscanf(line, "%d", &numFacets);
-//printf("numFacets %d \n",numFacets);
-   if (numFacets  < 1) {
-      fprintf(stderr, "molespmeshplugin) error: expected \"Positive Number of Facets\".\n");
-      error = 1;
-      return MOLFILE_ERROR;
-    } else {
-     gListPtr = new molfile_graphics_list;
-
-     gListPtr->next = NULL;
-     gListPtr->gItem.type = MOLFILE_TRIANGLE;
-     ntriangles++;
-     tmpPtr = gListPtr;
-   }
-//Read in the facet type 4=triangle 5=quadrilateral. need to do a while loop here, as long as xxxx<numFacets keep reading
-   while ( !feof(infile) && ( error == 0 ) ) {
-     fgets(line, 80, infile);
-     sscanf(line, "%d", &facetType);
-     if (facetType == 4) {
-//printf("facetype %d \n", facetType);
-        int l=0;
-        for (int k=0 ; k < facetType-1; k++) {
-              fgets(line, 80, infile);
-              sscanf(line, "%d", &facet);
-              tmpPtr->gItem.data[l++] = tmpData[facet][0];
-              tmpPtr->gItem.data[l++] = tmpData[facet][1];
-              tmpPtr->gItem.data[l++] = tmpData[facet][2];
-         }
-     fgets(line, 80, infile); //one more read to keep us in sync
-// Create a new list item and initialize it for second triangle.
-         tmpPtr->next = new molfile_graphics_list;
-         tmpPtr = tmpPtr->next;
-         tmpPtr->next = NULL;
-         tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-         ntriangles++;
-     } else if (facetType == 5 ) { 
-                for (int k=0 ; k < facetType-1; k++) {
-                     fgets(line, 80, infile);
-                     sscanf(line, "%d", &facet);
-                     tmpFacet[k]=facet;
-                }
-              
-                tmpPtr->gItem.data[0] = tmpData[tmpFacet[0]][0];
-                tmpPtr->gItem.data[1] = tmpData[tmpFacet[0]][1];
-                tmpPtr->gItem.data[2] = tmpData[tmpFacet[0]][2];
-
-                tmpPtr->gItem.data[3] = tmpData[tmpFacet[1]][0];
-                tmpPtr->gItem.data[4] = tmpData[tmpFacet[1]][1];
-                tmpPtr->gItem.data[5] = tmpData[tmpFacet[1]][2];
-
-                tmpPtr->gItem.data[6] = tmpData[tmpFacet[2]][0];
-                tmpPtr->gItem.data[7] = tmpData[tmpFacet[2]][1];
-                tmpPtr->gItem.data[8] = tmpData[tmpFacet[2]][2];
-
-// Create a new list item and initialize it for second triangle.
-                tmpPtr->next = new molfile_graphics_list;
-                tmpPtr = tmpPtr->next;
-                tmpPtr->next = NULL;
-                tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-                ntriangles++;
-
-                tmpPtr->gItem.data[0] = tmpData[tmpFacet[0]][0];
-                tmpPtr->gItem.data[1] = tmpData[tmpFacet[0]][1];
-                tmpPtr->gItem.data[2] = tmpData[tmpFacet[0]][2];
-
-                tmpPtr->gItem.data[3] = tmpData[tmpFacet[2]][0];
-                tmpPtr->gItem.data[4] = tmpData[tmpFacet[2]][1];
-                tmpPtr->gItem.data[5] = tmpData[tmpFacet[2]][2];
-
-                tmpPtr->gItem.data[6] = tmpData[tmpFacet[3]][0];
-                tmpPtr->gItem.data[7] = tmpData[tmpFacet[3]][1];
-                tmpPtr->gItem.data[8] = tmpData[tmpFacet[3]][2];
-
-// Create a new list item and initialize it for first triangle of the second quadrilateral.
-                tmpPtr->next = new molfile_graphics_list;
-                tmpPtr = tmpPtr->next;
-                tmpPtr->next = NULL;
-                tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-                ntriangles++;
-     } else if ( (facetType != 4 || facetType != 5) && facetType >= 6 ) {
-//Find out if this is a concatenated file by reading the next value and testing for a series of three floats.
-//If so, free tmpData and reallocate according to this number. then read all the vertices into tmpData and do
-//a drop back into the while loop.
-//If not, exit with error.
-         fgets(line, 80, infile);
-         float t1=0.0f, t2=0.0f, t3=0.0f;
-         if ( sscanf(line, "%f %f %f", &t1,&t2,&t3) ==3 ) {
-//free tmpData
-             for (int x=0; x< 3; x++) free(tmpData[x]);
-                  free (tmpData);
-             numVerts=facetType;
-             facetType=0;
-//Allocate new size for vertices array
-             tmpData = new float*[numVerts];
-             for (int h=0 ; h < numVerts ; h++ ) {
-                 tmpData[h] = new float[3];
-             }
-
-//Read in all new vertices after adding the first test vertex
-             tmpData[0][0] = t1;
-             tmpData[0][1] = t2;
-             tmpData[0][2] = t3;
-             for ( j=1 ; j < numVerts; j++) {
-                 i=0;
-                 fgets(line, 80, infile);
-                 float t1=0.0f, t2=0.0f, t3=0.0f;
-                 if ( sscanf(line, "%f %f %f", &t1, &t2, &t3) == 3 ) {
-                    tmpData[j][i++] = t1;
-                    tmpData[j][i++] = t2;
-                    tmpData[j][i++] = t3;
-                 } else if(ferror(infile)) {
-                           fprintf(stderr, "molespmeshplugin) error: problem reading vertices from concatenated file\n");
-                           error = 1;
-                           break;
-                }
-             }
-         } else if ( feof(infile)  ) {
-//end file read gracefully at the last facet
-                    break;
-         } else { fprintf(stderr, "molespmeshplugin) error: problem reading concatenated file?\n");
-                error = 1;
-                break;
-         }
-         fgets(line, 80, infile);
-         sscanf(line, "%d", &numFacets);
-         if (numFacets  < 1) {
-            fprintf(stderr, "molespmeshplugin) error: expected \"Positive Number of Facets\".\n");
-           error = 1;
-         }
-     }
-//go back into the while loop with error=0 so that we can reuse the facet code
-//for additional meshes
-     error = 0;
-    }
-    // If an error occurred, free the linked list and return MOLFILE_ERROR
-    if (error != 0) {
-      while (gListPtr != NULL) {
-        tmpPtr = gListPtr->next;
-        delete gListPtr;
-        gListPtr = tmpPtr;
-      }
-     for (int x=0; x< 3; x++) free(tmpData[x]);
-     free (tmpData);
-      return MOLFILE_ERROR;
-    }
-
-    // Create the array of molfile_graphics_t, and copy the data from the
-    // linked list into it, deleting the list as you go.
-    pmesh->graphics = new molfile_graphics_t[ntriangles-1];
-//    printf("ntriangles %d \n", ntriangles);
-    i = 0;
-    while (gListPtr != NULL) {
-      pmesh->graphics[i] = gListPtr->gItem;
-      tmpPtr = gListPtr->next;
-      delete gListPtr;
-      gListPtr = tmpPtr;
-      i++;
-    }
-
-    *nelem = ntriangles-1;
-    *data = pmesh->graphics;
-     for (int x=0; x< 3; x++) free(tmpData[x]);
-     free(tmpData);
-    return MOLFILE_SUCCESS;
-}
-
-static void close_file_read(void *v) {
-  pmesh_t *pmesh = (pmesh_t *)v;
-  fclose(pmesh->fd);
-  if (pmesh->graphics != NULL)
-    delete [] pmesh->graphics;
-  delete pmesh;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pmesh";
-  plugin.prettyname = "polygon mesh";
-  plugin.author = "Brian Bennion";
-  plugin.minorv = 0;
-  plugin.majorv = 1;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "mesh";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/msmsplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/msmsplugin.C
deleted file mode 100644
index c9c7a439631371ceb38bbb9200ad0ce2630deee5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/msmsplugin.C
+++ /dev/null
@@ -1,251 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: msmsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.13 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Reader for MSMS surface files
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *ffd;
-  FILE *vfd;
-  molfile_graphics_t *graphics;
-} msms_t;
-
-// Get a string from a stream, printing any errors that occur
-static char *msmsgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    return NULL;
-  } else if (ferror(stream)) {
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-  }
-
-  return returnVal;
-}
-
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *ffd; // face file
-  FILE *vfd; // vertex file
-  msms_t *msms;
-  char * facefilepath;
-  char * vertfilepath;
-  char * cp;
-
-  int filenamelen = strlen(filepath);
-  facefilepath = (char *) malloc(filenamelen + 10);
-  vertfilepath = (char *) malloc(filenamelen + 10);
-  strcpy(facefilepath, filepath);
-  strcpy(vertfilepath, filepath);
-
-  // require the MSMS output filenames to match what MSMS does
-  // If the user selected the .face file or the .vert file, we should
-  // be able to cope either way by assigning the right filenames to the
-  // right strings and getting the right files opened accordingly.
-  cp = strstr(facefilepath, ".face");
-  if (cp == NULL) {
-    cp = strstr(facefilepath, ".vert");
-    if (cp != NULL) {
-       strcpy(cp, ".face");
-    } else {
-      printf("msmsplugin) file names don't match expected MSMS output\n");
-      free(facefilepath);
-      free(vertfilepath);
-      return NULL;
-    } 
-  }
-  cp = strstr(vertfilepath, ".vert");
-  if (cp == NULL) {
-    cp = strstr(vertfilepath, ".face");
-    if (cp != NULL) {
-       strcpy(cp, ".vert");
-    } else {
-      printf("msmsplugin) file names don't match expected MSMS output\n");
-      free(facefilepath);
-      free(vertfilepath);
-      return NULL;
-    } 
-  }
- 
-  ffd = fopen(facefilepath, "r");
-  vfd = fopen(vertfilepath, "r");
-  if (!ffd || !vfd) { 
-    printf("msmsplugin) failed to open either the MSMS face or vertex file\n");
-    if (ffd) fclose(ffd);
-    if (vfd) fclose(vfd);
-    free(facefilepath);
-    free(vertfilepath);
-    return NULL;
-  }
-  msms = new msms_t;
-  msms->ffd = ffd;
-  msms->vfd = vfd;
-  msms->graphics = NULL;
-  *natoms = 0;
-  return msms;
-}
-
-static int read_rawgraphics(void *v, int *nelem, 
-    const molfile_graphics_t **data) {
-  msms_t *msms = (msms_t *)v;
-  #define LINESIZE 180
-  char inbuf[LINESIZE];
-  int i, t;
-  float tf=0.0f;
-  int facecount=0;
-  int vertexcount=0;
-
-  //
-  // count number of faces
-  //
-  while (msmsgets(inbuf, LINESIZE, msms->ffd) != NULL) {
-    if (sscanf(inbuf, "%d %d %d %d %d", &t, &t, &t, &t, &t) == 5) 
-      facecount++;
-  }
-  rewind(msms->ffd);
-
-  //
-  // count number of vertices
-  //
-  while (msmsgets(inbuf, LINESIZE, msms->vfd) != NULL) {
-    if (sscanf(inbuf, "%f %f %f %f %f %f %d %d %d", 
-        &tf, &tf, &tf, &tf, &tf, &tf, &t, &t, &t) == 9)
-      vertexcount++;
-  }
-  rewind(msms->vfd);
-
-  // simple sanity check to insure we have at least one usable triangle
-  if (facecount < 1 || vertexcount < 3) 
-    return MOLFILE_ERROR;
-
-  // allocate storage for vertex and normal data
-  float *vertex = new float[3 * vertexcount];
-  float *normal = new float[3 * vertexcount];
-
-  //
-  // read in the vertex data
-  //
-  i=0;
-  while (msmsgets(inbuf, LINESIZE, msms->vfd) != NULL) {
-    int addr = i * 3;
-    int atomid, l0fa, l;
-    
-    if (inbuf[0] != '#') { 
-      if (sscanf(inbuf, "%f %f %f %f %f %f %d %d %d",
-                 &vertex[addr], &vertex[addr+1], &vertex[addr+2], 
-                 &normal[addr], &normal[addr+1], &normal[addr+2], 
-                 &l0fa, &atomid, &l) == 9)
-        i++;
-    }
-  }
- 
-  // allocate the graphics objects, read in the facet data and 
-  // copy the vertex coordinates into triangles as necessary 
-  msms->graphics = new molfile_graphics_t[2*facecount];
-
-  //
-  // read in the facet data
-  //
-  i=0;
-  while (msmsgets(inbuf, LINESIZE, msms->ffd) != NULL) {
-    int v0, v1, v2, surftype, ana;
-
-    if (inbuf[0] != '#') { 
-      // read in the next facet
-      if (sscanf(inbuf, "%d %d %d %d %d", &v0, &v1, &v2, &surftype, &ana) == 5) {
-        // set the graphics object type
-        msms->graphics[2*i    ].type = MOLFILE_TRINORM;  
-        msms->graphics[2*i + 1].type = MOLFILE_NORMS;
-
-        v0--; // convert from 1-based indexing to 0-based indexing
-        v1--;
-        v2--;
-
-        // copy the triangle vertices
-        float *tri = msms->graphics[2*i    ].data;
-        float *nrm = msms->graphics[2*i + 1].data;
-        memcpy(tri  , vertex+(3*v0), 3*sizeof(float)); 
-        memcpy(tri+3, vertex+(3*v1), 3*sizeof(float)); 
-        memcpy(tri+6, vertex+(3*v2), 3*sizeof(float)); 
-        memcpy(nrm  , normal+(3*v0), 3*sizeof(float)); 
-        memcpy(nrm+3, normal+(3*v1), 3*sizeof(float)); 
-        memcpy(nrm+6, normal+(3*v2), 3*sizeof(float)); 
-
-        i++;
-      }
-    }
-  }
-
-  // set the result array pointers
-  *nelem = 2*facecount;
-  *data = msms->graphics;
-
-  // delete work area storage
-  delete [] normal;
-  delete [] vertex;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  msms_t *msms = (msms_t *)v;
-  fclose(msms->ffd);
-  fclose(msms->vfd);
-  delete [] msms->graphics;
-  delete msms;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "msms";
-  plugin.prettyname = "MSMS Surface Mesh";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "face,vert";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/namdbinplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/namdbinplugin.c
deleted file mode 100644
index 8397178c44001209ccc315a81a488b476f7946fc..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/namdbinplugin.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: namdbinplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-
-#include "molfile_plugin.h"
-
-#if INT_MAX == 2147483647
-  typedef int namdbin_int32;
-#elif SHRT_MAX == 2147483647
-  typedef short namdbin_int32;
-#elif LONG_MAX == 2147483647
-  typedef long namdbin_int32;
-#endif
-
-#define BLOCK 500
-
-typedef struct {
-  double xyz[3*BLOCK];
-  FILE *fd;
-  int numatoms;
-  int wrongendian;
-} namdbinhandle;
-
-static void *open_namdbin_read(const char *path, const char *filetype, 
-    int *natoms) {
-  namdbinhandle *namdbin;
-  FILE *fd;
-  int numatoms;
-  namdbin_int32 filen;
-  char lenbuf[4];
-  char tmpc;
-
-  namdbin = (namdbinhandle *)malloc(sizeof(namdbinhandle));
-  if (!namdbin) {
-    fprintf(stderr, "Unable to allocate space for read buffer.\n");
-    return NULL;
-  }
-  memset(namdbin, 0, sizeof(namdbinhandle));
-
-  fd = fopen(path, "rb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file '%s' for reading.\n", path);
-    free(namdbin);
-    return NULL;
-  }
-  fseek(fd,0,SEEK_END);
-  numatoms = (ftell(fd)-4)/24;
-  if (numatoms < 1) {
-    fprintf(stderr, "File '%s' is too short.\n", path);
-    fclose(fd);
-    free(namdbin);
-    return NULL;
-  }
-  fseek(fd,0,SEEK_SET);
-  fread(&filen, sizeof(namdbin_int32), 1, fd);
-  if (filen != numatoms) {
-    namdbin->wrongendian = 1;
-    memcpy(lenbuf, (const char *)&filen, 4);
-    tmpc = lenbuf[0]; lenbuf[0] = lenbuf[3]; lenbuf[3] = tmpc;
-    tmpc = lenbuf[1]; lenbuf[1] = lenbuf[2]; lenbuf[2] = tmpc;
-    memcpy((char *)&filen, lenbuf, 4);
-  }
-  if (filen != numatoms) {
-    fprintf(stderr, "Inconsistent atom count in file '%s'.\n", path);
-    fclose(fd);
-    free(namdbin);
-    return NULL;
-  }
-  if ( namdbin->wrongendian ) {
-    fprintf(stderr, "File '%s' appears to be other-endian.\n", path);
-  }
-  namdbin->fd = fd;
-  namdbin->numatoms = numatoms;
-  *natoms = namdbin->numatoms;
-  return namdbin;
-}
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  namdbinhandle *namdbin;
-  int i, numatoms;
-  char *cdata;
-
-  namdbin = (namdbinhandle *)v;
-  if (!namdbin->fd) 
-    return MOLFILE_ERROR;  /* Done reading frames */
-
-  numatoms = namdbin->numatoms;
-
-  for (i=0; i<namdbin->numatoms; i+=BLOCK) {
-    int j, n;
-    n = namdbin->numatoms - i;
-    if ( n > BLOCK ) n = BLOCK;
-
-    if (fread(namdbin->xyz, sizeof(double), 3*n, namdbin->fd) != (size_t)(3*n)) {
-      fprintf(stderr, "Failure reading data from NAMD binary file.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (namdbin->wrongendian) {
-      if ( ! i ) fprintf(stderr, "Converting other-endian data from NAMD binary file.\n");
-      cdata = (char *) namdbin->xyz;
-      for ( j=0; j<3*n; ++j, cdata+=8 ) {
-        char tmp0, tmp1, tmp2, tmp3;
-        tmp0 = cdata[0]; tmp1 = cdata[1];
-        tmp2 = cdata[2]; tmp3 = cdata[3];
-        cdata[0] = cdata[7]; cdata[1] = cdata[6];
-        cdata[2] = cdata[5]; cdata[3] = cdata[4];
-        cdata[7] = tmp0; cdata[6] = tmp1;
-        cdata[5] = tmp2; cdata[4] = tmp3;
-      }
-    }
-
-    if (ts) {
-      for (j=0; j<n; ++j) {
-        ts->coords[3L*(i+j)  ] = namdbin->xyz[3*j  ];
-        ts->coords[3L*(i+j)+1] = namdbin->xyz[3*j+1];
-        ts->coords[3L*(i+j)+2] = namdbin->xyz[3*j+2];
-      }
-    }
-
-  }
-  /*
-   * Close the file handle and set to NULL so we know we're done reading 
-   */
-  fclose(namdbin->fd);
-  namdbin->fd = NULL;
-
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_file_read(void *v) {
-  namdbinhandle *namdbin = (namdbinhandle *)v;
-  if (namdbin->fd)
-    fclose(namdbin->fd);
-  free(namdbin);
-}
-
-static void *open_namdbin_write(const char *path, const char *filetype, 
-    int natoms) {
-  namdbinhandle *namdbin;
-  FILE *fd;
-
-  namdbin = (namdbinhandle *)malloc(sizeof(namdbinhandle));
-  if (!namdbin) {
-    fprintf(stderr, "Unable to allocate space for write buffer.\n");
-    return NULL;
-  }
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    fprintf(stderr, "Could not open file %s for writing\n", path);
-    free(namdbin);
-    return NULL;
-  }
-
-  namdbin->fd = fd;
-  namdbin->numatoms = natoms;
-  return namdbin;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  
-  int i;
-  namdbin_int32 myint;
-  namdbinhandle *namdbin = (namdbinhandle *)v;
-  
-  if (!namdbin->fd)
-    return MOLFILE_ERROR;
-  
-  myint = (namdbin_int32)namdbin->numatoms;
-  fwrite(&myint, 4, 1, namdbin->fd);
-
-  for (i=0; i<namdbin->numatoms; i+=BLOCK) {
-    double *tmp = namdbin->xyz;
-    int j, n;
-    n = namdbin->numatoms - i;
-    if ( n > BLOCK ) n = BLOCK;
-    for (j=0; j<n; ++j) {
-      tmp[3*j  ] = ts->coords[3L*(i+j)  ];
-      tmp[3*j+1] = ts->coords[3L*(i+j)+1];
-      tmp[3*j+2] = ts->coords[3L*(i+j)+2];
-    }
-    if (fwrite(tmp, sizeof(double), 3*n, namdbin->fd) != 3*n) {
-      fprintf(stderr, "Error writing namd binary file\n");
-      return MOLFILE_ERROR;
-    }
-  }
-  
-  /*
-   * Close and NULLify the file handle so we don't write any more frames.
-   */
-  fclose(namdbin->fd);
-  namdbin->fd = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-       
-static void close_file_write(void *v) {
-  namdbinhandle *namdbin = (namdbinhandle *)v;
-  if (namdbin->fd)
-    fclose(namdbin->fd);
-  free(namdbin);
-}
-
-/*
- * Initialization stuff here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "namdbin";
-  plugin.prettyname = "NAMD Binary Coordinates";
-  plugin.author = "James Phillips, Justin Gullingsrud";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "coor";
-  plugin.open_file_read = open_namdbin_read;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_file_read;
-  plugin.open_file_write = open_namdbin_write;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-  
-#ifdef TEST_NAMDBINPLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_header_t header;
-  molfile_timestep_t timestep;
-  void *v;
-  int i;
-
-  while (--argc) {
-    ++argv; 
-    v = open_namdbin_read(*argv, &header);
-    if (!v) {
-      fprintf(stderr, "open_namdbin_read failed for file %s\n", *argv);
-      return 1;
-    }
-    timestep.coords = (float *)malloc(3*sizeof(float)*header.numatoms);
-    for (i=0; i<header.numsteps; i++) {
-      int rc = read_next_timestep(v, &timestep);
-      if (rc) {
-        fprintf(stderr, "error in read_next_timestep\n");
-        return 1;
-      }
-    }
-    close_file_read(v);
-  }
-  return 0;
-}
- 
-      
-#endif  
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/netcdfplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/netcdfplugin.c
deleted file mode 100644
index 6871d453ea8b10a34d1c5d820b5041d6014cd5c0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/netcdfplugin.c
+++ /dev/null
@@ -1,1140 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: netcdfplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.29 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * NetCDF based trajectories, used by AMBER 9, MMTK, etc.
- */
-
-#include <netcdf.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#define CDF_TYPE_UNKNOWN 0
-#define CDF_TYPE_AMBER   1
-#define CDF_TYPE_MMTK    2
-
-#define CDF_SUCCESS      0
-#define CDF_ERR         -1
-
-typedef struct {
-  int trajectorytype;
-  int step_numberdimid;
-  size_t step_numberdim;
-  int minor_step_numberdimid;
-  size_t minor_step_numberdim;
-  int atom_numberdimid;
-  size_t atom_numberdim;
-  int xyzdimid;
-  size_t xyzdim;
-  int box_size_lengthdimid;
-  size_t box_size_lengthdim;
-  int description_lengthdimid;
-  size_t description_lengthdim;
-  char *description;
-  int description_id;
-  int step_id;
-  int time_id;
-  int box_size_id;
-  int configuration_id;
-  int has_box;
-  char *comment;
-} mmtkdata;
-
-typedef struct {
-  int is_restart;
-  int is_trajectory;
-  int has_box;
-  int atomdimid;
-  size_t atomdim;
-  int spatialdimid;
-  size_t spatialdim;
-  int framedimid;
-  size_t framedim;
-  char *conventionversion;
-  char *title;
-  char *application;
-  char *program;
-  char *programversion;
-  int spatial_id;                  /* "xyz" */
-  int cell_spatial_id;             /* "abc" */
-  int cell_angular_id;             /* "alpha, beta, gamma" */
-  int time_id;                     /* frame time in picoseconds */
-  int coordinates_id;              /* coords in angstroms */
-  char *coordinates_units;         /* coordinates units */
-  float coordinates_scalefactor;   /* coordinates scaling factor */
-  int cell_lengths_id;             /* cell lengths in angstroms */
-  char *cell_lengths_units;        /* cell lengths units */
-  float cell_lengths_scalefactor;  /* cell lengths scaling factor */
-  int cell_angles_id;              /* cell angles in degrees */
-  char *cell_angles_units;         /* cell angles units */
-  float cell_angles_scalefactor;   /* cell angles scaling factor */
-  int velocities_id;               /* velocities in angstroms/picosecond */
-} amberdata;
-
-
-typedef struct {
-  /* sub-format independent data */
-  int ncid;
-  int type;
-  int natoms; 
-  int curframe;
-  char *conventions;
-
-  /* stuff used by AMBER */
-  amberdata amber;
-
-  /* stuff used by MMTK */
-  mmtkdata mmtk;
-
-} cdfdata;
-
-
-static void close_cdf_read(void *mydata) {
-  cdfdata *cdf = (cdfdata *)mydata;
-
-  nc_close(cdf->ncid);
-
-  /* AMBER stuff */
-  if (cdf->amber.title)
-    free(cdf->amber.title);
-
-  if (cdf->amber.application)
-    free(cdf->amber.application);
-
-  if (cdf->amber.program)
-    free(cdf->amber.program);
-
-  if (cdf->amber.programversion)
-    free(cdf->amber.programversion);
-
-  if (cdf->amber.conventionversion)
-    free(cdf->amber.conventionversion);
-
-  if (cdf->amber.coordinates_units)
-    free(cdf->amber.coordinates_units);
-
-  if (cdf->amber.cell_lengths_units)
-    free(cdf->amber.cell_lengths_units);
-
-  /* MMTK stuff */
-  if (cdf->mmtk.comment)
-    free(cdf->mmtk.comment);
-
-  /* format independent stuff */
-  if (cdf->conventions)
-    free(cdf->conventions);
-
-  free(cdf);
-}
-
-
-
-static int open_amber_cdf_read(cdfdata *cdf) {
-  int rc;
-  size_t len; 
-  amberdata *amber = &cdf->amber;
-
-  /* check if this is a restart file or not */
-  if (!strcmp(cdf->conventions, "AMBERRESTART")) {
-    amber->is_restart = 1;
-  } else {
-    amber->is_trajectory = 1;
-  }
-
-  /* global attrib: "ConventionVersion" -- required */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "ConventionVersion", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->conventionversion = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "ConventionVersion", amber->conventionversion);
-    amber->conventionversion[len] = '\0';
-    printf("netcdfplugin) %s follows AMBER conventions version '%s'\n", 
-           (amber->is_restart) ? "restart file" : "trajectory",
-           amber->conventionversion);
-  } else {
-    return CDF_ERR;
-  }
-
-  /* at this point we know that this is an AMBER trajectory or restart file */
-  cdf->type = CDF_TYPE_AMBER;
-
-  /* initialize default scaling factors so they are always set to a sane */
-  /* value even if problems occur later */
-  amber->coordinates_scalefactor = 1.0;
-  amber->cell_lengths_scalefactor = 1.0;
-  amber->cell_angles_scalefactor = 1.0;
-
-  /* global attrib: "program" -- required */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "program", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->program = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "program", amber->program);
-    amber->program[len] = '\0';
-    printf("netcdfplugin) AMBER: program '%s'\n", amber->program);
-  } else {
-    printf("netcdfplugin) AMBER: Missing required 'program' global attribute, corrupt file?\n");
-  }
-
-
-  /* global attrib: "programVersion" -- required */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "programVersion", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->programversion = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "programVersion", amber->programversion);
-    amber->programversion[len] = '\0';
-    printf("netcdfplugin) AMBER: program version '%s'\n", amber->programversion);
-  } else {
-    printf("netcdfplugin) AMBER: Missing required 'programVersion' global attribute, corrupt file?\n");
-  }
-
-
-  /* global attrib: "title" -- optional */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "title", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->title = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "title", amber->title);
-    amber->title[len] = '\0';
-    printf("netcdfplugin) AMBER: title '%s'\n", amber->title);
-  } 
-
-
-  /* global attrib: "application" -- optional */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "application", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->application = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "application", amber->application);
-    amber->application[len] = '\0';
-    printf("netcdfplugin) AMBER: application '%s'\n", amber->application);
-  } 
-
-
-/* XXX lots of additional error checking is needed below... */
-
-  /* read in spatial dimension */
-  rc = nc_inq_dimid(cdf->ncid, "spatial", &amber->spatialdimid);
-  if (rc == NC_NOERR) {    
-    rc = nc_inq_dimlen(cdf->ncid, amber->spatialdimid, &amber->spatialdim);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) AMBER: spatial dimension: %ld\n", (long)amber->spatialdim);
-    } else {
-      printf("netcdfplugin) AMBER: Missing spatial dimension, corrupt file?\n");
-      printf("netcdfplugin) AMBER: Fixing by guessing spatialdim as '3'\n");
-      amber->spatialdim = 3;
-    }
-  } else {
-    printf("netcdfplugin) AMBER: Missing spatial dimension, corrupt file?\n");
-    printf("netcdfplugin) AMBER: Fixing by guessing spatialdim as '3'\n");
-    amber->spatialdim = 3;
-  }
- 
-  /* read in atom dimension */
-  rc = nc_inq_dimid(cdf->ncid, "atom", &amber->atomdimid);
-  if (rc == NC_NOERR) {    
-    rc = nc_inq_dimlen(cdf->ncid, amber->atomdimid, &amber->atomdim);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) AMBER: atom dimension: %ld\n", (long)amber->atomdim);
-      cdf->natoms = amber->atomdim; /* copy to format independent part */
-    } else  {
-      printf("netcdfplugin) AMBER: missing atom dimension, aborting\n");
-      return CDF_ERR;
-    }
-  } else {
-    printf("netcdfplugin) AMBER: missing atom dimension, aborting\n");
-    return CDF_ERR;
-  }
- 
-  /* if this is a trajectory, read in frame dimension */
-  if (amber->is_trajectory) {
-    rc = nc_inq_dimid(cdf->ncid, "frame", &amber->framedimid);
-    if (rc == NC_NOERR) {    
-      rc = nc_inq_dimlen(cdf->ncid, amber->framedimid, &amber->framedim);
-      if (rc == NC_NOERR) {
-        printf("netcdfplugin) AMBER: frame dimension: %ld\n", (long)amber->framedim);
-      } else {
-        printf("netcdfplugin) AMBER: missing frame dimension, aborting\n");
-        return CDF_ERR;
-      }
-    } else {
-      printf("netcdfplugin) AMBER: missing frame dimension, aborting\n");
-      return CDF_ERR;
-    }
-  }
-
-
-  /* 
-   * get ID values for all of the variables we're interested in 
-   */
-#if 0
-  /* VMD can live without the various human readable label variables. */
-  rc = nc_inq_varid(cdf->ncid, "spatial", &amber->spatial_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  rc = nc_inq_varid(cdf->ncid, "cell_spatial", &amber->cell_spatial_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  rc = nc_inq_varid(cdf->ncid, "cell_angular", &amber->cell_angular_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-#endif
-
-  /* VMD requires coordinates at a minimum */
-  rc = nc_inq_varid(cdf->ncid, "coordinates", &amber->coordinates_id);
-  if (rc != NC_NOERR) {
-    printf("netcdfplugin) AMBER: no coordinates variable, nothing to load\n");
-    return CDF_ERR;
-  }
-
-  /* Coordinate units */
-  rc = nc_inq_attlen(cdf->ncid, amber->coordinates_id, "units", &len);
-  if (rc == NC_NOERR && len > 0) {
-    amber->coordinates_units = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, amber->coordinates_id, "units", amber->coordinates_units);
-    amber->coordinates_units[len] = '\0';
-    printf("netcdfplugin) AMBER: coordinates units: '%s'\n", amber->coordinates_units);
-  } else {
-    printf("netcdfplugin) AMBER: no coordinates units attribute, Angstroms assumed\n");
-  }
-
-  /* Coordinate scaling factor to get to Angstroms */
-  if (nc_get_att_float(cdf->ncid, amber->coordinates_id, "scale_factor", &amber->coordinates_scalefactor) != NC_NOERR) {
-    printf("netcdfplugin) AMBER: no coordinates scalefactor attribute, 1.0 assumed\n");
-  }
-  printf("netcdfplugin) AMBER: coordinates scalefactor: %f\n", amber->coordinates_scalefactor);
-
-#if 0
-  /* we don't need velocities at this time */
-  rc = nc_inq_varid(cdf->ncid, "velocities", &amber->velocities_id);
-  if (rc != NC_NOERR) {
-    printf("netcdfplugin) AMBER: missing velocities variable, aborting\n");
-    return CDF_ERR;
-  }
-#endif
-
-  /* optional periodic cell info */
-  rc = nc_inq_varid(cdf->ncid, "cell_lengths", &amber->cell_lengths_id);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_varid(cdf->ncid, "cell_angles", &amber->cell_angles_id);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) AMBER trajectory contains periodic cell information\n");
-      amber->has_box = 1;
-
-      /* Cell lengths units */
-      rc = nc_inq_attlen(cdf->ncid, amber->cell_lengths_id, "units", &len);
-      if (rc == NC_NOERR && len > 0) {
-        amber->cell_lengths_units = (char *) malloc((len+1) * sizeof(char));
-        nc_get_att_text(cdf->ncid, amber->cell_lengths_id, "units", amber->cell_lengths_units);
-        amber->cell_lengths_units[len] = '\0';
-        printf("netcdfplugin) AMBER: cell lengths units: '%s'\n", amber->cell_lengths_units);
-      } else {
-        printf("netcdfplugin) AMBER: no cell lengths units attribute, Angstroms assumed\n");
-      }
-
-      /* Cell lengths scaling factor to get to Angstroms */
-      if (nc_get_att_float(cdf->ncid, amber->cell_lengths_id, "scale_factor", &amber->cell_lengths_scalefactor) != NC_NOERR) {
-        printf("netcdfplugin) AMBER: no cell lengths scalefactor attribute, 1.0 assumed\n");
-      }
-      printf("netcdfplugin) AMBER: cell lengths scalefactor: %f\n", amber->cell_lengths_scalefactor);
-
-      /* Cell angles units */
-      rc = nc_inq_attlen(cdf->ncid, amber->cell_angles_id, "units", &len);
-      if (rc == NC_NOERR && len > 0) {
-        amber->cell_angles_units = (char *) malloc((len+1) * sizeof(char));
-        nc_get_att_text(cdf->ncid, amber->cell_angles_id, "units", amber->cell_angles_units);
-        amber->cell_angles_units[len] = '\0';
-        printf("netcdfplugin) AMBER: cell angles units: '%s'\n", amber->cell_angles_units);
-      } else {
-        printf("netcdfplugin) AMBER: no cell angles units attribute, Degrees assumed\n");
-      }
-
-      /* Cell angles scaling factor to get to degrees */
-      if (nc_get_att_float(cdf->ncid, amber->cell_angles_id, "scale_factor", &amber->cell_angles_scalefactor) != NC_NOERR) {
-        printf("netcdfplugin) AMBER: no cell angles scalefactor attribute, 1.0 assumed\n");
-      }
-      printf("netcdfplugin) AMBER: cell angles scalefactor: %f\n", amber->cell_angles_scalefactor);
-    }
-  }
-
-  return CDF_SUCCESS;
-}
-
-
-static int open_mmtk_cdf_read(cdfdata *cdf, int conventionsknown) {
-  int rc;
-  size_t len; 
-  mmtkdata *mmtk = &cdf->mmtk;
-
-  /* If conventions specify MMTK then we're safe to continue */
-  /* and we know what we're dealing with */
-  if (conventionsknown) {
-    cdf->type = CDF_TYPE_MMTK;
-  }
-
-  /* global attrib: "trajectory_type" (new format) */
-  rc = nc_get_att_int(cdf->ncid, NC_GLOBAL, "trajectory_type", &mmtk->trajectorytype);
-  if (rc == NC_NOERR) {
-    printf("netcdfplugin) MMTK trajectory type: %d\n", mmtk->trajectorytype);
-  } else {
-    printf("netcdfplugin) Assuming MMTK trajectory type: %d\n", mmtk->trajectorytype);
-    mmtk->trajectorytype = 0;
-  }
-
-  /* read in spatial dimension */
-  rc = nc_inq_dimid(cdf->ncid, "xyz", &mmtk->xyzdimid);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->xyzdimid, &mmtk->xyzdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: xyz dimension: %ld\n", (long)mmtk->xyzdim);
-    else 
-      return CDF_ERR;
-  } else {
-    return CDF_ERR;
-  }
-
-  /* read in atom dimension */
-  rc = nc_inq_dimid(cdf->ncid, "atom_number", &mmtk->atom_numberdimid); 
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->atom_numberdimid, &mmtk->atom_numberdim);
-    if (rc == NC_NOERR) {
-      printf("netcdfplugin) MMTK: atom_number dimension: %ld\n", (long)mmtk->atom_numberdim);
-      cdf->natoms = mmtk->atom_numberdim; /* copy to format independent part */
-    } else {
-      return CDF_ERR;
-    }
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* read in frame dimension */
-  rc = nc_inq_dimid(cdf->ncid, "step_number", &mmtk->step_numberdimid);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->step_numberdimid, &mmtk->step_numberdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: step_number dimension: %ld\n", (long)mmtk->step_numberdim);
-    else 
-      return CDF_ERR;
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* read in minor step number dimension */
-  rc = nc_inq_dimid(cdf->ncid, "minor_step_number", &mmtk->minor_step_numberdimid);
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->minor_step_numberdimid, &mmtk->minor_step_numberdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: minor_step_number dimension: %ld\n", (long)mmtk->minor_step_numberdim);
-    else 
-      return CDF_ERR;
-  } else if (rc == NC_EBADDIM) {
-    printf("netcdfplugin) MMTK: no minor_step_number dimension\n");
-    mmtk->minor_step_numberdim = 0;
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* read in description_length dimension */
-  rc = nc_inq_dimid(cdf->ncid, "description_length", &mmtk->description_lengthdimid); 
-  if (rc == NC_NOERR) {
-    rc = nc_inq_dimlen(cdf->ncid, mmtk->description_lengthdimid, &mmtk->description_lengthdim);
-    if (rc == NC_NOERR)
-      printf("netcdfplugin) MMTK: description_length dimension: %ld\n", (long)mmtk->description_lengthdim);
-    else
-      return CDF_ERR;
-  } else {
-    return CDF_ERR;
-  }
-
-
-  /* get ID values for all of the variables we're interested in */
-  rc = nc_inq_varid(cdf->ncid, "configuration", &mmtk->configuration_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  rc = nc_inq_varid(cdf->ncid, "description", &mmtk->description_id);
-  if (rc != NC_NOERR)
-    return CDF_ERR;
-
-  /* check for PBC */
-  rc = nc_inq_varid(cdf->ncid, "box_size", &mmtk->box_size_id);
-  if (rc == NC_NOERR) {
-    mmtk->has_box = 1;
-    printf("netcdfplugin) MMTK: system has periodic boundary conditions\n");
-  }
-  else if (rc == NC_ENOTVAR)
-    mmtk->has_box = 0;
-  else
-    return CDF_ERR;
-
-
-  /* global attrib: "comment" -- optional */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "comment", &len);
-  if (rc == NC_NOERR && len > 0) {
-    mmtk->comment = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "comment", mmtk->comment);
-    mmtk->comment[len] = '\0';
-    printf("netcdfplugin) MMTK: comment '%s'\n", mmtk->comment);
-  } 
-
-  /* at this point we know that this is an MMTK trajectory */
-  if (!conventionsknown) {
-    printf("netcdfplugin) File is an old format MMTK trajectory without conventions\n");    
-    cdf->type = CDF_TYPE_MMTK;
-  }
-
-  return CDF_SUCCESS;
-}
-
- 
-static void *open_cdf_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  int ncid, rc;
-  size_t len;
-  cdfdata *cdf;
- 
-  rc = nc_open(filename, NC_NOWRITE, &ncid);
-  if (rc != NC_NOERR) return NULL;
-
-  cdf = (cdfdata *) malloc(sizeof(cdfdata));
-  memset(cdf, 0, sizeof(cdfdata));
-
-  cdf->ncid = ncid;
-  cdf->type = CDF_TYPE_UNKNOWN;
-
-  /* Determine what NetCDF conventions apply to this data, if any */
-  rc = nc_inq_attlen(cdf->ncid, NC_GLOBAL, "Conventions", &len);
-  if (rc == NC_NOERR && len > 0) {
-    cdf->conventions = (char *) malloc((len+1) * sizeof(char));
-    nc_get_att_text(cdf->ncid, NC_GLOBAL, "Conventions", cdf->conventions);
-    cdf->conventions[len] = '\0';
-    printf("netcdfplugin) conventions: '%s'\n", cdf->conventions);
-  } 
-
-  if (cdf->conventions != NULL) {
-    /* Check if this is a file generated by AMBER */
-    if (strstr(cdf->conventions, "AMBER") != NULL) {
-      if (!open_amber_cdf_read(cdf)) {
-        *natoms = cdf->natoms;
-        return cdf;
-      }
-    } 
-
-    /* Check if this is a file generated by MMTK */
-    if (strstr(cdf->conventions, "MMTK") != NULL) {
-      if (!open_mmtk_cdf_read(cdf, 1)) {
-        *natoms = cdf->natoms;
-        return cdf;
-      }
-    } 
-  } 
-
-  printf("netcdfplugin) Missing or unrecognized conventions attribute\n");
-  printf("netcdfplugin) checking for old format MMTK NetCDF file...\n");
-
-  /* If no conventions are specified, then maybe it's from MMTK */
-  if (!open_mmtk_cdf_read(cdf, 0)) {
-    *natoms = cdf->natoms;
-    return cdf;
-  } 
-
-  /* if no conventions are recognized, then we free everything */
-  /* and return failure                                        */
-  close_cdf_read(cdf);
-
-  return NULL; 
-}
-
-/* A very basic bracket counter. It assumes that the expression
-   is syntactically correct. */
-static char *find_closing_bracket(char *s) {
-  int count = 1;
-  while (*s && count > 0) {
-    if (*s == '(' || *s == '[')
-      count++;
-    if (*s == ')' || *s == ']')
-      count--;
-    s++;
-  }
-  return s;
-}
-
-/* Simple string replacement routine for fixing atom names. */
-static void atom_name_replace(char *name, char *substring, char letter) {
-  char *s = strstr(name, substring);
-  if (s != NULL) {
-    *s = letter;
-    strcpy(s+1, s+strlen(substring));
-  }
-}
-
-static void atom_name_remove_underscores(char *name) {
-  char *s = name;
-  while (1) {
-    s = strchr(s, '_');
-    if (s == NULL)
-      break;
-    strcpy(s, s+1);
-  }
-}
-
-/* Set chainid, resname, and resnum for a range of atoms
-   and fix atom names. */
-static void set_atom_attributes(molfile_atom_t *atoms, int natoms,
-				char **atom_pointers, char chain_id,
-				char *resname, int resnum,
-				char *start, char *end,
-				int name_correction_type) {
-  int i;
-  for (i=0; i<natoms; i++)
-    if (atom_pointers[i] > start && atom_pointers[i] < end) {
-      molfile_atom_t *atom = atoms + i;
-      atom->chain[0] = chain_id;      
-      atom->chain[1] = '\0';      
-      strcpy(atom->resname, resname);
-      atom->resid = resnum;
-      if (name_correction_type == 1 /* proteins */) {
-	atom_name_replace(atom->name, "_alpha", 'A');
-	atom_name_replace(atom->name, "_beta", 'B');
-	atom_name_replace(atom->name, "_gamma", 'G');
-	atom_name_replace(atom->name, "_delta", 'D');
-	atom_name_replace(atom->name, "_epsilon", 'E');
-	atom_name_replace(atom->name, "_zeta", 'Z');
-	atom_name_replace(atom->name, "_eta", 'H');
-	atom_name_remove_underscores(atom->name);
-      }
-      else if (name_correction_type == 2 /* nucleic acids */) {
-	if (strcmp(atom->name, "O_1") == 0)
-	  strcpy(atom->name, "O1P");
-	else if (strcmp(atom->name, "O_2") == 0)
-	  strcpy(atom->name, "O2P");
-	else if (strcmp(atom->name, "C_1") == 0)
-	  strcpy(atom->name, "C1'");
-	else if (strcmp(atom->name, "C_2") == 0)
-	  strcpy(atom->name, "C2'");
-	else if (strcmp(atom->name, "C_3") == 0)
-	  strcpy(atom->name, "C3'");
-	else if (strcmp(atom->name, "O_3") == 0)
-	  strcpy(atom->name, "O3'");
-	else if (strcmp(atom->name, "C_4") == 0)
-	  strcpy(atom->name, "C4'");
-	else if (strcmp(atom->name, "O_4") == 0)
-	  strcpy(atom->name, "O4'");
-	else if (strcmp(atom->name, "C_5") == 0)
-	  strcpy(atom->name, "C5'");
-	else if (strcmp(atom->name, "O_5") == 0)
-	  strcpy(atom->name, "O5'");
-	else
-	  atom_name_remove_underscores(atom->name);
-      }
-    }
-}
-
-/* Get structure from an MMTK trajectory file */
-static int read_mmtk_cdf_structure(void *mydata, int *optflags,
-                                   molfile_atom_t *atoms) {
-  int i, rc;
-  molfile_atom_t *atom;
-  cdfdata *cdf = (cdfdata *) mydata;
-  mmtkdata *mmtk = &cdf->mmtk;
-  size_t start[3], count[3];
-  char *dstr;
-  char **atom_pointers;
-  int resnum;
-  char resname[8];
-
-  *optflags = MOLFILE_NOOPTIONS;
-
-  mmtk->description = (char *) malloc((mmtk->description_lengthdim + 1) * sizeof(char));
-  if (mmtk->description == NULL) 
-    return MOLFILE_ERROR;
-
-  start[0] = cdf->curframe; /* frame */
-  count[0] = mmtk->description_lengthdim;
-
-  rc = nc_get_vara_text(cdf->ncid, mmtk->description_id,
-                        start, count, mmtk->description);
-  if (rc != NC_NOERR)
-    return MOLFILE_ERROR;
-
-  /* initialize all atoms with name "X" to start with */
-  /* indicating unknown atom types etc..              */
-  for (i=0; i<cdf->natoms; i++) {
-    atom = atoms + i;
-    strncpy(atom->name, "X", sizeof(atom->name)-1);
-    atom->name[sizeof(atom->name)-1] = '\0';
-    strncpy(atom->type, atom->name, sizeof(atom->type)-1);
-    atom->type[sizeof(atom->type)-1] = '\0';
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  /* Allocate a pointer array that will hold each atom's location in
-     the description string. This will be used in a second pass through
-     the description string in which residue names and indices will
-     be assigned. */
-  atom_pointers = (char **) malloc(cdf->natoms * sizeof(char *));
-  if (atom_pointers == NULL)
-    return MOLFILE_ERROR;
-
-  /* First pass: look only at atoms */
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *atomstr;
-    atomstr = strstr(dstr, "A('");
-
-    if (atomstr != NULL) {
-      char name[1024];
-      char *nmstart = NULL;
-      char *nmend = NULL;
-      char *indstart = NULL;
-      char *endp = NULL;
-      int index, len;
-
-      endp = strchr(atomstr, ')');
-      nmstart = strchr(atomstr, '\'');
-      if (nmstart != NULL)
-        nmend = strchr(nmstart+1, '\'');
-      indstart = strchr(atomstr, ',');
-      if (endp == NULL || nmstart == NULL || nmend == NULL || indstart == NULL) {
-        printf("netcdfplugin) mmtk_read_structure(): unable to parse atom tag\n");
-        break; /* something went wrong */
-      }
-
-      len = nmend - nmstart - 1;
-      if (len > sizeof(name)) {
-        printf("netcdfplugin) mmtk_read_structure(): bad length: %d\n", len);
-        break; /* something went wrong */
-      }
-      memcpy(name, nmstart+1, len); 
-      name[len] = '\0';
-
-      index = -1;
-      sscanf(indstart, ",%d)", &index);
-      atom_pointers[index] = atomstr;
-
-      if (index >= 0 && index < cdf->natoms) {
-        atom = atoms + index;
-        strncpy(atom->name, name, sizeof(atom->name)-1);
-        atom->name[sizeof(atom->name)-1] = '\0';
-        strncpy(atom->type, atom->name, sizeof(atom->type)-1);
-        atom->type[sizeof(atom->type)-1] = '\0';
-      }
-
-      dstr = atomstr+1;
-    } else {
-      break; /* no more atom records found */
-    }
-  }
-
-  /* Second pass: peptide chains */
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *peptide, *pend;
-    char *group, *gend;
-    char *nmstart, *nmend;
-    char chain_id = 'A';
-    char *s;
-
-    peptide = strstr(dstr, "S('");
-    if (peptide == NULL)
-      break;
-    pend = find_closing_bracket(peptide+2);
-
-    resnum = 1;
-    group = peptide;
-    while (1) {
-      group = strstr(group, "G('");
-      if (group == NULL || group >= pend)
-	break;
-      gend = find_closing_bracket(group+2);
-      nmstart = strchr(group, '\'') + 1;
-      nmend = strchr(nmstart, '\'');
-      while (nmend > nmstart && isdigit(*(nmend-1)))
-	nmend--;
-      if (nmend-nmstart > 7)
-	nmend = nmstart+7;
-      strncpy(resname, nmstart, nmend-nmstart);
-      resname[nmend-nmstart] = '\0';
-      s = resname;
-      while (*s) {
-	*s = toupper(*s);
-	s++;
-      }
-      set_atom_attributes(atoms, cdf->natoms, atom_pointers,
-			  chain_id, resname, resnum, group, gend, 1);
-      group = gend;
-      resnum++;
-    }
-
-    if (chain_id == 'Z')
-      chain_id = 'A';
-    else
-	chain_id++;
-    dstr = pend;
-  }
-
-  /* Third pass: nucleic acid chains */
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *nacid, *nend;
-    char *group, *gend;
-    char *nmstart, *nmend;
-    char chain_id = 'a';
-    char *s;
-
-    nacid = strstr(dstr, "N('");
-    if (nacid == NULL)
-      break;
-    nend = find_closing_bracket(nacid+2);
-
-    resnum = 1;
-    group = nacid;
-    while (1) {
-      group = strstr(group, "G('");
-      if (group == NULL || group >= nend)
-	break;
-      gend = find_closing_bracket(group+2);
-      nmstart = strchr(group, '\'') + 1;
-      nmend = strchr(nmstart, '\'');
-      while (nmend > nmstart && isdigit(*(nmend-1)))
-	nmend--;
-      if (nmend > nmstart && nmend[-1] == '_')
-	nmend--;
-      if (nmend-nmstart > 7)
-	nmend = nmstart+7;
-      strncpy(resname, nmstart, nmend-nmstart);
-      resname[nmend-nmstart] = '\0';
-      s = resname;
-      while (*s) {
-	*s = toupper(*s);
-	s++;
-      }
-      if (resname[0] == 'R' || resname[0] == 'D') {
-	switch (resname[1]) {
-	case 'A':
-	  strcpy(resname, "ADE");
-	  break;
-	case 'C':
-	  strcpy(resname, "CYT");
-	  break;
-	case 'G':
-	  strcpy(resname, "GUA");
-	  break;
-	case 'T':
-	  strcpy(resname, "THY");
-	  break;
-	case 'U':
-	  strcpy(resname, "URA");
-	  break;
-	}
-      }
-      set_atom_attributes(atoms, cdf->natoms, atom_pointers,
-			  chain_id, resname, resnum, group, gend, 2);
-      group = gend;
-      resnum++;
-    }
-
-    if (chain_id == 'z')
-      chain_id = 'a';
-    else
-	chain_id++;
-    dstr = nend;
-  }
-
-  /* Fourth pass: non-chain molecules */
-  resnum = 1;
-  dstr = mmtk->description;
-  while (dstr < (mmtk->description + mmtk->description_lengthdim)) {
-    char *molecule, *mend;
-    char *nmstart, *nmend;
-
-    molecule = strstr(dstr, "M('");
-    if (molecule == NULL)
-      break;
-    mend = find_closing_bracket(molecule+2);
-    nmstart = strchr(molecule, '\'') + 1;
-    nmend = strchr(nmstart, '\'');
-    if (strncmp(nmstart, "water", 5) == 0)
-      strcpy(resname, "HOH");
-    else {
-      if (nmend-nmstart > 7)
-	nmend = nmstart+7;
-      strncpy(resname, nmstart, nmend-nmstart);
-      resname[nmend-nmstart] = '\0';
-    }
-    set_atom_attributes(atoms, cdf->natoms, atom_pointers,
-			'_', resname, resnum, molecule, mend, 0);
-    resnum++;
-    dstr = mend;
-  }
-
-  free(atom_pointers);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_cdf_structure(void *mydata, int *optflags,
-                                   molfile_atom_t *atoms) {
-  cdfdata *cdf = (cdfdata *)mydata;
-
-  switch (cdf->type) {
-    case CDF_TYPE_AMBER:
-      return MOLFILE_NOSTRUCTUREDATA; /* not an error, just no data */
-
-    case CDF_TYPE_MMTK:
-      return read_mmtk_cdf_structure(mydata, optflags, atoms);
-  }
-
-  return MOLFILE_ERROR;
-}
-
-
-static int read_amber_cdf_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  size_t start[3], count[3];
-  cdfdata *cdf = (cdfdata *)mydata;
-  amberdata *amber = &cdf->amber;
-  int rc;
-
-  /* Read in the atom coordinates and unit cell information */
-  /* only save coords if we're given a valid ts pointer     */ 
-  /* otherwise VMD wants us to skip it.                     */
-  if (ts != NULL) {
-    if (amber->is_restart) {
-      // restart files only contain one frame, so return if we get called again
-      if (cdf->curframe > 0)
-        return MOLFILE_ERROR;
-
-      start[0] = 0;             /* atom */
-      start[1] = 0;             /* spatial */
-      start[2] = 0;
-
-      count[0] = amber->atomdim;
-      count[1] = amber->spatialdim;
-      count[2] = 0;
-
-      rc = nc_get_vara_float(cdf->ncid, amber->coordinates_id, 
-                             start, count, ts->coords);
-      if (rc != NC_NOERR) { 
-        printf("netcdfplugin) AMBER: failed to parse restart file coordinates!\n");
-      }
-    } else {
-      start[0] = cdf->curframe; /* frame */
-      start[1] = 0;             /* atom */
-      start[2] = 0;             /* spatial */
-
-      count[0] = 1;
-      count[1] = amber->atomdim;
-      count[2] = amber->spatialdim;
-
-      /* parse trajectory timestep */
-      rc = nc_get_vara_float(cdf->ncid, amber->coordinates_id, 
-                             start, count, ts->coords);
-    }
-
-    if (rc != NC_NOERR) 
-      return MOLFILE_ERROR;
-
-    /* apply coordinate scaling factor if not 1.0 */
-    if (amber->coordinates_scalefactor != 1.0) {
-      int i;
-      float s = amber->coordinates_scalefactor;
-      for (i=0; i<natoms*3; i++) {
-        ts->coords[i] *= s;
-      }
-    }
-
-    /* Read the PBC box info. */
-    if (amber->has_box) {
-      size_t start[3], count[3];
-      double lengths[3];
-      double angles[3];
-
-      if (amber->is_restart) {
-        start[0] = 0;             /* spatial */
-        start[1] = 0;
-        start[2] = 0;
-        count[0] = amber->spatialdim;
-        count[1] = 0;
-        count[2] = 0;
-      } else {
-        start[0] = cdf->curframe; /* frame */
-        start[1] = 0;             /* spatial */
-        start[2] = 0;
-        count[0] = 1;
-        count[1] = amber->spatialdim;
-        count[2] = 0;
-      }
-
-      rc = nc_get_vara_double(cdf->ncid, amber->cell_lengths_id, 
-                              start, count, lengths);
-      if (rc != NC_NOERR) 
-        return MOLFILE_ERROR;
-
-      rc = nc_get_vara_double(cdf->ncid, amber->cell_angles_id, 
-                              start, count, angles);
-      if (rc != NC_NOERR) 
-        return MOLFILE_ERROR;
-
-      ts->A = lengths[0] * amber->cell_lengths_scalefactor;
-      ts->B = lengths[1] * amber->cell_lengths_scalefactor;
-      ts->C = lengths[2] * amber->cell_lengths_scalefactor;
-
-      ts->alpha = angles[0] * amber->cell_angles_scalefactor;
-      ts->beta  = angles[1] * amber->cell_angles_scalefactor;
-      ts->gamma = angles[2] * amber->cell_angles_scalefactor;
-    }
-  }
-
-  cdf->curframe++;
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_mmtk_cdf_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  cdfdata *cdf = (cdfdata *)mydata;
-  mmtkdata *mmtk = &cdf->mmtk;
-  int rc;
-
-  /* Read in the atom coordinates and unit cell information */
-  /* only save coords if we're given a valid ts pointer     */ 
-  /* otherwise VMD wants us to skip it.                     */
-  if (ts != NULL) {
-    size_t start[4], count[4];
-    int i;
-
-    if (mmtk->minor_step_numberdim == 0) {
-      start[0] = cdf->curframe; /* step */
-      start[1] = 0;             /* atom */
-      start[2] = 0;             /* spatial */
-      start[3] = 0;             /* minor step */
-    }
-    else {
-      start[0] = cdf->curframe/mmtk->minor_step_numberdim;   /* step */
-      start[1] = 0;             /* atom */
-      start[2] = 0;             /* spatial */
-      start[3] = cdf->curframe % mmtk->minor_step_numberdim; /* minor step */
-    }
-
-    count[0] = 1;
-    count[1] = mmtk->atom_numberdim;
-    count[2] = mmtk->xyzdim;
-    count[3] = 1;             /* only want one minor step, regardless */
-
-    rc = nc_get_vara_float(cdf->ncid, mmtk->configuration_id, 
-                           start, count, ts->coords);
-    if (rc != NC_NOERR) 
-      return MOLFILE_ERROR;
-
-    /* check for allocated but not yet used frame */
-    if (ts->coords[0] == NC_FILL_FLOAT)
-      return MOLFILE_ERROR;
-
-    /* scale coordinates from nanometers to angstroms */
-    for (i=0; i<(3 * mmtk->atom_numberdim); i++) {
-      ts->coords[i] *= 10.0f;
-    }
-
-    /* Read the PBC box info. */
-    if (mmtk->has_box) {
-      float lengths[3];
-
-      if (mmtk->minor_step_numberdim == 0) {
-	start[0] = cdf->curframe; /* step */
-	start[1] = 0;             /* box_size */
-	start[2] = 0;             /* minor step */
-      }
-      else {
-	start[0] = cdf->curframe/mmtk->minor_step_numberdim;   /* step */
-	start[1] = 0;             /* box_size */
-	start[2] = cdf->curframe % mmtk->minor_step_numberdim; /* minor step */
-      }
-
-      count[0] = 1;
-      count[1] = 3;
-      count[2] = 1;
-
-      rc = nc_get_vara_float(cdf->ncid, mmtk->box_size_id,
-                             start, count, lengths);
-      if (rc != NC_NOERR) 
-        return MOLFILE_ERROR;
-
-      ts->A = 10.*lengths[0];
-      ts->B = 10.*lengths[1];
-      ts->C = 10.*lengths[2];
-
-      ts->alpha = 90.;
-      ts->beta  = 90.;
-      ts->gamma = 90.;
-    }
-  }
-
-  cdf->curframe++;
-  return MOLFILE_SUCCESS;
-}
-
-
-
-static int read_cdf_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  cdfdata *cdf = (cdfdata *)mydata;
-
-  switch (cdf->type) {
-    case CDF_TYPE_AMBER: 
-      return read_amber_cdf_timestep(mydata, natoms, ts); 
-
-    case CDF_TYPE_MMTK:
-      return read_mmtk_cdf_timestep(mydata, natoms, ts); 
-  }
-
-  return MOLFILE_ERROR;
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "netcdf";
-  plugin.prettyname = "NetCDF (AMBER, MMTK)";
-  plugin.author = "Konrad Hinsen, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 1;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "nc,ncrst";
-  plugin.open_file_read = open_cdf_read;
-  plugin.read_structure = read_cdf_structure;
-  plugin.read_next_timestep = read_cdf_timestep;
-  plugin.close_file_read = close_cdf_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/offplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/offplugin.C
deleted file mode 100644
index a14ccc04746f290eb8eba7b4dec7649baac53bab..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/offplugin.C
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- *  Object File Format (.off)
- *
- *  Represent surfaces composed of polygons. It is documented there:
- *  http://people.sc.fsu.edu/~jburkardt/data/off/off.html
- *  http://shape.cs.princeton.edu/benchmark/documentation/off_format.html
- *
- *  Contributed by Francois-Xavier Coudert (fxcoudert@gmail.com)
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#include "molfile_plugin.h"
-
-// internal buffer size used in read_rawgraphics()
-#define BUFFLEN 1024
-
-static void *open_file_read(const char *filepath, const char *filetype,
-                            int *natoms) {
-  FILE *f;
-  
-  f = fopen(filepath, "rb");
-  if (!f) {
-    fprintf(stderr, "offplugin) Error opening file.\n");
-    return NULL;
-  }
-  *natoms = 0;
-  return f;
-}
-
-
-static char *nextNoncommentLine(char *buff, int bufflen, FILE *f) {
-  while (1) {
-    char *res = fgets(buff, bufflen, f);
-    if (!res || (res[0] != '#' && res[0] != '\n' && res[0] != '\r'))
-      return res;
-  };
-}
-
-
-static void calcNormals (float vert[9], float norm[9]) {
-  float x1 = vert[3] - vert[0];
-  float y1 = vert[4] - vert[1];
-  float z1 = vert[5] - vert[2];
-  float x2 = vert[6] - vert[0];
-  float y2 = vert[7] - vert[1];
-  float z2 = vert[8] - vert[2];
-  float nx = y1 * z2 - z1 * y2;
-  float ny = z1 * x2 - x1 * z2;
-  float nz = x1 * y2 - y1 * x2;
-  float n = 1 / sqrtf(nx*nx+ny*ny+nz*nz);
-  norm[0] = norm[3] = norm[6] = n * nx;
-  norm[1] = norm[4] = norm[7] = n * ny;
-  norm[2] = norm[5] = norm[8] = n * nz;
-}
-
-
-static int read_rawgraphics(void *v, int *nelem, 
-                            const molfile_graphics_t **data) {
-  int i, k, n;
-  int nVert, nFaces, nEdges;
-  float *vertices = NULL, *vertColors = NULL;
-  char *vertHasColor = NULL;
-  molfile_graphics_t *graphics = NULL;
-  int j=0;
-
-  char buff[BUFFLEN+1];
-  FILE *infile = (FILE *)v;
-
-  // First line is the header: "OFF"
-  nextNoncommentLine(buff, BUFFLEN, infile);
-  if (buff[0] != 'O' || buff[1] != 'F' || buff[2] != 'F') {
-    fprintf(stderr, "offplugin) error: expected \"OFF\" header.\n");
-    goto error;
-  }
-
-  // Second line: numVertices numFaces numEdges
-  nextNoncommentLine(buff, BUFFLEN, infile);
-  if (sscanf (buff, " %d %d %d", &nVert, &nFaces, &nEdges) < 2 || 
-      nVert <= 0 || nFaces <= 0) {
-    fprintf(stderr, "offplugin) error: wrong number of elements.\n");
-    goto error;
-  }
-
-  // Read vertices
-  vertices = (float *) calloc (3 * nVert, sizeof(float));
-  vertHasColor = (char *) calloc (nVert, sizeof(char));
-  vertColors = (float *) calloc (3 * nVert, sizeof(float));
-  for (i = 0; i < nVert; i++) {
-    nextNoncommentLine(buff, BUFFLEN, infile);
-    int n = sscanf (buff, " %g %g %g %g %g %g", 
-                    &vertices[3*i], &vertices[3*i+1], &vertices[3*i+2],
-                    &vertColors[3*i], &vertColors[3*i+1], &vertColors[3*i+2]);
-    if (n != 3 && n != 6) {
-      fprintf(stderr, "offplugin) error: not enough data.\n");
-      goto error;
-    }
-    vertHasColor[i] = (n == 6);
-  }
-
-  // Read faces
-  // We alloc 6 times the memory because:
-  //   -- a quadrangle will be transformed into two triangles.
-  //   -- each triangle may have color, and then also its norm will be specified
-  graphics = (molfile_graphics_t *) calloc(6*nFaces, sizeof(molfile_graphics_t));
-  n = 0;
-  for (i = 0; i < nFaces; i++) {
-    int idx[4];
-    float c[3];
-    nextNoncommentLine(buff, BUFFLEN, infile);
-
-    if (sscanf (buff, "%d", &k) != 1 || k < 3) {
-      fprintf(stderr, "offplugin) error: not enough data.\n");
-      goto error;
-    }
-
-    if (k > 4) {
-      // TODO -- handle polygon decomposition into triangles
-      // Follow the algorithm there:
-      // http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml
-      fprintf(stderr, "offplugin) error: TODO -- handling polygons with more than 4 vertices.\n");
-      goto error;
-    }
-
-    if (k == 3) {
-      j = sscanf (buff, "%d %d %d %d %g %g %g", &k, &idx[0], &idx[1], &idx[2], &c[0], &c[1], &c[2]);
-      bool hasColor = ((j == 7) || (vertHasColor[idx[0]] && vertHasColor[idx[1]] && vertHasColor[idx[2]]));
-
-      graphics[n].type = (hasColor ? MOLFILE_TRICOLOR : MOLFILE_TRIANGLE);
-      graphics[n].data[0] = vertices[3*idx[0]  ];
-      graphics[n].data[1] = vertices[3*idx[0]+1];
-      graphics[n].data[2] = vertices[3*idx[0]+2];
-      graphics[n].data[3] = vertices[3*idx[1]  ];
-      graphics[n].data[4] = vertices[3*idx[1]+1];
-      graphics[n].data[5] = vertices[3*idx[1]+2];
-      graphics[n].data[6] = vertices[3*idx[2]  ];
-      graphics[n].data[7] = vertices[3*idx[2]+1];
-      graphics[n].data[8] = vertices[3*idx[2]+2];
-      n++;
-
-      if (j == 7) {
-        // The facet has a specific color, use it.
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = graphics[n].data[3] = graphics[n].data[6] = c[0];
-        graphics[n].data[1] = graphics[n].data[4] = graphics[n].data[7] = c[1];
-        graphics[n].data[2] = graphics[n].data[5] = graphics[n].data[8] = c[2];
-        n++;
-      } else if (hasColor) {
-        // All three vertices have a color attribute
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = vertColors[3*idx[0]  ];
-        graphics[n].data[1] = vertColors[3*idx[0]+1];
-        graphics[n].data[2] = vertColors[3*idx[0]+2];
-        graphics[n].data[3] = vertColors[3*idx[1]  ];
-        graphics[n].data[4] = vertColors[3*idx[1]+1];
-        graphics[n].data[5] = vertColors[3*idx[1]+2];
-        graphics[n].data[6] = vertColors[3*idx[2]  ];
-        graphics[n].data[7] = vertColors[3*idx[2]+1];
-        graphics[n].data[8] = vertColors[3*idx[2]+2];
-        n++;
-      }
-    } else if (k == 4) {
-      j = sscanf (buff, "%d %d %d %d %d %g %g %g", &k, &idx[0], &idx[1], &idx[2], &idx[3], &c[0], &c[1], &c[2]);
-      bool hasColor = ((j == 8) || (vertHasColor[idx[0]] && vertHasColor[idx[1]] && vertHasColor[idx[2]] && vertHasColor[idx[3]]));
-
-      // Split a quadrangle into two triangles
-      graphics[n].type = (hasColor ? MOLFILE_TRICOLOR : MOLFILE_TRIANGLE);
-      graphics[n].data[0] = vertices[3*idx[0]  ];
-      graphics[n].data[1] = vertices[3*idx[0]+1];
-      graphics[n].data[2] = vertices[3*idx[0]+2];
-      graphics[n].data[3] = vertices[3*idx[1]  ];
-      graphics[n].data[4] = vertices[3*idx[1]+1];
-      graphics[n].data[5] = vertices[3*idx[1]+2];
-      graphics[n].data[6] = vertices[3*idx[2]  ];
-      graphics[n].data[7] = vertices[3*idx[2]+1];
-      graphics[n].data[8] = vertices[3*idx[2]+2];
-      n++;
-
-      if (j == 8) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-      
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = graphics[n].data[3] = graphics[n].data[6] = c[0];
-        graphics[n].data[1] = graphics[n].data[4] = graphics[n].data[7] = c[1];
-        graphics[n].data[2] = graphics[n].data[5] = graphics[n].data[8] = c[2];
-        n++;
-      } else if (hasColor) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = vertColors[3*idx[0]];
-        graphics[n].data[1] = vertColors[3*idx[0]+1];
-        graphics[n].data[2] = vertColors[3*idx[0]+2];
-        graphics[n].data[3] = vertColors[3*idx[1]];
-        graphics[n].data[4] = vertColors[3*idx[1]+1];
-        graphics[n].data[5] = vertColors[3*idx[1]+2];
-        graphics[n].data[6] = vertColors[3*idx[2]];
-        graphics[n].data[7] = vertColors[3*idx[2]+1];
-        graphics[n].data[8] = vertColors[3*idx[2]+2];
-        n++;
-      }
-
-      graphics[n].type = (hasColor ? MOLFILE_TRICOLOR : MOLFILE_TRIANGLE);
-      graphics[n].data[0] = vertices[3*idx[2]];
-      graphics[n].data[1] = vertices[3*idx[2]+1];
-      graphics[n].data[2] = vertices[3*idx[2]+2];
-      graphics[n].data[3] = vertices[3*idx[3]];
-      graphics[n].data[4] = vertices[3*idx[3]+1];
-      graphics[n].data[5] = vertices[3*idx[3]+2];
-      graphics[n].data[6] = vertices[3*idx[0]];
-      graphics[n].data[7] = vertices[3*idx[0]+1];
-      graphics[n].data[8] = vertices[3*idx[0]+2];
-      n++;
-
-      if (j == 8) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = graphics[n].data[3] = graphics[n].data[6] = c[0];
-        graphics[n].data[1] = graphics[n].data[4] = graphics[n].data[7] = c[1];
-        graphics[n].data[2] = graphics[n].data[5] = graphics[n].data[8] = c[2];
-        n++;
-      } else if (hasColor) {
-        graphics[n].type = MOLFILE_NORMS;
-        calcNormals (graphics[n-1].data, graphics[n].data);
-        n++;
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = vertColors[3*idx[2]];
-        graphics[n].data[1] = vertColors[3*idx[2]+1];
-        graphics[n].data[2] = vertColors[3*idx[2]+2];
-        graphics[n].data[3] = vertColors[3*idx[3]];
-        graphics[n].data[4] = vertColors[3*idx[3]+1];
-        graphics[n].data[5] = vertColors[3*idx[3]+2];
-        graphics[n].data[6] = vertColors[3*idx[0]];
-        graphics[n].data[7] = vertColors[3*idx[0]+1];
-        graphics[n].data[8] = vertColors[3*idx[0]+2];
-        n++;
-      }
-    }
-  }
-
-  *nelem = n;
-  *data = (molfile_graphics_t *) realloc(graphics, n*sizeof(molfile_graphics_t));
-  return MOLFILE_SUCCESS;
-
-  // goto jump target for disaster handling: free memory and bail out
-  error:
-    free (graphics);
-    free (vertices);
-    return MOLFILE_ERROR;
-}
-
-
-static void close_file_read(void *v) {
-  fclose((FILE *)v);
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "off";
-  plugin.prettyname = "Object File Format (OFF)";
-  plugin.author = "Francois-Xavier Coudert";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "off";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/parm7plugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/parm7plugin.C
deleted file mode 100644
index 67a72f9040f81bb9a26574c183cabd820d2686f3..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/parm7plugin.C
+++ /dev/null
@@ -1,174 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: parm7plugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <string.h>
-#include "molfile_plugin.h"
-#include "ReadPARM7.h"
-
-typedef struct {
-  parmstruct *prm;
-  int popn;
-  FILE *fd;
-  int nbonds;
-  int *from, *to;
-} parmdata;
-
-static void *open_parm7_read(const char *filename, const char *,int *natoms) {
-  FILE *fd;
-  int popn = 0;
-  if(!(fd = open_parm7_file(filename, &popn))) {
-    fprintf(stderr, "parm7plugin) Cannot open parm file '%s'\n", filename);
-    return NULL;
-  }
-  parmstruct *prm = read_parm7_header(fd);
-  if (!prm) {
-    close_parm7_file(fd, popn);
-    return NULL; 
-  }
-
-  *natoms = prm->Natom;
-  parmdata *p = new parmdata;
-  memset(p, 0, sizeof(parmdata));
-  p->prm = prm;
-  p->popn = popn;
-  p->fd = fd;
-  p->from = new int[prm->Nbonh + prm->Nbona];
-  p->to   = new int[prm->Nbonh + prm->Nbona];
-  return p;
-}
-
-static int read_parm7_structure(void *mydata, int *optflags, molfile_atom_t *atoms) {
-  parmdata *p = (parmdata *)mydata;
-  const parmstruct *prm = p->prm;
-  FILE *file = p->fd;
-  char buf[85];
-  char field[85];
-  char *resnames = NULL;
-
-  *optflags = MOLFILE_NOOPTIONS; /* no optional data to start with */
-
-  while (fgets(buf, 85, file)) {
-    // find the next line starting with %FLAG, indicating a new section
-    if (strncmp(buf, "%FLAG ", 6)) 
-      continue;
-    sscanf(buf+6, "%s\n", field); // type of record
-
-    // skip any number of lines until we get to "FORMAT". This handles
-    // the %COMMENT lines that may or may not be present
-    while (strncmp(buf, "%FORMAT", 7)) {
-        fgets(buf, 85, file);
-    }
-
-    if (!strcmp(field, "ATOM_NAME")) {
-      if (!parse_parm7_atoms(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "CHARGE")) {
-      *optflags |= MOLFILE_CHARGE;
-      if (!parse_parm7_charge(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "MASS")) {
-      *optflags |= MOLFILE_MASS;
-      if (!parse_parm7_mass(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "AMBER_ATOM_TYPE")) {
-      if (!parse_parm7_atype(buf, prm->Natom, atoms, file)) break;
-    } else if (!strcmp(field, "RESIDUE_LABEL")) {
-      resnames = new char[4*prm->Nres];
-      if (!parse_parm7_resnames(buf, prm->Nres, resnames, file)) break;
-    } else if (!strcmp(field, "RESIDUE_POINTER")) {
-      if (!resnames) {
-        fprintf(stderr, 
-            "parm7plugin) Cannot parse RESIDUE_POINTER before RESIDUE_LABEL\n");
-        continue;
-      }
-      if (!parse_parm7_respointers(buf, prm->Natom, atoms, 
-                                   prm->Nres, resnames, file)) 
-        break;
-      // XXX: we could count the bonded parameters and assign bond types.
-    } else if (!strcmp(field, "BONDS_WITHOUT_HYDROGEN")) {
-      if (!parse_parm7_bonds(buf, prm->Nbona, p->from+p->nbonds,
-            p->to+p->nbonds, file)) break;
-      p->nbonds += prm->Nbona;
-    } else if (!strcmp(field, "BONDS_INC_HYDROGEN")) {
-      if (!parse_parm7_bonds(buf, prm->Nbonh, p->from+p->nbonds,
-            p->to+p->nbonds, file)) break;
-      p->nbonds += prm->Nbonh;
-    }
-  }
-
-  // unused items
-  for (int i=0; i<prm->Natom; i++) {
-    atoms[i].chain[0] = '\0';
-    atoms[i].segid[0] = '\0';
-  }
-
-  delete [] resnames;
-  return MOLFILE_SUCCESS;
-}
-
-static int read_parm7_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                            float **bondorderptr, int **bondtype, 
-                            int *nbondtypes, char ***bondtypename){
-  parmdata *p = (parmdata *)v;
-  *nbonds = p->nbonds;
-  *fromptr = p->from;
-  *toptr = p->to;
-  *bondorderptr = NULL; // parm files don't contain bond order information
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-  return MOLFILE_SUCCESS;
-}
-
-static void close_parm7_read(void *mydata) {
-  parmdata *p = (parmdata *)mydata;
-  close_parm7_file(p->fd, p->popn);
-  delete p->prm;
-  delete [] p->from;
-  delete [] p->to;
-  delete p;
-}
- 
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(){
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "parm7";
-  plugin.prettyname = "AMBER7 Parm";
-  plugin.author = "Brian Bennion, Justin Gullingsrud, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 15;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "prmtop,parm7";
-  plugin.open_file_read = open_parm7_read;
-  plugin.read_structure = read_parm7_structure;
-  plugin.read_bonds = read_parm7_bonds;
-  plugin.close_file_read = close_parm7_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v,(vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(){
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/parmplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/parmplugin.C
deleted file mode 100644
index 777e15379e1e9f15bbf7beadfc539a4d2294581a..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/parmplugin.C
+++ /dev/null
@@ -1,147 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: parmplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.35 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <string.h>
-#include "ReadPARM.h"
-#include "molfile_plugin.h"
-
-typedef struct {
-  ReadPARM *rp;
-  FILE *parm;
-  int natoms;
-  int *from, *to;
-} parmdata;
-
-static void *open_parm_read(const char *filename, const char *, 
-    int *natoms) {
- 
-  FILE *parm;
-  ReadPARM *rp = new ReadPARM;
-  if(!(parm = rp->open_parm_file(filename))) {
-    fprintf(stderr, "parmplugin) Cannot open parm file '%s'\n", filename);
-    delete rp;
-    return NULL;
-  }
-  
-  if (rp->readparm(parm) != 0) {
-    delete rp;
-    // XXX should we call close_parm_file???
-    return NULL; 
-  }
-  *natoms = rp->get_parm_natoms();
-  
-  parmdata *p = new parmdata;
-  memset(p, 0, sizeof(parmdata));
-  p->rp = rp;
-  p->parm = parm;
-  p->natoms = *natoms;
-  return p;
-}
-
-static int read_parm_structure(void *mydata, int *optflags,
-    molfile_atom_t *atoms) {
-  
-  parmdata *p = (parmdata *)mydata;
-  ReadPARM *rp = p->rp;
-  rp->get_parm_boxInfo();
-  int i;
- 
-  *optflags = MOLFILE_CHARGE | MOLFILE_MASS;
-
-  for (i=0; i<p->natoms; i++) {
-    molfile_atom_t *atom = atoms+i;
-    // XXX Why isn't there a return code for error on read????
-    rp->get_parm_atom(i, atom->name, atom->type, atom->resname, atom->segid, 
-        &atom->resid, &atom->charge, &atom->mass);
-    atom->chain[0] = '\0';
-  }
-  // XXX amber box info not supported in the API
-  return MOLFILE_SUCCESS;
-}
-
-static int read_parm_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                           float **bondorderptr,  int **bondtype, 
-                           int *nbondtypes, char ***bondtypename) {
-  parmdata *p = (parmdata *)v;
-  ReadPARM *rp = p->rp;
-  int i, j;
-  int numbonds = rp->get_parm_nbonds();
-  p->from = (int *)malloc(numbonds*sizeof(int));
-  p->to = (int *)malloc(numbonds*sizeof(int));
-  j = 0;
-  for (i=0; i<numbonds; i++) {
-    int a1, a2;
-    rp->get_parm_bond(i, (&a1)-i, (&a2)-i);
-    if ( a1 <= p->natoms && a2 <= p->natoms) {
-      p->from[j] = a1;
-      p->to[j] = a2;
-      j++;
-    } else {
-      printf("parmplugin) skipping bond (%d %d)\n", a1, a2); 
-    }
-  }
-  *nbonds = j;
-  *fromptr = p->from;
-  *toptr = p->to;
-  *bondorderptr = NULL; // PARM files don't have bond order information
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_parm_read(void *mydata) {
-  parmdata *p = (parmdata *)mydata;
-  p->rp->close_parm_file(p->parm);
-  if (p->from) free(p->from);
-  if (p->to) free(p->to);
-  delete p->rp;
-}
- 
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "parm";
-  plugin.prettyname = "AMBER Parm";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 4;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "parm";
-  plugin.open_file_read = open_parm_read;
-  plugin.read_structure = read_parm_structure;
-  plugin.read_bonds = read_parm_bonds;
-  plugin.close_file_read = close_parm_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return 0;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pbeqplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pbeqplugin.C
deleted file mode 100644
index 1e540ae862f1938e5ea684f9fb7b22957acc8452..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pbeqplugin.C
+++ /dev/null
@@ -1,328 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pbeqplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * "unformatted" binary potential map, created by CHARMM PBEQ module
- *
- * Format (fortran): 
- *      INTEGER UNIT
- *      INTEGER NCLX,NCLY,NCLZ
- *      REAL*8  DCEL
- *      REAL*8  XBCEN,YBCEN,ZBCEN,EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
- *      REAL*4  PHI(*)
- *C
- *C     Local variable
- *      INTEGER I
- *
- *      WRITE(UNIT) NCLX,NCLY,NCLZ,DCEL,XBCEN,YBCEN,ZBCEN
- *      WRITE(UNIT) EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
- *      WRITE(UNIT)(PHI(I),I=1,NCLX*NCLY*NCLZ)
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int ndata;
-  int nclx;
-  int ncly;
-  int nclz;
-  int swap;
-  molfile_volumetric_t *vol;
-} pbeq_t;
-
-
-static void *open_pbeq_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  pbeq_t *pbeq;
-  int nclx, ncly, nclz;
-  int trash, length;
-  double dcel; 
-  double xbcen, ybcen, zbcen;
-  double epsw, epsp, conc, tmemb, zmemb, epsm;
-  int swap=0; 
-
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    printf("pbeqplugin) Error opening file %s.\n", filepath);
-    return NULL;
-  }
-
-  // skip first Fortran length record for
-  // WRITE(UNIT) NCLX,NCLY,NCLZ,DCEL,XBCEN,YBCEN,ZBCEN
-  if (fread(&length, 4, 1, fd) != 1)
-    return NULL;
-
-  if (fread(&nclx, 4, 1, fd) != 1)
-    return NULL;
-  if (fread(&ncly, 4, 1, fd) != 1)
-    return NULL;
-  if (fread(&nclz, 4, 1, fd) != 1)
-    return NULL;
-
-  // test endianness first
-  if (length != 44) {
-    swap = 1;
-    swap4_aligned(&length, 1);
-    if (length != 44) {
-      printf("pbeqplugin) length record != 44, unrecognized format (length: %d)\n", length);
-      return NULL;
-    }
-  }
-
-  if (swap) {
-    swap4_aligned(&nclx, 1);
-    swap4_aligned(&ncly, 1);
-    swap4_aligned(&nclz, 1);
-  } 
-
-  // this is a risky strategy for detecting endianness, 
-  // but it works so far, and the charmm potential maps don't
-  // have version numbers, magic numbers, or anything else that we
-  // might otherwise use for this purpose.
-  if ((nclx > 4000 && ncly > 4000 && nclz > 4000) ||
-      (nclx * ncly * nclz < 0)) {
-    printf("pbeqplugin) inconclusive byte ordering, bailing out\n");
-    return NULL;
-  }
-
-  // read the rest of the header
-  if (fread(&dcel, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&xbcen, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&ybcen, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&zbcen, 8, 1, fd) != 1) 
-    return NULL;
-
-  // skip second Fortran length record for
-  // WRITE(UNIT) NCLX,NCLY,NCLZ,DCEL,XBCEN,YBCEN,ZBCEN
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  // skip first Fortran length record for 
-  // WRITE(UNIT) EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  if (fread(&epsw, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&epsp, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&conc, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&tmemb, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&zmemb, 8, 1, fd) != 1) 
-    return NULL;
-  if (fread(&epsm, 8, 1, fd) != 1) 
-    return NULL;
-
-  // skip second Fortran length record for 
-  // WRITE(UNIT) EPSW,EPSP,CONC,TMEMB,ZMEMB,EPSM
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  // byte swap the header data if necessary
-  if (swap) {
-    swap8_aligned(&dcel, 1);
-    swap8_aligned(&xbcen, 1);
-    swap8_aligned(&ybcen, 1);
-    swap8_aligned(&zbcen, 1);
-    swap8_aligned(&epsw, 1);
-    swap8_aligned(&epsp, 1);
-    swap8_aligned(&conc, 1);
-    swap8_aligned(&tmemb, 1);
-    swap8_aligned(&zmemb, 1);
-    swap8_aligned(&epsm, 1);
-  }
-
-#if 0
-  // print header info for debugging of early versions
-  printf("pbeqplugin) nclx:%d nxly:%d nclz:%d\n", nclx, ncly, nclz);
-  printf("pbeqplugin) dcel: %f\n", dcel); 
-  printf("pbeqplugin) x/y/zbcen: %g %g %g\n", xbcen, ybcen, zbcen); 
-  printf("pbeqplugin) epsw/p: %g %g  conc: %g  tmemb: %g zmemb: %g  epsm: %g\n",
-         epsw, epsp, conc, tmemb, zmemb, epsm);
-#endif
-
-  /* Allocate and initialize the pbeq structure */
-  pbeq = new pbeq_t;
-  pbeq->fd = fd;
-  pbeq->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  pbeq->nsets = 1; /* this file contains only one data set */
-  pbeq->ndata = nclx*ncly*nclz;
-  pbeq->nclx = nclx;
-  pbeq->ncly = ncly;
-  pbeq->nclz = nclz;
-  pbeq->swap = swap;
-
-  pbeq->vol = new molfile_volumetric_t[1];
-  strcpy(pbeq->vol[0].dataname, "CHARMM PBEQ Potential Map");
-
-  pbeq->vol[0].origin[0] = -0.5*((nclx-1) * dcel) + xbcen;
-  pbeq->vol[0].origin[1] = -0.5*((ncly-1) * dcel) + ybcen;
-  pbeq->vol[0].origin[2] = -0.5*((nclz-1) * dcel) + zbcen;
-
-  // print origin info, for debuggin of early versions
-  printf("pbeqplugin) box LL origin: %g %g %g\n", 
-         pbeq->vol[0].origin[0],
-         pbeq->vol[0].origin[1],
-         pbeq->vol[0].origin[2]);
-
-  pbeq->vol[0].xaxis[0] = (nclx-1) * dcel;
-  pbeq->vol[0].xaxis[1] = 0;
-  pbeq->vol[0].xaxis[2] = 0;
-
-  pbeq->vol[0].yaxis[0] = 0;
-  pbeq->vol[0].yaxis[1] = (ncly-1) * dcel;
-  pbeq->vol[0].yaxis[2] = 0;
-
-  pbeq->vol[0].zaxis[0] = 0;
-  pbeq->vol[0].zaxis[1] = 0;
-  pbeq->vol[0].zaxis[2] = (nclz-1) * dcel;
-
-  pbeq->vol[0].xsize = nclx;
-  pbeq->vol[0].ysize = ncly;
-  pbeq->vol[0].zsize = nclz;
-
-  pbeq->vol[0].has_color = 0;
-
-  return pbeq;
-}
-
-static int read_pbeq_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  pbeq_t *pbeq = (pbeq_t *)v;
-  *nsets = pbeq->nsets; 
-  *metadata = pbeq->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_pbeq_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  pbeq_t *pbeq = (pbeq_t *)v;
-  int ndata = pbeq->ndata;
-  int nclx = pbeq->nclx;
-  int ncly = pbeq->ncly;
-  int nclz = pbeq->nclz;
-  FILE *fd = pbeq->fd;
-  int trash;
-
-  // skip first Fortran length record for 
-  // WRITE(UNIT)(PHI(I),I=1,NCLX*NCLY*NCLZ)
-  if (fread(&trash, 4, 1, fd) != 1)
-    return MOLFILE_ERROR;
-
-  /* Read the densities. Order for file is z fast, y medium, x slow */
-  int x, y, z;
-  int count=0;
-  for (x=0; x<nclx; x++) {
-    for (y=0; y<ncly; y++) {
-      for (z=0; z<nclz; z++) {
-        int addr = z*nclx*ncly + y*nclx + x;
-        if (fread(datablock + addr, 4, 1, fd) != 1) {
-          printf("pbeqplugin) Error reading potential map cell: %d,%d,%d\n", x, y, z);
-          printf("pbeqplugin) offset: %d\n", (int) ftell(fd));
-          return MOLFILE_ERROR;
-        }
-        count++;
-      }
-    }
-  }
-
-
-#if 0
-  // skip last Fortran length record for 
-  // WRITE(UNIT)(PHI(I),I=1,NCLX*NCLY*NCLZ)
-  if (fread(&trash, 4, 1, fd) != 1)
-    return NULL;
-
-  // print debugging info for early versions
-  printf("pbeqplugin) read %d phi values from block\n", count);
-  for (x=0; x<1000000; x++) {
-    int trash;
-    if (fread(&trash, 4, 1, fd) != 1) {
-      printf("pbeqplugin) read %d extra phi values past the end of the block\n", x);
-      break;
-    }
-  }   
-#endif
-
-  if (pbeq->swap) {
-    swap4_aligned(datablock, ndata);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pbeq_read(void *v) {
-  pbeq_t *pbeq = (pbeq_t *)v;
-
-  fclose(pbeq->fd);
-  if (pbeq->vol != NULL)
-    delete [] pbeq->vol; 
-  delete pbeq;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) { 
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pbeq";
-  plugin.prettyname = "CHARMM PBEQ Binary Potential Map";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "pbeq, phi80";
-  plugin.open_file_read = open_pbeq_read;
-  plugin.read_volumetric_metadata = read_pbeq_metadata;
-  plugin.read_volumetric_data = read_pbeq_data;
-  plugin.close_file_read = close_pbeq_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pdbplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pdbplugin.c
deleted file mode 100644
index 18cd9fbcc82ef71c5922fae02dd27bf8de91cf1e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pdbplugin.c
+++ /dev/null
@@ -1,604 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pdbplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.73 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * PDB file format specifications:
- *   http://www.rcsb.org/pdb/static.do?p=file_formats/pdb/index.html
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include "molfile_plugin.h"
-#include "readpdb.h"
-#include "periodic_table.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * API functions start here
- */
-
-typedef struct {
-  FILE *fd;
-  int first_frame;
-  int natoms;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-  int nconect;
-  int nbonds, maxbnum;
-  int *from, *to, *idxmap;
-} pdbdata;
-
-static void *open_pdb_read(const char *filepath, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  pdbdata *pdb;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx, nconect;
-
-  fd = fopen(filepath, "r");
-  if (!fd) 
-    return NULL;
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->fd = fd;
-  pdb->meta = (molfile_metadata_t *) malloc(sizeof(molfile_metadata_t));
-  memset(pdb->meta, 0, sizeof(molfile_metadata_t));
-
-  pdb->meta->remarklen = 0;
-  pdb->meta->remarks = NULL;
-
-  *natoms=0;
-  nconect=0;
-  do {
-    indx = read_pdb_record(pdb->fd, pdbstr);
-    if (indx == PDB_ATOM) {
-      *natoms += 1;
-    } else if (indx == PDB_CONECT) {
-      nconect++;
-    } else if (indx == PDB_HEADER) {
-      get_pdb_header(pdbstr, pdb->meta->accession, pdb->meta->date, NULL);
-      if (strlen(pdb->meta->accession) > 0) 
-        strcpy(pdb->meta->database, "PDB");
-    } else if (indx == PDB_REMARK || indx == PDB_CONECT || indx == PDB_UNKNOWN) {
-      int len=strlen(pdbstr);
-      int newlen = len + pdb->meta->remarklen;
-
-      char *newstr=realloc(pdb->meta->remarks, newlen + 1);
-      if (newstr != NULL) {
-        pdb->meta->remarks = newstr;
-        pdb->meta->remarks[pdb->meta->remarklen] = '\0';
-        memcpy(pdb->meta->remarks + pdb->meta->remarklen, pdbstr, len);
-        pdb->meta->remarks[newlen] = '\0';
-        pdb->meta->remarklen = newlen;
-      }
-    }
- 
-  } while (indx != PDB_END && indx != PDB_EOF);
-
-  /* If no atoms were found, this is probably not a PDB file! */
-  if (!*natoms) {
-    fprintf(stderr, "PDB file '%s' contains no atoms.\n", filepath);
-    if (pdb->meta->remarks != NULL)
-      free(pdb->meta->remarks);
-    if (pdb->meta != NULL)
-      free(pdb->meta);
-    free(pdb);
-    return NULL;
-  }
-
-  rewind(pdb->fd); /* if ok, rewind file and prepare to parse it for real */
-  pdb->natoms = *natoms;
-  pdb->nconect = nconect;
-  pdb->nbonds = 0;
-  pdb->maxbnum = 0;
-  pdb->from = NULL;
-  pdb->to = NULL;
-  pdb->idxmap = NULL;
-  pdb->atomlist = NULL;
-
-#if defined(VMDUSECONECTRECORDS)
-  /* allocate atom index translation table if we have 99,999 atoms or less */
-  /* and we have conect records to process                                 */
-  if (pdb->natoms < 100000 && pdb->nconect > 0) {
-    pdb->idxmap = (int *) malloc(100000 * sizeof(int));
-    memset(pdb->idxmap, 0, 100000 * sizeof(int));
-  }
-#endif
- 
-  return pdb; 
-}
-
-static int read_pdb_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) { 
-  pdbdata *pdb = (pdbdata *)mydata;
-  molfile_atom_t *atom;
-  char pdbrec[PDB_BUFFER_LENGTH];
-  int i, rectype, atomserial, pteidx;
-  char ridstr[8];
-  char elementsymbol[3];
-  int badptecount = 0;
-  long fpos = ftell(pdb->fd);
-
-  *optflags = MOLFILE_INSERTION | MOLFILE_OCCUPANCY | MOLFILE_BFACTOR |
-              MOLFILE_ALTLOC | MOLFILE_ATOMICNUMBER | MOLFILE_BONDSSPECIAL;
-
-  i = 0;
-  do {
-    rectype = read_pdb_record(pdb->fd, pdbrec);
-    switch (rectype) {
-    case PDB_ATOM:
-      atom = atoms+i;
-      get_pdb_fields(pdbrec, strlen(pdbrec), &atomserial, 
-          atom->name, atom->resname, atom->chain, atom->segid, 
-          ridstr, atom->insertion, atom->altloc, elementsymbol,
-          NULL, NULL, NULL, &atom->occupancy, &atom->bfactor);
-
-      if (pdb->idxmap != NULL && atomserial < 100000) {
-        pdb->idxmap[atomserial] = i; /* record new serial number translation */ 
-      }
- 
-      atom->resid = atoi(ridstr);
-
-      /* determine atomic number from the element symbol */
-      pteidx = get_pte_idx_from_string(elementsymbol);
-      atom->atomicnumber = pteidx;
-      if (pteidx != 0) {
-        atom->mass = get_pte_mass(pteidx);
-        atom->radius = get_pte_vdw_radius(pteidx);
-      } else {
-        badptecount++; /* unrecognized element */
-      }
- 
-      strcpy(atom->type, atom->name);
-      i++;
-      break;
-
-    case PDB_CONECT:
-      /* only read CONECT records for structures where we know they can */
-      /* be valid for all of the atoms in the structure                 */
-      if (pdb->idxmap != NULL) {
-        get_pdb_conect(pdbrec, pdb->natoms, pdb->idxmap, 
-                       &pdb->maxbnum, &pdb->nbonds, &pdb->from, &pdb->to);
-      }
-      break;
-
-    default:
-      /* other record types are ignored in the structure callback */
-      /* and are dealt with in the timestep callback or elsewhere */
-      break;
-    }
-  } while (rectype != PDB_END && rectype != PDB_EOF);
-
-  fseek(pdb->fd, fpos, SEEK_SET);
-
-  /* if all atoms are recognized, set the mass and radius flags too,  */
-  /* otherwise let VMD guess these for itself using it's own methods  */
-  if (badptecount == 0) {
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                      float ** bondorder,int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  pdbdata *pdb = (pdbdata *)v;
-  
-  *nbonds = 0;
-  *fromptr = NULL;
-  *toptr = NULL;
-  *bondorder = NULL; /* PDB files don't have bond order information */
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-/* The newest plugin API allows us to return CONECT records as 
- * additional bonds above and beyond what the distance search returns.
- * Without that feature, we otherwise have to check completeness and
- * ignore them if they don't look to be fully specified for this molecule */
-#if !defined(MOLFILE_BONDSSPECIAL)
-  if (pdb->natoms >= 100000) {
-    printf("pdbplugin) Warning: more than 99,999 atoms, ignored CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (((float) pdb->nconect / (float) pdb->natoms) <= 0.85) {
-    printf("pdbplugin) Warning: Probable incomplete bond structure specified,\n");
-    printf("pdbplugin)          ignoring CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (pdb->nconect == 0) {
-    return MOLFILE_SUCCESS;
-  }
-#endif
-
-  *nbonds = pdb->nbonds;
-  *fromptr = pdb->from;
-  *toptr = pdb->to;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/* 
- * 
- */
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v;
-  char pdbstr[PDB_BUFFER_LENGTH];
-  int indx, i;
-  float *x, *y, *z;
-  float occup, bfac;
-  if (pdb->natoms == 0) 
-    return MOLFILE_ERROR; /* EOF */
-  if (ts) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = 0;
-  } 
-  i = 0;
-  do {
-    indx = read_pdb_record(pdb->fd, pdbstr);
-    if((indx == PDB_END || indx == PDB_EOF) && (i < pdb->natoms)) {
-      return MOLFILE_ERROR;
-    } else if(indx == PDB_ATOM) {
-      if(i++ >= pdb->natoms) {
-        break;      
-      }
-      /* just get the coordinates, and store them */
-      if (ts) {
-        get_pdb_coordinates(pdbstr, x, y, z, &occup, &bfac);
-        x += 3;
-        y += 3;
-        z += 3;
-      } 
-    } else if (indx == PDB_CRYST1) {
-      if (ts) {
-        get_pdb_cryst1(pdbstr, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    }
-  } while(!(indx == PDB_END || indx == PDB_EOF));
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pdb_read(void *v) { 
-  pdbdata *pdb = (pdbdata *)v;
-  if (pdb->fd != NULL)
-    fclose(pdb->fd);
-  if (pdb->idxmap != NULL)
-    free(pdb->idxmap);
-  if (pdb->meta->remarks != NULL)
-    free(pdb->meta->remarks);
-  if (pdb->meta != NULL) 
-    free(pdb->meta);
-  free(pdb);
-}
-
-static void *open_file_write(const char *path, const char *filetype, 
-    int natoms) {
-
-  FILE *fd;
-  pdbdata *pdb;
-  fd = fopen(path, "w");
-  if (!fd) {
-    fprintf(stderr, "Unable to open file %s for writing\n", path);
-    return NULL;
-  }
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->fd = fd;
-  pdb->natoms = natoms; 
-  pdb->atomlist = NULL;
-  pdb->first_frame = 1;
-  return pdb;
-}
- 
-static int write_structure(void *v, int optflags, 
-    const molfile_atom_t *atoms) {
-
-  int i;
-  pdbdata *pdb = (pdbdata *)v;
-  int natoms = pdb->natoms;
-  pdb->atomlist = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-  memcpy(pdb->atomlist, atoms, natoms*sizeof(molfile_atom_t));
-
-  /* If occ, bfactor, and insertion aren't given, we assign defaultvalues. */
-  if (!(optflags & MOLFILE_OCCUPANCY)) {
-    for (i=0; i<natoms; i++) pdb->atomlist[i].occupancy = 0.0f;
-  }
-  if (!(optflags & MOLFILE_BFACTOR)) {
-    for (i=0; i<natoms; i++) pdb->atomlist[i].bfactor= 0.0f;
-  }
-  if (!(optflags & MOLFILE_INSERTION)) {
-    for (i=0; i<natoms; i++) {
-      pdb->atomlist[i].insertion[0] =' ';
-      pdb->atomlist[i].insertion[1] ='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ALTLOC)) {
-    for (i=0; i<natoms; i++) {
-      pdb->atomlist[i].altloc[0]=' ';
-      pdb->atomlist[i].altloc[1]='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ATOMICNUMBER)) {
-    for (i=0; i<natoms; i++) pdb->atomlist[i].atomicnumber = 0;
-  }
-
-  /* TODO: put bonds into CONECT records? */
-  return MOLFILE_SUCCESS;
-}
-
-/* SEQRES records look like this:
-
-COLUMNS        DATA TYPE       FIELD         DEFINITION
----------------------------------------------------------------------------------
- 1 -  6        Record name     "SEQRES"
-
- 9 - 10        Integer         serNum        Serial number of the SEQRES record
-                                             for the current chain.  Starts at 1
-                                             and increments by one each line.
-                                             Reset to 1 for each chain.
-
-12             Character       chainID       Chain identifier.  This may be any
-                                             single legal character, including a
-                                             blank which is used if there is
-                                             only one chain.
-
-14 - 17        Integer         numRes        Number of residues in the chain.
-                                             This value is repeated on every
-                                             record.
-
-20 - 22        Residue name    resName       Residue name.
-
-24 - 26        Residue name    resName       Residue name.
-
-... and so forth out to 68-70, for a total of 13 in each line (except possibly
-the last.
-
-source:
-http://www.rcsb.org/pdb/file_formats/pdb/pdbguide2.2/part_35.html
-*/
-
-/*
- * However, we don't use them right now because of several issues that
- * can't presently be resolved satisfactorily in VMD:
-
-According to the RCSB, SEQRES records have to contain all residues, not
-just those in the structure, which means VMD will usually produce incorrect
-output and there's nothing we can do about it.  The RCSB actually specifies
-that all residues in the chain have to present in the SEQRES records, even
-if they're not in the structure.
-  
-We can never know which residues to output.  Our current system of outputting   
-everything is just terrible when you have 20,000 waters in your system; we
-have to fix this immediately.  We could almost get away with making a hash
-table of the names of protein and nucleic acid residues and only write chains
-containing those residues.  However, there's this little snippet from the
-specification:
-  
-* Heterogens which are integrated into the backbone of the chain are listed
-  as being part of the chain and are included in the SEQRES records for
-  that chain.
-  
-That means that we can never know what might appear in the sequence unless we
-also read HET records and keep track of them in VMD as well.  We shouldn't 
-get people depending on such fallible SEQRES records.
-  
-And of course, there's the fact that no other program that we know of besides   
-CE needs these SEQRES records.
-
- * Uncomment the write_seqres line in write_timestep to turn them back on.
- */
-
-
-#if 0
-static void write_seqres(FILE * fd, int natoms, const molfile_atom_t *atomlist) {
-  int i=0;
-  while (i < natoms) {
-    int k, serNum;
-    int j = i;
-    int ires, nres = 1;
-    int resid = atomlist[i].resid;
-    /* Count up the number of residues in the chain */
-    const char *chain = atomlist[i].chain;
-    while (j < natoms && !strcmp(chain, atomlist[j].chain)) {
-      if (resid != atomlist[j].resid) {
-        nres++;
-        resid = atomlist[j].resid;
-      }
-      j++;
-    }
-    /* There are nres residues in the chain, from atoms i to j. */
-    serNum = 1;
-    ires = 1;
-    resid = atomlist[i].resid;
-    fprintf(fd, "SEQRES  %2d %c %4d  ",  serNum, chain[0], nres);
-    serNum = 2;
-    fprintf(fd, "%3s ", atomlist[i].resname);
-    for (k=i; k<j; k++) {
-      if (resid != atomlist[k].resid) {
-        resid = atomlist[k].resid;
-        if (!(ires % 13)) {
-          fprintf(fd, "\nSEQRES  %2d %c %4d  ",  serNum, chain[0], nres);
-          serNum++;
-        }
-        fprintf(fd, "%3s ", atomlist[k].resname);
-        ires++;
-      }
-    }
-    i = j;
-    fprintf(fd, "\n");
-  }
-}
-#endif
-
-/*
-CRYST1 records look like this:
-The CRYST1 record presents the unit cell parameters, space group, and Z value. If the structure was not determined by crystallographic means, CRYST1 simply defines a unit cube. 
-
-
-Record Format 
-
-COLUMNS       DATA TYPE      FIELD         DEFINITION
--------------------------------------------------------------
- 1 -  6       Record name    "CRYST1"
-
- 7 - 15       Real(9.3)      a             a (Angstroms).
-
-16 - 24       Real(9.3)      b             b (Angstroms).
-
-25 - 33       Real(9.3)      c             c (Angstroms).
-
-34 - 40       Real(7.2)      alpha         alpha (degrees).
-
-41 - 47       Real(7.2)      beta          beta (degrees).
-
-48 - 54       Real(7.2)      gamma         gamma (degrees).
-
-56 - 66       LString        sGroup        Space group.
-
-67 - 70       Integer        z             Z value.
-
-* If the coordinate entry describes a structure determined by a technique
-other than crystallography, CRYST1 contains a = b = c = 1.0, alpha =
-beta = gamma = 90 degrees, space group = P 1, and Z = 1.
-
-We will use "P 1" and "1" for space group and z value, as recommended, but
-we'll populate the other fields with the unit cell information we do have.
-
-*/
-  
-static void write_cryst1(FILE *fd, const molfile_timestep_t *ts) {
-  fprintf(fd, "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f P 1           1\n", 
-    ts->A, ts->B, ts->C, ts->alpha, ts->beta, ts->gamma);
-}
-
-
-static int write_timestep(void *v, const molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-  char elementsymbol[3];
-
-  if (pdb->natoms == 0)
-    return MOLFILE_SUCCESS;
-
-  if (pdb->first_frame) {
-    /* Turn off SEQRES writing for now; see comments above.
-    write_seqres(pdb->fd, pdb->natoms, pdb->atomlist);
-    */
-    write_cryst1(pdb->fd, ts);
-    pdb->first_frame = 0;
-  }
-  atom = pdb->atomlist;
-  pos = ts->coords;
-  for (i=0; i<pdb->natoms; i++) {
-    /*
-     * The 8.3 format for position, occupancy, and bfactor permits values 
-     * only in the range of -999.9994 to 9999.9994 (so that they round
-     * to the range [-999.999, 9999.999]).  If values fall outside of that
-     * range, fail and emit an error message rather than generate a
-     * misformatted PDB file.
-     */
-#define PDBBAD(x) ((x) < -999.9994f || (x) > 9999.9994f)
-    if (PDBBAD(pos[0]) || PDBBAD(pos[1]) || PDBBAD(pos[2]) ||
-		PDBBAD(atom->occupancy) || PDBBAD(atom->bfactor)) {
-	    fprintf(stderr, "PDB WRITE ERROR: Position, occupancy, or b-factor (beta) for atom %d\n", i);
-      fprintf(stderr, "                 cannot be written in PDB format.\n");
-      fprintf(stderr, "                 File will be truncated.\n");
-      return MOLFILE_ERROR;
-    }
-
-    /* check the atomicnumber and format the atomic element symbol string */
-    strcpy(elementsymbol, (atom->atomicnumber < 1) ? "  " : get_pte_label(atom->atomicnumber));
-    elementsymbol[0] = toupper(elementsymbol[0]);
-    elementsymbol[1] = toupper(elementsymbol[1]);
- 
-    if (!write_raw_pdb_record(pdb->fd,  
-        "ATOM  ", i+1, atom->name, atom->resname, atom->resid, 
-        atom->insertion, atom->altloc, elementsymbol,
-        pos[0], pos[1], pos[2], 
-        atom->occupancy, atom->bfactor, atom->chain, atom->segid)) {
-      fprintf(stderr, 
-          "PDB: Error encoutered writing atom %d; file may be incomplete.\n", 
-          i+1);
-      return MOLFILE_ERROR;
-    }
-    ++atom;
-    pos += 3;
-  }
-  fprintf(pdb->fd, "END\n");
-
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_file_write(void *v) {
-  pdbdata *pdb = (pdbdata *)v; 
-  fclose(pdb->fd);
-  free(pdb->atomlist);
-  free(pdb);
-}
-
-static int read_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  pdbdata *pdb = (pdbdata *)v; 
-  *metadata = pdb->meta;
-  return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
- 
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pdb";
-  plugin.prettyname = "PDB";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 16;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "pdb,ent";
-  plugin.open_file_read = open_pdb_read;
-  plugin.read_structure = read_pdb_structure;
-  plugin.read_bonds = read_bonds;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_pdb_read;
-  plugin.open_file_write = open_file_write;
-  plugin.write_structure = write_structure;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  plugin.read_molecule_metadata = read_molecule_metadata;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pdbxplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pdbxplugin.C
deleted file mode 100755
index f65e3a5d361ddb886d8e68b650d2415cc0107173..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pdbxplugin.C
+++ /dev/null
@@ -1,1555 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pdbxplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.17 $       $Date: 2016/11/28 05:01:22 $
- *
- ***************************************************************************/
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include "molfile_plugin.h"
-#include "periodic_table.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if !(defined(WIN32) || defined(WIN64))
-#include <sys/time.h>
-#endif
-
-#define VMDPLUGIN_STATIC
-#include "inthash.h"
-
-//#define PDBX_DEBUG 1
-
-//used for reading author defined values needed when reading bond info
-#define CHAIN_SIZE 4
-#define TYPE_SIZE 8
-#define BUFFER_SIZE 1024
-
-struct list_node { 
-  unsigned int next;
-  unsigned int index;
-};
-
-// class definition
-typedef struct pdbxParser {
-  FILE *file;
-  int natoms;
-  int nbonds;
-  int* resid_auth;
-  char * chain_auth;
-  char * type_auth;
-  float* xyz;
-  int* bondsTo;
-  int* bondsFrom;
-  bool error;
-  int table[64];
-  unsigned int tableSize;
-  inthash_t bondHash;
-  list_node * hashMem;
-} pdbxParser;
-
-// XXX yuck, this needs to go!
-static unsigned char charToNum[128];
-
-enum TableColums {
-  COLUMN_NUMBER,
-  COLUMN_NAME,
-  COLUMN_TYPE,
-  COLUMN_TYPE_AUTH,
-  COLUMN_RESNAME,
-  COLUMN_RESID,
-  COLUMN_RESID_AUTH,
-  COLUMN_INSERTION,
-  COLUMN_X,
-  COLUMN_Y,
-  COLUMN_Z,
-  COLUMN_OCCUPANCY,
-  COLUMN_BFACTOR,
-  COLUMN_CHARGE,
-  COLUMN_CHAIN,
-  COLUMN_CHAIN_AUTH,
-  COLUMN_JUNK
-};
-
-/* Opens the file, finds the number of atoms, and allocates arrays */
-/* Reads in and stores information from the file */
-static pdbxParser* create_pdbxParser(const char* filepath);
-
-/*Reads through the file and stores data */
-static int parseStructureFaster(molfile_atom_t * atoms, int * optflags, pdbxParser* parser);
-
-static int setCoordinatesFast(float* coords, pdbxParser* parser);
-
-static bool readRMSDBonds(molfile_atom_t * atoms, pdbxParser* parser);
-static bool readAngleBonds(molfile_atom_t * atoms, pdbxParser* parser);
-static bool readBonds(molfile_atom_t * atoms, pdbxParser* parser);
-
-/* Parse through file and return the total number of atoms */
-/* Will rewind the file to the start */
-/* Returns -1 if the number of atoms cannot be found */
-static int parseNumberAtoms(pdbxParser* parser);
-
-/* returns true if str starts with "_atom_site." */
-static inline bool isAtomSite(char * str);
-
-static inline bool isValidateRMSDBond(char * str);
-
-/* Assumes that str contains a single floating point number and */
-/* returns it as a float. NO ERROR CHECKING */
-/* Must be passed a null terminating string */
-/* Wrote specifically to parse strings returned from getNextWord */
-static float stringToFloat(char * str);
-
-/* Takes a string str and finds the next word starting from pos*/
-/* word must be allocated and suffiently large, does NO ERROR CHECKING */
-/* After returning, word will contain the next word and pos will be updated */
-/* to point to the current position in str */
-static void getNextWord(char * str, void * word, int& pos);
-
-/* Takes a string str and finds the next word starting from pos*/
-/* word must be allocated and suffiently large, does NO ERROR CHECKING */
-/* After returning, word will contain the next word and pos will be updated */
-/* to point to the current position in str */
-static void skipNextWord(char * str, void * word, int& pos);
-
-/* Returns a unique int id for an atom based on the chain and resid */
-static inline int getUniqueResID(char * chainstr, int resid);
-
-static void initCharToNum();
-
-#define WB_SIZE 1024
-
-#if 0 
-static const char atomSiteHeader[] =
-  "loop_\n"
-  "_atom_site.group_PDB\n"
-  "_atom_site.id\n"
-  "_atom_site.type_symbol\n"
-  "_atom_site.label_atom_id\n"
-  "_atom_site.label_alt_id\n"
-  "_atom_site.label_comp_id\n"
-  "_atom_site.label_asym_id\n"
-  "_atom_site.label_entity_id\n"
-  "_atom_site.label_seq_id\n"
-  "_atom_site.pdbx_PDB_ins_code\n"
-  "_atom_site.Cartn_x\n"
-  "_atom_site.Cartn_y\n"
-  "_atom_site.Cartn_z\n"
-  "_atom_site.occupancy\n"
-  "_atom_site.B_iso_or_equiv\n"
-  "_atom_site.Cartn_x_esd\n"
-  "_atom_site.Cartn_y_esd\n"
-  "_atom_site.Cartn_z_esd\n"
-  "_atom_site.occupancy_esd\n"
-  "_atom_site.B_iso_or_equiv_esd\n"
-  "_atom_site.pdbx_formal_charge\n"
-  "_atom_site.auth_seq_id\n"
-  "_atom_site.auth_comp_id\n"
-  "_atom_site.auth_asym_id\n"
-  "_atom_site.auth_atom_id\n"
-  "_atom_site.pdbx_PDB_model_num\n";
-#endif
-
-
-static const char atomSiteHeader[] =
-  "loop_\n"
-  "_atom_site.group_PDB\n"
-  "_atom_site.id\n"
-  "_atom_site.type_symbol\n"
-  "_atom_site.label_atom_id\n"
-  "_atom_site.label_alt_id\n"
-  "_atom_site.label_comp_id\n"
-  "_atom_site.label_asym_id\n"
-  "_atom_site.label_entity_id\n"
-  "_atom_site.label_seq_id\n"
-  "_atom_site.pdbx_PDB_ins_code\n"
-  "_atom_site.Cartn_x\n"
-  "_atom_site.Cartn_y\n"
-  "_atom_site.Cartn_z\n"
-  "_atom_site.occupancy\n"
-  "_atom_site.pdbx_formal_charge\n"
-  "_atom_site.auth_asym_id\n";
-
-
-typedef struct pdbxWriter {
-  FILE* fd;
-  char writeBuf[WB_SIZE];
-  char pdbName[256];
-  int bufferCount;
-  molfile_atom_t* atoms;
-  const float* coordinates;
-  int numatoms;
-} pdbxWriter;
-
-static void writeBuffer(pdbxWriter* writer);
-static void writeIntro(pdbxWriter* writer);
-static void write(const char* str, pdbxWriter* writer);
-static void writeAtomSite(pdbxWriter* writer);
-static void close(pdbxWriter* writer);
-static pdbxWriter* create_pdbxWriter(const char* filename, int numAtoms);
-static void addAtoms(const molfile_atom_t* atoms, int optflags, pdbxWriter* writer);
-static void addCoordinates(const float* coords, pdbxWriter* writer);
-static void writeFile(pdbxWriter* writer);
-
-// class implementation 
-
-static pdbxParser* create_pdbxParser(const char* filepath) {
-  pdbxParser* parser = new pdbxParser;
-  char buffer[BUFFER_SIZE];
-  int numberAtoms;
-  parser->xyz = NULL;
-  parser->hashMem = NULL;
-  parser->chain_auth = NULL;
-  parser->resid_auth = NULL;
-  parser->type_auth = NULL;
-  parser->error = false;
-  parser->bondsTo = NULL;
-  parser->bondsFrom = NULL;
-  parser->file = fopen(filepath, "r");
-  if (!parser->file) {
-    printf("pdbxplugin) cannot open file %s\n", filepath);
-    return NULL;
-  }
-  if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-    printf("pdbxplugin) cannot read file %s\n", filepath);
-    return NULL;
-  }
-
-  /* Find the number of atoms */
-  parser->natoms = parseNumberAtoms(parser);
-  numberAtoms = parser->natoms;
-  if (parser->natoms <= 0) {
-    printf("pdbxplugin) Could not get atom number\n");
-    return NULL;
-  }
-  initCharToNum();
-  parser->xyz = new float[numberAtoms*3];
-  parser->hashMem = new list_node[numberAtoms+1];
-  parser->chain_auth = new char[numberAtoms*CHAIN_SIZE];
-  parser->resid_auth = new int [numberAtoms];
-  parser->type_auth = new char[numberAtoms * TYPE_SIZE];
-  return parser;
-}
-
-void delete_pdbxParser(pdbxParser* parser) {
-  fclose(parser->file);
-  if (parser->xyz != NULL) {
-    delete [] parser->xyz;
-    parser->xyz = NULL;
-  }
-  if (parser->type_auth != NULL) {
-    delete [] parser->type_auth;
-    parser->type_auth = NULL;
-  }
-  if (parser->resid_auth != NULL) {
-    delete [] parser->resid_auth;
-    parser->resid_auth = NULL;
-  }
-  if (parser->hashMem != NULL) {
-    delete [] parser->hashMem;
-    parser->hashMem = NULL;
-  }
-  if (parser->chain_auth != NULL) {
-    delete [] parser->chain_auth;
-    parser->chain_auth = NULL;
-  }
-  if (parser->type_auth != NULL) {
-    inthash_destroy(&parser->bondHash);
-  }
-}
-
-static void skipNextWord(char * str, void * word, int& pos) {
-  /* Handle case if we start at end of line */
-  if (str[pos] == '\0' || str[pos] == '\n') {
-    return;
-  }
-  /* move forward until we hit non-whitespace */
-  while(str[pos] == ' ') {
-    ++pos;
-  }
-  /* increment pos until we hit a whitespace */
-  while (str[pos++] != ' ') {}
-}
-
-static void getNextWord(char * str, void * word, int& pos) {
-  char * w = (char*) word;
-  int wordpos = 0;
-  /* Handle case if we start at end of line */
-  if (str[pos] == '\0' || str[pos] == '\n') {
-    return;
-  }
-  /* move forward until we hit non-whitespace */
-  while(str[pos] == ' ') {
-    ++pos;
-  }
-  /* increment pos until we hit a whitespace */
-  while (str[pos] != ' ') {
-    w[wordpos++] = str[pos++];
-  }
-  w[wordpos] = '\0';
-  /* Increment pos to point to first char that has not been read */
-  ++pos;
-}
-
-static float stringToFloat(char * str) {
-  bool neg = (str[0] == '-');
-  unsigned int total = 0;
-  unsigned pos = neg ? 1 : 0;
-  unsigned int num = 0;
-  unsigned int denom = 1;
-  float retval;
-  /* calculate integer before the decimal */
-  while (str[pos] != '.') {
-    total = (total*10) + str[pos] - '0';
-    ++pos;
-  }
-  ++pos;
-  /* Find the fraction representing the decimal */
-  while (str[pos] != '\0') {
-    num = (num * 10) + str[pos] - '0';
-    denom *= 10;
-    ++pos;
-  }
-  retval = (float)total + (double)num/(double)denom;
-  if (neg)
-    retval *= -1;
-  return retval;
-}
-
-static int parseNumberAtoms(pdbxParser* parser) {
-  char buffer[BUFFER_SIZE];
-  char wordbuffer[64];
-  int numatoms = 0;
-  int i;
-  int tableSize = 0;
-
-  // skip past junk at start of file, stop when we get to atomSite data
-  while (NULL == strstr(buffer, "_atom_site.")) {
-    // if this is true then we couldnt find the numatoms
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file))
-      return -1;
-  }
-
-  while (!(NULL == strstr(buffer, "_atom_site."))) {
-    sscanf(buffer+11, "%s", wordbuffer); // table is used in parseStructure too
-    /* assign integer values to each column */
-    if (0 == strcmp(wordbuffer, "id")) {
-      parser->table[tableSize] = COLUMN_NUMBER;
-    } else if (0 == strcmp(wordbuffer, "type_symbol")) {
-      parser->table[tableSize] = COLUMN_NAME;
-    } else if (0 == strcmp(wordbuffer, "label_comp_id")) {
-      parser->table[tableSize] = COLUMN_RESNAME;
-    } else if (0 == strcmp(wordbuffer, "label_asym_id")) {
-      parser->table[tableSize] = COLUMN_CHAIN;
-    } else if (0 == strcmp(wordbuffer, "auth_asym_id")) {
-      parser->table[tableSize] = COLUMN_CHAIN_AUTH;
-    } else if (0 == strcmp(wordbuffer, "Cartn_x")) {
-      parser->table[tableSize] = COLUMN_X;
-    } else if (0 == strcmp(wordbuffer, "Cartn_y")) {
-      parser->table[tableSize] = COLUMN_Y;
-    } else if (0 == strcmp(wordbuffer, "Cartn_z")) {
-      parser->table[tableSize] = COLUMN_Z;
-    } else if (0 == strcmp(wordbuffer, "label_seq_id")) {
-      parser->table[tableSize] = COLUMN_RESID;
-    } else if (0 == strcmp(wordbuffer, "auth_seq_id")) {
-      parser->table[tableSize] = COLUMN_RESID_AUTH;
-    } else if (0 == strcmp(wordbuffer, "pdbx_PDB_ins_code")) {
-      parser->table[tableSize] = COLUMN_INSERTION;
-    } else if (0 == strcmp(wordbuffer, "B_iso_or_equiv")) {
-      parser->table[tableSize] = COLUMN_BFACTOR;
-    } else if (0 == strcmp(wordbuffer, "occupancy")) {
-      parser->table[tableSize] = COLUMN_OCCUPANCY;
-    } else if (0 == strcmp(wordbuffer, "label_atom_id")) {
-      parser->table[tableSize] = COLUMN_TYPE;
-    } else if (0 == strcmp(wordbuffer, "auth_atom_id")) {
-      parser->table[tableSize] = COLUMN_TYPE_AUTH;
-    } else if (0 == strcmp(wordbuffer, "pdbx_formal_charge")) {
-      parser->table[tableSize] = COLUMN_CHARGE;
-    } else {
-      parser->table[tableSize] = COLUMN_JUNK;
-    }
-
-    // if this is true then we couldnt find the numatoms
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file))
-      return -1;
-
-    tableSize++;
-  }
-
-  // increment numatoms until we get to the end of the file
-  while (buffer[0] != '#') {
-    // if this is true then we couldnt find the numatoms
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file))
-      return -1;
-    ++numatoms;
-  }
-
-  rewind(parser->file);
-  /* Cut off any junk columns from the end of table */
-
-  i = tableSize;
-  while(parser->table[--i] == COLUMN_JUNK){}
-  tableSize = i+1;
-  parser->tableSize = tableSize;
-
-  if (numatoms == 0) {
-    printf("pdbxplugin) Could not parse atom number from file\n");
-    return -1;
-  }
-
-  return numatoms;
-}
-
-
-static void initCharToNum() {
-  int i;
-  int j = 1;
-
-  for (i=0; i<128; i++)
-    charToNum[i] = -1;
-
-  i = 'A';
-  while (i <= 'Z')
-    charToNum[i++] = j++;
-  i = 'a';
-  while (i <= 'z')
-    charToNum[i++] = j++;
-  i = '0';
-  while (i <= '9')
-    charToNum[i++] = j++;
-}
-
-
-static inline int getUniqueResID(char * chainstr, int resid) {
-  int i, uid;
-  int length = strlen(chainstr);
-  // Assuming max length of chainstr is 3 chars
-  //Each char can be respresented by <= 6 bits since only a-z, A-Z, and 0-9 are valid values (62 possible values)
-  uid = 1 + charToNum[(int)chainstr[0]];
-  uid <<= 6;
-
-  if (length == 1) {
-    uid <<= 12;
-  } else if (length == 2) {
-    uid += charToNum[(int)chainstr[1]];
-    uid <<= 12;
-  } else if (length == 3) {
-    uid += charToNum[(int)chainstr[1]];
-    uid = (uid << 6) + charToNum[(int) chainstr[2]];
-    uid <<= 6;
-  }
-
-  // First 18 bits of uid dedicated to 3 letters of chainstr
-  uid <<= 12;
-  uid += (0xFFF & resid); //add 12 least significant bits of resid to fill the remaining 10 bits of uid
-
-  return uid;
-}
-
-
-
-#define ATOM_TYPE      0
-#define ATOM_RESNAME   1
-#define ATOM_INSERTION 2
-#define ATOM_CHAIN     3
-#define MAX_COLUMNS    64
-#define MAX_OPTIONAL_AUTH_FIELDS  2
-
-#define FLAG_CHAIN_LENGTH 0x01
-#define FLAG_CHARGE       0x02
-#define FLAG_INSERTION    0x04
-#define FLAG_BFACTOR      0x08
-#define FLAG_OCCUPANCY    0x10
-
-static int parseStructureFaster(molfile_atom_t * atoms, int * optflags, pdbxParser* parser) {
-  int i, count, atomdata, pos, idx, xyzcount, j;
-  char buffer[BUFFER_SIZE];
-  char namebuffer[8];
-  char occupancybuffer[16];
-  char bfactorbuffer[16];
-  char chargebuffer[16];
-  char residbuffer[8];
-  char residAuthbuffer[8];
-  char chainbuffer[16];
-  char trash[16];
-  char xbuffer[16];
-  char ybuffer[16];
-  char zbuffer[16];
-  void * pillars[MAX_COLUMNS];
-  molfile_atom_t * atom;
-  int badptecount = 0;
-  int chargecount = 0;
-  int occupancycount = 0;
-  int bfactorcount = 0;
-  char oldChain[8];
-  unsigned char parseFlags = 0;
-  chainbuffer[1] = '\0';
-  chainbuffer[2] = '\0';
-  int hashTemp;
-  int hashCount = 1;
-  int head;
-  int chainAuthIdx = MAX_COLUMNS-1, typeIdx = MAX_COLUMNS-1, resnameIdx = MAX_COLUMNS-1;
-  int insertionIdx = MAX_COLUMNS-1, typeAuthIdx = MAX_COLUMNS-1;
-#if (vmdplugin_ABIVERSION >= 20)
-  int chainIdx = MAX_COLUMNS-1;
-#endif
-  char * chainAuth = parser->chain_auth;
-  char * typeAuth = parser->type_auth;
-  int tableSize = parser->tableSize;
-  int* table = parser->table;
-  unsigned char doBonds = 0;
-
-  /* Initialize hash table used later when reading the special bonds */
-  inthash_init(&parser->bondHash, parser->natoms);
-
-  for (i=0; i<tableSize; i++) {
-    switch (table[i]) {
-      case COLUMN_NUMBER:
-        pillars[i] = trash;
-      break;
-      case COLUMN_NAME:
-        pillars[i] = namebuffer;
-      break;
-      case COLUMN_TYPE:
-        pillars[i] = atoms->type;
-        typeIdx = i;
-      break;
-      case COLUMN_TYPE_AUTH:
-        pillars[i] = typeAuth;
-        typeAuthIdx = i;
-      break;
-      case COLUMN_RESNAME:
-        pillars[i] = atoms->resname;
-        resnameIdx = i;
-      break;
-      case COLUMN_RESID:
-        pillars[i] = residbuffer;
-      break;
-      case COLUMN_RESID_AUTH:
-        pillars[i] = residAuthbuffer;
-        doBonds++;
-      break;
-      case COLUMN_INSERTION:
-        pillars[i] = atoms->insertion;
-        insertionIdx = i;
-      break;
-      case COLUMN_X:
-        pillars[i] = xbuffer;
-      break;
-      case COLUMN_Y:
-        pillars[i] = ybuffer;
-      break;
-      case COLUMN_Z:
-        pillars[i] = zbuffer;
-      break;
-      case COLUMN_OCCUPANCY:
-        pillars[i] = occupancybuffer;
-      break;
-      case COLUMN_BFACTOR:
-        pillars[i] = bfactorbuffer;
-      break;
-      case COLUMN_CHARGE:
-        pillars[i] = chargebuffer;
-      break;
-      case COLUMN_CHAIN:
-#if (vmdplugin_ABIVERSION < 20)
-        pillars[i] = chainbuffer;
-#else
-        pillars[i] = atoms->chain;
-        chainIdx = i;
-#endif
-      break;
-      case COLUMN_CHAIN_AUTH:
-        pillars[i] = chainAuth;
-        chainAuthIdx = i;
-        doBonds++;
-      break;
-      default:
-        pillars[i] = trash;
-      break;
-    }
-  }
-
-  /* If the two optional auth fields are not present, don't look for extra bonds */
-  if (doBonds != MAX_OPTIONAL_AUTH_FIELDS) {
-    doBonds = 0;
-  }
-
-  atomdata = 0;
-  /* Start parsing     */
-  /* Skip through junk */
-  while (!atomdata) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) failure while reading file\n");
-      parser->error = true;
-      return -1;
-    }
-    if (!(NULL == strstr(buffer, "_atom_site.")))
-      atomdata = 1;
-  }
-
-  /* Skip through the atomdata table declaration*/
-  while (atomdata) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) failure while reading file\n");
-      parser->error = true;
-      return -1;
-    }
-    if (NULL == strstr(buffer, "_atom_site."))
-      atomdata = 0;
-  }
-
-  count = 0;
-  atom = atoms;
-  do {
-    pos = 0;
-    for (i=0; i<tableSize; ++i) {
-      if (table[i] == COLUMN_JUNK) {
-        /* if we don't want this column, update pos to point to the next column */
-        skipNextWord(buffer, buffer, pos);
-      }
-      else {
-        /* will copy each column string into the atom struct */
-        /* or save the string if we need to convert it */
-        getNextWord(buffer, pillars[i], pos);
-      }
-    }
-    /* Coordinates must be saved until timestep is called */
-    xyzcount = count*3;
-    /*replacing atof with stringToFloat will increase performance */
-    parser->xyz[xyzcount] = atof(xbuffer);
-    parser->xyz[xyzcount+1] = atof(ybuffer);
-    parser->xyz[xyzcount+2] = atof(zbuffer);
-
-    atom->resid = atoi(residbuffer);
-    if (doBonds && residAuthbuffer[0] != '.' && residAuthbuffer[0] != '?') {
-      parser->resid_auth[count] = atoi(residAuthbuffer);
-
-      /* add atom to hash table */
-      hashTemp = getUniqueResID(chainAuth, parser->resid_auth[count]);
-
-      if (-1 != (head = inthash_insert(&parser->bondHash, hashTemp, hashCount))) {
-        /* key already exists, so we have to "add" a node to the linked list for this residue */
-        /* Since we can't change the pointer in the hash table, we insert the node at the second
-         * position in the list
-         */
-        parser->hashMem[hashCount].next = parser->hashMem[head].next;
-        parser->hashMem[head].next = hashCount;
-      }
-      /* "add" node to list */
-      parser->hashMem[hashCount++].index = count;
-    }
-
-    // XXX replace '?' or '.' insertion codes with a NUL char 
-    // indicating an empty insertion code.
-    if (atom->insertion[0] == '?' || atom->insertion[0] == '.') {
-      atom->insertion[0] = '\0';
-    }
-
-//TODO: figure out what this conditional should be
-#if (vmdplugin_ABIVERSION < 20)
-    /* check to see if the chain length is greater than 2 */
-    if (chainbuffer[2] != '\0' && chainbuffer[1] != '\0') {
-      chainbuffer[2] = '\0';
-      parseFlags |= FLAG_CHAIN_LENGTH;
-    }
-    atom->chain[0] = chainbuffer[0];
-    atom->chain[1] = chainbuffer[1];
-#endif
-
-    /* Assign these to the pdbx_data struct */
-    if (bfactorbuffer[0] != '.' && bfactorbuffer[0] != '.') {
-      atom->bfactor = atof(bfactorbuffer);
-      ++bfactorcount;
-      parseFlags |= FLAG_BFACTOR;
-    }
-    else
-      atom->bfactor = 0.0;
-
-    if (occupancybuffer[0] != '.' && occupancybuffer[0] != '?') {
-      atom->occupancy = atof(occupancybuffer);
-      ++occupancycount;
-      parseFlags |= FLAG_OCCUPANCY;
-    }
-    else 
-      atom->occupancy = 0.0;
-
-    if (chargebuffer[0] != '.' && chargebuffer[0] != '?') {
-      atom->charge = atof(chargebuffer);
-      ++chargecount;
-      parseFlags |= FLAG_CHARGE;
-    }
-    else
-      atom->charge = 0.0;
-
-    idx = get_pte_idx_from_string(namebuffer);
-
-    /* check for parenthesis in atom type */
-    if (atom->type[0] == '"') {
-      /* only save what is inside the parenthesis */
-      i = 1;
-      while (atom->type[i] != '"') {
-        atom->type[i-1] = atom->type[i];
-        ++i;
-      }
-      atom->type[i-1] = '\0';
-    }
-    /* atom->name and atom-> are the same */
-    strcpy(atom->name, atom->type);
-
-    /* Set periodic table values */
-    if (idx) {
-      atom->atomicnumber = idx;
-      atom->mass = get_pte_mass(idx);
-      atom->radius = get_pte_vdw_radius(idx);
-    }
-    else {
-      ++badptecount;
-    }
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) failure while reading file\n");
-      parser->error = true;
-      return -1;
-    }
-
-    ++count;
-    ++atom;
-    typeAuth += TYPE_SIZE;
-    if (doBonds) {
-      chainAuth += CHAIN_SIZE;
-      pillars[chainAuthIdx] = chainAuth;
-    }
-    pillars[typeAuthIdx] = typeAuth;
-    pillars[typeIdx] = atom->type;
-    pillars[resnameIdx] = atom->resname;
-    pillars[insertionIdx] = atom->insertion;
-#if (vmdplugin_ABIVERSION >= 20)
-    pillars[chainIdx] = atom->chain;
-#endif
-  } while (buffer[0] != '#'); //do until all the atoms have been read
-
-  /* after we finish parsing, set optflags */
-#if (vmdplugin_ABIVERSION < 20)
-  if (parseFlags & FLAG_CHAIN_LENGTH) {
-    printf("pdbxplugin) WARNING: This plugin ABI does not support chain names longer than two characters. Some chain names have been truncated.\n");
-  }
-#endif
-
-  if (badptecount == 0)
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS | MOLFILE_ATOMICNUMBER;
-
-  if (parseFlags & FLAG_CHARGE)
-    *optflags |= MOLFILE_CHARGE;
-
-  if (parseFlags & FLAG_BFACTOR)
-    *optflags |= MOLFILE_BFACTOR;
-
-  if (parseFlags & FLAG_OCCUPANCY)
-    *optflags |= MOLFILE_OCCUPANCY;
-
-
-  if (badptecount > 0) {
-    printf("pdbxplugin) encountered %d bad element indices!\n", badptecount);
-    return -1;
-  }
-
-  return 0;
-}
-
-static int setCoordinatesFast(float* coords, pdbxParser* parser) {
-  int i, j;
-  j = 0;
-  for(i=0; i<parser->natoms; i++) {
-    coords[0] = parser->xyz[j];
-    coords[1] = parser->xyz[j+1];
-    coords[2] = parser->xyz[j+2];
-    coords += 3;
-    j += 3;
-  }
-  return 0;
-}
-
-#define BOND_JUNK      0
-#define BOND_NAME_1    1
-#define BOND_CHAIN_1   2
-#define BOND_RESNAME_1 3
-#define BOND_RESID_1   4
-#define BOND_NAME_2    5
-#define BOND_CHAIN_2   6
-#define BOND_RESNAME_2 7
-#define BOND_RESID_2   8
-
-static bool readAngleBonds(molfile_atom_t * atoms, pdbxParser* parser) {
-  char buffer[BUFFER_SIZE];
-  int bondTable[32];
-  char* columns[32];
-  int bondTableSize = 0;
-  int bnum = 0;
-  int i, pos, j, k;
-  int* newBondsTo, *newBondsFrom;
-  fpos_t filePos;
-  char junk[16];
-  char modelNum[8];
-  char name1[8];
-  char wordbuffer[16];
-  char name2[8];
-  char chain1[8];
-  char chain2[8];
-  char resid1buffer[8];
-  char resid2buffer[8];
-  int resid1, resid2;
-  int uid1, uid2;
-  int aIdx1, aIdx2;
-  molfile_atom_t * atom;
-
-  /* skip through the file until we find the bond information */
-  do {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      return false;
-    }
-  } while (NULL == strstr(buffer,"_pdbx_validate_rmsd_angle."));
-
-  fgetpos(parser->file, &filePos);
-
-  //if (sscanf(  return if two words in one table definition line
-
-  /* Parse table header data */
-  while (NULL != strstr(buffer,"_pdbx_validate_rmsd_angle.")) {
-    sscanf(buffer+26, "%s", wordbuffer); // table is used in parseStructure too
-    /* assign integer values to each column */
-    if (0 == strcmp(wordbuffer, "auth_atom_id_1")) {
-      columns[bondTableSize] = (char*)name1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_1")) {
-      columns[bondTableSize] = (char*)chain1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_1")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_1")) {
-      columns[bondTableSize] = (char*)resid1buffer;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_atom_id_2")) {
-      columns[bondTableSize] = (char*)name2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_2")) {
-      columns[bondTableSize] = (char*)chain2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_2")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_2")) {
-      columns[bondTableSize] = (char*)resid2buffer;
-    }
-    else {
-      columns[bondTableSize] = (char*)junk;
-    }
-    ++bondTableSize;
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-
-  }
-
-  /* figure out how many bonds are being defined */
-  while (buffer[0] != '#') {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-    ++bnum;
-  }
-
-  int test = parser->nbonds + bnum;
-  if ((newBondsTo = (int*)realloc((void*)parser->bondsTo, (parser->nbonds + bnum) * sizeof(int))) == NULL)
-    return false;
-  if ((newBondsFrom = (int*)realloc((void*)parser->bondsFrom, (parser->nbonds + bnum) * sizeof(int))) == NULL)
-    return false;
-  parser->bondsTo = newBondsTo;
-  parser->bondsFrom = newBondsFrom;
-
-  /* Skip back to the start of the bond info */
-  fsetpos(parser->file, &filePos);
-  if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-    printf("pdbxplugin) could not read bond information.\n");
-    return false;
-  }
-  /* Skip through the header */
-  while (NULL != strstr(buffer,"_pdbx_validate_rmsd_angle.")) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-  }
-
-  bnum = 0;
-  while (buffer[0] != '#') {
-    pos = 0;
-    /* copy each column of the table into the appropriate columns index */
-    for (i=0; i<bondTableSize; ++i) {
-        getNextWord(buffer, columns[i], pos);
-    }
-    resid1 = atoi(resid1buffer);
-    resid2 = atoi(resid2buffer);
-    /* get unique res ID for hash table lookup */
-    uid1 = getUniqueResID(chain1, resid1);
-    uid2 = getUniqueResID(chain2, resid2);
-    k = 0;
-
-    /* find the atoms in the hash table */
-    if ( ((uid1 = inthash_lookup(&parser->bondHash, uid1)) != -1) && ((uid2 = inthash_lookup(&parser->bondHash, uid2)) != -1) ) {
-      // because the hashtable is residue specifc, loop through 
-      // all atoms in the residue to find the correct one
-      // Find atom 1 
-      do {
-        aIdx1 = parser->hashMem[uid1].index;
-        if (strcmp(name1, parser->type_auth + aIdx1 * TYPE_SIZE) == 0 && 
-            parser->resid_auth[aIdx1] == resid1 &&
-            strcmp(chain1, parser->chain_auth + aIdx1 * CHAIN_SIZE) == 0) {
-          k++;
-          break;
-        } else {
-          uid1 = parser->hashMem[uid1].next;
-        }
-      } while (uid1 != 0); //0 indicates end of "list"
-
-      // Find atom 2
-      do {
-        aIdx2 = parser->hashMem[uid2].index;
-        if (strcmp(name2, parser->type_auth + aIdx2 * TYPE_SIZE) == 0 && 
-            parser->resid_auth[aIdx2] == resid2 &&
-            strcmp(chain2, parser->chain_auth + aIdx2 * CHAIN_SIZE) == 0) {
-          k++;
-          break;
-        } else {
-          uid2 = parser->hashMem[uid2].next;
-        }
-      } while (uid2 != 0); // 0 indicates end of "list"
-
-      if (k == 2) {
-        parser->bondsFrom[parser->nbonds + bnum] = aIdx1+1;  // vmd doesn't use 0 based index for bond info?
-        parser->bondsTo[parser->nbonds + bnum] = aIdx2+1;
-        ++bnum;
-      }
-    }
-#ifdef PDBX_DEBUG
-    else {
-      printf("^^^^Could locate bond^^^^^, %s %d\n", chain1, resid1);
-      printf("Error finding atom ");
-      if (uid1 == 0)
-        printf("1 ");
-      if (uid2 == 0)
-        printf("2");
-      printf("\n");
-    }
-#endif
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read RMSD bond deviation information.\n");
-      return false;
-    }
-  }
-
-  parser->nbonds += bnum;
-#ifdef PDBX_DEBUG
-  printf("pdbxplugin) nbonds defined: %d\n", nbonds);
-#endif
-  return (bnum == 0) ? false : true;
-}
- 
-
-static bool readRMSDBonds(molfile_atom_t * atoms, pdbxParser* parser) {
-  char buffer[BUFFER_SIZE];
-  int bondTable[32];
-  char* columns[32];
-  int bondTableSize = 0;
-  int bnum = 0;
-  int i, pos, j, k;
-  fpos_t filePos;
-  char junk[16];
-  char modelNum[8];
-  char name1[8];
-  char wordbuffer[16];
-  char name2[8];
-  char chain1[8];
-  char chain2[8];
-  char resid1buffer[8];
-  char resid2buffer[8];
-  int resid1, resid2;
-  int uid1, uid2;
-  int aIdx1, aIdx2;
-  molfile_atom_t * atom;
-
-  /* skip through the file until we find the bond information */
-  do {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      parser->nbonds = 0;
-      return false;
-    }
-  } while (!isValidateRMSDBond(buffer));
-
-  fgetpos(parser->file, &filePos);
-
-  //if (sscanf(  return if two words in one table definition line
-
-  /* Parse table header data */
-  while (isValidateRMSDBond(buffer)) {
-    sscanf(buffer+25, "%s", wordbuffer); // table is used in parseStructure too
-    /* assign integer values to each column */
-    if (0 == strcmp(wordbuffer, "auth_atom_id_1")) {
-      columns[bondTableSize] = (char*)name1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_1")) {
-      columns[bondTableSize] = (char*)chain1;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_1")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_1")) {
-      columns[bondTableSize] = (char*)resid1buffer;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_atom_id_2")) {
-      columns[bondTableSize] = (char*)name2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_asym_id_2")) {
-      columns[bondTableSize] = (char*)chain2;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_comp_id_2")) {
-      columns[bondTableSize] = (char*)junk;
-    }
-    else if (0 == strcmp(wordbuffer, "auth_seq_id_2")) {
-      columns[bondTableSize] = (char*)resid2buffer;
-    }
-    else {
-      columns[bondTableSize] = (char*)junk;
-    }
-    ++bondTableSize;
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-    
-  }
-
-  /* figure out how many bonds are being defined */
-  while (buffer[0] != '#') {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-    ++bnum;
-  }
-
-  parser->nbonds = bnum;
-  parser->bondsTo = (int*)malloc(bnum * sizeof(int));
-  parser->bondsFrom = (int*)malloc(bnum * sizeof(int));
-
-  /* Skip back to the start of the bond info */
-  fsetpos(parser->file, &filePos);
-  if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-    printf("pdbxplugin) could not read bond information.\n");
-    return false;
-  }
-  /* Skip through the header */
-  while (isValidateRMSDBond(buffer)) {
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read bond information.\n");
-      return false;
-    }
-  }
-
-  bnum = 0;
-  while (buffer[0] != '#') {
-    pos = 0;
-    /* copy each column of the table into the appropriate columns index */
-    for (i=0; i<bondTableSize; ++i) {
-        getNextWord(buffer, columns[i], pos);
-    }
-    resid1 = atoi(resid1buffer);
-    resid2 = atoi(resid2buffer);
-    /* get unique res ID for hash table lookup */
-    uid1 = getUniqueResID(chain1, resid1);
-    uid2 = getUniqueResID(chain2, resid2);
-    k = 0;
-
-    /* find the atoms in the hash table */
-    if ( ((uid1 = inthash_lookup(&parser->bondHash, uid1)) != -1) && ((uid2 = inthash_lookup(&parser->bondHash, uid2)) != -1) ) {
-      /* because the hashtable is residue specifc, loop through all atoms in the residue to find the correct one */
-      /* Find atom 1 */
-      do {
-        aIdx1 = parser->hashMem[uid1].index;
-        if (strcmp(name1, parser->type_auth + aIdx1 * TYPE_SIZE) == 0 && parser->resid_auth[aIdx1] == resid1 &&
-            strcmp(chain1, parser->chain_auth + aIdx1 * CHAIN_SIZE) == 0){
-          k++;
-          break;
-        }
-        else
-          uid1 = parser->hashMem[uid1].next;
-      } while (uid1 != 0); //0 indicates end of "list"
-
-      /* find atom 2 */
-      do {
-        aIdx2 = parser->hashMem[uid2].index;
-        if (strcmp(name2, parser->type_auth + aIdx2 * TYPE_SIZE) == 0 && parser->resid_auth[aIdx2] == resid2 &&
-            strcmp(chain2, parser->chain_auth + aIdx2 * CHAIN_SIZE) == 0){
-          k++;
-          break;
-        }
-        else
-          uid2 = parser->hashMem[uid2].next;
-      } while (uid2 != 0); // 0 indicates end of "list"
-
-      if (k == 2) {
-        parser->bondsFrom[bnum] = aIdx1+1;  // vmd doesn't use 0 based index for bond info?
-        parser->bondsTo[bnum] = aIdx2+1;
-        ++bnum;
-      }
-    }
-#ifdef PDBX_DEBUG
-    else {
-      printf("^^^^Could locate bond^^^^^, %s %d\n", chain1, resid1);
-      printf("Error finding atom ");
-      if (uid1 == 0)
-        printf("1 ");
-      if (uid2 == 0)
-        printf("2");
-      printf("\n");
-    }
-#endif
-
-    if (NULL == fgets(buffer, BUFFER_SIZE, parser->file)) {
-      printf("pdbxplugin) could not read RMSD bond deviation information.\n");
-      return false;
-    }
-  }
-  parser->nbonds = bnum;
-#ifdef PDBX_DEBUG
-  printf("pdbxplugin) nbonds defined: %d\n", nbonds);
-#endif
-  return (bnum > 0);
-}
-
-
-static bool readBonds(molfile_atom_t * atoms, pdbxParser* parser) {
-  bool retval = false;
-  retval |= readRMSDBonds(atoms, parser);
-  retval |= readAngleBonds(atoms, parser);
-  return retval;
-}
-
-
-static inline bool isValidateRMSDBond(char * str) {
-  /* return str[0-24] == "_pdbx_validate_rmsd_bond." */
-  return (str[0] == '_' && str[1] == 'p' && str[2] == 'd' && str[3] == 'b' &&
-          str[4] == 'x' && str[5] == '_' && str[6] == 'v' && str[7] == 'a' &&
-          str[8] == 'l' && str[9] == 'i' && str[10] == 'd' && str[11] == 'a' &&
-          str[12] == 't' && str[13] == 'e' && str[14] == '_' && str[15] == 'r' &&
-          str[16] == 'm' && str[17] == 's' && str[18] == 'd' && str[19] == '_' &&
-          str[20] == 'b' && str[21] == 'o' && str[22] == 'n' && str[23] == 'd' &&
-          str[24] == '.');
-}
-
-static inline bool isAtomSite(char * str) {
-  return (str[0]=='_' && str[1]=='a' && str[2]=='t' && str[3]=='o' && str[4]=='m' &&
-          str[5]=='_' && str[6]=='s' && str[7]=='i' && str[8]=='t' && str[9]=='e' &&
-          str[10]=='.');
-}
-
-/* start of pdbxWriter implementation */
-
-static pdbxWriter* create_pdbxWriter(const char* filename, int numAtoms) {
-  pdbxWriter* writer = new pdbxWriter;
-  int length = strlen(filename);
-  int start = 0;
-  int end = length;
-  int i;
-  writer->numatoms = numAtoms;
-  writer->bufferCount = 0;
-
-  writer->fd = fopen(filename, "w");
-  /* get name of pdb file */
-  for (i=0; i<length; ++i) {
-    if (filename[i] == '/' || filename[i] == '\\') {
-      if (i+1 < length)
-        start = i+1;
-    }
-    if (filename[i] == '.')
-      end = i;
-  }
-  strncpy(writer->pdbName, filename + start, end - start);
-  writer->pdbName[end-start] = '\0';
-  return writer;
-}
-
-static void addCoordinates(const float* coords, pdbxWriter* writer) {
-  writer->coordinates = coords;
-}
-
-static void addAtoms(const molfile_atom_t* atomlist, int optflags, pdbxWriter* writer) {
-  int i;
-  writer->atoms = new molfile_atom_t[writer->numatoms];
-  molfile_atom_t* atoms = writer->atoms;
-  
-  memcpy(atoms, atomlist, writer->numatoms * sizeof(molfile_atom_t));
-
-  /* If occ, bfactor, and insertion aren't given, we assign defaultvalues. */
-  if (!(optflags & MOLFILE_OCCUPANCY)) {
-    for (i=0; i<writer->numatoms; i++)
-      atoms[i].occupancy = 0.0f;
-  }
-  if (!(optflags & MOLFILE_BFACTOR)) {
-    for (i=0; i<writer->numatoms; i++)
-      atoms[i].bfactor= 0.0f;
-  }
-  if (!(optflags & MOLFILE_INSERTION)) {
-    for (i=0; i<writer->numatoms; i++) {
-      atoms[i].insertion[0] =' ';
-      atoms[i].insertion[1] ='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ALTLOC)) {
-    for (i=0; i<writer->numatoms; i++) {
-      atoms[i].altloc[0]=' ';
-      atoms[i].altloc[1]='\0';
-    }
-  }
-  if (!(optflags & MOLFILE_ATOMICNUMBER)) {
-    for (i=0; i<writer->numatoms; i++)
-      atoms[i].atomicnumber = 0;
-  }
-}
-
-static void writeAtomSite(pdbxWriter* writer) {
-  char lineBuffer[BUFFER_SIZE];
-  int i;
-  const float* x, *y, *z;
-  molfile_atom_t* atoms = writer->atoms;
-  x = writer->coordinates;
-  y = x+1;
-  z = x+2;
-
-  for (i=0; i<writer->numatoms; ++i) {
-    sprintf(lineBuffer,"ATOM %d %s %s . %s %s . %d ? %f %f %f %f %f %s\n",
-            i+1, atoms[i].name, atoms[i].type, atoms[i].resname, atoms[i].chain,
-            atoms[i].resid, *x, *y, *z, atoms[i].occupancy,
-            atoms[i].charge, atoms[i].chain);
-    x += 3;
-    y += 3;
-    z += 3;
-    write(lineBuffer, writer);
-  }
-}
-
-
-static void writeFile(pdbxWriter* writer) {
-  /* write PDBx header */
-  writeIntro(writer);
-  write(atomSiteHeader, writer);
-  writeAtomSite(writer);
-  write("#\n", writer);
-  close(writer);
-}
-
-static void writeIntro(pdbxWriter* writer) {
-  write("data_", writer);
-  write(writer->pdbName, writer);
-  write("\n", writer);
-}
-
-static void close(pdbxWriter* writer) {
-  writeBuffer(writer);
-  fclose(writer->fd);
-}
-
-static void write(const char* str, pdbxWriter* writer) {
-  int length = strlen(str);
-  int copy_size;
-  int num_copied = 0;
-
-  if (length + writer->bufferCount < WB_SIZE) {
-    memcpy(writer->writeBuf + writer->bufferCount, str, length);
-    writer->bufferCount += length;
-  }
-  else do {
-    copy_size = WB_SIZE - writer->bufferCount;
-    if (copy_size + num_copied > length) {
-      copy_size = length - num_copied;
-    }
-    memcpy(writer->writeBuf + writer->bufferCount, str + num_copied, copy_size);
-    writer->bufferCount += copy_size;
-    num_copied += copy_size;
-    if (writer->bufferCount == WB_SIZE) {
-      writeBuffer(writer);
-    }
-  } while (num_copied < length);
-}
-
-static void writeBuffer(pdbxWriter* writer) {
-  if (writer->bufferCount == 0)
-    return;
-  fwrite(writer->writeBuf, sizeof(char), writer->bufferCount, writer->fd);
-  writer->bufferCount = 0;
-}
-
-
-/*
- * API functions start here
- */
-
-typedef struct {
-  pdbxParser * parser;
-  pdbxWriter * writer;
-  int natoms;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-  int readTS;
-} pdbx_data;
-
-
-static void * open_pdbx_read(const char *filepath, const char *filetype,
-                             int *natoms) {
-  pdbx_data *data;
-  data = new pdbx_data;
-  data->readTS = 0;
-  data->parser = create_pdbxParser(filepath);
-  data->natoms = data->parser->natoms;
-  *natoms = data->natoms;
-  if (*natoms == 0) //If no atoms were found this is not a pdb file
-    return NULL;
-  if (data->parser->error)
-    return NULL;
-  return data;
-}
-
-static int read_pdbx_structure(void * mydata, int *optflags, molfile_atom_t *atoms) {
-  pdbx_data * data = (pdbx_data *)mydata;
-  *optflags = MOLFILE_NOOPTIONS;
-#if 0
-  // XXX the current pdbx code doesn't actually throw any exceptions so the try
-  //     block causes linkage problems on Android if it is used as-is.
-  try {
-    parseStructureFaster(atoms, optflags, data->parser);
-  } catch (...) {
-    printf("pdbxplugin) Error while trying to read file\n");
-    return MOLFILE_ERROR;
-  }
-#else
-  if (parseStructureFaster(atoms, optflags, data->parser)) {
-    printf("pdbxplugin) Error while trying to parse pdbx structure\n");
-    return MOLFILE_ERROR;
-  }
-#endif
-
-  printf("pdbxplugin) Starting to read bonds...\n");
-  readBonds(atoms, data->parser);
-  *optflags |= MOLFILE_BONDSSPECIAL;
-  return MOLFILE_SUCCESS;
-}
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                      float ** bondorder,int **bondtype,
-                      int *nbondtypes, char ***bondtypename) {
-  pdbx_data * data = (pdbx_data *)v;
-  if (data->parser->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-  } else {
-    *nbonds = data->parser->nbonds;
-    *fromptr = data->parser->bondsFrom;
-    *toptr = data->parser->bondsTo;
-  }
-  *bondorder = NULL;
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_pdbx_timestep(void * mydata, int natoms, molfile_timestep_t *ts) {
-  pdbx_data * data = (pdbx_data *)mydata;
-  if (data->readTS)
-    return MOLFILE_ERROR;
-  data->readTS = 1;
-  setCoordinatesFast(ts->coords, data->parser);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pdbx_read(void *v) {
-  pdbx_data * data = (pdbx_data *)v;
-  delete_pdbxParser(data->parser);
-  delete data;
-}
-
-static void* open_file_write(const char *path, const char *filetypye, int natoms) {
-  FILE* fd;
-  pdbx_data * data = new pdbx_data;
-  data->writer = create_pdbxWriter(path, natoms);
-  return data;
-}
-
-static int write_structure(void* v, int optflags, const molfile_atom_t *atoms) {
-  pdbx_data * data = (pdbx_data *)v;
-  addAtoms(atoms, optflags, data->writer);
-  return MOLFILE_SUCCESS;
-}
-
-static int write_timestep(void *v, const molfile_timestep_t* ts) {
-  pdbx_data * data = (pdbx_data *)v;
-  addCoordinates(ts->coords, data->writer);
-  writeFile(data->writer);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_file_write(void* v) {
-  pdbx_data* data = (pdbx_data*)v;
-  delete data->writer;
-  delete data;
-}
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pdbx";
-  plugin.prettyname = "mmCIF/PDBX";
-  plugin.author = "Brendan McMorrow";
-  plugin.majorv = 0;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "cif";
-  plugin.open_file_read = open_pdbx_read;
-  plugin.read_structure = read_pdbx_structure;
-  plugin.read_next_timestep = read_pdbx_timestep;
-  plugin.read_bonds = read_bonds;
-  plugin.open_file_write = open_file_write;
-  plugin.write_structure = write_structure;
-  plugin.write_timestep = write_timestep;
-  plugin.close_file_write = close_file_write;
-  plugin.close_file_read = close_pdbx_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  pdbx_data *v;
-  int natoms, bnum, nbtypes;
-  float *border[1];
-  float *x, *y, *z;
-  int *btype[1];
-  char **btypenames[1];
-  int i, set;
-
-//  while (--argc) {
-    ++argv;
-
-  struct timeval  tot1, tot2;
-  gettimeofday(&tot1, NULL);
-    if (*argv != NULL)
-      v = (pdbx_data*)open_pdbx_read(*argv, "pdbx", &natoms);
-    else
-   //   v = (pdbx_data*)open_pdbx_read("/Users/Brendan/pdbx/3j3q.cif", "pdbx", &natoms);
-      v = (pdbx_data*)open_pdbx_read("/home/brendanbc1/Downloads/3j3q.cif", "pdbx", &natoms);
-    if (!v) {
-      fprintf(stderr, "main) open_pdbx_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "main) open_pdbx_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "main) number of atoms: %d\n", natoms);
-
-    set = 0;
-    molfile_atom_t * atoms = new molfile_atom_t[natoms];
-    if (MOLFILE_SUCCESS == read_pdbx_structure(v, &set, atoms)){
-      printf("xyz structure successfully read.\n");
-    } else {
-      fprintf(stderr, "main) error reading pdbx file\n");
-    }
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    if (!read_pdbx_timestep(v, natoms, &timestep)) {
-      fprintf(stderr, "main) open_pdbx_read succeeded for file %s\n", *argv);
-    } else {
-      fprintf(stderr, "main) Failed to read timestep\n");
-    }
-
-    gettimeofday(&tot2, NULL);
-    printf ("Total time to read file: %f seconds\n",
-           (double) (tot2.tv_usec - tot1.tv_usec) / 1000000 +
-           (double) (tot2.tv_sec - tot1.tv_sec));
-    close_pdbx_read(v);
-
-
-    printf("Writing file...\n");
-    v = (pdbx_data*)open_file_write("/home/brendanbc1/test.cif", 0, natoms);
-
-    //v = (pdbx_data*)open_file_write("/Users/Brendan/test.cif", 0, natoms);
-    printf("File opened for writing...\n");
-    //printf("%d\n", v->writer->numatoms);
-    write_structure(v, set, (const molfile_atom_t*)atoms);
-    printf("Structure information gathered...\n");
-    write_timestep(v, &timestep);
-    printf("File written...\n");
-    close_file_write(v);
-    printf("File closed.\n");
-    delete [] atoms;
-         /*
-    printf("Writing pdbx.txt\n");
-    x = timestep.coords; y = x+1;
-    z = x+2;
-    FILE *f;
-    f = fopen("pdbx.txt", "w");
-    for(i=0; i<natoms; i++) {
-      fprintf(f, "%i %d %s %s %s %f %f %f\n", atoms[i].atomicnumber, atoms[i].resid, atoms[i].chain, atoms[i].resname, atoms[i].type, *x,*y,*z);
-      //fprintf(stderr, "%i\t%s  %s\t%s  %s  %i  %f\t%f\t%f\t%f\t%f\t%f\n", i+1, atoms[i].name, atoms[i].type,
-        //      atoms[i].chain, atoms[i].resname, atoms[i].resid, *x, *y, *z, atoms[i].occupancy, atoms[i].bfactor, atoms[i].charge);
-      x+=3;
-      y+=3;
-      z+=3;
-    }
-    fclose(f);
-    printf("main) pdbx.txt written\n");
- // }
- */
-  return 0;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/periodic_table.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/periodic_table.h
deleted file mode 100644
index 36f9e5a902e77ba9a428ddb6b370484476c3145f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/periodic_table.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: periodic_table.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.12 $       $Date: 2009/01/21 17:45:41 $
- *
- ***************************************************************************/
-
-/*
- * periodic table of elements and helper functions to convert
- * ordinal numbers to labels and back.
- * all tables and functions are declared static, so that it
- * can be safely included by all plugins that may need it.
- *
- * 2002-2009 akohlmey@cmm.chem.upenn.edu, vmd@ks.uiuc.edu
- */
-
-#include <string.h>
-#include <ctype.h>
-
-/* periodic table of elements for translation of ordinal to atom type */
-static const char *pte_label[] = { 
-    "X",  "H",  "He", "Li", "Be", "B",  "C",  "N",  "O",  "F",  "Ne",
-    "Na", "Mg", "Al", "Si", "P" , "S",  "Cl", "Ar", "K",  "Ca", "Sc",
-    "Ti", "V",  "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", 
-    "As", "Se", "Br", "Kr", "Rb", "Sr", "Y",  "Zr", "Nb", "Mo", "Tc",
-    "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I",  "Xe",
-    "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb",
-    "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W",  "Re", "Os",
-    "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr",
-    "Ra", "Ac", "Th", "Pa", "U",  "Np", "Pu", "Am", "Cm", "Bk", "Cf",
-    "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt",
-    "Ds", "Rg"
-};
-static const int nr_pte_entries = sizeof(pte_label) / sizeof(char *);
-
-/* corresponding table of masses. */
-static const float pte_mass[] = { 
-    /* X  */ 0.00000, 1.00794, 4.00260, 6.941, 9.012182, 10.811,  
-    /* C  */ 12.0107, 14.0067, 15.9994, 18.9984032, 20.1797, 
-    /* Na */ 22.989770, 24.3050, 26.981538, 28.0855, 30.973761,
-    /* S  */ 32.065, 35.453, 39.948, 39.0983, 40.078, 44.955910,
-    /* Ti */ 47.867, 50.9415, 51.9961, 54.938049, 55.845, 58.9332,
-    /* Ni */ 58.6934, 63.546, 65.409, 69.723, 72.64, 74.92160, 
-    /* Se */ 78.96, 79.904, 83.798, 85.4678, 87.62, 88.90585, 
-    /* Zr */ 91.224, 92.90638, 95.94, 98.0, 101.07, 102.90550,
-    /* Pd */ 106.42, 107.8682, 112.411, 114.818, 118.710, 121.760, 
-    /* Te */ 127.60, 126.90447, 131.293, 132.90545, 137.327, 
-    /* La */ 138.9055, 140.116, 140.90765, 144.24, 145.0, 150.36,
-    /* Eu */ 151.964, 157.25, 158.92534, 162.500, 164.93032, 
-    /* Er */ 167.259, 168.93421, 173.04, 174.967, 178.49, 180.9479,
-    /* W  */ 183.84, 186.207, 190.23, 192.217, 195.078, 196.96655, 
-    /* Hg */ 200.59, 204.3833, 207.2, 208.98038, 209.0, 210.0, 222.0, 
-    /* Fr */ 223.0, 226.0, 227.0, 232.0381, 231.03588, 238.02891,
-    /* Np */ 237.0, 244.0, 243.0, 247.0, 247.0, 251.0, 252.0, 257.0,
-    /* Md */ 258.0, 259.0, 262.0, 261.0, 262.0, 266.0, 264.0, 269.0,
-    /* Mt */ 268.0, 271.0, 272.0
-};
-
-/*
- * corresponding table of VDW radii.
- * van der Waals radii are taken from A. Bondi, 
- * J. Phys. Chem., 68, 441 - 452, 1964, 
- * except the value for H, which is taken from R.S. Rowland & R. Taylor, 
- * J.Phys.Chem., 100, 7384 - 7391, 1996. Radii that are not available in 
- * either of these publications have RvdW = 2.00 Ã….
- * The radii for Ions (Na, K, Cl, Ca, Mg, and Cs are based on the CHARMM27 
- * Rmin/2 parameters for (SOD, POT, CLA, CAL, MG, CES) by default.
- */
-static const float pte_vdw_radius[] = { 
-    /* X  */ 1.5, 1.2, 1.4, 1.82, 2.0, 2.0,  
-    /* C  */ 1.7, 1.55, 1.52, 1.47, 1.54, 
-    /* Na */ 1.36, 1.18, 2.0, 2.1, 1.8,
-    /* S  */ 1.8, 2.27, 1.88, 1.76, 1.37, 2.0,
-    /* Ti */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Ni */ 1.63, 1.4, 1.39, 1.07, 2.0, 1.85,
-    /* Se */ 1.9, 1.85, 2.02, 2.0, 2.0, 2.0, 
-    /* Zr */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Pd */ 1.63, 1.72, 1.58, 1.93, 2.17, 2.0, 
-    /* Te */ 2.06, 1.98, 2.16, 2.1, 2.0,
-    /* La */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Eu */ 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Er */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* W  */ 2.0, 2.0, 2.0, 2.0, 1.72, 1.66,
-    /* Hg */ 1.55, 1.96, 2.02, 2.0, 2.0, 2.0, 2.0,
-    /* Fr */ 2.0, 2.0, 2.0, 2.0, 2.0, 1.86,
-    /* Np */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Md */ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
-    /* Mt */ 2.0, 2.0, 2.0
-};
-
-/* lookup functions */
-
-static const char *get_pte_label(const int idx)
-{
-    if ((idx < 1) || (idx >= nr_pte_entries)) return pte_label[0];
-
-    return pte_label[idx];
-}
-
-static float get_pte_mass(const int idx)
-{
-    if ((idx < 1) || (idx >= nr_pte_entries)) return pte_mass[0];
-
-    return pte_mass[idx];
-}
-
-static float get_pte_vdw_radius(const int idx)
-{
-    if ((idx < 1) || (idx >= nr_pte_entries)) return pte_vdw_radius[0];
-
-#if 1
-    /* Replace with Hydrogen radius with an "all-atom" radius */
-    if (idx == 1)
-      return 1.0;    /* H  */
-#else
-    /* Replace with old VMD atom radii values */
-    switch (idx) {
-      case  1: return 1.0;    /* H  */
-      case  6: return 1.5;    /* C  */
-      case  7: return 1.4;    /* N  */
-      case  8: return 1.3;    /* O  */
-      case  9: return 1.2;    /* F  */
-      case 15: return 1.5;    /* P  */
-      case 16: return 1.9;    /* S  */ 
-    }
-#endif
-
-    return pte_vdw_radius[idx];
-}
-
-static int get_pte_idx(const char *label)
-{
-    int i;
-    char atom[3];
-    
-    /* zap string */
-    atom[0] = (char) 0;
-    atom[1] = (char) 0;
-    atom[2] = (char) 0;
-    /* if we don't have a null-pointer, there must be at least two 
-     * chars, which is all we need. we convert to the capitalization 
-     * convention of the table above during assignment. */
-    if (label != NULL) {
-        atom[0] = (char) toupper((int) label[0]);
-        atom[1] = (char) tolower((int) label[1]);
-    }
-    /* discard numbers in atom label */
-    if (isdigit(atom[1])) atom[1] = (char) 0;
-    
-    for (i=0; i < nr_pte_entries; ++i) {
-        if ( (pte_label[i][0] == atom[0])
-             && (pte_label[i][1] == atom[1]) ) return i;
-    }
-    
-    return 0;
-}
-
-static int get_pte_idx_from_string(const char *label) {
-  int i, ind;
-  char atom[3];
-
-  if (label != NULL) {
-    /* zap string */
-    atom[0] = atom[1] = atom[2] = '\0';
-
-    for (ind=0,i=0; (ind<2) && (label[i]!='\0'); i++) {
-      if (label[i] != ' ') {
-        atom[ind] = toupper(label[i]);
-        ind++;
-      }
-    }
-
-    if (ind < 1)
-      return 0; /* no non-whitespace characters */
- 
-    for (i=0; i < nr_pte_entries; ++i) {
-      if ((toupper(pte_label[i][0]) == atom[0]) && (toupper(pte_label[i][1]) == atom[1])) 
-        return i;
-    }
-  }  
-
-  return 0;
-}
-
-#if 0
-#include <stdio.h>
-
-int main() {
-  int i;
-
-  printf("Periodic table check/dump\n");
-  printf("  Table contains data for %d elements\n", nr_pte_entries);
-  printf("   Mass table size check: %d\n", sizeof(pte_mass) / sizeof(float));
-  printf("    VDW table size check: %d\n", sizeof(pte_vdw_radius) / sizeof(float));
-  printf("\n");
-  printf("Symbol Num    Mass   rVDW\n");
-  for (i=0; i<nr_pte_entries; i++) {
-    printf("   %-2s  %3d  %6.2f  %4.2f\n",
-      get_pte_label(i), i, get_pte_mass(i), get_pte_vdw_radius(i));
-  } 
-  return 0;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/phiplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/phiplugin.C
deleted file mode 100644
index ffc7282aca64da52fca6e6655fc52578576ac6b4..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/phiplugin.C
+++ /dev/null
@@ -1,261 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: phiplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.28 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * "Formatted ASCII '.big'" potential maps from Delphi
- *   This format is created by the 'ASCIIPHI' program which was available with
- *   Delphi V3:
- *     http://www.csb.yale.edu/userguides/datamanip/delphi/manual.html#ASCIIPHI
- *
- *   More info for this format can be found at:
- *     http://www.msg.ucsf.edu/local/programs/insightII/doc/life/insight2000.1/delphi/B_Utilities.html
- * 
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int ndata;
-  molfile_volumetric_t *vol;
-} phi_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *phigets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    fprintf(stderr, "phiplugin) Unexpected end-of-file.\n");
-    returnVal = NULL; 
-  }
-  else if (ferror(stream)) {
-    fprintf(stderr, "phiplugin) Error reading file.\n");
-    return NULL;
-  }
-  else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      fprintf(stderr, "phiplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static void *open_phi_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  phi_t *phi;
-  char inbuf[LINESIZE];
-
-  float scale, midX, midY, midZ;
-  float cellSize, iGrid = 0.0;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "phiplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* Skip the header */
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-
-  /* Unit cell information is located at the *end* of the file. */
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  while (strncasecmp(inbuf, " end of phimap", 14) != 0) {
-    /* use integer division so trailing whitespace isn't included in the
-     * count */
-    iGrid += strlen(inbuf) / 4; 
-
-    if (phigets(inbuf, LINESIZE, fd) == NULL) {
-      return NULL;
-    }
-  } 
-
-  /* Find the cube-root of the number of datapoints (this will give the
-   * number of datapoints in each direction) and make sure it's an integer
-   */
-  cellSize = pow((double) iGrid, (double) 1.0/3.0);
-  if (fabs((double)(cellSize - floor(cellSize))) > 1e-8) {
-    return NULL;
-  }
-
-  /* Read the unit cell information */
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return NULL;
-  }
-  sscanf(inbuf, " %f %f %f %f", &scale, &midX, &midY, &midZ);
-
-  /* Allocate and initialize the phi structure */
-  phi = new phi_t;
-  phi->fd = fd;
-  phi->vol = NULL;
-  phi->ndata = (int) iGrid;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  phi->nsets = 1; /* this file contains only one data set */
-
-  phi->vol = new molfile_volumetric_t[1];
-  strcpy(phi->vol[0].dataname, "PHIMAP Electron Density Map");
-
-  /* <midX, midY, midZ> is the middle point of the grid. */
-  phi->vol[0].origin[0] = -0.5*(cellSize+1.0) / scale + midX;
-  phi->vol[0].origin[1] = -0.5*(cellSize+1.0) / scale + midY;
-  phi->vol[0].origin[2] = -0.5*(cellSize+1.0) / scale + midZ;
-
-  phi->vol[0].xaxis[0] = cellSize / scale;
-  phi->vol[0].xaxis[1] = 0;
-  phi->vol[0].xaxis[2] = 0;
-
-  phi->vol[0].yaxis[0] = 0;
-  phi->vol[0].yaxis[1] = cellSize / scale;
-  phi->vol[0].yaxis[2] = 0;
-  
-  phi->vol[0].zaxis[0] = 0;
-  phi->vol[0].zaxis[1] = 0;
-  phi->vol[0].zaxis[2] = cellSize / scale;
-
-  phi->vol[0].xsize = (int) cellSize;
-  phi->vol[0].ysize = (int) cellSize;
-  phi->vol[0].zsize = (int) cellSize;
-
-  phi->vol[0].has_color = 0;
-
-  return phi;
-}
-
-static int read_phi_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  phi_t *phi = (phi_t *)v;
-  *nsets = phi->nsets; 
-  *metadata = phi->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_phi_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  phi_t *phi = (phi_t *)v;
-  float *cellIndex;
-  int value, ndata, count = 0;
-  FILE *fd = phi->fd;
-  char inbuf[LINESIZE], currNum[5], *currChar;
-
-  cellIndex = datablock;
-  ndata = phi->ndata;
-  memset(currNum, 0, 5);
-
-  /* Skip the header */
-  rewind(fd);
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return MOLFILE_ERROR;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return MOLFILE_ERROR;
-  }
-  if (phigets(inbuf, LINESIZE, fd) == NULL) {
-    return MOLFILE_ERROR;
-  }
-
-  /* Read the densities. Order for file is x fast, y medium, z slow */
-  while (count < ndata) {
-    if (phigets(inbuf, LINESIZE, fd) == NULL) {
-      return MOLFILE_ERROR;
-    }
-
-    for (currChar = inbuf; (*currChar != '\n') && (*currChar != '\0'); 
-         currChar += 4) {
-      strncpy(currNum, currChar, 4);
-      value = atoi(currNum);
-      /* Scale -- units are in kT/e (25.6mV, 0.593 kcal/mole at 25°C). */
-      *cellIndex = 0.01 * (value - 5000);
-      cellIndex++;
-      count++;
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_phi_read(void *v) {
-  phi_t *phi = (phi_t *)v;
-
-  fclose(phi->fd);
-  if (phi->vol != NULL)
-    delete [] phi->vol; 
-  delete phi;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "delphibig";
-  plugin.prettyname = "Delphi 'Big' Formatted Potential Map";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "big";
-  plugin.open_file_read = open_phi_read;
-  plugin.read_volumetric_metadata = read_phi_metadata;
-  plugin.read_volumetric_data = read_phi_data;
-  plugin.close_file_read = close_phi_read;
-  return VMDPLUGIN_SUCCESS; 
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pltplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pltplugin.C
deleted file mode 100644
index 27f45ac6a24caae84c329ff79488190c3230bfc7..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pltplugin.C
+++ /dev/null
@@ -1,187 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pltplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * plt format electron density maps from gOpenMol.
- *
- * More info for format can be found at 
- * <http://www.csc.fi/gopenmol/developers/plt_format.phtml>
- * 
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  int swap;
-  molfile_volumetric_t *vol;
-} plt_t;
-
-
-static void *open_plt_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  plt_t *plt;
-  int swap=0;
-  // File header data:
-  int intHeader[5];
-  float floatHeader[6];
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "pltplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // Integer header info: rank (always 3), surface type, z length, y length, 
-  // x length.
-  fread(intHeader, sizeof(int), 5, fd);
-  if (intHeader[0] != 3) {
-    // check if the bytes need to be swapped
-    swap4_aligned(intHeader, 5);
-    if (intHeader[0] == 3) 
-      swap = 1;
-    else {
-      fprintf(stderr, "pltplugin) Incorrect header.\n");
-      return NULL;
-    }
-  }
-
-  // Float header info: z min, z max, y min, y max, xmin, x max.
-  fread(floatHeader, sizeof(float), 6, fd);
-  if (swap)
-    swap4_aligned(floatHeader, 6);
-
-  // Allocate and initialize the plt structure
-  plt = new plt_t;
-  plt->fd = fd;
-  plt->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  plt->nsets = 1; // this file contains only one data set
-  plt->swap = swap;
-
-  plt->vol = new molfile_volumetric_t[1];
-  strcpy(plt->vol[0].dataname, "PLT Electron Density Map");
-
-  // Best guesses for unit cell information, as none is included in the plt
-  // file format.
-  plt->vol[0].origin[0] = floatHeader[4];
-  plt->vol[0].origin[1] = floatHeader[2];
-  plt->vol[0].origin[2] = floatHeader[0];
-
-  plt->vol[0].xaxis[0] = floatHeader[5] - floatHeader[4];
-  plt->vol[0].xaxis[1] = 0;
-  plt->vol[0].xaxis[2] = 0;
-
-  plt->vol[0].yaxis[0] = 0;
-  plt->vol[0].yaxis[1] = floatHeader[3] - floatHeader[2];
-  plt->vol[0].yaxis[2] = 0;
-  
-  plt->vol[0].zaxis[0] = 0;
-  plt->vol[0].zaxis[1] = 0;
-  plt->vol[0].zaxis[2] = floatHeader[1] - floatHeader[0];
-
-  plt->vol[0].xsize = intHeader[4];
-  plt->vol[0].ysize = intHeader[3];
-  plt->vol[0].zsize = intHeader[2];
-
-  plt->vol[0].has_color = 0;
-
-  return plt;
-}
-
-static int read_plt_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  plt_t *plt = (plt_t *)v;
-  *nsets = plt->nsets; 
-  *metadata = plt->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_plt_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  plt_t *plt = (plt_t *)v;
-  int swap, ndata;
-  FILE *fd = plt->fd;
-
-  swap = plt->swap;
-  ndata = plt->vol[0].xsize * plt->vol[0].ysize * plt->vol[0].zsize;
-
-  // Read the densities. Order for file is x fast, y medium, z slow
-  if ( fread(datablock, sizeof(float), ndata, fd) != ndata ) {
-    fprintf(stderr, "pltplugin) Error reading data, not enough values read.\n");
-    return MOLFILE_ERROR;
-  }
-
-  if (swap) 
-    swap4_aligned(datablock, ndata);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_plt_read(void *v) {
-  plt_t *plt = (plt_t *)v;
-
-  fclose(plt->fd);
-  if (plt->vol != NULL)
-    delete [] plt->vol; 
-  delete plt;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "plt";
-  plugin.prettyname = "gOpenmol plt";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "plt";
-  plugin.open_file_read = open_plt_read;
-  plugin.read_volumetric_metadata = read_plt_metadata;
-  plugin.read_volumetric_data = read_plt_data;
-  plugin.close_file_read = close_plt_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/plugintest.x b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/plugintest.x
deleted file mode 100755
index fefead8cbee590a12bd4fecef55c29ef00908bfc..0000000000000000000000000000000000000000
Binary files a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/plugintest.x and /dev/null differ
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ply.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ply.c
deleted file mode 100644
index 272d31af32a9fbadacd8901494c0065bfc4f7b25..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ply.c
+++ /dev/null
@@ -1,3316 +0,0 @@
-/*
-
-The interface routines for reading and writing PLY polygon files.
-
-Greg Turk
-
----------------------------------------------------------------
-
-A PLY file contains a single polygonal _object_.
-
-An object is composed of lists of _elements_.  Typical elements are
-vertices, faces, edges and materials.
-
-Each type of element for a given object has one or more _properties_
-associated with the element type.  For instance, a vertex element may
-have as properties the floating-point values x,y,z and the three unsigned
-chars representing red, green and blue.
-
------------------------------------------------------------------------
-
-Copyright (c) 1998 Georgia Institute of Technology.  All rights reserved.   
-  
-Permission to use, copy, modify and distribute this software and its   
-documentation for any purpose is hereby granted without fee, provided   
-that the above copyright notice and this permission notice appear in   
-all copies of this software and that you do not sell the software.   
-  
-THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,   
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY   
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   
-
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <ply.h>
-
-char *type_names[] = {  /* names of scalar types */
-"invalid",
-"int8", "int16", "int32", "uint8", "uint16", "uint32", "float32", "float64",
-};
-
-char *old_type_names[] = {  /* old names of types for backward compatability */
-"invalid",
-"char", "short", "int", "uchar", "ushort", "uint", "float", "double",
-};
-
-int ply_type_size[] = {
-  0, 1, 2, 4, 1, 2, 4, 4, 8
-};
-
-#define NO_OTHER_PROPS  -1
-
-#define DONT_STORE_PROP  0
-#define STORE_PROP       1
-
-#define OTHER_PROP       0
-#define NAMED_PROP       1
-
-/* returns 1 if strings are equal, 0 if not */
-int equal_strings(char *, char *);
-
-/* find an element in a plyfile's list */
-PlyElement *find_element(PlyFile *, char *);
-
-/* find a property in an element's list */
-PlyProperty *find_property(PlyElement *, char *, int *);
-
-/* write to a file the word describing a PLY file data type */
-void write_scalar_type (FILE *, int);
-
-/* read a line from a file and break it up into separate words */
-char **get_words(FILE *, int *, char **);
-
-/* write an item to a file */
-void write_binary_item(FILE *, int, unsigned int, double, int);
-void write_ascii_item(FILE *, int, unsigned int, double, int);
-
-/* add information to a PLY file descriptor */
-void add_element(PlyFile *, char **, int);
-void add_property(PlyFile *, char **, int);
-void add_comment(PlyFile *, char *);
-void add_obj_info(PlyFile *, char *);
-
-/* copy a property */
-void copy_property(PlyProperty *, PlyProperty *);
-
-/* store a value into where a pointer and a type specify */
-void store_item(char *, int, int, unsigned int, double);
-
-/* return the value of a stored item */
-void get_stored_item( void *, int, int *, unsigned int *, double *);
-
-/* return the value stored in an item, given ptr to it and its type */
-double get_item_value(char *, int);
-
-/* get binary or ascii item and store it according to ptr and type */
-void get_ascii_item(char *, int, int *, unsigned int *, double *);
-void get_binary_item(FILE *, int, int *, unsigned int *, double *);
-
-/* get a bunch of elements from a file */
-void ascii_get_element(PlyFile *, char *);
-void binary_get_element(PlyFile *, char *);
-
-/* memory allocation */
-static char *my_alloc(int, int, char *);
-
-
-/*************/
-/*  Writing  */
-/*************/
-
-
-/******************************************************************************
-Given a file pointer, get ready to write PLY data to the file.
-
-Entry:
-  fp         - the given file pointer
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-
-Exit:
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *ply_write(
-  FILE *fp,
-  int nelems,
-  char **elem_names,
-  int file_type
-)
-{
-  int i;
-  PlyFile *plyfile;
-  PlyElement *elem;
-
-  /* check for NULL file pointer */
-  if (fp == NULL)
-    return (NULL);
-
-  /* create a record for this object */
-
-  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
-  plyfile->file_type = file_type;
-  plyfile->num_comments = 0;
-  plyfile->num_obj_info = 0;
-  plyfile->num_elem_types = nelems;
-  plyfile->version = 1.0;
-  plyfile->fp = fp;
-  plyfile->other_elems = NULL;
-
-  /* tuck aside the names of the elements */
-
-  plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *) * nelems);
-  for (i = 0; i < nelems; i++) {
-    elem = (PlyElement *) myalloc (sizeof (PlyElement));
-    plyfile->elems[i] = elem;
-    elem->name = strdup (elem_names[i]);
-    elem->num = 0;
-    elem->nprops = 0;
-  }
-
-  /* return pointer to the file descriptor */
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Open a polygon file for writing.
-
-Entry:
-  filename   - name of file to read from
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-
-Exit:
-  returns a file identifier, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *open_for_writing_ply(
-  char *filename,
-  int nelems,
-  char **elem_names,
-  int file_type
-)
-{
-  int i;
-  PlyFile *plyfile;
-  PlyElement *elem;
-  char *name;
-  FILE *fp;
-
-  /* tack on the extension .ply, if necessary */
-
-  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
-  strcpy (name, filename);
-  if (strlen (name) < 4 ||
-      strcmp (name + strlen (name) - 4, ".ply") != 0)
-      strcat (name, ".ply");
-
-  /* open the file for writing */
-
-  fp = fopen (name, "w");
-  if (fp == NULL) {
-    return (NULL);
-  }
-
-  /* create the actual PlyFile structure */
-
-  plyfile = ply_write (fp, nelems, elem_names, file_type);
-  if (plyfile == NULL)
-    return (NULL);
-
-  /* return pointer to the file descriptor */
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Describe an element, including its properties and how many will be written
-to the file.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  nelems    - number of elements of this type to be written
-  nprops    - number of properties contained in the element
-  prop_list - list of properties
-******************************************************************************/
-
-void element_layout_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems,
-  int nprops,
-  PlyProperty *prop_list
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"element_layout_ply: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
-
-  elem->num = nelems;
-
-  /* copy the list of properties */
-
-  elem->nprops = nprops;
-  elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *) * nprops);
-  elem->store_prop = (char *) myalloc (sizeof (char) * nprops);
-
-  for (i = 0; i < nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    elem->props[i] = prop;
-    elem->store_prop[i] = NAMED_PROP;
-    copy_property (prop, &prop_list[i]);
-  }
-}
-
-
-/******************************************************************************
-Describe a property of an element.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  prop      - the new property
-******************************************************************************/
-
-void ply_describe_property(
-  PlyFile *plyfile,
-  char *elem_name,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *elem_prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr, "ply_describe_property: can't find element '%s'\n",
-            elem_name);
-    return;
-  }
-
-  /* create room for new property */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-    elem->store_prop = (char *) myalloc (sizeof (char));
-    elem->nprops = 1;
-  }
-  else {
-    elem->nprops++;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * elem->nprops);
-  }
-
-  /* copy the new property */
-
-  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-  elem->props[elem->nprops - 1] = elem_prop;
-  elem->store_prop[elem->nprops - 1] = NAMED_PROP;
-  copy_property (elem_prop, prop);
-}
-
-
-/******************************************************************************
-State how many of a given element will be written.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  nelems    - number of elements of this type to be written
-******************************************************************************/
-
-void element_count_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"element_count_ply: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
-
-  elem->num = nelems;
-}
-
-
-/******************************************************************************
-Signal that we've described everything a PLY file's header and that the
-header should be written to the file.
-
-Entry:
-  plyfile - file identifier
-******************************************************************************/
-
-void header_complete_ply(PlyFile *plyfile)
-{
-  int i,j;
-  FILE *fp = plyfile->fp;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  fprintf (fp, "ply\n");
-
-  switch (plyfile->file_type) {
-    case PLY_ASCII:
-      fprintf (fp, "format ascii 1.0\n");
-      break;
-    case PLY_BINARY_BE:
-      fprintf (fp, "format binary_big_endian 1.0\n");
-      break;
-    case PLY_BINARY_LE:
-      fprintf (fp, "format binary_little_endian 1.0\n");
-      break;
-    default:
-      fprintf (stderr, "ply_header_complete: bad file type = %d\n",
-               plyfile->file_type);
-      exit (-1);
-  }
-
-  /* write out the comments */
-
-  for (i = 0; i < plyfile->num_comments; i++)
-    fprintf (fp, "comment %s\n", plyfile->comments[i]);
-
-  /* write out object information */
-
-  for (i = 0; i < plyfile->num_obj_info; i++)
-    fprintf (fp, "obj_info %s\n", plyfile->obj_info[i]);
-
-  /* write out information about each element */
-
-  for (i = 0; i < plyfile->num_elem_types; i++) {
-
-    elem = plyfile->elems[i];
-    fprintf (fp, "element %s %d\n", elem->name, elem->num);
-
-    /* write out each property */
-    for (j = 0; j < elem->nprops; j++) {
-      prop = elem->props[j];
-      if (prop->is_list == PLY_LIST) {
-        fprintf (fp, "property list ");
-        write_scalar_type (fp, prop->count_external);
-        fprintf (fp, " ");
-        write_scalar_type (fp, prop->external_type);
-        fprintf (fp, " %s\n", prop->name);
-      }
-      else if (prop->is_list == PLY_STRING) {
-        fprintf (fp, "property string");
-        fprintf (fp, " %s\n", prop->name);
-      }
-      else {
-        fprintf (fp, "property ");
-        write_scalar_type (fp, prop->external_type);
-        fprintf (fp, " %s\n", prop->name);
-      }
-    }
-  }
-
-  fprintf (fp, "end_header\n");
-}
-
-
-/******************************************************************************
-Specify which elements are going to be written.  This should be called
-before a call to the routine ply_put_element().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element we're talking about
-******************************************************************************/
-
-void put_element_setup_ply(PlyFile *plyfile, char *elem_name)
-{
-  PlyElement *elem;
-
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr, "put_element_setup_ply: can't find element '%s'\n", elem_name);
-    exit (-1);
-  }
-
-  plyfile->which_elem = elem;
-}
-
-
-/******************************************************************************
-Write an element to the file.  This routine assumes that we're
-writing the type of element specified in the last call to the routine
-put_element_setup_ply().
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to the element
-******************************************************************************/
-
-void put_element_ply(PlyFile *plyfile, void *elem_ptr)
-{
-  int i,j,k;
-  FILE *fp = plyfile->fp;
-  PlyElement *elem;
-  PlyProperty *prop;
-  char *item;
-  char *elem_data;
-  char **item_ptr;
-  int list_count;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  char **other_ptr;
-
-  elem = plyfile->which_elem;
-  elem_data = (char *) elem_ptr;
-  other_ptr = (char **) (((char *) elem_ptr) + elem->other_offset);
-
-  /* write out either to an ascii or binary file */
-
-  if (plyfile->file_type == PLY_ASCII) {
-
-    /* write an ascii file */
-
-    /* write out each property of the element */
-    for (j = 0; j < elem->nprops; j++) {
-
-      prop = elem->props[j];
-
-      if (elem->store_prop[j] == OTHER_PROP)
-        elem_data = *other_ptr;
-      else
-        elem_data = (char *) elem_ptr;
-
-      if (prop->is_list == PLY_LIST) {  /* list */
-        item = elem_data + prop->count_offset;
-        get_stored_item ((void *) item, prop->count_internal,
-                         &int_val, &uint_val, &double_val);
-        write_ascii_item (fp, int_val, uint_val, double_val,
-                          prop->count_external);
-        list_count = uint_val;
-        item_ptr = (char **) (elem_data + prop->offset);
-        item = item_ptr[0];
-        item_size = ply_type_size[prop->internal_type];
-        for (k = 0; k < list_count; k++) {
-          get_stored_item ((void *) item, prop->internal_type,
-                           &int_val, &uint_val, &double_val);
-          write_ascii_item (fp, int_val, uint_val, double_val,
-                            prop->external_type);
-          item += item_size;
-        }
-      }
-      else if (prop->is_list == PLY_STRING) {  /* string */
-	char **str;
-        item = elem_data + prop->offset;
-	str = (char **) item;
-	fprintf (fp, "\"%s\"", *str);
-      }
-      else {                                  /* scalar */
-        item = elem_data + prop->offset;
-        get_stored_item ((void *) item, prop->internal_type,
-                         &int_val, &uint_val, &double_val);
-        write_ascii_item (fp, int_val, uint_val, double_val,
-                          prop->external_type);
-      }
-    }
-
-    fprintf (fp, "\n");
-  }
-  else {
-
-    /* write a binary file */
-
-    /* write out each property of the element */
-    for (j = 0; j < elem->nprops; j++) {
-      prop = elem->props[j];
-      if (elem->store_prop[j] == OTHER_PROP)
-        elem_data = *other_ptr;
-      else
-        elem_data = (char *) elem_ptr;
-      if (prop->is_list == PLY_LIST) {   /* list */
-        item = elem_data + prop->count_offset;
-        item_size = ply_type_size[prop->count_internal];
-        get_stored_item ((void *) item, prop->count_internal,
-                         &int_val, &uint_val, &double_val);
-        write_binary_item (fp, int_val, uint_val, double_val,
-                           prop->count_external);
-        list_count = uint_val;
-        item_ptr = (char **) (elem_data + prop->offset);
-        item = item_ptr[0];
-        item_size = ply_type_size[prop->internal_type];
-        for (k = 0; k < list_count; k++) {
-          get_stored_item ((void *) item, prop->internal_type,
-                           &int_val, &uint_val, &double_val);
-          write_binary_item (fp, int_val, uint_val, double_val,
-                             prop->external_type);
-          item += item_size;
-        }
-      }
-      else if (prop->is_list == PLY_STRING) {   /* string */
-	int len;
-	char **str;
-        item = elem_data + prop->offset;
-	str = (char **) item;
-
-	/* write the length */
-	len = strlen(*str) + 1;
-	fwrite (&len, sizeof(int), 1, fp);
-
-	/* write the string, including the null character */
-	fwrite (*str, len, 1, fp);
-      }
-      else {                   /* scalar */
-        item = elem_data + prop->offset;
-        item_size = ply_type_size[prop->internal_type];
-        get_stored_item ((void *) item, prop->internal_type,
-                         &int_val, &uint_val, &double_val);
-        write_binary_item (fp, int_val, uint_val, double_val,
-                           prop->external_type);
-      }
-    }
-
-  }
-}
-
-
-
-
-
-
-/*************/
-/*  Reading  */
-/*************/
-
-
-
-/******************************************************************************
-Given a file pointer, get ready to read PLY data from the file.
-
-Entry:
-  fp - the given file pointer
-
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *ply_read(FILE *fp, int *nelems, char ***elem_names)
-{
-  int i,j;
-  PlyFile *plyfile;
-  int nwords;
-  char **words;
-  int found_format = 0;
-  char **elist;
-  PlyElement *elem;
-  char *orig_line;
-
-  /* check for NULL file pointer */
-  if (fp == NULL)
-    return (NULL);
-
-  /* create record for this object */
-
-  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
-  plyfile->num_elem_types = 0;
-  plyfile->comments = NULL;
-  plyfile->num_comments = 0;
-  plyfile->obj_info = NULL;
-  plyfile->num_obj_info = 0;
-  plyfile->fp = fp;
-  plyfile->other_elems = NULL;
-  plyfile->rule_list = NULL;
-
-  /* read and parse the file's header */
-
-  words = get_words (plyfile->fp, &nwords, &orig_line);
-  if (!words || !equal_strings (words[0], "ply"))
-    return (NULL);
-
-  while (words) {
-
-    /* parse words */
-
-    if (equal_strings (words[0], "format")) {
-      if (nwords != 3)
-        return (NULL);
-      if (equal_strings (words[1], "ascii"))
-        plyfile->file_type = PLY_ASCII;
-      else if (equal_strings (words[1], "binary_big_endian"))
-        plyfile->file_type = PLY_BINARY_BE;
-      else if (equal_strings (words[1], "binary_little_endian"))
-        plyfile->file_type = PLY_BINARY_LE;
-      else
-        return (NULL);
-      plyfile->version = atof (words[2]);
-      found_format = 1;
-    }
-    else if (equal_strings (words[0], "element"))
-      add_element (plyfile, words, nwords);
-    else if (equal_strings (words[0], "property"))
-      add_property (plyfile, words, nwords);
-    else if (equal_strings (words[0], "comment"))
-      add_comment (plyfile, orig_line);
-    else if (equal_strings (words[0], "obj_info"))
-      add_obj_info (plyfile, orig_line);
-    else if (equal_strings (words[0], "end_header"))
-      break;
-
-    /* free up words space */
-    free (words);
-
-    words = get_words (plyfile->fp, &nwords, &orig_line);
-  }
-
-  /* create tags for each property of each element, to be used */
-  /* later to say whether or not to store each property for the user */
-
-  for (i = 0; i < plyfile->num_elem_types; i++) {
-    elem = plyfile->elems[i];
-    elem->store_prop = (char *) myalloc (sizeof (char) * elem->nprops);
-    for (j = 0; j < elem->nprops; j++)
-      elem->store_prop[j] = DONT_STORE_PROP;
-    elem->other_offset = NO_OTHER_PROPS; /* no "other" props by default */
-  }
-
-  /* set return values about the elements */
-
-  elist = (char **) myalloc (sizeof (char *) * plyfile->num_elem_types);
-  for (i = 0; i < plyfile->num_elem_types; i++)
-    elist[i] = strdup (plyfile->elems[i]->name);
-
-  *elem_names = elist;
-  *nelems = plyfile->num_elem_types;
-
-  /* return a pointer to the file's information */
-
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Open a polygon file for reading.
-
-Entry:
-  filename - name of file to read from
-
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-  version    - version number of PLY file
-  returns a file identifier, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *ply_open_for_reading(
-  char *filename,
-  int *nelems,
-  char ***elem_names,
-  int *file_type,
-  float *version
-)
-{
-  FILE *fp;
-  PlyFile *plyfile;
-  char *name;
-
-  /* tack on the extension .ply, if necessary */
-
-  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
-  strcpy (name, filename);
-  if (strlen (name) < 4 ||
-      strcmp (name + strlen (name) - 4, ".ply") != 0)
-      strcat (name, ".ply");
-
-  /* open the file for reading */
-
-  fp = fopen (name, "r");
-  if (fp == NULL)
-    return (NULL);
-
-  /* create the PlyFile data structure */
-
-  plyfile = ply_read (fp, nelems, elem_names);
-
-  /* determine the file type and version */
-
-  *file_type = plyfile->file_type;
-  *version = plyfile->version;
-
-  /* return a pointer to the file's information */
-
-  return (plyfile);
-}
-
-
-/******************************************************************************
-Get information about a particular element.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element to get information about
-
-Exit:
-  nelems   - number of elements of this type in the file
-  nprops   - number of properties
-  returns a list of properties, or NULL if the file doesn't contain that elem
-******************************************************************************/
-
-PlyProperty **get_element_description_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int *nelems,
-  int *nprops
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-  PlyProperty **prop_list;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL)
-    return (NULL);
-
-  *nelems = elem->num;
-  *nprops = elem->nprops;
-
-  /* make a copy of the element's property list */
-  prop_list = (PlyProperty **) myalloc (sizeof (PlyProperty *) * elem->nprops);
-  for (i = 0; i < elem->nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, elem->props[i]);
-    prop_list[i] = prop;
-  }
-
-  /* return this duplicate property list */
-  return (prop_list);
-}
-
-
-/******************************************************************************
-Specify which properties of an element are to be returned.  This should be
-called before a call to the routine get_element_ply().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - which element we're talking about
-  nprops    - number of properties
-  prop_list - list of properties
-******************************************************************************/
-
-void get_element_setup_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nprops,
-  PlyProperty *prop_list
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-  int index;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  plyfile->which_elem = elem;
-
-  /* deposit the property information into the element's description */
-  for (i = 0; i < nprops; i++) {
-
-    /* look for actual property */
-    prop = find_property (elem, prop_list[i].name, &index);
-    if (prop == NULL) {
-      fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-               prop_list[i].name, elem_name);
-      continue;
-    }
-
-    /* store its description */
-    prop->internal_type = prop_list[i].internal_type;
-    prop->offset = prop_list[i].offset;
-    prop->count_internal = prop_list[i].count_internal;
-    prop->count_offset = prop_list[i].count_offset;
-
-    /* specify that the user wants this property */
-    elem->store_prop[index] = STORE_PROP;
-  }
-}
-
-
-/******************************************************************************
-Specify a property of an element that is to be returned.  This should be
-called (usually multiple times) before a call to the routine ply_get_element().
-This routine should be used in preference to the less flexible old routine
-called ply_get_element_setup().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - which element we're talking about
-  prop      - property to add to those that will be returned
-******************************************************************************/
-
-void ply_get_property(
-  PlyFile *plyfile,
-  char *elem_name,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *prop_ptr;
-  int index;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  plyfile->which_elem = elem;
-
-  /* deposit the property information into the element's description */
-
-  prop_ptr = find_property (elem, prop->name, &index);
-  if (prop_ptr == NULL) {
-    fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-             prop->name, elem_name);
-    return;
-  }
-  prop_ptr->internal_type  = prop->internal_type;
-  prop_ptr->offset         = prop->offset;
-  prop_ptr->count_internal = prop->count_internal;
-  prop_ptr->count_offset   = prop->count_offset;
-
-  /* specify that the user wants this property */
-  elem->store_prop[index] = STORE_PROP;
-}
-
-
-/******************************************************************************
-Read one element from the file.  This routine assumes that we're reading
-the type of element specified in the last call to the routine
-ply_get_element_setup().
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to location where the element information should be put
-******************************************************************************/
-
-void ply_get_element(PlyFile *plyfile, void *elem_ptr)
-{
-  if (plyfile->file_type == PLY_ASCII)
-    ascii_get_element (plyfile, (char *) elem_ptr);
-  else
-    binary_get_element (plyfile, (char *) elem_ptr);
-}
-
-
-/******************************************************************************
-Extract the comments from the header information of a PLY file.
-
-Entry:
-  plyfile - file identifier
-
-Exit:
-  num_comments - number of comments returned
-  returns a pointer to a list of comments
-******************************************************************************/
-
-char **get_comments_ply(PlyFile *plyfile, int *num_comments)
-{
-  *num_comments = plyfile->num_comments;
-  return (plyfile->comments);
-}
-
-
-/******************************************************************************
-Extract the object information (arbitrary text) from the header information
-of a PLY file.
-
-Entry:
-  plyfile - file identifier
-
-Exit:
-  num_obj_info - number of lines of text information returned
-  returns a pointer to a list of object info lines
-******************************************************************************/
-
-char **get_obj_info_ply(PlyFile *plyfile, int *num_obj_info)
-{
-  *num_obj_info = plyfile->num_obj_info;
-  return (plyfile->obj_info);
-}
-
-
-/******************************************************************************
-Make ready for "other" properties of an element-- those properties that
-the user has not explicitly asked for, but that are to be stashed away
-in a special structure to be carried along with the element's other
-information.
-
-Entry:
-  plyfile - file identifier
-  elem    - element for which we want to save away other properties
-******************************************************************************/
-
-void setup_other_props(PlyFile *plyfile, PlyElement *elem)
-{
-  int i;
-  PlyProperty *prop;
-  int size = 0;
-  int type_size;
-
-  /* Examine each property in decreasing order of size. */
-  /* We do this so that all data types will be aligned by */
-  /* word, half-word, or whatever within the structure. */
-
-  for (type_size = 8; type_size > 0; type_size /= 2) {
-
-    /* add up the space taken by each property, and save this information */
-    /* away in the property descriptor */
-
-    for (i = 0; i < elem->nprops; i++) {
-
-      /* don't bother with properties we've been asked to store explicitly */
-      if (elem->store_prop[i])
-        continue;
-
-      prop = elem->props[i];
-
-      /* internal types will be same as external */
-      prop->internal_type = prop->external_type;
-      prop->count_internal = prop->count_external;
-
-      /* list case */
-      if (prop->is_list == PLY_LIST) {
-
-        /* pointer to list */
-        if (type_size == sizeof (void *)) {
-          prop->offset = size;
-          size += sizeof (void *);    /* always use size of a pointer here */
-        }
-
-        /* count of number of list elements */
-        if (type_size == ply_type_size[prop->count_external]) {
-          prop->count_offset = size;
-          size += ply_type_size[prop->count_external];
-        }
-      }
-      /* string */
-      else if (prop->is_list == PLY_STRING) {
-        /* pointer to string */
-        if (type_size == sizeof (char *)) {
-          prop->offset = size;
-          size += sizeof (char *);
-        }
-      }
-      /* scalar */
-      else if (type_size == ply_type_size[prop->external_type]) {
-        prop->offset = size;
-        size += ply_type_size[prop->external_type];
-      }
-    }
-
-  }
-
-  /* save the size for the other_props structure */
-  elem->other_size = size;
-}
-
-
-/******************************************************************************
-Specify that we want the "other" properties of an element to be tucked
-away within the user's structure.
-
-Entry:
-  plyfile - file identifier
-  elem    - the element that we want to store other_props in
-  offset  - offset to where other_props will be stored inside user's structure
-
-Exit:
-  returns pointer to structure containing description of other_props
-******************************************************************************/
-
-static PlyOtherProp *get_other_properties(
-  PlyFile *plyfile,
-  PlyElement *elem,
-  int offset
-)
-{
-  int i;
-  PlyOtherProp *other;
-  PlyProperty *prop;
-  int nprops;
-
-  /* remember that this is the "current" element */
-  plyfile->which_elem = elem;
-
-  /* save the offset to where to store the other_props */
-  elem->other_offset = offset;
-
-  /* place the appropriate pointers, etc. in the element's property list */
-  setup_other_props (plyfile, elem);
-
-  /* create structure for describing other_props */
-  other = (PlyOtherProp *) myalloc (sizeof (PlyOtherProp));
-  other->name = strdup (elem->name);
-#if 0
-  if (elem->other_offset == NO_OTHER_PROPS) {
-    other->size = 0;
-    other->props = NULL;
-    other->nprops = 0;
-    return (other);
-  }
-#endif
-  other->size = elem->other_size;
-  other->props = (PlyProperty **) myalloc (sizeof(PlyProperty) * elem->nprops);
-  
-  /* save descriptions of each "other" property */
-  nprops = 0;
-  for (i = 0; i < elem->nprops; i++) {
-    if (elem->store_prop[i])
-      continue;
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, elem->props[i]);
-    other->props[nprops] = prop;
-    nprops++;
-  }
-  other->nprops = nprops;
-
-  /* set other_offset pointer appropriately if there are NO other properties */
-  if (other->nprops == 0) {
-    elem->other_offset = NO_OTHER_PROPS;
-  }
- 
-  /* return structure */
-  return (other);
-}
-
-
-/******************************************************************************
-Specify that we want the "other" properties of an element to be tucked
-away within the user's structure.  The user needn't be concerned for how
-these properties are stored.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that we want to store other_props in
-  offset    - offset to where other_props will be stored inside user's structure
-
-Exit:
-  returns pointer to structure containing description of other_props
-******************************************************************************/
-
-PlyOtherProp *ply_get_other_properties(
-  PlyFile *plyfile,
-  char *elem_name,
-  int offset
-)
-{
-  PlyElement *elem;
-  PlyOtherProp *other;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf (stderr, "ply_get_other_properties: Can't find element '%s'\n",
-             elem_name);
-    return (NULL);
-  }
-
-  other = get_other_properties (plyfile, elem, offset);
-  return (other);
-}
-
-
-
-
-/*************************/
-/*  Other Element Stuff  */
-/*************************/
-
-
-
-
-
-/******************************************************************************
-Grab all the data for the current element that a user does not want to
-explicitly read in.  Stores this in the PLY object's data structure.
-
-Entry:
-  plyfile - pointer to file
-
-Exit:
-  returns pointer to ALL the "other" element data for this PLY file
-******************************************************************************/
-
-PlyOtherElems *get_other_element_ply (PlyFile *plyfile)
-{
-  int i;
-  PlyElement *elem;
-  char *elem_name;
-  int elem_count;
-  PlyOtherElems *other_elems;
-  OtherElem *other;
-
-  elem = plyfile->which_elem;
-  elem_name = elem->name;
-  elem_count = elem->num;
-
-  /* create room for the new "other" element, initializing the */
-  /* other data structure if necessary */
-
-  if (plyfile->other_elems == NULL) {
-    plyfile->other_elems = (PlyOtherElems *) myalloc (sizeof (PlyOtherElems));
-    other_elems = plyfile->other_elems;
-    other_elems->other_list = (OtherElem *) myalloc (sizeof (OtherElem));
-    other = &(other_elems->other_list[0]);
-    other_elems->num_elems = 1;
-  }
-  else {
-    other_elems = plyfile->other_elems;
-    other_elems->other_list = (OtherElem *) realloc (other_elems->other_list,
-                              sizeof (OtherElem) * other_elems->num_elems + 1);
-    other = &(other_elems->other_list[other_elems->num_elems]);
-    other_elems->num_elems++;
-  }
-
-  /* count of element instances in file */
-  other->elem_count = elem_count;
-
-  /* save name of element */
-  other->elem_name = strdup (elem_name);
-
-  /* create a list to hold all the current elements */
-  other->other_data = (OtherData **)
-                  malloc (sizeof (OtherData *) * other->elem_count);
-
-  /* set up for getting elements */
-  other->other_props = ply_get_other_properties (plyfile, elem_name,
-                         offsetof(OtherData,other_props));
-
-  /* grab all these elements */
-  for (i = 0; i < other->elem_count; i++) {
-    /* grab and element from the file */
-    other->other_data[i] = (OtherData *) malloc (sizeof (OtherData));
-    ply_get_element (plyfile, (void *) other->other_data[i]);
-  }
-
-  /* return pointer to the other elements data */
-  return (other_elems);
-}
-
-
-/******************************************************************************
-Write out the "other" elements specified for this PLY file.
-
-Entry:
-  plyfile - pointer to PLY file to write out other elements for
-******************************************************************************/
-
-void put_other_elements_ply (PlyFile *plyfile)
-{
-  int i,j;
-  OtherElem *other;
-
-  /* make sure we have other elements to write */
-  if (plyfile->other_elems == NULL)
-    return;
-
-  /* write out the data for each "other" element */
-
-  for (i = 0; i < plyfile->other_elems->num_elems; i++) {
-
-    other = &(plyfile->other_elems->other_list[i]);
-    put_element_setup_ply (plyfile, other->elem_name);
-
-    /* write out each instance of the current element */
-    for (j = 0; j < other->elem_count; j++)
-      put_element_ply (plyfile, (void *) other->other_data[j]);
-  }
-}
-
-
-/******************************************************************************
-Free up storage used by an "other" elements data structure.
-
-Entry:
-  other_elems - data structure to free up
-******************************************************************************/
-
-void free_other_elements_ply (PlyOtherElems *other_elems)
-{
-
-}
-
-
-
-/*******************/
-/*  Miscellaneous  */
-/*******************/
-
-
-
-/******************************************************************************
-Close a PLY file.
-
-Entry:
-  plyfile - identifier of file to close
-******************************************************************************/
-
-void ply_close(PlyFile *plyfile)
-{
-  fclose (plyfile->fp);
-
-  /* free up memory associated with the PLY file */
-  free (plyfile);
-}
-
-
-/******************************************************************************
-Get version number and file type of a PlyFile.
-
-Entry:
-  ply - pointer to PLY file
-
-Exit:
-  version - version of the file
-  file_type - PLY_ASCII, PLY_BINARY_BE, or PLY_BINARY_LE
-******************************************************************************/
-
-void get_info_ply(PlyFile *ply, float *version, int *file_type)
-{
-  if (ply == NULL)
-    return;
-
-  *version = ply->version;
-  *file_type = ply->file_type;
-}
-
-
-/******************************************************************************
-Compare two strings.  Returns 1 if they are the same, 0 if not.
-******************************************************************************/
-
-int equal_strings(char *s1, char *s2)
-{
-  int i;
-
-  while (*s1 && *s2)
-    if (*s1++ != *s2++)
-      return (0);
-
-  if (*s1 != *s2)
-    return (0);
-  else
-    return (1);
-}
-
-
-/******************************************************************************
-Re-create the command line that was used to invoke this program.
-
-Entry:
-  argc - number of words in argv
-  argv - array of words in command line
-******************************************************************************/
-
-char *recreate_command_line (int argc, char *argv[])
-{
-  int i;
-  char *line;
-  int len = 0;
-
-  /* count total number of characters needed, including separating spaces */
-  for (i = 0; i < argc; i++)
-    len += strlen(argv[i]) + 1;
-
-  /* create empty line */
-  line = (char *) malloc (sizeof(char) * len);
-  line[0] = '\0';
-
-  /* repeatedly append argv */
-  for (i = 0; i < argc; i++) {
-    strcat (line, argv[i]);
-    if (i != argc - 1)
-      strcat (line, " ");
-  }
-
-  return (line);
-}
-
-
-/******************************************************************************
-Find an element from the element list of a given PLY object.
-
-Entry:
-  plyfile - file id for PLY file
-  element - name of element we're looking for
-
-Exit:
-  returns the element, or NULL if not found
-******************************************************************************/
-
-PlyElement *find_element(PlyFile *plyfile, char *element)
-{
-  int i;
-
-  for (i = 0; i < plyfile->num_elem_types; i++)
-    if (equal_strings (element, plyfile->elems[i]->name))
-      return (plyfile->elems[i]);
-
-  return (NULL);
-}
-
-
-/******************************************************************************
-Find a property in the list of properties of a given element.
-
-Entry:
-  elem      - pointer to element in which we want to find the property
-  prop_name - name of property to find
-
-Exit:
-  index - index to position in list
-  returns a pointer to the property, or NULL if not found
-******************************************************************************/
-
-PlyProperty *find_property(PlyElement *elem, char *prop_name, int *index)
-{
-  int i;
-
-  for (i = 0; i < elem->nprops; i++)
-    if (equal_strings (prop_name, elem->props[i]->name)) {
-      *index = i;
-      return (elem->props[i]);
-    }
-
-  *index = -1;
-  return (NULL);
-}
-
-
-/******************************************************************************
-Read an element from an ascii file.
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to element
-******************************************************************************/
-
-void ascii_get_element(PlyFile *plyfile, char *elem_ptr)
-{
-  int i,j,k;
-  PlyElement *elem;
-  PlyProperty *prop;
-  char **words;
-  int nwords;
-  int which_word;
-  FILE *fp = plyfile->fp;
-  char *elem_data,*item;
-  char *item_ptr;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  int list_count;
-  int store_it;
-  char **store_array;
-  char *orig_line;
-  char *other_data;
-  int other_flag;
-
-  /* the kind of element we're reading currently */
-  elem = plyfile->which_elem;
-
-  /* do we need to setup for other_props? */
-
-  if (elem->other_offset != NO_OTHER_PROPS) {
-    char **ptr;
-    other_flag = 1;
-    /* make room for other_props */
-    other_data = (char *) myalloc (elem->other_size);
-    /* store pointer in user's structure to the other_props */
-    ptr = (char **) (elem_ptr + elem->other_offset);
-    *ptr = other_data;
-  }
-  else
-    other_flag = 0;
-
-  /* read in the element */
-
-  words = get_words (plyfile->fp, &nwords, &orig_line);
-  if (words == NULL) {
-    fprintf (stderr, "ply_get_element: unexpected end of file\n");
-    exit (-1);
-  }
-
-  which_word = 0;
-
-  for (j = 0; j < elem->nprops; j++) {
-
-    prop = elem->props[j];
-    store_it = (elem->store_prop[j] | other_flag);
-
-    /* store either in the user's structure or in other_props */
-    if (elem->store_prop[j])
-      elem_data = elem_ptr;
-    else
-      elem_data = other_data;
-
-    if (prop->is_list == PLY_LIST) {       /* a list */
-
-      /* get and store the number of items in the list */
-      get_ascii_item (words[which_word++], prop->count_external,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->count_offset;
-        store_item(item, prop->count_internal, int_val, uint_val, double_val);
-      }
-
-      /* allocate space for an array of items and store a ptr to the array */
-      list_count = int_val;
-      item_size = ply_type_size[prop->internal_type];
-      store_array = (char **) (elem_data + prop->offset);
-
-      if (list_count == 0) {
-        if (store_it)
-          *store_array = NULL;
-      }
-      else {
-        if (store_it) {
-          item_ptr = (char *) myalloc (sizeof (char) * item_size * list_count);
-          item = item_ptr;
-          *store_array = item_ptr;
-        }
-
-        /* read items and store them into the array */
-        for (k = 0; k < list_count; k++) {
-          get_ascii_item (words[which_word++], prop->external_type,
-                          &int_val, &uint_val, &double_val);
-          if (store_it) {
-            store_item (item, prop->internal_type,
-                        int_val, uint_val, double_val);
-            item += item_size;
-          }
-        }
-      }
-
-    }
-    else if (prop->is_list == PLY_STRING) {   /* a string */
-      if (store_it) {
-	char *str;
-	char **str_ptr;
-	str = strdup (words[which_word++]);
-        item = elem_data + prop->offset;
-	str_ptr = (char **) item;
-	*str_ptr = str;
-      }
-      else {
-        which_word++;
-      }
-    }
-    else {                     /* a scalar */
-      get_ascii_item (words[which_word++], prop->external_type,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->offset;
-        store_item (item, prop->internal_type, int_val, uint_val, double_val);
-      }
-    }
-
-  }
-
-  free (words);
-}
-
-
-/******************************************************************************
-Read an element from a binary file.
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to an element
-******************************************************************************/
-
-void binary_get_element(PlyFile *plyfile, char *elem_ptr)
-{
-  int i,j,k;
-  PlyElement *elem;
-  PlyProperty *prop;
-  FILE *fp = plyfile->fp;
-  char *elem_data;
-  char *item;
-  char *item_ptr;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  int list_count;
-  int store_it;
-  char **store_array;
-  char *other_data;
-  int other_flag;
-
-  /* the kind of element we're reading currently */
-  elem = plyfile->which_elem;
-
-  /* do we need to setup for other_props? */
-
-  if (elem->other_offset != NO_OTHER_PROPS) {
-    char **ptr;
-    other_flag = 1;
-    /* make room for other_props */
-    other_data = (char *) myalloc (elem->other_size);
-    /* store pointer in user's structure to the other_props */
-    ptr = (char **) (elem_ptr + elem->other_offset);
-    *ptr = other_data;
-  }
-  else
-    other_flag = 0;
-
-  /* read in a number of elements */
-
-  for (j = 0; j < elem->nprops; j++) {
-
-    prop = elem->props[j];
-    store_it = (elem->store_prop[j] | other_flag);
-
-    /* store either in the user's structure or in other_props */
-    if (elem->store_prop[j])
-      elem_data = elem_ptr;
-    else
-      elem_data = other_data;
-
-    if (prop->is_list == PLY_LIST) {          /* list */
-
-      /* get and store the number of items in the list */
-      get_binary_item (fp, prop->count_external,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->count_offset;
-        store_item(item, prop->count_internal, int_val, uint_val, double_val);
-      }
-
-      /* allocate space for an array of items and store a ptr to the array */
-      list_count = int_val;
-      item_size = ply_type_size[prop->internal_type];
-      store_array = (char **) (elem_data + prop->offset);
-      if (list_count == 0) {
-        if (store_it)
-          *store_array = NULL;
-      }
-      else {
-        if (store_it) {
-          item_ptr = (char *) myalloc (sizeof (char) * item_size * list_count);
-          item = item_ptr;
-          *store_array = item_ptr;
-        }
-
-        /* read items and store them into the array */
-        for (k = 0; k < list_count; k++) {
-          get_binary_item (fp, prop->external_type,
-                          &int_val, &uint_val, &double_val);
-          if (store_it) {
-            store_item (item, prop->internal_type,
-                        int_val, uint_val, double_val);
-            item += item_size;
-          }
-        }
-      }
-
-    }
-    else if (prop->is_list == PLY_STRING) {     /* string */
-      int len;
-      char *str;
-      fread (&len, sizeof(int), 1, fp);
-      str = (char *) myalloc (len);
-      fread (str, len, 1, fp);
-      if (store_it) {
-	char **str_ptr;
-        item = elem_data + prop->offset;
-	str_ptr = (char **) item;
-	*str_ptr = str;
-      }
-    }
-    else {                                      /* scalar */
-      get_binary_item (fp, prop->external_type,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->offset;
-        store_item (item, prop->internal_type, int_val, uint_val, double_val);
-      }
-    }
-
-  }
-}
-
-
-/******************************************************************************
-Write to a file the word that represents a PLY data type.
-
-Entry:
-  fp   - file pointer
-  code - code for type
-******************************************************************************/
-
-void write_scalar_type (FILE *fp, int code)
-{
-  /* make sure this is a valid code */
-
-  if (code <= StartType || code >= EndType) {
-    fprintf (stderr, "write_scalar_type: bad data code = %d\n", code);
-    exit (-1);
-  }
-
-  /* write the code to a file */
-
-  fprintf (fp, "%s", type_names[code]);
-}
-
-
-/******************************************************************************
-Get a text line from a file and break it up into words.
-
-IMPORTANT: The calling routine should call "free" on the returned pointer once
-finished with it.
-
-Entry:
-  fp - file to read from
-
-Exit:
-  nwords    - number of words returned
-  orig_line - the original line of characters
-  returns a list of words from the line, or NULL if end-of-file
-******************************************************************************/
-
-char **get_words(FILE *fp, int *nwords, char **orig_line)
-{
-#define BIG_STRING 4096
-  int i,j;
-  static char str[BIG_STRING];
-  static char str_copy[BIG_STRING];
-  char **words;
-  int max_words = 10;
-  int num_words = 0;
-  char *ptr,*ptr2;
-  char *result;
-
-  words = (char **) myalloc (sizeof (char *) * max_words);
-
-  /* read in a line */
-  result = fgets (str, BIG_STRING, fp);
-  if (result == NULL) {
-    *nwords = 0;
-    *orig_line = NULL;
-    return (NULL);
-  }
-
-  /* convert line-feed and tabs into spaces */
-  /* (this guarentees that there will be a space before the */
-  /*  null character at the end of the string) */
-
-  str[BIG_STRING-2] = ' ';
-  str[BIG_STRING-1] = '\0';
-
-  for (ptr = str, ptr2 = str_copy; *ptr != '\0'; ptr++, ptr2++) {
-    *ptr2 = *ptr;
-    if (*ptr == '\t') {
-      *ptr = ' ';
-      *ptr2 = ' ';
-    }
-    else if (*ptr == '\n') {
-      *ptr = ' ';
-      *ptr2 = '\0';
-      break;
-    }
-  }
-
-  /* find the words in the line */
-
-  ptr = str;
-  while (*ptr != '\0') {
-
-    /* jump over leading spaces */
-    while (*ptr == ' ')
-      ptr++;
-
-    /* break if we reach the end */
-    if (*ptr == '\0')
-      break;
-
-    /* allocate more room for words if necessary */
-    if (num_words >= max_words) {
-      max_words += 10;
-      words = (char **) realloc (words, sizeof (char *) * max_words);
-    }
-
-    if (*ptr == '\"') {  /* a quote indidicates that we have a string */
-
-      /* skip over leading quote */
-      ptr++;
-
-      /* save pointer to beginning of word */
-      words[num_words++] = ptr;
-
-      /* find trailing quote or end of line */
-      while (*ptr != '\"' && *ptr != '\0')
-        ptr++;
-
-      /* replace quote with a null character to mark the end of the word */
-      /* if we are not already at the end of the line */
-      if (*ptr != '\0')
-	*ptr++ = '\0';
-    }
-    else {               /* non-string */
-
-      /* save pointer to beginning of word */
-      words[num_words++] = ptr;
-
-      /* jump over non-spaces */
-      while (*ptr != ' ')
-	ptr++;
-
-      /* place a null character here to mark the end of the word */
-      *ptr++ = '\0';
-    }
-  }
-
-  /* return the list of words */
-  *nwords = num_words;
-  *orig_line = str_copy;
-  return (words);
-}
-
-
-/******************************************************************************
-Return the value of an item, given a pointer to it and its type.
-
-Entry:
-  item - pointer to item
-  type - data type that "item" points to
-
-Exit:
-  returns a double-precision float that contains the value of the item
-******************************************************************************/
-
-double get_item_value(char *item, int type)
-{
-  unsigned char *puchar;
-  char *pchar;
-  short int *pshort;
-  unsigned short int *pushort;
-  int *pint;
-  unsigned int *puint;
-  float *pfloat;
-  double *pdouble;
-  int int_value;
-  unsigned int uint_value;
-  double double_value;
-
-  switch (type) {
-    case Int8:
-      pchar = (char *) item;
-      int_value = *pchar;
-      return ((double) int_value);
-    case Uint8:
-      puchar = (unsigned char *) item;
-      int_value = *puchar;
-      return ((double) int_value);
-    case Int16:
-      pshort = (short int *) item;
-      int_value = *pshort;
-      return ((double) int_value);
-    case Uint16:
-      pushort = (unsigned short int *) item;
-      int_value = *pushort;
-      return ((double) int_value);
-    case Int32:
-      pint = (int *) item;
-      int_value = *pint;
-      return ((double) int_value);
-    case Uint32:
-      puint = (unsigned int *) item;
-      uint_value = *puint;
-      return ((double) uint_value);
-    case Float32:
-      pfloat = (float *) item;
-      double_value = *pfloat;
-      return (double_value);
-    case Float64:
-      pdouble = (double *) item;
-      double_value = *pdouble;
-      return (double_value);
-    default:
-      fprintf (stderr, "get_item_value: bad type = %d\n", type);
-      exit (-1);
-  }
-
-  return (0.0);  /* never actually gets here */
-}
-
-
-/******************************************************************************
-Write out an item to a file as raw binary bytes.
-
-Entry:
-  fp         - file to write to
-  int_val    - integer version of item
-  uint_val   - unsigned integer version of item
-  double_val - double-precision float version of item
-  type       - data type to write out
-******************************************************************************/
-
-void write_binary_item(
-  FILE *fp,
-  int int_val,
-  unsigned int uint_val,
-  double double_val,
-  int type
-)
-{
-  unsigned char uchar_val;
-  char char_val;
-  unsigned short ushort_val;
-  short short_val;
-  float float_val;
-
-  switch (type) {
-    case Int8:
-      char_val = int_val;
-      fwrite (&char_val, 1, 1, fp);
-      break;
-    case Int16:
-      short_val = int_val;
-      fwrite (&short_val, 2, 1, fp);
-      break;
-    case Int32:
-      fwrite (&int_val, 4, 1, fp);
-      break;
-    case Uint8:
-      uchar_val = uint_val;
-      fwrite (&uchar_val, 1, 1, fp);
-      break;
-    case Uint16:
-      ushort_val = uint_val;
-      fwrite (&ushort_val, 2, 1, fp);
-      break;
-    case Uint32:
-      fwrite (&uint_val, 4, 1, fp);
-      break;
-    case Float32:
-      float_val = double_val;
-      fwrite (&float_val, 4, 1, fp);
-      break;
-    case Float64:
-      fwrite (&double_val, 8, 1, fp);
-      break;
-    default:
-      fprintf (stderr, "write_binary_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Write out an item to a file as ascii characters.
-
-Entry:
-  fp         - file to write to
-  int_val    - integer version of item
-  uint_val   - unsigned integer version of item
-  double_val - double-precision float version of item
-  type       - data type to write out
-******************************************************************************/
-
-void write_ascii_item(
-  FILE *fp,
-  int int_val,
-  unsigned int uint_val,
-  double double_val,
-  int type
-)
-{
-  switch (type) {
-    case Int8:
-    case Int16:
-    case Int32:
-      fprintf (fp, "%d ", int_val);
-      break;
-    case Uint8:
-    case Uint16:
-    case Uint32:
-      fprintf (fp, "%u ", uint_val);
-      break;
-    case Float32:
-    case Float64:
-      fprintf (fp, "%g ", double_val);
-      break;
-    default:
-      fprintf (stderr, "write_ascii_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Get the value of an item that is in memory, and place the result
-into an integer, an unsigned integer and a double.
-
-Entry:
-  ptr  - pointer to the item
-  type - data type supposedly in the item
-
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
-******************************************************************************/
-
-void get_stored_item(
-  void *ptr,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
-{
-  switch (type) {
-    case Int8:
-      *int_val = *((char *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint8:
-      *uint_val = *((unsigned char *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int16:
-      *int_val = *((short int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint16:
-      *uint_val = *((unsigned short int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int32:
-      *int_val = *((int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint32:
-      *uint_val = *((unsigned int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Float32:
-      *double_val = *((float *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    case Float64:
-      *double_val = *((double *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    default:
-      fprintf (stderr, "get_stored_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Get the value of an item from a binary file, and place the result
-into an integer, an unsigned integer and a double.
-
-Entry:
-  fp   - file to get item from
-  type - data type supposedly in the word
-
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
-******************************************************************************/
-
-void get_binary_item(
-  FILE *fp,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
-{
-  char c[8];
-  void *ptr;
-
-  ptr = (void *) c;
-
-  switch (type) {
-    case Int8:
-      fread (ptr, 1, 1, fp);
-      *int_val = *((char *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint8:
-      fread (ptr, 1, 1, fp);
-      *uint_val = *((unsigned char *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int16:
-      fread (ptr, 2, 1, fp);
-      *int_val = *((short int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint16:
-      fread (ptr, 2, 1, fp);
-      *uint_val = *((unsigned short int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Int32:
-      fread (ptr, 4, 1, fp);
-      *int_val = *((int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case Uint32:
-      fread (ptr, 4, 1, fp);
-      *uint_val = *((unsigned int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case Float32:
-      fread (ptr, 4, 1, fp);
-      *double_val = *((float *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    case Float64:
-      fread (ptr, 8, 1, fp);
-      *double_val = *((double *) ptr);
-      *int_val = *double_val;
-      *uint_val = *double_val;
-      break;
-    default:
-      fprintf (stderr, "get_binary_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Extract the value of an item from an ascii word, and place the result
-into an integer, an unsigned integer and a double.
-
-Entry:
-  word - word to extract value from
-  type - data type supposedly in the word
-
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
-******************************************************************************/
-
-void get_ascii_item(
-  char *word,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
-{
-  switch (type) {
-    case Int8:
-    case Uint8:
-    case Int16:
-    case Uint16:
-    case Int32:
-      *int_val = atoi (word);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-
-    case Uint32:
-      *uint_val = strtoul (word, (char **) NULL, 10);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-
-    case Float32:
-    case Float64:
-      *double_val = atof (word);
-      *int_val = (int) *double_val;
-      *uint_val = (unsigned int) *double_val;
-      break;
-
-    default:
-      fprintf (stderr, "get_ascii_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Store a value into a place being pointed to, guided by a data type.
-
-Entry:
-  item       - place to store value
-  type       - data type
-  int_val    - integer version of value
-  uint_val   - unsigned integer version of value
-  double_val - double version of value
-
-Exit:
-  item - pointer to stored value
-******************************************************************************/
-
-void store_item (
-  char *item,
-  int type,
-  int int_val,
-  unsigned int uint_val,
-  double double_val
-)
-{
-  unsigned char *puchar;
-  short int *pshort;
-  unsigned short int *pushort;
-  int *pint;
-  unsigned int *puint;
-  float *pfloat;
-  double *pdouble;
-
-  switch (type) {
-    case Int8:
-      *item = int_val;
-      break;
-    case Uint8:
-      puchar = (unsigned char *) item;
-      *puchar = uint_val;
-      break;
-    case Int16:
-      pshort = (short *) item;
-      *pshort = int_val;
-      break;
-    case Uint16:
-      pushort = (unsigned short *) item;
-      *pushort = uint_val;
-      break;
-    case Int32:
-      pint = (int *) item;
-      *pint = int_val;
-      break;
-    case Uint32:
-      puint = (unsigned int *) item;
-      *puint = uint_val;
-      break;
-    case Float32:
-      pfloat = (float *) item;
-      *pfloat = double_val;
-      break;
-    case Float64:
-      pdouble = (double *) item;
-      *pdouble = double_val;
-      break;
-    default:
-      fprintf (stderr, "store_item: bad type = %d\n", type);
-      exit (-1);
-  }
-}
-
-
-/******************************************************************************
-Add an element to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  words   - list of words describing the element
-  nwords  - number of words in the list
-******************************************************************************/
-
-void add_element (PlyFile *plyfile, char **words, int nwords)
-{
-  PlyElement *elem;
-
-  /* create the new element */
-  elem = (PlyElement *) myalloc (sizeof (PlyElement));
-  elem->name = strdup (words[1]);
-  elem->num = atoi (words[2]);
-  elem->nprops = 0;
-
-  /* make room for new element in the object's list of elements */
-  if (plyfile->num_elem_types == 0)
-    plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *));
-  else
-    plyfile->elems = (PlyElement **) realloc (plyfile->elems,
-                     sizeof (PlyElement *) * (plyfile->num_elem_types + 1));
-
-  /* add the new element to the object's list */
-  plyfile->elems[plyfile->num_elem_types] = elem;
-  plyfile->num_elem_types++;
-}
-
-
-/******************************************************************************
-Return the type of a property, given the name of the property.
-
-Entry:
-  name - name of property type
-
-Exit:
-  returns integer code for property, or 0 if not found
-******************************************************************************/
-
-int get_prop_type(char *type_name)
-{
-  int i;
-
-  /* try to match the type name */
-  for (i = StartType + 1; i < EndType; i++)
-    if (equal_strings (type_name, type_names[i]))
-      return (i);
-
-  /* see if we can match an old type name */
-  for (i = StartType + 1; i < EndType; i++)
-    if (equal_strings (type_name, old_type_names[i]))
-      return (i);
-
-  /* if we get here, we didn't find the type */
-  return (0);
-}
-
-
-/******************************************************************************
-Add a property to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  words   - list of words describing the property
-  nwords  - number of words in the list
-******************************************************************************/
-
-void add_property (PlyFile *plyfile, char **words, int nwords)
-{
-  int prop_type;
-  int count_type;
-  PlyProperty *prop;
-  PlyElement *elem;
-
-  /* create the new property */
-
-  prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-
-  if (equal_strings (words[1], "list")) {          /* list */
-    prop->count_external = get_prop_type (words[2]);
-    prop->external_type = get_prop_type (words[3]);
-    prop->name = strdup (words[4]);
-    prop->is_list = PLY_LIST;
-  }
-  else if (equal_strings (words[1], "string")) {   /* string */
-    prop->count_external = Int8;
-    prop->external_type = Int8;
-    prop->name = strdup (words[2]);
-    prop->is_list = PLY_STRING;
-  }
-  else {                                           /* scalar */
-    prop->external_type = get_prop_type (words[1]);
-    prop->name = strdup (words[2]);
-    prop->is_list = PLY_SCALAR;
-  }
-
-  /* add this property to the list of properties of the current element */
-
-  elem = plyfile->elems[plyfile->num_elem_types - 1];
-
-  if (elem->nprops == 0)
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-  else
-    elem->props = (PlyProperty **) realloc (elem->props,
-                  sizeof (PlyProperty *) * (elem->nprops + 1));
-
-  elem->props[elem->nprops] = prop;
-  elem->nprops++;
-}
-
-
-/******************************************************************************
-Add a comment to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  line    - line containing comment
-******************************************************************************/
-
-void add_comment (PlyFile *plyfile, char *line)
-{
-  int i;
-
-  /* skip over "comment" and leading spaces and tabs */
-  i = 7;
-  while (line[i] == ' ' || line[i] == '\t')
-    i++;
-
-  append_comment_ply (plyfile, &line[i]);
-}
-
-
-/******************************************************************************
-Add a some object information to a PLY file descriptor.
-
-Entry:
-  plyfile - PLY file descriptor
-  line    - line containing text info
-******************************************************************************/
-
-void add_obj_info (PlyFile *plyfile, char *line)
-{
-  int i;
-
-  /* skip over "obj_info" and leading spaces and tabs */
-  i = 8;
-  while (line[i] == ' ' || line[i] == '\t')
-    i++;
-
-  append_obj_info_ply (plyfile, &line[i]);
-}
-
-
-/******************************************************************************
-Copy a property.
-******************************************************************************/
-
-void copy_property(PlyProperty *dest, PlyProperty *src)
-{
-  dest->name = strdup (src->name);
-  dest->external_type = src->external_type;
-  dest->internal_type = src->internal_type;
-  dest->offset = src->offset;
-
-  dest->is_list = src->is_list;
-  dest->count_external = src->count_external;
-  dest->count_internal = src->count_internal;
-  dest->count_offset = src->count_offset;
-}
-
-
-/******************************************************************************
-Allocate some memory.
-
-Entry:
-  size  - amount of memory requested (in bytes)
-  lnum  - line number from which memory was requested
-  fname - file name from which memory was requested
-******************************************************************************/
-
-static char *my_alloc(int size, int lnum, char *fname)
-{
-  char *ptr;
-
-  ptr = (char *) malloc (size);
-
-  if (ptr == 0) {
-    fprintf(stderr, "Memory allocation bombed on line %d in %s\n", lnum, fname);
-  }
-
-  return (ptr);
-}
-
-
-/**** NEW STUFF ****/
-/**** NEW STUFF ****/
-/**** NEW STUFF ****/
-/**** NEW STUFF ****/
-
-
-
-/******************************************************************************
-Given a file pointer, get ready to read PLY data from the file.
-
-Entry:
-  fp - the given file pointer
-
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *read_ply(FILE *fp)
-{
-  PlyFile *ply;
-  int num_elems;
-  char **elem_names;
-
-  ply = ply_read (fp, &num_elems, &elem_names);
-
-  return (ply);
-}
-
-
-/******************************************************************************
-Given a file pointer, get ready to write PLY data to the file.
-
-Entry:
-  fp         - the given file pointer
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-
-Exit:
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
-******************************************************************************/
-
-PlyFile *write_ply(
-  FILE *fp,
-  int nelems,
-  char **elem_names,
-  int file_type
-)
-{
-  PlyFile *ply;
-
-  ply = ply_write (fp, nelems, elem_names, file_type);
-
-  return (ply);
-}
-
-
-/******************************************************************************
-Return a list of the names of the elements in a particular PLY file.
-
-Entry:
-  ply - PLY file whose element name list we want
-
-Exit:
-  num_elems  - the number of element names in the list
-  returns the list of names
-******************************************************************************/
-
-char **get_element_list_ply(PlyFile *ply, int *num_elems)
-{
-  int i;
-  char **elist;
-
-  /* create the list of element names */
-
-  elist = (char **) myalloc (sizeof (char *) * ply->num_elem_types);
-  for (i = 0; i < ply->num_elem_types; i++)
-    elist[i] = strdup (ply->elems[i]->name);
-
-  /* return the number of elements and the list of element names */
-  *num_elems = ply->num_elem_types;
-  return (elist);
-}
-
-
-/******************************************************************************
-Append a comment to a PLY file.
-
-Entry:
-  ply     - file to append comment to
-  comment - the comment to append
-******************************************************************************/
-
-void append_comment_ply(PlyFile *ply, char *comment)
-{
-  /* (re)allocate space for new comment */
-  if (ply->num_comments == 0)
-    ply->comments = (char **) myalloc (sizeof (char *));
-  else
-    ply->comments = (char **) realloc (ply->comments,
-		     sizeof (char *) * (ply->num_comments + 1));
-
-  /* add comment to list */
-  ply->comments[ply->num_comments] = strdup (comment);
-  ply->num_comments++;
-}
-
-
-/******************************************************************************
-Copy the comments from one PLY file to another.
-
-Entry:
-  out_ply - destination file to copy comments to
-  in_ply  - the source of the comments
-******************************************************************************/
-
-void copy_comments_ply(PlyFile *out_ply, PlyFile *in_ply)
-{
-  int i;
-
-  for (i = 0; i < in_ply->num_comments; i++)
-    append_comment_ply (out_ply, in_ply->comments[i]);
-}
-
-
-/******************************************************************************
-Append object information (arbitrary text) to a PLY file.
-
-Entry:
-  ply      - file to append object info to
-  obj_info - the object info to append
-******************************************************************************/
-
-void append_obj_info_ply(PlyFile *ply, char *obj_info)
-{
-  /* (re)allocate space for new info */
-  if (ply->num_obj_info == 0)
-    ply->obj_info = (char **) myalloc (sizeof (char *));
-  else
-    ply->obj_info = (char **) realloc (ply->obj_info,
-		     sizeof (char *) * (ply->num_obj_info + 1));
-
-  /* add info to list */
-  ply->obj_info[ply->num_obj_info] = strdup (obj_info);
-  ply->num_obj_info++;
-}
-
-
-/******************************************************************************
-Copy the object information from one PLY file to another.
-
-Entry:
-  out_ply - destination file to copy object information to
-  in_ply  - the source of the object information
-******************************************************************************/
-
-void copy_obj_info_ply(PlyFile *out_ply, PlyFile *in_ply)
-{
-  int i;
-
-  for (i = 0; i < in_ply->num_obj_info; i++)
-    append_obj_info_ply (out_ply, in_ply->obj_info[i]);
-}
-
-
-/******************************************************************************
-Close a PLY file.
-
-Entry:
-  plyfile - identifier of file to close
-******************************************************************************/
-
-void close_ply(PlyFile *plyfile)
-{
-  fclose (plyfile->fp);
-}
-
-
-/******************************************************************************
-Free the memory used by a PLY file.
-
-Entry:
-  plyfile - identifier of file
-******************************************************************************/
-
-void free_ply(PlyFile *plyfile)
-{
-  /* free up memory associated with the PLY file */
-  free (plyfile);
-}
-
-
-/******************************************************************************
-Specify the index of the next element to be read in from a PLY file.
-
-Entry:
-  ply - file to read from
-  index - index of the element to be read
-
-Exit:
-  elem_count - the number of elements in the file
-  returns pointer to the name of this next element
-******************************************************************************/
-
-char *setup_element_read_ply (PlyFile *ply, int index, int *elem_count)
-{
-  PlyElement *elem;
-
-  if (index < 0 || index > ply->num_elem_types) {
-    fprintf (stderr, "Warning:  No element with index %d\n", index);
-    return (0);
-  }
-
-  elem = ply->elems[index];
-
-  /* set this to be the current element */
-  ply->which_elem = elem;
-
-  /* return the number of such elements in the file and the element's name */
-  *elem_count = elem->num;
-  return (elem->name);
-}
-
-
-/******************************************************************************
-Read one element from the file.  This routine assumes that we're reading
-the type of element specified in the last call to the routine
-setup_element_read_ply().
-
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to location where the element information should be put
-******************************************************************************/
-
-void get_element_ply (PlyFile *plyfile, void *elem_ptr)
-{
-  if (plyfile->file_type == PLY_ASCII)
-    ascii_get_element (plyfile, (char *) elem_ptr);
-  else
-    binary_get_element (plyfile, (char *) elem_ptr);
-}
-
-
-/******************************************************************************
-Specify one of several properties of the current element that is to be
-read from a file.  This should be called (usually multiple times) before a
-call to the routine get_element_ply().
-
-Entry:
-  plyfile - file identifier
-  prop    - property to add to those that will be returned
-******************************************************************************/
-
-void setup_property_ply(
-  PlyFile *plyfile,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *prop_ptr;
-  int index;
-
-  elem = plyfile->which_elem;
-
-  /* deposit the property information into the element's description */
-
-  prop_ptr = find_property (elem, prop->name, &index);
-  if (prop_ptr == NULL) {
-    fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-             prop->name, elem->name);
-    return;
-  }
-  prop_ptr->internal_type  = prop->internal_type;
-  prop_ptr->offset         = prop->offset;
-  prop_ptr->count_internal = prop->count_internal;
-  prop_ptr->count_offset   = prop->count_offset;
-
-  /* specify that the user wants this property */
-  elem->store_prop[index] = STORE_PROP;
-}
-
-
-/******************************************************************************
-Specify that we want the "other" properties of the current element to be tucked
-away within the user's structure.
-
-Entry:
-  plyfile - file identifier
-  offset  - offset to where other_props will be stored inside user's structure
-
-Exit:
-  returns pointer to structure containing description of other_props
-******************************************************************************/
-
-PlyOtherProp *get_other_properties_ply(
-  PlyFile *plyfile,
-  int offset
-)
-{
-  PlyOtherProp *other;
-
-  other = get_other_properties (plyfile, plyfile->which_elem, offset);
-  return (other);
-}
-
-
-/******************************************************************************
-Describe which element is to be written next and state how many of them will
-be written.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being described
-  nelems    - number of elements of this type to be written
-******************************************************************************/
-
-void describe_element_ply(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"describe_element_ply: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
-
-  elem->num = nelems;
-
-  /* now this element is the current element */
-  plyfile->which_elem = elem;
-}
-
-
-/******************************************************************************
-Describe a property of an element.
-
-Entry:
-  plyfile   - file identifier
-  prop      - the new property
-******************************************************************************/
-
-void describe_property_ply(
-  PlyFile *plyfile,
-  PlyProperty *prop
-)
-{
-  PlyElement *elem;
-  PlyProperty *elem_prop;
-
-  elem = plyfile->which_elem;
-
-  /* create room for new property */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-    elem->store_prop = (char *) myalloc (sizeof (char));
-    elem->nprops = 1;
-  }
-  else {
-    elem->nprops++;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * elem->nprops);
-  }
-
-  /* copy the new property */
-
-  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-  elem->props[elem->nprops - 1] = elem_prop;
-  elem->store_prop[elem->nprops - 1] = NAMED_PROP;
-  copy_property (elem_prop, prop);
-}
-
-
-/******************************************************************************
-Describe what the "other" properties are that are to be stored, and where
-they are in an element.
-******************************************************************************/
-
-void describe_other_properties_ply(
-  PlyFile *plyfile,
-  PlyOtherProp *other,
-  int offset
-)
-{
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, other->name);
-  if (elem == NULL) {
-    fprintf(stderr, "describe_other_properties_ply: can't find element '%s'\n",
-            other->name);
-    return;
-  }
-
-  /* create room for other properties */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **)
-                  myalloc (sizeof (PlyProperty *) * other->nprops);
-    elem->store_prop = (char *) myalloc (sizeof (char) * other->nprops);
-    elem->nprops = 0;
-  }
-  else {
-    int newsize;
-    newsize = elem->nprops + other->nprops;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * newsize);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * newsize);
-  }
-
-  /* copy the other properties */
-
-  for (i = 0; i < other->nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, other->props[i]);
-    elem->props[elem->nprops] = prop;
-    elem->store_prop[elem->nprops] = OTHER_PROP;
-    elem->nprops++;
-  }
-
-  /* save other info about other properties */
-  elem->other_size = other->size;
-  elem->other_offset = offset;
-}
-
-
-/******************************************************************************
-Pass along a pointer to "other" elements that we want to save in a given
-PLY file.  These other elements were presumably read from another PLY file.
-
-Entry:
-  plyfile     - file pointer in which to store this other element info
-  other_elems - info about other elements that we want to store
-******************************************************************************/
-
-void describe_other_elements_ply (
-  PlyFile *plyfile,
-  PlyOtherElems *other_elems
-)
-{
-  int i;
-  OtherElem *other;
-
-  /* ignore this call if there is no other element */
-  if (other_elems == NULL)
-    return;
-
-  /* save pointer to this information */
-  plyfile->other_elems = other_elems;
-
-  /* describe the other properties of this element */
-
-  for (i = 0; i < other_elems->num_elems; i++) {
-    other = &(other_elems->other_list[i]);
-    element_count_ply (plyfile, other->elem_name, other->elem_count);
-    describe_other_properties_ply (plyfile, other->other_props,
-                                   offsetof(OtherData,other_props));
-  }
-}
-
-
-
-/**** Property Propagation Rules ****/
-
-
-typedef struct RuleName {
-  int code;
-  char *name;
-} RuleName;
-
-RuleName rule_name_list[] = {
-  AVERAGE_RULE, "avg",
-  RANDOM_RULE, "rnd",
-  MINIMUM_RULE, "max",
-  MAXIMUM_RULE, "min",
-  MAJORITY_RULE, "major",
-  SAME_RULE, "same",
-  -1, "end_marker",
-};
-
-
-
-/******************************************************************************
-Initialize the property propagation rules for an element.  Default is to
-use averaging (AVERAGE_RULE) for creating all new properties.
-
-Entry:
-  ply       - PLY object that this is for
-  elem_name - name of the element that we're making the rules for
-
-Exit:
-  returns pointer to the default rules
-******************************************************************************/
-
-PlyPropRules *init_rule_ply (PlyFile *ply, char *elem_name)
-{
-  int i,j;
-  PlyElement *elem;
-  PlyPropRules *rules;
-  PlyRuleList *list;
-  int found_prop;
-
-  elem = find_element (ply, elem_name);
-  if (elem == NULL) {
-    fprintf (stderr, "init_rule_ply: Can't find element '%s'\n", elem_name);
-    exit (-1);
-  }
-
-  rules = (PlyPropRules *) myalloc (sizeof (PlyPropRules));
-  rules->elem = elem;
-  rules->rule_list = (int *) myalloc (sizeof(int) * elem->nprops);
-  rules->max_props = 0;
-  rules->nprops = 0;
-
-  /* default is to use averaging rule */
-  for (i = 0; i < elem->nprops; i++)
-    rules->rule_list[i] = AVERAGE_RULE;
-
-  /* see if there are other rules we should use */
-
-  if (ply->rule_list == NULL)
-    return (rules);
-
-  /* try to match the element, property and rule name */
-
-  for (list = ply->rule_list; list != NULL; list = list->next) {
-
-    if (!equal_strings (list->element, elem->name))
-      continue;
-
-    found_prop = 0;
-
-    for (i = 0; i < elem->nprops; i++)
-      if (equal_strings (list->property, elem->props[i]->name)) {
-
-        found_prop = 1;
-
-        /* look for matching rule name */
-        for (j = 0; rule_name_list[j].code != -1; j++)
-          if (equal_strings (list->name, rule_name_list[j].name)) {
-            rules->rule_list[i] = rule_name_list[j].code;
-            break;
-          }
-      }
-
-    if (!found_prop) {
-      fprintf (stderr, "Can't find property '%s' for rule '%s'\n",
-               list->property, list->name);
-      continue;
-    }
-  }
-
-  return (rules);
-}
-
-
-/******************************************************************************
-Modify a property propagation rule.
-
-Entry:
-  rules - rules for the element
-  prop_name - name of the property whose rule we're modifying
-  rule_type - type of rule (MAXIMUM_RULE, MINIMUM_RULE, MAJORITY_RULE, etc.)
-******************************************************************************/
-
-void modify_rule_ply (PlyPropRules *rules, char *prop_name, int rule_type)
-{
-  int i;
-  PlyElement *elem = rules->elem;
-
-  /* find the property and modify its rule type */
-
-  for (i = 0; i < elem->nprops; i++)
-    if (equal_strings (elem->props[i]->name, prop_name)) {
-      rules->rule_list[i] = rule_type;
-      return;
-    }
-
-  /* we didn't find the property if we get here */
-  fprintf (stderr, "modify_rule_ply: Can't find property '%s'\n", prop_name);
-  exit (-1);
-}
-
-
-/******************************************************************************
-Begin to create a set of properties from a set of propagation rules.
-
-Entry:
-  ply   - PLY object whose rules we're preparing to use
-  rules - rules for the element
-******************************************************************************/
-
-void start_props_ply (PlyFile *ply, PlyPropRules *rules)
-{
-  int i;
-  int count;
-  PlyElement *elem = rules->elem;
-
-  /* save pointer to the rules in the PLY object */
-  ply->current_rules = rules;
-
-  /* get ready for new sets of properties to combine */
-  rules->nprops = 0;
-}
-
-
-/******************************************************************************
-Remember a set of properties and their weights for creating a new set of
-properties.
-
-Entry:
-  weight      - weights for this set of properties
-  other_props - the properties to use
-******************************************************************************/
-
-void weight_props_ply (PlyFile *ply, float weight, void *other_props)
-{
-  PlyPropRules *rules = ply->current_rules;
-
-  /* allocate space for properties and weights, if necessary */
-  if (rules->max_props == 0) {
-    rules->max_props = 6;
-    rules->props = (void **) myalloc (sizeof (void *) * rules->max_props);
-    rules->weights = (float *) myalloc (sizeof (float) * rules->max_props);
-  }
-  if (rules->nprops == rules->max_props) {
-    rules->max_props *= 2;
-    rules->props = (void **) realloc (rules->props,
-                   sizeof (void *) * rules->max_props);
-    rules->weights = (float *) realloc (rules->weights,
-                     sizeof (float) * rules->max_props);
-  }
-
-  /* remember these new properties and their weights */
-
-  rules->props[rules->nprops] = other_props;
-  rules->weights[rules->nprops] = weight;
-  rules->nprops++;
-}
-
-
-/******************************************************************************
-Return a pointer to a new set of properties that have been created using
-a specified set of property combination rules and a given collection of
-"other" properties.
-
-Exit:
-  returns a pointer to the new properties
-******************************************************************************/
-
-void *get_new_props_ply(PlyFile *ply)
-{
-  int i,j;
-  static double *vals;
-  static int max_vals = 0;
-  PlyPropRules *rules = ply->current_rules;
-  PlyElement *elem = rules->elem;
-  PlyProperty *prop;
-  char *data;
-  char *new_data;
-  void *ptr;
-  int offset;
-  int type;
-  double double_val;
-  int int_val;
-  unsigned int uint_val;
-  int random_pick;
-
-  /* return NULL if we've got no "other" properties */
-  if (elem->other_size == 0) {
-    return (NULL);
-  }
-
-  /* create room for combined other properties */
-  new_data = (char *) myalloc (sizeof (char) * elem->other_size);
-
-  /* make sure there is enough room to store values we're to combine */
-
-  if (max_vals == 0) {
-    max_vals = rules->nprops;
-    vals = (double *) myalloc (sizeof (double) * rules->nprops);
-  }
-  if (rules->nprops >= max_vals) {
-    max_vals = rules->nprops;
-    vals = (double *) realloc (vals, sizeof (double) * rules->nprops);
-  }
-
-  /* in case we need a random choice */
-#if defined(_MSC_VER)
-  random_pick = 0;
-#else
-  random_pick = (int) floor (rules->nprops * drand48());
-#endif
-  /* calculate the combination for each "other" property of the element */
-
-  for (i = 0; i < elem->nprops; i++) {
-
-    /* don't bother with properties we've been asked to store explicitly */
-    if (elem->store_prop[i])
-      continue;
-
-    prop = elem->props[i];
-    offset = prop->offset;
-    type = prop->external_type;
-
-    /* collect together all the values we're to combine */
-
-    for (j = 0; j < rules->nprops; j++) {
-      data = (char *) rules->props[j];
-      ptr = (void *) (data + offset);
-      get_stored_item ((void *) ptr, type, &int_val, &uint_val, &double_val);
-      vals[j] = double_val;
-    }
-
-    /* calculate the combined value */
-
-    switch (rules->rule_list[i]) {
-      case AVERAGE_RULE: {
-	double sum = 0;
-	double weight_sum = 0;
-	for (j = 0; j < rules->nprops; j++) {
-	  sum += vals[j] * rules->weights[j];
-	  weight_sum += rules->weights[j];
-	}
-	double_val = sum / weight_sum;
-        break;
-      }
-      case MINIMUM_RULE: {
-	double_val = vals[0];
-	for (j = 1; j < rules->nprops; j++)
-	  if (double_val > vals[j])
-	    double_val = vals[j];
-        break;
-      }
-      case MAXIMUM_RULE: {
-	double_val = vals[0];
-	for (j = 1; j < rules->nprops; j++)
-	  if (double_val < vals[j])
-	    double_val = vals[j];
-        break;
-      }
-      case RANDOM_RULE: {
-	double_val = vals[random_pick];
-        break;
-      }
-      case SAME_RULE: {
-	double_val = vals[0];
-	for (j = 1; j < rules->nprops; j++)
-	  if (double_val != vals[j]) {
-	    fprintf (stderr,
-    "get_new_props_ply: Error combining properties that should be the same.\n");
-            exit (-1);
-	  }
-        break;
-      }
-      default:
-        fprintf (stderr, "get_new_props_ply: Bad rule = %d\n",
-	         rules->rule_list[i]);
-	exit (-1);
-    }
-
-    /* store the combined value */
-
-    int_val = (int) double_val;
-    uint_val = (unsigned int) double_val;
-    ptr = (void *) (new_data + offset);
-    store_item ((char *) ptr, type, int_val, uint_val, double_val);
-  }
-
-  return ((void *) new_data);
-}
-
-
-/******************************************************************************
-Set the list of user-specified property combination rules.
-******************************************************************************/
-
-void set_prop_rules_ply (PlyFile *ply, PlyRuleList *prop_rules)
-{
-  ply->rule_list = prop_rules;
-}
-
-
-/******************************************************************************
-Append a property rule to a growing list of user-specified rules.
-
-Entry:
-  rule_list - current rule list
-  name      - name of property combination rule
-  property  - "element.property" says which property the rule affects
-
-Exit:
-  returns pointer to the new rule list
-******************************************************************************/
-
-PlyRuleList *append_prop_rule (
-  PlyRuleList *rule_list,
-  char *name,
-  char *property
-)
-{
-  PlyRuleList *rule;
-  PlyRuleList *rule_ptr;
-  char *str,*str2;
-  char *ptr;
-
-  /* find . */
-  str = strdup (property);
-  for (ptr = str; *ptr != '\0' && *ptr != '.'; ptr++) ;
-
-  /* split string at . */
-  if (*ptr == '.') {
-    *ptr = '\0';
-    str2 = ptr + 1;
-  }
-  else {
-    fprintf (stderr, "Can't find property '%s' for rule '%s'\n",
-             property, name);
-    return (rule_list);
-  }
-
-  rule = (PlyRuleList *) malloc (sizeof (PlyRuleList));
-  rule->name = name;
-  rule->element = str;
-  rule->property = str2;
-  rule->next = NULL;
-
-  /* either start rule list or append to it */
-
-  if (rule_list == NULL)
-    rule_list = rule;
-  else {                      /* append new rule to current list */
-    rule_ptr = rule_list;
-    while (rule_ptr->next != NULL)
-      rule_ptr = rule_ptr->next;
-    rule_ptr->next = rule;
-  }
-
-  /* return pointer to list */
-
-  return (rule_list);
-}
-
-
-/******************************************************************************
-See if a name matches the name of any property combination rules.
-
-Entry:
-  name - name of rule we're trying to match
-
-Exit:
-  returns 1 if we find a match, 0 if not
-******************************************************************************/
-
-int matches_rule_name (char *name)
-{
-  int i;
-
-  for (i = 0; rule_name_list[i].code != -1; i++)
-    if (equal_strings (rule_name_list[i].name, name))
-      return (1);
-
-  return (0);
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ply.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ply.h
deleted file mode 100644
index 127844caf2c77a6a55e11eda128d02ae7baf33f9..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/ply.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
-
-Header for PLY polygon files.
-
-- Greg Turk
-
-A PLY file contains a single polygonal _object_.
-
-An object is composed of lists of _elements_.  Typical elements are
-vertices, faces, edges and materials.
-
-Each type of element for a given object has one or more _properties_
-associated with the element type.  For instance, a vertex element may
-have as properties three floating-point values x,y,z and three unsigned
-chars for red, green and blue.
-
------------------------------------------------------------------------
-
-Copyright (c) 1998 Georgia Institute of Technology.  All rights reserved.   
-  
-Permission to use, copy, modify and distribute this software and its   
-documentation for any purpose is hereby granted without fee, provided   
-that the above copyright notice and this permission notice appear in   
-all copies of this software and that you do not sell the software.   
-  
-THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,   
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY   
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   
-
-*/
-
-#ifndef __PLY_H__
-#define __PLY_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stddef.h>
-
-#define PLY_ASCII      1        /* ascii PLY file */
-#define PLY_BINARY_BE  2        /* binary PLY file, big endian */
-#define PLY_BINARY_LE  3        /* binary PLY file, little endian */
-
-#define PLY_OKAY    0           /* ply routine worked okay */
-#define PLY_ERROR  -1           /* error in ply routine */
-
-/* scalar data types supported by PLY format */
-
-#define StartType  0
-#define Int8       1
-#define Int16      2
-#define Int32      3
-#define Uint8      4
-#define Uint16     5
-#define Uint32     6
-#define Float32    7
-#define Float64    8
-#define EndType    9
-
-#define  PLY_SCALAR  0
-#define  PLY_LIST    1
-#define  PLY_STRING  2
-
-
-typedef struct PlyProperty {    /* description of a property */
-
-  char *name;                   /* property name */
-  int external_type;            /* file's data type */
-  int internal_type;            /* program's data type */
-  int offset;                   /* offset bytes of prop in a struct */
-
-  int is_list;                  /* 0 = scalar, 1 = list, 2 = char string */
-  int count_external;           /* file's count type */
-  int count_internal;           /* program's count type */
-  int count_offset;             /* offset byte for list count */
-
-} PlyProperty;
-
-typedef struct PlyElement {     /* description of an element */
-  char *name;                   /* element name */
-  int num;                      /* number of elements in this object */
-  int size;                     /* size of element (bytes) or -1 if variable */
-  int nprops;                   /* number of properties for this element */
-  PlyProperty **props;          /* list of properties in the file */
-  char *store_prop;             /* flags: property wanted by user? */
-  int other_offset;             /* offset to un-asked-for props, or -1 if none*/
-  int other_size;               /* size of other_props structure */
-} PlyElement;
-
-typedef struct PlyOtherProp {   /* describes other properties in an element */
-  char *name;                   /* element name */
-  int size;                     /* size of other_props */
-  int nprops;                   /* number of properties in other_props */
-  PlyProperty **props;          /* list of properties in other_props */
-} PlyOtherProp;
-
-typedef struct OtherData { /* for storing other_props for an other element */
-  void *other_props;
-} OtherData;
-
-typedef struct OtherElem {     /* data for one "other" element */
-  char *elem_name;             /* names of other elements */
-  int elem_count;              /* count of instances of each element */
-  OtherData **other_data;      /* actual property data for the elements */
-  PlyOtherProp *other_props;   /* description of the property data */
-} OtherElem;
-
-typedef struct PlyOtherElems {  /* "other" elements, not interpreted by user */
-  int num_elems;                /* number of other elements */
-  OtherElem *other_list;        /* list of data for other elements */
-} PlyOtherElems;
-
-#define AVERAGE_RULE  1
-#define MAJORITY_RULE 2
-#define MINIMUM_RULE  3
-#define MAXIMUM_RULE  4
-#define SAME_RULE     5
-#define RANDOM_RULE   6
-
-typedef struct PlyPropRules {   /* rules for combining "other" properties */
-  PlyElement *elem;      /* element whose rules we are making */
-  int *rule_list;        /* types of rules (AVERAGE_PLY, MAJORITY_PLY, etc.) */
-  int nprops;            /* number of properties we're combining so far */
-  int max_props;         /* maximum number of properties we have room for now */
-  void **props;          /* list of properties we're combining */
-  float *weights;        /* list of weights of the properties */
-} PlyPropRules;
-
-typedef struct PlyRuleList {
-  char *name;                  /* name of the rule */
-  char *element;               /* name of element that rule applies to */
-  char *property;              /* name of property that rule applies to */
-  struct PlyRuleList *next;    /* pointer for linked list of rules */
-} PlyRuleList;
-
-typedef struct PlyFile {        /* description of PLY file */
-  FILE *fp;                     /* file pointer */
-  int file_type;                /* ascii or binary */
-  float version;                /* version number of file */
-  int num_elem_types;           /* number of element types of object */
-  PlyElement **elems;           /* list of elements */
-  int num_comments;             /* number of comments */
-  char **comments;              /* list of comments */
-  int num_obj_info;             /* number of items of object information */
-  char **obj_info;              /* list of object info items */
-  PlyElement *which_elem;       /* element we're currently reading or writing */
-  PlyOtherElems *other_elems;   /* "other" elements from a PLY file */
-  PlyPropRules *current_rules;  /* current propagation rules */
-  PlyRuleList *rule_list;       /* rule list from user */
-} PlyFile;
-
-/* memory allocation */
-/*
-extern char *my_alloc();
-*/
-#define myalloc(mem_size) my_alloc((mem_size), __LINE__, __FILE__)
-
-
-/* old routines */
-
-#if 0
-extern PlyFile *ply_write(FILE *, int, char **, int);
-extern PlyFile *ply_read(FILE *, int *, char ***);
-extern PlyFile *ply_open_for_reading( char *, int *, char ***, int *, float *);
-extern void ply_close(PlyFile *);
-extern PlyOtherProp *ply_get_other_properties(PlyFile *, char *, int);
-#endif
-
-extern void ply_describe_property(PlyFile *, char *, PlyProperty *);
-extern void ply_get_property(PlyFile *, char *, PlyProperty *);
-extern void ply_get_element(PlyFile *, void *);
-
-
-/*** delcaration of routines ***/
-
-PlyOtherElems *get_other_element_ply (PlyFile *);
-
-PlyFile *read_ply(FILE *);
-PlyFile *write_ply(FILE *, int, char **, int);
-extern PlyFile *open_for_writing_ply(char *, int, char **, int);
-void close_ply(PlyFile *);
-void free_ply(PlyFile *);
-
-void get_info_ply(PlyFile *, float *, int *);
-void free_other_elements_ply (PlyOtherElems *);
-
-void append_comment_ply(PlyFile *, char *);
-void append_obj_info_ply(PlyFile *, char *);
-void copy_comments_ply(PlyFile *, PlyFile *);
-void copy_obj_info_ply(PlyFile *, PlyFile *);
-char **get_comments_ply(PlyFile *, int *);
-char **get_obj_info_ply(PlyFile *, int *);
-
-char **get_element_list_ply(PlyFile *, int *);
-void setup_property_ply(PlyFile *, PlyProperty *);
-void get_element_ply (PlyFile *, void *);
-char *setup_element_read_ply (PlyFile *, int, int *);
-PlyOtherProp *get_other_properties_ply(PlyFile *, int);
-
-void element_count_ply(PlyFile *, char *, int);
-void describe_element_ply(PlyFile *, char *, int);
-void describe_property_ply(PlyFile *, PlyProperty *);
-void describe_other_properties_ply(PlyFile *, PlyOtherProp *, int);
-void describe_other_elements_ply ( PlyFile *, PlyOtherElems *);
-void get_element_setup_ply(PlyFile *, char *, int, PlyProperty *);
-PlyProperty **get_element_description_ply(PlyFile *, char *, int*, int*);
-void element_layout_ply(PlyFile *, char *, int, int, PlyProperty *);
-
-void header_complete_ply(PlyFile *);
-void put_element_setup_ply(PlyFile *, char *);
-void put_element_ply(PlyFile *, void *);
-void put_other_elements_ply(PlyFile *);
-
-PlyPropRules *init_rule_ply (PlyFile *, char *);
-void modify_rule_ply (PlyPropRules *, char *, int);
-void start_props_ply (PlyFile *, PlyPropRules *);
-void weight_props_ply (PlyFile *, float, void *);
-void *get_new_props_ply(PlyFile *);
-void set_prop_rules_ply (PlyFile *, PlyRuleList *);
-PlyRuleList *append_prop_rule (PlyRuleList *, char *, char *);
-int matches_rule_name (char *);
-
-int equal_strings(char *, char *);
-char *recreate_command_line (int, char *argv[]);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !__PLY_H__ */
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/plyplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/plyplugin.C
deleted file mode 100644
index 7736d2d3520ccde08ece211d0f4bf9a65a544d8e..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/plyplugin.C
+++ /dev/null
@@ -1,308 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: plyplugin.C,v $
- *      $Author: johns $       $:  $             $State: Exp $
- *      $Revision: 1.8 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-#include "ply.h"
-#include "ply.c"
-
-/* vertex and face definitions for a polygonal object */
-
-typedef struct Vertex {
-  float x,y,z;
-  float r,g,b;
-  float nx,ny,nz;
-  void *other_props;       /* other properties */
-} Vertex;
-
-typedef struct Face {
-  unsigned char nverts;    /* number of vertex indices in list */
-  int *verts;              /* vertex index list */
-  void *other_props;       /* other properties */
-} Face;
-
-char *elem_names[] = { /* list of the elements in the object */
-  "vertex", "face"
-};
-
-PlyProperty vert_props[] = { /* list of property information for a vertex */
-  {"x", Float32, Float32, offsetof(Vertex,x), 0, 0, 0, 0},
-  {"y", Float32, Float32, offsetof(Vertex,y), 0, 0, 0, 0},
-  {"z", Float32, Float32, offsetof(Vertex,z), 0, 0, 0, 0},
-  {"r", Float32, Float32, offsetof(Vertex,r), 0, 0, 0, 0},
-  {"g", Float32, Float32, offsetof(Vertex,g), 0, 0, 0, 0},
-  {"b", Float32, Float32, offsetof(Vertex,b), 0, 0, 0, 0},
-  {"nx", Float32, Float32, offsetof(Vertex,nx), 0, 0, 0, 0},
-  {"ny", Float32, Float32, offsetof(Vertex,ny), 0, 0, 0, 0},
-  {"nz", Float32, Float32, offsetof(Vertex,nz), 0, 0, 0, 0},
-};
-
-PlyProperty face_props[] = { /* list of property information for a face */
-  {"vertex_indices", Int32, Int32, offsetof(Face,verts),
-   1, Uint8, Uint8, offsetof(Face,nverts)},
-  {"vertex_index", Int32, Int32, offsetof(Face,verts),
-   1, Uint8, Uint8, offsetof(Face,nverts)},
-};
-
-
-
-/// plugin data handle
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-
-  int per_vertex_color;
-  int has_normals;
-} ply_t;
-
-
-static void *open_file_read(const char *filepath, const char *filetype,
-                            int *natoms) {
-  FILE *fd;
-  ply_t *ply;
-  
-  printf("plyplugin) Opening PLY file '%s'\n", filepath);
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-  ply = new ply_t;
-  ply->fd = fd;
-  ply->graphics = NULL;
-  *natoms = 0;
-  return ply;
-}
-
-
-static int read_rawgraphics(void *v, int *nelem, 
-                            const molfile_graphics_t **data) {
-  ply_t *ply = (ply_t *)v;
-  ply->per_vertex_color = 0;
-  ply->has_normals = 0;
-
-  int i=0;
-  int nverts=0;
-  int nfaces=0;
-  char *elem_name=NULL;
-  Vertex **vlist=NULL;
-  Face **flist=NULL;
-  PlyOtherProp *vert_other=NULL;
-  PlyOtherProp *face_other=NULL;
-
-  printf("plyplugin) Reading PLY file header...\n");
-  PlyFile *in_ply = read_ply(ply->fd);
-
-  printf("plyplugin) Processing PLY contents...\n");
-  printf("plyplugin) num_elem_types: %d\n", in_ply->num_elem_types);  
-
-  for (i=0; i<in_ply->num_elem_types; i++) {
-    int elem_count = 0;
-
-    /* prepare to read the i'th list of elements */
-    elem_name = setup_element_read_ply (in_ply, i, &elem_count);
-
-    if (equal_strings ("vertex", elem_name)) {
-      int j=0;
-      nverts = elem_count;
-      printf("plyplugin) reading %d vertex elements...\n", nverts);
-
-      /* create a vertex list to hold all the vertices */
-      vlist = (Vertex **) calloc (1, sizeof(Vertex *)*nverts);
-
-      /* set up for getting vertex elements */
-      setup_property_ply(in_ply, &vert_props[0]);
-      setup_property_ply(in_ply, &vert_props[1]);
-      setup_property_ply(in_ply, &vert_props[2]);
-
-      for (j=0; j<in_ply->elems[i]->nprops; j++) {
-        PlyProperty *prop;
-        prop = in_ply->elems[i]->props[j];
-        if (equal_strings ("r", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[3]);
-          ply->per_vertex_color = 1;
-        }
-        if (equal_strings ("g", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[4]);
-          ply->per_vertex_color = 1;
-        }
-        if (equal_strings ("b", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[5]);
-          ply->per_vertex_color = 1;
-        }
-        if (equal_strings ("nx", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[6]);
-          ply->has_normals = 1;
-        }
-        if (equal_strings ("ny", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[7]);
-          ply->has_normals = 1;
-        }
-        if (equal_strings ("nz", prop->name)) {
-          setup_property_ply(in_ply, &vert_props[8]);
-          ply->has_normals = 1;
-        }
-      }
-
-      vert_other = get_other_properties_ply(in_ply,
-                                            offsetof(Vertex,other_props));
-
-      /* grab all the vertex elements */
-      for (j=0; j<nverts; j++) {
-        vlist[j] = (Vertex *) calloc(1, sizeof(Vertex));
-        vlist[j]->r = 1;
-        vlist[j]->g = 1;
-        vlist[j]->b = 1;
-        get_element_ply (in_ply, (void *) vlist[j]);
-      }
-
-    } else if (equal_strings ("face", elem_name)) {
-      int j=0;
-      nfaces = elem_count;
-      printf("plyplugin) reading %d face elements...\n", nfaces);
-
-      /* create a list to hold all the face elements */
-      flist = (Face **) calloc(1, sizeof(Face *)*nfaces);
-
-      /* set up for getting face elements */
-      for (j=0; j<in_ply->elems[i]->nprops; j++) {
-        PlyProperty *prop;
-        prop = in_ply->elems[i]->props[j];
-        if (equal_strings ("vertex_indices", prop->name)) {
-          setup_property_ply(in_ply, &face_props[0]);
-        }
-        if (equal_strings ("vertex_index", prop->name)) {
-          setup_property_ply(in_ply, &face_props[1]);
-        }
-      }
-
-      face_other = get_other_properties_ply (in_ply,
-                                             offsetof(Face,other_props));
-
-      /* grab all the face elements */
-      for (j=0; j<nfaces; j++) {
-        flist[j] = (Face *) calloc(1, sizeof(Face));
-        get_element_ply(in_ply, (void *) flist[j]);
-      }
-    } else {
-      printf("plyplugin) reading other elements...\n");
-      get_other_element_ply(in_ply);
-    } 
-  }
-
-  printf("plyplugin) freeing PLY structures\n");
-  free_ply(in_ply);
-  in_ply = NULL;
-
-  printf("plyplugin) generating %d graphics primitives...\n", nfaces); 
-  ply->graphics = new molfile_graphics_t[2*nfaces];
-  int vert1, vert2, vert3;
-
-  for (i=0; i<nfaces; i++) {
-    if (flist[i]->nverts != 3) {
-      printf("plyplugin) Found non-triangle facet, aborting.\n");
-      return MOLFILE_ERROR;
-    }
-    vert1 = flist[i]->verts[0];
-    vert2 = flist[i]->verts[1];
-    vert3 = flist[i]->verts[2];
-
-    if (vert1 <      0  || vert2 <      0  || vert3 <       0 ||
-        vert1 >= nverts || vert2 >= nverts || vert3 >= nverts) {
-      printf("plyplugin) Error, out-of-range vertex index, aborting.\n"); 
-      return MOLFILE_ERROR;
-    }
-
-    ply->graphics[i].type = MOLFILE_TRIANGLE;
-    float *tridata =  ply->graphics[i].data;
-    tridata[0] = vlist[vert1]->x;
-    tridata[1] = vlist[vert1]->y;
-    tridata[2] = vlist[vert1]->z;
-    tridata[3] = vlist[vert2]->x;
-    tridata[4] = vlist[vert2]->y;
-    tridata[5] = vlist[vert2]->z;
-    tridata[6] = vlist[vert3]->x;
-    tridata[7] = vlist[vert3]->y;
-    tridata[8] = vlist[vert3]->z;
-  } 
-
-  *nelem = nfaces;
-  *data = ply->graphics;
-
-  printf("plyplugin) freeing ply face list\n");
-  for (i=0; i<nfaces; i++) {
-    free(flist[i]);
-  }
-  memset(flist, 0, sizeof(Face *)*nfaces);
-  free(flist);
-  flist = NULL;
-
-  printf("plyplugin) freeing ply vertex list\n");
-  for (i=0; i<nverts; i++) {
-    free(vlist[i]);
-  }
-  memset(vlist, 0, sizeof(float *)*nverts);
-  free(vlist);
-  vlist=NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  ply_t *ply = (ply_t *)v;
-  // close_ply(in_ply);
-  fclose(ply->fd);
-  
-  delete [] ply->graphics;
-  delete ply;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "ply";
-  plugin.prettyname = "PLY";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 2;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "ply";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pqrplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pqrplugin.c
deleted file mode 100644
index e9064732f784666a52fe3f6954788d3ae64640db..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/pqrplugin.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: pqrplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.21 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * PQR is be a space-delimited variant of the PDB format, with atom radius
- * and charge information replacing the B-factor and occupancy columns, and
- * containing only ATOM records.
- *
- * Most of this code is lifted from pdbplugin and readpdb.h
- */
-
-#include "molfile_plugin.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define PQR_RECORD_LENGTH 80
-
-/*  record type defines */
-enum {PQR_REMARK, PQR_ATOM, PQR_UNKNOWN, PQR_END, PQR_EOF, PQR_ERROR, PQR_CRYST1};
-
-/* 
- * read the next record from the specified pqr file, and put the string
- * found in the given string pointer (the caller must provide adequate (81
- * chars) buffer space); return the type of record found
- */
-static int read_pqr_record(FILE *f, char *retStr) {
-
-  char inbuf[PQR_RECORD_LENGTH+2];
-  int recType = PQR_UNKNOWN;
- 
-  /* XXX This PQR record reading code breaks with files that use
-   * Mac or DOS style line breaks with ctrl-M characters.  We need
-   * to replace the use of fgets() and comparisons against \n with
-   * code that properly handles the other cases.
-   */
- 
-  /*  read the next line  */
-  if(inbuf != fgets(inbuf, PQR_RECORD_LENGTH+1, f)) {
-    retStr[0] = '\0';
-    if (feof(f)) {
-      recType = PQR_EOF;
-    }
-    else {
-      recType = PQR_ERROR;
-    }
-  } 
-  else {
-    /*  remove the newline character, if there is one */
-    if(inbuf[strlen(inbuf)-1] == '\n')
-      inbuf[strlen(inbuf)-1] = '\0';
-
-    if (!strncmp(inbuf, "ATOM ",  5) || !strncmp(inbuf, "HETATM", 6)) {
-      /* Note that by only comparing 5 chars for "ATOM " rather than 6,     */
-      /* we allow PQR files containing > 99,999 atoms generated by AMBER    */
-      /* to load which would otherwise fail.  Not needed for HETATM since   */
-      /* those aren't going to show up in files produced for/by MD engines. */
-      strcpy(retStr,inbuf);
-      recType = PQR_ATOM;
-    } else if (!strncmp(inbuf, "CRYST1", 6)) {
-      recType = PQR_CRYST1;
-      strcpy(retStr,inbuf);
-    } else if (!strncmp(inbuf, "END", 3)) {
-      strcpy(retStr,inbuf);
-      recType = PQR_END;
-    } else {
-      retStr[0] = '\0';
-      recType = PQR_UNKNOWN;
-    }
-  }
-
-  /* read the '\r', if there was one */
-  {
-    int ch = fgetc(f);
-    if (ch != '\r') {
-      ungetc(ch, f);
-    }
-  }
-  
-  return recType;
-}
-
-/* Extract the alpha/beta/gamma a/b/c unit cell info from a CRYST1 record */
-static void get_pqr_cryst1(const char *record, 
-                           float *alpha, float *beta, float *gamma, 
-                           float *a, float *b, float *c) {
-  char tmp[PQR_RECORD_LENGTH+3]; /* space for line + cr + lf + NUL */
-  char ch, *s;
-  memset(tmp, 0, sizeof(tmp));
-  strncpy(tmp, record, PQR_RECORD_LENGTH);
-
-  s = tmp+6 ;          ch = tmp[15]; tmp[15] = 0;
-  *a = (float) atof(s);
-  s = tmp+15; *s = ch; ch = tmp[24]; tmp[24] = 0;
-  *b = (float) atof(s);
-  s = tmp+24; *s = ch; ch = tmp[33]; tmp[33] = 0;
-  *c = (float) atof(s);
-  s = tmp+33; *s = ch; ch = tmp[40]; tmp[40] = 0;
-  *alpha = (float) atof(s);
-  s = tmp+40; *s = ch; ch = tmp[47]; tmp[47] = 0;
-  *beta = (float) atof(s);
-  s = tmp+47; *s = ch; ch = tmp[54]; tmp[54] = 0;
-  *gamma = (float) atof(s);
-}
-
-/*
- * Read the fields in an ATOM line. Return 0 on success, nonzero otherwise.
- */
-static int get_pqr_fields(char *record, char *name, char *resname, char *chain,
-    char *segname, char *resid,
-    float *x, float *y, float *z, float *charge, float *radius) {
-
-  /*
-   * PQR files are like pdb files, but not quite.  They're fixed format
-   * for the the identifier data up to resid, but after that it's free-format
-   * for the floating point data.
-   */
-  strncpy(name, record+12, 4);    name[4] = 0;
-  strncpy(resname, record+17, 4); resname[4] = 0;
-  strncpy(chain, record+21, 1);   chain[1] = 0;
-  strncpy(resid, record+22, 4);   resid[4] = 0;
-  /* XXX what to do about the segid? */
-  segname[0] = 0;
-
-  if (sscanf(record+30, "%f%f%f%f%f", x, y, z, charge, radius) != 5) {
-    return 1;
-  }
-  /* success */
-  return 0;
-}
-
-/*
- * Read the coordinates in an ATOM line. Return 0 on success, nonzero otherwise.
- */
-static int get_pqr_coordinates(char *record, float *x, float *y, float *z) {
-  /* skip over the fixed format part and only parse the coordinates */
-  if (sscanf(record+30, "%f%f%f", x, y, z) != 3) {
-    return 1;
-  } 
-  return 0;
-}
-
-/*
- * Return a default radius for the given atom.
- */
-static float get_atom_radius(molfile_atom_t *atom) {
-  char *name, *type;
-  name = atom->name;
-  type = atom->type;
-
-  /* XXX - yeah, this needs to be fixed */
-  return 1.0;
-}
-
-/*
- * Append a PQR ATOM record to the given file.
- */
-static int write_pqr_atom(FILE *fd, int index, const molfile_atom_t *atom, 
-                   float x, float y, float z) {
-  int rc;
-
-  rc = fprintf(fd, "ATOM  %5d %-4s %s %5d    %8.3f %8.3f %8.3f %.3f %.3f\n",
-               index, atom->name, atom->resname, atom->resid, 
-               x, y, z, atom->charge, atom->radius);
-
-  return (rc > 0);
-}
-
-
-/*
- * API functions start here
- */
-
-typedef struct {
-  FILE *fd;
-  int natoms;
-  molfile_atom_t *atomlist;
-} pqrdata;
-
-static void *open_pqr_read(const char *filepath, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  pqrdata *pqr;
-  char pqr_record[PQR_RECORD_LENGTH+2];
-  int record_type;
-
-  fd = fopen(filepath, "r");
-  if (!fd) 
-    return NULL;
-  pqr = (pqrdata *)malloc(sizeof(pqrdata));
-  pqr->fd = fd;
-
-  *natoms=0;
-  do {
-    record_type = read_pqr_record(pqr->fd, pqr_record);
-    if (record_type == PQR_ATOM) {
-      *natoms += 1;
-    } else if (record_type == PQR_ERROR) {
-      printf("pqrplugin) Error reading file after opening.\n");
-      free(pqr);
-      return NULL;
-    }
-  } while ((record_type != PQR_EOF) && (record_type != PQR_END));
-
-  /* If no atoms were found, this is probably not a PQR file! */
-  if (!*natoms) {
-    printf("pqrplugin) file '%s' contains no atoms.\n", filepath);
-    free(pqr);
-    return NULL;
-  }
-
-  rewind(pqr->fd);
-  pqr->natoms = *natoms;
-  return pqr; 
-}
-
-/* 
- * Read atom structure, but not coordinate information.
- */
-static int read_pqr_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) { 
-  pqrdata *pqr = (pqrdata *)mydata;
-  molfile_atom_t *atom;
-  char pqr_record[PQR_RECORD_LENGTH + 1];
-  int i, record_type;
-  char ridstr[8];
-  float newpos;
-  long fpos = ftell(pqr->fd);
- 
-  *optflags = MOLFILE_CHARGE | MOLFILE_RADIUS;
-
-  i = 0;
-  do {
-    record_type = read_pqr_record(pqr->fd, pqr_record);
-    if (((record_type == PQR_EOF) || (record_type == PQR_END)) 
-        && (i < pqr->natoms)) {
-      printf("pqrplugin) unexpected end-of-file while reading structure.\n");
-printf("XXX: %d of %d \n", i, pqr->natoms);
-      return MOLFILE_ERROR;
-    } else if (record_type == PQR_ERROR) {
-      printf("pqrplugin) error reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    } else if (record_type == PQR_ATOM) {
-      if (i >= pqr->natoms) {
-        printf("pqrplugin) too many atoms.\n");
-        return MOLFILE_ERROR;
-      }
-      atom = atoms+i;
-      get_pqr_fields(pqr_record, atom->name, atom->resname, atom->chain, 
-          atom->segid, ridstr,
-          &newpos, &newpos, &newpos, &atom->charge, &atom->radius);
-      atom->resid = atoi(ridstr);
-      strcpy(atom->type, atom->name);
-      i++;
-    }
-  } while((record_type != PQR_EOF) && (record_type != PQR_END));
-
-  fseek(pqr->fd, fpos, SEEK_SET);
-
-  return MOLFILE_SUCCESS;
-}
-
-/* 
- * Read atom coordinates. PQR files contain only a single "timestep".
- */
-static int read_pqr_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pqrdata *pqr = (pqrdata *)v;
-  char pqr_record[PQR_RECORD_LENGTH+2];
-  int record_type, i;
-  float *x, *y, *z;
-
-  if (pqr->natoms == 0) 
-    return MOLFILE_ERROR; /* EOF */
-
-  if (ts != NULL) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = NULL;
-  }
-
-  i = 0;
-  do {
-    record_type = read_pqr_record(pqr->fd, pqr_record);
-    if (((record_type == PQR_EOF) || (record_type == PQR_END)) 
-        && (i < pqr->natoms)) {
-      if (i == 0) {
-        /* don't emit an error if there're no more timesteps */
-        return MOLFILE_EOF;
-      } else {
-        printf("pqrplugin) unexpected end-of-file while reading timestep.\n");
-        return MOLFILE_ERROR;
-      }
-    } else if (record_type == PQR_ERROR) {
-      printf("pqrplugin) error reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    } else if (record_type == PQR_CRYST1) {
-      if (ts) {
-        get_pqr_cryst1(pqr_record, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    } else if (record_type == PQR_ATOM) {
-      /* just get the coordinates, and store them */
-      if (ts != NULL) {
-        get_pqr_coordinates(pqr_record, x, y, z);
-        x += 3;
-        y += 3;
-        z += 3;
-      } 
-      i++;
-    }
-  } while(i < pqr->natoms);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pqr_read(void *v) { 
-  pqrdata *pqr = (pqrdata *)v;
-  if (pqr->fd) {
-    fclose(pqr->fd);
-    pqr->fd = 0;
-  }
-  free(pqr);
-}
-
-static void *open_pqr_write(const char *path, const char *filetype, 
-    int natoms) {
-  FILE *fd;
-  pqrdata *pqr;
-  fd = fopen(path, "w");
-  if (!fd) {
-    printf("pqrplugin) unable to open file %s for writing\n", path);
-    return NULL;
-  }
-
-  pqr = (pqrdata *)malloc(sizeof(pqrdata));
-  pqr->fd = fd;
-  pqr->natoms = natoms; 
-  pqr->atomlist = NULL;
-  return pqr;
-}
- 
-static int write_pqr_structure(void *v, int optflags, 
-    const molfile_atom_t *atoms) {
-  int i;
-  pqrdata *pqr = (pqrdata *)v;
-  int natoms = pqr->natoms;
-  pqr->atomlist = (molfile_atom_t *)malloc(natoms*sizeof(molfile_atom_t));
-
-  memcpy(pqr->atomlist, atoms, natoms*sizeof(molfile_atom_t));
-
-  /* If charge and radius aren't given, we assign defaultvalues. */
-  if (!(optflags & MOLFILE_CHARGE)) {
-    printf("pqrplugin) Warning no atom charges available, assigning zero\n");
-    for (i=0; i<natoms; i++) pqr->atomlist[i].charge = 0.0f;
-  }
-  if (!(optflags & MOLFILE_RADIUS)) {
-    printf("pqrplugin) Warning no atom radii available, assigning radii of 1.0\n");
-    for (i=0; i<natoms; i++) pqr->atomlist[i].radius = 
-      get_atom_radius(&(pqr->atomlist[i]));
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static void write_pqr_cryst1(FILE *fd, const molfile_timestep_t *ts) {
-  fprintf(fd, "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f P 1           1\n", 
-    ts->A, ts->B, ts->C, ts->alpha, ts->beta, ts->gamma);
-}
-
-static int write_pqr_timestep(void *v, const molfile_timestep_t *ts) {
-  pqrdata *pqr = (pqrdata *)v; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-
-  if (pqr->natoms == 0)
-    return MOLFILE_SUCCESS;
-
-  write_pqr_cryst1(pqr->fd, ts);
-  atom = pqr->atomlist;
-  pos = ts->coords;
-  for (i=0; i<pqr->natoms; i++) {
-    if (!write_pqr_atom(pqr->fd, i+1, atom, pos[0], pos[1], pos[2])) {
-      printf("pqrplugin) error writing atom %d; file may be incomplete.\n", i+1);
-      return MOLFILE_ERROR;
-    }
-    atom++;
-    pos += 3;
-  }
-
-  fprintf(pqr->fd, "END\n");
-
-  return MOLFILE_SUCCESS;
-}
- 
-static void close_pqr_write(void *v) {
-  pqrdata *pqr = (pqrdata *)v; 
-  fclose(pqr->fd);
-  free(pqr->atomlist);
-  free(pqr);
-}
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "pqr";
-  plugin.prettyname = "PQR";
-  plugin.author = "Eamon Caddigan";
-  plugin.majorv = 0;
-  plugin.minorv = 6;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "pqr";
-  plugin.open_file_read = open_pqr_read;
-  plugin.read_structure = read_pqr_structure;
-  plugin.read_next_timestep = read_pqr_timestep;
-  plugin.close_file_read = close_pqr_read;
-  plugin.open_file_write = open_pqr_write;
-  plugin.write_structure = write_pqr_structure;
-  plugin.write_timestep = write_pqr_timestep;
-  plugin.close_file_write = close_pqr_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/psfplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/psfplugin.c
deleted file mode 100644
index 012a161fdcb68126dd6313364533f860210dc986..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/psfplugin.c
+++ /dev/null
@@ -1,1113 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: psfplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.83 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include "molfile_plugin.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "fortread.h"
-
-#define PSF_RECORD_LENGTH 256  /* extended to handle Charmm CMAP/CHEQ/DRUDE */
-
-typedef struct {
-  FILE *fp;
-  int numatoms;
-  int namdfmt;     /* NAMD-specific PSF file                                */
-  int charmmfmt;   /* whether psf was written in charmm format              */
-  int charmmcmap;  /* cross-term maps                                       */
-  int charmmcheq;  /* stuff used by charmm for polarizable force fields     */
-  int charmmext;   /* flag used by charmm for IOFOrmat EXTEnded             */
-  int charmmdrude; /* flag used by charmm for Drude polarizable force field */
-  int nbonds;
-  int *from, *to;
-  int numangles, *angles;
-  int numdihedrals, *dihedrals;
-  int numimpropers, *impropers;
-  int numcterms, *cterms;
-} psfdata;
-
-
-/* Formatted reads:
- *
- * copy at most 'maxlen' characters from source to target allowing overflow.
- *
- * leading white space up to 'len' is skipped over but counts towards 'maxlen'.
- * the copy stops at first whitspace or a '\0'.
- * unlike strncpy(3) the result will always be \0 terminated.
- *
- * intended for copying (short) strings from formatted fortran
- * i/o files that must not contain whitespace (e.g. residue names,
- * atom name/types etc. in .pdb, .psf and alike.).
- *
- * returns number of bytes of overflow.
- */
-static int strnwscpy_shift(char *target, const char *source,
-                           const int len, const int maxlen) {
-  int i, c;
-
-  for (i=0, c=0; i<maxlen; ++i) {
-    if (*source == '\0' || (c > 0 && *source == ' ') || (c == 0 && i == len)) {
-      break;
-    }
-
-    if (*source == ' ') {
-      source++;
-    } else {
-      *target++ = *source++;
-      c++;
-    }
-  }
-  *target = '\0';
-  return ( i > len ? i - len : 0 );
-}
-
-/* atoi() replacement
- *
- * reads int with field width fw handling various overflow cases to
- * support both " %7d %7d" and "%8d%8d" writers up to 100M atoms.
- *
- */
-
-static int atoifw(char **ptr, int fw) {
-  char *op = *ptr;
-  int ival = 0;
-  int iws = 0;
-  char tmpc;
-
-  sscanf(op, "%d%n", &ival, &iws);
-  if ( iws == fw ) { /* "12345678 123..." or " 1234567 123..." */
-    *ptr += iws;
-  } else if ( iws < fw ) { /* left justified? */
-    while ( iws < fw && op[iws] == ' ' ) ++iws;
-    *ptr += iws;
-  } else if ( iws < 2*fw ) { /* " 12345678 123..." */
-    *ptr += iws;
-  } else { /* " 123456712345678" or "1234567812345678" */
-    tmpc = op[fw];  op[fw] = '\0';
-    ival = atoi(op);
-    op[fw] = tmpc;
-    *ptr += fw;
-  }
-  return ival;
-}
-
-
-/* Read in the next atom info into the given storage areas; this assumes
-   that file has already been moved to the beginning of the atom records.
-   Returns the serial number of the atom. If there is an error, returns -1.*/
-static int get_psf_atom(FILE *f, char *name, char *atype, char *resname,
-                        char *segname, int *resid, char *insertion, float *q, float *m, 
-                        int namdfmt, int charmmext, int charmmdrude) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  int num;
-
-  if (inbuf != fgets(inbuf, PSF_RECORD_LENGTH+1, f)) {
-    return(-1); /* failed to read in an atom */
-  }
-
-  if (strlen(inbuf) < 50) {
-    fprintf(stderr, "Line too short in psf file: \n%s\n", inbuf);
-    return -1;
-  }
-
-  num = atoi(inbuf); /* atom index */
-
-  if (namdfmt == 1) {
-    int cnt, rcnt;
-    char residstr[12], trash;
-    cnt = sscanf(inbuf, "%d %7s %10s %7s %7s %7s %f %f",
-                 &num, segname, residstr, resname, name, atype, q, m);
-    insertion[0] = ' ';  insertion[1] = '\0';
-    rcnt = sscanf(residstr, "%d%c%c", resid, insertion, &trash);
-    if (cnt != 8 || rcnt < 1 || rcnt > 2) {
-      printf("psfplugin) Failed to parse atom line in NAMD PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-  } else if (charmmdrude == 1 || charmmext == 1) {
-    int xplorshift;
-    /* CHARMM PSF format is (if DRUDE or (?) CHEQ are enabled):
-     *  '(I10,1X,A8,1X,A8,1X,A8,1X,A8,1X,I4,1X,2G14.6,I8,2G14.6)'
-     */
-    if ( inbuf[10] != ' ' ||
-         inbuf[19] != ' ' ||
-         inbuf[28] != ' ' ||
-         inbuf[37] != ' ' ||
-         inbuf[46] != ' ' ) {
-      printf("psfplugin) Failed to parse atom line in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-
-    strnwscpy(segname, inbuf+11, 7);
-    strnwscpy(resname, inbuf+29, 7);
-    strnwscpy(name, inbuf+38, 7);
-
-    xplorshift = 0;
-    strnwscpy(atype, inbuf+47, 4);
-    if ( ! isdigit(atype[0]) ) {
-      strnwscpy(atype, inbuf+47, 6);
-      xplorshift = 2;
-    }
-
-    if ( inbuf[51+xplorshift] != ' ' ) {
-      printf("psfplugin) Failed to parse atom line in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    
-    insertion[0] = ' ';  insertion[1] = '\0';
-    sscanf(inbuf+20, "%d%c", resid, insertion);
-    *q = (float) atof(inbuf+52+xplorshift);
-    *m = (float) atof(inbuf+66+xplorshift);
-    // data we don't currently read:
-    // if (charmmdrude == 1) {
-    //   *imove = atoi(inbuf+80+xplorshift);
-    //   *alphadp = atof(inbuf+88+xplorshift);
-    //   *tholei = atof(inbuf+102+xplorshift);
-    // }
-  } else {
-    /* CHARMM PSF format is 
-     *  '(I8,1X,A4,1X,A4,1X,A4,1X,A4,1X,I4,1X,2G14.6,I8)'
-     */
-    const char *rdbuf = inbuf;
-    char intbuf[16];
-
-    intbuf[0] = '\0';
-    rdbuf += strnwscpy_shift(intbuf, rdbuf, 8, 10);
-    if ( rdbuf[8] != ' ' ) {
-      printf("psfplugin) Failed to parse atom index in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(segname, rdbuf+9, 4, 7);
-    if ( rdbuf[13] != ' ' ) {
-      printf("psfplugin) Failed to parse segname in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    intbuf[0] = '\0';
-    rdbuf += strnwscpy_shift(intbuf, rdbuf+14, 4, 8);
-    insertion[0] = ' ';  insertion[1] = '\0';
-    sscanf(intbuf, "%d%c", resid, insertion);
-    if ( rdbuf[18] != ' ' ) {
-      printf("psfplugin) Failed to parse resid in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(resname, rdbuf+19, 4, 7);
-    if ( rdbuf[23] != ' ' ) {
-      printf("psfplugin) Failed to parse resname in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(name, rdbuf+24, 4, 7);
-    if ( rdbuf[28] != ' ' ) {
-      printf("psfplugin) Failed to parse atom name in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    rdbuf += strnwscpy_shift(atype, rdbuf+29, 4, 7);
-    if ( rdbuf[33] != ' ' ) {
-      printf("psfplugin) Failed to parse atom type in PSF file:\n");
-      printf("psfplugin)   '%s'\n", inbuf);
-      return -1;
-    }
-    *q = (float) atof(rdbuf+34);
-    *m = (float) atof(rdbuf+48);
-  }
-
-#if 0
-  /* if this is a Charmm31 PSF file, there may be two extra */
-  /* columns containing polarizable force field data.       */
-  if (psf->charmmcheq) {
-    /* do something to read in these columns here */
-  }
-#endif
-
-  return num;
-}
-
-
-/*
- * Read in the beginning of the bond/angle/dihed/etc information,
- * but don't read in the data itself.  Returns the number of the record type
- * for the molecule.  If error, returns (-1). 
- */
-static int psf_start_block(FILE *file, const char *blockname) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  int nrec = -1;
-  
-  /* check if we had a parse error earlier, which is indicated
-     by the file descriptor set to NULL */
-  if (!file)
-    return -1;
-
-  /* keep reading the next line until a line with blockname appears */
-  do {
-    if(inbuf != fgets(inbuf, PSF_RECORD_LENGTH+1, file)) {
-      /* EOF encountered with no blockname line found ==> error, return (-1) */
-      return -1;
-    }
-    if(strlen(inbuf) > 0 && strstr(inbuf, blockname))
-      nrec = atoi(inbuf);
-  } while (nrec == -1);
-
-  return nrec;
-}
-
-
-/* Read in the bond info into the given integer arrays, one for 'from' and
-   one for 'to' atoms; remember that .psf files use 1-based indices,
-   not 0-based.  Returns 1 if all nbond bonds found; 0 otherwise.  */
-static int psf_get_bonds(FILE *f, int nbond, int fromAtom[], int toAtom[], int charmmext, int namdfmt) {
-  char *bondptr=NULL;
-  int fw = charmmext ? 10 : 8;
-  char inbuf[PSF_RECORD_LENGTH+2];
-  int i=0;
-  size_t minlinesize;
-  int rc=0;
-
-  while (i < nbond) {
-    if (namdfmt) {
-      // NAMD assumes a space-delimited variant of the PSF file format
-      int cnt = fscanf(f, "%d %d", &fromAtom[i], &toAtom[i]);
-      if (cnt < 2) {
-        fprintf(stderr, "Bonds line too short in NAMD psf file.\n");
-        break;
-      }
-    } else {
-      if ((i % 4) == 0) {
-        /* must read next line */
-        if (!fgets(inbuf, PSF_RECORD_LENGTH+2, f)) {
-          /* early EOF encountered */
-          break;
-        }
-
-        /* Check that there is enough space in the line we are about to read */
-        if (nbond-i >= 4) {
-          minlinesize = 2*fw*4; 
-        } else {
-          minlinesize = 2*fw*(nbond-i); 
-        }
-
-        if (strlen(inbuf) < minlinesize) {
-          fprintf(stderr, "Bonds line too short in psf file: \n%s\n", inbuf);
-          break;
-        }
-        bondptr = inbuf;
-      }
-
-      if ((fromAtom[i] = atoifw(&bondptr,fw)) < 1) {
-        printf("psfplugin) ERROR: Bond %d references atom with index < 1!\n", i);
-        rc=-1;
-        break;
-      }
-  
-      if ((toAtom[i] = atoifw(&bondptr,fw)) < 1) {
-        printf("psfplugin) ERROR: Bond %d references atom with index < 1!\n", i);
-        rc=-1;
-        break;
-      }
-    }
-
-    i++;
-  }
-
-  if (rc == -1) {
-    printf("psfplugin) ERROR: skipping bond info due to bad atom indices\n");
-  } else if (i != nbond) {
-    printf("psfplugin) ERROR: unable to read the specified number of bonds!\n");
-    printf("psfplugin) Expected %d bonds but only read %d\n", nbond, i);
-  }
-
-  return (i == nbond);
-}
-
-
-/*
- * API functions
- */
-
-static void *open_psf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fp;
-  char inbuf[PSF_RECORD_LENGTH*8+2];
-  psfdata *psf;
-  const char *progname = "Charmm";
-  
-  /* Open the .psf file and skip past the remarks to the first data section.
-   * Returns the file pointer, or NULL if error.  Also puts the number of
-   * atoms in the molecule into the given integer.  
-   */
-  if (!path)
-    return NULL;
-
-  if ((fp = fopen(path, "r")) == NULL) {
-    fprintf(stderr, "Couldn't open psf file %s\n", path);
-    return NULL;
-  }
-
-  *natoms = MOLFILE_NUMATOMS_NONE; /* initialize to none */
-
-  psf = (psfdata *) malloc(sizeof(psfdata));
-  memset(psf, 0, sizeof(psfdata));
-  psf->fp = fp;
-  psf->namdfmt = 0;   /* off unless we discover otherwise */
-  psf->charmmfmt = 0; /* off unless we discover otherwise */
-  psf->charmmext = 0; /* off unless we discover otherwise */
-
-  /* read lines until a line with NATOM and without REMARKS appears    */
-  do {
-    /* be prepared for long lines from CNS remarks */
-    if (inbuf != fgets(inbuf, PSF_RECORD_LENGTH*8+1, fp)) {
-      /* EOF encountered with no NATOM line found ==> error, return null */
-      *natoms = MOLFILE_NUMATOMS_NONE;
-      fclose(fp);
-      free(psf);
-      return NULL;
-    }
-
-    if (strlen(inbuf) > 0) {
-      if (!strstr(inbuf, "REMARKS")) {
-        if (strstr(inbuf, "PSF")) {
-          if (strstr(inbuf, "NAMD")) {
-            psf->namdfmt = 1;      
-          }
-          if (strstr(inbuf, "EXT")) {
-            psf->charmmfmt = 1; 
-            psf->charmmext = 1;      
-          }
-          if (strstr(inbuf, "CHEQ")) {
-            psf->charmmfmt = 1; 
-            psf->charmmcheq = 1;      
-          }
-          if (strstr(inbuf, "CMAP")) {
-            psf->charmmfmt = 1; 
-            psf->charmmcmap = 1;      
-          }
-          if (strstr(inbuf, "DRUDE")) {
-            psf->charmmfmt = 1; 
-            psf->charmmdrude = 1;      
-          }
-        } else if (strstr(inbuf, "NATOM")) {
-          *natoms = atoi(inbuf);
-        }
-      } 
-    }
-  } while (*natoms == MOLFILE_NUMATOMS_NONE);
-
-  if (psf->namdfmt) {
-    progname = "NAMD";
-  } else {
-    progname = "Charmm";
-  }
-  if (psf->charmmcheq || psf->charmmcmap) {
-    printf("psfplugin) Detected a %s PSF file\n", progname);
-  }
-  if (psf->charmmext) {
-    printf("psfplugin) Detected a %s PSF EXTEnded file\n", progname);
-  }
-  if (psf->charmmdrude) {
-    printf("psfplugin) Detected a %s Drude polarizable force field file\n", progname);
-    printf("psfplugin) WARNING: Support for Drude FF is currently experimental\n");
-  }
-
-  psf->numatoms = *natoms;
-
-  return psf;
-}
-
-static int read_psf(void *v, int *optflags, molfile_atom_t *atoms) {
-  psfdata *psf = (psfdata *)v;
-  int i;
-  
-  /* we read in the optional mass and charge data */
-  *optflags = MOLFILE_INSERTION | MOLFILE_MASS | MOLFILE_CHARGE;
-
-  for (i=0; i<psf->numatoms; i++) {
-    molfile_atom_t *atom = atoms+i; 
-    if (get_psf_atom(psf->fp, atom->name, atom->type, 
-                     atom->resname, atom->segid,
-                     &atom->resid, atom->insertion, &atom->charge, &atom->mass, 
-                     psf->namdfmt, psf->charmmext, psf->charmmdrude) < 0) {
-      fprintf(stderr, "couldn't read atom %d\n", i);
-      fclose(psf->fp);
-      psf->fp = NULL;
-      return MOLFILE_ERROR;
-    }
-    atom->chain[0] = atom->segid[0];
-    atom->chain[1] = '\0';
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                      float **bondorder, int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  psfdata *psf = (psfdata *)v;
-
-  *nbonds = psf_start_block(psf->fp, "NBOND"); /* get bond count */
-
-  if (*nbonds > 0) {
-    psf->from = (int *) malloc(*nbonds*sizeof(int));
-    psf->to = (int *) malloc(*nbonds*sizeof(int));
-
-    if (!psf_get_bonds(psf->fp, *nbonds, psf->from, psf->to, 
-                       psf->charmmext, psf->namdfmt)) {
-      fclose(psf->fp);
-      psf->fp = NULL;
-      return MOLFILE_ERROR;
-    }
-    *fromptr = psf->from;
-    *toptr = psf->to;
-    *bondorder = NULL; /* PSF files don't provide bond order or type information */
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  } else {
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorder = NULL; /* PSF files don't provide bond order or type information */
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-    printf("psfplugin) WARNING: no bonds defined in PSF file.\n");
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int psf_get_angles(FILE *f, int n, int *angles, int charmmext) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  char *bondptr = NULL;
-  int fw = charmmext ? 10 : 8;
-  int i=0;
-  while (i<n) {
-    if((i % 3) == 0) {
-      /* must read next line */
-      if(!fgets(inbuf,PSF_RECORD_LENGTH+2,f)) {
-        /* early EOF encountered */
-        break;
-      }
-      bondptr = inbuf;
-    }
-    if((angles[3*i] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((angles[3*i+1] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((angles[3*i+2] = atoifw(&bondptr,fw)) < 1)
-      break;
-    i++;
-  }
-
-  return (i != n);
-}
-
-
-static int psf_get_dihedrals_impropers(FILE *f, int n, int *dihedrals, int charmmext) {
-  char inbuf[PSF_RECORD_LENGTH+2];
-  char *bondptr = NULL;
-  int fw = charmmext ? 10 : 8;
-  int i=0;
-  while (i<n) {
-    if((i % 2) == 0) {
-      /* must read next line */
-      if(!fgets(inbuf,PSF_RECORD_LENGTH+2,f)) {
-        /* early EOF encountered */
-        break;
-      }
-      bondptr = inbuf;
-    }
-    if((dihedrals[4*i] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((dihedrals[4*i+1] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((dihedrals[4*i+2] = atoifw(&bondptr,fw)) < 1)
-      break;
-    if((dihedrals[4*i+3] = atoifw(&bondptr,fw)) < 1)
-      break;
-    i++;
-  }
-
-  return (i != n);
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int read_angles(void *v, int *numangles, int **angles, 
-                       int **angletypes, int *numangletypes, 
-                       char ***angletypenames, int *numdihedrals,
-                       int **dihedrals, int **dihedraltypes, 
-                       int *numdihedraltypes, char ***dihedraltypenames,
-                       int *numimpropers, int **impropers, 
-                       int **impropertypes, int *numimpropertypes, 
-                       char ***impropertypenames, int *numcterms, 
-                       int **cterms, int *ctermcols, int *ctermrows) {
-  psfdata *psf = (psfdata *)v;
-
-  /* initialize data to zero */
-  *numangles         = 0;
-  *angles            = NULL;
-  *angletypes        = NULL;
-  *numangletypes     = 0;
-  *angletypenames    = NULL;
-  *numdihedrals      = 0;
-  *dihedrals         = NULL;
-  *dihedraltypes     = NULL;
-  *numdihedraltypes  = 0;
-  *dihedraltypenames = NULL;
-  *numimpropers      = 0;
-  *impropers         = NULL;
-  *impropertypes     = NULL;
-  *numimpropertypes  = 0;
-  *impropertypenames = NULL;
-  *numcterms         = 0;
-  *cterms            = NULL;
-  *ctermrows         = 0;
-  *ctermcols         = 0;
-
-  psf->numangles    = psf_start_block(psf->fp, "NTHETA"); /* get angle count */
-  if (psf->numangles > 0) {
-    psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-    psf_get_angles(psf->fp, psf->numangles, psf->angles, psf->charmmext);
-  } else {
-    printf("psfplugin) WARNING: no angles defined in PSF file.\n");
-  }
- 
-  psf->numdihedrals = psf_start_block(psf->fp, "NPHI");   /* get dihed count */
-  if (psf->numdihedrals > 0) {
-    psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numdihedrals, psf->dihedrals, psf->charmmext);
-  } else {
-    printf("psfplugin) WARNING: no dihedrals defined in PSF file.\n");
-  }
- 
-  psf->numimpropers = psf_start_block(psf->fp, "NIMPHI"); /* get imprp count */
-  if (psf->numimpropers > 0) {
-    psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numimpropers, psf->impropers, psf->charmmext);
-  } else {
-    printf("psfplugin) WARNING: no impropers defined in PSF file.\n");
-  }
-
-  psf->numcterms = psf_start_block(psf->fp, "NCRTERM"); /* get cmap count */
-  if (psf->numcterms > 0) {
-    psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-
-    /* same format as dihedrals, but double the number of terms */
-    psf_get_dihedrals_impropers(psf->fp, psf->numcterms * 2, psf->cterms, psf->charmmext);
-  } else {
-    printf("psfplugin) no cross-terms defined in PSF file.\n");
-  }
-
-  *numangles = psf->numangles;
-  *angles = psf->angles;
-
-  *numdihedrals = psf->numdihedrals;
-  *dihedrals = psf->dihedrals;
-
-  *numimpropers = psf->numimpropers;
-  *impropers = psf->impropers;
-
-  *numcterms = psf->numcterms;
-  *cterms = psf->cterms;
-
-  *ctermcols = 0;
-  *ctermrows = 0;
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int read_angles(void *v,
-               int *numangles,    int **angles,    double **angleforces,
-               int *numdihedrals, int **dihedrals, double **dihedralforces,
-               int *numimpropers, int **impropers, double **improperforces,
-               int *numcterms,    int **cterms,
-               int *ctermcols,    int *ctermrows,  double **ctermforces) {
-  psfdata *psf = (psfdata *)v;
-
-  psf->numangles    = psf_start_block(psf->fp, "NTHETA"); /* get angle count */
-  if (psf->numangles > 0) {
-    psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-    psf_get_angles(psf->fp, psf->numangles, psf->angles);
-  } else {
-    printf("psfplugin) WARNING: no angles defined in PSF file.\n");
-  }
- 
-  psf->numdihedrals = psf_start_block(psf->fp, "NPHI");   /* get dihed count */
-  if (psf->numdihedrals > 0) {
-    psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numdihedrals, psf->dihedrals);
-  } else {
-    printf("psfplugin) WARNING: no dihedrals defined in PSF file.\n");
-  }
- 
-  psf->numimpropers = psf_start_block(psf->fp, "NIMPHI"); /* get imprp count */
-  if (psf->numimpropers > 0) {
-    psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-    psf_get_dihedrals_impropers(psf->fp, psf->numimpropers, psf->impropers);
-  } else {
-    printf("psfplugin) WARNING: no impropers defined in PSF file.\n");
-  }
-
-  psf->numcterms = psf_start_block(psf->fp, "NCRTERM"); /* get cmap count */
-  if (psf->numcterms > 0) {
-    psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-
-    /* same format as dihedrals, but double the number of terms */
-    psf_get_dihedrals_impropers(psf->fp, psf->numcterms * 2, psf->cterms);
-  } else {
-    printf("psfplugin) no cross-terms defined in PSF file.\n");
-  }
-
-  *numangles = psf->numangles;
-  *angles = psf->angles;
-  *angleforces = NULL;
-
-  *numdihedrals = psf->numdihedrals;
-  *dihedrals = psf->dihedrals;
-  *dihedralforces = NULL;
-
-  *numimpropers = psf->numimpropers;
-  *impropers = psf->impropers;
-  *improperforces = NULL;
-
-  *numcterms = psf->numcterms;
-  *cterms = psf->cterms;
-
-  *ctermcols = 0;
-  *ctermrows = 0;
-  *ctermforces = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static void close_psf_read(void *mydata) {
-  psfdata *psf = (psfdata *)mydata;
-  if (psf) {
-    if (psf->fp != NULL) 
-      fclose(psf->fp);
-
-    /* free bond data */
-    if (psf->from != NULL) 
-      free(psf->from);
-    if (psf->to != NULL) 
-      free(psf->to);
-
-    /* free angle data */
-    if (psf->angles != NULL)
-      free(psf->angles);
-    if (psf->dihedrals != NULL)
-      free(psf->dihedrals);
-    if (psf->impropers != NULL)
-      free(psf->impropers);
-
-    /* free cross-term data */
-    if (psf->cterms != NULL)
-      free(psf->cterms);
-
-    free(psf);
-  }
-}  
-
-
-static void *open_psf_write(const char *path, const char *filetype,
-    int natoms) {
-  FILE *fp;
-  psfdata *psf;
-
-  fp = fopen(path, "w");
-  if (!fp) {
-    fprintf(stderr, "Unable to open file %s for writing\n", path);
-    return NULL;
-  }
-  psf = (psfdata *) malloc(sizeof(psfdata));
-  memset(psf, 0, sizeof(psfdata));
-  psf->fp = fp; 
-  psf->numatoms = natoms;
-  psf->namdfmt = 0;     /* initialize to off for now */
-  psf->charmmfmt = 0;   /* initialize to off for now */
-  psf->charmmext = 0;   /* off unless we discover we need it */
-  psf->charmmcmap = 0;  /* off unless we discover we need it */
-  psf->charmmcheq = 0;  /* off unless we discover we need it */
-  psf->charmmdrude = 0; /* off unless we discover we need it */
-  psf->nbonds = 0;
-  psf->to = NULL;
-  psf->from = NULL;
-  return psf;
-}
-
-static int write_psf_structure(void *v, int optflags,
-                               const molfile_atom_t *atoms) {
-  psfdata *psf = (psfdata *)v;
-  const molfile_atom_t *atom;
-  int i, fullrows;
-  int xplorfmt = 0;
-
-  for (i=0; i<psf->numatoms; i++) {
-    if ( ! isdigit(atoms[i].type[0]) ) xplorfmt = 1;
-  }
-
-  /* determine if we must write out an EXT formatted PSF file */
-  /* check the field width of the PSF atom records            */
-  if (psf->namdfmt == 0) {
-    int fw = xplorfmt ? 6 : 4;
-    for (i=0; i<psf->numatoms; i++) {
-      if (strlen(atoms[i].type) > fw) {
-        psf->namdfmt = 1;   /* force output to NAMD PSF variant because */
-                            /* the atom types are too long              */
-      }
-    }
-  }
-  if (psf->namdfmt) {
-    psf->charmmext = 0; /* using space-delimited format anyway */
-  } else {
-    if (psf->numatoms > 9999999) { /* allow space-delimited readers */
-      psf->charmmext = 1; /* force output to EXTended PSF format      */
-    }
-    if (psf->charmmext == 0) {
-      for (i=0; i<psf->numatoms; i++) {
-        if (strlen(atoms[i].name) > 4) {
-          psf->charmmext = 1; /* force output to EXTended PSF format      */
-        }
-        if (xplorfmt && strlen(atoms[i].type) > 4) {
-          psf->charmmext = 1; /* force output to EXTended PSF format      */
-        }
-      }
-    }
-  }
-  if (psf->namdfmt == 1) {
-    printf("psfplugin) Structure requires space-delimited NAMD PSF format\n");
-  } else if (psf->charmmext == 1) {
-    printf("psfplugin) Structure requires EXTended PSF format\n");
-  }
-
-  /* check to see if we'll be writing cross-term maps */
-  if (psf->numcterms > 0) {
-    psf->charmmcmap = 1;
-  }
-
-  /* write out the PSF header */
-  fprintf(psf->fp, "PSF");
-  if (psf->namdfmt == 1) 
-    fprintf(psf->fp, " NAMD");
-  if (psf->charmmext == 1)
-    fprintf(psf->fp, " EXT");
-  if (psf->charmmcmap == 1)
-    fprintf(psf->fp, " CMAP");
-  fprintf(psf->fp, "\n\n%8d !NTITLE\n", 1);
-
-  if (psf->charmmfmt) {
-    fprintf(psf->fp," REMARKS %s\n","VMD-generated Charmm PSF structure file");
-
-    printf("psfplugin) WARNING: Charmm format PSF file is incomplete, atom type ID\n");
-    printf("psfplugin)          codes have been emitted as '0'. \n");
-  } else {
-    fprintf(psf->fp," REMARKS %s\n","VMD-generated NAMD/X-Plor PSF structure file");
-  }
-  fprintf(psf->fp, "\n");
-
-  /* write out total number of atoms */
-  fprintf(psf->fp, "%8d !NATOM\n", psf->numatoms);
-
-  /* write out all of the atom records */
-  for (i=0; i<psf->numatoms; i++) {
-    const char *atomname; 
-    atom = &atoms[i];
-    atomname = atom->name;
-
-    /* skip any leading space characters given to us by VMD */ 
-    while (*atomname == ' ')
-      atomname++;
-
-    if (psf->charmmext) {
-      fprintf(psf->fp, xplorfmt ? 
-                       "%10d %-8s %-8d %-8s %-8s %-6s %10.6f    %10.4f  %10d\n"
-                     : "%10d %-8s %-8d %-8s %-8s %-4s %10.6f    %10.4f  %10d\n",
-              i+1, atom->segid, atom->resid, atom->resname,
-              atomname, atom->type, atom->charge, atom->mass, 0);
-    } else if (psf->charmmfmt) {
-      /* XXX replace hard-coded 0 with proper atom type ID code */
-      fprintf(psf->fp, "%8d %-4s %-4d %-4s %-4s %4d %10.6f    %10.4f  %10d\n",
-              i+1, atom->segid, atom->resid, atom->resname,
-              atomname, /* atom->typeid */ 0, atom->charge, atom->mass, 0);
-    } else {
-      fprintf(psf->fp, "%8d %-4s %-4d %-4s %-4s %-4s %10.6f    %10.4f  %10d\n",
-              i+1, atom->segid, atom->resid, atom->resname,
-              atomname, atom->type, atom->charge, atom->mass, 0);
-    }
-  } 
-  fprintf(psf->fp, "\n");
-
-  /* write out bonds if we have bond information */
-  /* XXX Note: We are generating bond records the same way for both the  */
-  /*           normal and EXT format PSF files, which seems odd, but was */
-  /*           seemingly validated by the CHARMM 31 test files I have.   */
-  if (psf->nbonds > 0 && psf->from != NULL && psf->to != NULL) {
-    fprintf(psf->fp, "%8d !NBOND: bonds\n", psf->nbonds);
-    for (i=0; i<psf->nbonds; i++) {
-      if (psf->namdfmt)
-        fprintf(psf->fp, " %7d %7d", psf->from[i], psf->to[i]);
-      else if (psf->charmmext)
-        fprintf(psf->fp, "%10d%10d", psf->from[i], psf->to[i]);
-      else
-        fprintf(psf->fp, "%8d%8d", psf->from[i], psf->to[i]);
-
-      if ((i % 4) == 3) 
-        fprintf(psf->fp, "\n");
-    }
-    if ((i % 4) != 0) 
-      fprintf(psf->fp, "\n");
-    fprintf(psf->fp, "\n");
-  } else {
-    fprintf(psf->fp, "%8d !NBOND: bonds\n", 0);
-    fprintf(psf->fp, "\n\n");
-  }
-
-  if (psf->numangles == 0 && psf->numdihedrals == 0 && psf->numimpropers == 0 && psf->numcterms == 0) {
-    printf("psfplugin) WARNING: PSF file is incomplete, no angles, dihedrals,\n");
-    printf("psfplugin)          impropers, or cross-terms will be written. \n");
-
-    fprintf(psf->fp, "%8d !NTHETA: angles\n\n\n", 0);
-    fprintf(psf->fp, "%8d !NPHI: dihedrals\n\n\n", 0);
-    fprintf(psf->fp, "%8d !NIMPHI: impropers\n\n\n", 0);
-  } else {
-    int i, numinline;
-
-    printf("psfplugin) Writing angles/dihedrals/impropers...\n");
-
-    fprintf(psf->fp, "%8d !NTHETA: angles\n", psf->numangles);
-    for (numinline=0,i=0; i<psf->numangles; i++) {
-      if ( numinline == 3 ) { fprintf(psf->fp, "\n");  numinline = 0; }
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d" : " %7d %7d %7d", 
-              psf->angles[i*3], psf->angles[i*3+1], psf->angles[i*3+2]);
-      numinline++;
-    }
-    fprintf(psf->fp, "\n\n");
-
-    fprintf(psf->fp, "%8d !NPHI: dihedrals\n", psf->numdihedrals);
-    for (numinline=0,i=0; i<psf->numdihedrals; i++) {
-      if ( numinline == 2 ) { fprintf(psf->fp, "\n");  numinline = 0; }
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d" : " %7d %7d %7d %7d", 
-              psf->dihedrals[i*4], psf->dihedrals[i*4+1], 
-              psf->dihedrals[i*4+2], psf->dihedrals[i*4+3]);
-      numinline++;
-    }
-    fprintf(psf->fp, "\n\n");
-
-    fprintf(psf->fp, "%8d !NIMPHI: impropers\n", psf->numimpropers);
-    for (numinline=0,i=0; i<psf->numimpropers; i++) {
-      if ( numinline == 2 ) { fprintf(psf->fp, "\n");  numinline = 0; }
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d" : " %7d %7d %7d %7d",
-              psf->impropers[i*4  ], psf->impropers[i*4+1], 
-              psf->impropers[i*4+2], psf->impropers[i*4+3]);
-      numinline++;
-    }
-    fprintf(psf->fp, "\n\n");
-  }
-
-
-  /*
-   * write out empty donor/acceptor records since we don't
-   * presently make use of this information 
-   */
-  fprintf(psf->fp, "%8d !NDON: donors\n\n\n", 0);
-  fprintf(psf->fp, "%8d !NACC: acceptors\n\n\n", 0);
-  fprintf(psf->fp, "%8d !NNB\n\n", 0);
-
-  /* Pad with zeros, one for every atom */
-  fullrows = psf->numatoms/8;
-  for (i=0; i<fullrows; ++i)
-    fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d%10d%10d%10d%10d\n" :
-                     "%8d%8d%8d%8d%8d%8d%8d%8d\n", 0, 0, 0, 0, 0, 0, 0, 0);
-  for (i=psf->numatoms - fullrows*8; i; --i)
-    fprintf(psf->fp, psf->charmmext ? "%10d" : "%8d", 0);
-  fprintf(psf->fp, "\n\n");
-  fprintf(psf->fp, psf->charmmext ? "%8d %7d !NGRP\n%10d%10d%10d\n\n" :
-                   "%8d %7d !NGRP\n%8d%8d%8d\n\n", 1, 0, 0, 0, 0);
-
-
-  /* write out cross-terms */
-  if (psf->numcterms > 0) {
-    fprintf(psf->fp, "%8d !NCRTERM: cross-terms\n", psf->numcterms);
-    for (i=0; i<psf->numcterms; i++) {
-      fprintf(psf->fp, psf->charmmext ? "%10d%10d%10d%10d%10d%10d%10d%10d\n" :
-                       " %7d %7d %7d %7d %7d %7d %7d %7d\n",
-              psf->cterms[i*8  ], psf->cterms[i*8+1], 
-              psf->cterms[i*8+2], psf->cterms[i*8+3],
-              psf->cterms[i*8+4], psf->cterms[i*8+5],
-              psf->cterms[i*8+6], psf->cterms[i*8+7]);
-    }
-    fprintf(psf->fp, "\n\n");
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-static int write_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                       float *bondorderptr, int *bondtype, 
-                       int nbondtypes, char **bondtypename) {
-  psfdata *psf = (psfdata *)v;
-
-  /* save info until we actually write out the structure file */
-  psf->nbonds = nbonds;
-  psf->from = (int *) malloc(nbonds * sizeof(int));
-  memcpy(psf->from, fromptr, nbonds * sizeof(int));
-  psf->to = (int *) malloc(nbonds * sizeof(int));
-  memcpy(psf->to, toptr, nbonds * sizeof(int));
-
-  return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int write_angles(void * v, int numangles, const int *angles,
-                        const int *angletypes, int numangletypes,
-                        const char **angletypenames, int numdihedrals, 
-                        const int *dihedrals, const int *dihedraltype,
-                        int numdihedraltypes, const char **dihedraltypenames,
-                        int numimpropers, const int *impropers, 
-                        const int *impropertypes, int numimpropertypes, 
-                        const char **impropertypenames, int numcterms, 
-                        const int *cterms, int ctermcols, int ctermrows) {
-  psfdata *psf = (psfdata *)v;
-
-  /* save info until we actually write out the structure file */
-  psf->numangles = numangles;
-  psf->numdihedrals = numdihedrals;
-  psf->numimpropers = numimpropers;
-  psf->numcterms = numcterms;
-
-  psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-  memcpy(psf->angles, angles, 3*psf->numangles*sizeof(int));
-
-  psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-  memcpy(psf->dihedrals, dihedrals, 4*psf->numdihedrals*sizeof(int));
-
-  psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-  memcpy(psf->impropers, impropers, 4*psf->numimpropers*sizeof(int));
-
-  psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-  memcpy(psf->cterms, cterms, 8*psf->numcterms*sizeof(int));
-
-  return MOLFILE_SUCCESS;
-}
-#else
-static int write_angles(void * v,
-        int numangles,    const int *angles,    const double *angleforces,
-        int numdihedrals, const int *dihedrals, const double *dihedralforces,
-        int numimpropers, const int *impropers, const double *improperforces,
-        int numcterms,   const int *cterms,
-        int ctermcols, int ctermrows, const double *ctermforces) {
-  psfdata *psf = (psfdata *)v;
-
-  /* save info until we actually write out the structure file */
-  psf->numangles = numangles;
-  psf->numdihedrals = numdihedrals;
-  psf->numimpropers = numimpropers;
-  psf->numcterms = numcterms;
-
-  psf->angles = (int *) malloc(3*psf->numangles*sizeof(int));
-  memcpy(psf->angles, angles, 3*psf->numangles*sizeof(int));
-
-  psf->dihedrals = (int *) malloc(4*psf->numdihedrals*sizeof(int));
-  memcpy(psf->dihedrals, dihedrals, 4*psf->numdihedrals*sizeof(int));
-
-  psf->impropers = (int *) malloc(4*psf->numimpropers*sizeof(int));
-  memcpy(psf->impropers, impropers, 4*psf->numimpropers*sizeof(int));
-
-  psf->cterms = (int *) malloc(8*psf->numcterms*sizeof(int));
-  memcpy(psf->cterms, cterms, 8*psf->numcterms*sizeof(int));
-
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static void close_psf_write(void *v) {
-  psfdata *psf = (psfdata *)v;
-  fclose(psf->fp);
-
-  /* free bonds if we have them */
-  if (psf->from != NULL) 
-    free(psf->from);
-  if (psf->to != NULL) 
-    free(psf->to);
-
-  /* free angles if we have them */
-  if (psf->angles)
-    free(psf->angles);
-  if (psf->dihedrals)
-    free(psf->dihedrals);
-  if (psf->impropers)
-    free(psf->impropers);
-
-  /* free cross-terms if we have them */
-  if (psf->cterms)
-    free(psf->cterms);
-
-  free(psf);
-}
-
-
-/*
- * Initialization stuff down here
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "psf";
-  plugin.prettyname = "CHARMM,NAMD,XPLOR PSF";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 9;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "psf";
-  plugin.open_file_read = open_psf_read;
-  plugin.read_structure = read_psf;
-  plugin.read_bonds = read_bonds;
-#if vmdplugin_ABIVERSION > 9
-  plugin.read_angles = read_angles;
-#endif
-  plugin.close_file_read = close_psf_read;
-  plugin.open_file_write = open_psf_write;
-  plugin.write_structure = write_psf_structure;
-  plugin.close_file_write = close_psf_write;
-  plugin.write_bonds = write_bonds;
-#if vmdplugin_ABIVERSION > 9
-  plugin.write_angles = write_angles;
-#endif
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/qmplugin.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/qmplugin.h
deleted file mode 100644
index 86daebe30f34004c17a9d325971ac458aae74cf8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/qmplugin.h
+++ /dev/null
@@ -1,1116 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: qmplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.23 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-/*******************************************************************
- * 
- *  Data structures and utility functions for plugins
- *  reading logfiles from QM packages.
- *  
- ******************************************************************/
-
-#ifndef QMPLUGIN_H
-#define QMPLUGIN_H
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <math.h>
-#include "molfile_plugin.h"
-
-
-#define FALSE 0
-#define TRUE  1
-
-#define NONE  0
-
-/* macros for shell types */
-#define UNK_SHELL -666
-#define SPD_SHELL   -11
-#define SP_SHELL    -10
-#define SPD_D_SHELL -5
-#define SPD_P_SHELL -4
-#define SPD_S_SHELL -3
-#define SP_S_SHELL -2
-#define SP_P_SHELL -1
-#define S_SHELL 0
-#define P_SHELL 1
-#define D_SHELL 2
-#define F_SHELL 3
-#define G_SHELL 4
-#define H_SHELL 5
-#define I_SHELL 6
-
-#define SPIN_ALPHA  0
-#define SPIN_BETA   1
-
-/* XXX the following macros should better be in molfileplugin.h
- * since the same macros must be defined in VMD too. */
-
-
-/* macros defining type of CI method (CITYP in GAMESS) */
-#define CI_UNKNOWN -1
-#define CI_NONE     0
-#define CI_CIS      1
-#define CI_ALDET    2
-#define CI_ORMAS    3
-#define CI_GUGA     4
-#define CI_FSOCI    5
-#define CI_GENCI    6
-
-/* Basis set definition for a primitive */
-typedef struct {
-  float exponent;
-  float contraction_coeff;
-} prim_t;
-
-/* Basis set definition for a shell */
-typedef struct {
-  int numprims;      /* number of primitives in this shell */
-  int type;          /* S, P, D, F, ...
-                      * just for convenience when retrieving info */
-  int wave_offset;   /* index into wave_function array */
-  prim_t *prim;      /* array of primitives */
-} shell_t;
-
-/* Basis set definition for an atom */
-typedef struct {
-  char name[11];  /* atom name or type */
-  int atomicnum;  /* atomic number (nuclear charge) */
-  int numshells;  /* number of shells for this atom */
-  shell_t *shell; /* array of shells */
-} basis_atom_t;
-
-
-/* Atoms */
-typedef struct 
-{
-  char type [11]; /* atom name or type */
-
-  int atomicnum;  /* atomic number (nuclear charge) */
-
-  float x,y,z;    /* coordinates of atom */
-} qm_atom_t;
-
-
-/* Wave function */
-typedef struct {
-  int   type;           /**< CANONICAL, LOCALIZED, OTHER */
-  int   spin;           /**< 0 for alpha, 1 for beta */
-  int   exci;           /**< 0 for ground state, 1,2,3,... for excited states */
-  int   mult;           /**< spin multiplicity of the electronic state */
-  char info[MOLFILE_BUFSIZ]; /**< string for additional type info */
-
-  int   num_orbitals;   /**< number of orbitals that was really 
-                         *   present in the output for this step */
-  int   num_coeffs;     /**< number of coefficients per orbital  */
-  int   has_orben;      /**< flag for orbital energies    */
-  int   has_occup;      /**< flag for orbital occupancies */
-  double energy;        /**< total energy for this state */
-  float *wave_coeffs;   /**< expansion coefficients for wavefunction in the
-                         *   form {orbital1(c1),orbital1(c2),.....,orbitalM(cN)} */
-  float *orb_energies;    /**< array of orbital energies*/
-  float *orb_occupancies; /**< array of orbital occupancies */
-} qm_wavefunction_t;
-
-
-/* Timestep specific data.
- * (Note that atoms are treated separately) */
-typedef struct {
-  qm_wavefunction_t *wave;
-  int     numwave;          /* number of wavefunctions for this ts */
-  float  *gradient;         /* energy gradient for each atom */
-  int     num_scfiter;      /* number of SCF iterations */
-
-  double *scfenergies;      /* scfenergies per trajectory point */
-
-  /* arrays with atom charges */
-  double *mulliken_charges; /* per-atom Mulliken charges */
-  double *lowdin_charges;   /* per-atom Lowdin charges */
-  double *esp_charges;      /* per-atom ESP charges */
-  int   have_mulliken; 
-  int   have_lowdin; 
-  int   have_esp; 
-} qm_timestep_t;
-
-
-/* Main QM plugin data structure */
-typedef struct 
-{
-  /* File format specific data.
-   * This pointer must be cast to the according type by the plugin.
-   * Typically, this will be a struct containing various data that
-   * are needed by different functions during the file parsing process
-   * and cannot be sent through the molfile_plugin QM interface since 
-   * the underlying data types are specific to the file format being
-   * read. */
-  void *format_specific_data; 
-
-  FILE *file;       /* the file we are reading */
-
-
-  /******************************************************
-   * calculation metadata (input data)
-   *****************************************************/
-
-  int numatoms;     /* number of atoms in structure */
-  int runtype;      /* type of calculation 
-                     * (ENERGY, OPTIMIZE, GRADIENT, ...) */
-  int scftype;      /* UHF, RHF, ROHF, ... */
-  int dfttype;      /* NONE, B3LYP, ...,   */
-  int citype;       /* NONE, GUGA, ...     */
-
-  int mplevel;      /* Moller-Plesset perturbation level */
-
-  char gbasis[10];  /* GBASIS of GAMESS run */
-
-  char basis_string[BUFSIZ]; /* basis name as "nice" string */
-
-  char runtitle[BUFSIZ];  /* title of gamess run */
-
-  char geometry[BUFSIZ];  /* either UNIQUE, CART or ZMP/ZMTMPC */
-  char guess[BUFSIZ];     /* type of guess method used */
-
-  char version_string[BUFSIZ]; /* GAMESS version used for run */
-
-
-  int  nproc;          /* Number processors used */
-  char memory[256];    /* Amount of memory used, e.g. 1Gb */
-
-  int totalcharge;     /* Total charge of the system */
-  int multiplicity;    /* Multiplicity of the system */
-  int num_electrons;   /* Number of electrons */
-
-  char pointgroup[BUFSIZ]; /* Symmetry point group */
-  int naxis;
-  int order;               /* Order of highest axis */
-
-  int mcscf_num_core;  /* Number of MCSCF core orbitals 
-                        * (determines # valid orb energies
-                        * for MCSCF natural orbitals) */
-
-  int max_opt_steps;   /* Max. number of geom. opt. steps */
-  float opt_tol;       /* gradient convergence tolerance,
-                        * in Hartree/Bohr. */
-
-
-  /*********************************************************
-   * Basis set data
-   *********************************************************/
-
-  /* this array of floats stores the contraction coefficients
-   * and exponents for the basis functions:
-   * { exp(1), c-coeff(1), exp(2), c-coeff(2), .... }
-   * This holds also for double-zeta basis functions with
-   * exp(i) = exp(j) and c-coeff(i) != c-coeff(j). */
-  float *basis;
-
-  /* hierarchical basis set structures for each atom */
-  basis_atom_t *basis_set;
-
-  /* number of uncontracted basis functions in basis array */
-  int num_basis_funcs;
-
-  /* number of atoms listed in basis set */
-  int num_basis_atoms;
-
-  /* atomic number per atom in basis set */
-  int *atomicnum_per_basisatom;
-
-  /* number of shells per atom in basis set */
-  int *num_shells_per_atom;
-
-  /* the total number of atomic shells */
-  int num_shells;
-
-  /* number of primitives in shell i */
-  int *num_prim_per_shell;
-
-  /* type of each shell */
-  int *shell_types; 
-
-  /* number of occupied spin A and B orbitals */
-  int num_occupied_A;
-  int num_occupied_B;
-
-  /* Max. size of the wave_function array per orbital.
-   * I.e. this is also the number of contracted
-   * cartesian gaussian basis functions or the size
-   * of the secular equation.
-   * While the actual # of MOs present can be different
-   * for each frame, this is the maximum number of 
-   * possible occupied and virtual orbitals. */
-  int wavef_size;
-
-  /* Array of length 3*num_wave_f containing the exponents 
-   * describing the cartesian components of the angular momentum. 
-   * E.g. S={0 0 0}, Px={1 0 0}, Dxy={1 1 0}, or Fyyz={0 2 1}. */
-  int *angular_momentum;
-
-  /* Highest shell occuring in basis set */
-  int max_shell;
-
-
-  /******************************************************
-   * normal modes
-   *****************************************************/
-
-  int have_normal_modes; /* TRUE/FALSE flag indicating if we
-                          * could properly read normal modes,
-                          * wavenumbers and intensities. */
-
-  int  nimag;          /* Number of imaginary frequencies */
-  int *imag_modes;     /* List of imaginary modes */
-
-  float *wavenumbers;  /* rotational and translational DoF 
-                        * are included, but can be removed due
-                        * to their zero frequencies */
-  float *intensities;  /* Intensities of spectral lines */
-
-  float *normal_modes; /* the normal modes themselves */
-
-
-  /******************************************************
-   * internal coordinate stuff
-   *****************************************************/
-
-  int have_internals;  /* TRUE/FALSE flag indicating if we
-                        * have internal coordinates */
-
-  int have_cart_hessian; /* TRUE/FALSE flag indicating if we
-                          * have a cartesian Hessian matrix */
-
-  int have_int_hessian;  /* TRUE/FALSE flag indicating if we
-                          * have a Hessian matrix in internal
-                          * coordinates */
-
-  int nintcoords;    /* Number of internal coordinates */
-  int nbonds;        /* Number of bonds */
-  int nangles;       /* Number of angles */
-  int ndiheds;       /* Number of dihedrals */
-  int nimprops;      /* Number of impropers */
-
-  int *bonds;        /* bond list (atom tuples) */
-  int *angles;       /* angle list (atom triples) */
-  int *dihedrals;    /* dihedral list (atom quadrupels) */
-  int *impropers;    /* improper list (atom quadrupels) */
-
-  double *internal_coordinates; /* value of internal coordinates */ 
-  
-  /* XXX GAMESS */
-  /* the order of force constants has to match the internal
-   * coordinates in *bonds, *angles, *dihedrals */
-
-  double *bond_force_const;     /* force constant for bonds */
-  double *angle_force_const;    /* force constant for angles */
-  double *dihedral_force_const; /* force constant for dihedrals */
-  double *improper_force_const; /* force constant for impropers */
-
-  /*******************************************************
-   * Hessian matrices
-   *******************************************************/
-
-  double *carthessian;  /* Hessian matrix in cartesian coordinates,
-                         * dimension (3*numatoms)*(3*numatoms),
-                         * single array of floats 
-                         * (row(1),row(2),...,row(numatoms))
-                         */
-
-  double *inthessian;  /* Hessian matrix in internal coordinates,
-                        * dimension nintcoords*nintcoords,
-                        * single array of floats 
-                        * (row(1),row(2),...,row(nintcoords))
-                        */
-
-  /*******************************************************
-   * Trajectory related data
-   *******************************************************/
-
-  /* per timestep data like wavefunctions and scf iterations */
-  qm_timestep_t *qm_timestep;
-
-  /* array of atoms for the current timestep */
-  qm_atom_t *atoms;
-
-  /* flag to tell if SCF cycle and the geometry search converged.
-   * XXX should distinguish between SCF and geometry convergence
-   * in separate flags */
-  int status;
-
-  /* number of trajectory frames: */
-  int num_frames;       /* total # frames */
-  int num_frames_read;  /* # frames read in so far */
-  int num_frames_sent;  /* # frames read sent to VMD so far */
-
-  /* flag to indicate wether we are done with reading frames */
-  int trajectory_done;
-
-  /* file positions of the beginning of each trajectory frame */
-  long *filepos_array;
-
-  /* file position indicator for the beginning of final section 
-   * printed after the last trajectory frame */
-  long end_of_traj;
-
-} qmdata_t;
-
-
-/* #######################################################
- *
- * Function declarations
- *
- * ####################################################### */
-
-/* Expand a set of symmetry unique atoms by creating images of
- * the atoms so that we have the full coordinate set. */
-static int symmetry_expand(qm_atom_t **atoms, int numunique, int natoms, 
-                            char *pg, int naxis);
-
-/* Skip n lines at a time */
-static void eatline(FILE * fd, int n);
-
-/* Advance to the next non-white line */
-static void eatwhitelines(FILE *fd);
-
-/* Trim leading whitespaces from string */
-static char* trimleft(char *);
-
-/* Trim trailing whitespaces from string */
-static char* trimright(char *);
-
-/* Return 1 if the string consists of whitespace only */
-static int iswhiteline(char *s);
-
-/* Convert a string to upper case */
-static char *strtoupper(char *s);
-
-
-/* Place file pointer AFTER the line containing one of
- * the keystrings. */
-static int pass_keyline(FILE *file, const char *keystring,
-			const char *keystring2);
-
-/* Place file pointer AT THE BEGINNING of the line containing 
- * a keystring. The keystrings are specified as a list of
- * const char* function arguments. The last argument must be 
- * NULL in order to terminate the list. */
-static int goto_keyline(FILE *file, ...);
-
-/* Check wether keystring1 occurs before keystring2 and
- * jumps back to beginning of search */
-static int have_keyline(FILE *file, const char *keystring1,
-                        const char *keystring2);
-
-
-/* Print the current line but don't advance the file pointer. */
-static void thisline(FILE *file);
-
-/* Print next nonempty, nonwhite line but do not advance
- * the file pointer. */
-static void whereami(FILE *file);
-
-
-
-/* #######################################################
- *
- * Function definitions
- *
- * ####################################################### */
-
-
-/*********************************************************
- *
- * Allocates and initiates qmdata_t structure.
- *
- *********************************************************/
-static qmdata_t* init_qmdata() {
-  /* allocate memory for main data structure */
-  qmdata_t *data = (qmdata_t *) calloc(1, sizeof(qmdata_t));
-  if (data == NULL)
-    return NULL;
-
-  data->runtype = NONE;
-  data->scftype = NONE;
-  data->dfttype = NONE;
-  data->citype  = NONE;
-  data->status = MOLFILE_QMSTATUS_UNKNOWN;
-  data->trajectory_done   = FALSE;
-  data->have_internals    = FALSE;
-  data->have_int_hessian  = FALSE;
-  data->have_cart_hessian = FALSE;
-  data->have_normal_modes = FALSE;
-
-  /* initialize some of the character arrays */
-  memset(data->basis_string,0,sizeof(data->basis_string));
-  memset(data->version_string,0,sizeof(data->version_string));
-  memset(data->memory,0,sizeof(data->memory));
-
-  return data;
-}
-
-
-/*********************************************************
- *
- * functions to manipulate the wavefunction array 
- * in qm_timestep_t.
- *
- *********************************************************/
-
-/* Increase wavefunction array in ts by one. */
-static qm_wavefunction_t* add_wavefunction(qm_timestep_t *ts) {
-  if (ts->numwave) {
-    /* Add a new wavefunction */
-    ts->wave = (qm_wavefunction_t *)realloc(ts->wave,
-                        (ts->numwave+1)*sizeof(qm_wavefunction_t));
-    memset(&ts->wave[ts->numwave], 0, sizeof(qm_wavefunction_t));
-    ts->numwave++;
-  } else {
-    /* We have no wavefunction for this timestep so create one */
-    ts->wave = (qm_wavefunction_t *)calloc(1, sizeof(qm_wavefunction_t));
-    ts->numwave = 1;
-  }
-
-  return &ts->wave[ts->numwave-1];
-}
-
-
-/* Replace the n-th wavefunction in ts with the last
- * one and decrease the array length by one. */
-static void replace_wavefunction(qm_timestep_t *ts, int n) {
-  if (ts->numwave>=2 && n>=0 && n<ts->numwave-1) {
-    qm_wavefunction_t *w1, *w2;
-    w2 = &ts->wave[n];
-    w1 = &ts->wave[ts->numwave-1];
-    free(w2->wave_coeffs);
-    free(w2->orb_energies);
-    free(w2->orb_occupancies);
-    memcpy(w2, w1, sizeof(qm_wavefunction_t));
-    ts->wave = (qm_wavefunction_t *) realloc(ts->wave,
-                   (ts->numwave-1)*sizeof(qm_wavefunction_t));
-    ts->numwave--;
-  }
-}
-
-
-/* Delete the last wavefunction in ts */
-static void del_wavefunction(qm_timestep_t *ts) {
-  if (ts->numwave) {
-    qm_wavefunction_t *w;
-    w = &ts->wave[ts->numwave-1];
-    free(w->wave_coeffs);
-    free(w->orb_energies);
-    free(w->orb_occupancies);
-    ts->numwave--;
-    ts->wave = (qm_wavefunction_t *)realloc(ts->wave,
-                        ts->numwave*sizeof(qm_wavefunction_t));    
-  }
-}
-
-/* Translate angular momentum string representation into
- * a triplet angular momentum exponents for X, Y, Z.
- * Angular momentum strings are a more human readable way
- * to specify the order of coefficients for wavefunctions.
- * So if the order of coefficients for D-shells implied
- * in the QM file is xx, yy, zz, xy, xz, yz then you can
- * use subsequent calls to this function in order to 
- * translate the strings into the more obscure but machine
- * friendly angular momentum exponents required by the 
- * molfile_plugin interface.
- *
- * Example translations:
- * S   --> {0 0 0}
- * X   --> {1 0 0}
- * Y   --> {0 1 0}
- * Z   --> {0 0 1}
- * XX  --> {2 0 0}
- * XY  --> {1 1 0}
- * YYZ --> {0 2 1}
- */
-static void angular_momentum_expon(int  *ang_mom_expon,
-                                   char *ang_mom_str) {
-  int i;
-  int xexp=0, yexp=0, zexp=0;
-
-  for (i=0; i<strlen(ang_mom_str); i++) {
-    switch (toupper(ang_mom_str[i])) {
-    case 'X':
-      xexp++;
-      break;
-    case 'Y':
-      yexp++;
-      break;
-    case 'Z':
-      zexp++;
-      break;
-    }
-  }
-  ang_mom_expon[0] = xexp;
-  ang_mom_expon[1] = yexp;
-  ang_mom_expon[2] = zexp;
-}
-
-/******************************************************
- *
- * matrix and vector functions
- *
- ******************************************************/
-
-/* Degree-to-Radians and Radians-to-Degrees Conversion macros */
-#define VMD_PI      3.14159265358979323846
-#define DEGTORAD(a)     (a*VMD_PI/180.0)
-#define RADTODEG(a)     (a*180.0/VMD_PI)
-
-/* clears the matrix (resets it to identity) */
-static void identity(float mat[16]) {
-  memset(mat, 0, 16*sizeof(float));
-  mat[0]=1.0f;
-  mat[5]=1.0f;
-  mat[10]=1.0f;
-  mat[15]=1.0f;
-}
-
-
-/* Print a matrix for debugging purpose */
-static void print_matrix4(const float mat[16]) {
-  int i, j;
-  for (i=0; i<4; i++) {
-    for (j=0; j<4; j++) {
-      printf("%f ", mat[4*j+i]);
-    }
-    printf("\n");
-  }
-  printf("\n");
-}
-
-
-/* premultiply the matrix by the given matrix */
-static void multmatrix(const float *m1, float m2[16]) {
-  int i, j;
-  float tmp[4];
-
-  for (j=0; j<4; j++) {
-    tmp[0] = m2[j];
-    tmp[1] = m2[4+j];
-    tmp[2] = m2[8+j]; 
-    tmp[3] = m2[12+j];
-    for (i=0; i<4; i++) {
-      m2[4*i+j] = m1[4*i]*tmp[0] + m1[4*i+1]*tmp[1] +
-        m1[4*i+2]*tmp[2] + m1[4*i+3]*tmp[3]; 
-    }
-  } 
-}
-
-
-/* performs a rotation around an axis (char == 'x', 'y', or 'z')
- * angle is in degrees */
-static void rot(float a, char axis, float mat[16]) {
-  double angle;
-  float m[16];
-  identity(m);			/* create identity matrix */
-
-  angle = (double)DEGTORAD(a);
-
-  if (axis == 'x') {
-    m[0]  = 1.f;
-    m[5]  = (float)cos(angle);
-    m[10] = m[5];
-    m[6]  = (float)sin(angle);
-    m[9]  = -m[6];
-  } else if (axis == 'y') {
-    m[0]  = (float)cos(angle);
-    m[5]  = 1.f;
-    m[10] = m[0];
-    m[2]  = (float) -sin(angle);
-    m[8]  = -m[2];
-  } else if (axis == 'z') {
-    m[0]  = (float)cos(angle);
-    m[5]  = m[0];
-    m[10] = 1.f;
-    m[1]  = (float)sin(angle);
-    m[4]  = -m[1];
-  }
-
-  multmatrix(m, mat);
-}
-
-
-/* scale a matrix */
-static void scale(float s, float m[16]) {
-  float t[16];
-  identity(t);		/* create identity matrix */
-  t[0]  = s;
-  t[5]  = s;
-  t[10] = s;
-  multmatrix(t, m);
-}
-
-
-/* reflect through mirror plane */
-static void mirror(char axis, float m[16]) {
-  scale(-1.f, m);
-  rot(180, axis, m);
-}
-
-
-/* multiplies a 3D point (first arg) by the Matrix, returns in second arg */
-static void multpoint3d(const float *mat, const float opoint[3], float npoint[3]) {
-  float tmp[3];
-  float itmp3 = 1.0f / (opoint[0]*mat[3] + opoint[1]*mat[7] +
-                        opoint[2]*mat[11] + mat[15]);
-  tmp[0] = itmp3*opoint[0];
-  tmp[1] = itmp3*opoint[1];
-  tmp[2] = itmp3*opoint[2];
-  npoint[0]=tmp[0]*mat[0] + tmp[1]*mat[4] + tmp[2]*mat[ 8] + itmp3*mat[12];
-  npoint[1]=tmp[0]*mat[1] + tmp[1]*mat[5] + tmp[2]*mat[ 9] + itmp3*mat[13];
-  npoint[2]=tmp[0]*mat[2] + tmp[1]*mat[6] + tmp[2]*mat[10] + itmp3*mat[14];
-}
-
-
-/* subtract 3rd vector from 2nd and put into 1st
- * in other words, a = b - c  */
-static void qm_vec_sub(float *a, const float *b, const float *c) {
-  a[0]=b[0]-c[0];
-  a[1]=b[1]-c[1];
-  a[2]=b[2]-c[2];
-}
-
-
-/* length of vector */
-static float norm(const float *vect) {
-#if defined(_MSC_VER) || defined(__MINGW32__)
-  return sqrt(vect[0]*vect[0] + vect[1]*vect[1] + vect[2]*vect[2]);
-#else
-  return sqrtf(vect[0]*vect[0] + vect[1]*vect[1] + vect[2]*vect[2]);
-#endif
-}
-
-
-/******************************************************
- *
- * Symmetry
- *
- ******************************************************/
-
-/* Expand a set of symmetry unique atoms by creating images of
- * the atoms so that we have the full coordinate set.
- * The atom array, the number of unique atoms, the total 
- * number of atoms, the pointgroup string and the order of
- * the highest axis mut be provided. The atoms array will be resized
- * and extended with the image atoms accordingly. */
-static int symmetry_expand(qm_atom_t **atoms, int numunique, int natoms, 
-                            char *pg, int naxis) {
-  int i, j;
-  float *unique, *image, *expanded;
-  int *indexmap;
-  int numexp;
-  float m[16];
-
-  printf("gamessplugin) Expanding %d coordinates for pointgroup %s, naxis=%d\n",
-         numunique, pg, naxis);
-
-  unique = calloc(3*numunique, sizeof(float));
-  image  = calloc(3*numunique, sizeof(float));
-  indexmap = calloc(numunique, sizeof(int));
-  for (i=0; i<numunique; i++) {
-    unique[3*i  ] = (*atoms)[i].x;
-    unique[3*i+1] = (*atoms)[i].y;
-    unique[3*i+2] = (*atoms)[i].z;
-    indexmap[i] = i;
-/*     printf("unique[%d]={%f %f %f}\n", i, unique[3*i], */
-/*            unique[3*i+1],unique[3*i+2]); */
-  }
-
-  /* Define the generating symmetry operations. */
-  /* XXX this is just a start, 
-   *     many molecules with higher symmetries will need 
-   *     two generating operations, e.g. a rotation and a
-   *     reflection. */
-  identity(m);
-  if (!strcmp(pg, "CI")) {
-    scale(-1.f, m);
-  }
-  else if (!strcmp(pg, "CS")) {
-    mirror('y', m);
-  }
-  else if (!strcmp(pg, "CN")) {
-    rot(360.f/naxis, 'z', m);
-  }
-  else if (!strcmp(pg, "CNV")) {
-    rot(360.f/naxis, 'z', m);
-  }
-  else if (!strcmp(pg, "CNH")) {
-    rot(360.f/naxis, 'z', m);
-  }
-  else if (!strcmp(pg, "DNH")) {
-    rot(360.f/naxis, 'z', m);
-  }
-
-  for (i=0; i<numunique; i++) {
-    multpoint3d(m, &unique[3*i], &image[3*i]);
-/*     printf("image[%d]={%f %f %f}\n", i, image[3*i  ], */
-/*            image[3*i+1], image[3*i+2]); */
-  }
-
-  expanded = calloc(3*numunique, sizeof(float));
-  memcpy(expanded, unique, 3*numunique* sizeof(float));
-  numexp=numunique;
-  for (i=0; i<numunique; i++) {
-    int found = 0;
-    for (j=0; j<numunique; j++) {
-      float d[3];
-      qm_vec_sub(d, &image[3*i], &unique[3*j]);
-      /* printf("%d,%d norm(d)=%f\n", i, j, norm(d)); */
-      if (norm(d)<0.001) {
-        found = 1;
-        break;
-      }
-    }
-
-    if (!found) {
-      expanded = realloc((float*)expanded, 3*(numexp+1)*sizeof(float));
-      indexmap = realloc((int*)indexmap, (numexp+1)*sizeof(int));
-      expanded[3*numexp  ] = image[3*i  ];
-      expanded[3*numexp+1] = image[3*i+1];
-      expanded[3*numexp+2] = image[3*i+2];
-      indexmap[numexp] = i;
-      numexp++;
-    }
-  }
-
-/*   for (i=0; i<numexp; i++) { */
-/*     printf("expanded[%d]={%f %f %f}\n", i, expanded[3*i], */
-/*            expanded[3*i+1], expanded[3*i+2]); */
-/*   } */
-
-  free(unique);
-  free(image);
-
-  if (natoms && numexp!=natoms) {
-    printf("gamessplugin) Couldn't expand symmetry unique atoms.\n");
-    free(expanded);
-    free(indexmap);
-    return FALSE;
-  }
-
-  /* XXX handling the natoms==0 case is futile unless we return 
-   *     the new number of atoms, so that the caller knows how
-   *     many atoms there are. */
-  if (!natoms)
-    *atoms = calloc(numexp, sizeof(qm_atom_t));
-  else 
-    *atoms = realloc((qm_atom_t*)(*atoms), numexp*sizeof(qm_atom_t));
-
-  for (i=numunique; i<numexp; i++) {
-    (*atoms)[i].x = expanded[3*i  ];
-    (*atoms)[i].y = expanded[3*i+1];
-    (*atoms)[i].z = expanded[3*i+2];
-    (*atoms)[i].atomicnum = (*atoms)[indexmap[i]].atomicnum;
-    strncpy((*atoms)[i].type, (*atoms)[indexmap[i]].type, 10);
-  }
-
-  free(expanded);
-  free(indexmap);
-  return TRUE;
-}
-
-
-/******************************************************
- *
- * string functions and other parsing helpers
- *
- ******************************************************/
-
-/* skip n lines at a time */
-static void eatline(FILE * fd, int n)
-{
-  int i;
-  for (i=0; i<n; i++) {
-    char readbuf[1025];
-    fgets(readbuf, 1024, fd);
-  }
-}
-
-
-/* Skip all following consecutive white lines. */
-static void eatwhitelines(FILE *file) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(file);
-  while (fgets(buffer, sizeof(buffer), file)) {
-    if (strlen(trimright(buffer))) {
-      fseek(file, filepos, SEEK_SET);
-      break;
-    }
-    filepos = ftell(file);
-  }
-}
-
-
-/* Returns a pointer to the first non-whitespace
- * character in a string.
- * The input string s must be null-terminated. 
- */
-static char* trimleft(char* the_string)
-{
-  char *new_string = the_string;
-  while ( (*new_string=='\n' || *new_string==' ' || *new_string=='\t') && 
-	  (*new_string != '\0'))
-  {
-    new_string++;
-  }
-
-  return new_string;
-}
-
-
-/* Places a NULL character after the last non-whitespace
- * character in a string and returns the pointer to the
- * beginning of the string. 
- * The input string s must be null-terminated.
- */
-static char* trimright(char* s)
-{
-  int i;
-  for (i=strlen(s)-1; i>=0; i--) {
-    if (!isspace(s[i])) break;
-  }
-  s[i+1] = '\0';
-
-  return s;
-}
-
-
-/* Return 1 if the string contains only whitespace. */
-static int iswhiteline(char *s) {
-  return (!strlen(trimleft(s)));
-}
-
-
-/* Convert a string to upper case */
-static char *strtoupper(char *s) {
-  int i;
-  int sz = strlen(s);
-
-  if (s != NULL) {
-    for(i=0; i<sz; i++)
-      s[i] = toupper(s[i]);
-  }
-
-  return s;
-}
-
-
-
-/* Places file pointer AFTER the line containing one of the
- * keystrings. If keystring2 is NULL then it will be ignored. */
-static int pass_keyline(FILE *file, const char *keystring,
-        const char *keystring2) {
-  char buffer[BUFSIZ];
-  char *line;
-  int found = 0;
-  long filepos;
-  filepos = ftell(file);
-
-  do {
-    if (!fgets(buffer, sizeof(buffer), file)) {
-      fseek(file, filepos, SEEK_SET);
-      return 0;
-    }
-    line = trimleft(buffer);
-    if (strstr(line, keystring)) {
-      found = 1;
-      break;
-    }
-    else if (keystring2 && strstr(line, keystring2)) {
-      found = 2;
-      break;
-    }
-  } while (1);
-    
-  if (!found) {
-    fseek(file, filepos, SEEK_SET);
-  }
-
-  return found;
-}
-
-
-/* Advances the file pointer until the first appearance
- * of a line containing one of the given keystrings.
- * The keystrings are specified as a list of const char*
- * function arguments. The last argument must be NULL
- * signifying the end of the keystring argument list.
- * Returns the 1-based index of the keystring from the
- * argument list for which a match was found.
- * The file pointer will be placed AT THE BEGINNING of
- * the line containing the matched keystring.
- * If no keystring was found before EOF then the file
- * is rewound to the position where the search started
- * and 0 is returned.
- */
-static int goto_keyline(FILE *file, ...) {
-  char buffer[BUFSIZ];
-  const char *keystring;
-  int found=0, loop=1;
-  long filepos, curline;
-  va_list argptr;
-  filepos = ftell(file);
-
-  /* loop over lines */
-  while (loop) {
-    int narg = 0;
-    curline = ftell(file);
-    if (!fgets(buffer, sizeof(buffer), file)) {
-      fseek(file, filepos, SEEK_SET);
-
-      return 0;
-    }
-
-    /* loop over the list of search strings */
-    va_start(argptr, file);
-    while ((keystring = va_arg(argptr, const char*)) != NULL) {
-      /* search for keystring in line buffer */
-      if (strstr(buffer, keystring)) {
-        found = narg+1;
-        /* rewind to beginning of current line */
-        fseek(file, curline, SEEK_SET);
-        loop = 0;
-        break;
-      }
-      narg++;
-    }
-    va_end (argptr);
-  };
-    
-  if (!found) {
-    /* no match, rewind to beginning of search */
-    fseek(file, filepos, SEEK_SET);
-  }
-
-  return found;
-}
-
-/* Check wether keystring1 occurs before keystring2 and
- * jumps back to beginning of search */
-static int have_keyline(FILE *file, const char *keystring1,
-        const char *keystring2) {
-  int found;
-  long filepos;
-  filepos = ftell(file);
-
-  found = pass_keyline(file, keystring1, keystring2);
-
-  fseek(file, filepos, SEEK_SET);
-  return found;
-}
-
-
-/* Some MOLDEN files use Fortran-style notation where 'D' is used instead of 
- * 'E' as exponential character. 
- * If you pass this function a C string that contains floating point numbers
- * in Fortran-style scientific notation, it will find the "D" characters
- * that correspond to just the floating point numbers and fix them by
- * changing them to "E".  Once converted, one should be able to
- * call scanf() on the string to parse it normally.  The code modifies
- * the string in-place, which should work well for the molden plugin. */
-
-static int fpexpftoc(char *ftocstr) {
-  int convcnt = 0;
-  int len = strlen(ftocstr);
-
-  // Compute string length, minus three chars, since any floating point 
-  // number in scientific notation is going to have at least a "-" or "+",
-  // and one or more integer digits following the "E" or "D" character for
-  // exponent notation.
-  int lenm2 = len - 2;
-
-  // Replace "D" exponential characters with "E", so we can parse with 
-  // ANSI stdio routines.
-  // Our loop starts at the second character in the string since the shortest
-  // possible FP number in scientific notation would be "1D+01" or something
-  // similar.
-  int i;
-  for (i=1; i<lenm2; i++) {
-    // Check for a 'D' character.  If we find one, then we look to see that the
-    // preceding character is numeric, that the following character is +/-,
-    // and that the character following +/- is also numeric.  If all of the
-    // necessary conditions are true then we replace the 'D' with an 'E'.
-    // The strict checking should allow us to safely convert entire strings
-    // of characters where there are also integers, and other kinds of strings
-    // on the same line.
-    if (ftocstr[i] == 'D' &&
-        ((ftocstr[i+1] == '-') || (ftocstr[i+1] == '+')) &&
-        ((ftocstr[i-1] >= '0') && (ftocstr[i-1] <= '9')) &&
-        ((ftocstr[i+2] >= '0') && (ftocstr[i+2] <= '9'))) {
-      ftocstr[i] = 'E';
-      convcnt++;
-    }
-  }
-
-  return convcnt;
-}
-
-
-
-
-/*****************************************************
- *
- *   Debugging functions
- *
- *****************************************************/
-
-/* Print the current line in the format
- * "HERE) <contents of line>".
- * Doesn't advance the file pointer.
- */
-static void thisline(FILE *file) {
-  char buffer[BUFSIZ];
-  long filepos;
-  filepos = ftell(file);
-  if (!fgets(buffer, sizeof(buffer), file)) {
-    if (feof(file)) printf("HERE) EOF\n");
-    else printf("HERE) ????\n");
-    return;
-  }
-  printf("HERE) %s\n", buffer);
-  fseek(file, filepos, SEEK_SET);
-}
-
-
-/* Print all lines up to and including the next line that contains
- * non-whitespace characters. The file pointer will be restored to
- * its previous position. 
- * Output format: "HERE) <contents of line>".
- * If the end of file has been reached print "HERE) EOF".
- */
-static void whereami(FILE *file) {
-  char buffer[BUFSIZ];
-  char *line;
-  long filepos;
-  filepos = ftell(file);
-  do {
-    if (!fgets(buffer, sizeof(buffer), file)) {
-      if (feof(file)) printf("HERE) EOF\n");
-      else printf("HERE) ????\n");
-      return;
-    }
-    line = trimleft(buffer);
-    printf("HERE) %s\n", buffer);
-  } while (!strlen(line));
-
-  fseek(file, filepos, SEEK_SET);
-}
-
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/raster3dplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/raster3dplugin.C
deleted file mode 100644
index f4c1d9bf32d9d9621504c2718c59989e71d28af0..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/raster3dplugin.C
+++ /dev/null
@@ -1,519 +0,0 @@
-
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} handle_t;
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  handle_t *handle;
-  
-  fd = fopen(filepath, "rt");
-  if (!fd) 
-    return NULL;
-  handle = new handle_t;
-  handle->fd = fd;
-  handle->graphics = NULL;
-  *natoms = 0;
-  return handle;
-}
-
-static void next_elem(int &n, int &max, molfile_graphics_t *& graphics) {
-  ++n;
-  if (n == max) {
-    max *= 2;
-    graphics = (molfile_graphics_t *)realloc(graphics, max*sizeof(molfile_graphics_t));
-  }
-}
-
-// gets a line of text from the file, ignoring comments
-static int get_line(int &line, char *buf, int len, FILE *f) {
-   do {
-      line++;
-      if (!fgets(buf, len - 1, f)) return 0;
-   } while (buf[0] == '#');
-   return 1;
-}
-
-
-
-
-/* 
- * Raster3D read_rawgraphics() entrypoint
- *
- * TODO
- *
- * 1. doesn't properly render capped cylinders
- * 2. needs to handle object types 15, 19, 9 (affects coordinate system);
- *    needs to first understand VMD's coordinate system.
- * 3. doesn't properly handle object type 8 (material definitions)
- * 4. doesn't properly handle object type 14 (quadrics)
- * 5. doesn't properly support file indirection (using '@')
- * 6. doesn't differentiate between round-ended cylinders (obj 3)
- *    and flat-ended cylinders (obj 5)
- * 7. doesn't handle planes
- * 8. doesn't support text (object types 10-12)
- * 9. doesn't handle depth cueing and transformations in global
- *    properties (object 16)
- */
-
-////  The header contains a lot of information which I ignore
-// TITLE (80 chars)
-// NTX, NTY (number of tiles -- ignored)
-// NPX, NPY (number of points per tile -- ignored)
-// SCHEME (antialiasing scheme -- ignored)
-// BKGND (background color -- ignored)
-// SHADOW (T/F -- ignored)
-// IPHONG (phong power -- ignored)
-// STRAIT (secondary light source -- ignored)
-// AMBIEN (ambient illumination -- ignored)
-// SPECLR ignored
-// EYEPOS ignored
-// SOURCE ignored
-// TMAT 4x4 matrix used to view the system
-// object mode (1 == triangle, 2 == spheres, or 3 ==  mixed)
-// INFMTS  --  FORTRAN input field specifications
-//   for input format specifiers 1/6, 2, and 3/5
-//   triangle(1) or plane(6) (x1,y1,z1)-(x2,y2,z2)-(x3,y3,z3) (r,g,b)
-//   sphere(2)      (x,y,z) r (r,g,b)
-//   cylinder(3,5)  (x1,y1,z1) R1 - (x2,y2,z2) R2(is ignored) (r,g,b)
-//                      except if one radius is 0, a cone is made
-//   I ignore these lines and just read them in as "%f"
-static int read_rawgraphics(void *v, int *nelem, const molfile_graphics_t **gdata) {
-  int count, i;
-  char buffer[200];
-  float mat[16];
-  FILE *infile = NULL;
-  int futureVersion = 0;
-  int line = 0;
-
-  handle_t *handle = (handle_t *)v;
-  infile = handle->fd;
-
-  int maxelem = 10;
-  int n = 0;
-  molfile_graphics_t *graphics = (molfile_graphics_t *) calloc(1, maxelem*sizeof(molfile_graphics_t));
-
-  // XXX This should probably be in open_file_read
-  if (!get_line(line, buffer, 199, infile)) {
-    fprintf(stderr, "raster3dplugin) Error reading file header (line %d)\n", 
-            line);
-    return MOLFILE_ERROR;
-  }
-
-  // tell the user info about the file
-  for (i = strlen(buffer) - 1; i >= 0 &&
-       (buffer[i] == 10 || buffer[i] == 13); i--) buffer[i] = 0;
-  printf("raster3dplugin) scene title: '%s'\n", buffer);
-
-  // The next 11 lines of text contain more header information
-  // about lighting, anti aliasing, image size, etc. This can be
-  // ignored.
-  for (count = 0; count < 11; count++) {
-    if (!get_line(line, buffer, 199, infile)) {
-      fprintf(stderr, 
-              "raster3dplugin) error reading file header (line %d)\n", line);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  // Now I have to get the matrix.  This is made nasty since
-  // there could be extra text after the first four numbers on a line
-  // as in: 1 0 0 0 This is an extra comment
-  for (i=0; i<4; i++) {
-    get_line(line, buffer, 199, infile);  // read the whole line into a string
-    if (sscanf(buffer, "%f %f %f %f",
-               &mat[4*i], &mat[4*i+1], &mat[4*i+2], &mat[4*i+3])<4) {
-      fprintf(stderr, "raster3dplugin) invalid format in file (line %d)\n",
-              line);
-      return MOLFILE_ERROR;
-    }
-  }
-
-  get_line(line, buffer, 199, infile);
-  if (sscanf(buffer, "%d", &i) < 1) {
-    fprintf(stderr, 
-            "raster3dplugin) error reading object input mode (line %d)\n", 
-            line);
-    return MOLFILE_ERROR;
-  }
-
-  if (i != 3) {
-     fprintf(stderr, 
-         "raster3dplugin) the specified file is in an unsupported format\n");
-     fprintf(stderr, 
-         "(object input mode %d). Aborting.\n", i);
-     return MOLFILE_ERROR;
-  }
-
-  float data[15];
-  float normals[15];
-  float tricolors[9];
-  float color[9];
-
-  // INFMT/INFMTS input specifiers; these can specifiy Fortran formatted
-  // input formats, but are usually "*" meaning free-format input. We
-  // give a warning if it's not free-format.
-  for (count = 0; count < 3; count++) {
-    get_line(line, buffer, 199, infile);
-    if (buffer[0] != '*') 
-      break;
-  }
-  if (count < 3) {  
-    fprintf(stderr, "raster3dplugin) Warning: this file contains input in a nonstandard\n");
-    fprintf(stderr, "Fortran format. This is generally not supported, and the read may fail.\n");
-  }
-  count = 0;
-
-  while (!feof(infile) && !ferror(infile)) {
-    int objtype = -1;
-
-    if (!get_line(line, buffer, 199, infile)) 
-      continue;
-
-    if (sscanf(buffer, "%d", &objtype) != 1) {
-      fprintf(stderr, "raster3dplugin) bad data in file (line %d)\n", line);
-      return MOLFILE_ERROR;
-    }
-
-    switch(objtype) {
-      case 1: // triangle
-        char buffer2[200];
-        int have_normals;
-        int have_tricolors;
-        long fpos;
-
-        have_normals = 0;
-        have_tricolors = 0;
-
-        get_line(line, buffer, 127, infile);
-        if (feof(infile)) {
-          //msgErr << "Raster3D input: error reading triangle data (line "
-          //<< line << ")" << sendmsg;
-          return MOLFILE_ERROR;
-        }
-
-        if (sscanf(buffer, "%f %f %f %f %f %f %f %f %f %f %f %f",
-                   data  , data+1, data+2, data+3, data+4, data+5,
-                   data+6, data+7, data+8, data+9, data+10, data+11) < 12) { 
-          //msgErr << "Raster3D input: bad triangle data in file (line "
-          //<< line << "). Will try to continue." << sendmsg;
-          continue;
-        }
-
-        while (!feof(infile) && !ferror(infile)) {
-          fpos = ftell(infile);
-          if (!get_line(line, buffer2, 199, infile)) {
-            fseek(infile, fpos, SEEK_SET);
-            break;
-          }
-
-          if (sscanf(buffer2, "%d", &objtype) != 1) {
-            //msgErr << "Raster3D input: bad data in file (line " << line
-            //<< "). Aborting." << sendmsg;
-            return MOLFILE_ERROR;
-          }
-
-          switch (objtype) {
-            case 7: // explicit normals
-              if (!get_line(line, buffer2, 199, infile)) {
-                //msgErr << "Raster3D input: read error in file (line " << line
-                //<< "). Aborting." << sendmsg;
-                return MOLFILE_ERROR;
-              }
-
-              if (sscanf(buffer2, "%f %f %f %f %f %f %f %f %f",
-                         normals  , normals+1, normals+2,
-                         normals+3, normals+4, normals+5,
-                         normals+6, normals+7, normals+8 ) < 9) { 
-                //msgErr << "Raster3D input: error reading triangle normals (line "
-                //<< line << "). Will try to continue." << sendmsg;
-                continue;
-              }
-
-              have_normals = 1;
-              break;
-
-            case 17: // colors at vertices of a tri-color
-              if (!get_line(line, buffer2, 199, infile)) {
-                //msgErr << "Raster3D input: read error in file (line " << line
-                //<< "). Aborting." << sendmsg;
-                return MOLFILE_ERROR;
-              }
-
-              if (sscanf(buffer2, "%f %f %f %f %f %f %f %f %f",
-                         tricolors,  tricolors+ 1, tricolors + 2,
-                         tricolors + 3, tricolors + 4, tricolors + 5,
-                         tricolors + 6, tricolors + 7, tricolors + 8) < 9) {
-                //msgErr << "Raster3D input: error reading vertex colors (line "
-                //<< line << "). Will try to continue." << sendmsg;
-                continue;
-              }
-
-              have_tricolors = 1;
-              break;
-
-            default:
-              fseek(infile, fpos, SEEK_SET);
-              fpos = 0;
-              break;
-
-          }
-
-          if (!fpos) 
-            break;
-        }
-
-        if (ferror(infile)) {
-          //msgErr << "Raster3D input: read error in file (line "
-          //<< line << "). Aborting." << sendmsg;
-          return MOLFILE_ERROR;
-        }
-
-        graphics[n].type = MOLFILE_COLOR;
-        graphics[n].data[0] = sqrt(data[9]);
-        graphics[n].data[1] = sqrt(data[10]);
-        graphics[n].data[2] = sqrt(data[11]);
-        next_elem(n, maxelem, graphics);
-
-        if (have_tricolors) {
-          for (int qq=0; qq<9; qq++) color[qq] = sqrt(tricolors[qq]);
-        }
-
-        if (!have_normals && !have_tricolors) {
-          graphics[n].type = MOLFILE_TRIANGLE;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-        } else if (have_normals && !have_tricolors) {
-          graphics[n].type = MOLFILE_TRINORM;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_NORMS;
-          memcpy(graphics[n].data, normals, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-        } else if (have_tricolors && !have_normals) {
-#if 0
-          float tmp1[3], tmp2[3], tmp3[3];
-          int j;
-          for (j = 0; j < 3; j++) {
-            tmp1[j] = data[3 + j] - data[j];
-            tmp2[j] = data[6 + j] - data[3 + j];
-          }
-          cross_prod(tmp3, tmp1, tmp2);
-          vec_normalize(tmp3);
-          triclr.putdata(data, data+3, data+6,
-                         tmp3, tmp3, tmp3,
-                         colorIndices[0], colorIndices[1], colorIndices[2], 
-                         cmdList);
-#else
-          // XXX Take the average of the color
-          graphics[n].type = MOLFILE_COLOR;
-          graphics[n].data[0] = (color[0]+color[3]+color[6])/3.0f;
-          graphics[n].data[1] = (color[1]+color[4]+color[7])/3.0f;
-          graphics[n].data[2] = (color[2]+color[5]+color[8])/3.0f;
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_TRIANGLE;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-#endif
-        } else {
-#if 0
-          triclr.putdata(data, data+3, data+6,
-                         normals, normals+3, normals+6,
-                         colorIndices[0], colorIndices[1], colorIndices[2], 
-                         cmdList);
-#else
-          graphics[n].type = MOLFILE_TRICOLOR;
-          memcpy(graphics[n].data, data, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_NORMS;
-          memcpy(graphics[n].data, normals, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-          graphics[n].type = MOLFILE_COLOR;
-          memcpy(graphics[n].data, color, 9*sizeof(float));
-          next_elem(n, maxelem, graphics);
-#endif
-       }
-       break;
-
-     case 2: // sphere
-       if (!get_line(line, buffer, 199, infile)) {
-         //msgErr << "Raster3D input: error reading sphere data (line "
-         //<< line << ")" << sendmsg;
-         return MOLFILE_ERROR;
-       }
-
-       if (sscanf(buffer, "%f %f %f %f %f %f %f",
-                  data, data + 1, data + 2, data + 3,
-                  data + 4, data + 5, data + 6) != 7) {
-         //msgErr << "Raster3D input: bad sphere data in file (line "
-         //<< line << "). Will try to continue." << sendmsg;
-         continue;
-       }
-       graphics[n].type = MOLFILE_COLOR;
-       color[0] = sqrt(data[4]);
-       color[1] = sqrt(data[5]);
-       color[2] = sqrt(data[6]);
-       memcpy(graphics[n].data, color, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-       graphics[n].type = MOLFILE_SPHERE;
-       graphics[n].size = data[3];
-       graphics[n].style = 12; // XXX hard-coded resolution
-       memcpy(graphics[n].data, data, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-       break;
-
-     case 3: // rounded cylinder
-     case 5: // flat cylinder
-       if (!get_line(line, buffer, 199, infile)) {
-         //msgErr << "Raster3D input: error reading cylinder data (line "
-         //<< line << ")" << sendmsg;
-         return MOLFILE_ERROR;
-       }
-
-       if (sscanf(buffer, "%f %f %f %f %f %f %f %f %f %f %f",
-                  data, data + 1, data + 2, data + 3, data + 4,
-                  data + 5, data + 6, data + 7, data + 8, data + 9,
-                  data + 10) != 11) {
-         //msgErr << "Raster3D input: bad cylinder data (line "
-         //<< line << "). Will try to continue." << sendmsg;
-         continue;
-       }
-       graphics[n].type = MOLFILE_COLOR;
-       color[0] = sqrt(data[8]);
-       color[1] = sqrt(data[9]);
-       color[2] = sqrt(data[10]);
-       memcpy(graphics[n].data, color, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-       graphics[n].type = MOLFILE_CYLINDER;
-       graphics[n].size = data[3];
-       graphics[n].style = 12; // XXX hard-coded resolution
-       memcpy(graphics[n].data, data, 3*sizeof(float));
-       memcpy(graphics[n].data+3, data+4, 3*sizeof(float));
-       next_elem(n, maxelem, graphics);
-
-       // cap with spheres for object 3
-       if (objtype == 3) {
-         graphics[n].type = MOLFILE_SPHERE;
-         graphics[n].size = data[3];
-         graphics[n].style = 12; // XXX hard-coded resolution
-         memcpy(graphics[n].data, data, 3*sizeof(float));
-         next_elem(n, maxelem, graphics);
-         graphics[n].type = MOLFILE_SPHERE;
-         graphics[n].size = data[3];
-         graphics[n].style = 12; // XXX hard-coded resolution
-         memcpy(graphics[n].data, data+4, 3*sizeof(float));
-         next_elem(n, maxelem, graphics);
-       }
-       break;
-
-     case 9:
-       break;
-
-     case 6: case 8: case 10: case 11: case 12: case 13: case 15: case 19:
-       // Ignore the next line
-       get_line(line, buffer, 199, infile);
-       break;
-
-     case 7:
-       //msgErr << "Raster3D input: encountered unexpected object 7 (triangle ";
-       //msgErr << "vertex normals) (line " << line;
-       //msgErr << "). Will try to continue." << sendmsg;
-       break;
-
-     case 17:
-       //msgErr << "Raster3D input: encountered unexpected object 17 (triangle " << sendmsg;
-       //msgErr << "vertex colors) (line " << line << "). Will try to continue." << sendmsg;
-       break;
-
-     case 0:  // Raster3D 'force EOF' -- checked later
-       break;
-
-     // We encountered an object that is not recognized.
-     // Need to warn the user. Future version of R3d perhaps?
-     default:
-       if (!futureVersion) {
-         //msgErr << "Raster3D input: encountered unknown object type #"
-         //<< objtype << sendmsg;
-         //msgErr << " (line " << line << "). Future version of Raster3D maybe?"
-         //<< " Will try to continue." << sendmsg;
-         futureVersion = 1;
-       }
-       break;
-
-    } // end of switch
-
-    // If this is a Raster3d "force EOF" object, break
-    if (objtype == 0) 
-      break;
-  } // end of while
-
-  if (ferror(infile)) {
-    //msgErr << "Raster3D input: read error while reading input file (line "
-    //<< line << "). Aborting." << sendmsg;
-    return MOLFILE_ERROR;
-  }
-
-  // normal exit
-  *nelem = n;
-  handle->graphics = graphics;
-  *gdata = graphics;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_file_read(void *v) {
-  handle_t *handle = (handle_t *)v;
-  fclose(handle->fd);
-  handle->fd = NULL;
-  free(handle->graphics);
-  handle->graphics = NULL;
-  delete handle;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "raster3d";
-  plugin.prettyname = "Raster3d Scene File";
-  plugin.author = "Justin Gullingsrud";
-  plugin.majorv = 0;
-  plugin.minorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "r3d";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/readpdb.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/readpdb.h
deleted file mode 100644
index d3c8798e15bedf71c18eeedb64474fd611badce2..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/readpdb.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: readpdb.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.43 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#ifndef READ_PDB_H
-#define READ_PDB_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define PDB_RECORD_LENGTH   80   /* actual record size */
-#define PDB_BUFFER_LENGTH   83   /* size need to buffer + CR, LF, and NUL */
-
-#define VMDUSECONECTRECORDS 1
-
-/*  record type defines */
-enum {
-  PDB_HEADER, PDB_REMARK, PDB_ATOM, PDB_CONECT, PDB_UNKNOWN, PDB_END, PDB_EOF, PDB_CRYST1
-};
-
-/* read the next record from the specified pdb file, and put the string found
-   in the given string pointer (the caller must provide adequate (81 chars)
-   buffer space); return the type of record found
-*/
-static int read_pdb_record(FILE *f, char *retStr) {
-  int ch;
-  char inbuf[PDB_BUFFER_LENGTH]; /* space for line + cr + lf + NUL */
-  int recType = PDB_UNKNOWN;
- 
-  /* XXX This PDB record reading code breaks with files that use
-   * Mac or DOS style line breaks with ctrl-M characters.  We need
-   * to replace the use of fgets() and comparisons against \n with
-   * code that properly handles the other cases.
-   */
- 
-  /* read the next line, including any ending cr/lf char */
-  if (inbuf != fgets(inbuf, PDB_RECORD_LENGTH + 2, f)) {
-    retStr[0] = '\0';
-    recType = PDB_EOF;
-  } else {
-#if 0
-    /* XXX disabled this code since \n chars are desirable in remarks */
-    /* and to make the behavior consistent with webpdbplugin          */
-
-    /* remove the newline character, if there is one */
-    if (inbuf[strlen(inbuf)-1] == '\n')
-      inbuf[strlen(inbuf)-1] = '\0';
-#endif
-
-    /* atom records are the most common */
-    if (!strncmp(inbuf, "ATOM ",  5) || !strncmp(inbuf, "HETATM", 6)) {
-      /* Note that by only comparing 5 chars for "ATOM " rather than 6,     */
-      /* we allow PDB files containing > 99,999 atoms generated by AMBER    */
-      /* to load which would otherwise fail.  Not needed for HETATM since   */
-      /* those aren't going to show up in files produced for/by MD engines. */
-      recType = PDB_ATOM;
-    } else if (!strncmp(inbuf, "CONECT", 6)) {
-      recType = PDB_CONECT;
-    } else if (!strncmp(inbuf, "REMARK", 6)) {
-      recType = PDB_REMARK;
-    } else if (!strncmp(inbuf, "CRYST1", 6)) {
-      recType = PDB_CRYST1;
-    } else if (!strncmp(inbuf, "HEADER", 6)) {
-      recType = PDB_HEADER;
-    } else if (!strncmp(inbuf, "END", 3)) {  /* very permissive */
-      /* XXX we treat any "ENDxxx" record as an end, to simplify testing */
-      /*     since we don't remove trailing '\n' chars                   */
-
-      /* the only two legal END records are "END   " and "ENDMDL" */
-      recType = PDB_END;
-    } 
-
-#if 0
-    /* XXX disable record type checking for now */
-    if (recType == PDB_ATOM || 
-        recType == PDB_CONECT || 
-        recType == PDB_REMARK || 
-        recType == PDB_HEADER || 
-        recType == PDB_CRYST1) {
-      strcpy(retStr, inbuf);
-    } else {
-      retStr[0] = '\0';
-    }
-#else
-    strcpy(retStr, inbuf);
-#endif
-  }
-
-  /* read the '\r', if there was one */
-  ch = fgetc(f);
-  if (ch != '\r')
-    ungetc(ch, f);
-  
-  return recType;
-}
-
-
-/* Extract the alpha/beta/gamma a/b/c unit cell info from a CRYST1 record */
-static void get_pdb_cryst1(const char *record, 
-                           float *alpha, float *beta, float *gamma, 
-                           float *a, float *b, float *c) {
-  char tmp[PDB_RECORD_LENGTH+3]; /* space for line + cr + lf + NUL */
-  char ch, *s;
-  memset(tmp, 0, sizeof(tmp));
-  strncpy(tmp, record, PDB_RECORD_LENGTH);
-
-  s = tmp+6 ;          ch = tmp[15]; tmp[15] = 0;
-  *a = (float) atof(s);
-  s = tmp+15; *s = ch; ch = tmp[24]; tmp[24] = 0;
-  *b = (float) atof(s);
-  s = tmp+24; *s = ch; ch = tmp[33]; tmp[33] = 0;
-  *c = (float) atof(s);
-  s = tmp+33; *s = ch; ch = tmp[40]; tmp[40] = 0;
-  *alpha = (float) atof(s);
-  s = tmp+40; *s = ch; ch = tmp[47]; tmp[47] = 0;
-  *beta = (float) atof(s);
-  s = tmp+47; *s = ch; ch = tmp[54]; tmp[54] = 0;
-  *gamma = (float) atof(s);
-}
-
-
-/* Extract the x,y,z coords, occupancy, and beta from an ATOM record */
-static void get_pdb_coordinates(const char *record, 
-                                float *x, float *y, float *z,
-                                float *occup, float *beta) {
-  char numstr[50]; /* store all fields in one array to save memset calls */
-  memset(numstr, 0, sizeof(numstr));
-
-  if (x != NULL) {
-    strncpy(numstr, record + 30, 8);
-    *x = (float) atof(numstr);
-  }
-
-  if (y != NULL) {
-    strncpy(numstr+10, record + 38, 8);
-    *y = (float) atof(numstr+10);
-  }
-
-  if (z != NULL) {
-    strncpy(numstr+20, record + 46, 8);
-    *z = (float) atof(numstr+20);
-  }
-
-  if (occup != NULL) {
-    strncpy(numstr+30, record + 54, 6);
-    *occup = (float) atof(numstr+30);
-  }
-
-  if (beta != NULL) {
-    strncpy(numstr+40, record + 60, 6);
-    *beta = (float) atof(numstr+40);
-  }
-}
-
-
-/* remove leading and trailing spaces from PDB fields */
-static void adjust_pdb_field_string(char *field) {
-  int i, len;
-
-  len = strlen(field);
-  while (len > 0 && field[len-1] == ' ') {
-    field[len-1] = '\0';
-    len--;
-  }
-
-  while (len > 0 && field[0] == ' ') {
-    for (i=0; i < len; i++)
-      field[i] = field[i+1];
-    len--;
-  }
-}
-
-static void get_pdb_header(const char *record, char *pdbcode, char *date,
-                           char *classification) {
-  if (date != NULL) {
-    strncpy(date, record + 50, 9);
-    date[9] = '\0';
-  }
-
-  if (classification != NULL) {
-    strncpy(classification, record + 10, 40);
-    classification[40] = '\0';
-  }
-
-  if (pdbcode != NULL) {
-    strncpy(pdbcode, record + 62, 4);
-    pdbcode[4] = '\0';
-    adjust_pdb_field_string(pdbcode); /* remove spaces from accession code */
-  }
-}
-
-
-static void get_pdb_conect(const char *record, int natoms, int *idxmap,
-                           int *maxbnum, int *nbonds, int **from, int **to) {
-  int bondto[11], numbonds, i;
-
-  int reclen = strlen(record);
-  for (numbonds=0, i=0; i<11; i++) {
-    char bondstr[6];
-    const int fieldwidth = 5;
-    int start = 6 + i*fieldwidth;
-    int end = start + fieldwidth;
-
-    if (end >= reclen)
-      break;
-
-    memcpy(bondstr, record + start, fieldwidth);
-    bondstr[5] = '\0';
-    if (sscanf(bondstr, "%d", &bondto[numbonds]) < 0)
-      break;
-    numbonds++; 
-  }
-
-  for (i=0; i<numbonds; i++) {
-    /* only add one bond per pair, PDBs list them redundantly */ 
-    if (bondto[i] > bondto[0]) {
-      int newnbonds = *nbonds + 1; /* add a new bond */
-
-      /* allocate more bondlist space if necessary */
-      if (newnbonds >= *maxbnum) {
-        int newmax;
-        int *newfromlist, *newtolist;
-        newmax = (newnbonds + 11) * 1.25;
-
-        newfromlist = (int *) realloc(*from, newmax * sizeof(int));
-        newtolist = (int *) realloc(*to, newmax * sizeof(int));
-
-        if (newfromlist != NULL || newtolist != NULL) {
-          *maxbnum = newmax;
-          *from = newfromlist;
-          *to = newtolist;
-        } else {
-          printf("readpdb) failed to allocate memory for bondlists\n");
-          return; /* abort */
-        }
-      }
-
-      *nbonds = newnbonds;
-      (*from)[newnbonds-1] = idxmap[bondto[0]] + 1;
-      (*to)[newnbonds-1] = idxmap[bondto[i]] + 1;
-    }
-  }
-}
-
-/* ATOM field format according to PDB standard v2.2
-  COLUMNS        DATA TYPE       FIELD         DEFINITION
----------------------------------------------------------------------------------
- 1 -  6        Record name     "ATOM  "
- 7 - 11        Integer         serial        Atom serial number.
-13 - 16        Atom            name          Atom name.
-17             Character       altLoc        Alternate location indicator.
-18 - 20        Residue name    resName       Residue name.
-22             Character       chainID       Chain identifier.
-23 - 26        Integer         resSeq        Residue sequence number.
-27             AChar           iCode         Code for insertion of residues.
-31 - 38        Real(8.3)       x             Orthogonal coordinates for X in Angstroms.
-39 - 46        Real(8.3)       y             Orthogonal coordinates for Y in Angstroms.
-47 - 54        Real(8.3)       z             Orthogonal coordinates for Z in Angstroms.
-55 - 60        Real(6.2)       occupancy     Occupancy.
-61 - 66        Real(6.2)       tempFactor    Temperature factor.
-73 - 76        LString(4)      segID         Segment identifier, left-justified.
-77 - 78        LString(2)      element       Element symbol, right-justified.
-79 - 80        LString(2)      charge        Charge on the atom.
- */
-
-/* Break a pdb ATOM record into its fields.  The user must provide the
-   necessary space to store the atom name, residue name, and segment name.
-   Character strings will be null-terminated.
-*/
-static void get_pdb_fields(const char *record, int reclength, int *serial,
-                           char *name, char *resname, char *chain, 
-                           char *segname, char *resid, char *insertion, 
-                           char *altloc, char *elementsymbol,
-                           float *x, float *y, float *z, 
-                           float *occup, float *beta) {
-  char serialbuf[6];
-
-  /* get atom serial number */
-  strncpy(serialbuf, record + 6, 5);
-  serialbuf[5] = '\0';
-  *serial = 0;
-  sscanf(serialbuf, "%5d", serial);
-  
-  /* get atom name */
-  strncpy(name, record + 12, 4);
-  name[4] = '\0';
-  adjust_pdb_field_string(name); /* remove spaces from the name */
-
-  /* get alternate location identifier */
-  strncpy(altloc, record + 16, 1);
-  altloc[1] = '\0';
-
-  /* get residue name */
-  strncpy(resname, record + 17, 4);
-  resname[4] = '\0';
-  adjust_pdb_field_string(resname); /* remove spaces from the resname */
-
-  /* get chain name */
-  chain[0] = record[21];
-  chain[1] = '\0';
-
-  /* get residue id number */
-  strncpy(resid, record + 22, 4);
-  resid[4] = '\0';
-  adjust_pdb_field_string(resid); /* remove spaces from the resid */
-
-  /* get the insertion code */
-  insertion[0] = record[26];
-  insertion[1] = '\0';
-
-  /* get x, y, and z coordinates */
-  get_pdb_coordinates(record, x, y, z, occup, beta);
-
-  /* get segment name */
-  if (reclength >= 73) {
-    strncpy(segname, record + 72, 4);
-    segname[4] = '\0';
-    adjust_pdb_field_string(segname); /* remove spaces from the segname */
-  } else {
-    segname[0] = '\0';
-  }
-
-  /* get the atomic element symbol */
-  if (reclength >= 77) {
-    strncpy(elementsymbol, record + 76, 2);
-    elementsymbol[2] = '\0';
-  } else {
-    elementsymbol[0] = '\0';
-  }
-}  
-
-
-/* Write PDB data to given file descriptor; return success. */
-static int write_raw_pdb_record(FILE *fd, const char *recordname,
-    int index,const char *atomname, const char *resname,int resid, 
-    const char *insertion, const char *altloc, const char *elementsymbol,
-    float x, float y, float z, float occ, float beta, 
-    const char *chain, const char *segname) {
-  int rc;
-  char indexbuf[32];
-  char residbuf[32];
-  char segnamebuf[5];
-  char resnamebuf[5];
-  char altlocchar;
-
-  /* XXX                                                          */
-  /* if the atom or residue indices exceed the legal PDB spec, we */
-  /* start emitting asterisks or hexadecimal strings rather than  */
-  /* aborting.  This is not really legal, but is an accepted hack */
-  /* among various other programs that deal with large PDB files  */
-  /* If we run out of hexadecimal indices, then we just print     */
-  /* asterisks.                                                   */
-  if (index < 100000) {
-    sprintf(indexbuf, "%5d", index);
-  } else if (index < 1048576) {
-    sprintf(indexbuf, "%05x", index);
-  } else {
-    sprintf(indexbuf, "*****");
-  }
-
-  if (resid < 10000) {
-    sprintf(residbuf, "%4d", resid);
-  } else if (resid < 65536) {
-    sprintf(residbuf, "%04x", resid);
-  } else { 
-    sprintf(residbuf, "****");
-  }
-
-  altlocchar = altloc[0];
-  if (altlocchar == '\0') {
-    altlocchar = ' ';
-  }
-
-  /* make sure the segname or resname do not overflow the format */ 
-  strncpy(segnamebuf,segname,4);
-  segnamebuf[4] = '\0';
-  strncpy(resnamebuf,resname,4);
-  resnamebuf[4] = '\0';
-
- 
-  rc = fprintf(fd,
-         "%-6s%5s %4s%c%-4s%c%4s%c   %8.3f%8.3f%8.3f%6.2f%6.2f      %-4s%2s\n",
-         recordname, indexbuf, atomname, altlocchar, resnamebuf, chain[0], 
-         residbuf, insertion[0], x, y, z, occ, beta, segnamebuf, elementsymbol);
-
-  return (rc > 0);
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/rst7plugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/rst7plugin.c
deleted file mode 100644
index ebe0bce69688dd46230fd1fff463e7f6f3077079..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/rst7plugin.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: rst7plugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.20 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "vmdconio.h"
-
-typedef struct {
-  FILE *file;
-  int has_box;
-  int has_vels;
-  int numatoms;
-  int count;
-  int rstfile;
-#if vmdplugin_ABIVERSION > 10
-  molfile_timestep_metadata_t ts_meta;
-#endif
-} rstdata;
-
-static void *open_rst_read(const char *filename, const char *filetype,int *natoms) {
-  FILE *fd;
-  rstdata *data;
-  int numats=0,i,j,point2,kkk=1; 
-  char title[82], *field;
-  char line[82];
-  float x, y, z,a=0.0,b=0.0,c=0.0;
-  double  timesteprst;
-
-  /* Amber 7'coord' restart files have a second introduction line with 
-   * possibly 2 entries only check for one now...
-   * they include three 90.00 ter cards at the end
-   * need to fix this, real crd files have atom record but no timestep and no
-   * velocity info...arggggg
-   */
-  fd = fopen(filename, "rb");
-  if (!fd) 
-    return NULL; /* failure */
-
-  data = (rstdata *)malloc(sizeof(rstdata));
-  memset(data, 0, sizeof(rstdata));
-#if vmdplugin_ABIVERSION > 10
-  data->ts_meta.count = -1;
-  data->ts_meta.has_velocities = 0;
-#endif
-
-  fgets(title, 82, fd);
-  vmdcon_printf(VMDCON_INFO, "rst7plugin) Title: %s\n",title);
-
-  fgets(line, 82, fd);
-  while (kkk==1) {
-    /* try to read first field */
-    field = strtok(line, " \t");
-    if (field==NULL) {                
-      continue; /* no fields at all on this line */
-    }
-    numats = atoi(field);
-
-    /* try to read second field will be null if not there */
-    field = strtok(NULL, " \t");
-    if (field==NULL) {
-      kkk=0;
-      vmdcon_printf(VMDCON_INFO, "rst7plugin) This file has no velocity info.\n");
-      data->has_vels=0;
-    } else {
-      timesteprst = strtod(field, NULL);
-      vmdcon_printf(VMDCON_INFO, "rst7plugin) This file contains velocity info.\n");
-      data->has_vels=1;
-#if vmdplugin_ABIVERSION > 10
-      data->ts_meta.has_velocities = 1;
-#endif
-      kkk=0;
-    }
-  }
-
-  point2=ftell(fd);
-  data->file = fd;
-  vmdcon_printf(VMDCON_INFO, "rst7plugin) The Restartcrd has %d atoms.\n",numats);
-
-  /* skip over coordinate data */
-  for (i=0; i<numats; i++) {
-    j = fscanf(fd, "%f%f%f", &x, &y, &z);
-  }
-
-  /* skip over velocity data, if present */
-  if (data->has_vels) {
-    for (i=0; i<numats; i++) {
-      j = fscanf(fd, "%f%f%f", &x, &y, &z);
-    }
-  }
-  
-  j = fscanf(fd, "%f%f%f%f%f%f", &x, &y, &z,&a,&b,&c);
-  if (j != EOF) {
-    vmdcon_printf(VMDCON_INFO, "rst7plugin) This restartcrd file has box info.\n");
-    data->has_box=1;
-    vmdcon_printf(VMDCON_INFO, "rst7plugin) Box Dimensions are %f %f %f %f %f %f\n",x,y,z,a,b,c);
-  }
-
-  *natoms=numats;
-  data->numatoms=numats;
-  data->rstfile=1;
-  fseek(fd,point2,SEEK_SET);
-
-  return data;
-}
-
-#if vmdplugin_ABIVERSION > 10
-static int read_timestep_metadata(void *mydata,
-                                  molfile_timestep_metadata_t *meta) {
-  rstdata *data = (rstdata *)mydata;
-  
-  meta->count = -1;
-  meta->has_velocities = data->ts_meta.has_velocities;
-  if (meta->has_velocities) {
-    vmdcon_printf(VMDCON_INFO,
-                  "rst7plugin) Importing velocities from restart file.\n");
-  }
-  return MOLFILE_SUCCESS;
-}
-#endif
-
-static int read_rst_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  rstdata *rst= (rstdata *)mydata;
-  int i, j;
-  float x, y, z, a, b, c;
-  
-  /* check for rst and first read through already taken place */
-  if(rst->count==1 && rst->rstfile==1) 
-    return MOLFILE_ERROR; 
-
-  ts->A = ts->B = ts->C = 0.0f;
-  ts->alpha = ts->beta = ts->gamma = 90.0f;
-  
-  for (i=0; i<rst->numatoms; i++)  {
-    /* changed to i=1 BB */
-    j = fscanf(rst->file, "%f%f%f", &x, &y, &z);
-    if (j == EOF) {
-      return MOLFILE_ERROR;
-    } else if (j <= 0) {
-      vmdcon_printf(VMDCON_ERROR, "rst7plugin) Problem reading CRD file\n");
-      return MOLFILE_ERROR;
-    }
-    ts->coords[3*i] = x;
-    ts->coords[3*i+1] = y;
-    ts->coords[3*i+2] = z;
-  }
-
-  if (rst->has_vels) {
-    /* Read in optional velocity data.  Units are Angstroms per 1/20.455ps. */
-    for (i=0; i<rst->numatoms; i++)  {
-      j = fscanf(rst->file, "%f%f%f", &x, &y, &z);
-      if (j == EOF) {
-        return MOLFILE_ERROR;
-      } else if (j <= 0) {
-        vmdcon_printf(VMDCON_ERROR, "rst7plugin) Problem reading velocities\n");
-        return MOLFILE_ERROR;
-      }
-#if vmdplugin_ABIVERSION > 10
-      if (ts->velocities != NULL) {
-        ts->velocities[3*i] = x;
-        ts->velocities[3*i+1] = y;
-        ts->velocities[3*i+2] = z;
-      }
-#endif
-    }
-  }
- 
-  if (rst->has_box) {
-    j = fscanf(rst->file, "%f%f%f%f%f%f", &x, &y, &z, &a, &b, &c);
-    if (j == EOF) {
-      vmdcon_printf(VMDCON_ERROR, "rst7plugin) Problem reading box data\n");
-      return MOLFILE_ERROR;
-    }
-    ts->A = x;
-    ts->B = y;
-    ts->C = z;
-    ts->alpha = a;
-    ts->beta = b;
-    ts->gamma = c;
-  }
-  rst->count++;
-  /* printf("rst->count: %d\n",rst->count); */
-
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_rst_read(void *mydata) {
-  rstdata *rst= (rstdata *)mydata;
-  fclose(rst->file);
-  free(rst);
-}
-
-static void *open_rst_write(const char *path, const char *filetype, int natoms) {
-  char title[82];
-  rstdata *rst;
-  FILE *fd;
-  int len;
-
-  fd = fopen(path, "wb");
-  if (!fd) {
-    vmdcon_printf(VMDCON_ERROR, "rst7plugin) Could not open file %s for writing\n", path);
-    return NULL;
-  }
-  /* write out fixed length fortran style string */
-  sprintf(title, "TITLE : Created by VMD with %d atoms",natoms);
-  len = strlen(title);
-  memset(title+len,(int)' ',82-len);
-  title[80] = '\n';
-  title[81] = '\0';
-  fputs(title,fd);
-
-  rst = (rstdata *)malloc(sizeof(rstdata));
-  rst->file = fd;
-  rst->numatoms = natoms;
-  rst->has_box = 1;
-  return rst;
-}
-  
-static int write_rst_timestep(void *v, const molfile_timestep_t *ts) {
-  rstdata *rst = (rstdata *)v;
-  int i;
-  const int ndata = rst->numatoms * 3;
-
-#if vmdplugin_ABIVERSION > 10
-  if (ts->velocities != NULL) {
-    fprintf(rst->file, "%10d %13.7g\n", rst->numatoms, ts->physical_time);
-  } else
-#endif
-    fprintf(rst->file, "%10d\n", rst->numatoms);
-
-  for (i=0; i<ndata; i++) {
-    fprintf(rst->file, "%12.7f", ts->coords[i]);
-    if ((i+1) % 6 == 0) fprintf(rst->file, "\n"); 
-  }
-  if (ndata % 6 != 0) fprintf(rst->file,"\n");
-
-#if vmdplugin_ABIVERSION > 10
-  if (ts->velocities != NULL) {
-    for (i=0; i<ndata; i++) {
-      fprintf(rst->file, "%12.7f", ts->velocities[i]);
-      if ((i+1) % 6 == 0) fprintf(rst->file, "\n"); 
-    }
-    if (ndata % 6 != 0) fprintf(rst->file,"\n");
-  }
-#endif
-
-  fprintf (rst->file, "%12.7f%12.7f%12.7f%12.7f%12.7f%12.7f\n",
-           ts->A, ts->B, ts->C, ts->alpha, ts->beta, ts->gamma);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_rst_write(void *v) {
-  rstdata *rst = (rstdata *)v;
-  fclose(rst->file);
-  free(rst);
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(){
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "rst7";
-  plugin.prettyname = "AMBER7 Restart";
-  plugin.author = "Brian Bennion, Axel Kohlmeyer";
-  plugin.majorv = 0;
-  plugin.minorv = 4;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "rst7";
-  plugin.open_file_read = open_rst_read;
-  plugin.read_next_timestep = read_rst_timestep;
-#if vmdplugin_ABIVERSION > 10
-  plugin.read_timestep_metadata = read_timestep_metadata;
-#endif
-  plugin.close_file_read = close_rst_read;
-  plugin.open_file_write = open_rst_write;
-  plugin.write_timestep = write_rst_timestep;
-  plugin.close_file_write = close_rst_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(){ return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/situsplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/situsplugin.C
deleted file mode 100644
index 3f19278bf8d0d832e7857d0ebb384d14509ba351..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/situsplugin.C
+++ /dev/null
@@ -1,379 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: situsplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * Situs EM map file reader
- *   map is a cubic lattice
- *   all data is stored in plain ASCII for convenience
- *
- * Format of the file is:
- *   voxel size in Angstroms
- *   coordinates of first voxel
- *   integer X/Y/Z counts
- *   voxels follow in X fastest, Y next fastest, Z slowest
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define MIN(X,Y) (((X)<(Y))? (X) : (Y))
-#define MAX(X,Y) (((X)>(Y))? (X) : (Y))
-
-#define TOLERANCE 1e-4
-
-#ifndef NAN //not a number
-  const float NAN = sqrtf(-1.f); //need some kind of portable NAN definition
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-} situs_t;
-
-
-static void *open_situs_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  situs_t *situs;
-  float scale;
-  int xsize, ysize, zsize;
-  float orig[3]; 
-  
-  fd = fopen(filepath, "r");
-  if (!fd) {
-    printf("situsplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* get the scale */
-  if (fscanf(fd, "%f", &scale) != 1) {;
-    printf("situsplugin) Error reading voxel scale.\n");
-    return NULL;
-  }
-
-  if (fscanf(fd, "%f %f %f", orig, orig+1, orig+2) != 3) {
-    printf("situsplugin) Error reading grid origin.\n");
-    return NULL;
-  }
-
-  /* get the number of grid points */
-  if (fscanf(fd, "%d %d %d", &xsize, &ysize, &zsize) != 3) {
-    printf("situsplugin) Error reading grid dimensions.\n");
-    return NULL;
-  }
-
-  /* allocate and initialize the situs structure */
-  situs = new situs_t;
-  situs->fd = fd;
-  situs->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  situs->nsets = 1; /* this file contains only one data set */
-
-  situs->vol = new molfile_volumetric_t[1];
-  strcpy(situs->vol[0].dataname, "Situs map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    situs->vol[0].origin[i] = orig[i];
-    situs->vol[0].xaxis[i] = 0.0;
-    situs->vol[0].yaxis[i] = 0.0;
-    situs->vol[0].zaxis[i] = 0.0;
-  }
-  situs->vol[0].xaxis[0] = scale * (xsize-1);
-  situs->vol[0].yaxis[1] = scale * (ysize-1);
-  situs->vol[0].zaxis[2] = scale * (zsize-1);
-
-  situs->vol[0].xsize = xsize;
-  situs->vol[0].ysize = ysize;
-  situs->vol[0].zsize = zsize;
-
-  situs->vol[0].has_color = 0; /* Situs maps contain no color information. */
-
-  return situs;
-}
-
-static int read_situs_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  situs_t *situs = (situs_t *)v;
-  *nsets = situs->nsets; 
-  *metadata = situs->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_situs_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  situs_t *situs = (situs_t *)v;
-  FILE *fd = situs->fd;
-  int xsize, ysize, zsize, xysize, count, total;
-
-  xsize = situs->vol[0].xsize;
-  ysize = situs->vol[0].ysize;
-  zsize = situs->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  /* Read the values from the file */
-  for (count=0; count<total; count++) {
-    if (fscanf(fd, "%f", datablock + count) != 1) {
-      printf("situsplugin) Failed reading situs map data\n");
-      return MOLFILE_ERROR;
-    }
-  }   
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_situs_read(void *v) {
-  situs_t *situs = (situs_t *)v;
-  
-  fclose(situs->fd);
-  if (situs->vol != NULL)
-    delete [] situs->vol; 
-  delete situs;
-}
-
-static void *open_situs_write(const char *filepath, const char *filetype, int natoms) {
-
-  FILE *fd = fopen(filepath, "w");
-  if (!fd) {
-    fprintf(stderr, "situsplugin) Could not open path '%s' for writing.\n",
-      filepath);
-  }
-  return fd;
-}
-
-static void close_situs_write(void *v) {
-  if (v) {
-    fclose((FILE *)v);
-  }
-}
-
-/* The Situs format requires the same grid spacing in all directions.
- * The following code allows us to re-sample the map so that we can 
- * write a Situs file when the uniform grid spacing requirement is not met.
- * */
-
-/// return voxel, after safely clamping index to valid range
-float situs_voxel_value_safe(int x, int y, int z, const int xsize, const int ysize, const int zsize, const float *data) {
-  int xx, yy, zz; 
-  xx = (x > 0) ? ((x < xsize) ? x : xsize-1) : 0;
-  yy = (y > 0) ? ((y < ysize) ? y : ysize-1) : 0;
-  zz = (z > 0) ? ((z < zsize) ? z : zsize-1) : 0;
-  int index = zz*xsize*ysize + yy*xsize + xx;
-  return data[index];
-}
-
-/// return interpolated value from 8 nearest neighbor voxels
-float situs_voxel_value_interpolate(float xv, float yv, float zv, const int xsize, const int ysize, const int zsize, const float *data) {
-  int x = (int) xv;
-  int y = (int) yv;
-  int z = (int) zv;
-  // fractional offset
-  float xf = xv - x;
-  float yf = yv - y;
-  float zf = zv - z;
-  float xlerps[4];
-  float ylerps[2];
-  float tmp;
-
-  tmp = situs_voxel_value_safe(x, y, z, xsize, ysize, zsize, data);
-  xlerps[0] = tmp + xf*(situs_voxel_value_safe(x+1, y, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = situs_voxel_value_safe(x, y+1, z, xsize, ysize, zsize, data);
-  xlerps[1] = tmp + xf*(situs_voxel_value_safe(x+1, y+1, z, xsize, ysize, zsize, data) - tmp);
-
-  tmp = situs_voxel_value_safe(x, y, z+1, xsize, ysize, zsize, data);
-  xlerps[2] = tmp + xf*(situs_voxel_value_safe(x+1, y, z+1, xsize, ysize, zsize, data) - tmp);
-
-  tmp = situs_voxel_value_safe(x, y+1, z+1, xsize, ysize, zsize, data);
-  xlerps[3] = tmp + xf*(situs_voxel_value_safe(x+1, y+1, z+1, xsize, ysize, zsize, data) - tmp);
-
-  ylerps[0] = xlerps[0] + yf*(xlerps[1] - xlerps[0]);
-  ylerps[1] = xlerps[2] + yf*(xlerps[3] - xlerps[2]);
-
-  return ylerps[0] + zf*(ylerps[1] - ylerps[0]);
-}
-
-/// return interpolated value of voxel, based on atomic coords.
-/// XXX need to account for non-orthog. cells
-float situs_voxel_value_interpolate_from_coord(float xpos, float ypos, float zpos, const float *origin, const float *xdelta, const float *ydelta, const float *zdelta, const int xsize, const int ysize, const int zsize, float *data) {
-  xpos = (xpos-origin[0])/xdelta[0];
-  ypos = (ypos-origin[1])/ydelta[1];
-  zpos = (zpos-origin[2])/zdelta[2];
-  int gx = (int) xpos; // XXX this is wrong for non-orthog cells.
-  int gy = (int) ypos;
-  int gz = (int) zpos;
-  if (gx < 0 || gx >= xsize) return NAN;
-  if (gy < 0 || gy >= ysize) return NAN;
-  if (gz < 0 || gz >= zsize) return NAN;
-    
-  return situs_voxel_value_interpolate(xpos, ypos, zpos, xsize, ysize, zsize, data);
-
-}
-
-static int write_situs_data(void *v, molfile_volumetric_t *metadata, float *datablock, float *colorblock) {
-
-  FILE *fd = (FILE *)v;
-  const int xsize = metadata->xsize;
-  const int ysize = metadata->ysize;
-  const int zsize = metadata->zsize;
-  const int xysize = xsize * ysize;
-
-  float xaxis[3], yaxis[3], zaxis[3];
-  float xdelta[3], ydelta[3], zdelta[3];
-  float origin[3];
-
-  int i, j, k;
-
-  for (i=0; i<3; i++) {
-    origin[i] = metadata->origin[i];
-    xaxis[i] = metadata->xaxis[i];
-    yaxis[i] = metadata->yaxis[i];
-    zaxis[i] = metadata->zaxis[i];
-    xdelta[i] = xaxis[i]/(xsize - 1);
-    ydelta[i] = yaxis[i]/(ysize - 1);
-    zdelta[i] = zaxis[i]/(zsize - 1);
-  }
-
-  /* Situs format requires an orthogonal cell */
-  if (fabs(xaxis[1]) > TOLERANCE || fabs(xaxis[2]) > TOLERANCE ||
-      fabs(yaxis[0]) > TOLERANCE || fabs(yaxis[2]) > TOLERANCE ||
-      fabs(zaxis[0]) > TOLERANCE || fabs(zaxis[1]) > TOLERANCE) {
-    fprintf(stderr, "situsplugin) Could not write situs file: this format requires an orthogonal cell.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* Situs format requires the same grid spacing in all dimensions */
-  float xres = xdelta[0]*xdelta[0] + xdelta[1]*xdelta[1] + xdelta[2]*xdelta[2];
-  float yres = ydelta[0]*ydelta[0] + ydelta[1]*ydelta[1] + ydelta[2]*ydelta[2];
-  float zres = zdelta[0]*zdelta[0] + zdelta[1]*zdelta[1] + zdelta[2]*zdelta[2];
-  if ( (fabs(xres-yres) > TOLERANCE) || (fabs(xres-zres) > TOLERANCE) ) {
-
-    //fprintf(stderr, "situsplugin) Could not write situs file: this format requires the same grid spacing in all dimensions.\n");
-    //return MOLFILE_ERROR;
-    
-    fprintf(stderr, "situsplugin) Warning: This format requires the same grid spacing in all dimensions. The map will be re-sampled to meet this requirement. The resulting cell may be slightly smaller than the original one.\n");
-
-    // Use the smallest grid spacing for the re-sampled map
-    float new_delta = MIN(xdelta[0], ydelta[1]);
-    new_delta = MIN(new_delta, zdelta[2]);
-
-    // Calculate the map dimensions for the new grid spacing 
-    int new_xsize = int(xaxis[0]/new_delta);
-    int new_ysize = int(yaxis[1]/new_delta);
-    int new_zsize = int(zaxis[2]/new_delta);
-    int new_xysize = new_xsize * new_ysize;
-    int new_size = new_xsize * new_ysize * new_zsize;
-
-    // Resample map
-    float *new_data = (float *)malloc(3*new_size*sizeof(float));
-    for (i=0; i<new_xsize; i++) {
-      float xpos = origin[0] + i*new_delta;
-      for (j=0; j<new_ysize; j++) {
-        float ypos = origin[1] + j*new_delta;
-        for (k=0; k<new_zsize; k++) {
-          float zpos = origin[2] + k*new_delta;
-          new_data[i + j*new_xsize + k*new_xysize] = situs_voxel_value_interpolate_from_coord(xpos, ypos, zpos, origin, xdelta, ydelta, zdelta, xsize, ysize, zsize, datablock);
-        }
-      }
-    }
-
-    /* Write a situs header */
-    fprintf(fd, "%g %g %g %g %d %d %d\n\n", new_delta, origin[0], origin[1], origin[2], new_xsize, new_ysize, new_zsize);
-  
-    /* Write the main data array */
-    int numentries = 1;
-    for (k=0; k<new_zsize; k++) {
-      for (j=0; j<new_ysize; j++) {
-        for (i=0; i<new_xsize; i++) {
-          fprintf(fd, "%g ", new_data[i + j*new_xsize + k*new_xysize]);
-          if (numentries % 10 == 0) fprintf(fd, "\n");
-          numentries++;
-        }
-      }
-    }
-
-    free(new_data);
-
-  } else {
-  
-    /* Write a situs header */
-    fprintf(fd, "%g %g %g %g %d %d %d\n\n", xdelta[0], origin[0], origin[1], origin[2], xsize, ysize, zsize);
-  
-    /* Write the main data array */
-    int numentries = 1;
-    for (k=0; k<zsize; k++) {
-      for (j=0; j<ysize; j++) {
-        for (i=0; i<xsize; i++) {
-          fprintf(fd, "%g ", datablock[i + j*xsize + k*xysize]);
-          if (numentries % 10 == 0) fprintf(fd, "\n");
-          numentries++;
-        }
-      }
-    }
-
-  }
-
-  fflush(fd);
-  return MOLFILE_SUCCESS;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "situs";
-  plugin.prettyname = "Situs Density Map";
-  plugin.author = "John Stone, Leonardo Trabuco";
-  plugin.majorv = 1;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "sit,situs";
-  plugin.open_file_read = open_situs_read;
-  plugin.read_volumetric_metadata = read_situs_metadata;
-  plugin.read_volumetric_data = read_situs_data;
-  plugin.close_file_read = close_situs_read;
-#if vmdplugin_ABIVERSION > 9
-  plugin.open_file_write = open_situs_write;
-  plugin.write_volumetric_data = write_situs_data;
-  plugin.close_file_write = close_situs_write;
-#endif
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/spiderplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/spiderplugin.C
deleted file mode 100644
index 830cccace4b00d65e2c40eed95b45478c187dc15..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/spiderplugin.C
+++ /dev/null
@@ -1,328 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: spiderplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.17 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/* 
- * SPIDER volumetric image datasets
- *   http://www.wadsworth.org/spider_doc/spider/docs/image_doc.html
- *
- * TODO:
- *  - Add code to determine axis scaling factors, axis angles, offsets, etc
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-#include "endianswap.h"
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-  int byteswap;
-  int nslice;
-  int nrow;
-  int nlabel;
-  int iform;
-  int imami;
-  float fmax;
-  float fmin;
-  float av;
-  float sig;
-  int nsam;
-  int headrec;
-  int iangle;
-  float phi;
-  float theta;
-  float gamma;
-  float xoffset;
-  float yoffset;
-  float zoffset;
-  float scale;
-  int headbyt;
-  int reclen;
-  int nstack;
-  int inuse;
-  int maxim; 
-} spider_t;
-
-
-static void *open_spider_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  spider_t *vol;
-  int total;
-
-  /* file header buffer union */ 
-  union buffer {
-    float fbuf[256];  
-    char  cbuf[1024];
-  } h;
- 
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "spiderplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  /* allocate and initialize the spider structure */
-  vol = new spider_t;
-  vol->fd = fd;
-  vol->vol = NULL;
-  vol->byteswap = 0;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  vol->nsets = 1; /* this file contains only one data set */
-
-  vol->vol = new molfile_volumetric_t[1];
-  strcpy(vol->vol[0].dataname, "SPIDER map");
-
-  // read SPIDER file header
-  if (fread(&h.cbuf, 1024, 1, fd) < 1) {
-    printf("spiderplugin) failed to read file header\n");
-    return NULL; 
-  } 
-
-  // perform sanity checks on header values to see if we 
-  // need to do byte swapping, or abort.
-  vol->nslice   = (h.fbuf[0] < 0) ? -h.fbuf[0] : h.fbuf[0];
-  vol->nrow     = h.fbuf[1];
-  vol->nsam     = h.fbuf[11];
-  total = vol->nslice * vol->nrow * vol->nsam;
-
-  if (total <= 0 || 
-      vol->nsam   <= 0 || vol->nsam   > 100000 ||
-      vol->nrow   <= 0 || vol->nrow   > 100000 ||
-      vol->nslice <= 0 || vol->nslice > 100000) { 
-
-    printf("spiderplugin) Non-native endianness or unusual file detected\n");
-
-    // byte swap the entire header in hopes of making sense of this gibberish
-    vol->byteswap = 1;
-    swap4_aligned(&h.fbuf, 256);
-
-    vol->nslice   = (h.fbuf[0] < 0) ? -h.fbuf[0] : h.fbuf[0];
-    vol->nrow     = h.fbuf[1];
-    vol->nsam     = h.fbuf[11];
-    total = vol->nslice * vol->nrow * vol->nsam;
-
-    // check to see if we still have gibberish or not, bail out if we do.
-    if (total <= 0 || 
-      vol->nsam   <= 0 || vol->nsam   > 100000 ||
-      vol->nrow   <= 0 || vol->nrow   > 100000 ||
-      vol->nslice <= 0 || vol->nslice > 100000) { 
-      printf("spiderplugin) bad header values in file fail sanity checks\n");
-      delete [] vol->vol;
-      delete vol;
-      return NULL;
-    }
-  }
-  if (vol->byteswap) {
-    printf("spiderplugin) Enabling byte swapping\n");
-  }
-
-  vol->nlabel   = h.fbuf[3];
-  vol->iform    = h.fbuf[4];
-  vol->imami    = h.fbuf[5];
-  vol->fmax     = h.fbuf[6];
-  vol->fmin     = h.fbuf[7];
-  vol->av       = h.fbuf[8];
-  vol->sig      = h.fbuf[9];
-  vol->headrec  = h.fbuf[12];
-  vol->iangle   = h.fbuf[13];
-  vol->phi      = h.fbuf[14];
-  vol->theta    = h.fbuf[15];
-  vol->gamma    = h.fbuf[16];
-  vol->xoffset  = h.fbuf[17];
-  vol->yoffset  = h.fbuf[18];
-  vol->zoffset  = h.fbuf[19];
-  vol->scale    = h.fbuf[20];
-  vol->headbyt  = h.fbuf[21];
-  vol->reclen   = h.fbuf[22];
-  vol->nstack   = h.fbuf[23];
-  vol->inuse    = h.fbuf[24];
-  vol->maxim    = h.fbuf[25];
-
-printf("spider  nslice: %d\n", vol->nslice);
-printf("spider    nrow: %d\n", vol->nrow);
-printf("spider    nsam: %d\n", vol->nsam);
-printf("spider   iform: %d\n", vol->iform);
-printf("spider   scale: %f\n", vol->scale);
-printf("spider xoffset: %f\n", vol->xoffset);
-printf("spider yoffset: %f\n", vol->yoffset);
-printf("spider zoffset: %f\n", vol->zoffset);
-printf("spider     phi: %f\n", vol->phi);
-printf("spider   theta: %f\n", vol->theta);
-printf("spider   gamma: %f\n", vol->gamma);
-
-  /* correct bad headbyt and reclen SPIDER files */
-  if (vol->iform < 4 && (vol->reclen < (vol->nsam * 4)))
-    vol->reclen = vol->nsam * 4; 
-
-  int headrec = 1024 / vol->reclen;
-  if (vol->reclen < 1024 && (1024 % (vol->reclen)) != 0)
-     headrec++;
-  int headbyt = headrec * vol->reclen;
- 
-  if (vol->iform < 4 && (vol->headbyt < headbyt))
-    vol->headbyt = headbyt;
-
-printf("spider headbyt: %d\n", vol->headbyt);
-
-  /* seek to data offset */
-  fseek(fd, vol->headbyt, SEEK_SET);
-
-  /* SPIDER files contain no color information */
-  vol->vol[0].has_color = 0;
-
-  vol->vol[0].xsize = vol->nsam;
-  vol->vol[0].ysize = vol->nrow;
-  vol->vol[0].zsize = vol->nslice;
-
-  /* Set the unit cell origin and basis vectors */
-  float vz[3] = {0.0, 0.0, 0.0};
-  memcpy(vol->vol[0].xaxis, &vz, sizeof(vz));
-  memcpy(vol->vol[0].yaxis, &vz, sizeof(vz));
-  memcpy(vol->vol[0].zaxis, &vz, sizeof(vz));
-
-  /* the scale value may be zero, if so, just reset to 1.0 */
-  float vscale = vol->scale;
-  if (vscale == 0.0) 
-    vscale = 1.0;
-
-  /* the data is stored in y/x/-z order and coordinate handedness  */
-  /* we should probably rewrite the loader loop to shuffle x/y     */
-  /* so that future conversions to other formats don't leave it in */
-  /* an unusual packing order.  For now this works however         */
-
-  float xlen = vscale * (vol->vol[0].ysize-1);
-  float ylen = vscale * (vol->vol[0].xsize-1);
-  float zlen = vscale * (vol->vol[0].zsize-1);
-
-  vol->vol[0].xaxis[1] =  xlen;
-  vol->vol[0].yaxis[0] =  ylen;
-  vol->vol[0].zaxis[2] = -zlen;
-
-  vol->vol[0].origin[0] = vol->yoffset - (0.5 * ylen);
-  vol->vol[0].origin[1] = vol->xoffset - (0.5 * xlen);
-  vol->vol[0].origin[2] = vol->zoffset + (0.5 * zlen);
-
-printf("spider final offset: (%f, %f, %f)\n",
-  vol->vol[0].origin[0], vol->vol[0].origin[1], vol->vol[0].origin[2]);
-
-printf("spider final axes:\n");
-printf("  X (%f, %f, %f)\n",
-  vol->vol[0].xaxis[0], 
-  vol->vol[0].xaxis[1], 
-  vol->vol[0].xaxis[2]);
-
-printf("  Y (%f, %f, %f)\n",
-  vol->vol[0].yaxis[0], 
-  vol->vol[0].yaxis[1], 
-  vol->vol[0].yaxis[2]);
-
-printf("  Z (%f, %f, %f)\n",
-  vol->vol[0].zaxis[0], 
-  vol->vol[0].zaxis[1], 
-  vol->vol[0].zaxis[2]);
-
-  return vol;
-}
-
-static int read_spider_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  spider_t *vol = (spider_t *)v;
-  *nsets = vol->nsets;
-  *metadata = vol->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_spider_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  spider_t *vol = (spider_t *)v;
-  FILE *fd = vol->fd;
-  int xsize, ysize, zsize, xysize, total;
-
-  xsize = vol->vol[0].xsize;
-  ysize = vol->vol[0].ysize;
-  zsize = vol->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  // Read the values from the file
-  fread(datablock, total * sizeof(float), 1, fd);
-
-  // perform byte swapping if necessary
-  if (vol->byteswap) 
-    swap4_aligned(datablock, total);
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_spider_read(void *v) {
-  spider_t *vol = (spider_t *)v;
-  
-  fclose(vol->fd);
-  if (vol->vol != NULL)
-    delete [] vol->vol; 
-  delete vol;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "spider";
-  plugin.prettyname = "SPIDER Density Map";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "spi,spider";
-  plugin.open_file_read = open_spider_read;
-  plugin.read_volumetric_metadata = read_spider_metadata;
-  plugin.read_volumetric_data = read_spider_data;
-  plugin.close_file_read = close_spider_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/stlplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/stlplugin.C
deleted file mode 100644
index 36b91b2138945f9bd198bf4977561b802c437829..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/stlplugin.C
+++ /dev/null
@@ -1,260 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: stlplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.16 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- *  STL files are used by most Automatic Fabricators (3D printers). Only 
- *  triangles are used to represent the geometry. 
- *
- *  ASCII STL files follow the following format. Files are case insensitive
- *  and whitespace is ignored.
- *
- *  solid name                ("name" is an arbitrary label for the solid)
- *  facet normal ni nj nk     (<n> is a unit normal of the triangle)
- *  outer loop
- *  vertex v1x v1y v1z        (<v1> is the first vertex)
- *  vertex v2x v2y v2z        (vertices are given in anti-clockwise order)
- *  vertex v3x v3y v3z        (vertices are given as floating-point values)
- *  endloop                   (there is no space in the label "endloop")
- *  endfacet                  (likewise)
- *  ...                       (additional facets are given as above)
- *  endsolid name             (this ends the stl file, same name as above)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp stricmp
-#endif
-
-#include "molfile_plugin.h"
-
-typedef struct graphics_list {
-  molfile_graphics_t gItem;
-  struct graphics_list *next;
-} molfile_graphics_list;
-
-typedef struct {
-  FILE *fd;
-  molfile_graphics_t *graphics;
-} stl_t;
-
-static void *open_file_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  stl_t *stl;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    fprintf(stderr, "stlplugin) Error opening file.\n");
-    return NULL;
-  }
-  stl = new stl_t;
-  stl->fd = fd;
-  stl->graphics = NULL;
-  *natoms = 0;
-  return stl;
-}
-
-static int read_rawgraphics(void *v, int *nelem, 
-    const molfile_graphics_t **data) {
-    molfile_graphics_list *gListPtr=NULL, *tmpPtr=NULL;
-    int i=0, ntriangles=0;
-    int error=0;
-    stl_t *stl = (stl_t *)v;
-    FILE *infile = stl->fd;
-    char line[81], keyWord[81];
-
-    // Check your head(er)
-    // "solid name"
-    fgets(line, 80, infile);
-    sscanf(line, " %s", keyWord);
-    if (strcasecmp(keyWord, "solid") != 0) {
-      fprintf(stderr, "stlplugin) error: expected \"solid\".\n");
-      error = 1;
-    }
-
-    // "facet normal ni nj nk"
-    fgets(line, 80, infile);
-    sscanf(line, " %s", keyWord);
-    if (strcasecmp(keyWord, "facet") != 0) {
-      fprintf(stderr, "stlplugin) error: expected \"facet\".\n");
-      error = 1;
-    } else {
-      gListPtr = new molfile_graphics_list;
-      gListPtr->next = NULL;
-      gListPtr->gItem.type = MOLFILE_TRIANGLE;
-      ntriangles++;
-      tmpPtr = gListPtr;
-    }
-
-    while ( !feof(infile) && (error == 0) ) {
-      // "outer loop"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "outer") != 0) {
-        fprintf(stderr, "stlplugin) error: expected \"outer\".\n");
-        error = 1;
-        break;
-      } else {
-        i = 0;
-      }
-        
-      // "vertex vx, vy, vz"
-      while (i < 9) {
-        fgets(line, 80, infile);
-        sscanf(line, " %s", keyWord);
-        if (strcasecmp(keyWord, "vertex") != 0) {
-          fprintf(stderr, "stlplugin) error: expected \"vertex\".\n");
-          error = 1;
-          break; 
-        } else {
-          float t1=0.0f, t2=0.0f, t3=0.0f;
-          if ( sscanf(line, " %*s %f %f %f", &t1, &t2, &t3) == 3 ) {
-            tmpPtr->gItem.data[i++] = t1;
-            tmpPtr->gItem.data[i++] = t2;
-            tmpPtr->gItem.data[i++] = t3;
-          } else {
-            fprintf(stderr, "stlplugin) error: not enough vertices.\n");
-            error = 1;
-            break;
-          }
-        }
-      }
-      if (error != 0) break;
-
-      // "endloop"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "endloop") != 0) {
-        fprintf(stderr, "stlplugin) error: expected \"endloop\".\n");
-        error = 1;
-        break;
-      }
-      
-      // "endfacet"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "endfacet") != 0) {
-        fprintf(stderr, "stlplugin) error: expected \"endfacet\".\n");
-        error = 1;
-        break;
-      }
-
-      // "endsolid" or "facet normal ni nj nk"
-      fgets(line, 80, infile);
-      sscanf(line, " %s", keyWord);
-      if (strcasecmp(keyWord, "endsolid") == 0) {
-        break;
-      }
-
-      if (strcasecmp(keyWord, "facet") == 0) {
-        // Create a new list item and initialize it.
-        tmpPtr->next = new molfile_graphics_list;
-        tmpPtr = tmpPtr->next;
-        tmpPtr->next = NULL;
-        tmpPtr->gItem.type = MOLFILE_TRIANGLE;
-        ntriangles++;
-      } else {
-        fprintf(stderr, 
-                "stlplugin) error: expected \"facet\" or \"endsolid\".\n");
-        error = 1;
-        break;
-      }
-
-      // file error
-      if(ferror(infile)) {
-        fprintf(stderr, "stlplugin) error: problem reading file\n");
-        error = 1;
-        break;
-      }
-    }
-
-
-    // If an error occurred, free the linked list and return MOLFILE_ERROR
-    if (error != 0) {
-      while (gListPtr != NULL) {
-        tmpPtr = gListPtr->next;
-        delete gListPtr;
-        gListPtr = tmpPtr;
-      }
-      return MOLFILE_ERROR;
-    }
-
-    // Create the array of molfile_graphics_t, and copy the data from the
-    // linked list into it, deleting the list as you go.
-    stl->graphics = new molfile_graphics_t[ntriangles];
-    i = 0;
-    while (gListPtr != NULL) {
-      stl->graphics[i] = gListPtr->gItem;
-      tmpPtr = gListPtr->next;
-      delete gListPtr;
-      gListPtr = tmpPtr;
-      i++;
-    }
-
-    *nelem = ntriangles;
-    *data = stl->graphics;
-
-    return MOLFILE_SUCCESS;
-}
-
-static void close_file_read(void *v) {
-  stl_t *stl = (stl_t *)v;
-  fclose(stl->fd);
-  if (stl->graphics != NULL)
-    delete [] stl->graphics;
-  delete stl;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "stl";
-  plugin.prettyname = "STL Stereolithography Triangle Mesh";
-  plugin.author = "Eamon Caddigan";
-  plugin.minorv = 0;
-  plugin.majorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "stl";
-  plugin.open_file_read = open_file_read;
-  plugin.read_rawgraphics = read_rawgraphics;
-  plugin.close_file_read = close_file_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/tinkerplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/tinkerplugin.c
deleted file mode 100644
index 1ebd4eeccf5d4a170f41e8da2bd3f6bfdf5df55b..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/tinkerplugin.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: tinkerplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
- /*
-  * The .arc file is the one coming straight out of tinker.
-  * Many frames, looks like a regular tinker, except that in the last columns
-  * after x, y and z it has :
-  * 
-  * atom type (not important for viz)
-  * 
-  * and then info in a Z-matrix form
-  * 
-  * atom to which you are bonded, atom to which you are 'angled' and atom to
-  * which you are 'torsioned'.
-  * 
-  */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  char *file_name;
-  molfile_atom_t *atomlist;
-} tinkerdata;
- 
-static void *open_tinker_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  tinkerdata *data;
-  int i;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  data = (tinkerdata *)malloc(sizeof(tinkerdata));
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* First line is the number of atoms, followed by other stuff */
-  i = fscanf(data->file, "%d", natoms);
-  if (i < 1) {
-    fprintf(stderr, "\n\nread) ERROR: tinker file '%s' should have the number of atoms in the first line.\n", filename);
-    return NULL;
-  }
-  data->numatoms=*natoms;
-
-  while (getc(fd) != '\n'); /* skip rest of this line */
- 
-  return data;
-}
-
-static int read_tinker_structure(void *mydata, int *optflags, 
-                                 molfile_atom_t *atoms) {
-  int i, j, atomid;
-  char *k;
-  float coord;
-  molfile_atom_t *atom;
-  tinkerdata *data = (tinkerdata *)mydata;
-
-  *optflags = MOLFILE_NOOPTIONS;
-
-  for (i=0; i<data->numatoms; i++) {
-    char buffer[1024], fbuffer[1024];
-    int atomtypeindex=0;
-    k = fgets(fbuffer, 1024, data->file);
-    atom = atoms + i;
-    j=sscanf(fbuffer, "%d %s %f %f %f %d", &atomid, buffer, &coord, &coord, &coord, &atomtypeindex);
-    if (k == NULL) {
-      fprintf(stderr, "tinker structure) missing atom(s) in file '%s'\n", data->file_name);
-      fprintf(stderr, "tinker structure) expecting '%d' atoms, found only '%d'\n", data->numatoms, i+1);
-      return MOLFILE_ERROR;
-    } else if (j < 5) {
-      fprintf(stderr, "tinker structure) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->file_name, i+1);
-      return MOLFILE_ERROR;
-    }
-
-    strncpy(atom->name, buffer, sizeof(atom->name));
-#if 0
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-#else
-    sprintf(atom->type, "%d", atomtypeindex);
-#endif
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_tinker_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j, atomid;
-  char atom_name[1024], fbuffer[1024], *k;
-  float x, y, z;
-  
-  tinkerdata *data = (tinkerdata *)mydata;
-  
-  /* skip over the first line */
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-
-  /* read the coordinates */
-  for (i=0; i<natoms; i++) {
-    k = fgets(fbuffer, 1024, data->file);
-
-    /* Read in atom type, X, Y, Z, skipping any remaining data fields */
-    j = sscanf(fbuffer, "%d %s %f %f %f", &atomid, atom_name, &x, &y, &z);
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 5) {
-      fprintf(stderr, "tinker timestep) missing type or coordinate(s) in file '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (j >= 5) {
-      if (ts != NULL) { 
-        /* only save coords if we're given a timestep pointer, */
-        /* otherwise assume that VMD wants us to skip past it. */
-        ts->coords[3*i  ] = x;
-        ts->coords[3*i+1] = y;
-        ts->coords[3*i+2] = z;
-      }
-    } else {
-      break;
-    }
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_tinker_read(void *mydata) {
-  tinkerdata *data = (tinkerdata *)mydata;
-  fclose(data->file);
-  free(data->file_name);
-  free(data);
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "tinker";
-  plugin.prettyname = "Tinker";
-  plugin.author = "John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "arc";
-  plugin.open_file_read = open_tinker_read;
-  plugin.read_structure = read_tinker_structure;
-  plugin.read_next_timestep = read_tinker_timestep;
-  plugin.close_file_read = close_tinker_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_tinker_read(*argv, "tinker", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_tinker_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_tinker_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_tinker_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_tinker_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/tngplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/tngplugin.C
deleted file mode 100644
index 996533aa0162cb8eb269a3d73e98ac328cf70de1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/tngplugin.C
+++ /dev/null
@@ -1,629 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: tngplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.7 $       $Date: 2015/10/12 03:00:46 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   VMD plugin to allow reading and writing of Gromacs TNG trajectories.
- *   This software and the TNG library are made available under the
- *   BSD license.  For details, see the license information associated
- *   with the Gromacs TNG library that this code depends on at:
- *     http://www.gromacs.org/
- *
- *   The TNG trajectory format is described in this publication:
- *     "An efficient and extensible format, library, and API for
- *     binary trajectory data from molecular simulations"
- *     Journal of Computational Chemistry 2013, DOI: 10.1002/jcc.23495
- *     http://onlinelibrary.wiley.com/doi/10.1002/jcc.23495/abstract
- *
- *   The TNG git repo is the master location for the sources, though
- *   the standard git SSL checks have to be disabled to access it:
- *      env GIT_SSL_NO_VERIFY=1 git clone https://gerrit.gromacs.org/tng
- *
- *   This version of the TNG plugin requires version 1.7.4 or greater
- *   of the TNG library.
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <tng/tng_io.h>
-#include "molfile_plugin.h"
-
-#define TNG_PLUGIN_MAJOR_VERSION 1
-#define TNG_PLUGIN_MINOR_VERSION 0
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-typedef struct {
-  tng_trajectory_t tng_traj;
-  int natoms;
-  int step;
-//   int stride_length;
-  int64_t n_frames;
-  int coord_exponential;
-//   int64_t n_frames_per_frame_set;
-  double time_per_frame;
-  int has_velocities;
-} tngdata;
-
-static void convert_tng_box_shape_to_vmd(float *box_shape, float *vmd_box)
-{
-    float A, B, C;
-
-    A = sqrt(box_shape[0]*box_shape[0] +
-             box_shape[1]*box_shape[1] +
-             box_shape[2]*box_shape[2]);
-    B = sqrt(box_shape[3]*box_shape[3] +
-             box_shape[4]*box_shape[4] +
-             box_shape[5]*box_shape[5]);
-    C = sqrt(box_shape[6]*box_shape[6] +
-             box_shape[7]*box_shape[7] +
-             box_shape[8]*box_shape[8]);
-
-    if ((A<=0) || (B<=0) || (C<=0))
-    {
-        vmd_box[0] = vmd_box[1] = vmd_box[2] = 0;
-        vmd_box[3] = vmd_box[4] = vmd_box[5] = 90;
-    }
-    else
-    {
-        vmd_box[0] = A;
-        vmd_box[1] = B;
-        vmd_box[2] = C;
-        vmd_box[3] = acos( (box_shape[3]*box_shape[6]+
-                            box_shape[4]*box_shape[7]+
-                            box_shape[5]*box_shape[8])/(B*C) ) * 90.0/M_PI_2;
-        vmd_box[4] = acos( (box_shape[0]*box_shape[6]+
-                            box_shape[1]*box_shape[7]+
-                            box_shape[2]*box_shape[8])/(A*C) ) * 90.0/M_PI_2;
-        vmd_box[5] = acos( (box_shape[0]*box_shape[3]+
-                            box_shape[1]*box_shape[4]+
-                            box_shape[2]*box_shape[5])/(A*B) ) * 90.0/M_PI_2;
-    }
-}
-
-static void convert_vmd_box_shape_to_tng(const molfile_timestep_t *ts, float *box_shape)
-{
-//     const float sa = sin((double)ts->alpha/180.0*M_PI);
-    const float ca = cos((double)ts->alpha/180.0*M_PI);
-    const float cb = cos((double)ts->beta/180.0*M_PI);
-    const float cg = cos((double)ts->gamma/180.0*M_PI);
-    const float sg = sin((double)ts->gamma/180.0*M_PI);
-
-    box_shape[0] = ts->A;
-    box_shape[1] = 0.0;
-    box_shape[2] = 0.0;
-    box_shape[3] = ts->B*cg; // ts->B*ca when writing trr?!
-    box_shape[4] = ts->B*sg; // ts->B*sa when writing trr?!
-    box_shape[5] = 0.0;
-    box_shape[6] = ts->C*cb;
-    box_shape[7] = ts->C*(ca - cb*cg)/sg;
-    box_shape[8] = ts->C*sqrt((double)(1.0 + 2.0*ca*cb*cg
-                                       - ca*ca - cb*cb - cg*cg)/(1.0 - cg*cg));
-}
-
-static void *open_tng_read(const char *filename, const char*,
-                           int *natoms)
-{
-    tngdata *tng;
-    tng_function_status stat;
-    int64_t n, exp;
-
-    tng = new tngdata;
-
-    stat = tng_util_trajectory_open(filename, 'r', &tng->tng_traj);
-    if(stat != TNG_SUCCESS)
-    {
-        fprintf(stderr, "tngplugin) Cannot open file '%s'\n", filename);
-        return NULL;
-    }
-
-    tng_num_particles_get(tng->tng_traj, &n);
-    *natoms = (int)n;
-    tng->natoms = (int)n;
-    tng->step = 0;
-    tng_num_frames_get(tng->tng_traj, &n);
-    tng->n_frames = n;
-    tng->has_velocities = 0;
-
-    tng_distance_unit_exponential_get(tng->tng_traj, &exp);
-    tng->coord_exponential = (int) exp;
-
-
-    return tng;
-}
-
-static int read_tng_structure(void *v, int *optflags,
-                               molfile_atom_t *atoms)
-{
-    tngdata *tng = (tngdata *)v;
-    char long_name[16], short_name[2];
-    int64_t id;
-
-    *optflags = MOLFILE_NOOPTIONS;
-    for(int i = 0; i < tng->natoms; i++)
-    {
-        molfile_atom_t *atom = atoms+i;
-        tng_atom_name_of_particle_nr_get(tng->tng_traj, i, long_name, 16);
-        strcpy(atom->name, long_name);
-        tng_atom_type_of_particle_nr_get(tng->tng_traj, i, long_name, 16);
-        strcpy(atom->type, long_name);
-        tng_residue_name_of_particle_nr_get(tng->tng_traj, i, long_name, 16);
-        strcpy(atom->resname, long_name);
-        tng_global_residue_id_of_particle_nr_get(tng->tng_traj, i, &id);
-        atom->resid = (int)id;
-//         fprintf(stderr, "resid: %d\n", (int)id);
-        tng_chain_name_of_particle_nr_get(tng->tng_traj, i, short_name, 2);
-        strcpy(atom->chain, short_name);
-        atom->segid[0] = '\0';
-    }
-//     fprintf(stderr, "Structure opened\n");
-    return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int read_tng_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                          float **bondorderptr, int **bondtypeptr,
-                          int *nbondtypes, char ***bondtypename)
-#else
-static int read_tng_bonds(void *v, int *nbonds, int **fromptr, int **toptr,
-                          float **bondorderptr)
-#endif
-{
-    int64_t *from_atoms = 0, *to_atoms = 0, bond_cnt, i;
-    tng_function_status stat;
-
-    tngdata *tng = (tngdata *)v;
-
-    stat = tng_molsystem_bonds_get(tng->tng_traj, &bond_cnt, &from_atoms,
-                                   &to_atoms);
-    if(stat != TNG_SUCCESS)
-    {
-        return MOLFILE_ERROR;
-    }
-
-    if(bond_cnt <= 0)
-    {
-        fprintf(stderr, "tngplugin) No bonds found in molsystem\n");
-        *nbonds = 0;
-        *fromptr = 0;
-        *toptr = 0;
-        return MOLFILE_SUCCESS;
-    }
-
-    /* Convert from int64_t to int. The fact that VMD and TNG use different
-     * int types can lead to problems if there are very many atoms and/or
-     * bonds */
-    *nbonds = (int) bond_cnt;
-    *fromptr = (int *)malloc((*nbonds) * sizeof(int));
-    *toptr = (int *)malloc((*nbonds) * sizeof(int));
-    *bondorderptr = 0;
-
-#if vmdplugin_ABIVERSION > 14
-    *bondtypeptr = 0;
-    *nbondtypes = 0;
-    *bondtypename = 0;
-#endif
-
-    for(i = 0; i < *nbonds; i++)
-    {
-        (*fromptr)[i] = (int)from_atoms[i] + 1;
-        (*toptr)[i] = (int)to_atoms[i] + 1;
-//         fprintf(stderr, "Adding bond from %d to %d\n", (*fromptr)[i], (*toptr)[i]);
-    }
-
-    return MOLFILE_SUCCESS;
-}
-
-static void convert_to_float(void *from, float *to, const float fact, const int natoms, const int nvalues, const char datatype)
-{
-    int i, j;
-
-    switch(datatype)
-    {
-    case TNG_FLOAT_DATA:
-        if(fact == 1)
-        {
-            memcpy(to, from, nvalues * sizeof(float) * natoms);
-        }
-        else
-        {
-            for(i = 0; i < natoms; i++)
-            {
-                for(j = 0; j < nvalues; j++)
-                {
-                    to[i*3+j] = (float)((float *)from)[i*3+j] * fact;
-                }
-            }
-        }
-        break;
-    case TNG_INT_DATA:
-        for(i = 0; i < natoms; i++)
-        {
-            for(j = 0; j < nvalues; j++)
-            {
-                to[i*3+j] = (float)((int64_t *)from)[i*3+j] * fact;
-            }
-        }
-        break;
-    case TNG_DOUBLE_DATA:
-        for(i = 0; i < natoms; i++)
-        {
-            for(j = 0; j < nvalues; j++)
-            {
-                to[i*3+j] = (float)((double *)from)[i*3+j] * fact;
-            }
-        }
-        break;
-    default:
-        fprintf(stderr, "tngplugin) Cannot cast data\n");
-    }
-    return;
-}
-
-static int read_tng_timestep(void *v, int natoms, molfile_timestep_t *ts)
-{
-    /* The pointers that will be allocated by the TNG must be NULL before allocation. */
-    void *values = 0;
-    char datatype;
-    float box_shape[9], vmd_box[6];
-    float fact = 1;
-    int64_t frame, n, temp, temp2;
-    tng_function_status stat;
-    tngdata *tng = (tngdata *)v;
-
-    if(!ts)
-    {
-        return MOLFILE_ERROR;
-    }
-
-//     fprintf(stderr, "Reading framestep from TNG\n");
-
-    stat = tng_util_particle_data_next_frame_read(tng->tng_traj, TNG_TRAJ_POSITIONS, &values,
-                                                  &datatype, &frame, &ts->physical_time);
-    if(stat != TNG_SUCCESS)
-    {
-        return MOLFILE_ERROR;
-    }
-//     fprintf(stderr, "tngplugin) Timestep %d (%f), frame %d (%d), %d atoms\n",
-//             tng->step, ts->physical_time, (int)frame, (int)tng->n_frames, natoms);
-
-    /* TODO: Here it would be possible to add reading of the energy and pressure
-     * measurements supported in VMD if they are present in the TNG file */
-    tng_num_particles_get(tng->tng_traj, &n);
-    if(n != natoms)
-    {
-        fprintf(stderr, "tngplugin) Timestep in file contains wrong number of atoms\n");
-        fprintf(stderr, "tngplugin) Found %d, expected %d\n", (int)n, natoms);
-        return MOLFILE_ERROR;
-    }
-
-    if(tng->coord_exponential != -10)
-    {
-        fact = pow(10.0, tng->coord_exponential + 10);
-    }
-
-    convert_to_float(values, ts->coords, fact, natoms, 3, datatype);
-
-    if(ts->velocities)
-    {
-//         fprintf(stderr, "tngplugin) Reading velocities\n");
-        stat = tng_particle_data_vector_interval_get(tng->tng_traj, TNG_TRAJ_VELOCITIES, frame,
-                                                     frame, TNG_USE_HASH, &values,
-                                                     &n, &temp, &temp2, &datatype);
-        if(stat == TNG_CRITICAL)
-        {
-            return MOLFILE_ERROR;
-        }
-        if(stat == TNG_SUCCESS)
-        {
-            convert_to_float(values, ts->velocities, fact, natoms, 3, datatype);
-        }
-    }
-
-    stat = tng_data_vector_interval_get(tng->tng_traj, TNG_TRAJ_BOX_SHAPE,
-                                        frame, frame, TNG_USE_HASH, &values,
-                                        &temp, &temp2, &datatype);
-    if(stat == TNG_CRITICAL)
-    {
-        return MOLFILE_ERROR;
-    }
-    if(stat == TNG_SUCCESS)
-    {
-        convert_to_float(values, box_shape, fact, 1, 9, datatype);
-
-        convert_tng_box_shape_to_vmd(box_shape, vmd_box);
-        if(ts)
-        {
-            ts->A = vmd_box[0];
-            ts->B = vmd_box[1];
-            ts->C = vmd_box[2];
-            ts->alpha = vmd_box[3];
-            ts->beta = vmd_box[4];
-            ts->gamma = vmd_box[5];
-        }
-    }
-
-    ++tng->step;
-    if(values)
-    {
-        free(values);
-    }
-
-    return MOLFILE_SUCCESS;
-}
-
-static int read_timestep_metadata(void *v, molfile_timestep_metadata_t *metadata)
-{
-    tng_function_status stat;
-    tngdata *tng = (tngdata *)v;
-
-    /* Check only once if there are velocities in the file at all. */
-    if(tng->has_velocities == 0)
-    {
-        stat = tng_frame_set_read_current_only_data_from_block_id(tng->tng_traj, TNG_SKIP_HASH, TNG_TRAJ_VELOCITIES);
-
-        if(stat == TNG_CRITICAL)
-        {
-            metadata->has_velocities = 0;
-            return MOLFILE_ERROR;
-        }
-        else if(stat == TNG_SUCCESS)
-        {
-            fprintf(stderr, "tngplugin) Trajectory contains velocities\n");
-            tng->has_velocities = 1;
-        }
-        else
-        {
-            fprintf(stderr, "tngplugin) Trajectory does not contain velocities\n");
-            tng->has_velocities = -1;
-        }
-    }
-    if(tng->has_velocities == 1)
-    {
-        metadata->has_velocities = 1;
-    }
-    else
-    {
-        metadata->has_velocities = 0;
-    }
-
-    return MOLFILE_SUCCESS;
-}
-
-static void close_tng(void *v)
-{
-    tngdata *tng = (tngdata *)v;
-    tng_util_trajectory_close(&tng->tng_traj);
-    delete tng;
-}
-
-static void *open_tng_write(const char *filename, const char*,
-                            int natoms)
-{
-    tngdata *tng;
-    tng_function_status stat;
-//     int64_t n, exp;
-
-    tng = new tngdata;
-
-    stat = tng_util_trajectory_open(filename, 'w', &tng->tng_traj);
-    if(stat != TNG_SUCCESS)
-    {
-        fprintf(stderr, "tngplugin) Cannot open file '%s'\n", filename);
-        return NULL;
-    }
-
-    tng->natoms = natoms;
-    tng->step = 0;
-    tng->coord_exponential = -10;
-    tng_distance_unit_exponential_set(tng->tng_traj, -10);
-
-    tng->time_per_frame = -1;
-
-    return tng;
-}
-
-static int write_tng_structure(void *v, int optflags, const molfile_atom_t *atoms)
-{
-    /* VMD atoms do not contain molecule information, which
-     * complicates TNG writing a bit. */
-    tng_molecule_t tng_mol = 0;
-    tng_chain_t tng_chain = 0;
-    tng_residue_t tng_residue = 0;
-    tng_atom_t tng_atom;
-    int prev_resid = -1;
-    char new_chain_name[4] = "X_A";
-
-    tngdata *tng = (tngdata *)v;
-
-    /* A dummy molecule must be added. All atoms will be added to it. */
-    if(tng_molecule_find(tng->tng_traj, "MOL", -1, &tng_mol) != TNG_SUCCESS)
-    {
-        tng_molecule_add(tng->tng_traj, "MOL", &tng_mol);
-    }
-
-    for(int i = 0; i < tng->natoms; i++)
-    {
-        if(tng_chain == 0)
-        {
-            if(tng_molecule_chain_find(tng->tng_traj, tng_mol, atoms[i].chain, -1, &tng_chain) !=
-                TNG_SUCCESS)
-            {
-                tng_molecule_chain_add(tng->tng_traj, tng_mol, atoms[i].chain, &tng_chain);
-            }
-        }
-        else if(tng_residue != 0)
-        {
-            if(prev_resid >= 0)
-            {
-                if(prev_resid > atoms[i].resid)
-                {
-                    new_chain_name[0] = atoms[i].chain[0];
-                    ++new_chain_name[2];
-                    tng_molecule_chain_add(tng->tng_traj, tng_mol, new_chain_name, &tng_chain);
-                }
-            }
-        }
-//         fprintf(stderr, "tngplugin) Looking for residue: %s, %d\n", atoms[i].resname, atoms[i].resid);
-        if (tng_chain_residue_find(tng->tng_traj, tng_chain, atoms[i].resname,
-                                   atoms[i].resid, &tng_residue) != TNG_SUCCESS)
-        {
-            tng_chain_residue_w_id_add(tng->tng_traj, tng_chain, atoms[i].resname,
-                                       atoms[i].resid, &tng_residue);
-            prev_resid = atoms[i].resid;
-        }
-        tng_residue_atom_add(tng->tng_traj, tng_residue, atoms[i].name, atoms[i].type, &tng_atom);
-    }
-    tng_molecule_cnt_set(tng->tng_traj, tng_mol, 1);
-
-    return MOLFILE_SUCCESS;
-}
-
-#if vmdplugin_ABIVERSION > 14
-static int write_tng_bonds(void *v, int nbonds, int *from, int *to,
-                          float *bondorder, int *bondtype,
-                          int nbondtypes, char **bondtypename)
-#else
-static int write_tng_bonds(void *v, int nbonds, int *from, int *to,
-                          float *bondorder)
-#endif
-{
-    tng_molecule_t tng_mol;
-    tng_bond_t tng_bond;
-    int i;
-
-    if(nbonds == 0)
-    {
-        return MOLFILE_SUCCESS;
-    }
-
-    tngdata *tng = (tngdata *)v;
-
-    /* A dummy molecule must be added. All atoms will be added to it. */
-    if(tng_molecule_find(tng->tng_traj, "MOL", -1, &tng_mol) != TNG_SUCCESS)
-    {
-        tng_molecule_add(tng->tng_traj, "MOL", &tng_mol);
-    }
-
-    for (i = 0; i < nbonds; i++)
-    {
-        if(tng_molecule_bond_add(tng->tng_traj, tng_mol, from[i]-1, to[i]-1, &tng_bond) != TNG_SUCCESS)
-        {
-            fprintf(stderr, "tngplugin) Error adding bond %d (from %d to %d).\n", i, from[i], to[i]);
-            return MOLFILE_ERROR;
-        }
-    }
-    return MOLFILE_SUCCESS;
-}
-
-static int write_tng_timestep(void *v, const molfile_timestep_t *ts)
-{
-    float box_shape[9];
-    tngdata *tng = (tngdata *)v;
-
-    /* If there are fewer particles in the TNG mol system (write_tng_structure
-     * has not already been performed) compensate by creating implicit particles,
-     * which will not have full atom information. */
-    tng_implicit_num_particles_set(tng->tng_traj, tng->natoms);
-
-    if(!ts)
-    {
-        return MOLFILE_ERROR;
-    }
-
-    convert_vmd_box_shape_to_tng(ts, box_shape);
-    if(tng->step == 1 && ts->physical_time != 0)
-    {
-        tng->time_per_frame = ts->physical_time;
-        tng_time_per_frame_set(tng->tng_traj, tng->time_per_frame);
-    }
-    if(tng->time_per_frame < 0)
-    {
-//         fprintf(stderr, "tngplugin) Writing frame without time stamp\n");
-        tng_util_box_shape_write(tng->tng_traj, tng->step, box_shape);
-        tng_util_pos_write(tng->tng_traj, tng->step, ts->coords);
-    }
-    else
-    {
-//         fprintf(stderr, "tngplugin) Writing frame with time stamp\n");
-        tng_util_box_shape_with_time_write(tng->tng_traj, tng->step, ts->physical_time,
-                                           box_shape);
-        tng_util_pos_with_time_write(tng->tng_traj, tng->step, ts->physical_time,
-                                     ts->coords);
-    }
-    if(tng->step == 0)
-    {
-        tng_util_pos_write_interval_set(tng->tng_traj, 1);
-        tng_util_box_shape_write_interval_set(tng->tng_traj, 1);
-    }
-    if(ts->velocities)
-    {
-//         fprintf(stderr, "tngplugin) Writing TNG velocities\n");
-        if(tng->time_per_frame < 0)
-        {
-            tng_util_vel_write(tng->tng_traj, tng->step, ts->velocities);
-        }
-        else
-        {
-            tng_util_vel_with_time_write(tng->tng_traj, tng->step, ts->physical_time,
-                                         ts->velocities);
-        }
-        if(tng->step == 0)
-        {
-            tng_util_vel_write_interval_set(tng->tng_traj, 1);
-        }
-    }
-
-    tng->step++;
-
-    return MOLFILE_SUCCESS;
-}
-
-static molfile_plugin_t tng_plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  // TNG plugin init
-  memset(&tng_plugin, 0, sizeof(molfile_plugin_t));
-  tng_plugin.abiversion = vmdplugin_ABIVERSION;
-  tng_plugin.type = MOLFILE_PLUGIN_TYPE;
-  tng_plugin.name = "tng";
-  tng_plugin.prettyname = "TNG: Trajectory Next Generation (testing)";
-  tng_plugin.author = "Magnus Lundborg";
-  tng_plugin.majorv = TNG_PLUGIN_MAJOR_VERSION;
-  tng_plugin.minorv = TNG_PLUGIN_MINOR_VERSION;
-  tng_plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  tng_plugin.filename_extension = "tng";
-  tng_plugin.open_file_read = open_tng_read;
-  tng_plugin.read_structure = read_tng_structure;
-  tng_plugin.read_bonds = read_tng_bonds;
-  tng_plugin.read_next_timestep = read_tng_timestep;
-  tng_plugin.close_file_read = close_tng;
-  tng_plugin.open_file_write = open_tng_write;
-  tng_plugin.write_structure = write_tng_structure;
-  tng_plugin.write_timestep = write_tng_timestep;
-  tng_plugin.close_file_write = close_tng;
-  tng_plugin.write_bonds = write_tng_bonds;
-  tng_plugin.read_timestep_metadata = read_timestep_metadata;
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&tng_plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/uhbdplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/uhbdplugin.C
deleted file mode 100644
index c1b97f9f63fd2c3c94fcfd0eb73e190a6799b5a2..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/uhbdplugin.C
+++ /dev/null
@@ -1,346 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: uhbdplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.14 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-/*
- * Plugin by Alexander Spaar for reading UHBD grid files
- * UHBD related docs:
- *   http://adrik.bchs.uh.edu/uhbd.html
- *   http://adrik.bchs.uh.edu/uhbd/
- *   http://mccammon.ucsd.edu/uhbd.html
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-#include "endianswap.h"
-
-#define LINESIZE 85
-
-typedef struct {
-  FILE *fd;
-  int nsets;
-  molfile_volumetric_t *vol;
-  float scale;  // 0 for ascii files, otherwise signals binary and provides
-                // scale factor for written data.
-  int doswap;   // true if byteswapping needed
-} uhbd_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *uhbdgets(char *s, int n, FILE *stream, const char *msg) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    printf("%s", msg);
-    printf("uhbdplugin) Unexpected end-of-file.\n");
-    return NULL;
-  } else if (ferror(stream)) {
-    printf("%s", msg);
-    printf("uhbdplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      printf("%s", msg);
-      printf("uhbdplugin) Encountered EOF or error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-static void *open_uhbd_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  uhbd_t *uhbd;
-  char inbuf[LINESIZE];
-  int xsize, ysize, zsize;
-  float orig[3], ra, o[3], s[3]; //xdelta[3], ydelta[3], zdelta[3];
-  int headersize = 0; // for binary format
-  int doswap = 0; // true if byteswapping needed
-  float scale=0;    // scale parameter in binary uhbd files
-  
-  if ((fd = fopen(filepath, "rb")) == NULL) {
-    printf("uhbdplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // check if the first part of file is a binary 160, which would indicate
-  // that this is a binary rather than ascii UHBD file.
-  fread(&headersize, sizeof(int), 1, fd);
-  if (headersize == 160) {
-    printf("uhbdplugin) Detected binary .grd file in native endian\n");
-    doswap = 0;
-  } else {
-    swap4_unaligned(&headersize, 1);
-    if (headersize == 160) {
-      printf("uhbdplugin) Detected binary .grd file in opposite endian\n");
-      doswap = 1;
-    } else {
-      headersize = 0;
-    }
-  }
-  if (headersize == 160) {
-    int iparams[8];
-    float fparams[4];
-    // we're doing binary
-    // read in the entire header, plus the trailing header size
-    char buf[164];
-    if (fread(buf, 1, 160, fd) != 160) {
-      fprintf(stderr, "uhbdplugin) Error: incomplete header in .grd file.\n");
-      fclose(fd);
-      return NULL;
-    }
-    // format of header is 72 character title, followed by:
-    // scale dum2 grdflag, idum2 km one km im jm km h ox oy oz
-    // The first two and last four parameters are floats, the rest ints.
-    memcpy(&scale,  buf + 72, sizeof(float));
-    memcpy(iparams, buf + 72 + 8, 32);
-    memcpy(fparams, buf + 72 + 40, 16);
-    if (doswap) {
-      swap4_unaligned(&scale, 1);
-      swap4_unaligned(iparams, 8);
-      swap4_unaligned(fparams, 4);
-    }
-    xsize = iparams[5];
-    ysize = iparams[6];
-    zsize = iparams[7];
-    ra = fparams[0];
-    orig[0] = fparams[1];
-    orig[1] = fparams[2];
-    orig[2] = fparams[3];
-
-  } else {
-    rewind(fd);
-    // Read the header
-    if (uhbdgets(inbuf, LINESIZE, fd, 
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-  
-    /* get grid dimensions, spacing and origin */
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while getting grid dimensions\n") == NULL) {
-      return NULL;
-    }
-    if (sscanf(inbuf, "%d %d %d %e %e %e %e", &xsize, &ysize, &zsize, &ra, orig, orig+1, orig+2)  != 7) {
-      printf("uhbdplugin) Error reading grid dimensions, spacing and origin.\n");
-      return NULL;
-    }
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-    if (uhbdgets(inbuf, LINESIZE, fd,
-        "uhbdplugin) error while skipping header lines\n") == NULL) 
-      return NULL;
-  }
-
-  /* allocate and initialize the uhbd structure */
-  uhbd = new uhbd_t;
-  uhbd->fd = fd;
-  uhbd->vol = NULL;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  uhbd->nsets = 1; /* this file contains only one data set */
-  uhbd->scale = scale; // set by binary files only
-  uhbd->doswap = doswap;
-
-  uhbd->vol = new molfile_volumetric_t[1];
-  strcpy(uhbd->vol[0].dataname, 
-      headersize ? "UHBD binary Electron Density Map"
-                 : "UHBD ascii Electron Density Map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    uhbd->vol[0].origin[i] = orig[i] + ra;
-    o[i] = uhbd->vol[0].origin[i];
-  }
-
-  uhbd->vol[0].xaxis[0] = ra * (xsize-1);
-  uhbd->vol[0].xaxis[1] = 0;
-  uhbd->vol[0].xaxis[2] = 0;
-
-  uhbd->vol[0].yaxis[0] = 0;
-  uhbd->vol[0].yaxis[1] = ra * (ysize-1);
-  uhbd->vol[0].yaxis[2] = 0;
-
-  uhbd->vol[0].zaxis[0] = 0;
-  uhbd->vol[0].zaxis[1] = 0;
-  uhbd->vol[0].zaxis[2] = ra * (zsize-1);
-
-  s[0] = uhbd->vol[0].xaxis[0];
-  s[1] = uhbd->vol[0].yaxis[1];
-  s[2] = uhbd->vol[0].zaxis[2];
-
-  uhbd->vol[0].xsize = xsize;
-  uhbd->vol[0].ysize = ysize;
-  uhbd->vol[0].zsize = zsize;
-
-  /* UHBD files contain no color information. */
-  uhbd->vol[0].has_color = 0;
-
-  return uhbd;
-}
-
-static int read_uhbd_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  uhbd_t *uhbd = (uhbd_t *)v;
-  *nsets = uhbd->nsets; 
-  *metadata = uhbd->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_uhbd_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  uhbd_t *uhbd = (uhbd_t *)v;
-  FILE *fd = uhbd->fd;
-  char inbuf[LINESIZE];
-  float grid[6];
-  int z, xsize, ysize, zsize, xysize, count, count2, total, i;
-
-  xsize = uhbd->vol[0].xsize;
-  ysize = uhbd->vol[0].ysize;
-  zsize = uhbd->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  if (uhbd->scale) {
-    int headerblock[6];
-    // The binary data is written one z-slice at a time.  First, a 
-    // block of three ints indicating which slice is next, of the form
-    // kk, im, jm, where kk is the on-based slice index, and im and jm
-    // are the x and y dimensions.  We just read past them and also read the
-    // start of the next block, which is the actual data.
-    for (z=0; z<zsize; z++) {
-      if (fread(headerblock, sizeof(int), 6, fd) != 6) {
-        fprintf(stderr, "uhbdplugin) Error reading header block in binary uhbd file\n");
-        return MOLFILE_ERROR;
-      }
-      // TODO: some sanity checks on the header block.
-      if (fread(datablock + z*xysize, sizeof(float), xysize, fd) != xysize) {
-        fprintf(stderr, "uhbdplugin) Error reading data block in binary uhbd file\n");
-        return MOLFILE_ERROR;
-      }
-      // read the trailing block delimiter
-      fseek(fd, 4, SEEK_CUR);
-    }
-    if (uhbd->doswap) {
-      swap4_aligned(datablock, total);
-    }
-    return MOLFILE_SUCCESS;
-  }
-
-  /* Read the values from the file */
-  for (z = 0; z < zsize; z++) {
-    // read header
-    if (uhbdgets(inbuf, LINESIZE, fd, 
-        "uhbdplugin) error while getting density plane indices\n") == NULL)
-      return MOLFILE_ERROR;
-
-    // read data
-    for (count = 0; count < xysize/6; count++) {
-      if (uhbdgets(inbuf, LINESIZE, fd,
-          "uhbdplugin) error while getting density values\n") == NULL)
-        return MOLFILE_ERROR;
-
-      if (sscanf(inbuf, "%e %e %e %e %e %e", &grid[0], &grid[1], &grid[2], &grid[3], &grid[4], &grid[5]) != 6) {
-        printf("uhbdplugin) Error reading grid data.\n");
-        return MOLFILE_ERROR;
-      }
-    
-      for (i = 0; i < 6; i++) { 
-        datablock[i + count*6 + z*xysize] = grid[i];
-      }
-    }
-
-    if ((xysize%6) != 0) {
-      if (uhbdgets(inbuf, LINESIZE, fd, 
-          "uhbdplugin) error reading data elements modulo 6\n") == NULL)
-        return MOLFILE_ERROR;
-
-      count2 = sscanf(inbuf, "%e %e %e %e %e %e", &grid[0], &grid[1], &grid[2], &grid[3], &grid[4], &grid[5]);
-      if (count2 != (xysize%6)) {
-        printf("uhbdplugin) Error: incorrect number of data points.\n");
-        return MOLFILE_ERROR;
-      }
-
-      for (i = 0; i < count2; i++) {
-        datablock[i + (count+1)*6 + z*xysize] = grid[i];
-      }
-    }
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_uhbd_read(void *v) {
-  uhbd_t *uhbd = (uhbd_t *)v;
-  
-  fclose(uhbd->fd);
-  if (uhbd->vol != NULL)
-    delete [] uhbd->vol; 
-  delete uhbd;
-}
-
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "uhbd";
-  plugin.prettyname = "UHBD Grid";
-  plugin.author = "Alexander Spaar, Justin Gullingsrud";
-  plugin.majorv = 0;
-  plugin.minorv = 5;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "uhbdgrd,grd";
-  plugin.open_file_read = open_uhbd_read;
-  plugin.read_volumetric_metadata = read_uhbd_metadata;
-  plugin.read_volumetric_data = read_uhbd_data;
-  plugin.close_file_read = close_uhbd_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/unit_conversion.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/unit_conversion.h
deleted file mode 100644
index 953fe7ce7b0d82d85194a5b2f9fd531ddb91d1ab..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/unit_conversion.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: unit_conversion.h,v $
- *      $Author: akohlmey $       $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $       $Date: 2009/06/26 01:13:39 $
- *
- ***************************************************************************/
-/******************************************************************
- * 
- * unit conversion factors.
- *  
- ******************************************************************/
-
-
-#ifndef UNIT_CONVERSION_H
-#define UNIT_CONVERSION_H
-
-/* 
- * units according to CODATA 2006 
- * Version 5.1, http://physics.nist.gov/constants
- */
-/* convert Bohr to Angstrom */
-#define BOHR_TO_ANGS 0.529177210859
-#define ANGS_TO_BOHR 1.88972612478289694072
-
-
-/* convert Hartree into kcal/mol */
-#define HARTREE_TO_KCAL 627.5094706142
-
-/* convert Hartree into eV */
-#define HARTREE_TO_EV    27.211383860484776
-
-#endif /* UNIT_CONVERSION */
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vasp5xdatcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vasp5xdatcarplugin.c
deleted file mode 100644
index 60865b98771b8257dd03db7ac0a4899a2c110f84..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vasp5xdatcarplugin.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vasp5xdatcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.3 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -fPIC -I. -I$VMDBASEDIR/plugins/include -c vasp5xdatcarplugin.c
- *  ld -shared -o vasp5xdatcarplugin.so vasp5xdatcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vasp5xdatcarplugin.c
- *  c++ -bundle -o vasp5xdatcarplugin.so vasp5xdatcarplugin.o
- *
- *  Install
- *  copy vasp5xdatcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vasp5xdatcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP5 is assumed in default */
-  data->version = 5;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Ignore rest of header up to the line with atom numbers */
-  for (i = 0; i < 5; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  /* Read title line */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Read the number of atoms per atom type */
-  data->numatoms = 0;
-  fgets(lineptr, LINESIZE, data->file);
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-    
-    if (n <= 0) break;
-    
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP5 XDATCAR read) ERROR: file '%s' does not have list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vasp5xdatcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar = NULL;
-  int atomcount, i;
-  char lineptr[LINESIZE], potcarfile[1000], *cp;
-  float lc;
- 
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  strcpy(potcarfile, data->filename);
-  cp = strstr(potcarfile, "XDATCAR");
-
-  if (cp) {
-    strcpy(cp, "POTCAR");
-    potcar = fopen(potcarfile, "r");
-  }
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise try the title line instead.
-   */
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    int idx, j;
-    char const *label;
-    float mass, radius;
-
-    if (potcar) {
-       char atomtype[5] = "X";
-       /* Obtain atom types from POTCAR file */
-       if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4[^_. 0-9]", atomtype);
-       idx = get_pte_idx(atomtype);
-       /* Skip lines in potcar file until next element */
-       while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    } else {
-       /* Try to obtain atom types from title line */
-       char const *token = (i == 0 ? strtok(data->titleline, " ") : strtok(NULL, " "));
-       idx = get_pte_idx(token);
-    }
-
-    label = get_pte_label(idx);
-    mass = get_pte_mass(idx);
-    radius = get_pte_vdw_radius(idx);
-    for (j = 0; j < data->eachatom[i]; ++j, ++atomcount) {
-      molfile_atom_t *const atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP5 XDATCAR read) ERROR: file '%s' doesn't seem to have list of atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  for (i = 0; i < 2; ++i) fgets(lineptr, LINESIZE, data->file);
-  sscanf(lineptr, "%f", &lc);
-   fprintf(stderr, "%f\n", lc);
-
-  for (i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-  vasp_buildrotmat(data);
-
- /* Ignore header until X,Y,Z-coordinates */
- for (i = 0; i < 3; ++i) fgets(lineptr, LINESIZE, data->file);
-
- /* Check whether all coordinates are present in the file */
- for (i = 0; i < data->numatoms; ++i) {
-   float coord;
-   fgets(lineptr, LINESIZE, data->file);
-   if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) {
-     fprintf(stderr, "\n\nVASP5 XDATCAR read) ERROR: structure is missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-     return MOLFILE_ERROR;
-   }
- }
-
- rewind(data->file);
-
- /* Ignore header until X,Y,Z-coordinates */
- for (i = 0; i < 8; ++i) fgets(lineptr, LINESIZE, data->file);
-
- return MOLFILE_SUCCESS;
-}
-
-
-static int read_vasp5xdatcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  int i;
-  char lineptr[LINESIZE];
-  
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  /* Save coords only if we're given a timestep pointer,
-   * otherwise assume that VMD wants us to skip past it.
-   */
-  if (!ts || !data) return MOLFILE_EOF;
-
-  for (i = 0; i < data->numatoms; ++i) {
-    float x, y, z, rotx, roty, rotz;
-    fgets(lineptr, LINESIZE, data->file);
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) {
-      fprintf(stderr, "VASP5 XDATCAR read) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-      return MOLFILE_EOF;
-    }
-
-    rotx = x*data->cell[0][0]+y*data->cell[1][0]+z*data->cell[2][0];
-    roty = x*data->cell[0][1]+y*data->cell[1][1]+z*data->cell[2][1];
-    rotz = x*data->cell[0][2]+y*data->cell[1][2]+z*data->cell[2][2];
-
-    ts->coords[3*i  ] = data->rotmat[0][0]*rotx+data->rotmat[0][1]*roty+data->rotmat[0][2]*rotz;
-    ts->coords[3*i+1] = data->rotmat[1][0]*rotx+data->rotmat[1][1]*roty+data->rotmat[1][2]*rotz;
-    ts->coords[3*i+2] = data->rotmat[2][0]*rotx+data->rotmat[2][1]*roty+data->rotmat[2][2]*rotz;
-  }
-
-  vasp_timestep_unitcell(ts, data);
-
-  /* VMD keeps calling for a next timestep, until we reach End-Of-File here */
-  if (fgets(lineptr, LINESIZE, data->file) == NULL) return MOLFILE_EOF;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vasp5xdatcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "VASP_XDATCAR5";
-  plugin.prettyname = "VASP_XDATCAR5";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "VASP_XDATCAR5";
-  plugin.open_file_read = open_vasp5xdatcar_read;
-  plugin.read_structure = read_vasp5xdatcar_structure;
-  plugin.read_next_timestep = read_vasp5xdatcar_timestep;
-  plugin.close_file_read = close_vasp5xdatcar_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspchgcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspchgcarplugin.c
deleted file mode 100644
index e656ca88a70f92c8ec8398ac9f552025bd3f94bf..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspchgcarplugin.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspchgcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.13 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspchgcarplugin.c
- *  ld -shared -o vaspchgcarplugin.so vaspchgcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspchgcarplugin.c
- *  c++ -bundle -o vaspchgcarplugin.so vaspchgcarplugin.o
- *
- *  Install
- *  copy vaspchgcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-
-
-static void *open_vaspchgcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  float lc;
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Read system title */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Read lattice constant */
-  fgets(lineptr, LINESIZE, data->file);
-  lc = atof(strtok(lineptr, " "));
-
-  /* Read unit cell lattice vectors and multiply by lattice constant */
-  for(i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-
-  /* Build rotation matrix */
-  vasp_buildrotmat(data);
-
-  /* Count number of atoms */
-  fgets(lineptr, LINESIZE, data->file);
-  data->numatoms = 0;
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, data->file);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: file '%s' does not contain list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  /* Skip lines up to the grid numbers */
-  for (i = 0; i < data->numatoms + 2; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-
-static int read_vaspchgcar_metadata(void *mydata, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int gridx, gridy, gridz, i;
-  char const spintext[4][20] = { "spin up+down", "spin up-down", "spin up", "spin down" };
-
-  /* Verify that input is OK */
-  if (!data || !nvolsets || !metadata) return MOLFILE_ERROR;
-
-  /* Read the grid size */
-  fgets(lineptr, LINESIZE, data->file);
-  if (3 != sscanf(lineptr, "%d %d %d", &gridx, &gridy, &gridz)) {
-     fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: file '%s' does not contain grid dimensions.\n", data->filename);
-     return MOLFILE_ERROR;
-  }
-
-  fprintf(stderr, "\n\nVASP CHGCAR read) found grid data block...\n");
-
-  /* Initialize the volume set list with 4 entries:
-   * spin up+down : always present
-   * spin up-down / spin up /spin down : only there for spin-polarized calculations
-   *                (the latter remain empty for non-spin-polarized calculations)
-   */
-  data->nvolsets = 4;
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-     fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: Cannot allocate space for volume data.\n");
-     return MOLFILE_ERROR;
-  }
-
-  for (i = 0; i < data->nvolsets; ++i) {
-    molfile_volumetric_t *const set = &(data->vol[i]); /* get a handle to the current volume set meta data */
-    int k;
-
-    set->has_color = 0;
-
-    /* put volume data name */
-    sprintf(set->dataname, "Charge density (%s)", spintext[i]);
-
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-    set->xsize = gridx + 1;
-    set->ysize = gridy + 1;
-    set->zsize = gridz + 1;
-
-    /* Rotate unit cell vectors */
-    for (k = 0; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->cell[0][0]
-		+ data->rotmat[k][1] * data->cell[0][1]
-		+ data->rotmat[k][2] * data->cell[0][2];
-      
-      set->yaxis[k] = data->rotmat[k][0] * data->cell[1][0] 
-		+ data->rotmat[k][1] * data->cell[1][1]
-		+ data->rotmat[k][2] * data->cell[1][2];
-      
-      set->zaxis[k] = data->rotmat[k][0] * data->cell[2][0] 
-		+ data->rotmat[k][1] * data->cell[2][1]
-		+ data->rotmat[k][2] * data->cell[2][2];
-    }
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_vaspchgcar_data(void *mydata, int set, float *datablock, float *colorblock)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int chargedensity, error, iset, n;
-  float volume;
-
-  /* Verify that input is OK */
-  if (!data || !datablock) return MOLFILE_ERROR;
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  if (strstr(data->filename, "LOCPOT") == NULL && strstr(data->filename, "ELFCAR") == NULL) {
-    chargedensity = 1;
-    fprintf(stderr, "\nVASP CHGCAR read) Charge density is assumed. Each value will be divided by unit cell volume.\n");
-  } else {
-    if (set == 1) {
-      fprintf(stderr, "\n\nVASP CHGCAR read) ERROR: ELF or local potential do not include spin difference information.\n");
-      return MOLFILE_ERROR;
-    }
-    chargedensity = 0;
-    fprintf(stderr, "\nVASP CHGCAR read) ELF or local potential is assumed.\n");
-  }
-
-  volume = fabs(
-            data->cell[0][0]*(data->cell[1][1]*data->cell[2][2]-data->cell[1][2]*data->cell[2][1])
-	  + data->cell[0][1]*(data->cell[1][2]*data->cell[2][0]-data->cell[1][0]*data->cell[2][2])
-	  + data->cell[0][2]*(data->cell[1][0]*data->cell[2][1]-data->cell[2][0]*data->cell[1][1])
-               );
-
-  /* Set file pointer to beginning of file and then skip header up to density data */
-  rewind(data->file);
-  for (n = 0; n < data->numatoms + data->version + 5; ++n) fgets(lineptr, LINESIZE, data->file);
-
-  for(error = iset = 0; iset <= set && iset < 2 && !error; ++iset) {
-    char const *dataname = data->vol[iset].dataname;
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-    int const numberOfDatapoints = (xsize - 1) * (ysize - 1) * (zsize - 1);
-    int ix, iy, iz;
-
-    fprintf(stderr, "\nVASP CHGCAR read) Patience! Reading volume set %d (%d points): %s\n", iset + 1, numberOfDatapoints, dataname);
-
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          float value;
-	  if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else {
-	    if (1 != fscanf(data->file, "%f", &value)) return MOLFILE_ERROR;
-	    if (chargedensity) value /= volume;
-	  }
-
-	  /* for set == 2: spin-up   = 0.5 * set0 + 0.5 * set1
-	   * for set == 3: spin-down = 0.5 * set0 - 0.5 * set1 */
-	  if (iset == set) datablock[n] = value;
-	  else if (set >= 2 && iset == 0) datablock[n] = 0.5 * value;
-	  else if (set == 2 && iset == 1) datablock[n] += 0.5 * value;
-	  else if (set == 3 && iset == 1) datablock[n] -= 0.5 * value;
-        }
-      }
-    }
-
-    /* Skip paw-augmentation part 
-     * augmentation parts are found only in CHGCAR not in PARCHG
-     * I have no good idea for that */
-    for (iy = 0; iy < data->numatoms; ++iy) {
-      int numaug;
-      if (1 != fscanf(data->file, "%*s %*s %*d %d", &numaug)) error = 1;
-      
-      for (ix = 0; ix < numaug && !error; ++ix) {
-	float val;
-	if (1 != fscanf(data->file, "%f", &val)) error = 2;
-      }
-      fgets(lineptr, LINESIZE, data->file);
-    }
-
-    /* After the charge density data there are floating numbers (times of atoms)
-     * and a line with three grid integers, all of which should be skipped. */
-    if(iset==0){
-      for (iy = 0; iy < data->numatoms; ++iy) {
-	float val;
-	if (1 != fscanf(data->file, "%f", &val)) error = 2;
-      }
-      for (iy = 0; iy < 3; ++iy) {
-	int ival;
-	if (1 != fscanf(data->file, "%d", &ival)) error = 2;
-      }
-    }
-
-    fprintf(stderr, "\nVASP CHGCAR read) %s finished.\n", dataname);
-  }
-
-  if (error) fprintf(stderr, "\nVASP CHGCAR read) PAW-augmentation part is incomplete, but it is ignored anyway.\n");
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspchgcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "CHGCAR";
-  plugin.prettyname = "VASP_CHGCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "CHGCAR";
-  plugin.open_file_read = open_vaspchgcar_read;
-  plugin.close_file_read = close_vaspchgcar_read;
-  plugin.read_volumetric_metadata = read_vaspchgcar_metadata;
-  plugin.read_volumetric_data = read_vaspchgcar_data;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspoutcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspoutcarplugin.c
deleted file mode 100644
index ea4a7d9604c63a5bcf952c9b6b076dc70fb9c953..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspoutcarplugin.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspoutcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspoutcarplugin.c
- *  ld -shared -o vaspoutcarplugin.so vaspoutcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspoutcarplugin.c
- *  c++ -bundle -o vaspoutcarplugin.so vaspoutcarplugin.o
- *
- *  Install
- *  copy vaspoutcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspoutcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-  
-  data->filename = strdup(filename);
-
-  /* Catch total number of atoms */
-  data->numatoms = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && data->numatoms == 0) {
-   if (strstr(lineptr, "NIONS =") != NULL) {
-      sscanf(lineptr, " %*[ a-zA-Z] = %*d %*[ a-zA-Z] = %d", &data->numatoms);
-      break;
-    }
-  }
-
-  if (data->numatoms <= 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does not contain the number of atoms.\n", filename);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-
-  /* Catch the lattice vectors */
-  while (fgets(lineptr, LINESIZE, data->file)) {
-     if (strstr(lineptr, "direct lattice vectors") != NULL) {
-       int i;
-       for (i = 0; i < 3; ++i) {
-	 fgets(lineptr, LINESIZE, data->file);
-	 if (3 != sscanf(lineptr, "%f %f %f", &data->cell[i][0], &data->cell[i][1], &data->cell[i][2])) {
-           vasp_plugindata_free(data);
-           fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does not contain lattice vectors.\n", filename);
-           return NULL;
-	 }
-       }
-       break;
-     }
-  }
-  vasp_buildrotmat(data);
-
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vaspoutcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar;
-  char lineptr[LINESIZE], potcarfile[1000];
-  float atommass[MAXATOMTYPES];
-  int atomcount, typecount, i;
-
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS;
-
-  typecount = 0;
-  atomcount = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && atomcount < data->numatoms) {
-    if (strstr(lineptr, "POMASS") != NULL) sscanf(lineptr, " POMASS = %f;", &atommass[typecount++]);
-
-    if (strstr(lineptr, "ions per type =") != NULL) {
-      char const *token = strtok(lineptr, "=");
-      for (i = 0; i < typecount; ++i) {
-        token = strtok(NULL, " ");
-        atomcount += data->eachatom[i] = atoi(token);
-      }
-    }
-  }
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does not have number of each atom.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise try to find similar mass in periodic table.
-   */
-  if (strstr(potcarfile, "OUTCAR")) {
-    strcpy(potcarfile, data->filename);
-    strcpy(strstr(potcarfile, "OUTCAR"), "POTCAR");
-    potcar = fopen(potcarfile, "r");
-  } else {
-    potcar = NULL;
-  }
-
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    char const *label;
-    float mass, radius;
-    int k, idx = 0;
-
-    if (potcar) {
-      /* Obtain atom types from POTCAR file */
-      char atomtype[5] = "X";
-      if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4[^_. 0-9]", atomtype);
-      idx = get_pte_idx(atomtype);
-
-      /* Skip lines in potcar file until next element */
-      while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    }
-    
-    if (idx == 0) {
-        /* Try to find atom type by browsing through periodic table */
-        idx = sizeof(pte_mass)/sizeof(pte_mass[0]);
-	do idx--;
-	while (idx > 0 && fabs(get_pte_mass(idx) - atommass[i]) > 0.01);
-    }
-
-    label = get_pte_label(idx);
-    mass = (idx ? get_pte_mass(idx) : atommass[i]);
-    radius = get_pte_vdw_radius(idx);
-    for (k = 0; k < data->eachatom[i]; ++k, ++atomcount) {
-      molfile_atom_t *atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does contain list of atom names.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  atomcount = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && atomcount == 0) {
-    if (strstr(lineptr, "position of ions in cartesian coordinates") != NULL) {
-      for (i = 0; i < data->numatoms; ++i, ++atomcount) {
-	float coord;
-        fgets(lineptr, LINESIZE, data->file);
-        if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) {
-	  fprintf(stderr, "\n\nVASP OUTCAR read) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-	  return MOLFILE_ERROR;
-	}
-      }
-    }
-  }
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP OUTCAR read) ERROR: file '%s' does contain list of atom names.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
- 
-  rewind(data->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspoutcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int atomcount;
-
-  /* Save coords only if we're given a timestep pointer,
-   * otherwise assume that VMD wants us to skip past it.
-   */
-  if (!data || !ts) return MOLFILE_EOF;
-
-  atomcount = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && atomcount == 0) {
-    if (strstr(lineptr, "TOTAL-FORCE") != NULL) {
-      int i;
-      fgets(lineptr, LINESIZE, data->file);
-      for (i = 0; i < data->numatoms; ++i, ++atomcount) {
-	float x, y, z;
-	fgets(lineptr, LINESIZE, data->file);
-	if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) return MOLFILE_EOF;
-      
-	ts->coords[3*i  ] = data->rotmat[0][0]*x+data->rotmat[0][1]*y+data->rotmat[0][2]*z;
-	ts->coords[3*i+1] = data->rotmat[1][0]*x+data->rotmat[1][1]*y+data->rotmat[1][2]*z;
-	ts->coords[3*i+2] = data->rotmat[2][0]*x+data->rotmat[2][1]*y+data->rotmat[2][2]*z;
-      }
-    }
-  }
-  if (atomcount != data->numatoms) return MOLFILE_EOF;
-
-  vasp_timestep_unitcell(ts, data);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspoutcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "OUTCAR";
-  plugin.prettyname = "VASP_OUTCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "OUTCAR";
-  plugin.open_file_read = open_vaspoutcar_read;
-  plugin.read_structure = read_vaspoutcar_structure;
-  plugin.read_next_timestep = read_vaspoutcar_timestep;
-  plugin.close_file_read = close_vaspoutcar_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspparchgplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspparchgplugin.c
deleted file mode 100644
index f8b061ccc43ba7f5bdd4d36c904b2827f09429ac..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspparchgplugin.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspparchgplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.2 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspparchgplugin.c
- *  ld -shared -o vaspparchgplugin.so vaspparchgplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspparchgplugin.c
- *  c++ -bundle -o vaspparchgplugin.so vaspparchgplugin.o
- *
- *  Install
- *  copy vaspparchgplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-
-
-static void *open_vaspparchg_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  float lc;
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Read system title */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Read lattice constant */
-  fgets(lineptr, LINESIZE, data->file);
-  lc = atof(strtok(lineptr, " "));
-
-  /* Read unit cell lattice vectors and multiply by lattice constant */
-  for(i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-
-  /* Build rotation matrix */
-  vasp_buildrotmat(data);
-
-  /* Count number of atoms */
-  fgets(lineptr, LINESIZE, data->file);
-  data->numatoms = 0;
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, data->file);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP PARCHG read) ERROR: file '%s' does not contain list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  /* Skip lines up to the grid numbers */
-  for (i = 0; i < data->numatoms + 2; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-
-static int read_vaspparchg_metadata(void *mydata, int *nvolsets, molfile_volumetric_t **metadata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int gridx, gridy, gridz, i;
-  char const spintext[4][20] = { "spin up+down", "spin up-down", "spin up", "spin down" };
-
-  /* Verify that input is OK */
-  if (!data || !nvolsets || !metadata) return MOLFILE_ERROR;
-
-  /* Read the grid size */
-  fgets(lineptr, LINESIZE, data->file);
-  if (3 != sscanf(lineptr, "%d %d %d", &gridx, &gridy, &gridz)) {
-     fprintf(stderr, "\n\nVASP PARCHG read) ERROR: file '%s' does not contain grid dimensions.\n", data->filename);
-     return MOLFILE_ERROR;
-  }
-
-  fprintf(stderr, "\n\nVASP PARCHG read) found grid data block...\n");
-
-  /* Initialize the volume set list with 4 entries:
-   * spin up+down : always present
-   * spin up-down / spin up /spin down : only there for spin-polarized calculations
-   *                (the latter remain empty for non-spin-polarized calculations)
-   */
-  data->nvolsets = 4;
-  data->vol = (molfile_volumetric_t *)malloc(data->nvolsets * sizeof(molfile_volumetric_t));
-  if (!data->vol) {
-     fprintf(stderr, "\n\nVASP PARCHG read) ERROR: Cannot allocate space for volume data.\n");
-     return MOLFILE_ERROR;
-  }
-
-  for (i = 0; i < data->nvolsets; ++i) {
-    molfile_volumetric_t *const set = &(data->vol[i]); /* get a handle to the current volume set meta data */
-    int k;
-
-    set->has_color = 0;
-
-    /* put volume data name */
-    sprintf(set->dataname, "Charge density (%s)", spintext[i]);
-
-    set->origin[0] = set->origin[1] = set->origin[2] = 0;
-    set->xsize = gridx + 1;
-    set->ysize = gridy + 1;
-    set->zsize = gridz + 1;
-
-    /* Rotate unit cell vectors */
-    for (k = 0; k < 3; ++k) {
-      set->xaxis[k] = data->rotmat[k][0] * data->cell[0][0]
-		+ data->rotmat[k][1] * data->cell[0][1]
-		+ data->rotmat[k][2] * data->cell[0][2];
-      
-      set->yaxis[k] = data->rotmat[k][0] * data->cell[1][0] 
-		+ data->rotmat[k][1] * data->cell[1][1]
-		+ data->rotmat[k][2] * data->cell[1][2];
-      
-      set->zaxis[k] = data->rotmat[k][0] * data->cell[2][0] 
-		+ data->rotmat[k][1] * data->cell[2][1]
-		+ data->rotmat[k][2] * data->cell[2][2];
-    }
-  }
-
-  *nvolsets = data->nvolsets;
-  *metadata = data->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspparchg_data(void *mydata, int set, float *datablock, float *colorblock)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int chargedensity, error, iset, n;
-  float volume;
-
-  /* Verify that input is OK */
-  if (!data || !datablock) return MOLFILE_ERROR;
-  if (set >= data->nvolsets) return MOLFILE_ERROR;
-
-  if (strstr(data->filename, "LOCPOT") == NULL && strstr(data->filename, "ELFCAR") == NULL) {
-    chargedensity = 1;
-    fprintf(stderr, "\nVASP PARCHG read) Charge density is assumed. Each value will be divided by unit cell volume.\n");
-  } else {
-    if (set == 1) {
-      fprintf(stderr, "\n\nVASP PARCHG read) ERROR: ELF or local potential do not include spin difference information.\n");
-      return MOLFILE_ERROR;
-    }
-    chargedensity = 0;
-    fprintf(stderr, "\nVASP PARCHG read) ELF or local potential is assumed.\n");
-  }
-
-  volume = fabs(
-            data->cell[0][0]*(data->cell[1][1]*data->cell[2][2]-data->cell[1][2]*data->cell[2][1])
-	  + data->cell[0][1]*(data->cell[1][2]*data->cell[2][0]-data->cell[1][0]*data->cell[2][2])
-	  + data->cell[0][2]*(data->cell[1][0]*data->cell[2][1]-data->cell[2][0]*data->cell[1][1])
-               );
-
-  /* Set file pointer to beginning of file and then skip header up to density data */
-  rewind(data->file);
-  for (n = 0; n < data->numatoms + data->version + 5; ++n) fgets(lineptr, LINESIZE, data->file);
-
-  for(error = iset = 0; iset <= set && iset < 2 && !error; ++iset) {
-    char const *dataname = data->vol[iset].dataname;
-    int const xsize = data->vol[iset].xsize; 
-    int const ysize = data->vol[iset].ysize;
-    int const zsize = data->vol[iset].zsize;
-    int const numberOfDatapoints = (xsize - 1) * (ysize - 1) * (zsize - 1);
-    int ix, iy, iz;
-
-    fprintf(stderr, "\nVASP PARCHG read) Patience! Reading volume set %d (%d points): %s\n", iset + 1, numberOfDatapoints, dataname);
-
-    for (n = iz = 0; iz < zsize; ++iz) {
-      for (iy = 0; iy < ysize; ++iy) {
-        for (ix = 0; ix < xsize; ++ix, ++n) {
-          float value;
-	  if (ix == xsize - 1) value = datablock[n - ix];
-	  else if (iy == ysize - 1) value = datablock[n - iy*xsize];
-	  else if (iz == zsize - 1) value = datablock[n - iz*ysize*xsize];
-	  else {
-	    if (1 != fscanf(data->file, "%f", &value)) return MOLFILE_ERROR;
-	    if (chargedensity) value /= volume;
-	  }
-
-	  /* for set == 2: spin-up   = 0.5 * set0 + 0.5 * set1
-	   * for set == 3: spin-down = 0.5 * set0 - 0.5 * set1 */
-	  if (iset == set) datablock[n] = value;
-	  else if (set >= 2 && iset == 0) datablock[n] = 0.5 * value;
-	  else if (set == 2 && iset == 1) datablock[n] += 0.5 * value;
-	  else if (set == 3 && iset == 1) datablock[n] -= 0.5 * value;
-        }
-      }
-    }
-
-    if(iset == 0){
-      for (iy = 0; iy < 3; ++iy) {
-	int ival;
-	if (1 != fscanf(data->file, "%d", &ival)) error = 2;
-      }
-    }
-
-    fprintf(stderr, "\nVASP PARCHG read) %s finished.\n", dataname);
-  }
-
-  if (error) fprintf(stderr, "\nVASP PARCHG read) PAW-augmentation part is incomplete, but it is ignored anyway.\n");
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspparchg_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "PARCHG";
-  plugin.prettyname = "VASP_PARCHG";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "PARCHG";
-  plugin.open_file_read = open_vaspparchg_read;
-  plugin.close_file_read = close_vaspparchg_read;
-  plugin.read_volumetric_metadata = read_vaspparchg_metadata;
-  plugin.read_volumetric_data = read_vaspparchg_data;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini(void) {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspplugin.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspplugin.h
deleted file mode 100644
index eaa1aa2ee1a2b4f04225216389d078091dc208a1..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspplugin.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspplugin.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.5 $       $Date: 2009/06/22 19:45:49 $
- *
- ***************************************************************************/
-
-
-#ifndef _VASPPLUGIN_H_
-#define _VASPPLUGIN_H_
-
-#include <stdio.h>
-#include <math.h>
-#include "molfile_plugin.h"
-
-#define LINESIZE 1024
-#define MAXATOMTYPES 100
-
-#ifndef M_PI
-#define M_PI           3.14159265358979323846
-#endif
-
-typedef struct {
-  FILE *file;
-  char *filename;
-  char *titleline;              /* Comment line provides system information */
-  int version;                  /* VASP version control */
-  int numatoms;                 /* total number of atoms */
-  int eachatom[MAXATOMTYPES];   /* number of atoms per atom type */
-  molfile_atom_t *atomlist;
-
-  float cell[3][3];             /* lattice vectors of the unit cell */
-  float rotmat[3][3];           /* rotation matrix, stored for periodic display hack */
-
-  /* volumetric variables for charge density data */
-  int nvolsets;                 /* number of volumetric datasets */
-  molfile_volumetric_t *vol;    /* volume set metadata */
-} vasp_plugindata_t;
-
-
-/* allocate memory for plugin data and NULLify the pointers */
-static vasp_plugindata_t *vasp_plugindata_malloc()
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)malloc(sizeof(vasp_plugindata_t));
-
-  if (!data) {
-    fprintf(stderr, "\n\nVASP plugin) ERROR: cannot allocate memory for plugin data.\n");
-    return NULL;
-  }
-
-  data->file = NULL;
-  data->filename = NULL;
-  data->titleline = NULL;
-  data->atomlist = NULL;
-  data->vol = NULL;
-
-  return data;
-}
-
-
-/* free up the plugin data */
-static void vasp_plugindata_free(vasp_plugindata_t *data)
-{
-  if (!data) return;
-
-  if (data->file) fclose(data->file);
-  if (data->filename) free(data->filename);
-  if (data->titleline) free(data->titleline);
-  if (data->atomlist) free(data->atomlist);
-  if (data->vol) free(data->vol);
-  free(data);
-  data = NULL;
-}
-
-
-/* calculate and store rotation matrix to realign everything later. */
-static void vasp_buildrotmat(vasp_plugindata_t *data)
-{
-  float const *const a = data->cell[0];
-  float const *const b = data->cell[1];
-
-  /* rotate first around y and z to align a along the x-axis... */
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  /* ...then rotate around x to put b into the xy-plane. */
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  data->rotmat[0][0] =  cph*cth;
-  data->rotmat[0][1] =  cph*sth;
-  data->rotmat[0][2] =  sph;
-  data->rotmat[1][0] = -sth*cps - sph*cth*sps;
-  data->rotmat[1][1] =  cth*cps - sph*sth*sps;
-  data->rotmat[1][2] =  cph*sps; 
-  data->rotmat[2][0] =  sth*sps - sph*cth*cps;
-  data->rotmat[2][1] = -cth*sps - sph*sth*cps; 
-  data->rotmat[2][2] =  cph*cps;
-}
-
-
-static void vasp_timestep_unitcell(molfile_timestep_t *ts, vasp_plugindata_t *data)
-{
-  if (!ts || !data) return;
-
-  ts->A = sqrt(data->cell[0][0]*data->cell[0][0]+data->cell[0][1]*data->cell[0][1]+data->cell[0][2]*data->cell[0][2]);
-  ts->B = sqrt(data->cell[1][0]*data->cell[1][0]+data->cell[1][1]*data->cell[1][1]+data->cell[1][2]*data->cell[1][2]);
-  ts->C = sqrt(data->cell[2][0]*data->cell[2][0]+data->cell[2][1]*data->cell[2][1]+data->cell[2][2]*data->cell[2][2]);
-
-  ts->gamma = acos((data->cell[0][0]*data->cell[1][0]+data->cell[0][1]*data->cell[1][1]+data->cell[0][2]*data->cell[1][2])/(ts->A*ts->B))*180.0/M_PI;
-  ts->beta  = acos((data->cell[0][0]*data->cell[2][0]+data->cell[0][1]*data->cell[2][1]+data->cell[0][2]*data->cell[2][2])/(ts->A*ts->C))*180.0/M_PI;
-  ts->alpha = acos((data->cell[1][0]*data->cell[2][0]+data->cell[1][1]*data->cell[2][1]+data->cell[1][2]*data->cell[2][2])/(ts->B*ts->C))*180.0/M_PI;
-}
-
-#endif /* _VASPPLUGIN_H_ */
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspposcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspposcarplugin.c
deleted file mode 100644
index e501942ab784b5aefe014e6566cbf67b482c750c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspposcarplugin.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspposcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $       $Date: 2014/10/10 14:41:01 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspposcarplugin.c
- *  ld -shared -o vaspposcarplugin.so vaspposcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspposcarplugin.c
- *  c++ -bundle -o vaspposcarplugin.so vaspposcarplugin.o
- *
- *  Install
- *  copy vaspposcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspposcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  int i;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Read title line */
-  fgets(lineptr, LINESIZE, data->file);
-  data->titleline = strdup(lineptr);
-
-  /* Ignore rest of header up to the line with atom numbers */
-  for (i = 0; i < 5; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  /* Read the number of atoms per atom type */
-  data->numatoms = 0;
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, data->file);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP POSCAR read) ERROR: file '%s' does not have list of atom numbers.\n", filename);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vaspposcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar = NULL;
-  int atomcount, i;
-  char lineptr[LINESIZE], potcarfile[1000], *cp;
- 
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  /* This plugin can read both POSCAR and CONTCAR files */
-  strcpy(potcarfile, data->filename);
-  cp = strstr(potcarfile, "POSCAR");
-  if (!cp) cp = strstr(potcarfile, "CONTCAR");
-
-  if (cp) {
-    strcpy(cp, "POTCAR");
-    potcar = fopen(potcarfile, "r");
-  }
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise try the title line instead.
-   */
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    int idx, j;
-    char const *label;
-    float mass, radius;
-
-    if (potcar) {
-       char atomtype[5] = "X";
-       /* Obtain atom types from POTCAR file */
-       if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4[^_. 0-9]", atomtype);
-       idx = get_pte_idx(atomtype);
-       /* Skip lines in potcar file until next element */
-       while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    } else {
-       /* Try to obtain atom types from title line */
-       char const *token = (i == 0 ? strtok(data->titleline, " ") : strtok(NULL, " "));
-       idx = get_pte_idx(token);
-    }
-
-    label = get_pte_label(idx);
-    mass = get_pte_mass(idx);
-    radius = get_pte_vdw_radius(idx);
-    for (j = 0; j < data->eachatom[i]; ++j, ++atomcount) {
-      molfile_atom_t *const atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP POSCAR read) ERROR: file '%s' doesn't seem to have list of atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
- /* Ignore header until X,Y,Z-coordinates */
- for (i = 0; i < data->version + 3; ++i) fgets(lineptr, LINESIZE, data->file);
-
- /* Ignore selective tag-line, starting with either 's' or 'S'. */
- if (tolower(lineptr[0]) == 's') fgets(lineptr, LINESIZE, data->file);
-
- /* Check whether all coordinates are present in the file */
- for (i = 0; i < data->numatoms; ++i) {
-   float coord;
-   fgets(lineptr, LINESIZE, data->file);
-   if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) {
-     fprintf(stderr, "\n\nVASP POSCAR read) ERROR: structure is missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-     return MOLFILE_ERROR;
-   }
- }
-
- rewind(data->file);
-
- return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspposcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  int i, direct;
-  char lineptr[LINESIZE];
-  float lc;
-  
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  /* Save coords only if we're given a timestep pointer,
-   * otherwise assume that VMD wants us to skip past it.
-   */
-  if (!ts || !data) return MOLFILE_EOF;
-
-  /* VMD keeps calling for a next timestep, until we reach End-Of-File here */
-  if (fgets(lineptr, LINESIZE, data->file) == NULL) return MOLFILE_EOF;
-
-  fgets(lineptr, LINESIZE, data->file);
-  sscanf(lineptr, "%f", &lc);
-
-  for (i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, data->file);
-    sscanf(lineptr, "%f %f %f", &x, &y, &z);
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-  vasp_buildrotmat(data);
-
-  /* Skip numbers of atom types */
-  for (i = 0; i < data->version - 2; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  /* Skip selective tag-line, starting with 's' or 'S'. */
-  if (tolower(lineptr[0]) == 's') fgets(lineptr, LINESIZE, data->file);
-
-  /* Detect direct coordinates tag, starting with 'd' or 'D'. */
-  direct = (tolower(lineptr[0]) == 'd' ? 1 : 0);
-
-  for (i = 0; i < data->numatoms; ++i) {
-    float x, y, z, rotx, roty, rotz;
-    fgets(lineptr, LINESIZE, data->file);
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) {
-      fprintf(stderr, "VASP POSCAR read) missing type or coordinate(s) in file '%s' for atom '%d'\n", data->filename, i+1);
-      return MOLFILE_EOF;
-    }
-
-    if (direct) {
-       rotx = x*data->cell[0][0]+y*data->cell[1][0]+z*data->cell[2][0];
-       roty = x*data->cell[0][1]+y*data->cell[1][1]+z*data->cell[2][1];
-       rotz = x*data->cell[0][2]+y*data->cell[1][2]+z*data->cell[2][2];
-    } else {
-       rotx = x*lc;
-       roty = y*lc;
-       rotz = z*lc;
-    }
-    ts->coords[3*i  ] = data->rotmat[0][0]*rotx+data->rotmat[0][1]*roty+data->rotmat[0][2]*rotz;
-    ts->coords[3*i+1] = data->rotmat[1][0]*rotx+data->rotmat[1][1]*roty+data->rotmat[1][2]*rotz;
-    ts->coords[3*i+2] = data->rotmat[2][0]*rotx+data->rotmat[2][1]*roty+data->rotmat[2][2]*rotz;
-  }
-
-  vasp_timestep_unitcell(ts, data);
-
-  /* POSCAR type files have only one single timestep.
-   * Therefore proceed till end of file after reading the coordinates.
-   */
-  fseek(data->file, 0, SEEK_END);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspposcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  vasp_plugindata_free(data);
-}
-
-
-static void *open_vaspposcar_write(const char *filename, const char *filetype, int natoms)
-{
-  vasp_plugindata_t *data;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  data->file = fopen(filename, "w");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "VASP POSCAR write) ERROR: Unable to open vaspposcar file '%s' for writing\n", filename);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-  data->numatoms = natoms;
-
-  return data;
-}
-
-
-static int write_vaspposcar_structure(void *mydata, int optflags, const molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-
-  if (!data || !atoms) return MOLFILE_ERROR;
-
-  data->atomlist = (molfile_atom_t *)malloc(data->numatoms*sizeof(molfile_atom_t));
-  if (!data->atomlist) return MOLFILE_ERROR;
-
-  memcpy(data->atomlist, atoms, data->numatoms*sizeof(molfile_atom_t));
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_vaspposcar_timestep(void *mydata, const molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata; 
-  molfile_atom_t const *atom;
-  int i, maxtype, eachatom[MAXATOMTYPES];
-  float x1, x2, y2, x3, y3, z3;
-  char tmptype[LINESIZE] = "";
-
-  if (!data || !ts) {
-    fprintf(stderr, "VASP POSCAR write) ERROR: Wrong input for writing POSCAR file\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* restore unit cell information in Cartesian */
-  x1 = ts->A;
-  x2 = ts->B*cos(ts->gamma*M_PI/180.0);
-  y2 = ts->B*sin(ts->gamma*M_PI/180.0);
-  x3 = ts->C*cos(ts->beta*M_PI/180.0);
-  y3 = (ts->B*ts->C*cos(ts->alpha*M_PI/180.0)-x2*x3)/y2;
-  z3 = sqrt(ts->C*ts->C - x3*x3 - y3*y3);
-
-  maxtype = -1;
-  atom = data->atomlist;
-  for (i = 0; i < data->numatoms && maxtype < MAXATOMTYPES - 1; ++i, ++atom) {
-    if (strcmp(tmptype, atom->type) != 0) {
-      fprintf(data->file, "%-2s  ", atom->type);
-      eachatom[++maxtype] = 0;
-    }
-    eachatom[maxtype]++;
-    strncpy(tmptype, atom->type, sizeof(atom->type));
-  }
-
-  fprintf(data->file, "\n%20.12f\n", 1.0);  
-  fprintf(data->file, "%20.12f  %20.12f  %20.12f\n", x1, 0.0, 0.0);
-  fprintf(data->file, "%20.12f  %20.12f  %20.12f\n", x2, y2,  0.0);
-  fprintf(data->file, "%20.12f  %20.12f  %20.12f\n", x3, y3,  z3);
-
-  for (i = 0; i <= maxtype; ++i) fprintf(data->file, " %d ", eachatom[i]);
-
-  fprintf(data->file, "\nDirect\n");
-
-  for (i = 0; i < data->numatoms; ++i) {
-    float const *pos = ts->coords + 3*i;
-    /* in direct coordinate */
-    fprintf(data->file, "%20.12f %20.12f %20.12f \n", pos[0]/x1, -x2*pos[0]/(x1*y2) + pos[1]/y2, (-y2*x3+x2*y3)*pos[0]/(x1*y2*z3) - y3*pos[1]/(y2*z3) + pos[2]/z3);
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspposcar_write(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "POSCAR";
-  plugin.prettyname = "VASP_POSCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "POSCAR";
-  plugin.open_file_read = open_vaspposcar_read;
-  plugin.read_structure = read_vaspposcar_structure;
-  plugin.read_next_timestep = read_vaspposcar_timestep;
-  plugin.close_file_read = close_vaspposcar_read;
-  plugin.open_file_write = open_vaspposcar_write;
-  plugin.write_structure = write_vaspposcar_structure;
-  plugin.write_timestep = write_vaspposcar_timestep;
-  plugin.close_file_write = close_vaspposcar_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspxdatcarplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspxdatcarplugin.c
deleted file mode 100644
index 4c218e7160a6ea00b8ef8b15014cf510a291482f..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspxdatcarplugin.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspxdatcarplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.10 $       $Date: 2014/10/10 14:41:02 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  gcc -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxdatcarplugin.c
- *  ld -shared -o vaspxdatcarplugin.so vaspxdatcarplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxdatcarplugin.c
- *  c++ -bundle -o vaspxdatcarplugin.so vaspxdatcarplugin.o
- *
- *  Install
- *  copy vaspxdatcarplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspxdatcar_read(const char *filename, const char *filetype, int *natoms)
-{
-  FILE *poscar;
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE], poscarfile[1000];
-  float lc;
-  int i;
-  
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  /* Use POSCAR or CONTCAR file for cell data and number of atoms */
-  if (strstr(filename, "XDATCAR") == NULL) {
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: file name '%s' does not contain 'XDATCAR'.\n", filename);
-    return NULL;
-  }
-  strcpy(poscarfile, filename);
-  strcpy(strstr(poscarfile, "XDATCAR"), "POSCAR");
-  poscar = fopen(poscarfile, "r");
-  if (!poscar) {
-    strcpy(poscarfile, filename);
-    strcpy(strstr(poscarfile, "XDATCAR"), "CONTCAR");
-    poscar = fopen(poscarfile, "r");
-    if (!poscar) {
-      fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: corresponding POSCAR or CONTCAR file not found.\n");
-      return NULL;
-    }
-  }
-  fprintf(stderr, "\n\nVASP XDATCAR read) determining lattice vectors and number of atoms from file '%s'.\n", poscarfile);
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  /* VASP4 is assumed in default */
-  data->version = 4;
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  fgets(lineptr, LINESIZE, poscar);
-  data->titleline = strdup(lineptr);
-
-  fgets(lineptr, LINESIZE, poscar);
-  lc = atof(strtok(lineptr, " "));
-  
-  for (i = 0; i < 3; ++i) {
-    float x, y, z;
-    fgets(lineptr, LINESIZE, poscar);
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) {
-      vasp_plugindata_free(data);
-      fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: POSCAR file '%s' does not have lattice vectors.\n", poscarfile);
-      return NULL;
-    }
-    data->cell[i][0] = x*lc;
-    data->cell[i][1] = y*lc;
-    data->cell[i][2] = z*lc;
-  }
-  vasp_buildrotmat(data);
-
-  /* Read the number of atoms per atom type */
-  data->numatoms = 0;
-  fgets(lineptr, LINESIZE, poscar);
-  for (i = 0; i < MAXATOMTYPES; ++i) {
-    char const *tmplineptr = strdup(lineptr);
-    char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-    int const n = (token ? atoi(token) : -1);
-
-    /* if fails to read number of atoms, then assume VASP5 */
-    if (i == 0 && n <= 0) {
-      data->version = 5;
-      data->titleline =  strdup(tmplineptr);
-      fgets(lineptr, LINESIZE, poscar);
-      break;
-    }else if (n <= 0) break;
-
-    data->eachatom[i] = n;
-    data->numatoms += n;
-  }
-
-  if (data->version == 5) {
-    data->numatoms = 0;
-    for (i = 0; i < MAXATOMTYPES; ++i) {
-      char const *token = (i == 0 ? strtok(lineptr, " ") : strtok(NULL, " "));
-      int const n = (token ? atoi(token) : -1);
-      
-      if (n <= 0) break;
-      
-      data->eachatom[i] = n;
-      data->numatoms += n;
-    }
-  }
-
-  fclose(poscar);
-
-  if (data->numatoms == 0) {
-    vasp_plugindata_free(data);
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: POSCAR file '%s' does not have the list of atom numbers.\n", poscarfile);
-    return NULL;
-  }
-
-  *natoms = data->numatoms;
-
-  return data;
-}
-
-
-static int read_vaspxdatcar_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  FILE *potcar;
-  char lineptr[LINESIZE], potcarfile[1000];
-  int atomcount, i;
-
-  /* Verify that input is OK */
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  /* Read POTCAR file to determine atom types.
-   * Each atom type section in POTCAR starts with a line
-   * that contains the name of the element (H, He, C etc.).
-   * Otherwise, try the title line instead.
-   */
-  strcpy(potcarfile, data->filename);
-  strcpy(strstr(potcarfile, "XDATCAR"), "POTCAR");
-  potcar = fopen(potcarfile, "r");
-  if (potcar) fprintf(stderr, "\n\nVASP XDATCAR read) using file '%s' for determining atom types.\n", potcarfile);
-
-  for (atomcount = i = 0; atomcount < data->numatoms; ++i) {
-    int j;
-    int idx;
-    char const *label;
-    float mass, radius;
-
-    if (potcar) {
-       /* Obtain atom types from POTCAR file */
-       char atomtype[5] = "X";
-       if (fgets(lineptr, LINESIZE, potcar)) sscanf(lineptr, "%*s %4s", atomtype);
-       idx = get_pte_idx(atomtype);
-
-       /* Skip lines in potcar file until next element */
-       while (fgets(lineptr, LINESIZE, potcar)) if (strstr(lineptr, "End of Dataset")) break;
-    } else {
-       /* Try to obtain atom types from title line */
-       char const *token = (i == 0 ? strtok(data->titleline, " ") : strtok(NULL, " "));
-       idx = get_pte_idx(token);
-    }
-
-    label = get_pte_label(idx);
-    mass = get_pte_mass(idx);
-    radius = get_pte_vdw_radius(idx);
-    for (j = 0; j < data->eachatom[i]; ++j, ++atomcount) {
-      molfile_atom_t *const atom = &(atoms[atomcount]);
-
-      /* Required settings */
-      strncpy(atom->name, label, sizeof(atom->name));
-      strncpy(atom->type, atom->name, sizeof(atom->type));
-      atom->resname[0] = '\0';
-      atom->resid = 1;
-      atom->segid[0]='\0';
-      atom->chain[0]='\0';
-
-      /* Optional flags (as defined in *optflags) */
-      atom->mass = mass;
-      atom->radius = radius;
-      atom->atomicnumber = idx;
-    }
-  }
-  if (potcar) fclose(potcar);
-
-  if (atomcount != data->numatoms) {
-    /* This can generally not happen; if it happens, there's a bug in the for-loop(i) above */
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: problem occurred when setting the atom types.\n");
-    return MOLFILE_ERROR;
-  }
-
-  /* Ignore header until X,Y,Z-coordinates */
-  for (i = 0; i < 4; ++i) fgets(lineptr, LINESIZE, data->file);
-
- /* Determine VASP4 and VASP5 */
-  if (tolower(lineptr[0]) == 'd'){
-    data->version = 5;
-    fgets(lineptr, LINESIZE, data->file);
-  }
-  else {
-      data->version = 4;
-      for (i = 0; i < 2; ++i)  fgets(lineptr, LINESIZE, data->file);
-    }
-
-  /* Check whether all coordinates are present in the file */
-  for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-    float coord;
-    if (3 != sscanf(lineptr, "%f %f %f", &coord, &coord, &coord)) break;
-  }
-  if (i != data->numatoms) {
-    fprintf(stderr, "\n\nVASP XDATCAR read) ERROR: file '%s' does not contain all coordinates of the atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  /* Set file pointer to the line of the atoms' coordinates */
-  rewind(data->file);
-  for (i = 0; i < 10 - data->version; ++i) fgets(lineptr, LINESIZE, data->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspxdatcar_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-  int i;
-
-  /* only save coords if we're given a timestep pointer, */
-  /* otherwise assume that VMD wants us to skip past it. */
-  if (!data || !ts) return MOLFILE_EOF;
-
-  for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-    float x, y, z, rotx, roty, rotz;
-    if (3 != sscanf(lineptr, "%f %f %f", &x, &y, &z)) break;
-
-    rotx = x*data->cell[0][0] + y*data->cell[1][0] + z*data->cell[2][0];
-    roty = x*data->cell[0][1] + y*data->cell[1][1] + z*data->cell[2][1];
-    rotz = x*data->cell[0][2] + y*data->cell[1][2] + z*data->cell[2][2];
-
-    ts->coords[3*i  ] = data->rotmat[0][0]*rotx + data->rotmat[0][1]*roty + data->rotmat[0][2]*rotz;
-    ts->coords[3*i+1] = data->rotmat[1][0]*rotx + data->rotmat[1][1]*roty + data->rotmat[1][2]*rotz;
-    ts->coords[3*i+2] = data->rotmat[2][0]*rotx + data->rotmat[2][1]*roty + data->rotmat[2][2]*rotz;
-  }
-  if (i != data->numatoms) return MOLFILE_EOF;
-
-  /* Skip the empty line after coordinates */
-  fgets(lineptr, LINESIZE, data->file);
-
-  vasp_timestep_unitcell(ts, data);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_vaspxdatcar_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "XDATCAR";
-  plugin.prettyname = "VASP_XDATCAR";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "XDATCAR";
-  plugin.open_file_read = open_vaspxdatcar_read;
-  plugin.read_structure = read_vaspxdatcar_structure;
-  plugin.read_next_timestep = read_vaspxdatcar_timestep;
-  plugin.close_file_read = close_vaspxdatcar_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspxmlplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspxmlplugin.c
deleted file mode 100644
index ed4dedd9d390e58eca13bade6b30a4c30f860385..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vaspxmlplugin.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vaspxmlplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.9 $       $Date: 2016/11/06 17:43:13 $
- *
- ***************************************************************************/
-
-/*
- *  VASP plugins for VMD
- *  Sung Sakong, Dept. of Phys., Univsity Duisburg-Essen
- *  
- *  VASP manual   
- *  http://cms.mpi.univie.ac.at/vasp/
- * 
- *  LINUX
- *  g++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxmlplugin.c
- *  ld -shared -o vaspxmlplugin.so vaspxmlplugin.o
- *
- *  MACOSX
- *  c++ -O2 -Wall -I. -I$VMDBASEDIR/plugins/include -c vaspxmlplugin.c
- *  c++ -bundle -o vaspxmlplugin.so vaspxmlplugin.o
- *
- *  Install
- *  copy vaspxmlplugin.so $VMDBASEDIR/plugins/$ARCH/molfile
- */
-
- /* Be aware that the XML file has 2 extra frames in addition to the
-  * ionic time steps. There is a 'initial position' frame, then the
-  * frames of each time step, and in the end once again a 'final position'
-  * frame. Hence, the xml file will load two frames more than the ones
-  * in XDATCAR or OUTCAR; the first two and last two are thus identical.
-  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-#include "vaspplugin.h"
-#include "periodic_table.h"
-
-
-static void *open_vaspxml_read(const char *filename, const char *filetype, int *natoms)
-{
-  vasp_plugindata_t *data;
-  char lineptr[LINESIZE];
-  int cellcoords, finished;
-
-  /* Verify that input is OK */
-  if (!filename || !natoms) return NULL;
-
-  /* Start with undefined value; set it after successful read */
-  *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-
-  data = vasp_plugindata_malloc();
-  if (!data) return NULL;
-
-  data->file = fopen(filename, "rb");
-  if (!data->file) {
-    vasp_plugindata_free(data);
-    return NULL;
-  }
-
-  data->filename = strdup(filename);
-
-  /* Scan xml file */
-  data->numatoms = cellcoords = finished = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && !finished) {
-
-    if (strstr(lineptr, "SYSTEM") != NULL && data->titleline == NULL) {
-       /* Extract title line */
-       char *begin = strstr(lineptr, ">") + 1;
-       char *end = strstr(lineptr, "</i>");
-       if (end) *end = '\0';
-       if (begin) data->titleline = strdup(begin);
-
-    } else if (strstr(lineptr, "atominfo") != NULL && data->numatoms == 0) {
-       /* Extract number of atoms */
-       fgets(lineptr, LINESIZE, data->file);
-       sscanf(lineptr, " <atoms> %d </atoms>", &data->numatoms);
-
-    } else if (strstr(lineptr, "crystal") != NULL && cellcoords == 0) {
-       /* Extract lattice vectors */
-       int i;
-       fgets(lineptr, LINESIZE, data->file);
-       for (i = 0; i < 3 && fgets(lineptr, LINESIZE, data->file); ++i) cellcoords += sscanf(lineptr, " <v> %f %f %f </v>", &data->cell[i][0], &data->cell[i][1], &data->cell[i][2]);
-    }
-
-    finished = data->titleline != NULL && data->numatoms != 0 && cellcoords != 0;
-  }
-
-  if (data->numatoms <= 0) {
-     vasp_plugindata_free(data);
-     fprintf(stderr, "\n\nVASP xml read) ERROR: file '%s' does not contain the number of atoms.\n", filename);
-     return NULL;
-  }
-
-  if (cellcoords != 9) {
-     vasp_plugindata_free(data);
-     fprintf(stderr, "\n\nVASP xml read) ERROR: file '%s' does not contain lattice vectors.\n", filename);
-     return NULL;
-  }
-
-  vasp_buildrotmat(data);
-
-  *natoms = data->numatoms;
-  rewind(data->file);
-
-  return data;
-}
-
-
-static int read_vaspxml_structure(void *mydata, int *optflags, molfile_atom_t *atoms)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  int atomcount, coordscount, finished;
-  char lineptr[LINESIZE];
-
-  /* Verify that input is OK */
-  if (!data || !optflags || !atoms) return MOLFILE_ERROR;
-
-  *optflags = MOLFILE_MASS; /* we set atom mass from the PTE. */
-  *optflags |= MOLFILE_ATOMICNUMBER | MOLFILE_RADIUS; 
-
-  /* Scan xml file */
-  atomcount = coordscount = finished = 0;
-  while (fgets(lineptr, LINESIZE, data->file) && !finished) {
-
-    /* Extract atom types */
-    if (strstr(lineptr, "atomtype") != NULL && atomcount == 0) {
-      int i;
-      fgets(lineptr, LINESIZE, data->file);
-      for (i = 0; i < data->numatoms; ++i, ++atomcount) {
-        molfile_atom_t *atom = &(atoms[i]);
-        char atomtype[5];
-        int idx;
-        fgets(lineptr, LINESIZE, data->file);
-	if (1 != sscanf(lineptr, " <rc><c> %4s </c>", atomtype)) break;
-
-        idx = get_pte_idx(atomtype);
-
-        /* Required settings */
-        strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-        strncpy(atom->type, atom->name, sizeof(atom->type));
-	atom->resname[0] = '\0';
-        atom->resid = 1;
-        atom->segid[0]  ='\0';
-        atom->chain[0] = '\0';
-
-        /* Optional flags (as defined in *optflags) */
-        atom->mass = get_pte_mass(idx);
-        atom->radius = get_pte_vdw_radius(idx);
-        atom->atomicnumber = idx;
-      }
-
-    /* Verify presence of coordinates for all atoms */
-    } else if (strstr(lineptr, "positions") != NULL && coordscount == 0) {
-        int i;
-        for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-           float x, y, z;
-	   if (3 != sscanf(lineptr, " <v> %f %f %f <\v>", &x, &y, &z)) break;
-        }
-	coordscount = 3 * i;
-    }
-
-    finished = atomcount != 0 && coordscount != 0;
-  }
-
-  if (atomcount != data->numatoms) {
-    fprintf(stderr, "\n\nVASP xml read) ERROR: file '%s' does not have list of atom names.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  if (coordscount != 3 * data->numatoms) {
-    fprintf(stderr, "\n\nVASP xml read)  file '%s' does not contain coordinates of all atoms.\n", data->filename);
-    return MOLFILE_ERROR;
-  }
-
-  rewind(data->file);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vaspxml_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  char lineptr[LINESIZE];
-
-  /* only save coords if we're given a timestep pointer, */
-  /* otherwise assume that VMD wants us to skip past it. */
-  if (!data || !ts) return MOLFILE_EOF;
-
-  /* Scan xml file */
-  while (fgets(lineptr, LINESIZE, data->file)) {
-
-    /* Extract coordinates of all atoms */
-    if (strstr(lineptr, "positions") != NULL) {
-      int i;
-      for (i = 0; i < data->numatoms && fgets(lineptr, LINESIZE, data->file); ++i) {
-        float x, y, z, rotx, roty, rotz;
-	if (3 != sscanf(lineptr, " <v> %f %f %f </v>", &x, &y, &z)) return MOLFILE_EOF;
-
-        rotx = x*data->cell[0][0] + y*data->cell[1][0] + z*data->cell[2][0];
-        roty = x*data->cell[0][1] + y*data->cell[1][1] + z*data->cell[2][1];
-        rotz = x*data->cell[0][2] + y*data->cell[1][2] + z*data->cell[2][2];
-
-        ts->coords[3*i  ] = data->rotmat[0][0]*rotx + data->rotmat[0][1]*roty + data->rotmat[0][2]*rotz;
-        ts->coords[3*i+1] = data->rotmat[1][0]*rotx + data->rotmat[1][1]*roty + data->rotmat[1][2]*rotz;
-        ts->coords[3*i+2] = data->rotmat[2][0]*rotx + data->rotmat[2][1]*roty + data->rotmat[2][2]*rotz;
-      }
-      vasp_timestep_unitcell(ts, data);
-      return MOLFILE_SUCCESS;
-    }
-  }
-
-  return MOLFILE_EOF;
-}
-
-
-static void close_vaspxml_read(void *mydata)
-{
-  vasp_plugindata_t *data = (vasp_plugindata_t *)mydata;
-  vasp_plugindata_free(data);
-}
-
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xml";
-  plugin.prettyname = "VASP_xml";
-  plugin.author = "Sung Sakong";
-  plugin.majorv = 0;
-  plugin.minorv = 7;
-  plugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  plugin.filename_extension = "xml";
-  plugin.open_file_read = open_vaspxml_read;
-  plugin.read_structure = read_vaspxml_structure;
-  plugin.read_next_timestep = read_vaspxml_timestep;
-  plugin.close_file_read = close_vaspxml_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vmddir.h b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vmddir.h
deleted file mode 100644
index f6b10d278179623ffbf4aec8ab3d9b775552fb3c..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vmddir.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vmddir.h,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.12 $       $Date: 2016/11/28 05:01:54 $
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#include <windows.h>
-
-typedef struct {
-  HANDLE h;
-  WIN32_FIND_DATA fd;
-} VMDDIR;
-
-#else
-#include <dirent.h>
-
-typedef struct {
-  DIR * d;
-} VMDDIR;
-#endif
-
-
-
-static VMDDIR * vmd_opendir(const char *);
-static char * vmd_readdir(VMDDIR *);
-static void vmd_closedir(VMDDIR *);
-static int vmd_file_is_executable(const char * filename);
-
-
-#define VMD_FILENAME_MAX 1024
-
-#if defined(_MSC_VER) || defined(__MINGW32__) 
-
-/* Windows version */
-
-static VMDDIR * vmd_opendir(const char * filename) {
-  VMDDIR * d;
-  char dirname[VMD_FILENAME_MAX];
-
-  strcpy(dirname, filename);
-  strcat(dirname, "\\*");
-  d = (VMDDIR *) malloc(sizeof(VMDDIR));
-  if (d != NULL) {
-#if _MSC_VER < 1400 || !(defined(UNICODE) || defined(_UNICODE))
-    d->h = FindFirstFile(dirname, &(d->fd));
-#else
-    wchar_t szBuff[VMD_FILENAME_MAX];
-    swprintf(szBuff, L"%p", dirname);
-    d->h = FindFirstFile(szBuff, &(d->fd));
-#endif
-    if (d->h == ((HANDLE)(-1))) {
-      free(d);
-      return NULL;
-    }
-  }
-  return d;
-}
-
-static char * vmd_readdir(VMDDIR * d) {
-  if (FindNextFile(d->h, &(d->fd))) {
-#if _MSC_VER < 1400 || !(defined(UNICODE) || defined(_UNICODE))
-    return d->fd.cFileName;
-#else
-    int len = wcslen(d->fd.cFileName);
-    char* ascii = new char[len + 1];
-    wcstombs(ascii, d->fd.cFileName, len);
-    return ascii;
-#endif
-  }
-  return NULL;     
-}
-
-static void vmd_closedir(VMDDIR * d) {
-  if (d->h != NULL) {
-    FindClose(d->h);
-  }
-  free(d);
-}
-
-
-static int vmd_file_is_executable(const char * filename) {
-  FILE * fp;
-  if ((fp=fopen(filename, "rb")) != NULL) {
-    fclose(fp);
-    return 1;
-  }
-
-  return 0;
-} 
-
-#else
-
-/* Unix version */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-static VMDDIR * vmd_opendir(const char * filename) {
-  VMDDIR * d;
-
-  d = (VMDDIR *) malloc(sizeof(VMDDIR));
-  if (d != NULL) {
-    d->d = opendir(filename);
-    if (d->d == NULL) {
-      free(d);
-      return NULL;
-    }
-  }
-
-  return d;
-}
-
-static char * vmd_readdir(VMDDIR * d) {
-  struct dirent * p;
-  if ((p = readdir(d->d)) != NULL) {
-    return p->d_name;
-  }
-
-  return NULL;     
-}
-
-static void vmd_closedir(VMDDIR * d) {
-  if (d->d != NULL) {
-    closedir(d->d);
-  }
-  free(d);
-}
-
-
-static int vmd_file_is_executable(const char * filename) {
-  struct stat buf;
-  if (!stat(filename, &buf)) {
-    if (buf.st_mode & S_IXUSR || 
-        buf.st_mode & S_IXGRP ||
-        buf.st_mode & S_IXOTH) {
-      return 1;
-    }
-  }
-  return 0;
-} 
-
-#endif
-
-
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vtfplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vtfplugin.c
deleted file mode 100644
index 58c1f6d405b203f653a691ef33e8d3ad96ac9b24..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vtfplugin.c
+++ /dev/null
@@ -1,1356 +0,0 @@
-/* VTF plugin by Olaf Lenz <olaf@lenz.name> and Henri Menke */
-/* $Id: vtfplugin.c,v 1.18 2014/02/04 17:00:35 johns Exp $ */
-
-/*
-VMD file reader plugin for:
-- VTF structure format (VSF)
-- VTF coordinate format (VCF)
-- VTF trajectory format (VTF)
-
-This code has two main entry points. The functions used in
-VMDPLUGIN_init() are the entry points for the VMD plugin API, while
-the function vtf_parse_userdata is the entry point when the plugin is
-called from the Tcl module "vtftools.tcl" to allow reading in userdata
-into Tcl data structures.
-*/
-#ifdef _MSC_VER
-/* Turn off annoying Windows warnings. */
-#define _CRT_SECURE_NO_WARNINGS
-#define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-#include <molfile_plugin.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <ctype.h>
-#include <string.h>
-
-#ifdef _USE_TCL
-#include <tcl.h>
-#endif
-#ifdef _USE_ZLIB
-#include <zlib.h>
-#define VTFFILE gzFile
-#define fopen gzopen
-#define feof gzeof
-#define fgets(buf,size,file) gzgets(file,buf,size)
-#define fclose gzclose
-#else
-#define VTFFILE FILE*
-#endif
-
-#ifdef _MSC_VER
-#define strdup _strdup
-#endif
-
-#define VERSION_MAJOR 2
-#define VERSION_MINOR 4
-
-/* TODO:
-- volumetric/graphics format
-- file write support
-*/
-
-/***************************************************
- * Data structures
- ***************************************************/
-/* Default atom. 
-   Used by vtf_parse_atom to initialize new atoms. */
-static molfile_atom_t default_atom;
-char* default_userdata;
-const char *molid;
-const char* userdata_varname;
-#ifdef _USE_TCL
-Tcl_Interp *tcl_interp;
-#endif
-
-#define VTF_MOLFILE 0
-#define VTF_USERDATA 1
-
-/* Plugin data structure to communciate data between the functions. */
-typedef struct {
-  /* opened file */
-  VTFFILE file;
-  /* return code */
-  int return_code;
-  /* read mode */
-  int read_mode;
-
-  /* STRUCTURE DATA (used by read_structure) */
-  /* atom info */
-  int natoms;
-  molfile_atom_t *atoms;
-  int optflags;
-
-  /* bond info */
-  int nbonds;
-  int *from;
-  int *to;
-
-  /* TIMESTEP DATA (used by read_next_timestep) */
-  unsigned int timestep;
-  /* reading mode for the next timestep */
-  int timestep_mode;
-  /* last timestep data */
-  float A, B, C, alpha, beta, gamma;
-  float *coords;
-} vtf_data;
-
-/* constants for timestep_mode */
-#define TIMESTEP_INDEXED 0
-#define TIMESTEP_ORDERED 1
-#define TIMESTEP_VCFSTART 2
-
-/* global variable: contains the line number of the file */
-static int vtf_lineno = 0;
-
-#ifdef _USE_TCL
-/* Make the atom userdata available to Tcl. */
-void vtf_set_atom_userdata(const int aid, const char* userdata) {
-  static char array_index[255];
-  if (userdata == NULL) return;
-  sprintf(array_index, "%s.atom.%d", molid, aid);
-  Tcl_SetVar2(tcl_interp, userdata_varname, array_index, userdata, 0);
-}
-
-/* Make the timestep userdata available to Tcl. */
-void vtf_set_timestep_userdata(const unsigned int timestep,
-                               const char* userdata) {
-  static char array_index[255];
-  if (userdata == NULL || strlen(userdata) == 0) return;
-  sprintf(array_index, "%s.step%d", molid, timestep);
-  Tcl_SetVar2(tcl_interp, userdata_varname, array_index, userdata, 0);
-}
-
-/* Make the coordinate userdata available to Tcl. */
-void vtf_set_coordinate_userdata(const unsigned int timestep, 
-                                 const int aid, 
-                                 const char* userdata) {
-  static char array_index[255];
-  if (userdata == NULL || strlen(userdata) == 0) return;
-  sprintf(array_index, "%s.step%d.%d", molid, timestep, aid);
-  Tcl_SetVar2(tcl_interp, userdata_varname, array_index, userdata, 0);
-}
-#endif
-
-/***************************************************
- * Print an error message.
- ***************************************************/
-static void vtf_error(const char *msg, const char *line) {
-  char message[255];
-  sprintf(message, "vtfplugin:%d: error: %s: \"%s\"\n",    
-          vtf_lineno, msg, line);
-
-/* #if vmdplugin_ABIVERSION > 13 */
-/*   if (cons_fputs) */
-/*     cons_fputs(VMDCON_ERROR, message); */
-/*   else */
-/* #else */
-  printf("%s", message);
-/* #endif */
-}
-
-/***************************************************
- * Free malloced memory, checking for NULL
- ***************************************************/
-static void sfree(void* ptr) {
-  if (ptr != NULL) free(ptr);
-}
-
-/***************************************************
- * Read a line
- ***************************************************/
-
-/* Read a whole line from the file. 
-   The line may have arbitrary length and continuation lines ending
-   with '\' are heeded.
-   The function will return a pointer to a buffer or NULL if an
-   error occured or eof occurs while no characters have been read.
-   The function will set the global variable lineno.
-*/
-static char *vtf_getline(VTFFILE file) {
-  static char *buffer = NULL;
-  static int buffer_size = 0;
-  char *s;   /* pointer to the place where the line will be read to */
-  int bytes_left;              /* the number of bytes that are left */
-  int l;
-
-  if (buffer == NULL) {
-    buffer_size = 255;
-    buffer = malloc(buffer_size);
-    /* TODO: error handling */
-  }
-
-  /* Point s to the beginning of buffer. */
-  s = buffer;
-  bytes_left = buffer_size;
-
-  if (feof(file)) {
-    sfree(buffer);
-    buffer = NULL;
-    return NULL;
-  }
-  do {
-    /* read a line */
-    if (fgets(s, bytes_left, file) == NULL) {
-      sfree(buffer);
-      buffer = NULL;
-      return NULL;
-    }
-
-    vtf_lineno++;
-
-    /* if we reached eof, finish */
-    if (feof(file)) break;
-
-    /* pos of the last char */
-    l = strlen(s) - 1;
-    if (l >= 0 && ( s[l] == '\n' || s[l] == '\r')) {
-      l--;
-      /* remove all line endings */
-      while (l >= 0 && (s[l] == '\n' || s[l] == '\r')) l--;
-      /* overwrite the first line ending char */
-      s[l+1] = '\0';
-      /* check the previous char, whether it is '\' */
-      if (l >= 0 && s[l] == '\\') {
-        /* last char before is continuation char */
-        /* position s to the continuation char */
-        bytes_left -= l+1;
-        s += l+1;
-      } else 
-        /* otherwise, the line is complete */
-        break;
-    } else {
-      /* last char is not a newline */
-      /* enlarge the buffer */
-      buffer_size += 255;
-      buffer = realloc(buffer, buffer_size);
-      /* TODO: error handling */
-      /* reposition s */
-      l = strlen(buffer);
-      s = buffer + l;
-      bytes_left += buffer_size - l;
-      vtf_lineno--;
-    }
-  } while (1);
-
-  /* now check the whole string */
-  s = buffer;
-  
-  /* skip all leading whitespace */
-  while (isspace(s[0])) s++;
-
-  /* ignore comment lines */
-  if (s[0] == '#') return vtf_getline(file);
-
-  l = strlen(s);
-
-  /* handle empty lines */
-  if (l == 0) {
-    if (feof(file)) {
-      sfree(buffer);
-      buffer = NULL;
-      return NULL;
-    }
-    else return vtf_getline(file);
-  }
-
-  return s;
-}
-
-/***************************************************
- * Parse ATOM
- ***************************************************/
-/* Create new atoms so that after the call max_aid atoms are there */
-static void vtf_create_atoms_as_needed(int max_aid, vtf_data *d) {
-  /* create new atoms as needed */
-  if (d->natoms < max_aid+1) {
-    int aid;
-      /* fill up with default atoms */
-      d->atoms = realloc(d->atoms, (max_aid+1)*sizeof(molfile_atom_t));
-      for (aid = d->natoms; aid <= max_aid; aid++)
-        d->atoms[aid] = default_atom;
-      d->natoms = max_aid+1;
-#ifdef _USE_TCL
-    if (d->read_mode != VTF_MOLFILE) {
-      /* fill up with default userdata */
-      for (aid = d->natoms; aid <= max_aid; aid++)
-        vtf_set_atom_userdata(aid, default_userdata);
-    }
-#endif
-  }
-}
-
-/* Parse the aid specifier.
-   Return an integer list of the aids that need to be modifed. The
-   list is terminated by -1. If the list is NULL, an error occured. If
-   the list is empty (i.e. it only contains -1), the default atom is
-   to be modified.
- */
-static int *vtf_parse_aid_specifier(char *s, vtf_data *d) {
-  int n;
-  unsigned int aid, from, to, offset;
-  unsigned int size = 0;
-  int *aid_list = NULL;
-
-  if (s[0] == 'd') {
-    /* DEFAULT */
-    /* if the specifier is "default", just leave the list empty! */
-#ifdef DEBUG
-    printf("%s", "\tdefine default atom\n");
-#endif
-  } else {
-    /* otherwise parse the aid specifier */
-    while (1) {
-      from = d->natoms;
-
-      if (sscanf(s, " %u:%u%n", &from, &to, &n) == 2) {
-        /* RANGE */
-        if (from > to) { 
-          vtf_error("bad range specifier (from > to):", s); 
-          sfree(aid_list);
-          return NULL;
-        }
-        vtf_create_atoms_as_needed(to, d);
-        /* add the range to the aid list */
-        offset = size;
-        size += to-from+1;
-        aid_list = realloc(aid_list, size*sizeof(int));
-        for (aid = from; aid <= to; aid++) {
-          aid_list[offset] = aid;
-          offset++;
-        }
-
-      } else if (sscanf(s, " %u%n", &to, &n) == 1) {
-        /* SINGLE AID */
-        vtf_create_atoms_as_needed(to, d);
-        /* add the aid to the aid_list */
-        size += 1;
-        aid_list = realloc(aid_list, size*sizeof(int));
-        aid_list[size - 1] = to;
-
-      } else {
-        /* ERROR */
-        vtf_error("bad aid specifier", s);
-        sfree(aid_list);
-        return NULL;
-      }
-
-      /* advance s */
-      s += n;
-
-      /* if there is no more to parse, break */
-      if (s[0] == '\0') break;
-
-      /* otherwise the next char should be a ',' */
-      if (s[0] != ',') {
-        vtf_error("bad aid specifier", s);
-        sfree(aid_list);
-        return NULL;
-      }
-      /* skip the ',' */
-      s++;
-    };
-  }
-
-  /* Terminate the list with -1 */
-  aid_list = realloc(aid_list, (size+1)*sizeof(int));
-  aid_list[size] = -1;
-  return aid_list;
-}
-
-/* Parse atom data from line. 
-   Return MOLFILE_SUCCESS, if data was sucessfully parsed, 
-   MOLFILE_ERROR if an error occured. */
-static int vtf_parse_atom(char *line, vtf_data *d) {
-  static molfile_atom_t atom;
-  static char keyword[255];
-  static char msg[255];
-  static char aid_specifier[255];
-  int n;
-  char *s;
-  int rest_is_userdata;
-  int *aid_list = NULL;
-
-  atom = default_atom;
-  s = line;
-
-#ifdef DEBUG
-  printf("\tatom record\n");
-  printf("line: %s\n", s);
-#endif
-
-  /* HANDLE THE AID SPECIFIER */
-
-  /* save the aid specifier */
-  if (sscanf(s, " %255s%n", aid_specifier, &n) < 1) {
-    vtf_error("atom specifier is missing", line);
-    return MOLFILE_ERROR;
-  }
-  s += n;
-
-  aid_list = vtf_parse_aid_specifier(aid_specifier, d);
-  if (aid_list == NULL) return MOLFILE_ERROR;
-
-  /* A -1 in the aid_list denotes the end of the list */
-#define AIDLOOP(assignment)                                             \
-  {                                                                     \
-    int *aid_ptr;                                                       \
-    for (aid_ptr = aid_list; *aid_ptr != -1; aid_ptr++) {               \
-      int aid = *aid_ptr;                                               \
-      molfile_atom_t *cur_atom = &d->atoms[aid];                        \
-      assignment;                                                       \
-    }                                                                   \
-  }
-  
-  /* handle the keywords */
-  rest_is_userdata = 0;
-  while (sscanf(s, " %255s%n", keyword, &n) == 1) {
-    s += n;
-#ifdef DEBUG
-    printf("keyword: \"%s\" rest: \"%s\"\n", keyword, s);
-#endif
-    switch (tolower(keyword[0])) {
-    case 'n': {
-      /* name */
-      if (sscanf(s, " %16s%n", atom.name, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->name, atom.name));
-      } else {
-        vtf_error("could not get name in atom record", line);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 't': {
-      /* type */
-      if (sscanf(s, " %16s%n", atom.type, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->type, atom.type));
-      } else {
-        vtf_error("could not get type in atom record", line);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'r': {
-      /* resname, resid, radius */
-      if (strlen(keyword) == 1 || 
-          strncmp(keyword, "rad", 3) == 0) { 
-        /* radius */
-        if (sscanf(s, " %f%n", &atom.radius, &n) == 1) {
-          AIDLOOP(cur_atom->radius = atom.radius);
-        } else {
-          vtf_error("could not get radius in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_RADIUS;
-      } else if (strcmp(keyword, "resid") == 0) {
-        /* resid */
-        if (sscanf(s, " %d%n", &atom.resid, &n) == 1) {
-          AIDLOOP(cur_atom->resid = atom.resid);
-        } else {
-          vtf_error("could not get resid in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-      } else if (strcmp(keyword, "res") == 0 || 
-                 strcmp(keyword, "resname") == 0) {
-        /* resname */
-        if (sscanf(s, " %8s%n", atom.resname, &n) == 1) {
-          AIDLOOP(strcpy(cur_atom->resname, atom.resname));
-        } else {
-          vtf_error("could not get resname in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-      } else {
-        strcpy(msg, "unrecognized keyword in atom record: ");
-        strncat(msg, keyword, 200);
-        vtf_error(msg, line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 's': {
-      /* segid */
-      if (sscanf(s, " %8s%n", atom.segid, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->segid, atom.segid));
-      } else {
-        vtf_error("could not get segid in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'i': {
-      /* insertion */
-      if (sscanf(s, " %2s%n", atom.insertion, &n) == 1) {
-        AIDLOOP(strcpy(cur_atom->insertion, atom.insertion));
-      } else {
-        vtf_error("could not get insertion in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_INSERTION;
-      s += n;
-      break;
-    }
-    case 'c': {
-      /* chain, charge */
-      if (strlen(keyword) == 1 || 
-          strcmp(keyword, "chain") == 0) {
-        if (sscanf(s, " %2s%n", atom.chain, &n) == 1) {
-          AIDLOOP(strcpy(cur_atom->chain, atom.chain));
-          s += n;
-          break;
-        } else {
-          vtf_error("could not get chain in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-      }
-    } /* if "chain" is not recognized, continue with next case */
-    case 'q': {
-      /* q and charge */
-      if (strlen(keyword) == 1 ||
-          strcmp(keyword, "charge") == 0) {
-        if (sscanf(s, " %f%n", &atom.charge, &n) == 1) {
-          AIDLOOP(cur_atom->charge = atom.charge);
-        } else {
-          vtf_error("could not get charge in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_CHARGE;
-      } else {
-        strcpy(msg, "unrecognized keyword in atom record: ");
-        strncat(msg, keyword, 200);
-        vtf_error(msg, line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'a': {
-      /* altloc, atomicnumber */
-      if (strlen(keyword)== 1 || 
-          strcmp(keyword, "atomicnumber") == 0) {
-        if (sscanf(s, " %d%n", &atom.atomicnumber, &n) == 1) {
-          AIDLOOP(cur_atom->atomicnumber = atom.atomicnumber);
-        } else {
-          vtf_error("could not get atomicnumber in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_ATOMICNUMBER;
-      } else if (strcmp(keyword, "altloc")) {
-        if (sscanf(s, " %2s%n", atom.altloc, &n) == 1) {
-          AIDLOOP(strcpy(cur_atom->altloc, atom.altloc));
-        } else {
-          vtf_error("could not get altloc in atom record", line);
-          sfree(aid_list);
-          return MOLFILE_ERROR;
-        }
-        d->optflags |= MOLFILE_ALTLOC;
-      } else { 
-        strcpy(msg, "unrecognized keyword in atom record: ");
-        strncat(msg, keyword, 200);
-        vtf_error(msg, line);
-          sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      s += n;
-      break;
-    }
-    case 'o': {
-      /* occupancy */
-      if (sscanf(s, " %f%n", &atom.occupancy, &n) == 1) {
-        AIDLOOP(cur_atom->occupancy = atom.occupancy);
-      } else {
-        vtf_error("could not get occupancy in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_OCCUPANCY;
-      s += n;
-      break;
-    }
-    case 'b': {
-      /* bfactor */
-      if (sscanf(s, " %f%n", &atom.bfactor, &n) == 1) {
-        AIDLOOP(cur_atom->bfactor = atom.bfactor);
-      } else {
-        vtf_error("could not get bfactor in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_BFACTOR;
-      s += n;
-      break;
-    }
-    case 'm': {
-      /* mass */
-      if (sscanf(s, " %f%n", &atom.mass, &n) == 1) {
-        AIDLOOP(cur_atom->mass = atom.mass);
-      } else {
-        vtf_error("could not get mass in atom record", line);
-        sfree(aid_list);
-        return MOLFILE_ERROR;
-      }
-      d->optflags |= MOLFILE_MASS;
-      s += n;
-      break;
-    }
-    case 'u': {
-      /* userdata: the rest of the line is user data */
-      rest_is_userdata = 1;
-#ifdef _USE_TCL
-      if (d->read_mode != VTF_MOLFILE) {
-        AIDLOOP(vtf_set_atom_userdata(aid, s));
-      }
-#endif
-      break;
-    }
-    default: { 
-      /* unrecognized */
-      strcpy(msg, "unrecognized keyword in atom record: ");
-      strncat(msg, keyword, 200);
-      vtf_error(msg, line);
-      sfree(aid_list);
-      return MOLFILE_ERROR;
-    }
-    }
-    if (rest_is_userdata) break;
-  }
-
-  /* if the aid_list is empty, modify the default atom */
-  if (*aid_list == -1) {
-      default_atom = atom;
-      if (d->read_mode != VTF_MOLFILE) {
-        sfree(default_userdata);
-        default_userdata = strdup(s);
-      }
-  }
-
-  sfree(aid_list);
-
-#ifdef DEBUG
-  printf("\tparsed keywords\n");
-#endif
-
-  return MOLFILE_SUCCESS;
-}
-
-/***************************************************
- * Parse BOND
- ***************************************************/
-/* Parse bond data from line.  Called by vtf_parse_structure(). Return
-   MOLFILE_SUCCESS, if data was sucessfully parsed, MOLFILE_ERROR if
-   an error occured. */
-static int vtf_parse_bond(char *line, vtf_data *d) {
-  char *s;
-  int n;
-  unsigned int from, to, aid, bid;
-
-  s = line;
-
-  while (1) {
-    if (sscanf(s, " %u::%u%n", &from, &to, &n) == 2) {
-      /* chain specifier */
-      if (from > to) {
-        vtf_error("bad chain specifier (from > to):", s); 
-        return MOLFILE_ERROR;
-      }
-      bid = d->nbonds;
-      d->nbonds += to-from;
-      d->from = realloc(d->from, d->nbonds*sizeof(int));
-      d->to = realloc(d->to, d->nbonds*sizeof(int));
-      /* TODO: error handling */
-      for (aid = from; aid < to; aid++) {
-        /*printf("creating bond from %d to %d\n", aid, aid+1);*/
-        d->from[bid] = aid+1;
-        d->to[bid] = aid+2;
-        bid++;
-      }
-    } else if (sscanf(s, " %u:%u%n", &from, &to, &n) == 2) {
-      /* single bond specifier */
-      d->nbonds += 1;
-      d->from = realloc(d->from, d->nbonds*sizeof(int));
-      d->to = realloc(d->to, d->nbonds*sizeof(int));
-      /* TODO: error handling */
-      d->from[d->nbonds-1] = from+1;
-      d->to[d->nbonds-1] = to+1;
-    } else {
-      vtf_error("bad bond specifier", s);
-      return MOLFILE_ERROR;
-    }
-
-    s += n;
-    
-    /* if there is no more to parse, break */
-    if (strlen(s) == 0) break;
-    
-    /* otherwise the next char should be a ',' */
-    if (s[0] != ',') {
-      vtf_error("bad bond specifier in line", line);
-      return MOLFILE_ERROR;
-    }
-    /* skip the ',' */
-    s++;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-/***************************************************
- * Parse PBC
- ***************************************************/
-/* Parse periodic boundary condition data from line. Called by
-   vtf_parse_structure().  Return MOLFILE_SUCCESS, if data was
-   sucessfully parsed, MOLFILE_ERROR if an error occured. */
-static int vtf_parse_pbc(char *line, vtf_data *d) {
-  char *s;
-  int n = 0;
-
-  if (sscanf(line, " %f %f %f%n", &d->A, &d->B, &d->C, &n) < 3) {
-    s = line;
-    vtf_error("Couldn't parse unit cell dimensions", s);
-    return MOLFILE_ERROR;
-  }
-  s = line + n;
-
-  n = sscanf(s, " %f %f %f", &d->alpha, &d->beta, &d->gamma);
-  if (n > 0 && n < 3) {
-    vtf_error("Couldn't parse unit cell angles", line);
-    return MOLFILE_ERROR;
-  }
-  return MOLFILE_SUCCESS;
-} 
-
-/* Parse timestep command from line. Called by vtf_parse_structure().
-   Return MOLFILE_SUCCESS, if it was sucessfully parsed, MOLFILE_ERROR
-   if an error occured. */
-static int vtf_parse_timestep(char *line, vtf_data *d) {
-  while (strlen(line) > 0 && isspace(line[0])) line++;
-  if (strlen(line) == 0) {
-    d->timestep_mode = TIMESTEP_ORDERED;
-  } else {
-    switch (tolower(line[0])) {
-    case 'o': { d->timestep_mode = TIMESTEP_ORDERED; break; }
-    case 'i': { d->timestep_mode = TIMESTEP_INDEXED; break; }
-    default: {
-      vtf_error("bad timestep line", line);
-      return MOLFILE_ERROR;
-    }
-    }
-  }
-  return MOLFILE_SUCCESS;
-}
-
-/* Called by _vtf_open_file_read() to parse the structure data. */
-static void vtf_parse_structure(vtf_data *d) {
-  char *line;                   /* next line in the file */
-  char s[255];
-  int n;
-  
-  /* initialize the default atom */
-  strcpy(default_atom.name, "X");
-  strcpy(default_atom.type, "X");
-  strcpy(default_atom.resname, "X");
-  default_atom.resid = 0;
-  strcpy(default_atom.segid, "");
-  strcpy(default_atom.chain, "");
-
-  strcpy(default_atom.altloc, "");
-  strcpy(default_atom.insertion, "");
-  default_atom.occupancy = 1.0;
-  default_atom.bfactor = 1.0;
-  default_atom.mass = 1.0;
-  default_atom.charge = 0.0;
-  default_atom.radius = 1.0;
-
-  default_userdata = NULL;
-
-  do {
-    line = vtf_getline(d->file);
-    if (line == NULL) break;
-#ifdef DEBUG
-    printf("parsing line %d: \"%s\"\n", vtf_lineno, line);
-#endif
-    switch (tolower(line[0])) {
-      /* ATOM RECORD */
-    case 'a': {
-      /* Remove the "atom" keyword" */
-     sscanf(line, " %255s%n", s, &n);
-      line += n;
-    }
-    case '0':
-    case '1':
-    case '2':
-    case '3':
-    case '4':
-    case '5':
-    case '6':
-    case '7':
-    case '8':
-    case '9':   
-    case 'd': { 
-      /* parse atom */
-      d->return_code = vtf_parse_atom(line, d);
-      break; 
-    }
-
-      /* BOND RECORD */
-    case 'b': {
-      /* Remove the "bond" keyword" */
-      sscanf(line, " %255s%n", s, &n);
-      line += n;
-      d->return_code = vtf_parse_bond(line, d);
-      break;
-    }
-
-      /* PBC/UNITCELL RECORD */
-    case 'u':
-    case 'p': {
-      /* Remove the "pbc"/"unitcell" keyword */
-      sscanf(line, " %255s%n", s, &n);
-      line += n;
-      d->return_code = vtf_parse_pbc(line, d);
-      break;
-    }
-
-      /* TIMESTEP RECORD*/
-    case 'c': 
-    case 't': {
-      /* Remove the "timestep" or "coordinates" keyword */
-      sscanf(line, " %255s%n", s, &n);
-      line += n;
-    }
-    case 'i': 
-    case 'o': { 
-      d->return_code = vtf_parse_timestep(line, d);
-      line = NULL; /* indicate the end of the structure block */
-      break; 
-    }
-
-      /* UNKNOWN RECORD */
-    default: {
-      vtf_error("unknown line type", line);
-      d->return_code = MOLFILE_ERROR;
-      break;
-    }
-    }
-  } while (line != NULL && 
-           d->return_code == MOLFILE_SUCCESS);
-
-  /* test if structure data was parsed */
-  if (d->read_mode == VTF_MOLFILE &&
-      d->atoms == NULL && 
-      d->return_code == MOLFILE_SUCCESS) {
-    d->return_code = MOLFILE_NOSTRUCTUREDATA;
-  }
-
-  /* test whether another error has occured */
-  if (errno != 0) {
-    perror("vtfplugin");
-    d->return_code = MOLFILE_ERROR;
-  }
-
-  sfree(default_userdata);
-}
-
-/***************************************************
- * Open file and parse structure info
- ***************************************************/
-/* Opens the file for reading.  To determine the number of atoms in
-   the file, it is necessary to parse the structure information,
-   anyway. Therefore, this function will parse the structure data and
-   save the information in the plugin's data structure.
-
-   The read_mode defines whether the file is read from VMD via the
-   plugin API (VTF_MOLFILE) to read structure and timestep data, or
-   via the vtftools to read userdata (VTF_USERDATA).
-
-   The function vtf_open_file_read() that is actually called by the
-   molfile reader plugin is defined below this function.
-*/
-static vtf_data *
-_vtf_open_file_read(const char *filepath, 
-                    const char *filetype, 
-                    int *natoms,
-                    int read_mode) {
-  vtf_data *d;
-
-  /* printf("Loading file %s\n  of type %s using vtfplugin v%i.%i.\n", 
-     filepath, filetype, VERSION_MAJOR, VERSION_MINOR); */
-
-  /* initialize the data structure */
-  d = malloc(sizeof(vtf_data));
-  
-  errno = 0;
-
-  d->return_code = MOLFILE_SUCCESS;
-  d->read_mode = read_mode;
-
-  /* initialize structure data */
-  d->optflags = MOLFILE_NOOPTIONS;
-  d->natoms = 0;
-  d->atoms = NULL;
-  d->nbonds = 0;
-  d->from = NULL;
-  d->to = NULL;
-
-  /* initialize timestep data */
-  d->timestep = 0;
-  d->timestep_mode = TIMESTEP_ORDERED;
-  d->coords = NULL;
-  d->A = 0.0;
-  d->B = 0.0;
-  d->C = 0.0;
-  d->alpha = 90.0;
-  d->beta = 90.0;
-  d->gamma = 90.0;
-
-  /* Open the file */
-  d->file = fopen(filepath, "rb");
-  if (d->file == NULL) {
-    /* Could not open file */
-    char msg[255];
-    sprintf(msg, "vtfplugin: %s", filepath);
-    perror(msg);
-    sfree(d);
-    return NULL;
-  }
-
-  if (strcmp(filetype, "vcf") == 0) {
-    d->timestep_mode = TIMESTEP_VCFSTART;
-    d->natoms = MOLFILE_NUMATOMS_UNKNOWN;
-    *natoms = MOLFILE_NUMATOMS_UNKNOWN;
-    d->return_code = MOLFILE_NOSTRUCTUREDATA;
-  } else {
-    vtf_parse_structure(d);
-    
-    if (d->return_code != MOLFILE_SUCCESS) {
-      /* close the file */
-      fclose(d->file);
-
-      /* free the data */
-      sfree(d->atoms);
-      sfree(d->coords);
-      sfree(d->from);
-      sfree(d->to);
-      sfree(d);
-      return NULL;
-    }
-   
-    *natoms = d->natoms;
-  }
-
-  return d;
-}
-
-/* This is the function actually called by the molfile reader plugin */
-static void *
-vtf_open_file_read(const char *filepath, 
-                   const char *filetype, 
-                   int *natoms) {
-  return _vtf_open_file_read(filepath, filetype, natoms, VTF_MOLFILE);
-}
-
-/* */
-static void vtf_close_file_read(void *data) {
-  vtf_data *d;
-
-  if (data == NULL) return;
-  d = (vtf_data*)data;
-
-  /* printf("Finished reading file.\n"); */
-
-  /* close the file */
-  fclose(d->file);
-
-  /* free the data */
-  sfree(d->coords);
-  sfree(d->from);
-  sfree(d->to);
-  sfree(d);
-}
-
-/* Read the next timestep from the file and store what has been read
-   into the ts datastructure. */
-static int vtf_read_next_timestep(void *data, 
-                                  int natoms, 
-                                  molfile_timestep_t *ts) {
-  vtf_data *d;
-  char *line;
-  static char s[255];
-  float x,y,z;
-  unsigned int aid;
-  int n;
-
-  if (data == NULL) {
-    vtf_error("Internal error: data==NULL in vtf_read_next_timestep", 0);
-    return MOLFILE_ERROR;
-  }
-
-  if (natoms <= 0) {
-    vtf_error("Internal error: natoms <= 0 in vtf_read_next_timestep", 0);
-    return MOLFILE_ERROR;
-  }
-
-  errno = 0;
-
-  d = (vtf_data*)data;
-
-  aid = 0;
-
-  if (feof(d->file)) return MOLFILE_EOF;
-
-  if (d->coords == NULL) {
-    /* initialize coords */
-    d->coords = malloc(natoms*3*sizeof(float));
-    /* TODO: error handling */
-    for (n = 0; n < natoms*3; n++)
-      d->coords[n] = 0.0;
-  } 
-  
-  /* read in the data, until the next timestep or EOF is reached */
-  do {
-    line = vtf_getline(d->file);
-
-    if (line == NULL) {
-      if (errno != 0) {
-        perror("vtfplugin");
-        return MOLFILE_ERROR;
-      }
-      break;
-    } 
-
-    /* At the beginning of a vcf file, skip a timestep line */
-    if (d->timestep_mode == TIMESTEP_VCFSTART) {
-      switch (tolower(line[0])) {
-      case 'c': 
-      case 't':
-        /* Remove the "timestep" or "coordinates" keyword */
-        sscanf(line, " %255s%n", s, &n);
-        line += n;
-      case 'i': 
-      case 'o': 
-        if (vtf_parse_timestep(line, d) != MOLFILE_SUCCESS)
-          return MOLFILE_ERROR;
-        line = vtf_getline(d->file);
-        break;
-      default:
-        /* if this is already a coordinate line, expect an ordered block */
-        d->timestep_mode = TIMESTEP_ORDERED;
-      }
-    }
-
-    /* parse timestep data */
-    if (d->timestep_mode == TIMESTEP_ORDERED 
-        && sscanf(line, " %f %f %f%n", &x, &y, &z, &n) == 3) {
-      if (aid < (unsigned int)natoms) {
-        d->coords[aid*3] = x;
-        d->coords[aid*3+1] = y;
-        d->coords[aid*3+2] = z;
-#ifdef _USE_TCL
-        if (d->read_mode == VTF_USERDATA) {
-          /* the rest of the line is userdata */
-          line += n;
-          vtf_set_coordinate_userdata(d->timestep, aid, line);
-        }
-#endif
-        aid++;
-      } else {
-        vtf_error("too many atom coordinates in ordered timestep block", line);
-        return MOLFILE_ERROR;
-      }
-    } else if (d->timestep_mode == TIMESTEP_INDEXED 
-               && sscanf(line, " %u %f %f %f%n", 
-                         &aid, &x, &y, &z, &n) == 4) {
-      if (aid < (unsigned int)natoms) {
-        d->coords[aid*3] = x;
-        d->coords[aid*3+1] = y;
-        d->coords[aid*3+2] = z;
-#ifdef _USE_TCL
-        if (d->read_mode == VTF_USERDATA) {
-          /* the rest of the line is userdata */
-          line += n;
-          vtf_set_coordinate_userdata(d->timestep, aid, line);
-        }
-#endif
-      } else {
-        vtf_error("atom id too large in indexed timestep block", line);
-        return MOLFILE_ERROR;
-      }
-    } else switch (tolower(line[0])) {
-        /* PBC/UNITCELL RECORD */
-      case 'u':
-      case 'p': {
-        /* Remove the "pbc"/"unitcell" keyword */
-        sscanf(line, " %255s%n", s, &n);
-        line += n;
-        if (vtf_parse_pbc(line, d) != MOLFILE_SUCCESS) 
-          return MOLFILE_ERROR;
-        break;
-      }
-
-        /* USER DATA RECORD */
-      case 'd': {
-        /* Remove the "data" keyword */
-        sscanf(line, " %255s%n", s, &n);
-#ifdef _USE_TCL
-        if (d->read_mode == VTF_USERDATA) {
-          line += n;
-          vtf_set_timestep_userdata(d->timestep, line);
-        }
-#endif
-        break;
-      }
-        
-        /* TIMESTEP RECORD */
-      case 'c': 
-      case 't': {
-        /* Remove the "timestep" or "coordinates" keyword */
-        sscanf(line, " %255s%n", s, &n);
-        line += n;
-      }
-      case 'i': 
-      case 'o': { 
-        if (vtf_parse_timestep(line, d) != MOLFILE_SUCCESS)
-          return MOLFILE_ERROR;
-        line = NULL; /* indicate end of this timestep */
-        d->timestep++;
-        break;
-      }
-        
-      default: { 
-        if (d->timestep_mode == TIMESTEP_INDEXED)
-          vtf_error("unknown line in indexed timestep block", line);
-        else
-          vtf_error("unknown line in ordered timestep block", line);
-        return MOLFILE_ERROR;
-      }
-      }
-
-    if (line == NULL) break;
-  } while (1);
-
-  if (ts != NULL) {
-    /* copy the ts data */
-    ts->A = d->A;
-    ts->B = d->B;
-    ts->C = d->C;
-    ts->alpha = d->alpha;
-    ts->beta = d->beta;
-    ts->gamma = d->gamma;
-    memcpy(ts->coords, d->coords, natoms*3*sizeof(float));
-    ts->velocities = NULL;
-    ts->physical_time = 0.0;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-/***************************************************
- * Copy the info collected in vtf_open_file_read
- ***************************************************/
-static int vtf_read_structure(void *data, 
-                              int *optflags, 
-                              molfile_atom_t *atoms) {
-  vtf_data *d;
-  d = (vtf_data*)data;
-
-  if (d->return_code != MOLFILE_SUCCESS) 
-    return d->return_code;
-
-  if (d->natoms > 0) {
-    /* copy the data parsed in vtf_open_file_read() */
-    memcpy(atoms, d->atoms, d->natoms*sizeof(molfile_atom_t));
-    /* free the data parsed in vtf_open_file_read() */
-    sfree(d->atoms);
-    d->atoms = NULL;
-  }
-
-  *optflags = d->optflags;
-
-  return MOLFILE_SUCCESS;
-}
-
-static int vtf_read_bonds(void *data, 
-                          int *nbonds, 
-                          int **from, 
-                          int **to,
-                          float **bondorder, 
-                          int **bondtype, 
-                          int *nbondtypes, 
-                          char ***bondtypename) {
-  vtf_data *d;
-  if (!data) {
-    vtf_error("Internal error: data==NULL in vtf_read_bonds", 0);
-    return MOLFILE_ERROR;
-  }
-
-  d = (vtf_data*)data;
-
-  *nbonds = d->nbonds;
-  *from = d->from;
-  *to = d->to;
-  *bondorder = NULL;
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-  return MOLFILE_SUCCESS;
-}
-
-/***************************************************/
-/* MOLFILE READER PLUGIN PART */
-/***************************************************/
-static molfile_plugin_t vsfplugin;
-static molfile_plugin_t vtfplugin;
-static molfile_plugin_t vcfplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&vsfplugin, 0, sizeof(molfile_plugin_t));
-  vsfplugin.abiversion = vmdplugin_ABIVERSION;
-  vsfplugin.type = MOLFILE_PLUGIN_TYPE;
-  vsfplugin.name = "vsf";
-  vsfplugin.author = "Olaf Lenz";
-  vsfplugin.majorv = VERSION_MAJOR;
-  vsfplugin.minorv = VERSION_MINOR;
-  vsfplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vsfplugin.filename_extension = "vsf";
-  vsfplugin.open_file_read = vtf_open_file_read;
-  vsfplugin.read_structure = vtf_read_structure;
-  vsfplugin.read_bonds = vtf_read_bonds;
-  /* plugin.read_next_timestep = vtf_read_next_timestep; */
-  vsfplugin.close_file_read = vtf_close_file_read;
-#if vmdplugin_ABIVERSION >= 9
-  vsfplugin.prettyname = "VTF structure format";
-#endif
-
-  memset(&vcfplugin, 0, sizeof(molfile_plugin_t));
-  vcfplugin.abiversion = vmdplugin_ABIVERSION;
-  vcfplugin.type = MOLFILE_PLUGIN_TYPE;
-  vcfplugin.name = "vcf";
-  vcfplugin.author = "Olaf Lenz";
-  vcfplugin.majorv = VERSION_MAJOR;
-  vcfplugin.minorv = VERSION_MINOR;
-  vcfplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vcfplugin.filename_extension = "vcf";
-  vcfplugin.open_file_read = vtf_open_file_read;
-  vcfplugin.read_next_timestep = vtf_read_next_timestep;
-  vcfplugin.close_file_read = vtf_close_file_read;
-#if vmdplugin_ABIVERSION >= 9
-  vcfplugin.prettyname = "VTF coordinate format";
-#endif
-
-  memset(&vtfplugin, 0, sizeof(molfile_plugin_t));
-  vtfplugin.abiversion = vmdplugin_ABIVERSION;
-  vtfplugin.type = MOLFILE_PLUGIN_TYPE;
-  vtfplugin.name = "vtf";
-  vtfplugin.author = "Olaf Lenz";
-  vtfplugin.majorv = VERSION_MAJOR;
-  vtfplugin.minorv = VERSION_MINOR;
-  vtfplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vtfplugin.filename_extension = "vtf";
-  vtfplugin.open_file_read = vtf_open_file_read;
-  vtfplugin.read_structure = vtf_read_structure;
-  vtfplugin.read_bonds = vtf_read_bonds;
-  vtfplugin.read_next_timestep = vtf_read_next_timestep;
-  vtfplugin.close_file_read = vtf_close_file_read;
-#if vmdplugin_ABIVERSION >= 9
-  vtfplugin.prettyname = "VTF trajectory format";
-#endif
-
-  /*printf("Loaded VTF/VSF/VCF plugins v%i.%i.\n", VERSION_MAJOR, VERSION_MINOR); */
-
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&vsfplugin);
-  (*cb)(v, (vmdplugin_t *)&vcfplugin);
-  (*cb)(v, (vmdplugin_t *)&vtfplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-#ifdef _USE_TCL
-/***************************************************/
-/* VTFTOOLS USERDATA PART */
-/***************************************************/
-static int vtf_parse_userdata(ClientData clientData, 
-                              Tcl_Interp *interp, 
-                              int argc, 
-                              const char *argv[]) {
-  /* Usage: vtf_parse_userdata path type */
-  int natoms;
-  const char *file, *type;
-  vtf_data *d;
-  char result[255];
-  int rc;
-
-  if (argc != 5) {
-    sprintf(result, "wrong # args: should be \"%s fileName fileType varName molId\"", argv[0]);
-    Tcl_SetResult(interp, result, TCL_VOLATILE);
-    return TCL_ERROR;
-  }
-
-  file = argv[1];
-  type = argv[2];
-  userdata_varname = argv[3];
-  molid = argv[4];
-  tcl_interp = interp;
-  
-  d = _vtf_open_file_read(file, type, &natoms, VTF_USERDATA);
-  if (d == NULL) {
-    sprintf(result, "%s: an error occured while reading the structure", argv[0]);
-    Tcl_SetResult(interp, result, TCL_VOLATILE);
-    return TCL_ERROR;
-  }
-  
-  do {
-    rc = vtf_read_next_timestep(d, d->natoms, NULL);
-  } while (rc == MOLFILE_SUCCESS);
-
-  sprintf(result, "%s: Read %d atoms and %d timesteps.", 
-          argv[0], d->natoms, d->timestep);
-  Tcl_SetResult(interp, result, TCL_VOLATILE);
-  vtf_close_file_read(d);
-  return TCL_OK;
-}
-
-int Vtfplugin_Init(Tcl_Interp *interp) {
-  char version_string[20];
-
-  /* Set up for stubs. */
-  if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
-    Tcl_SetResult(interp, "Tcl_InitStubs failed", TCL_STATIC);
-    return TCL_ERROR;
-  }
-
-  sprintf(version_string, "%d.%d", VERSION_MAJOR, VERSION_MINOR);
-  if (Tcl_PkgProvide(interp, "vtfplugin", version_string) == TCL_ERROR) {
-    return TCL_ERROR;
-  }
-
-  /* Create the Tcl command. */
-  Tcl_CreateCommand(interp, 
-                    "vtf_parse_userdata", vtf_parse_userdata, 
-                    NULL, NULL);
-  return TCL_OK;
-}
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vtkplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vtkplugin.C
deleted file mode 100644
index ad644f980d500b318814ab674530fe78bed46698..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/vtkplugin.C
+++ /dev/null
@@ -1,445 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 2007-2011 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: vtkplugin.C,v $
- *      $Author: johns $        $Locker:  $             $State: Exp $
- *      $Revision: 1.5 $      $Date: 2015/10/26 22:14:45 $
- *
- ***************************************************************************
- * DESCRIPTION:
- *   Plugin for reading uniform grids and vector fields written 
- *   in the VTK ASCII format
- ***************************************************************************/
-
-//
-// Prototype file reader developed using VTK refs and a couple samples:
-//   http://www.vtk.org/Wiki/VTK/Tutorials/3DDataTypes
-//   http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf
-//
-
-// This parser currently expects the data to be formatted like this:
-// # vtk DataFile Version X.0
-// titletext
-// ASCII
-// DATASET STRUCTURED_POINTS
-// DIMENSIONS XXX YYY ZZZ
-// SPACING XX YY ZZ
-// ORIGIN XX YY XX
-// POINT_DATA n
-//
-// And either a field like this:
-// FIELD fieldname numarrays
-// arrayname0 numcomponents numtuples datatype
-// val0 val1 ...
-//
-// Or a list of vectors like this:
-// VECTORS dataname datatype
-// val0 val1 ...
-//
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#if defined(WIN32) || defined(WIN64)
-#define strcasecmp  stricmp
-#define strncasecmp strnicmp
-#endif
-
-#include "molfile_plugin.h"
-#include "largefiles.h"
-
-#define THISPLUGIN plugin
-#include "vmdconio.h"
-
-#define LINESIZE 2040
-
-typedef struct {
-  FILE *fd;
-  char title[257]; /// spec says 256 chars max w/ newline termination
-  int nsets;
-  molfile_volumetric_t *vol;
-  int isBinary; 
-} vtk_t;
-
-
-// Get a string from a stream, printing any errors that occur
-static char *vtkgets(char *s, int n, FILE *stream) {
-  char *returnVal;
-
-  if (feof(stream)) {
-    printf("vtkplugin) Unexpected end-of-file.\n");
-    return NULL;
-  } else if (ferror(stream)) {
-    printf("vtkplugin) Error reading file.\n");
-    return NULL;
-  } else {
-    returnVal = fgets(s, n, stream);
-    if (returnVal == NULL) {
-      printf("vtkplugin) Error reading line.\n");
-    }
-  }
-
-  return returnVal;
-}
-
-
-static int vtkgetstrcmp(char *s, int n, FILE *stream, const char *cmpstr) {
-  char *str = vtkgets(s, n, stream);
-  int rc = strncmp(cmpstr, str, strlen(cmpstr));
-  if (rc) {
-    printf("vtkplugin) found '%s', expected '%s'\n", str, cmpstr);
-  }
-  return rc;
-}
-   
-
-static void *open_vtk_read(const char *filepath, const char *filetype,
-    int *natoms) {
-  FILE *fd;
-  vtk_t *vtk;
-  char inbuf[LINESIZE];
-  int xsize, ysize, zsize;
-  float orig[3], xdelta[3], ydelta[3], zdelta[3];
- 
-  memset(orig, 0, sizeof(orig));
-  memset(xdelta, 0, sizeof(xdelta));
-  memset(ydelta, 0, sizeof(ydelta));
-  memset(zdelta, 0, sizeof(zdelta));
- 
-  fd = fopen(filepath, "rb");
-  if (!fd) {
-    printf("vtkplugin) Error opening file.\n");
-    return NULL;
-  }
-
-  // allocate and initialize the vtk structure
-  vtk = new vtk_t;
-  memset(vtk, 0, sizeof(vtk_t));
-  vtk->fd = fd;
-  vtk->vol = NULL;
-  vtk->isBinary = 0;
-  *natoms = MOLFILE_NUMATOMS_NONE;
-  vtk->nsets = 1; /* this file contains only one data set */
-
-  /* skip comments */
-  do {
-    if (vtkgets(inbuf, LINESIZE, fd) == NULL) 
-      return NULL;
-  } while (inbuf[0] == '#');
-
-  // read VTK title line 
-  printf("vtkplugin) Dataset title: '%s'\n", inbuf);
-  strncpy(vtk->title, inbuf, sizeof(vtk->title) - 1);
-  vtk->title[256]='\0'; // force-terminate potentially truncated title string
-
-  if (vtkgetstrcmp(inbuf, LINESIZE, fd, "ASCII")) return NULL;
-  if (vtkgetstrcmp(inbuf, LINESIZE, fd, "DATASET STRUCTURED_POINTS")) return NULL;
-
-  // get the grid dimensions
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  if (sscanf(inbuf, "DIMENSIONS %d %d %d", &xsize, &ysize, &zsize) != 3) {
-    printf("vtkplugin) Error reading grid dimensions!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get the grid spacing
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  if (sscanf(inbuf, "SPACING %e %e %e", xdelta, ydelta+1, zdelta+2) != 3) {
-    printf("vtkplugin) Error reading cell dimensions!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get the grid origin
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  if (sscanf(inbuf, "ORIGIN %e %e %e", orig, orig+1, orig+2) != 3) {
-    printf("vtkplugin) Error reading grid origin!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get number of grid points
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-  int numgridpoints = 0;
-  if (sscanf(inbuf, "POINT_DATA %d", &numgridpoints) != 1) {
-    printf("vtkplugin) Error reading grid point counts!\n");
-    delete vtk;
-    return NULL;
-  }
-
-  // get field or vector list depending on file format variant we have
-  if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-    delete vtk;
-    return NULL;
-  }
-
-  char tmp[256];
-  sscanf(inbuf, "%s", tmp);
-  if (!strcmp(tmp, "FIELD")) {
-    char fieldname[256];
-    int numarrays=0;
-    sscanf(inbuf, "FIELD %s %d", fieldname, &numarrays);
-    printf("vtkplugin) FIELD: name '%s', %d arrays\n", fieldname, numarrays);
-
-    // eat the array name for field zero
-    if (vtkgets(inbuf, LINESIZE, fd) == NULL) {
-      delete vtk;
-      return NULL;
-    }
-  } else if (!strcmp(tmp, "VECTORS")) {
-    // prepare to eat vectors
-    char fieldname[256];
-    int numvecs=0;
-    sscanf(inbuf, "VECTORS %s %d", fieldname, &numvecs);
-    printf("vtkplugin) VECTORS: name '%s', %d arrays\n", fieldname, numvecs);
-  } else {
-    printf("vtkplugin) Unrecognized file structure, aborting!:\n");
-    printf("vtkplugin) line contents: '%s'\n", inbuf);
-    delete vtk;
-    return NULL;
-  } 
-
-  vtk->vol = new molfile_volumetric_t[1];
-  memset(vtk->vol, 0, sizeof(molfile_volumetric_t));
-  strcpy(vtk->vol[0].dataname, "VTK volumetric map");
-
-  /* Set the unit cell origin and basis vectors */
-  for (int i=0; i<3; i++) {
-    vtk->vol[0].origin[i] = orig[i];
-    vtk->vol[0].xaxis[i] = xdelta[i] * ((xsize-1 > 0) ? (xsize-1) : 1);
-    vtk->vol[0].yaxis[i] = ydelta[i] * ((ysize-1 > 0) ? (ysize-1) : 1);
-    vtk->vol[0].zaxis[i] = zdelta[i] * ((zsize-1 > 0) ? (zsize-1) : 1);
-  }
-
-  vtk->vol[0].xsize = xsize;
-  vtk->vol[0].ysize = ysize;
-  vtk->vol[0].zsize = zsize;
-
-#if vmdplugin_ABIVERSION > 16
-  vtk->vol[0].has_scalar = 1;
-  vtk->vol[0].has_gradient = 1;
-  vtk->vol[0].has_variance = 0;
-#endif
-  vtk->vol[0].has_color = 0; // no color data
-
-  return vtk;
-}
-
-
-static int read_vtk_metadata(void *v, int *nsets, 
-  molfile_volumetric_t **metadata) {
-  vtk_t *vtk = (vtk_t *)v;
-  *nsets = vtk->nsets; 
-  *metadata = vtk->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_vtk_data(void *v, int set, float *datablock,
-                         float *colorblock) {
-  vtk_t *vtk = (vtk_t *)v;
-  FILE *fd = vtk->fd;
-  int x, y, z, xsize, ysize, zsize, xysize, total;
-
-  if (vtk->isBinary)
-    return MOLFILE_ERROR;
-
-  xsize = vtk->vol[0].xsize;
-  ysize = vtk->vol[0].ysize;
-  zsize = vtk->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  double scalemag = 1.0;
-  const char *userscalefactor=getenv("VMDVTKPLUGINSCALEVOXELMAG");
-  if (userscalefactor) {
-    scalemag = atof(userscalefactor);
-    if (scalemag != 0.0) {
-      printf("vtkplugin) Applying user scaling factor to voxel scalar/gradient values: %g\n", scalemag); 
-    } else {
-      printf("vtkplugin) Warning: ignoring user scaling factor due to parse error or zero-value\n"); 
-    }
-  } else {
-    printf("vtkplugin) No user scaling factor set, using scale factor 1.0.\n");
-  }
-
-  float maxmag = 0.0f;
-  strcpy(vtk->vol[0].dataname, "volgradient");
-  for (z=0; z<zsize; z++) {
-    for (y=0; y<ysize; y++) {
-      for (x=0; x<xsize; x++) {
-        double vx, vy, vz;
-        fscanf(fd, "%lf %lf %lf", &vx, &vy, &vz);
-
-#if 1
-        // XXX hack to allow user override of voxel magnitude
-        // during loading...
-        vx *= scalemag;
-        vy *= scalemag;
-        vz *= scalemag;
-#endif
-
-        // compute scalar magnitude from vector field
-        double mag = sqrt(vx*vx + vy*vy + vz*vz);
-
-        int addr = z*xsize*ysize + y*xsize + x;
-        datablock[addr] = mag;
-
-        if (mag > maxmag)
-          maxmag = mag;
-      }
-    }
-  }
-  printf("vtkplugin) maxmag: %g\n", maxmag);
-
-  return MOLFILE_SUCCESS;
-}
-
-
-#if vmdplugin_ABIVERSION > 16
-
-static int read_vtk_data_ex(void *v, molfile_volumetric_readwrite_t *p) {
-  vtk_t *vtk = (vtk_t *)v;
-  FILE *fd = vtk->fd;
-  int x, y, z, xsize, ysize, zsize, xysize, total;
-
-  if (vtk->isBinary)
-    return MOLFILE_ERROR;
-
-  if (!p->scalar || !p->gradient) 
-    return MOLFILE_ERROR;
-
-  xsize = vtk->vol[0].xsize;
-  ysize = vtk->vol[0].ysize;
-  zsize = vtk->vol[0].zsize;
-  xysize = xsize * ysize;
-  total = xysize * zsize;
-
-  double scalemag = 1.0;
-  const char *userscalefactor=getenv("VMDVTKPLUGINSCALEVOXELMAG");
-  if (userscalefactor) {
-    scalemag = atof(userscalefactor);
-    if (scalemag != 0.0) {
-      printf("vtkplugin) Applying user scaling factor to voxel scalar/gradient values: %g\n", scalemag); 
-    } else {
-      printf("vtkplugin) Warning: ignoring user scaling factor due to parse error or zero-value\n"); 
-    }
-  } else {
-    printf("vtkplugin) No user scaling factor set, using scale factor 1.0.\n");
-  }
-
-  float maxmag = 0.0f;
-  strcpy(vtk->vol[0].dataname, "volgradient");
-  for (z=0; z<zsize; z++) {
-    for (y=0; y<ysize; y++) {
-      for (x=0; x<xsize; x++) {
-        double vx, vy, vz;
-        fscanf(fd, "%lf %lf %lf", &vx, &vy, &vz);
-
-#if 1
-        // XXX hack to allow user override of voxel magnitude
-        // during loading...
-        vx *= scalemag;
-        vy *= scalemag;
-        vz *= scalemag;
-#endif
-
-        // compute scalar magnitude from vector field
-        double mag = sqrt(vx*vx + vy*vy + vz*vz);
-
-        int addr = z*xsize*ysize + y*xsize + x;
-        p->scalar[addr] = mag;
-
-        if (mag > maxmag)
-          maxmag = mag;
-
-        // assign vector field to gradient map
-        // index into vector field of 3-component vectors
-        int addr3 = addr *= 3;
-        p->gradient[addr3    ] = vx;
-        p->gradient[addr3 + 1] = vy;
-        p->gradient[addr3 + 2] = vz;
-      }
-    }
-  }
-  printf("vtkplugin) maxmag: %g\n", maxmag);
-
-  return MOLFILE_SUCCESS;
-}
-
-#endif
-
-
-static void close_vtk_read(void *v) {
-  vtk_t *vtk = (vtk_t *)v;
-  
-  fclose(vtk->fd);
-  if (vtk->vol != NULL)
-    delete [] vtk->vol; 
-  delete vtk;
-}
-
-
-//
-// Initialization stuff here
-//
-static molfile_plugin_t vtkplugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&vtkplugin, 0, sizeof(molfile_plugin_t));
-  vtkplugin.abiversion = vmdplugin_ABIVERSION;
-  vtkplugin.type = MOLFILE_PLUGIN_TYPE;
-  vtkplugin.name = "vtk";
-  vtkplugin.prettyname = "VTK grid reader";
-  vtkplugin.author = "John Stone";
-  vtkplugin.majorv = 0;
-  vtkplugin.minorv = 2;
-  vtkplugin.is_reentrant = VMDPLUGIN_THREADUNSAFE;
-  vtkplugin.filename_extension = "vtk";
-  vtkplugin.open_file_read = open_vtk_read;
-  vtkplugin.read_volumetric_metadata = read_vtk_metadata;
-  vtkplugin.read_volumetric_data = read_vtk_data;
-#if vmdplugin_ABIVERSION > 16
-  vtkplugin.read_volumetric_data_ex = read_vtk_data_ex;
-#endif
-  vtkplugin.close_file_read = close_vtk_read;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&vtkplugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/webpdbplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/webpdbplugin.c
deleted file mode 100644
index b0b7963bf7600114154492ba0f180ddcbf356964..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/webpdbplugin.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: webpdbplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.54 $       $Date: 2016/11/28 05:01:55 $
- *
- ***************************************************************************/
-
-#include <tcl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "molfile_plugin.h"
-#include "readpdb.h"
-#include "periodic_table.h"
-
-/*
- * Load pdb from the RCSB
- * Uses Tcl
- */
-
-/*
- * Need my own read_pdb_record because the one in readpdb takes a FILE*.
- * This one will be better anyway since I don't recopy the string ;-)
- * Read the given pdb string.  On returning, pos will point to the start of
- * the next read. 
- */ 
-static int my_read_pdb_record(const char *pdb, char **pos) {
-  int recType = PDB_UNKNOWN;
-  char *nlpos;  /* newline position */
-
-  nlpos = strchr(pdb, '\n'); /* XXX segv occurs on x86_64 linux */
-                             /* loading '1epw' or '1sft'        */ 
-
-  if (!nlpos) {
-    return PDB_EOF;
-  } 
-
-  /* set the next position to the first char after the newline */
-  *pos = nlpos + 1;
-
-  /* atom records are the most common */
-  if (!strncmp(pdb, "ATOM ",  5) || !strncmp(pdb, "HETATM", 6)) {
-    /* Note that by only comparing 5 chars for "ATOM " rather than 6,     */
-    /* we allow PDB files containing > 99,999 atoms generated by AMBER    */
-    /* to load which would otherwise fail.  Not needed for HETATM since   */
-    /* those aren't going to show up in files produced for/by MD engines. */
-    recType = PDB_ATOM;
-  } else if (!strncmp(pdb, "REMARK", 6)) {
-    recType = PDB_REMARK;
-  } else if (!strncmp(pdb, "CRYST1", 6)) {
-    recType = PDB_CRYST1;
-  } else if (!strncmp(pdb, "HEADER", 6)) {
-    recType = PDB_HEADER;
-  } else if (!strncmp(pdb, "END", 3)) {  /* very permissive */
-    /* XXX we treat any "ENDxxx" record as an end, to simplify testing */
-    /*     since we don't remove trailing '\n' chars                   */
-
-    /* the only two legal END records are "END   " and "ENDMDL" */
-    recType = PDB_END;
-  } 
-
-  return recType;
-}
-
- 
-typedef struct {
-  char *pdbstr; 
-  char *pos;
-  int natoms;
-  molfile_metadata_t *meta;
-  int nconect;
-  int nbonds, maxbnum;
-  int *from, *to, *idxmap;
-} pdbdata;
-
-
-static void *pdb_read(char *pdbstr, int *natoms) {
-  pdbdata *pdb;
-  int indx, nconect;
-  char *pos = pdbstr;
-  char *next;
-
-  if (!pdbstr) return NULL;
-
-  pdb = (pdbdata *)malloc(sizeof(pdbdata));
-  pdb->meta = (molfile_metadata_t *) malloc(sizeof(molfile_metadata_t));
-  memset(pdb->meta, 0, sizeof(molfile_metadata_t));
-
-  pdb->meta->remarklen = 0;
-  pdb->meta->remarks = NULL;
-
-  *natoms=0;
-  nconect=0;
-  do {
-    indx = my_read_pdb_record(pos, &next);
-    if (indx == PDB_ATOM) {
-      *natoms += 1;
-    } else if (indx == PDB_CONECT) {
-      nconect++;
-    } else if (indx == PDB_HEADER) {
-      get_pdb_header(pos, pdb->meta->accession, pdb->meta->date, NULL);
-      if (strlen(pdb->meta->accession) > 0)
-        strcpy(pdb->meta->database, "PDB");
-    } else if (indx == PDB_REMARK || indx == PDB_UNKNOWN) {
-      int len = next - pos;
-      int newlen = len + pdb->meta->remarklen;
-
-      char *newstr=realloc(pdb->meta->remarks, newlen + 1);
-      if (newstr != NULL) {
-        pdb->meta->remarks = newstr;
-        pdb->meta->remarks[pdb->meta->remarklen] = '\0';
-        memcpy(pdb->meta->remarks + pdb->meta->remarklen, pos, len);
-        pdb->meta->remarks[newlen] = '\0';
-        pdb->meta->remarklen = newlen;
-      }
-    }
-
-    pos = next;
-  } while (indx != PDB_END && indx != PDB_EOF);
-
-  pdb->pdbstr = pdbstr;
-  pdb->pos =    pdbstr;
-
-  pdb->natoms = *natoms;
-  pdb->nconect = nconect;
-  pdb->nbonds = 0;
-  pdb->maxbnum = 0;
-  pdb->from = NULL;
-  pdb->to = NULL;
-  pdb->idxmap = NULL;
-
-#if defined(VMDUSECONECTRECORDS)
-  /* allocate atom index translation table if we have 99,999 atoms or less */
-  /* and we have conect records to process                                 */
-  if (pdb->natoms < 100000 && pdb->nconect > 0) {
-    pdb->idxmap = (int *) malloc(100000 * sizeof(int));
-    memset(pdb->idxmap, 0, 100000 * sizeof(int));
-  }
-#endif
-
-  return pdb;
-}
-
-static const char *rcsbmsg[] = {
-  "  The PDB is supported by RCSB, the NSF, US PHS, NIH, NCRP, NIGMS, NLM,",
-  "and US DoE, who are not liable for the data.  PDB files shall not be",
-  "sold.  See ftp://ftp.rcsb.org/advisory.doc for full details."
-};
-
-static int show_msg = 1;
-
-static void *open_file_read(const char *filename, const char *filetype,
-    int *natoms) {
-
-  Tcl_Interp *interp;
-  char url[300];
-  char cmd[300]; 
-  char *pdbfile;
-  const char *result;
-  void *v;
-
-  /*
-   * Create and initialize the interpreter
-   */
-  interp = Tcl_CreateInterp();
-  if (!interp) {
-    fprintf(stderr, "Could not create new Tcl Interp\n");
-    return NULL; 
-  }
-  if (Tcl_Init(interp) != TCL_OK) {
-    fprintf(stderr, "Warning, could not create initialize Tcl Interp\n");
-  }
-  if (!Tcl_PkgRequire(interp, (char *)"http", (char *)"2.0", 0)) {
-    fprintf(stderr, "Could not load http package\n");
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  }
-
-  if (strlen(filename) != 4) {
-    fprintf(stderr, "PDB code %s is invalid; PDB accession codes have four letters.\n", filename);
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  }
-
-  if (show_msg) {
-    int i;
-    show_msg = 0;
-    for (i=0; i<3; i++) printf("%s\n", rcsbmsg[i]);
-  }
-
-  /* Adapted to new PDB website layout, changed on 1/1/2006 */
-  sprintf(url, "http://www.rcsb.org/pdb/downloadFile.do?fileFormat=pdb&compression=NO&structureId=%s",filename);
-  sprintf(cmd, "set token [::http::geturl \"%s\"]", url);
-  if (Tcl_Eval(interp, cmd) != TCL_OK) {
-    fprintf(stderr, "Error loading PDB: %s\n", Tcl_GetStringResult(interp));
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  } 
-  sprintf(cmd, "upvar #0 $token state");
-  Tcl_Eval(interp, cmd); 
-  
-  result = Tcl_GetVar2(interp, (char *)"state", "body", TCL_GLOBAL_ONLY); 
-  if (!result) {
-    fprintf(stderr, "Error loading PDB: %s\n", Tcl_GetStringResult(interp));
-    Tcl_DeleteInterp(interp);
-    return NULL;
-  } 
-  pdbfile = strdup(result);
-  Tcl_DeleteInterp(interp);
-
-  /* XXX this code needs updating still */
-  /* pdbfile will be free'd by close_pdb() */
-  v = pdb_read(pdbfile, natoms); 
-  return v;
-}
-   
-static int read_pdb_structure(void *mydata, int *optflags, 
-    molfile_atom_t *atoms) {
-
-  pdbdata *pdb = (pdbdata *)mydata;
-  char *pos = pdb->pdbstr;
-  char *next;
-  int i, rectype, atomserial, pteidx;
-  char ridstr[8];
-  char elementsymbol[3];
-  molfile_atom_t *atom;
-  int badptecount = 0;
-  elementsymbol[2]=0;
-
-  *optflags = MOLFILE_INSERTION | MOLFILE_OCCUPANCY | MOLFILE_BFACTOR | 
-              MOLFILE_ALTLOC | MOLFILE_ATOMICNUMBER | MOLFILE_BONDSSPECIAL;
-
-  i=0; /* Count atoms */
-  do {
-    rectype = my_read_pdb_record(pos, &next);
-    switch (rectype) {
-    case PDB_ATOM:
-      atom = atoms+i;
-      get_pdb_fields(pos, next-pos, &atomserial,
-          atom->name, atom->resname, atom->chain, atom->segid, 
-          ridstr, atom->insertion, atom->altloc, elementsymbol,
-          NULL, NULL, NULL, &atom->occupancy, &atom->bfactor);
-
-      if (pdb->idxmap != NULL && atomserial < 100000) {
-        pdb->idxmap[atomserial] = i; /* record new serial number translation */
-      }
-
-      atom->resid = atoi(ridstr);
-
-      /* determine atomic number from the element symbol */
-      pteidx = get_pte_idx_from_string(elementsymbol);
-      atom->atomicnumber = pteidx;
-      if (pteidx != 0) {
-        atom->mass = get_pte_mass(pteidx);
-        atom->radius = get_pte_vdw_radius(pteidx);
-      } else {
-        badptecount++; /* unrecognized element */
-      }
-
-      strcpy(atom->type, atom->name);
-      i++;
-      break;
-
-    case PDB_CONECT:
-      /* only read CONECT records for structures where we know they can */
-      /* be valid for all of the atoms in the structure                 */
-      if (pdb->idxmap != NULL) {
-        char cbuf[PDB_BUFFER_LENGTH];
-        int len = next-pos;
-
-        if (len > PDB_BUFFER_LENGTH) 
-          len = PDB_BUFFER_LENGTH;
-        strncpy(cbuf, pos, len);
-        get_pdb_conect(cbuf, pdb->natoms, pdb->idxmap,
-                       &pdb->maxbnum, &pdb->nbonds, &pdb->from, &pdb->to);
-      }
-      break;
-
-    default:
-      /* other record types are ignored in the structure callback */
-      /* and are dealt with in the timestep callback or elsewhere */
-      break;
-    }
-    pos = next;
-  } while (rectype != PDB_END && rectype != PDB_EOF);
-
-  /* if all atoms are recognized, set the mass and radius flags too,  */
-  /* otherwise let VMD guess these for itself using it's own methods  */
-  if (badptecount == 0) {
-    *optflags |= MOLFILE_MASS | MOLFILE_RADIUS;
-  }
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                      float **bondorder, int **bondtype, 
-                      int *nbondtypes, char ***bondtypename) {
-  pdbdata *pdb = (pdbdata *)v;
- 
-  *nbonds = 0;
-  *fromptr = NULL;
-  *toptr = NULL;
-  *bondorder = NULL; /* PDB files don't have bond order information */
-  *bondtype = NULL;
-  *nbondtypes = 0;
-  *bondtypename = NULL;
-
-/* The newest plugin API allows us to return CONECT records as
- * additional bonds above and beyond what the distance search returns.
- * Without that feature, we otherwise have to check completeness and
- * ignore them if they don't look to be fully specified for this molecule */
-#if !defined(MOLFILE_BONDSSPECIAL)
-  if (pdb->natoms >= 100000) {
-    printf("webpdbplugin) Warning: more than 99,999 atoms, ignored CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (((float) pdb->nconect / (float) pdb->natoms) <= 0.85) {
-    printf("webpdbplugin) Warning: Probable incomplete bond structure specified,\n");
-    printf("webpdbplugin)          ignoring CONECT records\n");
-    return MOLFILE_SUCCESS;
-  } else if (pdb->nconect == 0) {
-    return MOLFILE_SUCCESS;
-  }
-#endif
-
-  *nbonds = pdb->nbonds;
-  *fromptr = pdb->from;
-  *toptr = pdb->to;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_next_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  pdbdata *pdb = (pdbdata *)v;
-  char *pos = pdb->pos;
-  char *next;
-  float *x, *y, *z;
-  float occup, bfac;
-  int indx, i = 0;
-
-  if (ts) {
-    x = ts->coords;
-    y = x+1;
-    z = x+2;
-  } else {
-    x = y = z = 0;
-  }
-  do {
-    indx = my_read_pdb_record(pos, &next);
-    if((indx == PDB_END || indx == PDB_EOF) && (i < pdb->natoms)) {
-      return MOLFILE_ERROR;
-    } else if(indx == PDB_ATOM) {
-      if(i++ >= pdb->natoms) {
-        break;
-      }
-      /* just get the coordinates, and store them */
-      if (ts) {
-        get_pdb_coordinates(pos, x, y, z, &occup, &bfac);
-        x += 3;
-        y += 3;
-        z += 3;
-      }
-    } else if (indx == PDB_CRYST1) {
-      if (ts) {
-        get_pdb_cryst1(pos, &ts->alpha, &ts->beta, &ts->gamma,
-                               &ts->A, &ts->B, &ts->C);
-      }
-    }
-    pos = next;
-  } while(!(indx == PDB_END || indx == PDB_EOF));
-  pdb->pos = pos;
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_pdb_read(void *v) {
-  pdbdata *pdb = (pdbdata *)v;
-  if (!pdb) return;
-  free(pdb->pdbstr);
-  if (pdb->idxmap != NULL)
-    free(pdb->idxmap);
-  if (pdb->meta->remarks != NULL)
-    free(pdb->meta->remarks);
-  if (pdb->meta != NULL)
-    free(pdb->meta);
-  free(pdb);
-}
-
-
-static int read_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  pdbdata *pdb = (pdbdata *)v;
-  *metadata = pdb->meta;
-  return MOLFILE_SUCCESS;
-}
-
-/* 
- * Registration stuff
- */
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "webpdb";
-  plugin.prettyname = "Web PDB Download";
-  plugin.author = "Justin Gullingsrud, John Stone";
-  plugin.majorv = 1;
-  plugin.minorv = 16;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "";
-  plugin.open_file_read = open_file_read;
-  plugin.read_structure = read_pdb_structure;
-  plugin.read_bonds = read_bonds;
-  plugin.read_next_timestep = read_next_timestep;
-  plugin.close_file_read = close_pdb_read;
-  plugin.read_molecule_metadata = read_molecule_metadata;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_WEBPDB_PLUGIN
-
-int main(int argc, char *argv[]) {
-  char *file;
-  if (argc < 2) {
-    fprintf(stderr, "Usage: %s <pdbcode>\n", argv[0]);
-    return -1;
-  }
-  file = (char *)open_file_read(argv[1], "webpdb",  NULL);
-  printf("%s\n", file);
-  free(file);
-  return 0;
-}
-
-#endif
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xbgfplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xbgfplugin.C
deleted file mode 100644
index 4d49a0841d7d063ef8fa010bafac32ba4f77f3de..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xbgfplugin.C
+++ /dev/null
@@ -1,706 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: xbgfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.34 $       $Date: 2016/11/28 05:01:55 $
- *
- ***************************************************************************/
-
-#include "molfile_plugin.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(_AIX)
-#include <strings.h>
-#endif
-
-#define LINESIZE 256
-#define MAXBONDS 16
-
-typedef struct {
-  FILE *file;
-  molfile_atom_t *atomlist;
-  molfile_metadata_t *meta;
-  int natoms, nbonds, optflags, coords_read;
-  int *from, *to;
-  float *bondorder;
-} xbgfdata;
-
-
-// Open the file and create the xbgf struct used to pass data to the other
-// functions.
-static void *open_xbgf_read(const char *path, const char *filetype, 
-    int *natoms) {
-  FILE *fd;
-  xbgfdata *bgf;
-  char line[LINESIZE]; 
-  int nbonds, optflags;
-  int numat=0;
-  nbonds=0;
-  int nbline; //Number of bonds in current line
-
-  // Allocate and initialize the bgf structure
-  bgf = (xbgfdata *) malloc(sizeof(xbgfdata));
-  memset(bgf, 0, sizeof(xbgfdata));
-
-  bgf->meta = (molfile_metadata_t *) malloc(sizeof(molfile_metadata_t));
-  memset(bgf->meta, 0, sizeof(molfile_metadata_t));
-
-  bgf->meta->remarklen = 0;
-  bgf->meta->remarks = NULL;
-
-  if ((fd = fopen(path, "r")) == NULL)
-    return NULL;
-
-  do {
-    fgets(line, LINESIZE, fd);
-    if ( ferror(fd) || feof(fd) ) {
-      printf("xbgfplugin) Improperly terminated bgf file\n");
-      return NULL;
-    }
-
-    if ((strncmp(line, "ATOM", 4) == 0) || (strncmp(line, "HETATM", 6)==0)) 
-      numat++;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      nbline=(strlen(line)-1)/6; 
-      nbline -= 2;
-      nbonds += nbline;
-    }
-
-    // Read the remarks
-    if (strncmp(line, "REMARK", 4)==0 || strncmp(line, "LEWIS", 4)==0 || 
-        strncmp(line, "VDW", 3)==0) {
-      int len=strlen(line);
-      int newlen = len + bgf->meta->remarklen;
-      char *newstr=(char*) realloc(bgf->meta->remarks, newlen + 1);
-      if (newstr != NULL) {
-        bgf->meta->remarks = newstr;
-        bgf->meta->remarks[bgf->meta->remarklen] = '\0';
-        memcpy(bgf->meta->remarks + bgf->meta->remarklen, line, len);
-        bgf->meta->remarks[newlen] = '\0';
-        bgf->meta->remarklen = newlen;
-      }
-    }
-
-    optflags = MOLFILE_INSERTION | MOLFILE_CHARGE | MOLFILE_BFACTOR | MOLFILE_OCCUPANCY | MOLFILE_ATOMICNUMBER;
-  } while ( strncmp(line, "END", 3) );
-    
-  *natoms = numat;
-  rewind(fd);
-
-  bgf->file = fd;
-  bgf->natoms = *natoms;
-  bgf->nbonds = nbonds;
-
-  bgf->optflags = optflags;
-  bgf->coords_read = 0;
-  bgf->from = NULL;
-  bgf->to = NULL;
-  bgf->bondorder = NULL;
-                                                                                
-  return bgf;
-}
-
-
-static void adjust_xbgf_field_string(char *field) {
-  int i, len;
-
-  len = strlen(field);
-  while (len > 0 && field[len-1] == ' ') {
-    field[len-1] = '\0';
-    len--;
-  }
-
-  while (len > 0 && field[0] == ' ') {
-    for (i=0; i < len; i++)
-      field[i] = field[i+1];
-    len--;
-  }
-}
-
-static void get_xbgf_coordinates(const char *record, 
-                                float *x, float *y, float *z) {
-  char numstr[50]; /* store all fields in one array to save memset calls */
-  memset(numstr, 0, sizeof(numstr));
-  if (x != NULL) {
-    strncpy(numstr, record + 32, 10);
-    *x = (float) atof(numstr);
-  }
-
-  if (y != NULL) {
-    strncpy(numstr+10, record + 42, 10);
-    *y = (float) atof(numstr+10);
-  }
-
-  if (z != NULL) {
-    strncpy(numstr+20, record + 52, 10);
-    *z = (float) atof(numstr+20);
-  }
-}
-
-
-static void get_xbgf_fields(const char *record, char *name, char *resname, 
-                           char *chain, char* segname, float *occupancy, 
-                           float *bfactor, int *elementindex,
-                           int *resid, char *type, float *charge,
-                           float *x, float *y, float *z, char* insert) {
-  char tempresid[6];
-  char tempcharge[8];
-  char tempbeta[7];
-  char tempocc[7];
-  char tempelem[4];
-  strcpy(insert, " ");
-
-  /* get atom name */
-  strncpy(name, record + 14, 5);
-  name[5] = '\0';
-  adjust_xbgf_field_string(name); /* remove spaces from the name */
-
-  /* get residue name */
-  strncpy(resname, record + 20, 4);
-  resname[4] = '\0';
-  adjust_xbgf_field_string(resname); /* remove spaces from the resname */
-
-  /* set segname */
-  strncpy(segname, record + 101, 4);
-  segname[4]='\0';
-  adjust_xbgf_field_string(segname); /* remove spaces from the segname */
-
-  /* get chain name */
-  chain[0] = record[25];
-  chain[1] = '\0';
-
-  /* get residue id number */
-  strncpy(tempresid, record + 27, 5);
-  tempresid[5] = '\0';
-  adjust_xbgf_field_string(tempresid); /* remove spaces from the resid */
-  *resid=atoi(tempresid);
-
-  /* get force field type */
-  strncpy(type, record+63, 5);
-  type[5]='\0';
-  adjust_xbgf_field_string(type); /* remove spaces */
-
-  /* get charge*/
-  strncpy(tempcharge, record + 74, 7);
-  tempcharge[7] = '\0';
-  adjust_xbgf_field_string(tempcharge); /* remove spaces from the charge */
-  *charge=atof(tempcharge);
-
-  /* Get B factor, occupancy, and element */
-  strncpy(tempbeta, record + 83, 6);
-  tempbeta[6] = '\0';
-  adjust_xbgf_field_string(tempbeta); /* remove spaces from the beta field */
-  *bfactor=atof(tempbeta);
-  
-  strncpy(tempocc, record + 90, 6);
-  tempocc[6] = '\0';
-  adjust_xbgf_field_string(tempocc); /* remove spaces from the occupancy field */
-  *occupancy=atof(tempocc);
-  
-  strncpy(tempelem, record + 97, 3);
-  tempelem[3] = '\0';
-  adjust_xbgf_field_string(tempelem); /* remove spaces from the element */
-  *elementindex=atoi(tempelem);
-
-  /* get x, y, and z coordinates */
-  get_xbgf_coordinates(record, x, y, z);
-}  
-
-
-// Read atom information, but not coordinates.
-static int read_xbgf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  char line[LINESIZE]; 
-  molfile_atom_t *atom;
-  int natoms=0;
-
-  //optflags = MOLFILE_INSERTION | MOLFILE_CHARGE | MOLFILE_BFACTOR | MOLFILE_OCCUPANCY | MOLFILE_ATOMICNUMBER;
-  *optflags = bgf->optflags;
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) FORMAT ATOM record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) Error occurred reading atom record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(line, "ATOM", 4) && strncmp(line, "HETATM", 6)) continue;
-    atom=atoms+natoms;
-    natoms++;
-    get_xbgf_fields(line, atom->name, atom->resname, atom->chain, atom->segid, 
-                   &atom->occupancy, &atom->bfactor, &atom->atomicnumber, 
-                   &atom->resid, atom->type, &atom->charge, 
-                   NULL, NULL, NULL, atom->insertion);
-  } while (strncmp(line, "END", 3));
-
-  bgf->natoms = natoms;
-
-  return MOLFILE_SUCCESS;
-}
-
-
-// Read atom coordinates
-static int read_xbgf_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  char line[LINESIZE];
-  int i;
-  float x, y, z;
-
-  // Since the file is rewound when coordinates are read, EOF shouldn't
-  // happen. Instead, use a flag to indicate that the single timestep has
-  // been read
-  if (bgf->coords_read) {
-    return MOLFILE_EOF;
-  }
-
-  // Find and read the ATOM record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) No FORMAT ATOM record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT ATOM", 11) );
-
-  // Read the atoms
-  for (i = 0; i < bgf->natoms; i++) {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) Error occurred reading atom coordinates.\n");
-      return MOLFILE_ERROR;
-    }
-
-    // skip comments and blank lines
-    if (strncmp(line,"ATOM",4)!=0 && strncmp(line,"HETATM",6)!=0) continue;
-
-    get_xbgf_coordinates(line, &x, &y, &z);
-
-    if (ts) {
-      ts->coords[3*i  ] = x;
-      ts->coords[3*i+1] = y;
-      ts->coords[3*i+2] = z;
-    }
-  }
-
-  bgf->coords_read = 1;
-  return MOLFILE_SUCCESS;
-}
-
-
-static void *open_xbgf_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  xbgfdata *data;
-
-  if ((fd = fopen(filename, "w")) == NULL) { 
-    printf("xbgfplugin) Error, unable to open xbgf file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (xbgfdata *) malloc(sizeof(xbgfdata));
-  memset(data, 0, sizeof(xbgfdata));
-  data->natoms = natoms;
-  data->file = fd;
-  data->nbonds = 0;
-  return data;
-}
-
-
-static int write_xbgf_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  fflush(stdout);
-  xbgfdata *data = (xbgfdata *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->natoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->natoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_xbgf_bonds_aux(void *v, int *nbonds, int **fromptr, int **toptr, float **bondorderptr) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  char line[LINESIZE]; 
-  char nextline[LINESIZE]; 
-  if (bgf->nbonds == 0) {
-    *nbonds = 0;
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL;
-    return MOLFILE_SUCCESS;
-  }
-
-  // Find and read the BOND record
-  rewind(bgf->file);
-  do {
-    fgets(line, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) No bond record found in file.\n");
-      return MOLFILE_ERROR;
-    }
-  } while ( strncmp(line, "FORMAT CONECT", 13) != 0 );
-
-  // Read the bonds
-  int j; //From atom
-  int k; //To atom
-  bool conline=false; //true if line after the conect line is an order line
-  char currbond[7]="xxxxxx"; //Stores current bond field
-  char currcon[7]="xxxxxx"; //Stores current ORDER field
-  char* bondptr; //pointer to current position in bond line
-  char* conptr; //pointer to current position in order line
-  int bonds[MAXBONDS]; //Stores bonds of current atom
-  float orders[MAXBONDS]; //Stores bond orders of current atom
-  int numbonds; //Stores number of bonds of current atom
-  int numords; //Stores number of bond order records of current atom
-  float bo; //current bond order
-  int i=0; //Number of the current bond
-  int numfields=0; //number of fields in the current line
-  fgets(line, LINESIZE, bgf->file);
-  while (1) {
-    // bondptr=NULL;
-    //conptr=NULL;
-    conline=false;
-    if (strncmp(line,"END",3)==0)
-      break;
-
-    fgets(nextline, LINESIZE, bgf->file);
-    if ( ferror(bgf->file) || feof(bgf->file) ) {
-      printf("xbgfplugin) Error occurred reading bond record.\n");
-      return MOLFILE_ERROR;
-    }
-
-    if (strncmp(nextline,"ORDER",5)==0) 
-      conline=true;
-
-    if (strncmp(line,"CONECT",6)==0) {
-      numfields=(strlen(line)-1)/6;
-      bondptr=&line[0];
-      numfields--;
-      bondptr += 6;
-      numbonds=0;
-      numords=0;
-      strncpy(currbond,bondptr,6);
-      j=atoi(currbond);
-      numfields--;
-      bondptr += 6;
-
-      while ((numfields > 0) && (numbonds <= MAXBONDS)) {
-        strncpy(currbond,bondptr,6);
-        numfields--;
-        bondptr += 6;
-        bonds[numbonds]=atoi(currbond);
-        numbonds++;
-      }
-
-      if (conline) {
-        numfields=(strlen(line)-1)/6;
-        conptr=&nextline[0];
-        numfields -= 2;
-        conptr += 12;
-        numords=0;
-        while ((numfields > 0) && (numords < numbonds)) {
-          strncpy(currcon,conptr,6);
-          numfields--;
-          conptr+=6;
-          bo=atof(currcon);
-          orders[numords]=bo;
-          numords++;
-        }
-      }
-
-      for (int l=0;l<numbonds;l++) {
-        k=bonds[l];
-        if (j<k) {
-          bgf->from[i]=j;
-          bgf->to[i]=k;
-          if (conline) {
-            bgf->bondorder[i]=orders[l];
-          } else {
-            bgf->bondorder[i]=1.0;
-          }
-          i++;
-        }
-      }
-        
-      if (conline) {
-        fgets(line, LINESIZE, bgf->file);
-      } else {
-        strncpy(line,nextline,LINESIZE);
-      }
-    } else {
-      strncpy(line,nextline,LINESIZE);
-    }
-  }
-
-  *nbonds = i;
-  *fromptr = bgf->from;
-  *toptr = bgf->to;
-  *bondorderptr = bgf->bondorder; // not implemented yet
-
-  return MOLFILE_SUCCESS;
-}
-
-
-static int read_xbgf_bonds(void *v, int *nbonds, int **fromptr, int **toptr, 
-                           float **bondorderptr, int **bondtype,
-                           int *nbondtypes, char ***bondtypename) {
-  xbgfdata *bgf = (xbgfdata *)v;
-
-  /* now read bond data */
-  *nbonds=bgf->nbonds;
-  if (bgf->nbonds > 0) {
-    bgf->from = (int *) malloc(*nbonds*sizeof(int));
-    bgf->to = (int *) malloc(*nbonds*sizeof(int));
-    bgf->bondorder = (float *) malloc(*nbonds*sizeof(float));
-
-    if ((read_xbgf_bonds_aux(bgf, nbonds, &(bgf->from), &(bgf->to), &(bgf->bondorder))) != MOLFILE_SUCCESS) {
-      fclose(bgf->file);
-      bgf->file = NULL;
-      return MOLFILE_ERROR;
-    }
-    *fromptr = bgf->from;
-    *toptr = bgf->to;
-    *bondorderptr = bgf->bondorder; // not implemented yet
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  } else {
-    printf("xbgfplugin) WARNING: no bonds defined in xbgf file.\n");
-    *fromptr = NULL;
-    *toptr = NULL;
-    *bondorderptr = NULL;
-    *bondtype = NULL;
-    *nbondtypes = 0;
-    *bondtypename = NULL;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-
-static int write_xbgf_timestep(void *mydata, const molfile_timestep_t *ts) {
-  fflush(stdout);
-  xbgfdata *data = (xbgfdata *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  int i;
-
-  //print header block
-  fprintf(data->file, "BIOGRF  332\n");
-  fprintf(data->file, "REMARK NATOM %4i\n", data->natoms);
-  fprintf(data->file, "FORCEFIELD DREIDING\n");
-  fprintf(data->file, "FORMAT ATOM   (a6,1x,i6,1x,a5,1x,a4,1x,a1,1x,i5,3f10.5,1x,a5,i3,i2,1x,f8.5,1x,f6.3,1x,f6.3,1x,i3,1x,a4)\n");
-
-  //print atoms block
-  atom = data->atomlist;
-  pos = ts->coords;
-  int numbonds=0;
-  int lp=0;
-  for (i = 0; i < data->natoms; i++) {
-    fprintf(data->file, "%-6s %6i %5s %4s %1s %5i%10.5f%10.5f%10.5f %-5s%3i%2i %8.5f %6.3f %6.3f %3i %4s\n", "ATOM", i+1, atom->name, atom->resname, atom->chain, atom->resid, pos[0], pos[1], pos[2], atom->type, numbonds, lp, atom->charge, atom->bfactor, atom->occupancy, atom->atomicnumber, atom->segid);
-    ++atom; 
-    pos += 3;
-  }
-
-  //write the connectivity data
-  fprintf(data->file,"FORMAT CONECT (a6,14i6) \nFORMAT ORDER (a6,i6,13f6.3)\n");
-    
-  //iterate through the bond arrays and write them all
-  int* bonds=(int *)malloc((data->natoms+1) * sizeof(int) * MAXBONDS);
-  float* orders=(float *)malloc((data->natoms+1)*sizeof(float) * MAXBONDS);
-  int* numcons=(int *)malloc((data->natoms+1)*sizeof(int));
-  for (i=0;i<data->natoms+1;i++) {
-    numcons[i]=0;
-  }
-
-  int j,k; //indices for atoms being bonded
-  float o; //bond order
-  for (i=0;i<data->nbonds;i++) {
-    j=data->from[i];
-    k=data->to[i];
-
-    if (data->bondorder != NULL)
-      o=data->bondorder[i];
-    else 
-      o=1.0f;
-
-    numcons[j]++;
-    numcons[k]++;
-    if (numcons[j]>MAXBONDS) {
-      printf("xbgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[j]--;
-      numcons[k]--;
-      continue;
-    }
-       
-    if (numcons[k]>MAXBONDS) {
-      printf("xbgfplugin) Warning: Bond overflow. Not all bonds were written\n");
-      numcons[k]--;
-      numcons[j]--;
-      continue;
-    }
-    bonds[6*j+numcons[j]-1]=k;
-    bonds[6*k+numcons[k]-1]=j;
-    orders[6*j+numcons[j]-1]=o;
-    orders[6*k+numcons[k]-1]=o;
-  }
-
-  for (i=1;i<=data->natoms;i++) {
-    fprintf(data->file,"CONECT%6i",i);
-    for (j=0;j<numcons[i];j++) {
-      fprintf(data->file,"%6i",bonds[6*i+j]);
-    }
-    fprintf(data->file,"\nORDER %6i",i);
-    for (j=0;j<numcons[i];j++) {
-      fprintf(data->file,"%6.3f",orders[6*i+j]);
-    }
-    fprintf(data->file,"\n");
-  }
-
-  if (bonds != NULL) {
-    free(bonds);
-    bonds = NULL;
-  }
-  if (orders != NULL) {
-    free(orders);
-    orders = NULL;
-  }
-  if (numcons != NULL) {
-    free(numcons);
-    numcons = NULL;
-  }
-
-  fprintf(data->file,"END\n");
-  return MOLFILE_SUCCESS;
-}
-
-static int write_xbgf_bonds(void *v, int nbonds, int *fromptr, int *toptr, 
-                            float *bondorderptr,  int *bondtype, 
-                            int nbondtypes, char **bondtypename) {
-  xbgfdata *data = (xbgfdata *)v;
-  data->from = (int*) malloc (nbonds * sizeof(int));
-  data->to = (int*) malloc (nbonds * sizeof(int));
-  data->nbonds = nbonds;
-  fflush(stdout);
-
-
-  //set the pointers for use later
-  for (int i=0;i<nbonds;i++) {
-    data->from[i]=fromptr[i];
-    data->to[i]=toptr[i];
-  }
-
-  if (bondorderptr != NULL) {
-    data->bondorder = (float*) malloc (nbonds * sizeof(float));
-    for (int i=0;i<nbonds;i++) {
-      data->bondorder[i]=bondorderptr[i];
-    }
-  }
-
-
-  return MOLFILE_SUCCESS;
-}
-
-static void close_xbgf_write(void *mydata) {
-  xbgfdata *data = (xbgfdata *)mydata;
-  if (data) {
-    fclose(data->file);
-
-    if (data->atomlist != NULL) free(data->atomlist);
-    data->atomlist = NULL;
-    if (data->from != NULL) free(data->from);
-    data->from = NULL;
-    if (data->to != NULL) free(data->to);
-    data->to = NULL;
-    if (data->bondorder != NULL) free(data->bondorder);
-    data->bondorder = NULL;
-    free(data);
-  }
-}
-
-//
-// Free the memory used by the bgf structure
-static void close_xbgf_read(void *v) {
-  xbgfdata *bgf = (xbgfdata *)v;
-  if (bgf) {
-    if (bgf->file) fclose(bgf->file);
-    if (bgf->from != NULL) free(bgf->from);
-    if (bgf->to != NULL)   free(bgf->to);
-    if (bgf->bondorder != NULL) free(bgf->bondorder);
-
-    if (bgf->meta->remarks != NULL)
-      free(bgf->meta->remarks);
-    if (bgf->meta != NULL) 
-      free(bgf->meta);
-    free(bgf);
-  }
-  bgf=NULL;
-}
-
-
-static int read_xbgf_molecule_metadata(void *v, molfile_metadata_t **metadata) {
-  xbgfdata *bgf = (xbgfdata *)v; 
-  *metadata = bgf->meta;
-  return MOLFILE_SUCCESS;
-}
-
-
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xbgf";
-  plugin.prettyname = "Internal Paratool Format";
-  plugin.author = "Peter Freddolino ";
-  plugin.majorv = 0;
-  plugin.minorv = 13;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "xbgf";
-  plugin.open_file_read = open_xbgf_read;
-  plugin.read_structure = read_xbgf_structure;
-  plugin.read_bonds = read_xbgf_bonds;
-  plugin.read_next_timestep = read_xbgf_timestep;
-  plugin.close_file_read = close_xbgf_read;
-  plugin.open_file_write = open_xbgf_write;
-  plugin.write_structure = write_xbgf_structure;
-  plugin.write_timestep = write_xbgf_timestep;
-  plugin.close_file_write = close_xbgf_write;
-  plugin.read_molecule_metadata = read_xbgf_molecule_metadata;
-  plugin.write_bonds = write_xbgf_bonds;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xsfplugin.C b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xsfplugin.C
deleted file mode 100644
index e3fdf220621a33d8ee79291d0bfdac80c4f0d8d8..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xsfplugin.C
+++ /dev/null
@@ -1,1023 +0,0 @@
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: xsfplugin.C,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.20 $       $Date: 2016/11/09 17:53:21 $
- *
- ***************************************************************************/
-
-//
-// Molefile plugin for xsf/axsf format files as created by the 
-// Quantum Espresso software package (http://www.quantum-espresso.org) 
-// a.k.a. PWScf (http://www.pwscf.org/) and XCrySDen (http://www.xcrysden.org/
-//
-// a file format description is available at:
-// http://www.xcrysden.org/doc/XSF.html
-//
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "molfile_plugin.h"
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661922
-#endif
-
-#include "periodic_table.h"
-
-static const char *xsf_symtab[] = {
-  "(unknown keyword)", "#",
-  "BEGIN_INFO", "END_INFO",
-  "BEGIN_BLOCK_DATAGRID_2D", "END_BLOCK_DATAGRID_2D",
-  "BEGIN_DATAGRID_2D", "END_DATAGRID_2D",
-  "BEGIN_BLOCK_DATAGRID_3D", "END_BLOCK_DATAGRID_3D",
-  "BEGIN_DATAGRID_3D", "END_DATAGRID_3D",
-  "BEGIN_BLOCK_BANDGRID_3D", "END_BLOCK_BANDGRID_3D",
-  "ATOMS", "ANIMSTEPS", "BAND",
-  "MOLECULE", "POLYMER", "SLAB", "CRYSTAL",
-  "PRIMVEC", "CONVVEC", "PRIMCOORD", "CONVCOORD"
-};
-
-
-typedef enum {
-  xsf_UNKNOWN = 0,  xsf_COMMENT,
-  xsf_BEGINFO,      xsf_ENDINFO, 
-  xsf_BEG_2D_BLOCK, xsf_END_2D_BLOCK,
-  xsf_BEG_2D_DATA,  xsf_END_2D_DATA,
-  xsf_BEG_3D_BLOCK, xsf_END_3D_BLOCK,
-  xsf_BEG_3D_DATA,  xsf_END_3D_DATA,
-  xsf_BEG_3D_BAND,  xsf_END_3D_BAND,
-  xsf_ATOMS, xsf_ANIMSTEPS, xsf_BAND,
-  xsf_MOLECULE, xsf_POLYMER, xsf_SLAB, xsf_CRYSTAL,
-  xsf_PRIMVEC, xsf_CONVVEC, xsf_PRIMCOORD, xsf_CONVCOORD,
-  xsf_NR_KEYWORDS
-} xsf_keyword_t;
-
-
-// list of known alternatives to the keywords above
-// last entry has to be an xsf_UNKNOWN.
-static const struct {
-  const char *name;
-  xsf_keyword_t kw;
-}  xsf_aliases[] = {
-  { "DATAGRID_2D", xsf_BEG_2D_DATA },
-  { "DATAGRID_3D", xsf_BEG_3D_DATA },
-  { "BEGIN_BLOCK_DATAGRID2D", xsf_BEG_2D_BLOCK },
-  { "BEGIN_BLOCK_DATAGRID3D", xsf_BEG_3D_BLOCK },
-  { "END_BLOCK_DATAGRID2D", xsf_END_2D_BLOCK },
-  { "END_BLOCK_DATAGRID3D", xsf_END_3D_BLOCK },
-  { NULL,          xsf_UNKNOWN     }
-};
-
-
-static xsf_keyword_t lookup_keyword(const char* word) {
-  int i, j;
-  
-  if (word == 0) return xsf_UNKNOWN;
-  
-  // find start of word.
-  j=0;
-  for (i=0; i < (int)strlen(word); ++i) {
-    j=i;
-    if (!isspace(word[i])) 
-      break;
-  }
-  
-  for (i=1; i < xsf_NR_KEYWORDS; ++i) {
-    if (0 == strncmp(word + j, xsf_symtab[i], strlen(xsf_symtab[i])))
-      return (xsf_keyword_t) i;
-  }
-
-  // check for known aliases/alternatives
-  for (i=0; xsf_aliases[i].kw != xsf_UNKNOWN; ++i) {
-    const char *name = xsf_aliases[i].name;
-
-    if (0 == strncmp(word + j, name, strlen(name)))
-      return xsf_aliases[i].kw;
-  }
-
-  return xsf_UNKNOWN;
-}
-
-
-
-// A format-independent structure to hold unit cell data
-typedef struct {
-  float A, B, C, alpha, beta, gamma, cell[3][3];
-} xsf_box;
-
-typedef struct {
-  FILE *fd;                     // file descriptor
-  int nvolsets;                 // number of volumetric datasets
-  int numatoms;                 // number of atoms
-  int animsteps;                // for comparison.
-  int numsteps;                 // number of coordinate sets.
-  bool coord;                   // has coordinate data
-  char *file_name;              // original filename 
-  xsf_keyword_t pbctype;        // type of periodicity (none/polymer/slab/crystal)
-  molfile_volumetric_t *vol;    // volume set metadata 
-  int numvolmeta;               // number of entries in *vol
-  float origin[3];              // origin, stored for periodic display hack 
-  float rotmat[3][3];           // rotation matrix, stored for periodic display hack
-  float invmat[3][3];           // reciprocal cell matrix (for PBC wrapping).
-  xsf_box box;                  // unit cell dimensions (for VMD).
-} xsf_t;
-
-
-// Converts box basis vectors to A, B, C, alpha, beta, and gamma.  
-// Stores values in xsf_box struct, which should be allocated before calling
-// this function.
-static int xsf_readbox(xsf_box *box, float *x, float *y, float *z) {
-  float A, B, C;
-  int i;
-
-  if (!box) {
-    return 1;
-  }
-
-  // provide defaults
-  box->A = 10.0;
-  box->B = 10.0;
-  box->C = 10.0;
-  box->alpha = 90.0;
-  box->beta  = 90.0;
-  box->gamma = 90.0;
-
-  // A, B, C are the lengths of the x, y, z vectors, respectively
-  A = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] );
-  B = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] );
-  C = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] );
-  if ((A<=0) || (B<=0) || (C<=0)) {
-    return 1;
-  }
-  box->A = A;
-  box->B = B;
-  box->C = C;
-
-  // gamma, beta, alpha are the angles between the x & y, x & z, y & z
-  // vectors, respectively
-  box->gamma = acos( (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])/(A*B) ) * 90.0/M_PI_2;
-  box->beta = acos( (x[0]*z[0]+x[1]*z[1]+x[2]*z[2])/(A*C) ) * 90.0/M_PI_2;
-  box->alpha = acos( (y[0]*z[0]+y[1]*z[1]+y[2]*z[2])/(B*C) ) * 90.0/M_PI_2; 
-
-  // copy original cell vectors for PBC wrapping.
-  for (i=0; i<3; ++i) {
-    box->cell[i][0] = x[i];
-    box->cell[i][1] = y[i];
-    box->cell[i][2] = z[i];
-  }
-  
-  return 0;
-}
-
-
-// calculate and store rotation matrix to realign everything later.
-static void xsf_buildrotmat(xsf_t *xsf, float *a, float *b) {
-  // we rotate first around y and z to align a along the x-axis...
-  const double len   = sqrt(a[0]*a[0] + a[1]*a[1]);
-  const double phi   = atan2((double) a[2], (double) len);
-  const double theta = atan2((double) a[1], (double) a[0]);
-
-  const double cph = cos(phi);
-  const double cth = cos(theta);
-  const double sph = sin(phi);
-  const double sth = sin(theta);
-
-  // ...then we rotate around x to put b into the xy-plane.
-  const double psi = atan2(-sph*cth*b[0] - sph*sth*b[1] + cph*b[2],-sth*b[0] + cth*b[1]);
-  const double cps = cos(psi);
-  const double sps = sin(psi);
-
-  const double r[3][3] = { 
-    {               cph*cth,                cph*sth,      sph},
-    {-sth*cps - sph*cth*sps,  cth*cps - sph*sth*sps,  cph*sps},
-    { sth*sps - sph*cth*cps, -cth*sps - sph*sth*cps,  cph*cps}
-  };
-
-  for (int i=0; i<3; ++i) {
-    for (int j=0; j<3; ++j) {
-      xsf->rotmat[i][j] = r[i][j];
-    }
-  }
-}
-
-
-static void xsf_buildinvmat(xsf_t *xsf, float *a, float *b, float *c) {
-  float det, id;
-  
-  det = a[0]*b[1]*c[2] + b[0]*c[1]*a[2] + c[0]*a[1]*b[2] 
-        - a[0]*c[1]*b[2] - b[0]*a[1]*c[2] - c[0]*b[1]*a[2];
-  
-  id = 1.0 / det;
-  xsf->invmat[0][0] = id * ( b[1]*c[2]-b[2]*c[1] );
-  xsf->invmat[1][0] = id * ( a[2]*c[1]-a[1]*c[2] );
-  xsf->invmat[2][0] = id * ( a[1]*b[2]-a[2]*b[1] );
-  xsf->invmat[0][1] = id * ( b[2]*c[0]-b[0]*c[2] );
-  xsf->invmat[1][1] = id * ( a[0]*c[2]-a[2]*c[0] );
-  xsf->invmat[2][1] = id * ( a[2]*b[0]-a[0]*b[2] );
-  xsf->invmat[0][2] = id * ( b[0]*c[1]-b[1]*c[0] );
-  xsf->invmat[1][2] = id * ( a[1]*c[0]-a[0]*c[1] );
-  xsf->invmat[2][2] = id * ( a[0]*b[1]-a[1]*b[0] );
-}
-
-
-// read a line and forget the data
-static void eatline(FILE *fd) {
-  char readbuf[1025];
-  fgets(readbuf, 1024, fd);    // go on to next line
-}  
-
-
-static bool xsf_read_cell(FILE *fd, float *a, float *b, float *c) {
-  return (9 == fscanf(fd, "%f%f%f%f%f%f%f%f%f", 
-                      &a[0],&a[1],&a[2],
-                      &b[0],&b[1],&b[2],
-                      &c[0],&c[1],&c[2]));
-}
-
-// forward declaration for cleanup handling...
-static void close_xsf_read(void *v);
-
-static void *open_xsf_read(const char *filepath, const char *filetype,
-                           int *natoms) {
-  FILE *fd;
-  xsf_t *xsf;
-  int i,j;
-  
-  fd = fopen(filepath, "rb");
-  if (!fd) 
-    return NULL;
-
-  xsf = new xsf_t;
-  xsf->fd = fd;
-  xsf->vol = NULL;
-  xsf->numvolmeta = 0;
-  xsf->coord = false;
-  xsf->nvolsets = 0;
-  xsf->numatoms = 0;
-  xsf->numsteps = 0;
-  xsf->file_name = strdup(filepath);
-  // this will disable pbc wrapping of coordinates by default
-  xsf->pbctype = xsf_MOLECULE; 
-
-  // initialize origin and rotmat to sensible defaults.
-  for (i=0; i<3; ++i) {
-    for (j=0; j<3; ++j) {
-      xsf->rotmat[i][j] = 0.0;
-    }
-  }
-  for (i=0; i<3; ++i) {
-    xsf->origin[i] = 0.0;
-    xsf->rotmat[i][i] = 1.0;
-  }
-
-  // since there can be all kinds of data in the file, 
-  // we start by scanning through the whole file and analyse
-  // the available info.
-  char readbuf[256]; // line buffer
-  xsf_keyword_t kw;
-
-  // we loop until can't read anymore.
-  do {
-    if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-
-    again:
-    kw = lookup_keyword(readbuf);
-#ifdef TEST_PLUGIN
-    fprintf(stderr, "keyword: %d / %s", kw, readbuf);
-#endif          
-    
-    switch (kw) {
-      case xsf_ANIMSTEPS:
-#ifdef TEST_PLUGIN
-      {
-        int n;
-        if (1 == sscanf(readbuf, "%*s%d", &n)) {
-          fprintf(stderr, "ANIMSTEPS: found %d steps\n", n);
-        }
-      }
-#endif          
-      break;
-        
-      case xsf_ATOMS: // no specification for the number of atoms, so we
-                      // try to figure them out
-        ++xsf->numsteps;
-        if (xsf->numatoms == 0) { // count atoms only, if we don't know how many
-          while (fgets(readbuf, 256, xsf->fd)) {
-            float x,y,z;
-            // the coordinate lines are <index> <x> <y> <z> with optional forces.
-            if (3 == sscanf(readbuf, "%*s%f%f%f", &x, &y, &z)) {
-              ++xsf->numatoms;
-            } else {
-              // we've most likely read the next keyword. reparse buffer.
-              goto again;
-              break;
-            }
-          }
-#ifdef TEST_PLUGIN
-          fprintf(stderr, "ATOMS: found %d atoms\n", xsf->numatoms);
-#endif          
-        } else { // skip over the lines
-          int n;
-          for (n=0; n < xsf->numatoms; ++n) eatline(xsf->fd);
-        }
-        break;
-        
-      case xsf_PRIMCOORD: // number of atoms is in the next line
-        if (fgets(readbuf, 256, xsf->fd)) {
-          int mol, mult;
-          
-          if (xsf->numatoms == 0) {
-            if (2 == sscanf(readbuf, "%d%d", &mol, &mult)) {
-              xsf->numatoms = mol * mult;
-            } else {
-              xsf->numatoms = mol;
-            }
-          }
-          // skip over atom coordinates
-          int n;
-          for (n=0; n < xsf->numatoms; ++n) eatline(xsf->fd);
-          ++xsf->numsteps; 
-
-#ifdef TEST_PLUGIN
-          fprintf(stderr, "PRIMCOORD: found %d atoms\n", xsf->numatoms);
-#endif          
-        }
-        break;
-        
-      case xsf_CONVCOORD: // number of atoms is in the next line
-        if (fgets(readbuf, 256, xsf->fd)) {
-          int mol, mult, num;
-          
-          num = 0;
-          if (2 == sscanf(readbuf, "%d%d", &mol, &mult)) {
-            num = mol * mult;
-          }
-          
-          // skip over atom coordinates
-          int n;
-          for (n=0; n < num; ++n) eatline(xsf->fd);
-#ifdef TEST_PLUGIN
-          fprintf(stderr, "CONVCOORD: ignoring %d atoms\n", num);
-#endif          
-        }
-        break;
-
-      case xsf_PRIMVEC: // store primitive cell info for rotation of the volumetric data grid vectors
-      {
-        float a[3], b[3], c[3];
-        
-        if (xsf_read_cell(xsf->fd, a, b, c)) {
-          xsf_buildrotmat(xsf, a, b);
-        } else {
-          fprintf(stderr, "xsfplugin) WARNING: error reading unit cell. ignoring unit cell info.\n");
-        }
-      }
-      break;
-      
-      case xsf_CONVVEC: // ignore conventional cells.
-      {
-        int n;
-        for (n=0; n < 3; ++n)
-          eatline(xsf->fd);
-      }
-      break;
-
-      case xsf_BEG_3D_BLOCK: // analyse number of 3d-data sets
-        // ordinarily the parsing of the metadata would be done in read_xsf_metadata()
-        // but since we have to move through the whole file to count its contents,
-        // it is faster to parse it here and just pass the data later.
-
-        if (xsf->vol == NULL) { // initialize the volume set list with 32 entries
-          xsf->numvolmeta = 32;
-          xsf->vol = new molfile_volumetric_t[xsf->numvolmeta];
-        }
-        
-        // next line is title, then check for data blocks
-        fgets(readbuf, 256, xsf->fd);
-        printf("xsfplugin) found grid data block: %s", readbuf);
-
-        do { // loop until we reach the end of the whole block 
-             // or run out of data.
-          if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-          switch (lookup_keyword(readbuf)) {
-            case xsf_BEG_3D_DATA: // fallthrough
-            {
-              int n;
-              molfile_volumetric_t *set;
-              float a[3], b[3], c[3];
-              float orig[3];
-              ++xsf->nvolsets;
-
-              // double the size of the cache for metainfo, if needed
-              if (xsf->nvolsets > xsf->numvolmeta) {
-                molfile_volumetric_t *ptr = xsf->vol;
-                xsf->vol = new molfile_volumetric_t[2 * xsf->numvolmeta];
-                memcpy((void *)xsf->vol, (void *)ptr, xsf->numvolmeta*sizeof(molfile_volumetric_t));
-                xsf->numvolmeta *= 2;
-                delete[] ptr;
-              }
-
-              // get a handle to the current volume set meta data
-              set = &(xsf->vol[xsf->nvolsets - 1]);
-              set->has_color = 0;
-
-              // the begin mark is also the title of the data set.
-              // we need the exact name to later find the start of the data set.
-              strncpy(set->dataname, readbuf, 255);
-              
-              // next is the number of grid points, the origin and
-              // the spanning vectors of the data block
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%d%d%d", &(set->xsize), &(set->ysize), &(set->zsize));
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &orig[0], &orig[1], &orig[2]);
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &a[0], &a[1], &a[2]);
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &b[0], &b[1], &b[2]);
-              fgets(readbuf, 256, xsf->fd);
-              sscanf(readbuf, "%f%f%f", &c[0], &c[1], &c[2]);
-              
-              // we need to fix up the size of the data points, since xsf file 
-              // store the data points at the borders on both sides.
-              -- set->xsize; -- set->ysize; -- set->zsize;
-
-              // store the realigned axes.
-              for (n=0; n<3; ++n) {
-                set->origin[n] = xsf->rotmat[n][0] * orig[0] 
-                  + xsf->rotmat[n][1] * orig[1] + xsf->rotmat[n][2] * orig[2];
-
-                set->xaxis[n] = xsf->rotmat[n][0] * a[0] 
-                  + xsf->rotmat[n][1] * a[1] + xsf->rotmat[n][2] * a[2];
-                
-                set->yaxis[n] = xsf->rotmat[n][0] * b[0] 
-                  + xsf->rotmat[n][1] * b[1] + xsf->rotmat[n][2] * b[2];
-    
-                set->zaxis[n] = xsf->rotmat[n][0] * c[0] 
-                  + xsf->rotmat[n][1] * c[1] + xsf->rotmat[n][2] * c[2];
-              }
-
-              do { // loop until we reach the end of the data set
-                fgets(readbuf, 256, xsf->fd);
-              } while (xsf_END_3D_DATA != lookup_keyword(readbuf));
-
-              /*   as of VMD version 1.8.3, volumetric data points are 
-               *   expected to represent the center of a grid box. xsf format 
-               *   volumetric data represents the value at the edges of the 
-               *   grid boxes, so we need to shift the internal origin by half 
-               *   a grid box diagonal to have the data at the correct position 
-               *   This will need to be changed again when the plugin interface
-               *   is updated to explicitly allow point/face-centered data sets.
-               */
-              set->origin[0] -= 0.5 * ( set->xaxis[0] / (double) set->xsize
-                                        + set->yaxis[0] / (double) set->ysize
-                                        + set->zaxis[0] / (double) set->zsize);
-              set->origin[1] -= 0.5 * ( set->xaxis[1] / (double) set->xsize
-                                        + set->yaxis[1] / (double) set->ysize
-                                        + set->zaxis[1] / (double) set->zsize);
-              set->origin[2] -= 0.5 * ( set->xaxis[2] / (double) set->xsize
-                                        + set->yaxis[2] / (double) set->ysize
-                                        + set->zaxis[2] / (double) set->zsize);
-            }
-            break;
-
-            default:
-              break;
-          }
-        } while (xsf_END_3D_BLOCK != lookup_keyword(readbuf));
-        
-#ifdef TEST_PLUGIN
-        fprintf(stderr, "found %d volumetric data sets\n", xsf->nvolsets);
-#endif          
-        break;
-
-      case xsf_BEG_2D_BLOCK:
-        do { // skip over data
-          fgets(readbuf, 256, xsf->fd);
-        } while (xsf_END_2D_BLOCK != lookup_keyword(readbuf));
-        break;
-        
-        // periodicity encoding. needed for coordinate wrapping.
-      case xsf_MOLECULE: // fallthrough
-      case xsf_SLAB:     // fallthrough
-      case xsf_POLYMER:  // fallthrough
-      case xsf_CRYSTAL:
-        xsf->pbctype = kw;
-        break;
-
-      case xsf_COMMENT:  // fallthrough
-      case xsf_UNKNOWN:  // fallthrough
-      default:                  // ignore everything unknown
-        break;
-        
-    }
-  } while (! (feof(xsf->fd) || ferror(xsf->fd)));
-#ifdef TEST_PLUGIN
-  fprintf(stderr, "total of %d coordinate sets\n", xsf->numsteps);
-#endif
-  rewind(xsf->fd);
-  *natoms = xsf->numatoms;
-  return xsf;
-}
-
-  
-static int read_xsf_structure(void *v, int *optflags, molfile_atom_t *atoms) {
-  int i;
-  xsf_t *xsf = (xsf_t *)v;
-
-  // return immediately if there is no structure in this file.
-  if (xsf->numatoms < 1) return MOLFILE_SUCCESS;
-
-  
-  // go to beginning of file and find first set of coordinates
-  rewind(xsf->fd);
-
-  // we loop until we have found, read and parsed the first 
-  // set of atomic coordinates. we only accept ATOMS and PRIMCOORD
-  // sections. if we happen to find a PRIMVEC section, too, we use
-  // that to set the default for animations.
-  char readbuf[1024]; // line buffer
-  do {
-    if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-
-    switch (lookup_keyword(readbuf)) {
-
-      case xsf_PRIMCOORD: // number of atoms is in the next line. skip.
-        eatline(xsf->fd);
-        // fallthrough
-      case xsf_ATOMS: // no specification for the number of atoms, 
-                      // we can use the same parser for both sections.
-
-        /* we set atom mass and VDW radius from the PTE. */
-        *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS;
-
-        for(i=0; i<xsf->numatoms; ++i) {
-          int j;
-          char *k;
-          float coord;
-          molfile_atom_t *atom;
-
-          char buffer[1024];
-          k = fgets(readbuf, 1024, xsf->fd);
-          atom = atoms + i;
-          j=sscanf(readbuf, "%s %f %f %f", buffer, &coord, &coord, &coord);
-          if (k == NULL) {
-            fprintf(stderr, "xsfplugin) structure missing atom(s) in file '%s'\n",xsf->file_name);
-            fprintf(stderr, "xsfplugin) expecting '%d' atoms, found only '%d'\n",xsf->numatoms,i+1);
-            return MOLFILE_ERROR;
-          } else if (j < 4) {
-            fprintf(stderr, "xsfplugin) missing type or coordinate(s) in file '%s' for atom '%d'\n",
-                    xsf->file_name, i+1);
-            return MOLFILE_ERROR;
-          }
-
-          /* handle the case if the first item is an ordinal number 
-           * from the PTE */
-          if (isdigit(buffer[0])) {
-            int idx;
-            idx = atoi(buffer);
-            strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-            atom->atomicnumber = idx;
-            atom->mass = get_pte_mass(idx);
-            atom->radius = get_pte_vdw_radius(idx);
-          } else {
-            int idx;
-            strncpy(atom->name, buffer, sizeof(atom->name));
-            idx = get_pte_idx(buffer);
-            atom->atomicnumber = idx;
-            atom->mass = get_pte_mass(idx);
-            atom->radius = get_pte_vdw_radius(idx);
-          }
-          strncpy(atom->type, atom->name, sizeof(atom->type));
-          atom->resname[0] = '\0';
-          atom->resid = 1;
-          atom->chain[0] = '\0';
-          atom->segid[0] = '\0';
-#ifdef TEST_PLUGIN
-          fprintf(stderr,"xsfplugin) atom %4d: %s  / mass= %f\n", i, atom->name, atom->mass);
-#endif
-        }
-        
-        // ok. done. rewind once more and get the hell out of here.
-        rewind(xsf->fd);
-        return MOLFILE_SUCCESS;
-        break;
-        
-        // read primitive cell info.
-      case xsf_PRIMVEC: 
-      {
-        float a[3], b[3], c[3];
-
-        if (xsf_read_cell(xsf->fd, a, b, c)) { // ignore unit cell info,if we cannot parse it.
-          xsf_readbox(&(xsf->box), a, b, c);
-          xsf_buildrotmat(xsf, a, b);
-          // print warning, if the rotation will be significant:
-          if ((fabs((double) a[1]) + fabs((double) a[2]) + fabs((double) b[2]))
-              > 0.001) {
-            fprintf(stderr, "xsfplugin) WARNING: Coordinates will be rotated to comply \n"
-                    "xsfplugin) with VMD's conventions for periodic display...\n");
-          }
-          xsf_buildinvmat(xsf, a, b, c);
-
-#if defined(TEST_PLUGIN)
-        printf("cell vectors:\n");
-        printf("<a>: %12.8f %12.8f %12.8f\n", a[0], a[1], a[2]);
-        printf("<b>: %12.8f %12.8f %12.8f\n", b[0], b[1], b[2]);
-        printf("<c>: %12.8f %12.8f %12.8f\n", c[0], c[1], c[2]);
-        printf("cell dimensions:\n");
-        printf("a= %12.8f   b= %12.8f   c= %12.8f\n", xsf->box.A, xsf->box.B, xsf->box.C);
-        printf("alpha= %6.2f  beta= %6.2f  gamma= %6.2f\n", xsf->box.alpha, xsf->box.beta, xsf->box.gamma);
-        printf("reciprocal cell vectors:\n");
-        printf("i: %12.8f %12.8f %12.8f\n", xsf->invmat[0][0], xsf->invmat[0][1], xsf->invmat[0][2]);
-        printf("k: %12.8f %12.8f %12.8f\n", xsf->invmat[1][0], xsf->invmat[1][1], xsf->invmat[1][2]);
-        printf("l: %12.8f %12.8f %12.8f\n", xsf->invmat[2][0], xsf->invmat[2][1], xsf->invmat[2][2]);
-        printf("cell rotation matrix:\n");
-        printf("x: %12.8f %12.8f %12.8f\n", xsf->rotmat[0][0], xsf->rotmat[0][1], xsf->rotmat[0][2]);
-        printf("y: %12.8f %12.8f %12.8f\n", xsf->rotmat[1][0], xsf->rotmat[1][1], xsf->rotmat[1][2]);
-        printf("z: %12.8f %12.8f %12.8f\n", xsf->rotmat[2][0], xsf->rotmat[2][1], xsf->rotmat[2][2]);
-#endif
-        }
-      }
-      break;
-
-      default:                  // ignore everything unknown
-        break;
-    }
-  } while (! (feof(xsf->fd) || ferror(xsf->fd)));
-
-  // if we reach this point, some error must have happened.
-  return MOLFILE_ERROR;
-
-}
-
-
-static int read_xsf_timestep(void *v, int natoms, molfile_timestep_t *ts) {
-  int i;
-  
-  xsf_t *xsf = (xsf_t *)v;
-
-  // we loop until we have found, read and parsed the next.
-  // set of atomic coordinates. we only accept ATOMS and PRIMCOORD
-  // sections. if we happen to find a PRIMVEC section, too, we use
-  // that to reset the cell parameters.
-
-  char readbuf[1024]; // line buffer
-  do {
-    if (NULL == fgets(readbuf, 256, xsf->fd)) break;
-
-    switch (lookup_keyword(readbuf)) {
-
-      case xsf_PRIMCOORD: // number of atoms is in the next line. skip.
-        eatline(xsf->fd);
-        // fallthrough
-      case xsf_ATOMS: // no specification for the number of atoms, 
-                      // we can use the same parser for both sections.
-
-        for(i=0; i<natoms; ++i) {
-          int j, n;
-          char *k, buffer[1024];
-          float x, y, z;
-          
-          k = fgets(readbuf, 1024, xsf->fd);
-          j=sscanf(readbuf, "%s %f %f %f", buffer, &x, &y, &z);
-
-          if (k == NULL) {
-            return MOLFILE_ERROR;
-          } else if (j < 4) {
-            fprintf(stderr, "xsfplugin) missing type or coordinate(s) in file '%s' for atom '%d'\n",
-                    xsf->file_name, i+1);
-            return MOLFILE_ERROR;
-          } else if (j>=3) {
-            if (ts != NULL) { 
-              // Only save coords if we're given a timestep pointer, 
-              // otherwise assume that VMD wants us to skip past it.
-              float xf, yf, zf;
-              
-              // apply periodic boundary conditions.
-#ifdef TEST_PLUGIN
-                  printf("wrap PBC: before: %12.6f %12.6f %12.6f\n", x, y, z);
-#endif                  
-              switch(xsf->pbctype) {
-                case xsf_CRYSTAL:
-                  xf = xsf->invmat[0][0] * x + xsf->invmat[0][1] * y + xsf->invmat[0][2] * z;
-                  xf = xf - floor((double)xf);
-                  yf = xsf->invmat[1][0] * x + xsf->invmat[1][1] * y + xsf->invmat[1][2] * z;
-                  yf = yf - floor((double)yf);
-                  zf = xsf->invmat[2][0] * x + xsf->invmat[2][1] * y + xsf->invmat[2][2] * z;
-                  zf = zf - floor((double)zf);
-                  x = xsf->box.cell[0][0] * xf + xsf->box.cell[0][1] * yf + xsf->box.cell[0][2] * zf;
-                  y = xsf->box.cell[1][0] * xf + xsf->box.cell[1][1] * yf + xsf->box.cell[1][2] * zf;
-                  z = xsf->box.cell[2][0] * xf + xsf->box.cell[2][1] * yf + xsf->box.cell[2][2] * zf;
-                  break;
-
-                case xsf_SLAB:
-                  xf = xsf->invmat[0][0] * x + xsf->invmat[0][1] * y + xsf->invmat[0][2] * z;
-                  xf = xf - floor((double)xf);
-                  yf = xsf->invmat[1][0] * x + xsf->invmat[1][1] * y + xsf->invmat[1][2] * z;
-                  yf = yf - floor((double)yf);
-                  zf = xsf->invmat[2][0] * x + xsf->invmat[2][1] * y + xsf->invmat[2][2] * z;
-                  x = xsf->box.cell[0][0] * xf + xsf->box.cell[0][1] * yf + xsf->box.cell[0][2] * zf;
-                  y = xsf->box.cell[1][0] * xf + xsf->box.cell[1][1] * yf + xsf->box.cell[1][2] * zf;
-                  z = xsf->box.cell[2][0] * xf + xsf->box.cell[2][1] * yf + xsf->box.cell[2][2] * zf;
-                  break;
-                  
-                case xsf_POLYMER:
-                  xf = xsf->invmat[0][0] * x + xsf->invmat[0][1] * y + xsf->invmat[0][2] * z;
-                  xf = xf - floor((double)xf);
-                  yf = xsf->invmat[1][0] * x + xsf->invmat[1][1] * y + xsf->invmat[1][2] * z;
-                  zf = xsf->invmat[2][0] * x + xsf->invmat[2][1] * y + xsf->invmat[2][2] * z;
-                  x = xsf->box.cell[0][0] * xf + xsf->box.cell[0][1] * yf + xsf->box.cell[0][2] * zf;
-                  y = xsf->box.cell[1][0] * xf + xsf->box.cell[1][1] * yf + xsf->box.cell[1][2] * zf;
-                  z = xsf->box.cell[2][0] * xf + xsf->box.cell[2][1] * yf + xsf->box.cell[2][2] * zf;
-                  break;
-                  
-                case xsf_MOLECULE:
-                  xf = x;
-                  yf = y;
-                  zf = z;
-                  break;
-                  
-                default:
-                  break;
-              }
-              
-#ifdef TEST_PLUGIN
-                  printf("wrap PBC: fract:  %12.6f %12.6f %12.6f\n", xf, yf, zf);
-                  printf("wrap PBC: after: %12.6f %12.6f %12.6f\n", x, y, z);
-#endif                  
-
-              // In order to make the periodic display work, we need to
-              // rotate the coordinates around the origin by the stored
-              // rotation matrix. for xsf files the origin is not explicitely
-              // so far, but since it is already initialized to (0,0,0) it
-              // does no harm, to leave it in here.
-              x -= xsf->origin[0];
-              y -= xsf->origin[1];
-              z -= xsf->origin[2];
-        
-              for (n=0; n<3; ++n) {
-                ts->coords[3*i + n] = (xsf->origin[n] + xsf->rotmat[n][0] * x
-                                       + xsf->rotmat[n][1] * y + xsf->rotmat[n][2] * z);
-              }
-            }
-          } else {
-            break;
-          }
-        }
-        // (re-)set unitcell dimensions
-        if (ts != NULL) { 
-          ts->A = xsf->box.A;
-          ts->B = xsf->box.B;
-          ts->C = xsf->box.C;
-          ts->alpha = xsf->box.alpha;
-          ts->beta  = xsf->box.beta;
-          ts->gamma = xsf->box.gamma;
-        }
-  
-        return MOLFILE_SUCCESS;
-        break;
-        
-        // read and update primitive cell info.
-      case xsf_PRIMVEC: 
-      {
-        float a[3], b[3], c[3];
-        
-        if (xsf_read_cell(xsf->fd, a, b, c)) {
-          xsf_readbox(&(xsf->box), a,b,c);
-          xsf_buildrotmat(xsf, a, b);
-          // print warning, if the rotation will be significant:
-          if ((fabs((double) a[1]) + fabs((double) a[2]) + fabs((double) b[2]))
-              > 0.001) {
-            fprintf(stderr, "xsfplugin) WARNING: Coordinates will be rotated to comply \n"
-                    "xsfplugin) with VMD's conventions for periodic display...\n");
-          }
-          xsf_buildinvmat(xsf, a, b, c);
-
-#if defined(TEST_PLUGIN)
-        printf("new cell vectors:\n");
-        printf("<a>: %12.8f %12.8f %12.8f\n", a[0], a[1], a[2]);
-        printf("<b>: %12.8f %12.8f %12.8f\n", b[0], b[1], b[2]);
-        printf("<c>: %12.8f %12.8f %12.8f\n", c[0], c[1], c[2]);
-        printf("new cell dimensions:\n");
-        printf("a= %12.8f   b= %12.8f   c= %12.8f\n", xsf->box.A, xsf->box.B, xsf->box.C);
-        printf("alpha= %6.2f  beta= %6.2f  gamma= %6.2f\n", xsf->box.alpha, xsf->box.beta, xsf->box.gamma);
-        printf("new reciprocal cell vectors:\n");
-        printf("i: %12.8f %12.8f %12.8f\n", xsf->invmat[0][0], xsf->invmat[0][1], xsf->invmat[0][2]);
-        printf("k: %12.8f %12.8f %12.8f\n", xsf->invmat[1][0], xsf->invmat[1][1], xsf->invmat[1][2]);
-        printf("l: %12.8f %12.8f %12.8f\n", xsf->invmat[2][0], xsf->invmat[2][1], xsf->invmat[2][2]);
-        printf("new cell rotation matrix:\n");
-        printf("x: %12.8f %12.8f %12.8f\n", xsf->rotmat[0][0], xsf->rotmat[0][1], xsf->rotmat[0][2]);
-        printf("y: %12.8f %12.8f %12.8f\n", xsf->rotmat[1][0], xsf->rotmat[1][1], xsf->rotmat[1][2]);
-        printf("z: %12.8f %12.8f %12.8f\n", xsf->rotmat[2][0], xsf->rotmat[2][1], xsf->rotmat[2][2]);
-#endif
-        }
-      }
-      break;
-
-      default:                  // ignore everything unknown
-        break;
-    }
-  } while (! (feof(xsf->fd) || ferror(xsf->fd)));
-
-  // if we reach this point, some error must have happened.
-  return MOLFILE_ERROR;
-}
-
-static int read_xsf_metadata(void *v, int *nvolsets, 
-  molfile_volumetric_t **metadata) {
-  xsf_t *xsf = (xsf_t *)v;
-  *nvolsets = xsf->nvolsets; 
-  *metadata = xsf->vol;  
-
-  return MOLFILE_SUCCESS;
-}
-
-static int read_xsf_data(void *v, int set, float *datablock, float *colorblock) {
-  xsf_t *xsf = (xsf_t *)v;
-  const char *block = xsf->vol[set].dataname;
-  
-  fprintf(stderr, "xsfplugin) trying to read xsf data set %d: %s\n", set, block);
-  
-  int xsize = xsf->vol[set].xsize; 
-  int ysize = xsf->vol[set].ysize;
-  int zsize = xsf->vol[set].zsize;
-  int x, y, z;
-  int n;
-  char readbuf[1024];
-  float dummy;
-  
-  // find data set ...
-  rewind(xsf->fd);
-  do {
-    if (NULL == fgets(readbuf, 1024, xsf->fd)) return MOLFILE_ERROR;
-  } while (strncmp(readbuf, block, 1024));
-  // ... and skip five more lines to get to the beginning of the data
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  eatline(xsf->fd);
-  
-  // read in the data values
-  // XSF data grids include the points at the border on both sides,
-  // so we have to read and skip over those on one of them.
-  n = 0;
-  for (z=0; z<zsize+1; z++) {
-    for (y=0; y<ysize+1; y++) {
-      for (x=0; x<xsize+1; x++) {
-        if ((x>=xsize) || (y>=ysize) || (z>=zsize)) { 
-          if (fscanf(xsf->fd, "%f", &dummy) != 1) return MOLFILE_ERROR;
-        } else {
-          if (fscanf(xsf->fd, "%f", &datablock[n]) != 1) return MOLFILE_ERROR;
-          ++n;
-        }
-      }
-    }
-  }
-  rewind(xsf->fd);
-  return MOLFILE_SUCCESS;
-}
-
-static void close_xsf_read(void *v) {
-  xsf_t *xsf = (xsf_t *)v;
-
-  fclose(xsf->fd);
-  if (xsf->vol) {
-    delete[] xsf->vol; 
-  }
-  free(xsf->file_name);
-  delete xsf;
-}
-
-/*
- * Initialization stuff here
- */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init(void) {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xsf";
-  plugin.prettyname = "(Animated) XCrySDen Structure File";
-  plugin.author = "Axel Kohlmeyer, John Stone";
-  plugin.majorv = 0;
-  plugin.minorv = 10;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "axsf,xsf";
-  plugin.open_file_read = open_xsf_read;
-  plugin.read_structure = read_xsf_structure;
-  plugin.read_next_timestep =read_xsf_timestep;
-  plugin.close_file_read = close_xsf_read;
-  plugin.read_volumetric_metadata = read_xsf_metadata;
-  plugin.read_volumetric_data = read_xsf_data;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini(void) { return VMDPLUGIN_SUCCESS; }
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  int natoms, optflags;
-  void *v;
-  int i, nvolsets, set;
-  molfile_volumetric_t * meta;
-
-
-  printf("got index: %d\n", lookup_keyword("	 ATOMS  "));
-  
-  while (--argc) {
-    ++argv;
-    v = open_xsf_read(*argv, "xsf", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_xsf_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_xsf_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "input contains %d atoms\n", natoms);
-
-    molfile_atom_t atoms[natoms];
-    
-    // try reading the structure info
-    i = read_xsf_structure(v, &optflags, atoms);
-    if (i) {
-      fprintf(stderr, "read_xsf_structure failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "read_xsf_structure succeeded for file %s\n", *argv);
-
-    // try loading the EDM metadata now
-    if (read_xsf_metadata(v, &nvolsets, &meta)) {
-      return 1; // failed to load xsf file
-    }
-    fprintf(stderr, "read_xsf_metadata succeeded for file %s\n", *argv);
-
-    for (set=0; set<nvolsets; set++) {
-      printf("Loading volume set: %d\n", set);   
-      
-      int elements = meta[set].xsize * meta[set].ysize * meta[set].zsize;
-      printf("   Grid Elements: %d\n", elements);
-      printf(" Grid dimensions: X: %d Y: %d Z: %d\n", 
-             meta[set].xsize, meta[set].ysize, meta[set].zsize);
-
-      float * voldata = (float *) malloc(sizeof(float) * elements);
-      float * coldata = NULL;
-
-      if (meta[set].has_color) {
-        coldata = (float *) malloc(sizeof(float) * elements * 3);
-      }
-
-      // try loading the data sets now
-      if (read_xsf_data(v, set, voldata, coldata)) {
-        return 1; // failed to load xsf file
-      }
-
-      printf("First 6 elements:\n   ");
-      for (i=0; i<6; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-
-      printf("Last 6 elements:\n   ");
-      for (i=elements - 6; i<elements; i++) {
-        printf("%g, ", voldata[i]);
-      }
-      printf("\n"); 
-    }
-
-    molfile_timestep_t ts;
-    ts.coords = new float[3*natoms];
-    
-    if (read_xsf_timestep(v, natoms, &ts)) {
-      printf("read_xsf_timestep 0: failed\n");
-    } else {
-      printf("read_xsf_timestep 0: success\n");
-    }
-    
-    if (read_xsf_timestep(v, natoms, &ts)) {
-      printf("read_xsf_timestep 1: failed\n");
-    } else {
-      printf("read_xsf_timestep 1: success\n");
-    }
-    
-    close_xsf_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xyzplugin.c b/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xyzplugin.c
deleted file mode 100644
index adc0b74ab6fb6f67b5f67d44c4a6dc18eb1099c5..0000000000000000000000000000000000000000
--- a/pymolfile/molfile/vmd_molfile_plugins/molfile_plugin/src/xyzplugin.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/***************************************************************************
- *cr
- *cr            (C) Copyright 1995-2016 The Board of Trustees of the
- *cr                        University of Illinois
- *cr                         All Rights Reserved
- *cr
- ***************************************************************************/
-
-/***************************************************************************
- * RCS INFORMATION:
- *
- *      $RCSfile: xyzplugin.c,v $
- *      $Author: johns $       $Locker:  $             $State: Exp $
- *      $Revision: 1.37 $       $Date: 2016/11/28 05:01:55 $
- *
- ***************************************************************************/
-
-/*
- *  XMol XYZ molecule file format:
- *    XYZ files are a simple molecule file format suitable for output
- *    by homegrown software since they are very minimalistic.  They don't
- *    even include bonding information.
- *
- *  [ N                       ] # of atoms, required by this xyz reader plugin
- *  [ molecule name           ] name of molecule (can be blank)
- *  atom1 x y z [optional data] atom name followed by xyz coords 
- *  atom2 x y z [ ...         ] and (optionally) other data.
- *  ...                         instead of atom name the atom number in 
- *  atomN x y z [ ...         ] the PTE can be given.
- *  ...
- *
- *  Note that this plugin currently ignores everything following the z 
- *  coordinate (the optional data fields).
- *
- *  Sample input file for XMol:
- *  3
- *  Water Molecule - XYZ Format
- *  O      .000000     .000000     .114079
- *  H      .000000     .780362    -.456316
- *  H      .000000    -.780362    -.456316
- *                      
- */
-
-#include "largefiles.h"   /* platform dependent 64-bit file I/O defines */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "molfile_plugin.h"
-
-#include "periodic_table.h"
-
-typedef struct {
-  FILE *file;
-  int numatoms;
-  char *file_name;
-  molfile_atom_t *atomlist;
-} xyzdata;
- 
-static void *open_xyz_read(const char *filename, const char *filetype, 
-                           int *natoms) {
-  FILE *fd;
-  xyzdata *data;
-  int i;
-
-  fd = fopen(filename, "rb");
-  if (!fd) return NULL;
-  
-  data = (xyzdata *)malloc(sizeof(xyzdata));
-  data->file = fd;
-  data->file_name = strdup(filename);
-
-  /* First line is the number of atoms   */
-  i = fscanf(data->file, "%d", natoms);
-  if (i < 1) {
-    fprintf(stderr, "\n\nread) ERROR: xyz file '%s' should have the number of atoms in the first line.\n", filename);
-    return NULL;
-  }
-  data->numatoms=*natoms;
-
-  rewind(fd);
-
-  return data;
-}
-
-static int read_xyz_structure(void *mydata, int *optflags, 
-                              molfile_atom_t *atoms) {
-  int i, j;
-  char *k;
-  float coord;
-  molfile_atom_t *atom;
-  xyzdata *data = (xyzdata *)mydata;
-  char buffer[1024], fbuffer[1024];
-
-  /* skip over the first two lines */
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-
-  /* we set atom mass and VDW radius from the PTE. */
-  *optflags = MOLFILE_ATOMICNUMBER | MOLFILE_MASS | MOLFILE_RADIUS; 
-
-  for(i=0; i<data->numatoms; i++) {
-    k = fgets(fbuffer, 1024, data->file);
-    atom = atoms + i;
-    j=sscanf(fbuffer, "%s %f %f %f", buffer, &coord, &coord, &coord);
-    if (k == NULL) {
-      fprintf(stderr, "xyz structure) missing atom(s) in file '%s'\n", data->file_name);
-      fprintf(stderr, "xyz structure) expecting '%d' atoms, found only '%d'\n", data->numatoms, i);
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "xyz structure) missing type or coordinate(s) in file '%s' for atom '%d'\n",
-          data->file_name, i+1);
-      return MOLFILE_ERROR;
-    }
-
-    /* handle the case if the first item is an ordinal number 
-     * from the PTE */
-    if (isdigit(buffer[0])) {
-      int idx;
-      idx = atoi(buffer);
-      strncpy(atom->name, get_pte_label(idx), sizeof(atom->name));
-      atom->atomicnumber = idx;
-      atom->mass = get_pte_mass(idx);
-      atom->radius = get_pte_vdw_radius(idx);
-    } else {
-      int idx;
-      strncpy(atom->name, buffer, sizeof(atom->name));
-      idx = get_pte_idx(buffer);
-      atom->atomicnumber = idx;
-      atom->mass = get_pte_mass(idx);
-      atom->radius = get_pte_vdw_radius(idx);
-    }
-    strncpy(atom->type, atom->name, sizeof(atom->type));
-    atom->resname[0] = '\0';
-    atom->resid = 1;
-    atom->chain[0] = '\0';
-    atom->segid[0] = '\0';
-    /* skip to the end of line */
-  }
-
-  rewind(data->file);
-  return MOLFILE_SUCCESS;
-}
-
-static int read_xyz_timestep(void *mydata, int natoms, molfile_timestep_t *ts) {
-  int i, j;
-  char atom_name[1024], fbuffer[1024], *k;
-  float x, y, z;
-  
-  xyzdata *data = (xyzdata *)mydata;
-  
-  /* skip over the first two lines */
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-  if (NULL == fgets(fbuffer, 1024, data->file))  return MOLFILE_ERROR;
-
-  /* read the coordinates */
-  for (i=0; i<natoms; i++) {
-    k = fgets(fbuffer, 1024, data->file);
-
-    /* Read in atom type, X, Y, Z, skipping any remaining data fields */
-    j = sscanf(fbuffer, "%s %f %f %f", atom_name, &x, &y, &z);
-    if (k == NULL) {
-      return MOLFILE_ERROR;
-    } else if (j < 4) {
-      fprintf(stderr, "xyz timestep) missing type or coordinate(s) in file '%s' for atom '%d'\n",data->file_name,i+1);
-      return MOLFILE_ERROR;
-    } else if (j >= 4) {
-      if (ts != NULL) { 
-        /* only save coords if we're given a timestep pointer, */
-        /* otherwise assume that VMD wants us to skip past it. */
-        ts->coords[3*i  ] = x;
-        ts->coords[3*i+1] = y;
-        ts->coords[3*i+2] = z;
-      }
-    } else {
-      break;
-    }
-  }
-  
-  return MOLFILE_SUCCESS;
-}
-    
-static void close_xyz_read(void *mydata) {
-  xyzdata *data = (xyzdata *)mydata;
-  fclose(data->file);
-  free(data->file_name);
-  free(data);
-}
-
-
-static void *open_xyz_write(const char *filename, const char *filetype, 
-                           int natoms) {
-  FILE *fd;
-  xyzdata *data;
-
-  fd = fopen(filename, "w");
-  if (!fd) { 
-    fprintf(stderr, "Error) Unable to open xyz file %s for writing\n",
-            filename);
-    return NULL;
-  }
-  
-  data = (xyzdata *)malloc(sizeof(xyzdata));
-  data->numatoms = natoms;
-  data->file = fd;
-  data->file_name = strdup(filename);
-  return data;
-}
-
-static int write_xyz_structure(void *mydata, int optflags, 
-                               const molfile_atom_t *atoms) {
-  xyzdata *data = (xyzdata *)mydata;
-  data->atomlist = (molfile_atom_t *)malloc(data->numatoms*sizeof(molfile_atom_t));
-  memcpy(data->atomlist, atoms, data->numatoms*sizeof(molfile_atom_t));
-  return MOLFILE_SUCCESS;
-}
-
-static int write_xyz_timestep(void *mydata, const molfile_timestep_t *ts) {
-  xyzdata *data = (xyzdata *)mydata; 
-  const molfile_atom_t *atom;
-  const float *pos;
-  const char  *label;
-  int i;
-
-  fprintf(data->file, "%d\n", data->numatoms);
-  fprintf(data->file, " generated by VMD\n");
-  
-  atom = data->atomlist;
-  pos = ts->coords;
-  
-  for (i = 0; i < data->numatoms; ++i) {
-    if (atom->atomicnumber > 0) {
-       label=pte_label[atom->atomicnumber];
-    } else {
-       label=atom->name;
-    }
-    fprintf(data->file, " %-2s %15.6f %15.6f %15.6f\n", 
-            label, pos[0], pos[1], pos[2]);
-    ++atom; 
-    pos += 3;
-  }
-  return MOLFILE_SUCCESS;
-}
-
-
-static void close_xyz_write(void *mydata) {
-  xyzdata *data = (xyzdata *)mydata;
-  fclose(data->file);
-  free(data->atomlist);
-  free(data->file_name);
-  free(data);
-}
-
-/* registration stuff */
-static molfile_plugin_t plugin;
-
-VMDPLUGIN_API int VMDPLUGIN_init() {
-  memset(&plugin, 0, sizeof(molfile_plugin_t));
-  plugin.abiversion = vmdplugin_ABIVERSION;
-  plugin.type = MOLFILE_PLUGIN_TYPE;
-  plugin.name = "xyz";
-  plugin.prettyname = "XYZ";
-  plugin.author = "Mauricio Carrillo Tripp, John E. Stone, Axel Kohlmeyer";
-  plugin.majorv = 1;
-  plugin.minorv = 3;
-  plugin.is_reentrant = VMDPLUGIN_THREADSAFE;
-  plugin.filename_extension = "xyz,xmol";
-  plugin.open_file_read = open_xyz_read;
-  plugin.read_structure = read_xyz_structure;
-  plugin.read_next_timestep = read_xyz_timestep;
-  plugin.close_file_read = close_xyz_read;
-  plugin.open_file_write = open_xyz_write;
-  plugin.write_structure = write_xyz_structure;
-  plugin.write_timestep = write_xyz_timestep;
-  plugin.close_file_write = close_xyz_write;
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_register(void *v, vmdplugin_register_cb cb) {
-  (*cb)(v, (vmdplugin_t *)&plugin);
-  return VMDPLUGIN_SUCCESS;
-}
-
-VMDPLUGIN_API int VMDPLUGIN_fini() {
-  return VMDPLUGIN_SUCCESS;
-}
-
-
-#ifdef TEST_PLUGIN
-
-int main(int argc, char *argv[]) {
-  molfile_timestep_t timestep;
-  void *v;
-  int natoms;
-  int i, nsets, set;
-
-  while (--argc) {
-    ++argv;
-    v = open_xyz_read(*argv, "xyz", &natoms);
-    if (!v) {
-      fprintf(stderr, "open_xyz_read failed for file %s\n", *argv);
-      return 1;
-    }
-    fprintf(stderr, "open_xyz_read succeeded for file %s\n", *argv);
-    fprintf(stderr, "number of atoms: %d\n", natoms);
-
-    i = 0;
-    timestep.coords = (float *)malloc(3*sizeof(float)*natoms);
-    while (!read_xyz_timestep(v, natoms, &timestep)) {
-      i++;
-    }
-    fprintf(stderr, "ended read_next_timestep on frame %d\n", i);
-
-    close_xyz_read(v);
-  }
-  return 0;
-}
-
-#endif
-
diff --git a/pymolfile/plugin_list.pyc b/pymolfile/plugin_list.pyc
deleted file mode 100644
index e2ae09006f8595e1ab959ded1fa70b1e9e6da63d..0000000000000000000000000000000000000000
Binary files a/pymolfile/plugin_list.pyc and /dev/null differ
diff --git a/pymolfile/pymolfile.pyc b/pymolfile/pymolfile.pyc
deleted file mode 100644
index ad428713b68f97c74134807f79a3bc1f2769ca3b..0000000000000000000000000000000000000000
Binary files a/pymolfile/pymolfile.pyc and /dev/null differ
diff --git a/pymolfile/test_libpymolfile.py b/pymolfile/test_libpymolfile.py
deleted file mode 100644
index a509ef39b8dd2d91171f1cd1c4389330123337e1..0000000000000000000000000000000000000000
--- a/pymolfile/test_libpymolfile.py
+++ /dev/null
@@ -1,133 +0,0 @@
-import numpy
-import molfile.libpymolfile as pym
-
-mylist  = pym.molfile_plugin_list(200)
-print(mylist)
-numlist = pym.molfile_init()
-print(numlist)
-for i in range(numlist):
-    testplugin = pym.molfile_plugin_info(mylist, i)
-    print(i, testplugin)
-
-#splugin = pym.get_plugin(mylist, 99) #pdb
-#cplugin = pym.get_plugin(mylist, 83) #trr
-#cplugin = pym.get_plugin(mylist, 85) #xtc
-splugin = pym.get_plugin(mylist, 105) #psf
-#splugin = pym.get_plugin(mylist, 81) #gro
-cplugin = pym.get_plugin(mylist, 69) #dcd
-#cplugin = pym.get_plugin(mylist, 126) #nc
-print(splugin)
-print(cplugin)
-natoms=0
-#sfname="../test/DPDP.pdb"
-#cfname="../test/DPDP.nc"
-
-#sfname="../test/ala3.pdb"
-sfname="../test/ala3.psf"
-cfname="../test/ala3.dcd"
-
-#sfname="../test/md.gro"
-#cfname="../test/md.trr"
-#cfname="../test/md.xtc"
-
-#sfname="../test/md_1u19.gro"
-#cfname="../test/md_1u19.xtc"
-
-#sftype="pdb"
-#cftype="trr"
-#cftype="xtc"
-sftype="psf"
-#sftype="gro"
-cftype="dcd"
-#cftype="nc"
-
-print("Structure plugin:")
-spluginhandle = pym.open_file_read(splugin, sfname, sftype, natoms)
-print("Coordinate plugin:")
-cpluginhandle = pym.open_file_read(cplugin, cfname, cftype, natoms)
-print(cpluginhandle)
-print(cpluginhandle.natoms)
-print(spluginhandle)
-print(spluginhandle.natoms)
-if cpluginhandle.natoms != spluginhandle.natoms:
-    print("Number of atoms do not match in structure and coordinate files.")
-    
-
-if pym.is_plugin_same(spluginhandle, cpluginhandle):
-    pym.close_file_read(cpluginhandle)
-    cpluginhandle = spluginhandle
-
-#if 0 && vmdplugin_ABIVERSION > 17
-#  /* The new PDB file formats allows for much larger structures, */
-#  /* which can therefore require longer chain ID strings.  The   */
-#  /* new PDBx/mmCIF file formats do not have length limits on    */
-#  /* fields, so PDB chains could be arbitrarily long strings     */
-#  /* in such files.  At present, we know we need at least 3-char */
-#  /* chains for existing PDBx/mmCIF files.                       */
-#  char chain[4];      /**< required chain name, or ""            */
-#else
-#  char chain[2];      /**< required chain name, or ""            */
-#endif
-# Change 'chain', 'S4' to S2 for PDB
-if 'pdb' in [sftype, cftype]:
-    print("file chain is set to S2")
-    chain_size = 'S2'
-else:
-    chain_size = 'S4'
-x = numpy.array([
-    ('C1','C','ACE',0,'','','','',1.0,1.0,1.0,1.0,1.0,6), 
-    ('C2','C','ACE',0,'','','','',1.0,1.0,1.0,1.0,1.0,6)
-    ],
-    dtype=[
-        ('name', 'S16'), ('type', 'S16'), ('resname', 'S8'),
-        ('resid', 'i4'), ('segid', 'S8'), ('chain', chain_size),
-        ('altloc', 'S2'), ('insertion', 'S2'), ('occupancy', 'f4'),
-        ('bfactor', 'f4'), ('mass', 'f4'), ('charge', 'f4'),
-        ('radius', 'f4'), ('atomicnumber', 'i4')
-        ]
-    )
-y = pym.read_fill_structure(spluginhandle, x)
-if y is not None:
-    print(y)
-    print(len(y))
-
-try:
-    z = pym.read_fill_bonds(spluginhandle)
-    if z is not None:
-        print(z)
-        print(len(z))
-except (AttributeError, SystemError):
-    pass
-
-try:
-    a = pym.read_fill_angles(spluginhandle)
-    if a is not None:
-        print(a)
-        print(len(a))
-except (AttributeError, SystemError):
-    pass
-
-if pym.is_plugin_same(spluginhandle, cpluginhandle):
-    pass
-else:
-    pym.close_file_read(spluginhandle)
-
-step=0
-while True:
-#while False:
-    try:
-        c = pym.read_fill_next_timestep(cpluginhandle)
-        if c is None:
-            break
-        step=step+1
-        print("Step:",step)
-        print(c)
-        if c["coords"] is not None:
-            print(len(c["coords"]))
-    except (AttributeError,OSError):
-        pass
-
-pym.close_file_read(cpluginhandle)
-pym.molfile_finish()
-
-