aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-05-23 16:35:06 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-06-11 20:22:09 +0200
commit856dfd8a035e42cd96ca823f1cbbd18d332e2f84 (patch)
tree408d7b4c400bf2a8957eb8fe3521644cf3663d37
parent14a48c1d0d687735c76880e59bcede6e99871ded (diff)
qemu-common: Move qemu_isalnum() etc. to qemu/ctype.h
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-3-armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--block/ssh.c1
-rw-r--r--block/vvfat.c1
-rw-r--r--gdbstub.c2
-rw-r--r--hw/core/bus.c2
-rw-r--r--hw/core/qdev-properties.c1
-rw-r--r--hw/s390x/s390-virtio-ccw.c1
-rw-r--r--hw/scsi/scsi-generic.c2
-rw-r--r--include/qemu-common.h16
-rw-r--r--include/qemu/ctype.h27
-rw-r--r--monitor.c1
-rw-r--r--net/net.c1
-rw-r--r--net/tap-solaris.c1
-rw-r--r--qapi/qapi-util.c2
-rw-r--r--qobject/json-parser.c2
-rw-r--r--target/ppc/monitor.c2
-rw-r--r--target/riscv/cpu.c1
-rw-r--r--tests/libqtest.c1
-rw-r--r--tests/vhost-user-bridge.c2
-rw-r--r--ui/keymaps.c1
-rw-r--r--util/cutils.c3
-rw-r--r--util/id.c2
-rw-r--r--util/readline.c2
22 files changed, 50 insertions, 24 deletions
diff --git a/block/ssh.c b/block/ssh.c
index 12fd4f39e8..584c302fe6 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -32,6 +32,7 @@
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "qemu/sockets.h"
#include "qemu/uri.h"
diff --git a/block/vvfat.c b/block/vvfat.c
index 253cc716dd..f6c28805dd 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -34,6 +34,7 @@
#include "migration/blocker.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
diff --git a/gdbstub.c b/gdbstub.c
index 462f89edfe..9159d7d153 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -16,9 +16,11 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "trace-root.h"
#ifdef CONFIG_USER_ONLY
diff --git a/hw/core/bus.c b/hw/core/bus.c
index e09843f6ab..60c4720379 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -18,7 +18,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/ctype.h"
#include "hw/qdev.h"
#include "qapi/error.h"
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 5da1439a8b..81c97f48a7 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -4,6 +4,7 @@
#include "qapi/error.h"
#include "hw/pci/pci.h"
#include "qapi/qmp/qerror.h"
+#include "qemu/ctype.h"
#include "qemu/error-report.h"
#include "hw/block/block.h"
#include "net/hub.h"
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 4d643686cb..87b2039f1b 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -23,6 +23,7 @@
#include "hw/s390x/css.h"
#include "virtio-ccw.h"
#include "qemu/config-file.h"
+#include "qemu/ctype.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "s390-pci-bus.h"
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index d82b462be4..e8a8706a4f 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -13,7 +13,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "qemu-common.h"
+#include "qemu/ctype.h"
#include "qemu/error-report.h"
#include "hw/scsi/scsi.h"
#include "hw/scsi/emulation.h"
diff --git a/include/qemu-common.h b/include/qemu-common.h
index d7f4a4e7eb..9b01f6e7cb 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -31,22 +31,6 @@ int qemu_main(int argc, char **argv, char **envp);
void qemu_get_timedate(struct tm *tm, int offset);
int qemu_timedate_diff(struct tm *tm);
-#define qemu_isalnum(c) isalnum((unsigned char)(c))
-#define qemu_isalpha(c) isalpha((unsigned char)(c))
-#define qemu_iscntrl(c) iscntrl((unsigned char)(c))
-#define qemu_isdigit(c) isdigit((unsigned char)(c))
-#define qemu_isgraph(c) isgraph((unsigned char)(c))
-#define qemu_islower(c) islower((unsigned char)(c))
-#define qemu_isprint(c) isprint((unsigned char)(c))
-#define qemu_ispunct(c) ispunct((unsigned char)(c))
-#define qemu_isspace(c) isspace((unsigned char)(c))
-#define qemu_isupper(c) isupper((unsigned char)(c))
-#define qemu_isxdigit(c) isxdigit((unsigned char)(c))
-#define qemu_tolower(c) tolower((unsigned char)(c))
-#define qemu_toupper(c) toupper((unsigned char)(c))
-#define qemu_isascii(c) isascii((unsigned char)(c))
-#define qemu_toascii(c) toascii((unsigned char)(c))
-
void *qemu_oom_check(void *ptr);
ssize_t qemu_write_full(int fd, const void *buf, size_t count)
diff --git a/include/qemu/ctype.h b/include/qemu/ctype.h
new file mode 100644
index 0000000000..3691f0984d
--- /dev/null
+++ b/include/qemu/ctype.h
@@ -0,0 +1,27 @@
+/*
+ * QEMU TCG support
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_CTYPE_H
+#define QEMU_CTYPE_H
+
+#define qemu_isalnum(c) isalnum((unsigned char)(c))
+#define qemu_isalpha(c) isalpha((unsigned char)(c))
+#define qemu_iscntrl(c) iscntrl((unsigned char)(c))
+#define qemu_isdigit(c) isdigit((unsigned char)(c))
+#define qemu_isgraph(c) isgraph((unsigned char)(c))
+#define qemu_islower(c) islower((unsigned char)(c))
+#define qemu_isprint(c) isprint((unsigned char)(c))
+#define qemu_ispunct(c) ispunct((unsigned char)(c))
+#define qemu_isspace(c) isspace((unsigned char)(c))
+#define qemu_isupper(c) isupper((unsigned char)(c))
+#define qemu_isxdigit(c) isxdigit((unsigned char)(c))
+#define qemu_tolower(c) tolower((unsigned char)(c))
+#define qemu_toupper(c) toupper((unsigned char)(c))
+#define qemu_isascii(c) isascii((unsigned char)(c))
+#define qemu_toascii(c) toascii((unsigned char)(c))
+
+#endif
diff --git a/monitor.c b/monitor.c
index 3650ceb574..5c5cbe254a 100644
--- a/monitor.c
+++ b/monitor.c
@@ -42,6 +42,7 @@
#include "sysemu/numa.h"
#include "monitor/monitor.h"
#include "qemu/config-file.h"
+#include "qemu/ctype.h"
#include "qemu/readline.h"
#include "ui/console.h"
#include "ui/input.h"
diff --git a/net/net.c b/net/net.c
index 2cf5e76469..3e65c93920 100644
--- a/net/net.c
+++ b/net/net.c
@@ -41,6 +41,7 @@
#include "qemu/sockets.h"
#include "qemu/cutils.h"
#include "qemu/config-file.h"
+#include "qemu/ctype.h"
#include "hw/qdev.h"
#include "qemu/iov.h"
#include "qemu/main-loop.h"
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index a2a92356c1..0e3f3e0a9b 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -26,6 +26,7 @@
#include "qapi/error.h"
#include "tap_int.h"
#include "sysemu/sysemu.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include <sys/ethernet.h>
diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
index e9b266bb70..29a6c98b53 100644
--- a/qapi/qapi-util.c
+++ b/qapi/qapi-util.c
@@ -12,7 +12,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "qemu-common.h"
+#include "qemu/ctype.h"
const char *qapi_enum_lookup(const QEnumLookup *lookup, int val)
{
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index d8eb210c0c..7d23e12e33 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -12,10 +12,10 @@
*/
#include "qemu/osdep.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "qemu/unicode.h"
#include "qapi/error.h"
-#include "qemu-common.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
diff --git a/target/ppc/monitor.c b/target/ppc/monitor.c
index ee9d6e81d2..7f8360d903 100644
--- a/target/ppc/monitor.c
+++ b/target/ppc/monitor.c
@@ -21,9 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "cpu.h"
#include "monitor/monitor.h"
+#include "qemu/ctype.h"
#include "monitor/hmp-target.h"
#include "hmp.h"
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 86fd8693a8..6f2b644220 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -19,6 +19,7 @@
#include "qemu/osdep.h"
#include "qemu/qemu-print.h"
+#include "qemu/ctype.h"
#include "qemu/log.h"
#include "cpu.h"
#include "exec/exec-all.h"
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 9b9b5f37fc..3c5c3f49d8 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -22,6 +22,7 @@
#include "libqtest.h"
#include "qemu-common.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "qapi/error.h"
#include "qapi/qmp/json-parser.h"
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index 5b771de7a3..0bb03af0e5 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -30,8 +30,8 @@
#define _FILE_OFFSET_BITS 64
#include "qemu/osdep.h"
-#include "qemu-common.h"
#include "qemu/atomic.h"
+#include "qemu/ctype.h"
#include "qemu/iov.h"
#include "standard-headers/linux/virtio_net.h"
#include "contrib/libvhost-user/libvhost-user.h"
diff --git a/ui/keymaps.c b/ui/keymaps.c
index 544b55c27b..38fd22ed2b 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -26,6 +26,7 @@
#include "keymaps.h"
#include "sysemu/sysemu.h"
#include "trace.h"
+#include "qemu/ctype.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "ui/input.h"
diff --git a/util/cutils.c b/util/cutils.c
index 9aacc422ca..53e4af59f8 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -21,14 +21,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
-#include "qemu-common.h"
#include "qemu/host-utils.h"
#include <math.h>
#include "qemu/sockets.h"
#include "qemu/iov.h"
#include "net/net.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
diff --git a/util/id.c b/util/id.c
index 6141352955..af1c5f1b81 100644
--- a/util/id.c
+++ b/util/id.c
@@ -11,7 +11,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/ctype.h"
#include "qemu/id.h"
bool id_wellformed(const char *id)
diff --git a/util/readline.c b/util/readline.c
index a7672b51c1..e534460da6 100644
--- a/util/readline.c
+++ b/util/readline.c
@@ -23,8 +23,8 @@
*/
#include "qemu/osdep.h"
-#include "qemu-common.h"
#include "qemu/readline.h"
+#include "qemu/ctype.h"
#include "qemu/cutils.h"
#define IS_NORM 0