summaryrefslogtreecommitdiffstats
path: root/src/H5Spoint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1998-07-22 22:11:22 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1998-07-22 22:11:22 (GMT)
commitb970dce3ec059f86206b275d55fde2b8b6e5fd33 (patch)
treeae810bf2af451559ced99a17269ec06f8db4dbce /src/H5Spoint.c
parent29a029d7e7c95be8ded8fb4e0989e3711ab7e3dc (diff)
downloadhdf5-b970dce3ec059f86206b275d55fde2b8b6e5fd33.zip
hdf5-b970dce3ec059f86206b275d55fde2b8b6e5fd33.tar.gz
hdf5-b970dce3ec059f86206b275d55fde2b8b6e5fd33.tar.bz2
[svn-r530] Added code so H5Scopy copies selections properly.
Diffstat (limited to 'src/H5Spoint.c')
-rw-r--r--src/H5Spoint.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index a291d8a..91141a4 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -639,4 +639,83 @@ H5S_hyper_npoints (const H5S_t *space)
FUNC_LEAVE (space->select.num_elem);
} /* H5S_hyper_npoints() */
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5S_point_copy
+ PURPOSE
+ Copy a selection from one dataspace to another
+ USAGE
+ herr_t H5S_point_copy(dst, src)
+ H5S_t *dst; OUT: Pointer to the destination dataspace
+ H5S_t *src; IN: Pointer to the source dataspace
+ RETURNS
+ SUCCEED/FAIL
+ DESCRIPTION
+ Copies all the point selection information from the source
+ dataspace to the destination dataspace.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5S_point_copy (H5S_t *dst, const H5S_t *src)
+{
+ H5S_pnt_node_t *curr, *new, *new_head; /* Point information nodes */
+ herr_t ret_value=SUCCEED; /* return value */
+
+ FUNC_ENTER (H5S_point_copy, FAIL);
+
+ assert(src);
+ assert(dst);
+
+#ifdef QAK
+ printf("%s: check 1.0\n",FUNC);
+#endif /* QAK */
+ /* Allocate room for the head of the point list */
+ if((dst->select.sel_info.pnt_lst=H5MM_malloc(sizeof(H5S_pnt_list_t)))==NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "can't allocate point node");
+
+ curr=src->select.sel_info.pnt_lst->head;
+ new_head=NULL;
+ while(curr!=NULL) {
+ /* Create each point */
+ if((new=H5MM_malloc(sizeof(H5S_pnt_node_t)))==NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "can't allocate point node");
+ if((new->pnt = H5MM_malloc(src->extent.u.simple.rank*sizeof(hssize_t)))==NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "can't allocate coordinate information");
+ HDmemcpy(new->pnt,curr->pnt,(src->extent.u.simple.rank*sizeof(hssize_t)));
+ new->next=NULL;
+
+#ifdef QAK
+ printf("%s: check 5.0\n",FUNC);
+ {
+ intn i;
+ for(i=0; i<src->extent.u.simple.rank; i++)
+ printf("%s: check 5.1, new->pnt[%d]=%d\n",FUNC,i,(int)new->pnt[i]);
+ }
+#endif /* QAK */
+
+ /* Keep the order the same when copying */
+ if(new_head==NULL)
+ new_head=dst->select.sel_info.pnt_lst->head=new;
+ else {
+ new_head->next=new;
+ new_head=new;
+ } /* end else */
+
+ curr=curr->next;
+ } /* end while */
+#ifdef QAK
+ printf("%s: check 10.0 src->select.sel_info.pnt_lst=%p, dst->select.sel_info.pnt_lst=%p\n",FUNC,src->select.sel_info.pnt_lst,dst->select.sel_info.pnt_lst);
+ printf("%s: check 10.0 src->select.sel_info.pnt_lst->head=%p, dst->select.sel_info.pnt_lst->head=%p\n",FUNC,src->select.sel_info.pnt_lst->head,dst->select.sel_info.pnt_lst->head);
+#endif /* QAK */
+
+done:
+ FUNC_LEAVE (ret_value);
+} /* end H5S_point_copy() */
'>send_obj_cmd Tk is a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages.
summaryrefslogtreecommitdiffstats
path: root/license.terms
blob: 01264352c87ca7e34771bd1ee18bed5201ef139f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
This software is copyrighted by the Regents of the University of
California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
Corporation, Apple Inc. and other parties.  The following terms apply to
all files associated with the software unless explicitly disclaimed in
individual files.

The authors hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
that existing copyright notices are retained in all copies and that this
notice is included verbatim in any distributions. No written agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file where
they apply.

IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.

GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (b) (3) of DFARs.  Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.