PluginIOMgr.C

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include "PluginIOMgr.h"
00003 
00004 //static const int PluginIOMgr::MAX_PLUGINS = 200;
00005 
00006 int register_cb(void *v, vmdplugin_t *p){
00007 /*    const char *key = p->name;
00008     if (num_plugins >= MAX_PLUGINS) {
00009         fprintf(stderr, "Exceeded maximum allowed number of plugins; recompile. :(\n");
00010         return NAMDPLUGIN_ERROR;
00011     }
00012     if (hash_insert(&pluginhash, key, num_plugins) != HASH_FAIL) {
00013         fprintf(stderr, "Multiple plugins for file type '%s' found!", key);
00014         return NAMDPLUGIN_ERROR;
00015     }
00016     plugins[num_plugins++] = (molfile_plugin_t *)p;
00017     return NAMDPLUGIN_SUCCESS;
00018 */
00019     PluginIOMgr *me = (PluginIOMgr *)v;
00020     me->setPlugin((molfile_plugin_t *)p);
00021     return 0;
00022 }
00023 
00024 PluginIOMgr::PluginIOMgr(){
00025     molfile_jsplugin_init();
00026     molfile_jsplugin_register(this, register_cb);
00027 }
00028 
00029 PluginIOMgr::~PluginIOMgr(){
00030     molfile_jsplugin_fini();
00031 }
00032 
00033 /*molfile_plugin_t *PulginIOMgr::getPlugin(const char *filetype){
00034     int id;
00035     if ((id = hash_lookup(&pluginhash, filetype)) == HASH_FAIL) {
00036         fprintf(stderr, "No plugin found for filetype '%s'\n", filetype);
00037         return NULL;
00038     }
00039 
00040     return plugins[id];
00041 }*/

Generated on Tue Sep 26 01:17:14 2017 for NAMD by  doxygen 1.4.7