Index: util/bxl2txt/Makefile.in =================================================================== --- util/bxl2txt/Makefile.in (revision 30723) +++ util/bxl2txt/Makefile.in (revision 30724) @@ -10,18 +10,23 @@ include $(LIBRND)/core/librnd.mak -all: bxl2txt$(LIBRND_EXE) +all: bxl2txt$(LIBRND_EXE) txt2bxl$(LIBRND_EXE) include ../../Makefile.conf bxl2txt$(LIBRND_EXE): bxl2txt.o bxl_decode.o -bxl_decode.o: $(PLUG)/bxl_decode.c $(PLUG)/bxl_decode.h - $(CC) -c $(CFLAGS) $(PLUG)/bxl_decode.c -o bxl_decode.o +txt2bxl$(LIBRND_EXE): txt2bxl.o bxl_decode.o +txt2bxl.o: txt2bxl.c $(PLUG)/bxl_decode.h + $(CC) -c $(CFLAGS) txt2bxl.c -o txt2bxl.o + bxl2txt.o: bxl2txt.c $(PLUG)/bxl_decode.h $(CC) -c $(CFLAGS) bxl2txt.c -o bxl2txt.o +bxl_decode.o: $(PLUG)/bxl_decode.c $(PLUG)/bxl_decode.h + $(CC) -c $(CFLAGS) $(PLUG)/bxl_decode.c -o bxl_decode.o + install_all: $(SCCBOX) mkdir -p "$(BINDIR)" $(SCCBOX) $(HOW) "bxl2txt$(LIBRND_EXE)" "$(BINDIR)/bxl2txt$(LIBRND_EXE)" Index: util/bxl2txt/txt2bxl.c =================================================================== --- util/bxl2txt/txt2bxl.c (nonexistent) +++ util/bxl2txt/txt2bxl.c (revision 30724) @@ -0,0 +1,49 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * + * BXL IO plugin - file format write, encoder + * pcb-rnd Copyright (C) 2020 Tibor 'Igor2' Palinkas + * (Supported by NLnet NGI0 PET Fund in 2020) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; 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/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +/* test program: read plain text on stdin, encode to bxl on stdout (without the length header) */ + +#include +#include "bxl_decode.h" + +int main() +{ + hdecode_t ctx; + int inch; + + pcb_bxl_encode_init(&ctx); + + while((inch = fgetc(stdin)) != EOF) { + int n, len; + len = pcb_bxl_encode_char(&ctx, inch); + for(n = 0; n < len; n++) + printf("%c", ctx.out[n]); + } + return 0; +}