Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
f7e6b192
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f7e6b192
编写于
11月 11, 2009
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a QBool type
Signed-off-by:
N
Anthony Liguori
<
aliguori@us.ibm.com
>
上级
9c9efb6b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
107 addition
and
1 deletion
+107
-1
Makefile
Makefile
+1
-1
qbool.c
qbool.c
+76
-0
qbool.h
qbool.h
+29
-0
qobject.h
qobject.h
+1
-0
未找到文件。
Makefile
浏览文件 @
f7e6b192
...
...
@@ -137,7 +137,7 @@ obj-y += buffered_file.o migration.o migration-tcp.o qemu-sockets.o
obj-y
+=
qemu-char.o aio.o savevm.o
obj-y
+=
msmouse.o ps2.o
obj-y
+=
qdev.o qdev-properties.o
obj-y
+=
qint.o qstring.o qdict.o qlist.o qfloat.o
obj-y
+=
qint.o qstring.o qdict.o qlist.o qfloat.o
qbool.o
obj-y
+=
qemu-config.o block-migration.o
obj-$(CONFIG_BRLAPI)
+=
baum.o
...
...
qbool.c
0 → 100644
浏览文件 @
f7e6b192
/*
* QBool Module
*
* Copyright (C) 2009 Red Hat Inc.
*
* Authors:
* Luiz Capitulino <lcapitulino@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
*
* Copyright IBM, Corp. 2009
*
* Authors:
* Anthony Liguori <aliguori@us.ibm.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*
*/
#include "qbool.h"
#include "qobject.h"
#include "qemu-common.h"
static
void
qbool_destroy_obj
(
QObject
*
obj
);
static
const
QType
qbool_type
=
{
.
code
=
QTYPE_QBOOL
,
.
destroy
=
qbool_destroy_obj
,
};
/**
* qbool_from_int(): Create a new QBool from an int
*
* Return strong reference.
*/
QBool
*
qbool_from_int
(
int
value
)
{
QBool
*
qb
;
qb
=
qemu_malloc
(
sizeof
(
*
qb
));
qb
->
value
=
value
;
QOBJECT_INIT
(
qb
,
&
qbool_type
);
return
qb
;
}
/**
* qbool_get_int(): Get the stored int
*/
int
qbool_get_int
(
const
QBool
*
qb
)
{
return
qb
->
value
;
}
/**
* qobject_to_qbool(): Convert a QObject into a QBool
*/
QBool
*
qobject_to_qbool
(
const
QObject
*
obj
)
{
if
(
qobject_type
(
obj
)
!=
QTYPE_QBOOL
)
return
NULL
;
return
container_of
(
obj
,
QBool
,
base
);
}
/**
* qbool_destroy_obj(): Free all memory allocated by a
* QBool object
*/
static
void
qbool_destroy_obj
(
QObject
*
obj
)
{
assert
(
obj
!=
NULL
);
qemu_free
(
qobject_to_qbool
(
obj
));
}
qbool.h
0 → 100644
浏览文件 @
f7e6b192
/*
* QBool Module
*
* Copyright IBM, Corp. 2009
*
* Authors:
* Anthony Liguori <aliguori@us.ibm.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*
*/
#ifndef QBOOL_H
#define QBOOL_H
#include <stdint.h>
#include "qobject.h"
typedef
struct
QBool
{
QObject_HEAD
;
int
value
;
}
QBool
;
QBool
*
qbool_from_int
(
int
value
);
int
qbool_get_int
(
const
QBool
*
qb
);
QBool
*
qobject_to_qbool
(
const
QObject
*
obj
);
#endif
/* QBOOL_H */
qobject.h
浏览文件 @
f7e6b192
...
...
@@ -42,6 +42,7 @@ typedef enum {
QTYPE_QDICT
,
QTYPE_QLIST
,
QTYPE_QFLOAT
,
QTYPE_QBOOL
,
}
qtype_code
;
struct
QObject
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录