24 #include <winpr/string.h>
26 BOOL state_run_failed(state_run_t status)
30 case STATE_RUN_FAILED:
31 case STATE_RUN_QUIT_SESSION:
38 BOOL state_run_success(state_run_t status)
40 if (status == STATE_RUN_CONTINUE)
42 return status >= STATE_RUN_SUCCESS;
45 const char* state_run_result_string(state_run_t status,
char* buffer,
size_t buffersize)
47 const char* name = NULL;
51 case STATE_RUN_ACTIVE:
52 name =
"STATE_RUN_ACTIVE";
54 case STATE_RUN_REDIRECT:
55 name =
"STATE_RUN_REDIRECT";
57 case STATE_RUN_SUCCESS:
58 name =
"STATE_RUN_SUCCESS";
60 case STATE_RUN_FAILED:
61 name =
"STATE_RUN_FAILED";
63 case STATE_RUN_QUIT_SESSION:
64 name =
"STATE_RUN_QUIT_SESSION";
66 case STATE_RUN_TRY_AGAIN:
67 name =
"STATE_RUN_TRY_AGAIN";
69 case STATE_RUN_CONTINUE:
70 name =
"STATE_RUN_CONTINUE";
73 name =
"STATE_RUN_UNKNOWN";
77 (void)_snprintf(buffer, buffersize,
"%s [%d]", name, status);
81 BOOL state_run_continue(state_run_t status)
83 return (status == STATE_RUN_TRY_AGAIN) || (status == STATE_RUN_CONTINUE) ||
84 (status == STATE_RUN_ACTIVE);