types.h
header#include "/package/prog/prjlibs/include/types.h" { type_len len=str_len("foo"); type_bool empty=(len==0); type_fd fd=open("path", O_RDONLY); type_status status=fcntl(fd, F_SETFD, FD_CLOEXEC); type_error error=errno; type_signal sig=SIGTERM; }
The types.h
C header file defines meaningful aliases for
commonly used types.
type_len
is an alias for unsigned
int
, when it is used to represent a length, like
size_t
.
type_bool
is an alias for
unsigned int
, when it is used to represent a Boolean
flag.
type_fd
is an alias for int
,
when it is used to represent a file descriptor.
type_status
is an alias for
int
, when it is used to represent a zero-for-success,
nonzero-for-error status.
type_error
is an alias for
int
, when it is used to represent an error code.
type_signal
is an alias for
int
, when it is used to represent a signal number.