From 8d1ac98fd148c1bb838e8b12107c90f35a26e7ce Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 22 Feb 1995 08:51:34 +0000 Subject: [PATCH] Output function can be customized in fml, which is used to print the reply to reply_fd. --- kernel/Makefile | 8 ++++++-- kernel/main.c | 11 ++++++++++- kernel/urp.c | 13 ++++++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 231c015..280c748 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -2,7 +2,11 @@ # Europagate, 1995 # # $Log: Makefile,v $ -# Revision 1.6 1995/02/21 14:00:08 adam +# Revision 1.7 1995/02/22 08:51:34 adam +# Output function can be customized in fml, which is used to print +# the reply to reply_fd. +# +# Revision 1.6 1995/02/21 14:00:08 adam # Minor changes. # # Revision 1.5 1995/02/21 12:11:59 adam @@ -34,7 +38,7 @@ INCLUDE=-I../include CFLAGS=-g -Wall TPROG1=kernel O=main.o urp.o -CPP=cc -E +CPP=$(CC) -E USELIBS1=../lib/ccl.a ../lib/fml.a ../lib/libzass.a ../lib/libres+log.a \ ../lib/util.a $(ZLIB) DEFS=$(INCLUDE) -DUSE_FML=1 diff --git a/kernel/main.c b/kernel/main.c index a96b0f2..c87b9b1 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -2,7 +2,11 @@ * Europagate, 1995 * * $Log: main.c,v $ - * Revision 1.5 1995/02/20 21:16:20 adam + * Revision 1.6 1995/02/22 08:51:34 adam + * Output function can be customized in fml, which is used to print + * the reply to reply_fd. + * + * Revision 1.5 1995/02/20 21:16:20 adam * FML support. Bug fixes. Profile for drewdb. * * Revision 1.4 1995/02/17 17:06:16 adam @@ -158,6 +162,10 @@ int main (int argc, char **argv) return 0; } #if USE_FML +static void fml_inf_write (int ch) +{ + putc (ch, reply_fd); +} static FILE *fml_inf; static int fml_inf_read (void) @@ -288,6 +296,7 @@ void read_kernel_res (void) { info.fml = fml_open (); info.fml->read_func = fml_inf_read; + info.fml->write_func = fml_inf_write; fml_preprocess (info.fml); fml_exec (info.fml); fclose (fml_inf); diff --git a/kernel/urp.c b/kernel/urp.c index 2ec695a..196bd03 100644 --- a/kernel/urp.c +++ b/kernel/urp.c @@ -2,7 +2,11 @@ * Europagate, 1995 * * $Log: urp.c,v $ - * Revision 1.9 1995/02/21 17:46:21 adam + * Revision 1.10 1995/02/22 08:51:35 adam + * Output function can be customized in fml, which is used to print + * the reply to reply_fd. + * + * Revision 1.9 1995/02/21 17:46:21 adam * Minor changes. * * Revision 1.8 1995/02/21 12:12:00 adam @@ -330,6 +334,11 @@ static int exec_show (struct ccl_token *list) li = li->next->next; } } + if (!li->next) + { + fprintf (reply_fd, "%s\n", "Missing token after '='"); + return -2; + } li = li->next; } else @@ -421,6 +430,7 @@ static int exec_show (struct ccl_token *list) #endif fprintf (reply_fd, "--- %d/%d ---\n", i+offset, offset+zp->num-1); +#if 0 if (pp->which == ZASS_REC_DIAG) { fprintf (reply_fd, "Record error %d: %s\n", @@ -433,6 +443,7 @@ static int exec_show (struct ccl_token *list) pp->which); continue; } +#endif rec = iso2709_cvt (pp->record); #if USE_FML if (format_token) -- 1.7.10.4