changeset 1875:c03a287a79cf

*** empty log message ***
author baghdadi <baghdadi>
date Mon, 30 Aug 2004 15:21:24 +0000
parents 559b95abe8d4
children 32bb54fe1f4c
files libsrc2/doc/minc_20.tex libsrc2/grpattr.c libsrc2/test/grpattr-test.c
diffstat 3 files changed, 465 insertions(+), 112 deletions(-) [+]
line wrap: on
line diff
--- a/libsrc2/doc/minc_20.tex
+++ b/libsrc2/doc/minc_20.tex
@@ -104,12 +104,15 @@
 * Updated the entire document according to the current cvs
 
 THU JUL 22/2004 Leila\\*
-* Updated miget_slice_scaling_flag : missing parameter
+* Updated miget\_slice\_scaling\_flag : missing parameter
 
 THU AUG 12/2004 Leila\\*
-* Removed MI_TYPE_CHAR 
+* Removed MI\_TYPE\_CHAR 
 * Added the attribute listing functions to API
 
+MON AUG 30/2004 Leila\\*
+* Added Attribute functions
+
 \section{Introduction}
 
 
@@ -123,7 +126,7 @@
 
 To be completed later. 
 
-\section{ATTRIBUTE/GROUP FUNCTIONS (13)}
+\section{ATTRIBUTE/GROUP FUNCTIONS (11)}
 \subsection{micreate\_group}
 
 \begin{verbatim}
@@ -330,41 +333,42 @@
 attribute value(s) or MI_ERROR otherwise
 \end{verbatim}
 
-\subsection{milist\_attr\_start}
+\subsection{milist\_start}
 
 \begin{verbatim}
 NAME 
 
-milist_attr_start - get list of attributes starting at given path
+milist_start - get list of attributes or groups starting at given path
 
 SYNOPSIS
 
 #include <minc2.h>
 
-int milist_attr_start ( mihandle_t              volume, 
-                        const char              *path,
-                        int                     flags,
-                        milisthandle_t          *handle)
+int milist_start ( mihandle_t              volume, 
+                   const char              *path,
+                   int                     flags,
+                   milisthandle_t          *handle)
 
                                                 
 DESCRIPTION
 
-This function begins listing the attributes found in the group (and
-possibly the subgroups) associated with the given path.
+This function begins listing the attributes or groups in the 
+given path.
 
 If the flags argument includes MILIST_RECURSE, then all of the 
-paths subgroups will be searched and their attributes will be listed
-as well.
+paths subgroups will be searched and their attributes or groups 
+will be listed as well.
 
 The path string should always end with a slash ("/") character.
 
-The returned handle is used to pass to milist_attr_next() and 
-milist_attr_finish() to actually perform the listing operation.
+The returned handle is used to pass to milist_attr_next() for 
+attributes or milist_grp_next() for groups and 
+milist_finish() to actually perform the listing operation.
 
 RETURN VALUE
 
-milist_attr_start returns MI_NOERROR if it successfully gets the
-attribute(s) or MI_ERROR otherwise
+milist_start returns MI_NOERROR if it successfully gets the
+attribute(s) or group(s) or MI_ERROR otherwise
 
 \end{verbatim}
 
@@ -408,102 +412,59 @@
 
 \end{verbatim}
 
-\subsection{milist\_attr\_finish}
-
-\begin{verbatim}
-NAME
-
-milist_attr_finish - finish listing attributes in a group
-
-SYNOPSIS
-
-#include <minc2.h>
-
-int milist_attr_finish (milisthandle_t handle)
-
-DESCRIPTION
-
-Finishes the attribute listing process, and frees any memory
-associated with the handle.
-
-RETURN VALUE 
-
-milist_attr_finish() returns MI_NOERROR if it completes successfully,
-or MI_ERROR otherwise.
-
-\end{verbatim}
-
-\subsection{milist\_grp\_start}
-
-\begin{verbatim}
-NAME 
-
-milist_grp_start - get list of groups starting at given path
-
-SYNOPSIS
-
-#include <minc2.h>
-
-int milist_grp_start ( mihandle_t              volume, 
-                       const char              *path,
-                       int                     flags,
-                       milisthandle_t          *handle)
-
-DESCRIPTION
-
-RETURN VALUE
-
-milist_grp_start returns MI_NOERROR if it successfully gets the
-groups or MI_ERROR otherwise
-\end{verbatim}
-
-
 \subsection{milist\_grp\_next}
 
 \begin{verbatim}
 
 NAME 
 
