mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
util: Rename and move virStrIsPrint to virStringIsPrintable
This commit is contained in:
parent
1ee1b58fc3
commit
dcf02a704f
@ -7160,7 +7160,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!virStrIsPrint(vendor)) {
|
||||
if (!virStringIsPrintable(vendor)) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("disk vendor is not printable string"));
|
||||
goto error;
|
||||
@ -7175,7 +7175,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!virStrIsPrint(product)) {
|
||||
if (!virStringIsPrintable(product)) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("disk product is not printable string"));
|
||||
goto error;
|
||||
|
@ -2265,6 +2265,7 @@ virStringFreeListCount;
|
||||
virStringGetFirstWithPrefix;
|
||||
virStringHasControlChars;
|
||||
virStringIsEmpty;
|
||||
virStringIsPrintable;
|
||||
virStringJoin;
|
||||
virStringListLength;
|
||||
virStringReplace;
|
||||
@ -2478,7 +2479,6 @@ virSetNonBlock;
|
||||
virSetSockReuseAddr;
|
||||
virSetUIDGID;
|
||||
virSetUIDGIDWithCaps;
|
||||
virStrIsPrint;
|
||||
virTristateBoolTypeFromString;
|
||||
virTristateBoolTypeToString;
|
||||
virTristateSwitchTypeFromString;
|
||||
|
@ -1048,3 +1048,21 @@ virStringToUpper(char **dst, const char *src)
|
||||
*dst = cap;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virStringIsPrintable:
|
||||
*
|
||||
* Returns true @str contains only printable characters.
|
||||
*/
|
||||
bool
|
||||
virStringIsPrintable(const char *str)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; str[i]; i++)
|
||||
if (!c_isprint(str[i]))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -275,4 +275,6 @@ void virStringStripIPv6Brackets(char *str);
|
||||
bool virStringHasControlChars(const char *str);
|
||||
void virStringStripControlChars(char *str);
|
||||
|
||||
bool virStringIsPrintable(const char *str);
|
||||
|
||||
#endif /* __VIR_STRING_H__ */
|
||||
|
@ -1600,18 +1600,6 @@ virValidateWWN(const char *wwn)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
virStrIsPrint(const char *str)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; str[i]; i++)
|
||||
if (!c_isprint(str[i]))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(major) && defined(minor)
|
||||
int
|
||||
virGetDeviceID(const char *path, int *maj, int *min)
|
||||
|
@ -152,8 +152,6 @@ bool virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);
|
||||
|
||||
bool virValidateWWN(const char *wwn);
|
||||
|
||||
bool virStrIsPrint(const char *str);
|
||||
|
||||
int virGetDeviceID(const char *path,
|
||||
int *maj,
|
||||
int *min);
|
||||
|
Loading…
x
Reference in New Issue
Block a user