Line | Count | Source |
1 | | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
2 | | * Copyright by The HDF Group. * |
3 | | * All rights reserved. * |
4 | | * * |
5 | | * This file is part of HDF5. The full HDF5 copyright notice, including * |
6 | | * terms governing use, modification, and redistribution, is contained in * |
7 | | * the LICENSE file, which can be found at the root of the source code * |
8 | | * distribution tree, or in https://www.hdfgroup.org/licenses. * |
9 | | * If you do not have access to either file, you may request a copy from * |
10 | | * help@hdfgroup.org. * |
11 | | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
12 | | |
13 | | /*------------------------------------------------------------------------- |
14 | | * |
15 | | * Created: H5Sdbg.c |
16 | | * |
17 | | * Purpose: Dump debugging information about a dataspace |
18 | | * |
19 | | *------------------------------------------------------------------------- |
20 | | */ |
21 | | |
22 | | /****************/ |
23 | | /* Module Setup */ |
24 | | /****************/ |
25 | | |
26 | | #include "H5Smodule.h" /* This source code file is part of the H5S module */ |
27 | | |
28 | | /***********/ |
29 | | /* Headers */ |
30 | | /***********/ |
31 | | #include "H5private.h" /* Generic Functions */ |
32 | | #include "H5Eprivate.h" /* Error handling */ |
33 | | #include "H5Spkg.h" /* Dataspaces */ |
34 | | |
35 | | /****************/ |
36 | | /* Local Macros */ |
37 | | /****************/ |
38 | | |
39 | | /******************/ |
40 | | /* Local Typedefs */ |
41 | | /******************/ |
42 | | |
43 | | /********************/ |
44 | | /* Package Typedefs */ |
45 | | /********************/ |
46 | | |
47 | | /********************/ |
48 | | /* Local Prototypes */ |
49 | | /********************/ |
50 | | |
51 | | /*****************************/ |
52 | | /* Library Private Variables */ |
53 | | /*****************************/ |
54 | | |
55 | | /*********************/ |
56 | | /* Package Variables */ |
57 | | /*********************/ |
58 | | |
59 | | /*******************/ |
60 | | /* Local Variables */ |
61 | | /*******************/ |
62 | | |
63 | | /*------------------------------------------------------------------------- |
64 | | * Function: H5S_debug |
65 | | * |
66 | | * Purpose: Prints debugging information about a dataspace. |
67 | | * |
68 | | * Return: Non-negative on success/Negative on failure |
69 | | * |
70 | | *------------------------------------------------------------------------- |
71 | | */ |
72 | | herr_t |
73 | | H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth) |
74 | 0 | { |
75 | 0 | const H5S_t *mesg = (const H5S_t *)_mesg; |
76 | |
|
77 | 0 | FUNC_ENTER_NOAPI_NOINIT_NOERR |
78 | |
|
79 | 0 | switch (H5S_GET_EXTENT_TYPE(mesg)) { |
80 | 0 | case H5S_NULL: |
81 | 0 | fprintf(stream, "%*s%-*s H5S_NULL\n", indent, "", fwidth, "Space class:"); |
82 | 0 | break; |
83 | | |
84 | 0 | case H5S_SCALAR: |
85 | 0 | fprintf(stream, "%*s%-*s H5S_SCALAR\n", indent, "", fwidth, "Space class:"); |
86 | 0 | break; |
87 | | |
88 | 0 | case H5S_SIMPLE: |
89 | 0 | fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth, "Space class:"); |
90 | 0 | H5O_debug_id(H5O_SDSPACE_ID, f, &(mesg->extent), stream, indent + 3, MAX(0, fwidth - 3)); |
91 | 0 | break; |
92 | | |
93 | 0 | case H5S_NO_CLASS: |
94 | 0 | default: |
95 | 0 | fprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth, |
96 | 0 | "Space class:", (long)(H5S_GET_EXTENT_TYPE(mesg))); |
97 | 0 | break; |
98 | 0 | } /* end switch */ |
99 | | |
100 | 0 | FUNC_LEAVE_NOAPI(SUCCEED) |
101 | 0 | } /* end H5S_debug() */ |