-milist_grp_next - get the group at given path
+milist_grp_next - get the group(s) at given path
 
 SYNOPSIS
 
 #include <minc2.h>
 
 int milist_grp_next  ( milisthandle_t          handle, 
-                       const char              *path,
+                       char                    *path,
                        int                     maxpath)
                         
 DESCRIPTION
 
-
+This function returns each of the groups associated with the listing 
+initiated by a call to milist_start(). Each successive call to 
+milist_grp_next() returns the next group's path in the corresponding 
+string buffer.
+
+When all possible groups have been returned, the function returns an error.
 
 RETURN VALUE
 
 milist_grp_next returns MI_NOERROR if it successfully gets the
-group name or MI_ERROR otherwise
+group(s) name or MI_ERROR otherwise
 
 \end{verbatim}
 
-\subsection{milist\_grp\_finish}
+\subsection{milist\_finish}
 
 \begin{verbatim}
 NAME
 
-milist_grp_finish - Finish listing the subgroups of a group.
+milist_finish - finish listing attributes or groups
+
 SYNOPSIS
 
 #include <minc2.h>
 
-int milist_grp_finish  ( milisthandle_t          handle, 
-                       
+int milist_finish (milisthandle_t handle)
+
 DESCRIPTION
 
-Finishes the group listing process, and frees any memory associated
-with handle.
-
-RETURN VALUE
-milist_grp_finish() returns MI_NOERROR if it completes successfully,
+Finishes the attribute or groups listing process, and frees any memory
+associated with the handle.
+
+RETURN VALUE 
+
+milist_finish() returns MI_NOERROR if it completes successfully,
 or MI_ERROR otherwise.
 
 \end{verbatim}
--- a/libsrc2/grpattr.c
+++ b/libsrc2/grpattr.c
@@ -1,11 +1,286 @@
 /** \file grpattr.c
  * \brief MINC 2.0 group/attribute functions
+ * \author Bert Vincent and Leila Baghdadi
+ *
+ * Functions to manipulate attributes and groups.
  ************************************************************************/
 #include <stdlib.h>
 #include <hdf5.h>
 #include "minc2.h"
 #include "minc2_private.h"
 
+#define MILIST_MAX_PATH 256
+#define MILIST_RECURSE 0x0001
+
+struct milistframe {
+    struct milistframe *next;
+    hid_t grp_id;
+    int att_idx;
+    int grp_idx;
+    char relpath[MILIST_MAX_PATH];
+};
+
+struct milistdata {
+    int flags;
+    char *name_ptr;
+    int name_len;
+    struct milistframe *frame_ptr; /* recursive frame */
+};
+
+
+/*! Start listing the objects in a group.
+ */
+int
+milist_start(mihandle_t vol, const char *path, int flags,
+	     milisthandle_t *handle)
+{
+    hid_t grp_id;
+    char fullpath[256];
+    struct milistdata *data;
+    struct milistframe *frame;
+    
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+   
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
+    grp_id = H5Gopen(vol->hdf_id, fullpath);
+    if (grp_id < 0) {
+        return (MI_ERROR);
+    }
+
+    data = (struct milistdata *) malloc(sizeof (struct milistdata));
+    if (data == NULL) {
+        return (MI_ERROR);
+    }
+    
+    frame = (struct milistframe *) malloc(sizeof (struct milistframe));
+    frame->next = NULL;
+    frame->grp_id = grp_id;
+    frame->att_idx = 0;
+    frame->grp_idx = 0;
+    strcpy(frame->relpath, path);
+    data->frame_ptr = frame;
+
+    data->flags = flags;
+
+    *handle = data;
+
+    return (MI_NOERROR);
+}
+
+static int
+milist_recursion(milisthandle_t handle, char *path)
+{
+  struct milistdata *data = (struct milistdata *) handle;
+  
+
+  herr_t r;
+  int i=0;
+  
+  for(;;){
+    ;
+  struct milistframe *frame;
+  H5E_BEGIN_TRY {
+    
+    r = H5Gget_objtype_by_idx(data->frame_ptr->grp_id,
+			      data->frame_ptr->grp_idx);
+  } H5E_END_TRY;
+ 
+  if (r < 0) {
+    
+    /* End of this group, need to pop the frame. */
+    frame = data->frame_ptr->next;
+    H5Gclose(data->frame_ptr->grp_id);
+    free(data->frame_ptr);
+    data->frame_ptr = frame;
+    if (frame == NULL) {
+      return (MI_ERROR);
+    }
+  }
+  else {
+    
+    data->frame_ptr->grp_idx++;
+    /* If the object is a group, we need to recurse into it.
+     */
+    if (r == H5G_GROUP) {
+      char tmp[256];
+      int l;
+
+      H5Gget_objname_by_idx(data->frame_ptr->grp_id,
+			    data->frame_ptr->grp_idx - 1,
+			    tmp, sizeof(tmp));
+      frame = malloc(sizeof(struct milistframe));
+      if (frame == NULL) {
+	return (MI_ERROR);
+      }
+      
+      frame->grp_idx = 0;
+      frame->att_idx = 0;
+      frame->grp_id = H5Gopen(data->frame_ptr->grp_id, tmp);
+			
+      strcpy(frame->relpath, data->frame_ptr->relpath);
+      l = strlen(frame->relpath);
+                            
+      if (l > 0 && frame->relpath[l - 1] != '/') {
+	strcat(frame->relpath, "/");
+      }
+      strcat(frame->relpath, tmp);
+
+      /* Start working on the next frame.
+       */
+      frame->next = data->frame_ptr;
+      data->frame_ptr = frame;
+      strncpy(path, data->frame_ptr->relpath, MILIST_MAX_PATH);
+      break;  /* Out of inner for(;;) */
+    }
+  }       
+   }  
+}
+
+
+static herr_t
+milist_attr_op(hid_t loc_id, const char *attr_name, void *op_data)
+{
+    struct milistdata *data = (struct milistdata *) op_data;
+    strncpy(data->name_ptr, attr_name, data->name_len);
+    return (1);
+}
+
+/*! Get attributes at a given path
+ */ 
+int
+milist_attr_next(mihandle_t vol, milisthandle_t handle, 
+                 char *path, int maxpath,
+                 char *name, int maxname)
+{
+    struct milistdata *data = (struct milistdata *) handle;
+    herr_t r;
+    
+    data->name_ptr = name;
+    data->name_len = maxname;
+
+    for (;;) {
+      
+     
+        H5E_BEGIN_TRY {
+            r = H5Aiterate(data->frame_ptr->grp_id, 
+                           &data->frame_ptr->att_idx, milist_attr_op, data);
+        } H5E_END_TRY;
+        if (r > 0) {
+	  
+	  strncpy(path, data->frame_ptr->relpath, maxpath);
+	  return (MI_NOERROR);
+        }
+        else if (data->flags & MILIST_RECURSE) {
+	  
+          r = milist_recursion(handle, path);
+          if ( r == MI_ERROR)
+	    {
+	      return(MI_ERROR);
+	    }
+            
+        }
+        else {
+            return (MI_ERROR);
+        }
+    }
+
+    return (MI_NOERROR);
+}
+
+/*! Finish listing attributes or groups
+ */
+int
+milist_finish(milisthandle_t handle)
+{
+    struct milistdata *data = (struct milistdata *) handle;
+    struct milistframe *frame;
+
+    if (data == NULL) {
+        return (MI_ERROR);
+    }
+
+    while ((frame = data->frame_ptr) != NULL) {
+        data->frame_ptr = frame->next;
+        H5Gclose(frame->grp_id);
+        free(frame);
+    }
+
+    free(data);
+    return (MI_NOERROR);
+}
+
+static herr_t
+milist_grp_op(hid_t loc_id, const char *name, void *op_data)
+{
+  struct milistdata *data = (struct milistdata *) op_data;
+  H5G_stat_t statbuf;
+  
+  H5Gget_objinfo(loc_id,name, FALSE, &statbuf);
+  if (statbuf.type == H5G_GROUP)
+    {
+      int l;
+      l = strlen(data->frame_ptr->relpath);
+      if (l > 0 && data->frame_ptr->relpath[l-1] != '/') {
+	strcat(data->frame_ptr->relpath, "/");
+      }
+      strcat(data->frame_ptr->relpath, name);
+    }
+  return(1);
+}
+
+/*! Get the group at given path
+ */
+int
+milist_grp_next(milisthandle_t handle, char *path, int maxpath)
+{
+  struct milistdata *data = (struct milistdata *) handle;
+  herr_t r;
+  
+  if (!(data->flags & MILIST_RECURSE))
+      {
+	char fullpath[256];
+	char tmp[256];
+	
+	strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+	strncat(fullpath, data->frame_ptr->relpath, sizeof (fullpath) - strlen(fullpath));
+	strcpy(tmp, data->frame_ptr->relpath);
+
+	H5E_BEGIN_TRY {
+	  r = H5Giterate(data->frame_ptr->grp_id,fullpath,
+			 &data->frame_ptr->grp_idx, milist_grp_op, data);
+      
+	} H5E_END_TRY;
+	if ( r > 0 )
+	  {
+	    strncpy(path, data->frame_ptr->relpath, maxpath);
+	    strncpy(data->frame_ptr->relpath, tmp, maxpath);
+	    return (MI_NOERROR);
+	  }
+	else
+      	  {
+	    return (MI_ERROR);	   
+	  }
+      }
+
+  else if (data->flags & MILIST_RECURSE) {
+    
+    r = milist_recursion(handle, path);
+    if ( r == MI_ERROR) {
+	return(MI_ERROR);
+    }
+  }
+  else {
+    return (MI_ERROR);
+  }
+   
+  return (MI_NOERROR);
+}
+
 /*! Create a group at "path" using "name".
  */
 int
@@ -14,6 +289,7 @@
     hid_t hdf_file;
     hid_t hdf_grp;
     hid_t hdf_new_grp;
+    char fullpath[256];
 
     /* Get a handle to the actual HDF file 
      */
@@ -22,9 +298,15 @@
 	return (MI_ERROR);
     }
 
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
     /* Search through the path, descending into each group encountered.
      */
