main.c 461B

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