main.c 611B

123456789101112131415161718192021222324252627
  1. #include "light.h"
  2. #include "helpers.h"
  3. //#include <stdio.h>
  4. #define LIGHT_RETURNVAL_INITFAIL 2
  5. #define LIGHT_RETURNVAL_EXECFAIL 1
  6. #define LIGHT_RETURNVAL_SUCCESS 0
  7. int main(int argc, char **argv)
  8. {
  9. light_context_t *light_ctx = light_initialize(argc, argv);
  10. if (light_ctx == NULL) {
  11. LIGHT_ERR("Initialization failed");
  12. return LIGHT_RETURNVAL_INITFAIL;
  13. }
  14. if (!light_execute(light_ctx)) {
  15. LIGHT_ERR("Execution failed");
  16. light_free(light_ctx);
  17. return LIGHT_RETURNVAL_EXECFAIL;
  18. }
  19. light_free(light_ctx);
  20. return LIGHT_RETURNVAL_SUCCESS;
  21. }