-    hdf_grp = midescend_path(hdf_file, path);
+    hdf_grp = midescend_path(hdf_file, fullpath);
     if (hdf_grp < 0) {
 	return (MI_ERROR);
     }
@@ -52,6 +334,7 @@
     hid_t hdf_file;
     hid_t hdf_grp;
     herr_t hdf_result;
+    char fullpath[256];
 
     /* Get a handle to the actual HDF file 
      */
@@ -60,9 +343,15 @@
 	return (MI_ERROR);
     }
 
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
     /* Search through the path, descending into each group encountered.
      */
-    hdf_grp = midescend_path(hdf_file, path);
+    hdf_grp = midescend_path(hdf_file, fullpath);
     if (hdf_grp < 0) {
 	return (MI_ERROR);
     }
@@ -89,6 +378,7 @@
     hid_t hdf_file;
     hid_t hdf_grp;
     herr_t hdf_result;
+    char fullpath[256];
 
     /* Get a handle to the actual HDF file 
      */
@@ -97,9 +387,15 @@
 	return (MI_ERROR);
     }
 
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
     /* Search through the path, descending into each group encountered.
      */
-    hdf_grp = midescend_path(hdf_file, path);
+    hdf_grp = midescend_path(hdf_file, fullpath);
     if (hdf_grp < 0) {
 	return (MI_ERROR);
     }
