Diff of /hdf5.pd [17662b] .. [9fd343]  Maximize  Restore

Switch to side-by-side view

--- a/hdf5.pd
+++ b/hdf5.pd
@@ -1179,6 +1179,9 @@
 hid_t H5Dclose (hid_t dataset_id);
 hid_t H5Dget_type(hid_t dataset_id);
 hid_t H5Dget_space(hid_t dataset_id);
+# H5Dvlen_reclaim buf type changed from void * to I8 * so that is can be catergorized separately in the
+#  typemap as a T_PVI traslation
+herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, I8 *buf);
 
 hid_t H5Gcreate(hid_t loc_id, const char *name, size_t size_hint);
 hid_t H5Gopen(hid_t loc_id, const char *name);
@@ -1211,6 +1214,7 @@
 #hid_t H5Tget_super(hid_t type);
 htri_t H5Tequal(hid_t type_id1, hid_t type_id2); 
 H5T_class_t H5Tget_class(hid_t type_id);
+htri_t H5Tis_variable_str(hid_t type_id);
 
 EODEF
 
@@ -2565,6 +2569,80 @@
 	}
 
 
+# Code to get the maximum length of strings in a ragged character array
+int
+findMaxVarLenSize( buf, numelem )
+	I8 *	buf
+	int 	numelem
+CODE:
+	int     i;
+	int     maxStrSize;
+	int     len;
+	char**  rdata; 
+	/* Convert input generic pointer to character array */
+	rdata = (char **) buf;
+
+        /* Find max string length */
+        maxStrSize = 0;
+        for(i=0; i<numelem; i++) {
+                /* printf("String %d = '%s'\n", i, rdata[i]); */
+                len = strlen(rdata[i]);
+                if( len > maxStrSize ) maxStrSize = len;
+        } /* end for */
+        RETVAL = maxStrSize;
+OUTPUT:
+	RETVAL
+
+	
+# Function to copy the variable length strings from an input buffer varlenbuff to a supplied
+#   fixed-length string buffer fixedbuf.
+#    Number of elements (numelem) and maximum length of any variable length string (maxVarlensize)
+#    must be supplied.
+#  Output is the number of elements converted
+int
+copyVarLenToFixed( varlenbuff, fixedbuf, numelem, maxVarlensize )
+	I8 *	varlenbuff
+	I8 *	fixedbuf
+	int 	numelem
+	int 	maxVarlensize
+CODE:
+        int fixlenbufferInc; /* size of strings, including the null byte */
+	int     i;
+	char**  rdata; 
+	char*   tempPtr;
+	
+        fixlenbufferInc = maxVarlensize + 1; /* size of strings, including the null byte */
+
+	/* Convert input generic pointer to character array */
+	rdata = (char **) varlenbuff;
+	tempPtr = (char*) fixedbuf;
+
+        /* Copy variable length strings to fixed length strings */
+        for(i=0; i<numelem; i++, tempPtr += fixlenbufferInc ) {
+             strncpy(tempPtr, rdata[i], fixlenbufferInc);
+        }
+        RETVAL = numelem;
+OUTPUT:
+	RETVAL
+
+# Code size of a pointer for the current platform
+#  This should return 4 on 32bit machines and 8 on 64bit machines
+int
+bufPtrSize()
+CODE:
+        RETVAL = sizeof(void *);
+OUTPUT:
+	RETVAL
+
+# Sub to add the H5T_VARIABLE constant
+#  This is added manually here, rather than regenerate the constant function above
+int
+H5T_VARIABLE()
+CODE:
+        RETVAL = H5T_VARIABLE;
+OUTPUT:
+	RETVAL
+	
 EOXS
 
 # Don't import anything from core but barf

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks