mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-12-04 14:46:31 -05:00
Feature: Added igloo_instance_validate()
This commit is contained in:
parent
3b68465b67
commit
aad572fe38
@ -113,6 +113,19 @@ igloo_objecthandler_t * igloo_instance_get_logger(igloo_ro_t self);
|
||||
*/
|
||||
igloo_error_t igloo_instance_log(igloo_ro_t self, igloo_ro_t msg);
|
||||
|
||||
/* Validate an instance.
|
||||
*
|
||||
* Note: This is very useful when a instance is passed from a user to a library.
|
||||
*
|
||||
* Parameters:
|
||||
* self
|
||||
* An instance to validate.
|
||||
* Returns:
|
||||
* igloo_ERROR_NONE if self is a valid instance, or error code otherwise.
|
||||
*/
|
||||
igloo_error_t igloo_instance_validate_raw(igloo_ro_t self);
|
||||
#define igloo_instance_validate(x) igloo_instance_validate_raw((x))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -241,3 +241,12 @@ igloo_error_t igloo_instance_log(igloo_ro_t self, igloo_ro_t msg)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
igloo_error_t igloo_instance_validate_raw(igloo_ro_t self)
|
||||
{
|
||||
if (igloo_RO_IS_VALID(self, igloo_instance_t)) {
|
||||
return igloo_ERROR_NONE;
|
||||
} else {
|
||||
return igloo_ERROR_GENERIC;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user