X-Git-Url: http://git.droids-corp.org/?p=protos%2Flibecoli.git;a=blobdiff_plain;f=lib%2Fecoli_node.h;h=9bf459dd3a82f77abf84177a3a2987a82f99ba1e;hp=6fede5978f0556e7c5fd13fdbe8ace0bb433c346;hb=1d655de6043b607f39888c1bb88f72d071f2d49a;hpb=2be188c2858fa975d6b2ba3f91405d260d3c5b75 diff --git a/lib/ecoli_node.h b/lib/ecoli_node.h index 6fede59..9bf459d 100644 --- a/lib/ecoli_node.h +++ b/lib/ecoli_node.h @@ -132,6 +132,14 @@ const struct ec_node_type *ec_node_type_lookup(const char *name); */ void ec_node_type_dump(FILE *out); +enum ec_node_free_state { + EC_NODE_FREE_STATE_NONE, + EC_NODE_FREE_STATE_TRAVERSED, + EC_NODE_FREE_STATE_FREEABLE, + EC_NODE_FREE_STATE_NOT_FREEABLE, + EC_NODE_FREE_STATE_FREEING, +}; + struct ec_node { const struct ec_node_type *type; struct ec_config *config; /**< Generic configuration. */ @@ -139,6 +147,11 @@ struct ec_node { char *desc; struct ec_keyval *attrs; unsigned int refcnt; + struct { + enum ec_node_free_state state; /**< State of loop detection */ + unsigned int refcnt; /**< Number of reachable references + * starting from node beeing freed */ + } free; /**< Freeing state: used for loop detection */ }; /* create a new node when the type is known, typically called from the node