I particularly am looking into:
// in lib
pub const STATUS_SIGNALS = enum(u8) {
EXIT_SUCCESS = 0,
EXIT_FAILURE = 1,
EXIT_TIMEDOUT = 124, // Time expired before child completed.
EXIT_CANCELED = 125, // Internal error prior to exec attempt.
EXIT_CANNOT_INVOKE = 126, // Program located, but not usable.
EXIT_ENOENT = 127, // Could not find program to exec.
pub fn exit(self: STATUS_SIGNALS) u8 {
// some code before exit ...
std.posix.exit(@intFromEnum(self));
}
};
// in program
const TTY_STATUS_SIGNALS = enum(u8) {
// also note the repeating value here
TTY_STDIN_NOTTY = 1,
TTY_FAILURE = 2,
TTY_WRITE_ERROR = 3,
};
Im also open to other options, but im still curious about title.
I dont actually think its posible with enums.
Also note the repeating value 1.