7712 mandoc -Tlint does always exit with error code 0
[unleashed.git] / usr / src / cmd / lvm / metassist / xml / xml_convert.h
bloba6017111bcae0a602d890f270ac65bc9d626fed5
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _XML_CONVERT_H
28 #define _XML_CONVERT_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #include <libxml/parser.h>
37 #include "volume_request.h"
38 #include "volume_defaults.h"
40 /* The location of the volume-request.dtd */
41 #define VOLUME_REQUEST_DTD_LOC "/usr/share/lib/xml/dtd/volume-request.dtd"
43 /* The location of the volume-request-defaults.dtd */
44 #define VOLUME_DEFAULTS_DTD_LOC "/usr/share/lib/xml/dtd/volume-defaults.dtd"
46 /* The location of the volume-config.dtd */
47 #define VOLUME_CONFIG_DTD_LOC "/usr/share/lib/xml/dtd/volume-config.dtd"
49 /* Location of the volume-command.xsl file */
50 #define VOLUME_COMMAND_XSL_LOC "/usr/share/lib/xml/style/volume-command.xsl"
53 * Valid values for attributes
55 #define VALID_ATTR_TRUE "TRUE"
56 #define VALID_ATTR_FALSE "FALSE"
57 #define VALID_MIRROR_READ_GEOMETRIC "GEOMETRIC"
58 #define VALID_MIRROR_READ_FIRST "FIRST"
59 #define VALID_MIRROR_READ_ROUNDROBIN "ROUNDROBIN"
60 #define VALID_MIRROR_WRITE_SERIAL "SERIAL"
61 #define VALID_MIRROR_WRITE_PARALLEL "PARALLEL"
64 * Standard units
66 #define UNIT_BLOCKS "BLOCKS"
67 #define UNIT_KILOBYTES "KB"
68 #define UNIT_MEGABYTES "MB"
69 #define UNIT_GIGABYTES "GB"
70 #define UNIT_TERABYTES "TB"
73 * Initialize the XML parser, setting defaults across all XML
74 * routines.
76 extern void init_xml();
79 * Clean up any remaining structures before exiting.
81 extern void cleanup_xml();
84 * Converts a volume-request XML document into a request_t.
86 * @param doc
87 * an existing volume-request XML document
89 * @param request
90 * RETURN: a new request_t which must be freed via
91 * free_request
93 * @return 0 on success, non-zero otherwise.
95 extern int xml_to_request(xmlDocPtr doc, request_t **request);
98 * Converts a volume-defaults XML document into a defaults_t.
100 * @param doc
101 * an existing volume-defaults XML document
103 * @param defaults
104 * RETURN: a new defaults_t which must be freed via
105 * free_defaults
107 * @return 0 on success, non-zero otherwise.
109 extern int xml_to_defaults(xmlDocPtr doc, defaults_t **defaults);
112 * Converts a volume-config XML document into a devconfig_t.
114 * @param doc
115 * an existing volume-config XML document
117 * @param config
118 * RETURN: a new devconfig_t which must be freed via
119 * free_devconfig
121 * @return 0 on success, non-zero otherwise.
123 extern int xml_to_config(xmlDocPtr doc, devconfig_t **config);
126 * Converts a devconfig_t into a volume-config XML document.
128 * @param config
129 * an existing devconfig_t representing a volume
130 * configuration.
132 * @param doc
133 * RETURN: a new volume-config XML document which must be
134 * freed via xmlFreeDoc
136 * @return 0 on success, non-zero otherwise.
138 extern int config_to_xml(devconfig_t *config, xmlDocPtr *doc);
141 * Converts a volume-config XML document into a Bourne shell script.
143 * @param doc
144 * an existing volume-config XML document
146 * @param commands
147 * RETURN: a new char* which must be freed
149 * @return 0 on success, non-zero otherwise.
151 extern int xml_to_commands(xmlDocPtr doc, char **commands);
153 #ifdef __cplusplus
155 #endif
157 #endif /* _XML_CONVERT_H */