@@ -135,6 +431,7 @@
     hsize_t hdf_dims[1];   /* TODO: symbolic constant for "1" here? */
     hid_t hdf_space;
     hid_t hdf_type;
+    char fullpath[256];
 
     /* Get a handle to the actual HDF file 
      */
@@ -143,9 +440,15 @@
 	return (MI_ERROR);
     }
 
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
     /* Search through the path, descending into each group encountered.
      */
-    hdf_grp = midescend_path(hdf_file, path);
+    hdf_grp = midescend_path(hdf_file, fullpath);
     if (hdf_grp < 0) {
 	return (MI_ERROR);
     }
@@ -207,6 +510,7 @@
     hid_t hdf_grp;
     hid_t hdf_attr;
     hid_t hdf_type;
+    char fullpath[256];
 
     /* Get a handle to the actual HDF file 
      */
@@ -215,9 +519,15 @@
 	return (MI_ERROR);
     }
 
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
     /* Search through the path, descending into each group encountered.
      */
-    hdf_grp = midescend_path(hdf_file, path);
+    hdf_grp = midescend_path(hdf_file, fullpath);
     if (hdf_grp < 0) {
 	return (MI_ERROR);
     }
@@ -257,6 +567,7 @@
     hid_t mtyp_id;
     hid_t hdf_space;
     hid_t hdf_attr;
