diff --git a/CMakeLists.txt b/CMakeLists.txt index 75380fe..944dee9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ set (SRC_FILES src/internal.c src/threadpool.c include/pandio/threadpool.h + include/pandio/err.h ) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") diff --git a/include/pandio/err.h b/include/pandio/err.h new file mode 100644 index 0000000..a71b922 --- /dev/null +++ b/include/pandio/err.h @@ -0,0 +1,800 @@ +/* Auto generated file */ +#include + +#ifdef EPERM +#define PD_EPERM (-EPERM) +#else +#define PD_EPERM (-1) +#endif + +#ifdef ENOENT +#define PD_ENOENT (-ENOENT) +#else +#define PD_ENOENT (-2) +#endif + +#ifdef ESRCH +#define PD_ESRCH (-ESRCH) +#else +#define PD_ESRCH (-3) +#endif + +#ifdef EINTR +#define PD_EINTR (-EINTR) +#else +#define PD_EINTR (-4) +#endif + +#ifdef EIO +#define PD_EIO (-EIO) +#else +#define PD_EIO (-5) +#endif + +#ifdef ENXIO +#define PD_ENXIO (-ENXIO) +#else +#define PD_ENXIO (-6) +#endif + +#ifdef E2BIG +#define PD_E2BIG (-E2BIG) +#else +#define PD_E2BIG (-7) +#endif + +#ifdef ENOEXEC +#define PD_ENOEXEC (-ENOEXEC) +#else +#define PD_ENOEXEC (-8) +#endif + +#ifdef EBADF +#define PD_EBADF (-EBADF) +#else +#define PD_EBADF (-9) +#endif + +#ifdef ECHILD +#define PD_ECHILD (-ECHILD) +#else +#define PD_ECHILD (-10) +#endif + +#ifdef EAGAIN +#define PD_EAGAIN (-EAGAIN) +#else +#define PD_EAGAIN (-11) +#endif + +#ifdef ENOMEM +#define PD_ENOMEM (-ENOMEM) +#else +#define PD_ENOMEM (-12) +#endif + +#ifdef EACCES +#define PD_EACCES (-EACCES) +#else +#define PD_EACCES (-13) +#endif + +#ifdef EFAULT +#define PD_EFAULT (-EFAULT) +#else +#define PD_EFAULT (-14) +#endif + +#ifdef ENOTBLK +#define PD_ENOTBLK (-ENOTBLK) +#else +#define PD_ENOTBLK (-15) +#endif + +#ifdef EBUSY +#define PD_EBUSY (-EBUSY) +#else +#define PD_EBUSY (-16) +#endif + +#ifdef EEXIST +#define PD_EEXIST (-EEXIST) +#else +#define PD_EEXIST (-17) +#endif + +#ifdef EXDEV +#define PD_EXDEV (-EXDEV) +#else +#define PD_EXDEV (-18) +#endif + +#ifdef ENODEV +#define PD_ENODEV (-ENODEV) +#else +#define PD_ENODEV (-19) +#endif + +#ifdef ENOTDIR +#define PD_ENOTDIR (-ENOTDIR) +#else +#define PD_ENOTDIR (-20) +#endif + +#ifdef EISDIR +#define PD_EISDIR (-EISDIR) +#else +#define PD_EISDIR (-21) +#endif + +#ifdef EINVAL +#define PD_EINVAL (-EINVAL) +#else +#define PD_EINVAL (-22) +#endif + +#ifdef ENFILE +#define PD_ENFILE (-ENFILE) +#else +#define PD_ENFILE (-23) +#endif + +#ifdef EMFILE +#define PD_EMFILE (-EMFILE) +#else +#define PD_EMFILE (-24) +#endif + +#ifdef ENOTTY +#define PD_ENOTTY (-ENOTTY) +#else +#define PD_ENOTTY (-25) +#endif + +#ifdef ETXTBSY +#define PD_ETXTBSY (-ETXTBSY) +#else +#define PD_ETXTBSY (-26) +#endif + +#ifdef EFBIG +#define PD_EFBIG (-EFBIG) +#else +#define PD_EFBIG (-27) +#endif + +#ifdef ENOSPC +#define PD_ENOSPC (-ENOSPC) +#else +#define PD_ENOSPC (-28) +#endif + +#ifdef ESPIPE +#define PD_ESPIPE (-ESPIPE) +#else +#define PD_ESPIPE (-29) +#endif + +#ifdef EROFS +#define PD_EROFS (-EROFS) +#else +#define PD_EROFS (-30) +#endif + +#ifdef EMLINK +#define PD_EMLINK (-EMLINK) +#else +#define PD_EMLINK (-31) +#endif + +#ifdef EPIPE +#define PD_EPIPE (-EPIPE) +#else +#define PD_EPIPE (-32) +#endif + +#ifdef EDOM +#define PD_EDOM (-EDOM) +#else +#define PD_EDOM (-33) +#endif + +#ifdef ERANGE +#define PD_ERANGE (-ERANGE) +#else +#define PD_ERANGE (-34) +#endif + +#ifdef EDEADLK +#define PD_EDEADLK (-EDEADLK) +#else +#define PD_EDEADLK (-35) +#endif + +#ifdef ENAMETOOLONG +#define PD_ENAMETOOLONG (-ENAMETOOLONG) +#else +#define PD_ENAMETOOLONG (-36) +#endif + +#ifdef ENOLCK +#define PD_ENOLCK (-ENOLCK) +#else +#define PD_ENOLCK (-37) +#endif + +#ifdef ENOSYS +#define PD_ENOSYS (-ENOSYS) +#else +#define PD_ENOSYS (-38) +#endif + +#ifdef ENOTEMPTY +#define PD_ENOTEMPTY (-ENOTEMPTY) +#else +#define PD_ENOTEMPTY (-39) +#endif + +#ifdef ELOOP +#define PD_ELOOP (-ELOOP) +#else +#define PD_ELOOP (-40) +#endif + +#ifdef EWOULDBLOCK +#define PD_EWOULDBLOCK (-EWOULDBLOCK) +#else +#define PD_EWOULDBLOCK (-11) +#endif + +#ifdef ENOMSG +#define PD_ENOMSG (-ENOMSG) +#else +#define PD_ENOMSG (-42) +#endif + +#ifdef EIDRM +#define PD_EIDRM (-EIDRM) +#else +#define PD_EIDRM (-43) +#endif + +#ifdef ECHRNG +#define PD_ECHRNG (-ECHRNG) +#else +#define PD_ECHRNG (-44) +#endif + +#ifdef EL2NSYNC +#define PD_EL2NSYNC (-EL2NSYNC) +#else +#define PD_EL2NSYNC (-45) +#endif + +#ifdef EL3HLT +#define PD_EL3HLT (-EL3HLT) +#else +#define PD_EL3HLT (-46) +#endif + +#ifdef EL3RST +#define PD_EL3RST (-EL3RST) +#else +#define PD_EL3RST (-47) +#endif + +#ifdef ELNRNG +#define PD_ELNRNG (-ELNRNG) +#else +#define PD_ELNRNG (-48) +#endif + +#ifdef EUNATCH +#define PD_EUNATCH (-EUNATCH) +#else +#define PD_EUNATCH (-49) +#endif + +#ifdef ENOCSI +#define PD_ENOCSI (-ENOCSI) +#else +#define PD_ENOCSI (-50) +#endif + +#ifdef EL2HLT +#define PD_EL2HLT (-EL2HLT) +#else +#define PD_EL2HLT (-51) +#endif + +#ifdef EBADE +#define PD_EBADE (-EBADE) +#else +#define PD_EBADE (-52) +#endif + +#ifdef EBADR +#define PD_EBADR (-EBADR) +#else +#define PD_EBADR (-53) +#endif + +#ifdef EXFULL +#define PD_EXFULL (-EXFULL) +#else +#define PD_EXFULL (-54) +#endif + +#ifdef ENOANO +#define PD_ENOANO (-ENOANO) +#else +#define PD_ENOANO (-55) +#endif + +#ifdef EBADRQC +#define PD_EBADRQC (-EBADRQC) +#else +#define PD_EBADRQC (-56) +#endif + +#ifdef EBADSLT +#define PD_EBADSLT (-EBADSLT) +#else +#define PD_EBADSLT (-57) +#endif + +#ifdef EDEADLOCK +#define PD_EDEADLOCK (-EDEADLOCK) +#else +#define PD_EDEADLOCK (-35) +#endif + +#ifdef EBFONT +#define PD_EBFONT (-EBFONT) +#else +#define PD_EBFONT (-59) +#endif + +#ifdef ENOSTR +#define PD_ENOSTR (-ENOSTR) +#else +#define PD_ENOSTR (-60) +#endif + +#ifdef ENODATA +#define PD_ENODATA (-ENODATA) +#else +#define PD_ENODATA (-61) +#endif + +#ifdef ETIME +#define PD_ETIME (-ETIME) +#else +#define PD_ETIME (-62) +#endif + +#ifdef ENOSR +#define PD_ENOSR (-ENOSR) +#else +#define PD_ENOSR (-63) +#endif + +#ifdef ENONET +#define PD_ENONET (-ENONET) +#else +#define PD_ENONET (-64) +#endif + +#ifdef ENOPKG +#define PD_ENOPKG (-ENOPKG) +#else +#define PD_ENOPKG (-65) +#endif + +#ifdef EREMOTE +#define PD_EREMOTE (-EREMOTE) +#else +#define PD_EREMOTE (-66) +#endif + +#ifdef ENOLINK +#define PD_ENOLINK (-ENOLINK) +#else +#define PD_ENOLINK (-67) +#endif + +#ifdef EADV +#define PD_EADV (-EADV) +#else +#define PD_EADV (-68) +#endif + +#ifdef ESRMNT +#define PD_ESRMNT (-ESRMNT) +#else +#define PD_ESRMNT (-69) +#endif + +#ifdef ECOMM +#define PD_ECOMM (-ECOMM) +#else +#define PD_ECOMM (-70) +#endif + +#ifdef EPROTO +#define PD_EPROTO (-EPROTO) +#else +#define PD_EPROTO (-71) +#endif + +#ifdef EMULTIHOP +#define PD_EMULTIHOP (-EMULTIHOP) +#else +#define PD_EMULTIHOP (-72) +#endif + +#ifdef EDOTDOT +#define PD_EDOTDOT (-EDOTDOT) +#else +#define PD_EDOTDOT (-73) +#endif + +#ifdef EBADMSG +#define PD_EBADMSG (-EBADMSG) +#else +#define PD_EBADMSG (-74) +#endif + +#ifdef EOVERFLOW +#define PD_EOVERFLOW (-EOVERFLOW) +#else +#define PD_EOVERFLOW (-75) +#endif + +#ifdef ENOTUNIQ +#define PD_ENOTUNIQ (-ENOTUNIQ) +#else +#define PD_ENOTUNIQ (-76) +#endif + +#ifdef EBADFD +#define PD_EBADFD (-EBADFD) +#else +#define PD_EBADFD (-77) +#endif + +#ifdef EREMCHG +#define PD_EREMCHG (-EREMCHG) +#else +#define PD_EREMCHG (-78) +#endif + +#ifdef ELIBACC +#define PD_ELIBACC (-ELIBACC) +#else +#define PD_ELIBACC (-79) +#endif + +#ifdef ELIBBAD +#define PD_ELIBBAD (-ELIBBAD) +#else +#define PD_ELIBBAD (-80) +#endif + +#ifdef ELIBSCN +#define PD_ELIBSCN (-ELIBSCN) +#else +#define PD_ELIBSCN (-81) +#endif + +#ifdef ELIBMAX +#define PD_ELIBMAX (-ELIBMAX) +#else +#define PD_ELIBMAX (-82) +#endif + +#ifdef ELIBEXEC +#define PD_ELIBEXEC (-ELIBEXEC) +#else +#define PD_ELIBEXEC (-83) +#endif + +#ifdef EILSEQ +#define PD_EILSEQ (-EILSEQ) +#else +#define PD_EILSEQ (-84) +#endif + +#ifdef ERESTART +#define PD_ERESTART (-ERESTART) +#else +#define PD_ERESTART (-85) +#endif + +#ifdef ESTRPIPE +#define PD_ESTRPIPE (-ESTRPIPE) +#else +#define PD_ESTRPIPE (-86) +#endif + +#ifdef EUSERS +#define PD_EUSERS (-EUSERS) +#else +#define PD_EUSERS (-87) +#endif + +#ifdef ENOTSOCK +#define PD_ENOTSOCK (-ENOTSOCK) +#else +#define PD_ENOTSOCK (-88) +#endif + +#ifdef EDESTADDRREQ +#define PD_EDESTADDRREQ (-EDESTADDRREQ) +#else +#define PD_EDESTADDRREQ (-89) +#endif + +#ifdef EMSGSIZE +#define PD_EMSGSIZE (-EMSGSIZE) +#else +#define PD_EMSGSIZE (-90) +#endif + +#ifdef EPROTOTYPE +#define PD_EPROTOTYPE (-EPROTOTYPE) +#else +#define PD_EPROTOTYPE (-91) +#endif + +#ifdef ENOPROTOOPT +#define PD_ENOPROTOOPT (-ENOPROTOOPT) +#else +#define PD_ENOPROTOOPT (-92) +#endif + +#ifdef EPROTONOSUPPORT +#define PD_EPROTONOSUPPORT (-EPROTONOSUPPORT) +#else +#define PD_EPROTONOSUPPORT (-93) +#endif + +#ifdef ESOCKTNOSUPPORT +#define PD_ESOCKTNOSUPPORT (-ESOCKTNOSUPPORT) +#else +#define PD_ESOCKTNOSUPPORT (-94) +#endif + +#ifdef EOPNOTSUPP +#define PD_EOPNOTSUPP (-EOPNOTSUPP) +#else +#define PD_EOPNOTSUPP (-95) +#endif + +#ifdef EPFNOSUPPORT +#define PD_EPFNOSUPPORT (-EPFNOSUPPORT) +#else +#define PD_EPFNOSUPPORT (-96) +#endif + +#ifdef EAFNOSUPPORT +#define PD_EAFNOSUPPORT (-EAFNOSUPPORT) +#else +#define PD_EAFNOSUPPORT (-97) +#endif + +#ifdef EADDRINUSE +#define PD_EADDRINUSE (-EADDRINUSE) +#else +#define PD_EADDRINUSE (-98) +#endif + +#ifdef EADDRNOTAVAIL +#define PD_EADDRNOTAVAIL (-EADDRNOTAVAIL) +#else +#define PD_EADDRNOTAVAIL (-99) +#endif + +#ifdef ENETDOWN +#define PD_ENETDOWN (-ENETDOWN) +#else +#define PD_ENETDOWN (-100) +#endif + +#ifdef ENETUNREACH +#define PD_ENETUNREACH (-ENETUNREACH) +#else +#define PD_ENETUNREACH (-101) +#endif + +#ifdef ENETRESET +#define PD_ENETRESET (-ENETRESET) +#else +#define PD_ENETRESET (-102) +#endif + +#ifdef ECONNABORTED +#define PD_ECONNABORTED (-ECONNABORTED) +#else +#define PD_ECONNABORTED (-103) +#endif + +#ifdef ECONNRESET +#define PD_ECONNRESET (-ECONNRESET) +#else +#define PD_ECONNRESET (-104) +#endif + +#ifdef ENOBUFS +#define PD_ENOBUFS (-ENOBUFS) +#else +#define PD_ENOBUFS (-105) +#endif + +#ifdef EISCONN +#define PD_EISCONN (-EISCONN) +#else +#define PD_EISCONN (-106) +#endif + +#ifdef ENOTCONN +#define PD_ENOTCONN (-ENOTCONN) +#else +#define PD_ENOTCONN (-107) +#endif + +#ifdef ESHUTDOWN +#define PD_ESHUTDOWN (-ESHUTDOWN) +#else +#define PD_ESHUTDOWN (-108) +#endif + +#ifdef ETOOMANYREFS +#define PD_ETOOMANYREFS (-ETOOMANYREFS) +#else +#define PD_ETOOMANYREFS (-109) +#endif + +#ifdef ETIMEDOUT +#define PD_ETIMEDOUT (-ETIMEDOUT) +#else +#define PD_ETIMEDOUT (-110) +#endif + +#ifdef ECONNREFUSED +#define PD_ECONNREFUSED (-ECONNREFUSED) +#else +#define PD_ECONNREFUSED (-111) +#endif + +#ifdef EHOSTDOWN +#define PD_EHOSTDOWN (-EHOSTDOWN) +#else +#define PD_EHOSTDOWN (-112) +#endif + +#ifdef EHOSTUNREACH +#define PD_EHOSTUNREACH (-EHOSTUNREACH) +#else +#define PD_EHOSTUNREACH (-113) +#endif + +#ifdef EALREADY +#define PD_EALREADY (-EALREADY) +#else +#define PD_EALREADY (-114) +#endif + +#ifdef EINPROGRESS +#define PD_EINPROGRESS (-EINPROGRESS) +#else +#define PD_EINPROGRESS (-115) +#endif + +#ifdef ESTALE +#define PD_ESTALE (-ESTALE) +#else +#define PD_ESTALE (-116) +#endif + +#ifdef EUCLEAN +#define PD_EUCLEAN (-EUCLEAN) +#else +#define PD_EUCLEAN (-117) +#endif + +#ifdef ENOTNAM +#define PD_ENOTNAM (-ENOTNAM) +#else +#define PD_ENOTNAM (-118) +#endif + +#ifdef ENAVAIL +#define PD_ENAVAIL (-ENAVAIL) +#else +#define PD_ENAVAIL (-119) +#endif + +#ifdef EISNAM +#define PD_EISNAM (-EISNAM) +#else +#define PD_EISNAM (-120) +#endif + +#ifdef EREMOTEIO +#define PD_EREMOTEIO (-EREMOTEIO) +#else +#define PD_EREMOTEIO (-121) +#endif + +#ifdef EDQUOT +#define PD_EDQUOT (-EDQUOT) +#else +#define PD_EDQUOT (-122) +#endif + +#ifdef ENOMEDIUM +#define PD_ENOMEDIUM (-ENOMEDIUM) +#else +#define PD_ENOMEDIUM (-123) +#endif + +#ifdef EMEDIUMTYPE +#define PD_EMEDIUMTYPE (-EMEDIUMTYPE) +#else +#define PD_EMEDIUMTYPE (-124) +#endif + +#ifdef ECANCELED +#define PD_ECANCELED (-ECANCELED) +#else +#define PD_ECANCELED (-125) +#endif + +#ifdef ENOKEY +#define PD_ENOKEY (-ENOKEY) +#else +#define PD_ENOKEY (-126) +#endif + +#ifdef EKEYEXPIRED +#define PD_EKEYEXPIRED (-EKEYEXPIRED) +#else +#define PD_EKEYEXPIRED (-127) +#endif + +#ifdef EKEYREVOKED +#define PD_EKEYREVOKED (-EKEYREVOKED) +#else +#define PD_EKEYREVOKED (-128) +#endif + +#ifdef EKEYREJECTED +#define PD_EKEYREJECTED (-EKEYREJECTED) +#else +#define PD_EKEYREJECTED (-129) +#endif + +#ifdef EOWNERDEAD +#define PD_EOWNERDEAD (-EOWNERDEAD) +#else +#define PD_EOWNERDEAD (-130) +#endif + +#ifdef ENOTRECOVERABLE +#define PD_ENOTRECOVERABLE (-ENOTRECOVERABLE) +#else +#define PD_ENOTRECOVERABLE (-131) +#endif + +#ifdef ERFKILL +#define PD_ERFKILL (-ERFKILL) +#else +#define PD_ERFKILL (-132) +#endif + +#ifdef EHWPOISON +#define PD_EHWPOISON (-EHWPOISON) +#else +#define PD_EHWPOISON (-133) +#endif diff --git a/scripts/errors.mjs b/scripts/errors.mjs new file mode 100644 index 0000000..ccfc519 --- /dev/null +++ b/scripts/errors.mjs @@ -0,0 +1,146 @@ +import { writeFileSync } from 'fs'; + +const errcodes = { + 'EPERM': 1, // Operation not permitted + 'ENOENT': 2, // No such file or directory + 'ESRCH': 3, // No such process + 'EINTR': 4, // Interrupted system call + 'EIO': 5, // I/O error + 'ENXIO': 6, // No such device or address + 'E2BIG': 7, // Argument list too long + 'ENOEXEC': 8, // Exec format error + 'EBADF': 9, // Bad file number + 'ECHILD': 10, // No child processes + 'EAGAIN': 11, // Try again + 'ENOMEM': 12, // Out of memory + 'EACCES': 13, // Permission denied + 'EFAULT': 14, // Bad address + 'ENOTBLK': 15, // Block device required + 'EBUSY': 16, // Device or resource busy + 'EEXIST': 17, // File exists + 'EXDEV': 18, // Cross-device link + 'ENODEV': 19, // No such device + 'ENOTDIR': 20, // Not a directory + 'EISDIR': 21, // Is a directory + 'EINVAL': 22, // Invalid argument + 'ENFILE': 23, // File table overflow + 'EMFILE': 24, // Too many open files + 'ENOTTY': 25, // Not a typewriter + 'ETXTBSY': 26, // Text file busy + 'EFBIG': 27, // File too large + 'ENOSPC': 28, // No space left on device + 'ESPIPE': 29, // Illegal seek + 'EROFS': 30, // Read-only file system + 'EMLINK': 31, // Too many links + 'EPIPE': 32, // Broken pipe + 'EDOM': 33, // Math argument out of domain of func + 'ERANGE': 34, // Math result not representable + 'EDEADLK': 35, // Resource deadlock would occur + 'ENAMETOOLONG': 36, // File name too long + 'ENOLCK': 37, // No record locks available + 'ENOSYS': 38, // Function not implemented + 'ENOTEMPTY': 39, // Directory not empty + 'ELOOP': 40, // Too many symbolic links encountered + 'EWOULDBLOCK': 11, // Operation would block (same as EAGAIN) + 'ENOMSG': 42, // No message of desired type + 'EIDRM': 43, // Identifier removed + 'ECHRNG': 44, // Channel number out of range + 'EL2NSYNC': 45, // Level 2 not synchronized + 'EL3HLT': 46, // Level 3 halted + 'EL3RST': 47, // Level 3 reset + 'ELNRNG': 48, // Link number out of range + 'EUNATCH': 49, // Protocol driver not attached + 'ENOCSI': 50, // No CSI structure available + 'EL2HLT': 51, // Level 2 halted + 'EBADE': 52, // Invalid exchange + 'EBADR': 53, // Invalid request descriptor + 'EXFULL': 54, // Exchange full + 'ENOANO': 55, // No anode + 'EBADRQC': 56, // Invalid request code + 'EBADSLT': 57, // Invalid slot + 'EDEADLOCK': 35, // Resource deadlock would occur (same as EDEADLK) + 'EBFONT': 59, // Bad font file format + 'ENOSTR': 60, // Device not a stream + 'ENODATA': 61, // No data available + 'ETIME': 62, // Timer expired + 'ENOSR': 63, // Out of streams resources + 'ENONET': 64, // Machine is not on the network + 'ENOPKG': 65, // Package not installed + 'EREMOTE': 66, // Object is remote + 'ENOLINK': 67, // Link has been severed + 'EADV': 68, // Advertise error + 'ESRMNT': 69, // Srmount error + 'ECOMM': 70, // Communication error on send + 'EPROTO': 71, // Protocol error + 'EMULTIHOP': 72, // Multihop attempted + 'EDOTDOT': 73, // RFS specific error + 'EBADMSG': 74, // Not a data message + 'EOVERFLOW': 75, // Value too large for defined data type + 'ENOTUNIQ': 76, // Name not unique on network + 'EBADFD': 77, // File descriptor in bad state + 'EREMCHG': 78, // Remote address changed + 'ELIBACC': 79, // Can not access a needed shared library + 'ELIBBAD': 80, // Accessing a corrupted shared library + 'ELIBSCN': 81, // .lib section in a.out corrupted + 'ELIBMAX': 82, // Attempting to link in too many shared libraries + 'ELIBEXEC': 83, // Cannot exec a shared library directly + 'EILSEQ': 84, // Illegal byte sequence + 'ERESTART': 85, // Interrupted system call should be restarted + 'ESTRPIPE': 86, // Streams pipe error + 'EUSERS': 87, // Too many users + 'ENOTSOCK': 88, // Socket operation on non-socket + 'EDESTADDRREQ': 89, // Destination address required + 'EMSGSIZE': 90, // Message too long + 'EPROTOTYPE': 91, // Protocol wrong type for socket + 'ENOPROTOOPT': 92, // Protocol not available + 'EPROTONOSUPPORT': 93, // Protocol not supported + 'ESOCKTNOSUPPORT': 94, // Socket type not supported + 'EOPNOTSUPP': 95, // Operation not supported on transport endpoint + 'EPFNOSUPPORT': 96, // Protocol family not supported + 'EAFNOSUPPORT': 97, // Address family not supported by protocol + 'EADDRINUSE': 98, // Address already in use + 'EADDRNOTAVAIL': 99, // Cannot assign requested address + 'ENETDOWN': 100, // Network is down + 'ENETUNREACH': 101, // Network is unreachable + 'ENETRESET': 102, // Network dropped connection because of reset + 'ECONNABORTED': 103, // Software caused connection abort + 'ECONNRESET': 104, // Connection reset by peer + 'ENOBUFS': 105, // No buffer space available + 'EISCONN': 106, // Transport endpoint is already connected + 'ENOTCONN': 107, // Transport endpoint is not connected + 'ESHUTDOWN': 108, // Cannot send after transport endpoint shutdown + 'ETOOMANYREFS': 109, // Too many references: cannot splice + 'ETIMEDOUT': 110, // Connection timed out + 'ECONNREFUSED': 111, // Connection refused + 'EHOSTDOWN': 112, // Host is down + 'EHOSTUNREACH': 113, // No route to host + 'EALREADY': 114, // Operation already in progress + 'EINPROGRESS': 115, // Operation now in progress + 'ESTALE': 116, // Stale file handle + 'EUCLEAN': 117, // Structure needs cleaning + 'ENOTNAM': 118, // Not a XENIX named type file + 'ENAVAIL': 119, // No XENIX semaphores available + 'EISNAM': 120, // Is a named type file + 'EREMOTEIO': 121, // Remote I/O error + 'EDQUOT': 122, // Quota exceeded + 'ENOMEDIUM': 123, // No medium found + 'EMEDIUMTYPE': 124, // Wrong medium type + 'ECANCELED': 125, // Operation Canceled + 'ENOKEY': 126, // Required key not available + 'EKEYEXPIRED': 127, // Key has expired + 'EKEYREVOKED': 128, // Key has been revoked + 'EKEYREJECTED': 129, // Key was rejected by service + 'EOWNERDEAD': 130, // Owner died + 'ENOTRECOVERABLE': 131, // State not recoverable + 'ERFKILL': 132, // Operation not possible due to RF-kill + 'EHWPOISON': 133 // Memory page has hardware error +}; + +let file = "/* Auto generated file */\n#include \n"; + +for (const [code, value] of Object.entries(errcodes)) { + file += `\n#ifdef ${code}\n#define PD_${code} (-${code})\n#else\n#define PD_${code} (-${value})\n#endif\n`; +} + +// run this script from the root of the project +writeFileSync("./include/pandio/err.h", file, { encoding: "utf8" }); diff --git a/src/sys/notifier_unix.c b/src/sys/notifier_unix.c index 2d5b316..dd0b4dc 100644 --- a/src/sys/notifier_unix.c +++ b/src/sys/notifier_unix.c @@ -19,7 +19,7 @@ * SOFTWARE. */ -#include "../../include/pandio/core.h" +#include "pandio/core.h" #include "internal.h" #include