mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +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;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virStrIsPrint(vendor)) {
|
if (!virStringIsPrintable(vendor)) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("disk vendor is not printable string"));
|
_("disk vendor is not printable string"));
|
||||||
goto error;
|
goto error;
|
||||||
@ -7175,7 +7175,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virStrIsPrint(product)) {
|
if (!virStringIsPrintable(product)) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("disk product is not printable string"));
|
_("disk product is not printable string"));
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -2265,6 +2265,7 @@ virStringFreeListCount;
|
|||||||
virStringGetFirstWithPrefix;
|
virStringGetFirstWithPrefix;
|
||||||
virStringHasControlChars;
|
virStringHasControlChars;
|
||||||
virStringIsEmpty;
|
virStringIsEmpty;
|
||||||
|
virStringIsPrintable;
|
||||||
virStringJoin;
|
virStringJoin;
|
||||||
virStringListLength;
|
virStringListLength;
|
||||||
virStringReplace;
|
virStringReplace;
|
||||||
@ -2478,7 +2479,6 @@ virSetNonBlock;
|
|||||||
virSetSockReuseAddr;
|
virSetSockReuseAddr;
|
||||||
virSetUIDGID;
|
virSetUIDGID;
|
||||||
virSetUIDGIDWithCaps;
|
virSetUIDGIDWithCaps;
|
||||||
virStrIsPrint;
|
|
||||||
virTristateBoolTypeFromString;
|
virTristateBoolTypeFromString;
|
||||||
virTristateBoolTypeToString;
|
virTristateBoolTypeToString;
|
||||||
virTristateSwitchTypeFromString;
|
virTristateSwitchTypeFromString;
|
||||||
|
@ -1048,3 +1048,21 @@ virStringToUpper(char **dst, const char *src)
|
|||||||
*dst = cap;
|
*dst = cap;
|
||||||
return 1;
|
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);
|
bool virStringHasControlChars(const char *str);
|
||||||
void virStringStripControlChars(char *str);
|
void virStringStripControlChars(char *str);
|
||||||
|
|
||||||
|
bool virStringIsPrintable(const char *str);
|
||||||
|
|
||||||
#endif /* __VIR_STRING_H__ */
|
#endif /* __VIR_STRING_H__ */
|
||||||
|
@ -1600,18 +1600,6 @@ virValidateWWN(const char *wwn)
|
|||||||
return true;
|
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)
|
#if defined(major) && defined(minor)
|
||||||
int
|
int
|
||||||
virGetDeviceID(const char *path, int *maj, int *min)
|
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 virValidateWWN(const char *wwn);
|
||||||
|
|
||||||
bool virStrIsPrint(const char *str);
|
|
||||||
|
|
||||||
int virGetDeviceID(const char *path,
|
int virGetDeviceID(const char *path,
|
||||||
int *maj,
|
int *maj,
|
||||||
int *min);
|
int *min);
|
||||||
|
Loading…
Reference in New Issue
Block a user