Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

vtfplugin.c File Reference

#include <molfile_plugin.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <string.h>

Go to the source code of this file.

Compounds

struct  vtf_data

Defines

#define VTFFILE   FILE*
#define VERSION_MAJOR   2
#define VERSION_MINOR   4
#define VTF_MOLFILE   0
#define VTF_USERDATA   1
#define TIMESTEP_INDEXED   0
#define TIMESTEP_ORDERED   1
#define TIMESTEP_VCFSTART   2
#define AIDLOOP(assignment)

Functions

void vtf_error (const char *msg, const char *line)
void sfree (void *ptr)
char * vtf_getline (VTFFILE file)
void vtf_create_atoms_as_needed (int max_aid, vtf_data *d)
int * vtf_parse_aid_specifier (char *s, vtf_data *d)
int vtf_parse_atom (char *line, vtf_data *d)
int vtf_parse_bond (char *line, vtf_data *d)
int vtf_parse_pbc (char *line, vtf_data *d)
int vtf_parse_timestep (char *line, vtf_data *d)
void vtf_parse_structure (vtf_data *d)
vtf_data_vtf_open_file_read (const char *filepath, const char *filetype, int *natoms, int read_mode)
void * vtf_open_file_read (const char *filepath, const char *filetype, int *natoms)
void vtf_close_file_read (void *data)
int vtf_read_next_timestep (void *data, int natoms, molfile_timestep_t *ts)
int vtf_read_structure (void *data, int *optflags, molfile_atom_t *atoms)
int vtf_read_bonds (void *data, int *nbonds, int **from, int **to, float **bondorder, int **bondtype, int *nbondtypes, char ***bondtypename)
VMDPLUGIN_API int VMDPLUGIN_init ()
VMDPLUGIN_API int VMDPLUGIN_register (void *v, vmdplugin_register_cb cb)
VMDPLUGIN_API int VMDPLUGIN_fini ()

Variables

molfile_atom_t default_atom
char * default_userdata
const char * molid
const char * userdata_varname
int vtf_lineno = 0
molfile_plugin_t vsfplugin
molfile_plugin_t vtfplugin
molfile_plugin_t vcfplugin


Define Documentation

#define AIDLOOP assignment   
 

Value:

{                                                                     \
    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;                                                       \
    }                                                                   \
  }

#define TIMESTEP_INDEXED   0
 

Definition at line 101 of file vtfplugin.c.

Referenced by vtf_parse_timestep, and vtf_read_next_timestep.

#define TIMESTEP_ORDERED   1
 

Definition at line 102 of file vtfplugin.c.

Referenced by _vtf_open_file_read, vtf_parse_timestep, and vtf_read_next_timestep.

#define TIMESTEP_VCFSTART   2
 

Definition at line 103 of file vtfplugin.c.

Referenced by _vtf_open_file_read, and vtf_read_next_timestep.

#define VERSION_MAJOR   2
 

Definition at line 47 of file vtfplugin.c.

Referenced by VMDPLUGIN_init.

#define VERSION_MINOR   4
 

Definition at line 48 of file vtfplugin.c.

Referenced by VMDPLUGIN_init.

#define VTF_MOLFILE   0
 

Definition at line 68 of file vtfplugin.c.

Referenced by vtf_create_atoms_as_needed, vtf_open_file_read, vtf_parse_atom, and vtf_parse_structure.

#define VTF_USERDATA   1
 

Definition at line 69 of file vtfplugin.c.

Referenced by vtf_read_next_timestep.

#define VTFFILE   FILE*
 

Definition at line 40 of file vtfplugin.c.

Referenced by vtf_getline.


Function Documentation

vtf_data* _vtf_open_file_read const char *    filepath,
const char *    filetype,
int *    natoms,
int    read_mode
[static]
 

Definition at line 886 of file vtfplugin.c.

References vtf_data::A, vtf_data::alpha, vtf_data::atoms, vtf_data::B, vtf_data::beta, vtf_data::C, vtf_data::coords, vtf_data::file, vtf_data::from, vtf_data::gamma, MOLFILE_NOOPTIONS, MOLFILE_NOSTRUCTUREDATA, MOLFILE_NUMATOMS_UNKNOWN, vtf_data::natoms, vtf_data::nbonds, vtf_data::optflags, vtf_data::read_mode, vtf_data::return_code, sfree, vtf_data::timestep, vtf_data::timestep_mode, TIMESTEP_ORDERED, TIMESTEP_VCFSTART, vtf_data::to, and vtf_parse_structure.

