cpu-exec: fix cpu_exec_nocache
[qemu/ar7.git] / util / id.c
blob09b22fb8fae04b3c13768d4dc3daad5c93c89e28
1 /*
2 * Dealing with identifiers
4 * Copyright (C) 2014 Red Hat, Inc.
6 * Authors:
7 * Markus Armbruster <armbru@redhat.com>,
9 * This work is licensed under the terms of the GNU LGPL, version 2.1
10 * or later. See the COPYING.LIB file in the top-level directory.
13 #include "qemu-common.h"
15 bool id_wellformed(const char *id)
17 int i;
19 if (!qemu_isalpha(id[0])) {
20 return false;
22 for (i = 1; id[i]; i++) {
23 if (!qemu_isalnum(id[i]) && !strchr("-._", id[i])) {
24 return false;
27 return true;