aboutsummaryrefslogtreecommitdiffstats
path: root/outputchannel.h
diff options
context:
space:
mode:
authorOt ten Thije <ottenthije@google.com>2010-10-06 17:48:15 +0100
committerOt ten Thije <ottenthije@google.com>2010-10-28 13:47:54 +0100
commit2ff39a367738422c0ca1313cac8ff380e1fdd498 (patch)
treea85cd059101de7f5eac9cd1f205d8971b6a3910d /outputchannel.h
parentf5f9aed3f35a80d8112849d0d354a465acfbbcc5 (diff)
downloadexternal_qemu-2ff39a367738422c0ca1313cac8ff380e1fdd498.zip
external_qemu-2ff39a367738422c0ca1313cac8ff380e1fdd498.tar.gz
external_qemu-2ff39a367738422c0ca1313cac8ff380e1fdd498.tar.bz2
Control state snapshots from Android console.
This patch exposes Qemu's save, load, delete and list commands for state snapshots on the Android console. A level of indirection is added by means of the OutputChannel construct. This allows us to show the output of the Qemu commands on the console rather than on the monitor, while minimizing the differences with the upstream codebase. The new commands are exposed only when the configuration constant CONFIG_ANDROID_SNAPSHOTS is not 0. Change-Id: I558d5cd505d321fe2da5835713d341d151f60534
Diffstat (limited to 'outputchannel.h')
-rw-r--r--outputchannel.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/outputchannel.h b/outputchannel.h
new file mode 100644
index 0000000..4dece8d
--- /dev/null
+++ b/outputchannel.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _OUTPUTCHANNEL_H
+#define _OUTPUTCHANNEL_H
+
+#include <stdarg.h>
+
+/* Callback function to print a printf-formatted string to a channel */
+typedef int (*OutputChannelPrintf) (void* opaque, const char* fmt, va_list ap);
+
+typedef struct OutputChannel OutputChannel;
+
+/* Allocates a new output channel */
+OutputChannel* output_channel_alloc(void* opaque, OutputChannelPrintf cb);
+
+/* Prints a printf-formatted string to the output channel */
+int output_channel_printf(OutputChannel* oc, const char* fmt, ...);
+
+/* Frees an output channel */
+void output_channel_free(OutputChannel* oc);
+
+/* Returns the number of bytes written to the channel */
+unsigned int output_channel_written(OutputChannel* oc);
+
+#endif /* _OUTPUTCHANNEL_H */