diff options
author | Markus Armbruster <armbru@redhat.com> | 2019-05-23 16:35:06 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2019-06-11 20:22:09 +0200 |
commit | 856dfd8a035e42cd96ca823f1cbbd18d332e2f84 (patch) | |
tree | 408d7b4c400bf2a8957eb8fe3521644cf3663d37 | |
parent | 14a48c1d0d687735c76880e59bcede6e99871ded (diff) | |
download | qemu-856dfd8a035e42cd96ca823f1cbbd18d332e2f84.zip qemu-856dfd8a035e42cd96ca823f1cbbd18d332e2f84.tar.gz qemu-856dfd8a035e42cd96ca823f1cbbd18d332e2f84.tar.bz2 |
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.c | 1 | ||||
-rw-r--r-- | block/vvfat.c | 1 | ||||
-rw-r--r-- | gdbstub.c | 2 | ||||
-rw-r--r-- | hw/core/bus.c | 2 | ||||
-rw-r--r-- | hw/core/qdev-properties.c | 1 | ||||
-rw-r--r-- | hw/s390x/s390-virtio-ccw.c | 1 | ||||
-rw-r--r-- | hw/scsi/scsi-generic.c | 2 | ||||
-rw-r--r-- | include/qemu-common.h | 16 | ||||
-rw-r--r-- | include/qemu/ctype.h | 27 | ||||
-rw-r--r-- | monitor.c | 1 | ||||
-rw-r--r-- | net/net.c | 1 | ||||
-rw-r--r-- | net/tap-solaris.c | 1 | ||||
-rw-r--r-- | qapi/qapi-util.c | 2 | ||||
-rw-r--r-- | qobject/json-parser.c | 2 | ||||
-rw-r--r-- | target/ppc/monitor.c | 2 | ||||
-rw-r--r-- | target/riscv/cpu.c | 1 | ||||
-rw-r--r-- | tests/libqtest.c | 1 | ||||
-rw-r--r-- | tests/vhost-user-bridge.c | 2 | ||||
-rw-r--r-- | ui/keymaps.c | 1 | ||||
-rw-r--r-- | util/cutils.c | 3 | ||||
-rw-r--r-- | util/id.c | 2 | ||||
-rw-r--r-- | util/readline.c | 2 |
22 files changed, 50 insertions, 24 deletions
diff --git a/block/ssh.c b/block/ssh.c index 12fd4f3..584c302 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 253cc71..f6c2880 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" @@ -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 e09843f..60c4720 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 5da1439..81c97f4 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 4d64368..87b2039 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 d82b462..e8a8706 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 d7f4a4e..9b01f6e 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 0000000..3691f09 --- /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 @@ -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" @@ -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 a2a9235..0e3f3e0 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 e9b266b..29a6c98 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 d8eb210..7d23e12 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 ee9d6e8..7f8360d 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 86fd869..6f2b644 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 9b9b5f3..3c5c3f4 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 5b771de..0bb03af 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 544b55c..38fd22e 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 9aacc42..53e4af5 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" @@ -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 a7672b5..e534460 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 |