Index: trunk/src/libcschem/Makefile.in =================================================================== --- trunk/src/libcschem/Makefile.in (revision 685) +++ trunk/src/libcschem/Makefile.in (revision 686) @@ -4,6 +4,7 @@ include {template/cc.tmpasm} put /local/csch/OBJS [@ + abstract.o attrib.o buildin.o compat.o Index: trunk/src/libcschem/abstract.c =================================================================== --- trunk/src/libcschem/abstract.c (nonexistent) +++ trunk/src/libcschem/abstract.c (revision 686) @@ -0,0 +1,55 @@ +/* + * COPYRIGHT + * + * cschem - modular/flexible schematics editor - libcschem (core library) + * Copyright (C) 2019 Tibor 'Igor2' Palinkas + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version.* + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contact: + * Project page: http://repo.hu/projects/cschem + * lead developer: email to cschem (at) igor2.repo.hu + * mailing list: cschem (at) list.repo.hu (send "subscribe") + */ + +#include "config.h" + +#include +#include +#include + +#include "abstract.h" +#include "compat.h" + +void csch_abstract_init(csch_abstract_t *abs) +{ + memset(abs, 0, sizeof(csch_abstract_t)); + htsp_init(&abs->nets, strhash, strkeyeq); +} + +csch_anet_t *csch_anet_get(csch_abstract_t *abs, const char *netname, int alloc) +{ + csch_anet_t *net; + + net = htsp_get(&abs->nets, netname); + if ((net != NULL) || (!alloc)) + return net; + + net = calloc(sizeof(csch_anet_t), 1); + net->netname = csch_strdup(netname); + htsp_set(&abs->nets, net->netname, net); + return net; +} + Index: trunk/src/libcschem/abstract.h =================================================================== --- trunk/src/libcschem/abstract.h (revision 685) +++ trunk/src/libcschem/abstract.h (revision 686) @@ -24,6 +24,9 @@ * mailing list: cschem (at) list.repo.hu (send "subscribe") */ +#ifndef CSCH_ABSTRACT_H +#define CSCH_ABSTRACT_H + #include #include @@ -115,6 +118,10 @@ } csch_ahub_t; +/*** abs ***/ +void csch_abstract_init(csch_abstract_t *abs); + /*** net ***/ csch_anet_t *csch_anet_get(csch_abstract_t *abs, const char *netname, int alloc); +#endif Index: trunk/src/libcschem/compile.h =================================================================== --- trunk/src/libcschem/compile.h (revision 685) +++ trunk/src/libcschem/compile.h (revision 686) @@ -23,3 +23,13 @@ * lead developer: email to cschem (at) igor2.repo.hu * mailing list: cschem (at) list.repo.hu (send "subscribe") */ + +#ifndef CSCH_COMPILE_H +#define CSCH_COMPILE_H + +#include +#include + +int csch_compile_sheet(csch_abstract_t *dst, const csch_sheet_t *src); + +#endif