/** * idmef_time_new_from_ntpstamp: * @time: Address where to store the created #idmef_time_t object. * @buf: Pointer to a string containing an NTP timestamp. * * Creates an #idmef_time_t object filled with information provided * from the @buf NTP timestamp, and stores it in @time. * * Returns: 0 on success, a negative value if an error occured. */ int idmef_time_new_from_ntpstamp(idmef_time_t **time, const char *buf) { int ret; libidmef_return_val_if_fail(buf, libidmef_error(LIBIDMEF_ERROR_ASSERTION)); ret = idmef_time_new(time); if ( ret < 0 ) return ret; ret = idmef_time_set_from_ntpstamp(*time, buf); if ( ret < 0 ) { free(*time); return ret; } return 0; }
/** * idmef_time_new_from_ntpstamp: * @time: Address where to store the created #idmef_time_t object. * @buf: Pointer to a string containing an NTP timestamp. * * Creates an #idmef_time_t object filled with information provided * from the @buf NTP timestamp, and stores it in @time. * * Returns: 0 on success, a negative value if an error occured. */ int idmef_time_new_from_ntpstamp(idmef_time_t **time, const char *buf) { int ret; prelude_return_val_if_fail(buf, prelude_error(PRELUDE_ERROR_ASSERTION)); ret = idmef_time_new(time); if ( ret < 0 ) return ret; ret = idmef_time_set_from_ntpstamp(*time, buf); if ( ret < 0 ) { free(*time); return ret; } return 0; }
/** * idmef_time_new_from_ntpstamp: * @time: Address where to store the created #idmef_time_t object. * @buf: Pointer to a string containing an NTP timestamp. * * Creates an #idmef_time_t object filled with information provided * from the @buf NTP timestamp, and stores it in @time. * * Returns: 0 on success, a negative value if an error occured. */ int idmef_time_new_from_ntpstamp(idmef_time_t **time, const char *buf) { int ret; requiem_return_val_if_fail(buf, requiem_error(REQUIEM_ERROR_ASSERTION)); ret = idmef_time_new(time); if ( ret < 0 ) return ret; ret = idmef_time_set_from_ntpstamp(*time, buf); if ( ret < 0 ) { free(*time); return ret; } return 0; }