// vim:fileencoding=utf-8:foldmethod=marker

#ifndef COMMANDER_OUTPUT_H
#define COMMANDER_OUTPUT_H

#include "../../../common/aliases/aliases.h"
#include "../../../common/platform/platform.h"
#include "../../../common/misc/misc_utils.h"

#ifdef WP_PLATFORM_CPP
BEGIN_C_LINKAGE
#endif // !WP_PLATFORM_CPP

typedef enum {
	WP_SHELL_OUTPUT_DISCARD,
	WP_SHELL_OUTPUT_PRINT,
	WP_SHELL_OUTPUT_CAPTURE,
} WpCmdOutHandling;

typedef enum {
	WP_SHELL_ERR_NO_ERROR,
	WP_SHELL_ERR_INVALID_ARGS,
	WP_SHELL_ERR_ALLOCATION_FAIL,
	WP_SHELL_ERR_PROC_START_FAIL,
	WP_SHELL_ERR_OUT_BUF_FULL,
	WP_SHELL_ERR_PROC_EXIT_FAIL,
} WpCmdError;

typedef struct WpCmdResult WpCmdResult;
struct WpCmdResult {
	i32 exit_code;
	WpCmdError error;
	b8 exited;

	wpMiscUtilsReservePadding(sizeof(b8) + sizeof(i32) + sizeof(WpCmdError));
};

#ifdef WP_PLATFORM_CPP
END_C_LINKAGE
#endif // !WP_PLATFORM_CPP

#endif // !COMMANDER_OUTPUT_H
