Index: /trunk/pbs_drmaa/pbs_conn.c
===================================================================
--- /trunk/pbs_drmaa/pbs_conn.c	(revision 94)
+++ /trunk/pbs_drmaa/pbs_conn.c	(revision 95)
@@ -18,5 +18,5 @@
  */
 
- #ifdef HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 #	include <config.h>
 #endif
@@ -37,4 +37,5 @@
 #include <signal.h>
 #include <unistd.h>
+
 
 
@@ -154,28 +155,28 @@
 }
 
-#define HAS_PBS_SUBMIT_HASH		
-#ifdef HAS_PBS_SUBMIT_HASH
-
-#include <qsub_functions.h>
+#ifdef HAVE_PBS_SUBMIT_HASH
+
+
+#include <torque4.h>
 
 void set_job_defaults(job_info *ji) {
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_c, CHECKPOINT_UNSPECIFIED, STATIC_DATA);
-
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_h, NO_HOLD, STATIC_DATA);
-
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_j, NO_JOIN, STATIC_DATA);
-
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_k, NO_KEEP, STATIC_DATA);
-
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_m, MAIL_AT_ABORT, STATIC_DATA);
-
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_p, DEFAULT_PRIORITY, STATIC_DATA);
-
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_r, "FALSE", STATIC_DATA);
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_f, "FALSE", STATIC_DATA);
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_c, CHECKPOINT_UNSPECIFIED, STATIC_DATA);
+
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_h, NO_HOLD, STATIC_DATA);
+
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_j, NO_JOIN, STATIC_DATA);
+
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_k, NO_KEEP, STATIC_DATA);
+
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_m, MAIL_AT_ABORT, STATIC_DATA);
+
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_p, DEFAULT_PRIORITY, STATIC_DATA);
+
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_r, "FALSE", STATIC_DATA);
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_f, "FALSE", STATIC_DATA);
   
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->client_attr, "pbs_dprefix", "#PBS", STATIC_DATA);
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_job_radix, "0", STATIC_DATA);
-  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_v, "");
+  hash_add_or_exit_c(&ji->mm, &ji->client_attr, "pbs_dprefix", "#PBS", STATIC_DATA);
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_job_radix, "0", STATIC_DATA);
+  hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_v, "", ENV_DATA);
 }  
 
@@ -192,5 +193,5 @@
 	memset(&ji, 0, sizeof(job_info));
 
-	if (_Z11memmgr_initPP6memmgri(&ji.mm, 8192) != PBSE_NONE) /* do not want to use g++ just for this file*/
+	if (memmgr_init_c(&ji.mm, 8192) != PBSE_NONE) /* do not want to use g++ just for this file*/
 	  {
 		pbsdrmaa_exc_raise_pbs( "memmgr_init", connection_fd);
@@ -201,7 +202,7 @@
 	for (p = attrib; p; p = p->next) {
 		if (p->resource) {
-			_Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji.mm, &ji.res_attr, p->resource, p->value);
+			hash_add_or_exit_c(&ji.mm, &ji.res_attr, p->resource, p->value, CMDLINE_DATA);
 		} else {
-			_Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji.mm, &ji.job_attr, p->name, p->value);
+			hash_add_or_exit_c(&ji.mm, &ji.job_attr, p->name, p->value, CMDLINE_DATA);
 		}
 	}
@@ -223,5 +224,5 @@
 	jobname_copy = fsd_strdup(new_jobname);
 
-	_Z14memmgr_destroyPP6memmgr(&ji.mm);
+	memmgr_destroy_c(&ji.mm);
 
 	return jobname_copy;
@@ -246,5 +247,5 @@
 retry:
 
-#ifdef HAS_PBS_SUBMIT_HASH
+#ifdef HAVE_PBS_SUBMIT_HASH
 		job_id = pbs_submit_4_wrapper(self->connection_fd, attrib, script, destination);
 #else
Index: /trunk/pbs_drmaa/torque4.cpp
===================================================================
--- /trunk/pbs_drmaa/torque4.cpp	(revision 95)
+++ /trunk/pbs_drmaa/torque4.cpp	(revision 95)
@@ -0,0 +1,17 @@
+
+#include "torque4.h"
+
+void hash_add_or_exit_c(memmgr **mm, job_data **head, const char *name, const char *value, int var_type)
+{
+	hash_add_or_exit(mm, head, name, value, var_type);
+}	
+
+int memmgr_init_c(memmgr **mm, int size)
+{
+	return memmgr_init(mm,size);
+}
+
+void memmgr_destroy_c(memmgr **mm)
+{
+	memmgr_destroy(mm);
+}
Index: /trunk/pbs_drmaa/torque4.h
===================================================================
--- /trunk/pbs_drmaa/torque4.h	(revision 95)
+++ /trunk/pbs_drmaa/torque4.h	(revision 95)
@@ -0,0 +1,24 @@
+#ifdef __cplusplus
+
+#include "u_hash_map_structs.h"
+
+extern "C" {
+#endif
+
+typedef struct job_info
+{
+  memmgr *mm;
+  job_data *job_attr;
+  job_data *res_attr;
+  job_data *user_attr;
+  job_data *client_attr;
+} job_info;
+
+
+void hash_add_or_exit_c(memmgr **mm, job_data **head, const char *name, const char *value, int var_type);
+int memmgr_init_c(memmgr **mm, int size);
+void memmgr_destroy_c(memmgr **mm);
+
+#ifdef __cplusplus
+}
+#endif