Referenced by vtf_open_file_read.

void sfree void *    ptr [static]
 

Definition at line 157 of file vtfplugin.c.

Referenced by _vtf_open_file_read, vtf_close_file_read, vtf_getline, vtf_parse_aid_specifier, vtf_parse_atom, vtf_parse_structure, and vtf_read_structure.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 1287 of file vtfplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 1222 of file vtfplugin.c.

References molfile_plugin_t::close_file_read, molfile_plugin_t::filename_extension, MOLFILE_PLUGIN_TYPE, molfile_plugin_t::open_file_read, molfile_plugin_t::read_bonds, molfile_plugin_t::read_next_timestep, molfile_plugin_t::read_structure, VERSION_MAJOR, VERSION_MINOR, vmdplugin_ABIVERSION, VMDPLUGIN_API, VMDPLUGIN_SUCCESS, VMDPLUGIN_THREADUNSAFE, vtf_close_file_read, vtf_open_file_read, vtf_read_bonds, vtf_read_next_timestep, and vtf_read_structure.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 1280 of file vtfplugin.c.

References VMDPLUGIN_API, vmdplugin_register_cb, and VMDPLUGIN_SUCCESS.

void vtf_close_file_read void *    data [static]
 

Definition at line 969 of file vtfplugin.c.

References vtf_data::coords, vtf_data::file, vtf_data::from, sfree, and vtf_data::to.

Referenced by VMDPLUGIN_init.

void vtf_create_atoms_as_needed int    max_aid,
vtf_data   d
[static]
 

Definition at line 266 of file vtfplugin.c.

References vtf_data::atoms, default_userdata, vtf_data::natoms, vtf_data::read_mode, and VTF_MOLFILE.

Referenced by vtf_parse_aid_specifier.

void vtf_error const char *    msg,
const char *    line
[static]
 

Definition at line 140 of file vtfplugin.c.

References vtf_lineno.

Referenced by vtf_parse_aid_specifier, vtf_parse_atom, vtf_parse_bond, vtf_parse_pbc, vtf_parse_structure, vtf_parse_timestep, vtf_read_bonds, and vtf_read_next_timestep.

char* vtf_getline VTFFILE    file [static]
 

Definition at line 172 of file vtfplugin.c.

References sfree, vtf_lineno, and VTFFILE.

Referenced by vtf_parse_structure, and vtf_read_next_timestep.

void* vtf_open_file_read const char *    filepath,
const char *    filetype,
int *    natoms
[static]
 

Definition at line 962 of file vtfplugin.c.

References _vtf_open_file_read, and VTF_MOLFILE.

Referenced by VMDPLUGIN_init.

int* vtf_parse_aid_specifier char *    s,
vtf_data   d
[static]
 

Definition at line 291 of file vtfplugin.c.

References vtf_data::natoms, sfree, vtf_create_atoms_as_needed, and vtf_error.

Referenced by vtf_parse_atom.

int vtf_parse_atom char *    line,
vtf_data   d
[static]
 

Definition at line 366 of file vtfplugin.c.

References molfile_atom_t::altloc, molfile_atom_t::atomicnumber, molfile_atom_t::bfactor, molfile_atom_t::chain, molfile_atom_t::charge, default_userdata, molfile_atom_t::insertion, molfile_atom_t::mass, MOLFILE_ALTLOC, MOLFILE_ATOMICNUMBER, MOLFILE_BFACTOR, MOLFILE_CHARGE, MOLFILE_ERROR, MOLFILE_INSERTION, MOLFILE_MASS, MOLFILE_OCCUPANCY, MOLFILE_RADIUS, molfile_atom_t::name, molfile_atom_t::occupancy, vtf_data::optflags, molfile_atom_t::radius, vtf_data::read_mode, molfile_atom_t::resid, molfile_atom_t::resname, molfile_atom_t::segid, sfree, molfile_atom_t::type, vtf_error, VTF_MOLFILE, and vtf_parse_aid_specifier.

Referenced by vtf_parse_structure.

int vtf_parse_bond char *    line,
vtf_data   d
[static]
 

Definition at line 657 of file vtfplugin.c.

References vtf_data::from, MOLFILE_ERROR, vtf_data::nbonds, vtf_data::to, and vtf_error.

Referenced by vtf_parse_structure.

int vtf_parse_pbc char *    line,
vtf_data   d
[static]
 

