46#ifndef PINK26_STATUS_H
47#define PINK26_STATUS_H
53#define P26_THREAD_LOCAL __declspec(thread)
55#define P26_THREAD_LOCAL _Thread_local
64#if defined(__GNUC__) || defined(__clang__)
65#define P26_PRINTF_LIKE(fmt_index, args_index) \
66 __attribute__((format(printf, fmt_index, args_index)))
68#define P26_PRINTF_LIKE(fmt_index, args_index)
p26_status
Result of a pink26 function.
Definition status.h:75
@ P26_E_FORMAT
Malformed or truncated file content.
Definition status.h:80
@ P26_E_UNSUPPORTED
Valid input that pink26 does not handle (e.g.
Definition status.h:81
@ P26_E_IO
A file could not be opened, read, written or closed.
Definition status.h:82
@ P26_E_TYPE
Unknown or unsupported pixel type.
Definition status.h:78
@ P26_E_NOMEM
Memory allocation failed.
Definition status.h:79
@ P26_E_OVERFLOW
A size does not fit in memory or in the integer types.
Definition status.h:83
@ P26_OK
Success.
Definition status.h:76
@ P26_E_INTERNAL
Admitted legacy Pink code aborted (a former exit() call).
Definition status.h:84
@ P26_E_INVALID_ARG
NULL pointer, bad dimension, bad connectivity...
Definition status.h:77
p26_status const char * p26_last_error(void)
Returns the last message recorded by p26_fail() in the calling thread.
int64_t p26_index
Pixel index or size in pixels (64-bit, so large 3D images fit).
Definition status.h:72
void p26_clear_error(void)
Empties the error message of the calling thread.
p26_status p26_fail(p26_status status, const char *format,...) P26_PRINTF_LIKE(2
Records an error message for the calling thread and returns status.
const char * p26_status_name(p26_status status)
Returns the name of a status code, e.g.
#define P26_PRINTF_LIKE(fmt_index, args_index)
Portability switch: marks a printf-like function so that GCC and Clang check its format string agains...
Definition status.h:68