From 1df039994ff2368bc64ea4bc38d9261e6153437c Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 6 Feb 2026 22:08:39 +0100 Subject: libcnary: Define error codes and add cycle, depth, and parent guards --- libcnary/include/node.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libcnary/include/node.h') diff --git a/libcnary/include/node.h b/libcnary/include/node.h index 123241a..5b3ae37 100644 --- a/libcnary/include/node.h +++ b/libcnary/include/node.h @@ -29,6 +29,18 @@ #define NODE_TYPE 1; +#ifndef NODE_MAX_DEPTH +#define NODE_MAX_DEPTH 512 +#endif + +#define NODE_ERR_SUCCESS 0 +#define NODE_ERR_INVALID_ARG -1 +#define NODE_ERR_NO_MEM -2 +#define NODE_ERR_PARENT -3 +#define NODE_ERR_CIRCULAR_REF -4 +#define NODE_ERR_MAX_DEPTH -5 +#define NODE_ERR_NOT_FOUND -6 + // This class implements the abstract iterator class typedef struct node* node_t; struct node { -- cgit v1.1-32-gdbae