+    char fullpath[256];
 
     /* Get a handle to the actual HDF file 
      */
@@ -265,9 +576,15 @@
 	return (MI_ERROR);
     }
 
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
     /* Search through the path, descending into each group encountered.
      */
-    hdf_grp = midescend_path(hdf_file, path);
+    hdf_grp = midescend_path(hdf_file, fullpath);
     if (hdf_grp < 0) {
 	return (MI_ERROR);
     }
@@ -332,6 +649,7 @@
     hid_t hdf_file;
     hid_t hdf_grp;
     int result;
+    char fullpath[256];
 
     /* Get a handle to the actual HDF file 
      */
@@ -340,9 +658,15 @@
 	return (MI_ERROR);
     }
 
+    strncpy(fullpath, MI_ROOT_PATH "/" MI_INFO_NAME, sizeof (fullpath));
+    if (*path != '/') {
+        strncat(fullpath, "/", sizeof (fullpath) - strlen(fullpath));
+    }
+    strncat(fullpath, path, sizeof (fullpath) - strlen(fullpath));
+
     /* Search through the path, descending into each group encountered.
      */
-    hdf_grp = midescend_path(hdf_file, path);
+    hdf_grp = midescend_path(hdf_file, fullpath);
     if (hdf_grp < 0) {
 	return (MI_ERROR);
     }
--- a/libsrc2/test/grpattr-test.c
+++ b/libsrc2/test/grpattr-test.c
@@ -23,6 +23,7 @@
     float fltarr[TESTARRAYSIZE];
     int intarr[TESTARRAYSIZE];
     char valstr[128];
+    milisthandle_t hlist, h1list;
 
     r = micreate_volume("tst-grpa.mnc", 0, NULL, MI_TYPE_UINT, 
                         MI_CLASS_INT, NULL, &hvol);
@@ -31,51 +32,88 @@
 	return (-1);
     }
 
-    r = micreate_group(hvol, "/minc-2.0", "test1");
-    if (r < 0) {
-        TESTRPT("micreate_group failed", r);
-    }
-
-    r = micreate_group(hvol, "/minc-2.0", "test2");
+    r = micreate_group(hvol, "/", "test1");
     if (r < 0) {
         TESTRPT("micreate_group failed", r);
     }
 
-    r = micreate_group(hvol, "/minc-2.0/test1", "stuff");
+    r = micreate_group(hvol, "/", "test2");
+    if (r < 0) {
+        TESTRPT("micreate_group failed", r);
+    }
+    r = micreate_group(hvol, "/", "test3");
+    if (r < 0) {
+        TESTRPT("micreate_group failed", r);
+    }
+    r = micreate_group(hvol, "/", "test4");
+    if (r < 0) {
+        TESTRPT("micreate_group failed", r);
+    }
+    r = micreate_group(hvol, "/test2", "stuff2");
+    if (r < 0) {
+	TESTRPT("micreate_group failed", r);
+    }
+    r = micreate_group(hvol, "/test1", "stuff");
     if (r < 0) {
 	TESTRPT("micreate_group failed", r);
     }
