#include"scf_vector.h"
typedef struct ses_step_s ses_step_t;
+typedef struct ses_path_s ses_path_t;
typedef struct ses_edge_s ses_edge_t;
typedef struct ses_ctx_s ses_ctx_t;
ScfEpin* p1;
};
+#define SES_PATH_MAIN 0
+#define SES_PATH_BRANCH 1
+#define SES_PATH_BRIDGE 2
+
+struct ses_path_s
+{
+ scf_vector_t* pins;
+
+ scf_vector_t* childs;
+ ses_path_t* parent;
+
+ int type;
+};
+
struct ses_ctx_s
{
scf_vector_t* paths;
void* priv;
};
+ses_path_t* ses_path_alloc();
+void ses_path_free (ses_path_t* path);
ses_ctx_t* ses_ctx_alloc();
void ses_ctx_free (ses_ctx_t* ctx);
&ses_step_output,
};
+ses_path_t* ses_path_alloc()
+{
+ ses_path_t* path = calloc(1, sizeof(ses_path_t));
+ if (!path)
+ return NULL;
+
+ path->pins = scf_vector_alloc();
+ if (!path->pins) {
+ free(path);
+ return NULL;
+ }
+
+ return path;
+}
+
+void ses_path_free(ses_path_t* path)
+{
+ if (path) {
+ if (path->pins)
+ scf_vector_free(path->pins);
+
+ if (path->childs) {
+ scf_vector_clear(path->childs, ( void (*)(void*) )ses_path_free);
+ scf_vector_free (path->childs);
+ }
+
+ free(path);
+ }
+}
+
ses_ctx_t* ses_ctx_alloc()
{
ses_ctx_t* ctx = calloc(1, sizeof(ses_ctx_t));