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 "fastio.h"
#include "endianswap.h"
#include "molfile_plugin.h"

Go to the source code of this file.

Compounds

struct  jshandle

Defines

#define M_PI_2   1.57079632679489661922
#define JSHEADERSTRING   "JS Binary 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

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 jsplugin


Define Documentation

#define JSBADFILE   1
 

Definition at line 68 of file jsplugin.c.

#define JSBADFORMAT   2
 

Definition at line 69 of file jsplugin.c.

#define JSENDIANISM   0x12345678
 

Definition at line 61 of file jsplugin.c.

Referenced by open_js_read, and open_js_write.

#define JSHEADERSTRING   "JS Binary Trajectory File Format"
 

Definition at line 59 of file jsplugin.c.

Referenced by open_js_read, and open_js_write.

#define JSMAGICNUMBER   0x31337
 

Definition at line 60 of file jsplugin.c.

Referenced by open_js_read, and open_js_write.

#define JSMAJORVERSION   1
 

Definition at line 62 of file jsplugin.c.

Referenced by open_js_write.

#define JSMINORVERSION   0
 

Definition at line 63 of file jsplugin.c.

Referenced by open_js_write.

#define JSNFRAMESOFFSET   (strlen(JSHEADERSTRING) + 20)
 

Definition at line 65 of file jsplugin.c.

Referenced by close_js_write.

#define JSNOERR   0
 

Definition at line 67 of file jsplugin.c.

#define M_PI_2   1.57079632679489661922
 

Definition at line 56 of file jsplugin.c.

Referenced by read_js_timestep, and write_js_timestep.


Function Documentation

void close_js_read void *    v [static]
 

Definition at line 193 of file jsplugin.c.

References jshandle::fd, and fio_fclose.

void close_js_write void *    v [static]
 

Definition at line 253 of file jsplugin.c.

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

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

Definition at line 80 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::reverse, and swap4_aligned.

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

Definition at line 200 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.

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

Definition at line 143 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::reverse, swap4_aligned, and swap8_aligned.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 302 of file jsplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 293 of file jsplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 297 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 231 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.


Variable Documentation

molfile_plugin_t jsplugin [static]
 

Initial value:

 {
  vmdplugin_ABIVERSION,                         
  MOLFILE_PLUGIN_TYPE,                          
  "js",                                         
  "js",                                         
  "John Stone",                                 
  0,                                            
  8,                                            
  VMDPLUGIN_THREADSAFE,                         
  "js",                                         
  open_js_read,
  0,
  0,
  read_js_timestep,
  close_js_read,
  open_js_write,
  0,
  write_js_timestep,
  close_js_write,
  0,                            
  0,                            
  0                             
}

Definition at line 269 of file jsplugin.c.


Generated on Wed Mar 22 13:15:33 2006 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002