ia64/xen-unstable

view tools/libxen/include/xen_console.h @ 12999:462b945e2f41

Update doc-comments to match recent documentation tidy-ups.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Dec 08 10:51:41 2006 +0000 (2006-12-08)
parents 5e9812e53300
children be35eed950da
line source
1 /*
2 * Copyright (c) 2006, XenSource Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
19 #ifndef XEN_CONSOLE_H
20 #define XEN_CONSOLE_H
22 #include "xen_common.h"
23 #include "xen_console_decl.h"
24 #include "xen_console_protocol.h"
25 #include "xen_vm_decl.h"
28 /*
29 * The console class.
30 *
31 * A console.
32 */
35 /**
36 * Free the given xen_console. The given handle must have been
37 * allocated by this library.
38 */
39 extern void
40 xen_console_free(xen_console console);
43 typedef struct xen_console_set
44 {
45 size_t size;
46 xen_console *contents[];
47 } xen_console_set;
49 /**
50 * Allocate a xen_console_set of the given size.
51 */
52 extern xen_console_set *
53 xen_console_set_alloc(size_t size);
55 /**
56 * Free the given xen_console_set. The given set must have been
57 * allocated by this library.
58 */
59 extern void
60 xen_console_set_free(xen_console_set *set);
63 typedef struct xen_console_record
64 {
65 xen_console handle;
66 char *uuid;
67 enum xen_console_protocol protocol;
68 char *uri;
69 struct xen_vm_record_opt *vm;
70 } xen_console_record;
72 /**
73 * Allocate a xen_console_record.
74 */
75 extern xen_console_record *
76 xen_console_record_alloc(void);
78 /**
79 * Free the given xen_console_record, and all referenced values. The
80 * given record must have been allocated by this library.
81 */
82 extern void
83 xen_console_record_free(xen_console_record *record);
86 typedef struct xen_console_record_opt
87 {
88 bool is_record;
89 union
90 {
91 xen_console handle;
92 xen_console_record *record;
93 } u;
94 } xen_console_record_opt;
96 /**
97 * Allocate a xen_console_record_opt.
98 */
99 extern xen_console_record_opt *
100 xen_console_record_opt_alloc(void);
102 /**
103 * Free the given xen_console_record_opt, and all referenced values.
104 * The given record_opt must have been allocated by this library.
105 */
106 extern void
107 xen_console_record_opt_free(xen_console_record_opt *record_opt);
110 typedef struct xen_console_record_set
111 {
112 size_t size;
113 xen_console_record *contents[];
114 } xen_console_record_set;
116 /**
117 * Allocate a xen_console_record_set of the given size.
118 */
119 extern xen_console_record_set *
120 xen_console_record_set_alloc(size_t size);
122 /**
123 * Free the given xen_console_record_set, and all referenced values.
124 * The given set must have been allocated by this library.
125 */
126 extern void
127 xen_console_record_set_free(xen_console_record_set *set);
131 typedef struct xen_console_record_opt_set
132 {
133 size_t size;
134 xen_console_record_opt *contents[];
135 } xen_console_record_opt_set;
137 /**
138 * Allocate a xen_console_record_opt_set of the given size.
139 */
140 extern xen_console_record_opt_set *
141 xen_console_record_opt_set_alloc(size_t size);
143 /**
144 * Free the given xen_console_record_opt_set, and all referenced
145 * values. The given set must have been allocated by this library.
146 */
147 extern void
148 xen_console_record_opt_set_free(xen_console_record_opt_set *set);
151 /**
152 * Get a record containing the current state of the given console.
153 */
154 extern bool
155 xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
158 /**
159 * Get a reference to the console instance with the specified UUID.
160 */
161 extern bool
162 xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
165 /**
166 * Create a new console instance, and return its handle.
167 */
168 extern bool
169 xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
172 /**
173 * Destroy the specified console instance.
174 */
175 extern bool
176 xen_console_destroy(xen_session *session, xen_console console);
179 /**
180 * Get the uuid field of the given console.
181 */
182 extern bool
183 xen_console_get_uuid(xen_session *session, char **result, xen_console console);
186 /**
187 * Get the protocol field of the given console.
188 */
189 extern bool
190 xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
193 /**
194 * Get the uri field of the given console.
195 */
196 extern bool
197 xen_console_get_uri(xen_session *session, char **result, xen_console console);
200 /**
201 * Get the VM field of the given console.
202 */
203 extern bool
204 xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
207 #endif