-
-    r = micreate_group(hvol, "/minc-2.0/test1/stuff", "hello");
+    r = micreate_group(hvol, "/test1", "otherstuff");
+    if (r < 0) {
+	TESTRPT("micreate_group failed", r);
+    }
+    r = micreate_group(hvol, "/test1", "theotherstuff");
     if (r < 0) {
 	TESTRPT("micreate_group failed", r);
     }
-
-    r = miset_attr_values(hvol, MI_TYPE_STRING, "/minc-2.0/test1/stuff/hello", 
+    r = micreate_group(hvol, "/test1/theotherstuff", "thisstuff");
+    if (r < 0) {
+	TESTRPT("micreate_group failed", r);
+    }
+    r = micreate_group(hvol, "/test1/stuff", "hello");
+    if (r < 0) {
+	TESTRPT("micreate_group failed", r);
+    }
+    r = micreate_group(hvol, "/test1/stuff", "helloleila");
+    if (r < 0) {
+	TESTRPT("micreate_group failed", r);
+    }
+    
+    r = miset_attr_values(hvol, MI_TYPE_STRING, "/test1/stuff/hello", 
 			  "animal", 8, "fruitbat");
     if (r < 0) {
 	TESTRPT("miset_attr_values failed", r);
     }
 
-    r = miset_attr_values(hvol, MI_TYPE_STRING, "/minc-2.0/test1/stuff", 
+    r = miset_attr_values(hvol, MI_TYPE_STRING, "/test1/stuff", 
+			  "objtype", 10, "automobile");
+    if (r < 0) {
+	TESTRPT("miset_attr_values failed", r);
+    }
+
+    r = miset_attr_values(hvol, MI_TYPE_STRING, "/test3", 
 			  "objtype", 10, "automobile");
     if (r < 0) {
 	TESTRPT("miset_attr_values failed", r);
     }
 
-    r = miset_attr_values(hvol, MI_TYPE_DOUBLE, "/minc-2.0/test2", 
+    r = miset_attr_values(hvol, MI_TYPE_STRING, "/test1/stuff", 
+			  "objname", 10, "automobile");
+    if (r < 0) {
+	TESTRPT("miset_attr_values failed", r);
+    }
+    r = miset_attr_values(hvol, MI_TYPE_DOUBLE, "/test2", 
 			  "maxvals", TESTARRAYSIZE, tstarr);
     if (r < 0) {
 	TESTRPT("miset_attr_values failed", r);
     }
 
-    r = miget_attr_type(hvol, "/minc-2.0/test1/stuff/hello", "animal", 
+    r = miget_attr_type(hvol, "/test1/stuff/hello", "animal", 
 			&data_type);
     if (r < 0) {
 	TESTRPT("miget_attr_type failed", r);
     }
 
-    r = miget_attr_length(hvol, "/minc-2.0/test1/stuff/hello", "animal", 
+    r = miget_attr_length(hvol, "/test1/stuff/hello", "animal", 
 			  &length);
     if (r < 0) {
 	TESTRPT("miget_attr_length failed", r);
@@ -87,20 +125,20 @@
     if (length != 8) {
 	TESTRPT("miget_attr_length failed", length);
     }
-
-    r = midelete_group(hvol, "/minc-2.0/test1/stuff", "goodbye");
+    
+    r = midelete_group(hvol, "/test1/stuff", "goodbye");
     if (r >= 0) {
 	TESTRPT("midelete_group failed", r);
     }
 
-    r = midelete_group(hvol, "/minc-2.0/test1/stuff", "hello");
+    r = midelete_group(hvol, "/test1/stuff", "hello");
     /* This should succeed.
      */
     if (r < 0) {
 	TESTRPT("midelete_group failed", r);
     }
 
-    r = miget_attr_length(hvol, "/minc-2.0/test1/stuff/hello", "animal", 
+    r = miget_attr_length(hvol, "/test1/stuff/hello", "animal", 
 			  &length);
     /* This should fail since we deleted the group.
      */
@@ -108,7 +146,7 @@
 	TESTRPT("miget_attr_length failed", r);
     }
 
-    r = miget_attr_values(hvol, MI_TYPE_DOUBLE, "/minc-2.0/test2", "maxvals", 
+    r = miget_attr_values(hvol, MI_TYPE_DOUBLE, "/test2", "maxvals", 
 			  TESTARRAYSIZE, dblarr);
     if (r < 0) {
 	TESTRPT("miget_attr_values failed", r);
@@ -122,7 +160,7 @@
 
     /* Get the values again in float rather than double format.
      */
-    r = miget_attr_values(hvol, MI_TYPE_FLOAT, "/minc-2.0/test2", "maxvals", 
+    r = miget_attr_values(hvol, MI_TYPE_FLOAT, "/test2", "maxvals", 
 			  TESTARRAYSIZE, fltarr);
     if (r < 0) {
 	TESTRPT("miget_attr_values failed", r);
@@ -138,7 +176,7 @@
 
     /* Get the values again in int rather than double format.
      */
-    r = miget_attr_values(hvol, MI_TYPE_INT, "/minc-2.0/test2", "maxvals", 
+    r = miget_attr_values(hvol, MI_TYPE_INT, "/test2", "maxvals", 
 			  TESTARRAYSIZE, intarr);
     if (r < 0) {
 	TESTRPT("miget_attr_values failed", r);
@@ -152,7 +190,7 @@
 	}
     }
 
-    r = miget_attr_values(hvol, MI_TYPE_STRING, "/minc-2.0/test1/stuff", 
+    r = miget_attr_values(hvol, MI_TYPE_STRING, "/test1/stuff", 
 			  "objtype", 128, valstr);
     if (r < 0) {
 	TESTRPT("miget_attr_values failed", r);
@@ -162,14 +200,14 @@
 	TESTRPT("miget_attr_values failed", 0);
     }
 
-    r = miset_attr_values(hvol, MI_TYPE_STRING, "/minc-2.0/test1/stuff",
+    r = miset_attr_values(hvol, MI_TYPE_STRING, "/test1/stuff",
 			  "objtype", 8, "bicycle");
 
     if (r < 0) {
 	TESTRPT("miset_attr_values failed on rewrite", r);
     }
 
-    r = miget_attr_values(hvol, MI_TYPE_STRING, "/minc-2.0/test1/stuff", 
+    r = miget_attr_values(hvol, MI_TYPE_STRING, "/test1/stuff", 
 			  "objtype", 128, valstr);
     if (r < 0) {
 	TESTRPT("miget_attr_values failed", r);
@@ -179,6 +217,36 @@
 	TESTRPT("miget_attr_values failed", 0);
     }
 
+    {
+        char pathbuf[256];
+        char namebuf[256];
+	int count=0;
+        r = milist_start(hvol, "/", 1, &hlist);
+        if (r == MI_NOERROR) {
+	  count++;
+            while (milist_attr_next(hvol, hlist, pathbuf, sizeof(pathbuf),
+                                    namebuf, sizeof(namebuf)) == MI_NOERROR) {
+                printf(" %s %s\n", pathbuf, namebuf);
+            }
+        }
+        milist_finish(hlist);
+
+	printf("***************** \n");
+
+	char pathbuf1[256];
+        
+        r = milist_start(hvol, "/", 1, &h1list);
+        if (r == MI_NOERROR) {
+	  while( milist_grp_next(h1list, pathbuf1, sizeof(pathbuf1)) == MI_NOERROR) {
+	      printf("%s \n", pathbuf1);
+	  }
+   
+        }
+	
+        milist_finish(h1list);
+	
+    }
+
     miclose_volume(hvol);
 
     if (error_cnt != 0) {