Definition at line 719 of file vtfplugin.c.

References vtf_data::A, vtf_data::alpha, vtf_data::B, vtf_data::beta, vtf_data::C, vtf_data::gamma, MOLFILE_ERROR, and vtf_error.

Referenced by vtf_parse_structure, and vtf_read_next_timestep.

void vtf_parse_structure vtf_data   d [static]
 

Definition at line 759 of file vtfplugin.c.

References molfile_atom_t::altloc, vtf_data::atoms, molfile_atom_t::bfactor, molfile_atom_t::chain, molfile_atom_t::charge, default_userdata, vtf_data::file, molfile_atom_t::insertion, molfile_atom_t::mass, MOLFILE_ERROR, MOLFILE_NOSTRUCTUREDATA, molfile_atom_t::name, molfile_atom_t::occupancy, molfile_atom_t::radius, vtf_data::read_mode, molfile_atom_t::resid, molfile_atom_t::resname, vtf_data::return_code, molfile_atom_t::segid, sfree, molfile_atom_t::type, vtf_error, vtf_getline, vtf_lineno, VTF_MOLFILE, vtf_parse_atom, vtf_parse_bond, vtf_parse_pbc, and vtf_parse_timestep.

Referenced by _vtf_open_file_read.

int vtf_parse_timestep char *    line,
vtf_data   d
[static]
 

Definition at line 741 of file vtfplugin.c.

References MOLFILE_ERROR, TIMESTEP_INDEXED, vtf_data::timestep_mode, TIMESTEP_ORDERED, and vtf_error.

Referenced by vtf_parse_structure, and vtf_read_next_timestep.

int vtf_read_bonds void *    data,
int *    nbonds,
int **    from,
int **    to,
float **    bondorder,
int **    bondtype,
int *    nbondtypes,
char ***    bondtypename
[static]
 

Definition at line 1188 of file vtfplugin.c.

References vtf_data::from, MOLFILE_ERROR, vtf_data::nbonds, vtf_data::to, and vtf_error.

Referenced by VMDPLUGIN_init.

int vtf_read_next_timestep void *    data,
int    natoms,
molfile_timestep_t   ts
[static]
 

Definition at line 989 of file vtfplugin.c.

References vtf_data::A, molfile_timestep_t::A, vtf_data::alpha, molfile_timestep_t::alpha, vtf_data::B, molfile_timestep_t::B, vtf_data::beta, molfile_timestep_t::beta, vtf_data::C, molfile_timestep_t::C, molfile_timestep_t::coords, vtf_data::coords, vtf_data::file, vtf_data::gamma, molfile_timestep_t::gamma, MOLFILE_EOF, MOLFILE_ERROR, molfile_timestep_t::physical_time, vtf_data::read_mode, vtf_data::timestep, TIMESTEP_INDEXED, vtf_data::timestep_mode, TIMESTEP_ORDERED, TIMESTEP_VCFSTART, molfile_timestep_t::velocities, vtf_error, vtf_getline, vtf_parse_pbc, vtf_parse_timestep, and VTF_USERDATA.

Referenced by VMDPLUGIN_init.

int vtf_read_structure void *    data,
int *    optflags,
molfile_atom_t   atoms
[static]
 

Definition at line 1166 of file vtfplugin.c.

References vtf_data::atoms, vtf_data::natoms, vtf_data::optflags, vtf_data::return_code, and sfree.

Referenced by VMDPLUGIN_init.


Variable Documentation

molfile_atom_t default_atom [static]
 

Definition at line 60 of file vtfplugin.c.

char* default_userdata
 

Definition at line 61 of file vtfplugin.c.

Referenced by vtf_create_atoms_as_needed, vtf_parse_atom, and vtf_parse_structure.

const char* molid
 

Definition at line 62 of file vtfplugin.c.

const char* userdata_varname
 

Definition at line 63 of file vtfplugin.c.

molfile_plugin_t vcfplugin [static]
 

Definition at line 1220 of file vtfplugin.c.

molfile_plugin_t vsfplugin [static]
 

Definition at line 1218 of file vtfplugin.c.

int vtf_lineno = 0 [static]
 

Definition at line 106 of file vtfplugin.c.

Referenced by vtf_error, vtf_getline, and vtf_parse_structure.

molfile_plugin_t vtfplugin [static]
 

Definition at line 1219 of file vtfplugin.c.


Generated on Thu Mar 28 03:08:31 2024 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002