| 1 | /** |
|---|
| 2 | * This file contains functions necessary to perform XML-I/O for |
|---|
| 3 | * NeXus with the mxml-library. |
|---|
| 4 | * |
|---|
| 5 | * Most notably it contains the callback function for reading data |
|---|
| 6 | * |
|---|
| 7 | * Copyright (C) 2004 Mark Koennecke |
|---|
| 8 | * |
|---|
| 9 | * This library is free software; you can redistribute it and/or |
|---|
| 10 | * modify it under the terms of the GNU Lesser General Public |
|---|
| 11 | * License as published by the Free Software Foundation; either |
|---|
| 12 | * version 2 of the License, or (at your option) any later version. |
|---|
| 13 | * |
|---|
| 14 | * This library is distributed in the hope that it will be useful, |
|---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 17 | * Lesser General Public License for more details. |
|---|
| 18 | * |
|---|
| 19 | * You should have received a copy of the GNU Lesser General Public |
|---|
| 20 | * License along with this library; if not, write to the Free Software |
|---|
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 22 | * |
|---|
| 23 | * For further information, see <http://www.nexusformat.org> |
|---|
| 24 | */ |
|---|
| 25 | |
|---|
| 26 | #ifndef __NXIO |
|---|
| 27 | #define __NXIO |
|---|
| 28 | #include <mxml.h> |
|---|
| 29 | |
|---|
| 30 | #define TYPENAME "NAPItype" |
|---|
| 31 | |
|---|
| 32 | #define DIMS_NODE_NAME "columns" |
|---|
| 33 | #define DATA_NODE_NAME "row" |
|---|
| 34 | |
|---|
| 35 | mxml_type_t nexusTypeCallback(mxml_node_t *parent); |
|---|
| 36 | const char *NXwhitespaceCallback(mxml_node_t *node, int where); |
|---|
| 37 | int nexusLoadCallback(mxml_node_t *node, const char *buffer); |
|---|
| 38 | char *nexusWriteCallback(mxml_node_t *node); |
|---|
| 39 | |
|---|
| 40 | void setNumberFormat(int dataType, char *formatString); |
|---|
| 41 | void initializeNumberFormats(); |
|---|
| 42 | void getNumberText(int nx_type, char *typestring, int typeLen); |
|---|
| 43 | void destroyDataset(void *data); |
|---|
| 44 | int translateTypeCode(const char *code); |
|---|
| 45 | int isDataNode(mxml_node_t *node); |
|---|
| 46 | void analyzeDim(const char *typeString, int *rank, |
|---|
| 47 | int64_t *iDim, int *type); |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | #endif |
|---|