aboutsummaryrefslogtreecommitdiff
path: root/qint.h
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-08-28 15:27:05 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-04 09:37:29 -0500
commit6b8d1ece705752cb0214fb89ccd3925eddc62df8 (patch)
tree450e655a60e90b51cb6cdbcf919dd8f8e229dd2e /qint.h
parentIntroduce QObject (diff)
downloadqemu-kvm-6b8d1ece705752cb0214fb89ccd3925eddc62df8.tar.gz
qemu-kvm-6b8d1ece705752cb0214fb89ccd3925eddc62df8.tar.bz2
qemu-kvm-6b8d1ece705752cb0214fb89ccd3925eddc62df8.zip
Introduce QInt
QInt is a high-level data type that can be used to represent integers, internally it stores an int64_t value. The following functions are available: - qint_from_int() Create a new QInt - qint_get_int() Get the stored integer Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qint.h')
-rw-r--r--qint.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/qint.h b/qint.h
new file mode 100644
index 000000000..672b32196
--- /dev/null
+++ b/qint.h
@@ -0,0 +1,16 @@
+#ifndef QINT_H
+#define QINT_H
+
+#include <stdint.h>
+#include "qobject.h"
+
+typedef struct QInt {
+ QObject_HEAD;
+ int64_t value;
+} QInt;
+
+QInt *qint_from_int(int64_t value);
+int64_t qint_get_int(const QInt *qi);
+QInt *qobject_to_qint(const QObject *obj);
+
+#endif /* QINT_H */