QEMU main repository: Please see https://www.qemu.org/docs/master/devel/submitting-a-patch.html for how to submit changes to QEMU. Pull Requests are ignored. Please only use release tarballs from the QEMU website. http://www.qemu.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
560 B
28 lines
560 B
/*
|
|
* Dealing with identifiers
|
|
*
|
|
* Copyright (C) 2014 Red Hat, Inc.
|
|
*
|
|
* Authors:
|
|
* Markus Armbruster <armbru@redhat.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 "qemu-common.h"
|
|
|
|
bool id_wellformed(const char *id)
|
|
{
|
|
int i;
|
|
|
|
if (!qemu_isalpha(id[0])) {
|
|
return false;
|
|
}
|
|
for (i = 1; id[i]; i++) {
|
|
if (!qemu_isalnum(id[i]) && !strchr("-._", id[i])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|