Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

jsplugin.c File Reference

#include "largefiles.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "hash.h"
#include "fastio.h"
#include "endianswap.h"
#include "molfile_plugin.h"

Go to the source code of this file.

Compounds

struct  jshandle

Defines

#define VMDPLUGIN_STATIC
#define M_PI_2   1.57079632679489661922
#define JSHEADERSTRING   "JS Binary Structure and Trajectory File Format"
#define JSMAGICNUMBER   0x31337
#define JSENDIANISM   0x12345678
#define JSMAJORVERSION   1
#define JSMINORVERSION   0
#define JSNFRAMESOFFSET   (strlen(JSHEADERSTRING) + 20)
#define JSNOERR   0
#define JSBADFILE   1
#define JSBADFORMAT   2
#define JSOPT_NOOPTIONS   0x0000
#define JSOPT_STRUCTURE   0x0001
#define JSOPT_BONDS   0x0002
#define JSOPT_BONDORDERS   0x0004
#define JSOPT_OCCUPANCY   0x0008
#define JSOPT_BFACTOR   0x0010
#define JSOPT_MASS   0x0020
#define JSOPT_CHARGE   0x0040
#define JSOPT_RADIUS   0x0080
#define JSOPT_ATOMICNUMBER   0x0100

Functions

void * open_js_read (const char *path, const char *filetype, int *natoms)
int read_js_timestep (void *v, int natoms, molfile_timestep_t *ts)
void close_js_read (void *v)
void * open_js_write (const char *path, const char *filetype, int natoms)
int write_js_timestep (void *v, const molfile_timestep_t *ts)
void close_js_write (void *v)
VMDPLUGIN_API int VMDPLUGIN_init ()
VMDPLUGIN_API int VMDPLUGIN_register (void *v, vmdplugin_register_cb cb)
VMDPLUGIN_API int VMDPLUGIN_fini ()

Variables

molfile_plugin_t plugin


Define Documentation

#define JSBADFILE   1
 

Definition at line 74 of file jsplugin.c.

#define JSBADFORMAT   2
 

Definition at line 75 of file jsplugin.c.

#define JSENDIANISM   0x12345678
 

Definition at line 62 of file jsplugin.c.

Referenced by open_js_read, and open_js_write.

#define JSHEADERSTRING   "JS Binary Structure and Trajectory File Format"
 

Definition at line 60 of file jsplugin.c.

Referenced by open_js_read, and open_js_write.

#define JSMAGICNUMBER   0x31337
 

Definition at line 61 of file jsplugin.c.

Referenced by open_js_read, and open_js_write.

#define JSMAJORVERSION   1
 

Definition at line 67 of file jsplugin.c.

Referenced by open_js_write.

#define JSMINORVERSION   0
 

Definition at line 68 of file jsplugin.c.

Referenced by open_js_write.

#define JSNFRAMESOFFSET   (strlen(JSHEADERSTRING) + 20)
 

Definition at line 71 of file jsplugin.c.

Referenced by close_js_write.

#define JSNOERR   0
 

Definition at line 73 of file jsplugin.c.

#define JSOPT_ATOMICNUMBER   0x0100
 

Definition at line 87 of file jsplugin.c.

#define JSOPT_BFACTOR   0x0010
 

Definition at line 83 of file jsplugin.c.

#define JSOPT_BONDORDERS   0x0004
 

Definition at line 81 of file jsplugin.c.

#define JSOPT_BONDS   0x0002
 

Definition at line 80 of file jsplugin.c.

#define JSOPT_CHARGE   0x0040
 

Definition at line 85 of file jsplugin.c.

#define JSOPT_MASS   0x0020
 

Definition at line 84 of file jsplugin.c.

#define JSOPT_NOOPTIONS   0x0000
 

Definition at line 78 of file jsplugin.c.

#define JSOPT_OCCUPANCY   0x0008
 

Definition at line 82 of file jsplugin.c.

#define JSOPT_RADIUS   0x0080
 

Definition at line 86 of file jsplugin.c.

#define JSOPT_STRUCTURE   0x0001
 

