#ifndef RESULTS_H #define RESULTS_H typedef enum { OK, ERR_INVALID_STATE, ERR_NO_MEM, ERR_SIZE, ERR_LIQUID, ERR_SYSCALL // a syscall failed. Use errno to determine the cause. } result_t; #ifdef DEBUG_LIQUID #include # define ERR_CHECK_LIQUID(call) \ do { \ liquid_error_code result; \ if((result = (call)) != LIQUID_OK) { \ fprintf(stderr, "Liquid call failed in %s:%d: %s\n", __FILE__, __LINE__, liquid_error_info(result)); \ return ERR_LIQUID; \ } \ } while(0); #else # define ERR_CHECK_LIQUID(call) if((call) != LIQUID_OK) { return ERR_LIQUID; } #endif #endif // RESULTS_H