Index: trunk/src/libcschem/concrete.c =================================================================== --- trunk/src/libcschem/concrete.c (revision 2466) +++ trunk/src/libcschem/concrete.c (revision 2467) @@ -63,6 +63,7 @@ return ctype_names[typ]; } +static long next_uid; csch_sheet_t *csch_sheet_alloc(csch_project_t *parent) { @@ -70,6 +71,7 @@ csch_sheet_t *sheet = calloc(sizeof(csch_sheet_t), 1); sheet->parent = parent; + sheet->uid = next_uid++; htsp_init(&sheet->comm_str, strhash, strkeyeq); for(n = 0; n < CSCH_DSPLY_max; n++) Index: trunk/src/libcschem/concrete.h =================================================================== --- trunk/src/libcschem/concrete.h (revision 2466) +++ trunk/src/libcschem/concrete.h (revision 2467) @@ -175,6 +175,7 @@ struct csch_sheet_s { rnd_hidlib_t hidlib; csch_project_t *parent; + long uid; csch_rtree_t dsply[CSCH_DSPLY_max]; /* IDs in screen coords, per display layer */ csch_cgrp_t direct, indirect; /* a sheet is really made of groups to keep the code simple */ Index: trunk/src/libcschem/plug_library.c =================================================================== --- trunk/src/libcschem/plug_library.c (revision 2466) +++ trunk/src/libcschem/plug_library.c (revision 2467) @@ -39,6 +39,7 @@ #include "plug_library.h" static htsp_t lib_masters; +static int master_uids = 0; TODO("librnd: Use libualloc") @@ -195,6 +196,7 @@ res = calloc(sizeof(csch_lib_master_t), 1); res->name = rnd_strdup(name); + res->uid = master_uids++; htsp_init(&res->roots, strhash, strkeyeq); htsp_set(&lib_masters, res->name, res); return res; Index: trunk/src/libcschem/plug_library.h =================================================================== --- trunk/src/libcschem/plug_library.h (revision 2466) +++ trunk/src/libcschem/plug_library.h (revision 2467) @@ -87,6 +87,7 @@ typedef struct csch_lib_master_s { char *name; + int uid; htsp_t roots; /* realpath -> (csch_lib_t *) root dir */ vtp0_t backends; /* list of (csch_lib_backend_t *) as registered */ } csch_lib_master_t;