提交 dcf02a70 编写于 作者: P Peter Krempa

util: Rename and move virStrIsPrint to virStringIsPrintable

上级 1ee1b58f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册