/* * Constructs new condition for timeout check. This function is invoked by * 'cnd_new()' in order to perform class specific initialization. * * parameter: cnd - Pointer to condition passed by 'cnd_new()'. * ap - Pointer to user supplied arguments list for this * constructor. * returns: Pointer to condition - Construction was successful. * NULL - Construction failed. */ static condition* _cnd_constr_timeout(condition* cnd, va_list ap) { cnd_timeout_dat *data = NULL; /* allocate memory */ if((data = (cnd_timeout_dat*)g_malloc(sizeof(cnd_timeout_dat))) == NULL) return NULL; /* initialize user data */ data->start_time = time(NULL); data->timeout_s = va_arg(ap, gint32); cnd_set_user_data(cnd, (void*)data); return cnd; } /* END _cnd_constr_timeout() */
/* * Constructs new condition for capturesize check. This function is invoked by * 'cnd_new()' in order to perform class specific initialization. * * parameter: cnd - Pointer to condition passed by 'cnd_new()'. * ap - Pointer to user supplied arguments list for this * constructor. * returns: Pointer to condition - Construction was successful. * NULL - Construction failed. */ static condition* _cnd_constr_capturesize(condition* cnd, va_list ap){ cnd_capturesize_dat *data = NULL; /* allocate memory */ if((data = (cnd_capturesize_dat*)g_malloc(sizeof(cnd_capturesize_dat))) == NULL) return NULL; /* initialize user data */ data->max_capture_size = va_arg(ap, guint64); if (data->max_capture_size > ((guint64)INT_MAX + 1)) data->max_capture_size = (guint64)INT_MAX + 1; cnd_set_user_data(cnd, (void*)data); return cnd; } /* END _cnd_constr_capturesize() */