From 48f8e55c0a7aae63b741725b3c40c377959b9d35 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 3 Aug 1998 19:30:35 -0500 Subject: [svn-r566] Fixed offset code [finally :-/ ] for selections. --- src/.distdep | 1001 ++++++++++++++++++++++++++---------------------------- src/H5D.c | 16 + src/H5S.c | 68 +++- src/H5Shyper.c | 212 +++++++----- src/H5Spoint.c | 66 +++- src/H5Sprivate.h | 5 +- src/H5Spublic.h | 2 + src/H5Sselect.c | 98 +++++- test/.distdep | 322 ++++++++++-------- test/tselect.c | 340 ++++++++++++++++++- 10 files changed, 1361 insertions(+), 769 deletions(-) diff --git a/src/.distdep b/src/.distdep index 516813c..15be2c8 100644 --- a/src/.distdep +++ b/src/.distdep @@ -1,5 +1,5 @@ -H5B.o: \ - H5B.c \ +H5.o: \ + H5.c \ H5private.h \ H5public.h \ H5config.h \ @@ -12,43 +12,38 @@ H5B.o: \ H5Bprivate.h \ H5Bpublic.h \ H5Eprivate.h \ - H5Epublic.h -H5Fcore.o: \ - H5Fcore.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h \ - H5Fprivate.h \ - H5Fpublic.h -H5Ffamily.o: \ - H5Ffamily.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h \ - H5Fprivate.h \ - H5Fpublic.h -H5Fmpio.o: \ - H5Fmpio.c \ + H5Iprivate.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Pprivate.h \ + H5Ppublic.h \ + H5Zpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5A.o: \ + H5A.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ + H5Iprivate.h \ H5Ipublic.h \ - H5Dprivate.h \ - H5Dpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Dpublic.h \ + H5Dprivate.h \ H5Gprivate.h \ H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ @@ -59,36 +54,29 @@ H5Fmpio.o: \ H5Spublic.h \ H5Zprivate.h \ H5Zpublic.h \ - H5MMprivate.h \ - H5MMpublic.h -H5Fsec2.o: \ - H5Fsec2.c \ - H5private.h \ - H5public.h \ - H5config.h \ H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ H5MMprivate.h \ - H5MMpublic.h -H5Fstdio.o: \ - H5Fstdio.c \ + H5MMpublic.h \ + H5Pprivate.h \ + H5Ppublic.h \ + H5Apkg.h \ + H5Aprivate.h +H5AC.o: \ + H5AC.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h \ + H5ACprivate.h \ + H5ACpublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Ipublic.h \ H5Dpublic.h \ - H5MMprivate.h \ - H5MMpublic.h -H5Gnode.o: \ - H5Gnode.c \ + H5Eprivate.h \ + H5Epublic.h +H5B.o: \ + H5B.c \ H5private.h \ H5public.h \ H5config.h \ @@ -102,43 +90,26 @@ H5Gnode.o: \ H5Bpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5Gpkg.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5HLprivate.h \ - H5HLpublic.h \ H5MFprivate.h \ H5MFpublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h -H5Gstab.o: \ - H5Gstab.c \ + H5MMprivate.h +H5D.o: \ + H5D.c \ H5private.h \ H5public.h \ H5config.h \ + H5Iprivate.h \ + H5Ipublic.h \ H5ACprivate.h \ H5ACpublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Ipublic.h \ H5Dpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Gpkg.h \ + H5Dprivate.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5HLprivate.h \ - H5HLpublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ @@ -146,189 +117,147 @@ H5Gstab.o: \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h -H5HL.o: \ - H5HL.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5ACprivate.h \ - H5ACpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Ipublic.h \ - H5Dpublic.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ H5Eprivate.h \ H5Epublic.h \ H5HLprivate.h \ - H5HLpublic.h -H5I.o: \ - H5I.c \ + H5HLpublic.h \ + H5MFprivate.h \ + H5MFpublic.h +H5E.o: \ + H5E.c \ H5private.h \ H5public.h \ H5config.h \ H5Iprivate.h \ H5Ipublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h -H5MF.o: \ - H5MF.c \ + H5Eprivate.h +H5F.o: \ + H5F.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ + H5Iprivate.h \ H5Ipublic.h \ - H5Fprivate.h \ - H5Fpublic.h -H5MM.o: \ - H5MM.c \ - H5private.h \ - H5public.h \ - H5config.h -H5O.o: \ - H5O.c \ - H5private.h \ - H5public.h \ - H5config.h \ H5ACprivate.h \ H5ACpublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Ipublic.h \ H5Dpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MFprivate.h \ - H5MFpublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h -H5Ocomp.o: \ - H5Ocomp.c \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Pprivate.h \ + H5Ppublic.h \ + H5Zpublic.h +H5Farray.o: \ + H5Farray.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ + H5Dprivate.h \ + H5Dpublic.h \ H5Ipublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h -H5Ocont.o: \ - H5Ocont.c \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MFprivate.h \ + H5MFpublic.h +H5Fcore.o: \ + H5Fcore.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h -H5Oname.o: \ - H5Oname.c \ + H5Ipublic.h +H5Ffamily.o: \ + H5Ffamily.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ + H5Ipublic.h +H5Fistore.o: \ + H5Fistore.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Dprivate.h \ + H5Dpublic.h \ H5Ipublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h -H5Onull.o: \ - H5Onull.c \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MFprivate.h \ + H5MFpublic.h +H5Flow.o: \ + H5Flow.c \ H5private.h \ H5public.h \ H5config.h \ - H5Oprivate.h \ - H5Opublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Ipublic.h \ H5Dpublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h -H5Ostab.o: \ - H5Ostab.c \ + H5MMprivate.h \ + H5MMpublic.h +H5Fmpio.o: \ + H5Fmpio.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ + H5Dprivate.h \ + H5Dpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ @@ -336,52 +265,39 @@ H5Ostab.o: \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h -H5Tbit.o: \ - H5Tbit.c \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5MMprivate.h \ + H5MMpublic.h +H5Fsec2.o: \ + H5Fsec2.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ - H5Iprivate.h \ - H5Tpkg.h \ - H5HGprivate.h \ - H5HGpublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h -H5Tconv.o: \ - H5Tconv.c \ - H5Iprivate.h \ - H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h +H5Fsplit.o: \ + H5Fsplit.c \ + H5private.h \ H5public.h \ H5config.h \ - H5private.h \ H5Eprivate.h \ H5Epublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Tpkg.h \ - H5HGprivate.h \ - H5HGpublic.h \ + H5Ipublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h -H5Flow.o: \ - H5Flow.c \ + H5MFprivate.h \ + H5MFpublic.h +H5Fstdio.o: \ + H5Fstdio.c \ H5private.h \ H5public.h \ H5config.h \ @@ -393,16 +309,39 @@ H5Flow.o: \ H5Dpublic.h \ H5MMprivate.h \ H5MMpublic.h -H5Fsplit.o: \ - H5Fsplit.c \ +H5G.o: \ + H5G.c \ H5private.h \ H5public.h \ H5config.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Ipublic.h \ + H5Dpublic.h \ + H5Dprivate.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h \ - H5Fprivate.h \ - H5Fpublic.h + H5Gpkg.h \ + H5ACprivate.h \ + H5ACpublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5Iprivate.h \ + H5MMprivate.h H5Gent.o: \ H5Gent.c \ H5private.h \ @@ -420,11 +359,9 @@ H5Gent.o: \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ - H5Bpublic.h \ - H5HLprivate.h \ - H5HLpublic.h -H5HG.o: \ - H5HG.c \ + H5Bpublic.h +H5Gnode.o: \ + H5Gnode.c \ H5private.h \ H5public.h \ H5config.h \ @@ -434,57 +371,147 @@ H5HG.o: \ H5Fpublic.h \ H5Ipublic.h \ H5Dpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ H5Eprivate.h \ H5Epublic.h \ + H5Gpkg.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5MFprivate.h \ + H5MFpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ - H5HGpublic.h -H5Tinit.o: \ - H5Tinit.c \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h +H5Gstab.o: \ + H5Gstab.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ + H5ACprivate.h \ + H5ACpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ H5Ipublic.h \ + H5Dpublic.h \ H5Eprivate.h \ H5Epublic.h \ + H5Gpkg.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ H5MMprivate.h \ H5MMpublic.h \ - H5Tpkg.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h +H5HG.o: \ + H5HG.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5ACprivate.h \ + H5ACpublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Ipublic.h \ H5Dpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Gprivate.h -H5Farray.o: \ - H5Farray.c \ + H5Eprivate.h \ + H5Epublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5MFprivate.h \ + H5MFpublic.h \ + H5MMprivate.h +H5HL.o: \ + H5HL.c \ H5private.h \ H5public.h \ H5config.h \ - H5Dprivate.h \ + H5ACprivate.h \ + H5ACpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Ipublic.h \ H5Dpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5MFprivate.h \ + H5MFpublic.h \ + H5MMprivate.h +H5I.o: \ + H5I.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Iprivate.h \ H5Ipublic.h \ + H5Eprivate.h +H5MF.o: \ + H5MF.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h +H5MM.o: \ + H5MM.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h +H5O.o: \ + H5O.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5ACprivate.h \ + H5ACpublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Ipublic.h \ + H5Dpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MFprivate.h \ + H5MFpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h -H5Odtype.o: \ - H5Odtype.c \ + H5Sprivate.h +H5Oattr.o: \ + H5Oattr.c \ H5private.h \ H5public.h \ H5config.h \ @@ -507,24 +534,25 @@ H5Odtype.o: \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h -H5Oefl.o: \ - H5Oefl.c \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Apkg.h +H5Ocomp.o: \ + H5Ocomp.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ - H5HLprivate.h \ - H5HLpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ H5MMprivate.h \ H5MMpublic.h \ H5Oprivate.h \ H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ @@ -533,33 +561,31 @@ H5Oefl.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h -H5Olayout.o: \ - H5Olayout.c \ +H5Ocont.o: \ + H5Ocont.c \ H5private.h \ H5public.h \ H5config.h \ - H5Dprivate.h \ - H5Dpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h -H5Osdspace.o: \ - H5Osdspace.c \ + H5Tpublic.h +H5Odtype.o: \ + H5Odtype.c \ H5private.h \ H5public.h \ H5config.h \ @@ -580,24 +606,24 @@ H5Osdspace.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h -H5Oshared.o: \ - H5Oshared.c \ + H5Tpublic.h +H5Oefl.o: \ + H5Oefl.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ H5MMprivate.h \ H5MMpublic.h \ H5Oprivate.h \ H5Opublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ @@ -607,34 +633,22 @@ H5Oshared.o: \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h -H5E.o: \ - H5E.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Iprivate.h \ - H5Ipublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h -H5Oattr.o: \ - H5Oattr.c \ + H5Spublic.h \ + H5Zprivate.h +H5Olayout.o: \ + H5Olayout.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ + H5Dprivate.h \ + H5Dpublic.h \ H5Ipublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ @@ -642,9 +656,10 @@ H5Oattr.o: \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h -H5Z.o: \ - H5Z.c \ + H5Spublic.h \ + H5Zprivate.h +H5Omtime.o: \ + H5Omtime.c \ H5private.h \ H5public.h \ H5config.h \ @@ -665,73 +680,40 @@ H5Z.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h -H5Sall.o: \ - H5Sall.c \ + H5Tpublic.h +H5Oname.o: \ + H5Oname.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Zprivate.h \ - H5Zpublic.h -H5Ssimp.o: \ - H5Ssimp.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h \ - H5Sprivate.h \ - H5Spublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Zprivate.h \ - H5Zpublic.h -H5V.o: \ - H5V.c \ + H5Tpublic.h +H5Onull.o: \ + H5Onull.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h \ H5Oprivate.h \ H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Ipublic.h \ H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ @@ -739,98 +721,76 @@ H5V.o: \ H5Bpublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h -H5.o: \ - H5.c \ + H5Tprivate.h +H5Osdspace.o: \ + H5Osdspace.c \ H5private.h \ H5public.h \ H5config.h \ - H5ACprivate.h \ - H5ACpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ H5Ipublic.h \ - H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Iprivate.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ H5MMprivate.h \ H5MMpublic.h \ - H5Pprivate.h \ - H5Ppublic.h \ - H5Zpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h -H5F.o: \ - H5F.c \ +H5Oshared.o: \ + H5Oshared.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ + H5Eprivate.h \ + H5Epublic.h \ H5Ipublic.h \ - H5ACprivate.h \ - H5ACpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Pprivate.h \ - H5Ppublic.h \ - H5Zpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h -H5G.o: \ - H5G.c \ +H5Ostab.o: \ + H5Ostab.c \ H5private.h \ H5public.h \ H5config.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Ipublic.h \ - H5Dpublic.h \ - H5Dprivate.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Gpkg.h \ - H5ACprivate.h \ - H5ACpublic.h \ - H5HLprivate.h + H5Dpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h H5P.o: \ H5P.c \ H5private.h \ @@ -858,11 +818,9 @@ H5P.o: \ H5Zpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Pprivate.h -H5Shyper.o: \ - H5Shyper.c \ + H5MMprivate.h +H5Sall.o: \ + H5Sall.c \ H5private.h \ H5public.h \ H5config.h \ @@ -883,19 +841,15 @@ H5Shyper.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Zprivate.h \ - H5Zpublic.h -H5Spoint.o: \ - H5Spoint.c \ + H5Tpublic.h +H5Shyper.o: \ + H5Shyper.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ H5Sprivate.h \ H5Spublic.h \ H5Gprivate.h \ @@ -911,71 +865,52 @@ H5Spoint.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h -H5TB.o: \ - H5TB.c \ +H5Spoint.o: \ + H5Spoint.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ - H5Ipublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MMprivate.h -H5A.o: \ - H5A.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Iprivate.h \ H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Dprivate.h \ - H5Gprivate.h \ - H5Gpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Pprivate.h -H5S.o: \ - H5S.c \ + H5HGpublic.h +H5Ssimp.o: \ + H5Ssimp.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ - H5Ipublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ + H5Ipublic.h \ + H5Sprivate.h \ + H5Spublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h + H5Tpublic.h H5Sselect.o: \ H5Sselect.c \ H5private.h \ @@ -1000,79 +935,147 @@ H5Sselect.o: \ H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h -H5Omtime.o: \ - H5Omtime.c \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Zprivate.h \ + H5Zpublic.h +H5T.o: \ + H5T.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Dprivate.h \ + H5Dpublic.h \ + H5Ipublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Iprivate.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h +H5Tbit.o: \ + H5Tbit.c \ H5private.h \ H5public.h \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ + H5Iprivate.h \ + H5Tpkg.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Gprivate.h +H5Tconv.o: \ + H5Tconv.c \ + H5Iprivate.h \ + H5Ipublic.h \ + H5public.h \ + H5config.h \ + H5private.h \ + H5Eprivate.h \ + H5Epublic.h \ H5MMprivate.h \ H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ + H5Tpkg.h \ + H5HGprivate.h \ + H5HGpublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ - H5Bpublic.h \ + H5Bpublic.h +H5Tinit.o: \ + H5Tinit.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Iprivate.h \ + H5Ipublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Tpkg.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h -H5D.o: \ - H5D.c \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Tprivate.h +H5TB.o: \ + H5TB.c \ H5private.h \ H5public.h \ H5config.h \ H5Iprivate.h \ H5Ipublic.h \ - H5ACprivate.h \ - H5ACpublic.h \ + H5Eprivate.h +H5V.o: \ + H5V.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Dprivate.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5HLprivate.h \ - H5HLpublic.h \ - H5MFprivate.h \ - H5MFpublic.h -H5T.o: \ - H5T.c \ + H5Spublic.h +H5Z.o: \ + H5Z.c \ H5private.h \ H5public.h \ H5config.h \ - H5Dprivate.h \ - H5Dpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ H5Ipublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ @@ -1080,49 +1083,27 @@ H5T.o: \ H5Sprivate.h \ H5Spublic.h \ H5Zprivate.h \ - H5Zpublic.h \ - H5Iprivate.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h -H5AC.o: \ - H5AC.c \ + H5Zpublic.h +H5S.o: \ + H5S.c \ H5private.h \ H5public.h \ H5config.h \ - H5ACprivate.h \ - H5ACpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ + H5Iprivate.h \ H5Ipublic.h \ - H5Dpublic.h \ H5Eprivate.h \ - H5Epublic.h -H5Fistore.o: \ - H5Fistore.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Dprivate.h \ - H5Dpublic.h \ - H5Ipublic.h \ + H5Epublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Dpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MFprivate.h \ - H5MFpublic.h + H5Tprivate.h diff --git a/src/H5D.c b/src/H5D.c index 1a88560..68a7a81 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -575,12 +575,20 @@ H5Dread (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, NULL == (mem_space = H5I_object(mem_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } + /* Check for valid selection */ + if(H5S_select_valid(mem_space)!=TRUE) { + HRETURN_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent"); + } /* end if */ } if (H5S_ALL != file_space_id) { if (H5_DATASPACE != H5I_group(file_space_id) || NULL == (file_space = H5I_object(file_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } + /* Check for valid selection */ + if(H5S_select_valid(file_space)!=TRUE) { + HRETURN_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent"); + } /* end if */ } if (H5P_DEFAULT == plist_id) { xfer_parms = &H5D_xfer_dflt; @@ -666,12 +674,20 @@ H5Dwrite (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, NULL == (mem_space = H5I_object(mem_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } + /* Check for valid selection */ + if(H5S_select_valid(mem_space)!=TRUE) { + HRETURN_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent"); + } /* end if */ } if (H5S_ALL != file_space_id) { if (H5_DATASPACE != H5I_group(file_space_id) || NULL == (file_space = H5I_object(file_space_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); } + /* Check for valid selection */ + if(H5S_select_valid(file_space)!=TRUE) { + HRETURN_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent"); + } /* end if */ } if (H5P_DEFAULT == plist_id) { xfer_parms = &H5D_xfer_dflt; diff --git a/src/H5S.c b/src/H5S.c index 6e8bc8d..68345fa 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -237,6 +237,10 @@ H5S_close(H5S_t *ds) assert(ds); + /* If there was a previous offset for the selection, release it */ + if(ds->select.offset!=NULL) + ds->select.offset=H5MM_xfree(ds->select.offset); + /* Release selection (this should come before the extent release) */ H5S_select_release(ds); @@ -485,8 +489,7 @@ H5S_copy(const H5S_t *src) FUNC_ENTER(H5S_copy, NULL); if (NULL==(dst = H5MM_malloc(sizeof(H5S_t)))) { - HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed"); + HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); } *dst = *src; @@ -933,6 +936,11 @@ H5S_read(H5G_entry_t *ent) /* Default to entire dataspace being selected */ ds->select.type=H5S_SEL_ALL; + /* Allocate space for the offset and set it to zeros */ + if (NULL==(ds->select.offset = H5MM_calloc(ds->extent.u.simple.rank*sizeof(hssize_t)))) { + HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + } + FUNC_LEAVE(ds); } @@ -1181,6 +1189,15 @@ H5S_set_extent_simple (H5S_t *space, int rank, const hsize_t *dims, assert(rank>=0); assert(0==rank || dims); + /* If there was a previous offset for the selection, release it */ + if(space->select.offset!=NULL) + space->select.offset=H5MM_xfree(space->select.offset); + + /* Allocate space for the offset and set it to zeros */ + if (NULL==(space->select.offset = H5MM_calloc(rank*sizeof(hssize_t)))) { + HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + } + /* shift out of the previous state to a "simple" dataspace */ switch (space->extent.type) { case H5S_SCALAR: @@ -1567,7 +1584,7 @@ H5Sset_extent_none (hid_t space_id) H5TRACE1("e","i",space_id); /* Check args */ - if ((space = H5I_object(space_id)) == NULL) { + if (H5_DATASPACE != H5I_group(space_id) || NULL == (space = H5I_object(space_id))) { HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); } @@ -1580,6 +1597,51 @@ H5Sset_extent_none (hid_t space_id) FUNC_LEAVE(SUCCEED); } /* end H5Sset_extent_none() */ +/*-------------------------------------------------------------------------- + NAME + H5Soffset_simple + PURPOSE + Changes the offset of a selection within a simple dataspace extent + USAGE + herr_t H5Soffset_simple(space_id, offset) + hid_t space_id; IN: Dataspace object to reset + const hssize_t *offset; IN: Offset to position the selection at + RETURNS + SUCCEED/FAIL + DESCRIPTION + This function creates an offset for the selection within an extent, allowing + the same shaped selection to be moved to different locations within a + dataspace without requiring it to be re-defined. +--------------------------------------------------------------------------*/ +herr_t +H5Soffset_simple (hid_t space_id, const hssize_t *offset) +{ + H5S_t *space = NULL; /* dataspace to modify */ + + FUNC_ENTER(H5Soffset_simple, FAIL); + H5TRACE2("e","i*Hs",space_id,offset); + + /* Check args */ + if (H5_DATASPACE != H5I_group(space_id) || NULL == (space = H5I_object(space_id))) { + HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a data space"); + } + if (offset == NULL) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no offset specified"); + } + + /* Allocate space for new offset */ + if(space->select.offset==NULL) { + if (NULL==(space->select.offset = H5MM_malloc(sizeof(hssize_t)*space->extent.u.simple.rank))) { + HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + } + } + + /* Copy the offset over */ + HDmemcpy(space->select.offset,offset,sizeof(hssize_t)*space->extent.u.simple.rank); + + FUNC_LEAVE(SUCCEED); +} /* end H5Soffset_simple() */ + /*------------------------------------------------------------------------- * Function: H5S_debug * diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 7a646aa..ebf6cfe 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -41,8 +41,8 @@ static intn H5S_hyper_bsearch(hssize_t size, H5S_hyper_bound_t *barr, size_t count); static H5S_hyper_region_t * H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, - H5S_hyper_bound_t **lo_bounds, - H5S_hyper_bound_t **hi_bounds, hssize_t *pos); + H5S_hyper_bound_t **lo_bounds, H5S_hyper_bound_t **hi_bounds, hssize_t *pos, + hssize_t *offset); static size_t H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info); static size_t H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info); @@ -164,8 +164,8 @@ H5S_hyper_compare_regions (const void *r1, const void *r2) */ static H5S_hyper_region_t * H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, - H5S_hyper_bound_t **lo_bounds, - H5S_hyper_bound_t **hi_bounds, hssize_t *pos) + H5S_hyper_bound_t **lo_bounds, H5S_hyper_bound_t **hi_bounds, hssize_t *pos, + hssize_t *offset) { H5S_hyper_region_t *ret_value=NULL; /* Pointer to array to return */ H5S_hyper_node_t *node; /* Region node for a given boundary */ @@ -196,47 +196,42 @@ H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, #endif /* QAK */ for(i=0; i=lo_bounds[0][i].bound && pos[0] <= - hi_bounds[0][i].bound)) { + if(pos[0]==(-1) || ((pos[0]+offset[0])>=lo_bounds[0][i].bound && (pos[0]+offset[0]) <= hi_bounds[0][i].bound)) { /* Check if we've allocated the array yet */ if(num_reg==0) { /* Allocate array */ ret_value=H5MM_malloc(sizeof(H5S_hyper_region_t)); /* Initialize with first region */ - ret_value[0].start=MAX(lo_bounds[0][i].bound,pos[0]); - ret_value[0].end=hi_bounds[0][i].bound; + ret_value[0].start=MAX(lo_bounds[0][i].bound,pos[0])+offset[0]; + ret_value[0].end=hi_bounds[0][i].bound+offset[0]; /* Increment the number of regions */ num_reg++; } else { /* - * Check if we should merge this region into the current - * region. - */ + * Check if we should merge this region into the current + * region. + */ if(lo_bounds[0][i].boundhi_bounds[dim][i].bound && i(hi_bounds[dim][i].bound+offset[dim]) && i=lo_bounds[dim][i].bound && i=(lo_bounds[dim][i].bound+offset[dim]) && i=0 && pos[temp_dim]>=node->start[temp_dim] && - pos[temp_dim]<=node->end[temp_dim]) + while(temp_dim>=0 && pos[temp_dim]>=(node->start[temp_dim]+offset[temp_dim]) && pos[temp_dim]<=(node->end[temp_dim]+offset[temp_dim])) temp_dim--; /* Yes, all previous positions match, this is a valid region */ @@ -288,36 +288,28 @@ H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, ret_value=H5MM_malloc(sizeof(H5S_hyper_region_t)); /* Initialize with first region */ - ret_value[0].start=MAX(node->start[next_dim],pos[next_dim]); - ret_value[0].end=node->end[next_dim]; + ret_value[0].start=MAX(node->start[next_dim],pos[next_dim])+offset[next_dim]; + ret_value[0].end=node->end[next_dim]+offset[next_dim]; #ifdef QAK - printf("%s: check 3.2, lo_bounds=%d, start=%d, " - "hi_bounds=%d, end=%d\n", - FUNC, (int)node->start[next_dim], - (int)ret_value[curr_reg].start, - (int)node->end[next_dim], - (int)ret_value[curr_reg].end); + printf("%s: check 3.2, lo_bounds=%d, start=%d, hi_bounds=%d, end=%d\n", + FUNC, (int)node->start[next_dim], (int)ret_value[curr_reg].start, + (int)node->end[next_dim], (int)ret_value[curr_reg].end); #endif /* QAK */ /* Increment the number of regions */ num_reg++; } else { #ifdef QAK - printf("%s: check 4.0, lo_bounds=%d, start=%d, " - "hi_bounds=%d, end=%d\n", - FUNC, (int)node->start[next_dim], - (int)ret_value[curr_reg].start, - (int)node->end[next_dim], - (int)ret_value[curr_reg].end); + printf("%s: check 4.0, lo_bounds=%d, start=%d, hi_bounds=%d, end=%d\n", + FUNC, (int)node->start[next_dim], (int)ret_value[curr_reg].start, + (int)node->end[next_dim], (int)ret_value[curr_reg].end); #endif /* QAK */ /* Enlarge array */ - ret_value=H5MM_realloc(ret_value, - (sizeof(H5S_hyper_region_t)* - (num_reg+1))); + ret_value=H5MM_realloc(ret_value,(sizeof(H5S_hyper_region_t)*(num_reg+1))); /* Initialize with new region */ - ret_value[num_reg].start=node->start[next_dim]; - ret_value[num_reg].end=node->end[next_dim]; + ret_value[num_reg].start=node->start[next_dim]+offset[next_dim]; + ret_value[num_reg].end=node->end[next_dim]+offset[next_dim]; /* Increment the number of regions & the current region */ num_reg++; @@ -328,8 +320,7 @@ H5S_hyper_get_regions (size_t *num_regions, intn dim, size_t bound_count, /* Sort region list and eliminate duplicates if necessary */ if(num_reg>1) { - qsort(ret_value,num_reg,sizeof(H5S_hyper_region_t), - H5S_hyper_compare_regions); + qsort(ret_value,num_reg,sizeof(H5S_hyper_region_t),H5S_hyper_compare_regions); for(i=1,curr_reg=0,uniq_reg=1; ispace->select.sel_info.hyper_lst->count, fhyper_info->lo_bounds, fhyper_info->hi_bounds, - fhyper_info->iter->hyp.pos))!=NULL) { + fhyper_info->iter->hyp.pos,fhyper_info->space->select.offset))!=NULL) { /* * Check if this is the second to last dimension in dataset (Which @@ -419,15 +410,12 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) /* Set up hyperslab I/O parameters which apply to all regions */ /* Copy the location of the region in the file */ - HDmemcpy(file_offset, fhyper_info->iter->hyp.pos, - (fhyper_info->space->extent.u.simple.rank * - sizeof(hssize_t))); + HDmemcpy(file_offset, fhyper_info->iter->hyp.pos, (fhyper_info->space->extent.u.simple.rank * sizeof(hssize_t))); file_offset[fhyper_info->space->extent.u.simple.rank]=0; /* Set the hyperslab size to copy */ hsize[0]=1; - H5V_array_fill(hsize, hsize, sizeof(hsize[0]), - fhyper_info->space->extent.u.simple.rank); + H5V_array_fill(hsize, hsize, sizeof(hsize[0]), fhyper_info->space->extent.u.simple.rank); hsize[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Set the memory offset to the origin */ @@ -438,8 +426,7 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) #ifdef QAK printf("%s: check 2.2, i=%d\n",FUNC,(int)i); #endif /* QAK */ - region_size=MIN(fhyper_info->nelmts, - (regions[i].end-regions[i].start)+1); + region_size=MIN(fhyper_info->nelmts, (regions[i].end-regions[i].start)+1); hsize[fhyper_info->space->extent.u.simple.rank-1]=region_size; file_offset[fhyper_info->space->extent.u.simple.rank-1]=regions[i].start; @@ -447,12 +434,9 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) * Gather from file. */ if (H5F_arr_read (fhyper_info->f, fhyper_info->layout, - fhyper_info->comp, fhyper_info->efl, - hsize, hsize, zero, file_offset, - fhyper_info->xfer_mode, - fhyper_info->dst/*out*/)<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, - "read error"); + fhyper_info->comp, fhyper_info->efl, hsize, hsize, zero, + file_offset, fhyper_info->xfer_mode, fhyper_info->dst/*out*/)<0) { + HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, "read error"); } #ifdef QAK printf("%s: check 2.3, region #%d\n",FUNC,(int)i); @@ -462,8 +446,7 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) #endif /* QAK */ /* Advance the pointer in the buffer */ - fhyper_info->dst = ((uint8 *)fhyper_info->dst) + - region_size*fhyper_info->elmt_size; + fhyper_info->dst = ((uint8 *)fhyper_info->dst) + region_size*fhyper_info->elmt_size; /* Increment the number of elements read */ num_read+=region_size; @@ -475,8 +458,7 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) if(region_size==(hsize_t)((regions[i].end-regions[i].start)+1)) fhyper_info->iter->hyp.pos[dim+1]=(-1); else - fhyper_info->iter->hyp.pos[dim+1] = regions[i].start + - region_size; + fhyper_info->iter->hyp.pos[dim+1] = regions[i].start + region_size; /* Decrement the iterator count */ fhyper_info->iter->hyp.elmt_left-=region_size; @@ -492,17 +474,15 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) /* Step through each region in this dimension */ for(i=0; inelmts>0; i++) { /* Step through each location in each region */ - for(j=regions[i].start; - j<=regions[i].end && fhyper_info->nelmts>0; - j++) { + for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) { #ifdef QAK printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); #endif /* QAK */ /* - * If we are moving to a new position in this dim, reset - * the next lower dim. location. - */ + * If we are moving to a new position in this dim, reset + * the next lower dim. location. + */ if(fhyper_info->iter->hyp.pos[dim]!=j) fhyper_info->iter->hyp.pos[dim+1]=(-1); @@ -659,7 +639,7 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) if((regions=H5S_hyper_get_regions(&num_regions,dim, fhyper_info->space->select.sel_info.hyper_lst->count, fhyper_info->lo_bounds, fhyper_info->hi_bounds, - fhyper_info->iter->hyp.pos))!=NULL) { + fhyper_info->iter->hyp.pos,fhyper_info->space->select.offset))!=NULL) { /* Check if this is the second to last dimension in dataset */ /* (Which means that we've got a list of the regions in the fastest */ @@ -890,7 +870,7 @@ H5S_hyper_mread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) if((regions=H5S_hyper_get_regions(&num_regions,dim, fhyper_info->space->select.sel_info.hyper_lst->count, fhyper_info->lo_bounds, fhyper_info->hi_bounds, - fhyper_info->iter->hyp.pos))!=NULL) { + fhyper_info->iter->hyp.pos,fhyper_info->space->select.offset))!=NULL) { /* Check if this is the second to last dimension in dataset */ /* (Which means that we've got a list of the regions in the fastest */ @@ -909,30 +889,24 @@ H5S_hyper_mread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) /* Set up hyperslab I/O parameters which apply to all regions */ /* Set up the size of the memory space */ - HDmemcpy(mem_size, fhyper_info->space->extent.u.simple.size, - fhyper_info->space->extent.u.simple.rank*sizeof(hsize_t)); + HDmemcpy(mem_size, fhyper_info->space->extent.u.simple.size, fhyper_info->space->extent.u.simple.rank*sizeof(hsize_t)); mem_size[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Copy the location of the region in the file */ - HDmemcpy(mem_offset, fhyper_info->iter->hyp.pos, - (fhyper_info->space->extent.u.simple.rank * - sizeof(hssize_t))); + HDmemcpy(mem_offset, fhyper_info->iter->hyp.pos, (fhyper_info->space->extent.u.simple.rank * sizeof(hssize_t))); mem_offset[fhyper_info->space->extent.u.simple.rank]=0; /* Set the hyperslab size to copy */ hsize[0]=1; - H5V_array_fill(hsize, hsize, sizeof(hsize[0]), - fhyper_info->space->extent.u.simple.rank); + H5V_array_fill(hsize, hsize, sizeof(hsize[0]), fhyper_info->space->extent.u.simple.rank); hsize[fhyper_info->space->extent.u.simple.rank]=fhyper_info->elmt_size; /* Set the memory offset to the origin */ - HDmemset (zero, 0, ((fhyper_info->space->extent.u.simple.rank+1)* - sizeof(*zero))); + HDmemset (zero, 0, ((fhyper_info->space->extent.u.simple.rank+1)* sizeof(*zero))); /* perform I/O on data from regions */ for(i=0; inelmts>0; i++) { - region_size=MIN(fhyper_info->nelmts, - (regions[i].end-regions[i].start)+1); + region_size=MIN(fhyper_info->nelmts, (regions[i].end-regions[i].start)+1); hsize[fhyper_info->space->extent.u.simple.rank-1]=region_size; mem_offset[fhyper_info->space->extent.u.simple.rank-1]=regions[i].start; #ifdef QAK @@ -951,8 +925,7 @@ H5S_hyper_mread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) } /* Advance the pointer in the buffer */ - fhyper_info->dst = ((uint8 *)fhyper_info->dst) + - region_size*fhyper_info->elmt_size; + fhyper_info->dst = ((uint8 *)fhyper_info->dst) + region_size*fhyper_info->elmt_size; /* Increment the number of elements read */ num_read+=region_size; @@ -981,17 +954,15 @@ H5S_hyper_mread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) /* Step through each region in this dimension */ for(i=0; inelmts>0; i++) { /* Step through each location in each region */ - for(j=regions[i].start; - j<=regions[i].end && fhyper_info->nelmts>0; - j++) { + for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) { #ifdef QAK printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j); #endif /* QAK */ /* - * If we are moving to a new position in this dim, reset - * the next lower dim. location. - */ + * If we are moving to a new position in this dim, reset + * the next lower dim. location. + */ if(fhyper_info->iter->hyp.pos[dim]!=j) fhyper_info->iter->hyp.pos[dim+1]=(-1); @@ -1164,7 +1135,7 @@ H5S_hyper_mwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info) if((regions=H5S_hyper_get_regions(&num_regions,dim, fhyper_info->space->select.sel_info.hyper_lst->count, fhyper_info->lo_bounds, fhyper_info->hi_bounds, - fhyper_info->iter->hyp.pos))!=NULL) { + fhyper_info->iter->hyp.pos,fhyper_info->space->select.offset))!=NULL) { #ifdef QAK printf("%s: check 2.0, rank=%d\n", @@ -1915,4 +1886,57 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src) done: FUNC_LEAVE (ret_value); } /* end H5S_hyper_copy() */ + +/*-------------------------------------------------------------------------- + NAME + H5S_hyper_select_valid + PURPOSE + Check whether the selection fits within the extent, with the current + offset defined. + USAGE + hbool_t H5S_hyper_select_valid(space); + H5S_t *space; IN: Dataspace pointer to query + RETURNS + TRUE if the selection fits within the extent, FALSE if it does not and + FAIL on an error. + DESCRIPTION + Determines if the current selection at the current offet fits within the + extent for the dataspace. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +hbool_t +H5S_hyper_select_valid (const H5S_t *space) +{ + H5S_hyper_node_t *curr; /* Hyperslab information nodes */ + intn i; /* Counter */ + hbool_t ret_value=TRUE; /* return value */ + + FUNC_ENTER (H5S_hyper_select_valid, FAIL); + + assert(space); + + /* Check each point to determine whether selection+offset is within extent */ + curr=space->select.sel_info.hyper_lst->head; + while(curr!=NULL && ret_value==TRUE) { + /* Check each dimension */ + for(i=0; iextent.u.simple.rank; i++) { + /* Check if an offset has been defined */ + /* Bounds check the selected point + offset against the extent */ + if(((curr->start[i]+space->select.offset[i])>(hssize_t)space->extent.u.simple.size[i]) + || ((curr->start[i]+space->select.offset[i])<0) + || ((curr->end[i]+space->select.offset[i])>(hssize_t)space->extent.u.simple.size[i]) + || ((curr->end[i]+space->select.offset[i])<0)) { + ret_value=FALSE; + break; + } /* end if */ + } /* end for */ + + curr=curr->next; + } /* end while */ + + FUNC_LEAVE (ret_value); +} /* end H5S_hyper_select_valid() */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 91141a4..d375e0d 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -259,10 +259,13 @@ H5S_point_fgath (H5F_t *f, const struct H5O_layout_t *layout, while(num_readpnt.elmt_left>0) { /* Copy the location of the point to get */ - HDmemcpy(file_offset, file_iter->pnt.curr->pnt, - ndims*sizeof(hssize_t)); + HDmemcpy(file_offset, file_iter->pnt.curr->pnt,ndims*sizeof(hssize_t)); file_offset[ndims] = 0; + /* Add in the offset */ + for(i=0; iextent.u.simple.rank; i++) + file_offset[i] += file_space->select.offset[i]; + /* Go read the point */ if (H5F_arr_read (f, layout, comp, efl, hsize, hsize, zero, file_offset, xfer_mode, buf/*out*/)<0) { @@ -375,6 +378,10 @@ H5S_point_fscat (H5F_t *f, const struct H5O_layout_t *layout, HDmemcpy(file_offset,file_iter->pnt.curr->pnt,ndims*sizeof(hssize_t)); file_offset[ndims] = 0; + /* Add in the offset, if there is one */ + for(i=0; iextent.u.simple.rank; i++) + file_offset[i] += file_space->select.offset[i]; + #ifdef QAK printf("%s: check 3.0\n",FUNC); { @@ -466,7 +473,7 @@ H5S_point_mgath (const void *_buf, size_t elmt_size, if(mem_iter->pnt.elmt_left>0) { /* Compute the location of the point to get */ for(i=space_ndims-1,acc=1,off=0; i>=0; i--) { - off+=mem_iter->pnt.curr->pnt[i]*acc; + off+=(mem_iter->pnt.curr->pnt[i]+mem_space->select.offset[i])*acc; acc*=mem_size[i]; } /* end for */ @@ -550,7 +557,7 @@ H5S_point_mscat (const void *_tconv_buf, size_t elmt_size, if(mem_iter->pnt.elmt_left>0) { /* Compute the location of the point to get */ for(i=space_ndims-1,acc=1,off=0; i>=0; i--) { - off+=mem_iter->pnt.curr->pnt[i]*acc; + off+=(mem_iter->pnt.curr->pnt[i]+mem_space->select.offset[i])*acc; acc*=mem_size[i]; } /* end for */ @@ -718,4 +725,55 @@ H5S_point_copy (H5S_t *dst, const H5S_t *src) done: FUNC_LEAVE (ret_value); } /* end H5S_point_copy() */ + +/*-------------------------------------------------------------------------- + NAME + H5S_point_select_valid + PURPOSE + Check whether the selection fits within the extent, with the current + offset defined. + USAGE + hbool_t H5S_point_select_valid(space); + H5S_t *space; IN: Dataspace pointer to query + RETURNS + TRUE if the selection fits within the extent, FALSE if it does not and + FAIL on an error. + DESCRIPTION + Determines if the current selection at the current offet fits within the + extent for the dataspace. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +hbool_t +H5S_point_select_valid (const H5S_t *space) +{ + H5S_pnt_node_t *curr; /* Point information nodes */ + intn i; /* Counter */ + hbool_t ret_value=TRUE; /* return value */ + + FUNC_ENTER (H5S_point_select_valid, FAIL); + + assert(space); + + /* Check each point to determine whether selection+offset is within extent */ + curr=space->select.sel_info.pnt_lst->head; + while(curr!=NULL) { + /* Check each dimension */ + for(i=0; iextent.u.simple.rank; i++) { + /* Check if an offset has been defined */ + /* Bounds check the selected point + offset against the extent */ + if(((curr->pnt[i]+space->select.offset[i])>(hssize_t)space->extent.u.simple.size[i]) + || ((curr->pnt[i]+space->select.offset[i])<0)) { + ret_value=FALSE; + break; + } /* end if */ + } /* end for */ + + curr=curr->next; + } /* end while */ + + FUNC_LEAVE (ret_value); +} /* end H5S_point_select_valid() */ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 611ea27..842c114 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -99,7 +99,7 @@ typedef struct { /* Selection information container */ typedef struct { H5S_sel_type type; /* Type of selection (list of points or hyperslabs) */ - hsize_t *offset; /* Offset within the extent (NULL means a 0 offset) */ + hssize_t *offset; /* Offset within the extent (NULL means a 0 offset) */ hsize_t *order; /* Selection order. (NULL means a specific ordering of points) */ hsize_t num_elem; /* Number of elements in selection */ union { @@ -227,6 +227,7 @@ hsize_t H5S_select_npoints (const H5S_t *space); intn H5S_extend (H5S_t *space, const hsize_t *size); herr_t H5S_set_extent_simple (H5S_t *space, int rank, const hsize_t *dims, const hsize_t *max); +hbool_t H5S_select_valid (const H5S_t *space); herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, intn indent, intn fwidth); @@ -288,6 +289,7 @@ herr_t H5S_point_add (H5S_t *space, size_t num_elemn, const hssize_t **coord); herr_t H5S_point_release (H5S_t *space); hsize_t H5S_point_npoints (const H5S_t *space); herr_t H5S_point_copy (H5S_t *dst, const H5S_t *src); +hbool_t H5S_point_select_valid (const H5S_t *space); /* "All" select functions */ herr_t H5S_all_init (const struct H5O_layout_t *layout, @@ -341,5 +343,6 @@ hsize_t H5S_hyper_npoints (const H5S_t *space); int H5S_hyper_compare_regions (const void *r1, const void *r2); int H5S_hyper_compare_bounds (const void *r1, const void *r2); herr_t H5S_hyper_copy (H5S_t *dst, const H5S_t *src); +hbool_t H5S_hyper_select_valid (const H5S_t *space); #endif diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 881e692..9dca348 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -66,6 +66,8 @@ herr_t H5Sset_extent_none (hid_t space_id); herr_t H5Sextent_copy (hid_t dst_id,hid_t src_id); herr_t H5Sselect_all (hid_t spaceid); herr_t H5Sselect_none (hid_t spaceid); +herr_t H5Soffset_simple (hid_t space_id, const hssize_t *offset); +hbool_t H5Sselect_valid (hid_t spaceid); #ifdef __cplusplus } diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 7f7650b..2188470 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -104,7 +104,14 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src) /* Copy regular fields */ dst->select=src->select; -/* Need to copy offset and order information still */ +/* Need to copy order information still */ + + /* Copy offset information */ + if (NULL==(dst->select.offset = H5MM_calloc(src->extent.u.simple.rank*sizeof(hssize_t)))) { + HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + } + if(src->select.offset!=NULL) + HDmemcpy(dst->select.offset,src->select.offset,(src->extent.u.simple.rank*sizeof(hssize_t))); /* Perform correct type of copy based on the type of selection */ switch (src->extent.type) { @@ -631,7 +638,7 @@ H5S_select_npoints (const H5S_t *space) { herr_t ret_value=FAIL; /* return value */ - FUNC_ENTER (H5Sselect_npoints, FAIL); + FUNC_ENTER (H5S_select_npoints, FAIL); assert(space); @@ -701,3 +708,90 @@ H5S_sel_iter_release (const H5S_t *space, H5S_sel_iter_t *sel_iter) FUNC_LEAVE (ret_value); } /* H5S_sel_iter_release() */ + +/*-------------------------------------------------------------------------- + NAME + H5Sselect_valid + PURPOSE + Check whether the selection fits within the extent, with the current + offset defined. + USAGE + hbool_t H5Sselect_void(dsid) + hid_t dsid; IN: Dataspace ID to query + RETURNS + TRUE if the selection fits within the extent, FALSE if it does not and + FAIL on an error. + DESCRIPTION + Determines if the current selection at the current offet fits within the + extent for the dataspace. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +hbool_t +H5Sselect_valid (hid_t spaceid) +{ + H5S_t *space = NULL; /* Dataspace to modify selection of */ + hbool_t ret_value=FAIL; /* return value */ + + FUNC_ENTER (H5Sselect_valid, 0); + H5TRACE1("b","i",spaceid); + + /* Check args */ + if (H5_DATASPACE != H5I_group(spaceid) || + NULL == (space=H5I_object(spaceid))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space"); + } + + ret_value = H5S_select_valid(space); + + FUNC_LEAVE (ret_value); +} /* H5Sselect_valid() */ + +/*-------------------------------------------------------------------------- + NAME + H5S_select_valid + PURPOSE + Check whether the selection fits within the extent, with the current + offset defined. + USAGE + hbool_t H5Sselect_void(space) + H5S_t *space; IN: Dataspace pointer to query + RETURNS + TRUE if the selection fits within the extent, FALSE if it does not and + FAIL on an error. + DESCRIPTION + Determines if the current selection at the current offet fits within the + extent for the dataspace. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +hbool_t +H5S_select_valid (const H5S_t *space) +{ + hbool_t ret_value=FAIL; /* return value */ + + FUNC_ENTER (H5S_select_valid, FAIL); + + assert(space); + + switch(space->select.type) { + case H5S_SEL_POINTS: /* Sequence of points selected */ + ret_value=H5S_point_select_valid(space); + break; + + case H5S_SEL_HYPERSLABS: /* Hyperslab selection defined */ + ret_value=H5S_hyper_select_valid(space); + break; + + case H5S_SEL_ALL: /* Entire extent selected */ + case H5S_SEL_NONE: /* Nothing selected */ + ret_value=TRUE; + break; + } /* end switch */ + + FUNC_LEAVE (ret_value); +} /* H5S_select_valid() */ diff --git a/test/.distdep b/test/.distdep index 502e178..82aaa44 100644 --- a/test/.distdep +++ b/test/.distdep @@ -1,3 +1,34 @@ +testhdf5.o: \ + testhdf5.c \ + testhdf5.h \ + ../src/H5private.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h +tattr.o: \ + tattr.c \ + testhdf5.h \ + ../src/H5private.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ + ../src/H5Ipublic.h \ + ../src/hdf5.h \ + ../src/H5Apublic.h \ + ../src/H5ACpublic.h \ + ../src/H5Bpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Fpublic.h \ + ../src/H5Gpublic.h \ + ../src/H5HGpublic.h \ + ../src/H5HLpublic.h \ + ../src/H5MFpublic.h \ + ../src/H5MMpublic.h \ + ../src/H5Opublic.h \ + ../src/H5Ppublic.h \ + ../src/H5Zpublic.h tfile.o: \ tfile.c \ testhdf5.h \ @@ -11,8 +42,7 @@ tfile.o: \ ../src/H5Bpublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Pprivate.h + ../src/H5Dpublic.h theap.o: \ theap.c \ testhdf5.h \ @@ -29,8 +59,7 @@ theap.o: \ ../src/H5Fpublic.h \ ../src/H5Dpublic.h \ ../src/H5Pprivate.h \ - ../src/H5Ppublic.h \ - ../src/H5Zpublic.h + ../src/H5Ppublic.h tmeta.o: \ tmeta.c \ testhdf5.h \ @@ -39,7 +68,9 @@ tmeta.o: \ ../src/H5config.h \ ../src/H5Eprivate.h \ ../src/H5Epublic.h \ - ../src/H5Ipublic.h + ../src/H5Ipublic.h \ + ../src/H5Fprivate.h \ + ../src/H5Fpublic.h tohdr.o: \ tohdr.c \ testhdf5.h \ @@ -68,8 +99,30 @@ tohdr.o: \ ../src/H5HGpublic.h \ ../src/H5Tprivate.h \ ../src/H5Tpublic.h \ - ../src/H5Sprivate.h \ - ../src/H5Spublic.h + ../src/H5Sprivate.h +tselect.o: \ + tselect.c \ + testhdf5.h \ + ../src/H5private.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ + ../src/H5Ipublic.h \ + ../src/hdf5.h \ + ../src/H5Apublic.h \ + ../src/H5ACpublic.h \ + ../src/H5Bpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Fpublic.h \ + ../src/H5Gpublic.h \ + ../src/H5HGpublic.h \ + ../src/H5HLpublic.h \ + ../src/H5MFpublic.h \ + ../src/H5MMpublic.h \ + ../src/H5Opublic.h \ + ../src/H5Ppublic.h \ + ../src/H5Zpublic.h tstab.o: \ tstab.c \ testhdf5.h \ @@ -98,13 +151,67 @@ tstab.o: \ ../src/H5HGpublic.h \ ../src/H5Tprivate.h \ ../src/H5Tpublic.h \ + ../src/H5Sprivate.h +th5s.o: \ + th5s.c \ + testhdf5.h \ + ../src/H5private.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ + ../src/H5Ipublic.h \ + ../src/H5Bprivate.h \ + ../src/H5Bpublic.h \ + ../src/H5Fprivate.h \ + ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ ../src/H5Sprivate.h \ - ../src/H5Spublic.h + ../src/H5Spublic.h \ + ../src/H5Gprivate.h \ + ../src/H5Gpublic.h \ + ../src/H5Oprivate.h \ + ../src/H5Opublic.h \ + ../src/H5HGprivate.h \ + ../src/H5HGpublic.h \ + ../src/H5Tprivate.h \ + ../src/H5Tpublic.h \ + ../src/H5Zprivate.h \ + ../src/H5Zpublic.h +dtypes.o: \ + dtypes.c \ + ../src/hdf5.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Ipublic.h \ + ../src/H5Apublic.h \ + ../src/H5ACpublic.h \ + ../src/H5Bpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Epublic.h \ + ../src/H5Fpublic.h \ + ../src/H5Gpublic.h \ + ../src/H5HGpublic.h \ + ../src/H5HLpublic.h \ + ../src/H5MFpublic.h \ + ../src/H5MMpublic.h \ + ../src/H5Opublic.h \ + ../src/H5Ppublic.h \ + ../src/H5Zpublic.h \ + ../src/H5Spublic.h \ + ../src/H5Tpublic.h \ + ../src/H5Tpkg.h \ + ../src/H5HGprivate.h \ + ../src/H5Fprivate.h \ + ../src/H5private.h \ + ../src/H5Tprivate.h hyperslab.o: \ hyperslab.c \ ../src/H5private.h \ ../src/H5public.h \ - ../src/H5config.h + ../src/H5config.h \ + ../src/H5MMprivate.h \ + ../src/H5MMpublic.h istore.o: \ istore.c \ ../src/H5private.h \ @@ -130,9 +237,11 @@ istore.o: \ ../src/H5HGpublic.h \ ../src/H5Tprivate.h \ ../src/H5Tpublic.h \ - ../src/H5Sprivate.h -extend.o: \ - extend.c \ + ../src/H5Sprivate.h \ + ../src/H5Spublic.h \ + ../src/H5Zprivate.h +dsets.o: \ + dsets.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -151,9 +260,10 @@ extend.o: \ ../src/H5Opublic.h \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ - ../src/H5Spublic.h -external.o: \ - external.c \ + ../src/H5Spublic.h \ + ../src/H5Tpublic.h +cmpd_dset.o: \ + cmpd_dset.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -172,27 +282,9 @@ external.o: \ ../src/H5Opublic.h \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ - ../src/H5Spublic.h \ - ../src/H5Tpublic.h -gheap.o: \ - gheap.c \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ - ../src/H5Ipublic.h \ - ../src/H5Fprivate.h \ - ../src/H5Fpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Gprivate.h \ - ../src/H5Gpublic.h \ - ../src/H5Bprivate.h \ - ../src/H5Bpublic.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h -shtype.o: \ - shtype.c \ + ../src/H5Spublic.h +extend.o: \ + extend.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -212,8 +304,8 @@ shtype.o: \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ ../src/H5Spublic.h -links.o: \ - links.c \ +external.o: \ + external.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -234,8 +326,8 @@ links.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -chunk.o: \ - chunk.c \ +iopipe.o: \ + iopipe.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -256,25 +348,27 @@ chunk.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -bittests.o: \ - bittests.c \ - ../src/H5Tpkg.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h \ +gheap.o: \ + gheap.c \ + ../src/H5private.h \ ../src/H5public.h \ ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ + ../src/H5Ipublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ - ../src/H5Ipublic.h \ - ../src/H5private.h \ ../src/H5Dpublic.h \ - ../src/H5Tprivate.h \ - ../src/H5Tpublic.h \ ../src/H5Gprivate.h \ ../src/H5Gpublic.h \ - ../src/H5Bprivate.h -big.o: \ - big.c \ + ../src/H5Bprivate.h \ + ../src/H5Bpublic.h \ + ../src/H5HGprivate.h \ + ../src/H5HGpublic.h \ + ../src/H5Pprivate.h \ + ../src/H5Ppublic.h +shtype.o: \ + shtype.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -293,17 +387,9 @@ big.o: \ ../src/H5Opublic.h \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ - ../src/H5Spublic.h \ - ../src/H5Tpublic.h \ - ../src/H5private.h -testhdf5.o: \ - testhdf5.c \ - testhdf5.h \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h -dsets.o: \ - dsets.c \ + ../src/H5Spublic.h +big.o: \ + big.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -323,9 +409,10 @@ dsets.o: \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ - ../src/H5Tpublic.h -dtypes.o: \ - dtypes.c \ + ../src/H5Tpublic.h \ + ../src/H5private.h +links.o: \ + links.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -345,54 +432,18 @@ dtypes.o: \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ - ../src/H5Tpublic.h \ - ../src/H5Tpkg.h \ - ../src/H5HGprivate.h \ - ../src/H5Fprivate.h \ - ../src/H5private.h \ - ../src/H5Tprivate.h \ - ../src/H5Gprivate.h -th5s.o: \ - th5s.c \ - testhdf5.h \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ - ../src/H5Ipublic.h \ - ../src/H5Bprivate.h \ - ../src/H5Bpublic.h \ - ../src/H5Fprivate.h \ - ../src/H5Fpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Sprivate.h \ - ../src/H5Spublic.h \ - ../src/H5Gprivate.h \ - ../src/H5Gpublic.h \ - ../src/H5Oprivate.h \ - ../src/H5Opublic.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h \ - ../src/H5Tprivate.h \ - ../src/H5Tpublic.h \ - ../src/H5Zprivate.h \ - ../src/H5Zpublic.h \ - ../src/H5Pprivate.h -tattr.o: \ - tattr.c \ - testhdf5.h \ - ../src/H5private.h \ + ../src/H5Tpublic.h +chunk.o: \ + chunk.c \ + ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ ../src/H5Ipublic.h \ - ../src/hdf5.h \ ../src/H5Apublic.h \ ../src/H5ACpublic.h \ ../src/H5Bpublic.h \ ../src/H5Dpublic.h \ + ../src/H5Epublic.h \ ../src/H5Fpublic.h \ ../src/H5Gpublic.h \ ../src/H5HGpublic.h \ @@ -402,53 +453,26 @@ tattr.o: \ ../src/H5Opublic.h \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ - ../src/H5Spublic.h -tselect.o: \ - tselect.c \ - testhdf5.h \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ - ../src/H5Ipublic.h \ - ../src/hdf5.h \ - ../src/H5Apublic.h \ - ../src/H5ACpublic.h \ - ../src/H5Bpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Fpublic.h \ - ../src/H5Gpublic.h \ + ../src/H5Spublic.h \ + ../src/H5Tpublic.h +bittests.o: \ + bittests.c \ + ../src/H5Tpkg.h \ + ../src/H5HGprivate.h \ ../src/H5HGpublic.h \ - ../src/H5HLpublic.h \ - ../src/H5MFpublic.h \ - ../src/H5MMpublic.h \ - ../src/H5Opublic.h \ - ../src/H5Ppublic.h \ - ../src/H5Zpublic.h -cmpd_dset.o: \ - cmpd_dset.c \ - ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ + ../src/H5Fprivate.h \ + ../src/H5Fpublic.h \ ../src/H5Ipublic.h \ - ../src/H5Apublic.h \ - ../src/H5ACpublic.h \ - ../src/H5Bpublic.h \ + ../src/H5private.h \ ../src/H5Dpublic.h \ - ../src/H5Epublic.h \ - ../src/H5Fpublic.h \ - ../src/H5Gpublic.h \ - ../src/H5HGpublic.h \ - ../src/H5HLpublic.h \ - ../src/H5MFpublic.h \ - ../src/H5MMpublic.h \ - ../src/H5Opublic.h \ - ../src/H5Ppublic.h \ - ../src/H5Zpublic.h \ - ../src/H5Spublic.h -iopipe.o: \ - iopipe.c \ + ../src/H5Tprivate.h \ + ../src/H5Tpublic.h \ + ../src/H5Gprivate.h \ + ../src/H5Gpublic.h +mtime.o: \ + mtime.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ diff --git a/test/tselect.c b/test/tselect.c index 29fff74..c19bfdd 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -49,12 +49,6 @@ static char RcsId[] = "$Revision$"; #define SPACE3_DIM1 15 #define SPACE3_DIM2 26 -/* 2-D dataset with fixed dimensions */ -#define SPACE4_NAME "Space4" -#define SPACE4_RANK 2 -#define SPACE4_DIM1 15 -#define SPACE4_DIM2 26 - /* Element selection information */ #define POINT1_NPOINTS 10 @@ -1090,6 +1084,338 @@ test_select_point_copy(void) /**************************************************************** ** +** test_select_hyper_offset(): Test basic H5S (dataspace) selection code. +** Tests hyperslabs of various sizes and dimensionalities with selection +** offsets. +** +****************************************************************/ +static void +test_select_hyper_offset(void) +{ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; + hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + hssize_t offset[SPACE1_RANK]; /* Offset of selection */ + uint8 *wbuf, /* buffer to write to disk */ + *rbuf, /* buffer read from disk */ + *tbuf, /* temporary buffer pointer */ + *tbuf2; /* temporary buffer pointer */ + intn i,j; /* Counters */ + herr_t ret; /* Generic return value */ + hbool_t valid; /* Generic boolean return value */ + H5S_class_t ext_type; /* Extent type */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Hyperslab Selection Functions with Offsets\n")); + + /* Allocate write & read buffers */ + wbuf=malloc(sizeof(uint8)*SPACE2_DIM1*SPACE2_DIM2); + rbuf=calloc(sizeof(uint8),SPACE3_DIM1*SPACE3_DIM2); + + /* Initialize write buffer */ + for(i=0, tbuf=wbuf; i