Definition at line 79 of file jsplugin.c.

#define M_PI_2   1.57079632679489661922
 

Definition at line 57 of file jsplugin.c.

Referenced by read_js_timestep, and write_js_timestep.

#define VMDPLUGIN_STATIC
 

Definition at line 50 of file jsplugin.c.


Function Documentation

void close_js_read void *    v [static]
 

Definition at line 541 of file jsplugin.c.

References jshandle::fd, and fio_fclose.

Referenced by VMDPLUGIN_init.

void close_js_write void *    v [static]
 

Definition at line 983 of file jsplugin.c.

References jshandle::fd, fio_fclose, fio_fseek, FIO_SEEK_END, FIO_SEEK_SET, fio_write_int32, JSNFRAMESOFFSET, and jshandle::nframes.

Referenced by VMDPLUGIN_init.

void* open_js_read const char *    path,
const char *    filetype,
int *    natoms
[static]
 

Definition at line 112 of file jsplugin.c.

References jshandle::fd, fio_fclose, fio_fread, fio_open, FIO_READ, fio_read_int32, JSENDIANISM, JSHEADERSTRING, JSMAGICNUMBER, jshandle::natoms, jshandle::nframes, jshandle::reverseendian, and swap4_aligned.

Referenced by VMDPLUGIN_init.

void* open_js_write const char *    path,
const char *    filetype,
int    natoms
[static]
 

Definition at line 558 of file jsplugin.c.

References jshandle::fd, fio_open, FIO_WRITE, fio_write_int32, fio_write_str, JSENDIANISM, JSHEADERSTRING, JSMAGICNUMBER, JSMAJORVERSION, JSMINORVERSION, jshandle::natoms, jshandle::nframes, and jshandle::with_unitcell.

Referenced by VMDPLUGIN_init.

int read_js_timestep void *    v,
int    natoms,
molfile_timestep_t   ts
[static]
 

Definition at line 491 of file jsplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, molfile_timestep_t::B, molfile_timestep_t::beta, molfile_timestep_t::C, molfile_timestep_t::coords, jshandle::fd, fio_fseek, fio_readv, FIO_SEEK_CUR, molfile_timestep_t::gamma, fio_iovec::iov_base, fio_iovec::iov_len, M_PI_2, MOLFILE_EOF, MOLFILE_SUCCESS, jshandle::reverseendian, swap4_aligned, and swap8_aligned.

Referenced by VMDPLUGIN_init.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 1044 of file jsplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 1011 of file jsplugin.c.

References molfile_plugin_t::close_file_read, molfile_plugin_t::close_file_write, close_js_read, close_js_write, molfile_plugin_t::filename_extension, MOLFILE_PLUGIN_TYPE, molfile_plugin_t::open_file_read, molfile_plugin_t::open_file_write, open_js_read, open_js_write, molfile_plugin_t::read_bonds, read_js_timestep, molfile_plugin_t::read_next_timestep, molfile_plugin_t::read_structure, vmdplugin_ABIVERSION, VMDPLUGIN_API, VMDPLUGIN_SUCCESS, VMDPLUGIN_THREADSAFE, molfile_plugin_t::write_bonds, write_js_timestep, molfile_plugin_t::write_structure, and molfile_plugin_t::write_timestep.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 1039 of file jsplugin.c.

References VMDPLUGIN_API, vmdplugin_register_cb, and VMDPLUGIN_SUCCESS.

int write_js_timestep void *    v,
const molfile_timestep_t   ts
[static]
 

Definition at line 961 of file jsplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, molfile_timestep_t::B, molfile_timestep_t::beta, molfile_timestep_t::C, molfile_timestep_t::coords, jshandle::fd, fio_fwrite, molfile_timestep_t::gamma, M_PI_2, MOLFILE_SUCCESS, jshandle::natoms, and jshandle::nframes.

Referenced by VMDPLUGIN_init.


Variable Documentation

molfile_plugin_t plugin [static]
 

Definition at line 1009 of file jsplugin.c.


Generated on Sun Sep 7 01:39:39 2008 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002