diff -cprP metahtml-5.03/ANNOUNCE-5.04 metahtml-5.04/ANNOUNCE-5.04
*** metahtml-5.03/ANNOUNCE-5.04 Wed Dec 31 16:00:00 1969
--- metahtml-5.04/ANNOUNCE-5.04 Sat Jun 21 12:56:08 1997
***************
*** 0 ****
--- 1,100 ----
+
+ Meta-HTML 5.03 Source Release
+
+ Version 5.03 of the Meta-HTML Web Language distribution is now
+ available for download from:
+
+ http://www.metahtml.com/download
+
+ It should be available from prep.ai.mit.edu, and other GNU mirror
+ sites within the next two weeks.
+
+ ------------------------------------------------------------
+
+ What is it?
+
+ Meta-HTML is a programming language specifically designed for working
+ within the World Wide Web environment. Although it is a genuine
+ programming language, suitable for large-scale symbolic manipulation,
+ it provides the most commonly wanted Web functionality as built-in
+ primitives, so you don't have to write them. You can find out more
+ about the theory of implementation in this white paper
+ [http://www.metahtml.com/documentation/manifesto.html].
+
+ Web pages are authored using HTML and Meta-HTML statements freely
+ intermixed. When a page is requested by a browser, the page is passed
+ through the Meta-HTML interpreter, which dynamically processes any
+ Meta-HTML statements to produce a final HTML page that is delivered
+ to the browser.
+
+ The source distribution provides several different interpreter options:
+
+ * A CGI engine which can be run by any Unix Web server,
+ * A FastCGI engine which can be run under FastCGI compliant servers,
+ * A full-featured Web server (mhttpd) with the interpreter built in,
+ * A standalone processor, much like Perl or Tcl, and
+ * An interactive debugger, with a feel similar to GDB (mdb)
+
+ ------------------------------------------------------------
+
+ Meta-HTML Changes in 5.03 from 5.02
+
+ * All reported bugs have been fixed. I'm happy to say that
+ just haven't been many bugs reported!
+
+ * The server is now able to perform DNS caching -- this should
+ improve request response time for sites that have client name
+ resolution turned on (the default). It is controlled by
+ a variable in the server config file.
+
+ * A new set of documented array operators, including:
+ array-append, array-member, array-size, array-add-unique,
+ array-shift, array-concat, foreach, and a new "sort"
+ function.
+
+ * Complete support for mSQL 2.x as well as mSQL 1.x. Many
+ bugs were found and fixed in this code.
+
+ * Improvements to various functions, documentation for same.
+ Specifically, cgi-exec, sort, with-open-stream, stream-get,
+ page-debug, system-error-output, and debugging-output have
+ all improved.
+
+ * Dynamically loaded modules allow C language extensions to be
+ added to the running Meta-HTML interpreter. Several useful
+ examples are included.
+
+ * FastCGI support for all platforms now built automatically.
+
+ * Better configuration mechanism allows compilation on many
+ more machine/OS's than before.
+
+ * Again, more and improved documentation.
+
+ * More control over cookie manipulation and session IDs.
+
+ * The ability to include binary representations of Meta-HTML
+ source code directly in the compiled Engine, Server,
+ Debugger, and Standalone Processor. See libmhtml/bootstrap.mhtml.
+
+ ------------------------------------------------------------
+
+ E-Mail Addresses and URLs
+
+ Bug reports for Meta-HTML should be sent to bug-metahtml@metahtml.com.
+ Bug reports for the documentation should be sent to bug-manual@metahtml.com.
+
+ There is a user mailing list: metahtml-users@metahtml.com. You can
+ subscribe on the Web [http://www.metahtml.com/E-Mail/], or by
+ sending mail to metahtml-users-request@metahtml.com.
+
+ ------------------------------------------------------------
+
+ Authors and Maintenance
+
+ Meta-HTML was designed and implemented by Brian J. Fox (bfox@ai.mit.edu).
+ Meta-HTML is owned by Universal Access Inc., and is released under
+ terms nearly identical to the GPL. The code and utilities are
+ maintained by Brian J. Fox and Jarlath O' Carroll at Universal Access
+ Inc.
+ ------------------------------------------------------------
diff -cprP metahtml-5.03/Makefile.in metahtml-5.04/Makefile.in
*** metahtml-5.03/Makefile.in Fri Jun 13 07:51:49 1997
--- metahtml-5.04/Makefile.in Sat Jun 21 12:55:07 1997
***************
*** 30,36 ****
# The version number of this package.
PACKNAME= metahtml
! PACKVER = 5.03
# Items that were filled in by configure.
VPATH = @srcdir@
--- 30,36 ----
# The version number of this package.
PACKNAME= metahtml
! PACKVER = 5.04
# Items that were filled in by configure.
VPATH = @srcdir@
diff -cprP metahtml-5.03/README.download metahtml-5.04/README.download
*** metahtml-5.03/README.download Tue May 20 05:56:49 1997
--- metahtml-5.04/README.download Sun Jun 22 12:58:47 1997
***************
*** 1,7 ****
Meta-HTML
Copyright 1995, 1996 Brian J. Fox
! Copyright 1996, Universal Access Inc.
Written by Brian J. Fox (bfox@ua.com)
This is the README file for various Meta-HTML binary distributions.
--- 1,7 ----
Meta-HTML
Copyright 1995, 1996 Brian J. Fox
! Copyright 1996, 1997, Universal Access Inc.
Written by Brian J. Fox (bfox@ua.com)
This is the README file for various Meta-HTML binary distributions.
*************** General Instructions for Installation
*** 10,19 ****
-------------------------------------
There are distribution specific instructions located in the
! directories Server, Engine, and Processor. You may have only one of
! these directories if you elected to obtain only the Server, Engine, or
! Stand-Alone Processor, or, you may have all of them if you received
! the Meta-HTML Suite distribution.
Installing Your First Web Server:
--- 10,16 ----
-------------------------------------
There are distribution specific instructions located in the
! directories `server', `engine', and `mhc'.
Installing Your First Web Server:
*************** Installing Your First Web Server:
*** 48,55 ****
4) Copy "release" to /docs/.
(cp -r release /usr/www/docs/)
! 5) Copy "server/conf/*" to /conf.
! (cp -r server/conf/* /usr/www/conf/)
6) Create the file "/conf/identity.local", and place
the following Meta-HTML commands in it to tell the server
--- 45,52 ----
4) Copy "release" to /docs/.
(cp -r release /usr/www/docs/)
! 5) Copy "server/conf" to /conf.
! (cp -r server/conf /usr/www/conf)
6) Create the file "/conf/identity.local", and place
the following Meta-HTML commands in it to tell the server
*************** Installing the Meta-HTML CGI Engine:
*** 109,115 ****
on-line documentation discussing the specifics of server
configuration:
! http://www.metahtml.com/meta-html/manual/install.mhtml
Installing the Meta-HTML Stand-Alone Processor:
--- 106,112 ----
on-line documentation discussing the specifics of server
configuration:
! http://www.metahtml.com/documentation/manual/install.mhtml
Installing the Meta-HTML Stand-Alone Processor:
diff -cprP metahtml-5.03/engine/Makefile.in metahtml-5.04/engine/Makefile.in
*** metahtml-5.03/engine/Makefile.in Thu Jun 12 09:31:09 1997
--- metahtml-5.04/engine/Makefile.in Tue Jun 24 13:22:14 1997
***************
*** 1,4 ****
! # Makefile.in: -*- Text -*- Source for configure to make a Makefile from.
#
# Author: Brian J. Fox (bfox@ai.mit.edu).
# This file is part of (tm), a system for the rapid deployment
--- 1,4 ----
! 93# Makefile.in: -*- Text -*- Source for configure to make a Makefile from.
#
# Author: Brian J. Fox (bfox@ai.mit.edu).
# This file is part of (tm), a system for the rapid deployment
*************** FCGI_ENGINE = nph-fcgi-engine$(EXE)
*** 90,96 ****
PROGS = $(ENGINE) $(ISP_ENGINE) $(FCGI_ENGINE)
REQLIBS = $(LIBTIMESTAMP) $(LIBREGISTER) $(LIBMHTML) \
$(LIBUTILS) $(LIBSERVER) $(LIBSSL)
!
TARGETS = $(PROGS)
.c.o:
--- 90,96 ----
PROGS = $(ENGINE) $(ISP_ENGINE) $(FCGI_ENGINE)
REQLIBS = $(LIBTIMESTAMP) $(LIBREGISTER) $(LIBMHTML) \
$(LIBUTILS) $(LIBSERVER) $(LIBSSL)
!
TARGETS = $(PROGS)
.c.o:
diff -cprP metahtml-5.03/install-site metahtml-5.04/install-site
*** metahtml-5.03/install-site Fri Jun 20 12:17:33 1997
--- metahtml-5.04/install-site Sat Jun 21 15:18:43 1997
*************** echo "Okay, we are about to install the
*** 204,210 ****
echo ""
echo "|---------------------------------------------------------------------|"
echo "| Please check the following locations, and make sure that they are |"
! echo "| correct. If you are happy with the locations, type \"yes\" as |"
echo "| your answer. ANYTHING ELSE means that you aren't ready, or need |"
echo "| to change the values that you have entered. |"
echo "|---------------------------------------------------------------------|"
--- 204,210 ----
echo ""
echo "|---------------------------------------------------------------------|"
echo "| Please check the following locations, and make sure that they are |"
! echo "| correct. If you are happy with the locations, type \"yes\" as |"
echo "| your answer. ANYTHING ELSE means that you aren't ready, or need |"
echo "| to change the values that you have entered. |"
echo "|---------------------------------------------------------------------|"
*************** echo "done."
*** 310,316 ****
if [ ! -d PowerStrip ]; then
if [ -d ./doc ]; then
${ECHO_N} " Installing the documentation...${ECHO_C}"
! cp -r ./doc ${docdir}/release/5.03/documentation
echo "done."
fi
fi
--- 310,316 ----
if [ ! -d PowerStrip ]; then
if [ -d ./doc ]; then
${ECHO_N} " Installing the documentation...${ECHO_C}"
! cp -r ./doc ${docdir}/release/5.04/documentation
echo "done."
fi
fi
diff -cprP metahtml-5.03/libmhtml/Makefile.in metahtml-5.04/libmhtml/Makefile.in
*** metahtml-5.03/libmhtml/Makefile.in Fri Jun 20 21:23:43 1997
--- metahtml-5.04/libmhtml/Makefile.in Mon Jun 23 18:36:17 1997
*************** LIB_OBJS = symbols.o forms.o pages.o pag
*** 104,115 ****
$(MSQLFUNCS_O) $(CRYPTFUNCS_O) prims.o symdump.o cgi-exec.o \
require.o parser.o initfuncs.o sessionfuncs.o dbmfuncs.o \
rewriter.o $(MODFUNCS_O) lockname.o bootstrapper.o \
! bootstrapcode.o dbmfuncs.o cleaner.o arrayfuncs.o
XFUNCFILES = $(MSQLFUNCS_O) $(CRYPTFUNCS_O) $(MODFUNCS_O)
FUNCFILES = simplefuncs.o pagefuncs.o streamfuncs.o dbfuncs.o filefuncs.o \
prims.o cgi-exec.o require.o sessionfuncs.o $(XFUNCFILES) \
! dbmfuncs.o rewriter.o cleaner.o arrayfuncs.o
T=tagsets
STANDARD_TAGS = \
$(T)/characters.mhtml $(T)/dirfuns.mhtml $(T)/dump-package.mhtml \
--- 104,115 ----
$(MSQLFUNCS_O) $(CRYPTFUNCS_O) prims.o symdump.o cgi-exec.o \
require.o parser.o initfuncs.o sessionfuncs.o dbmfuncs.o \
rewriter.o $(MODFUNCS_O) lockname.o bootstrapper.o \
! bootstrapcode.o dbmfuncs.o cleaner.o arrayfuncs.o flowfuncs.o
XFUNCFILES = $(MSQLFUNCS_O) $(CRYPTFUNCS_O) $(MODFUNCS_O)
FUNCFILES = simplefuncs.o pagefuncs.o streamfuncs.o dbfuncs.o filefuncs.o \
prims.o cgi-exec.o require.o sessionfuncs.o $(XFUNCFILES) \
! dbmfuncs.o rewriter.o cleaner.o arrayfuncs.o flowfuncs.o
T=tagsets
STANDARD_TAGS = \
$(T)/characters.mhtml $(T)/dirfuns.mhtml $(T)/dump-package.mhtml \
*************** bootstrapcode.o: bootstrapcode.c bootstr
*** 158,164 ****
bootstrap.lib: bootstrap.mhtml $(STANDARD_TAGS)
@if [ -x ../mhc/mhc ]; then \
! ../mhc/mhc ../utilities/mklib -o bootstrap.lib bootstrap.mhtml; \
else \
(\
echo ""; \
--- 158,164 ----
bootstrap.lib: bootstrap.mhtml $(STANDARD_TAGS)
@if [ -x ../mhc/mhc ]; then \
! ../mhc/mhc -z ../utilities/mklib -o bootstrap.lib bootstrap.mhtml; \
else \
(\
echo ""; \
diff -cprP metahtml-5.03/libmhtml/arrayfuncs.c metahtml-5.04/libmhtml/arrayfuncs.c
*** metahtml-5.03/libmhtml/arrayfuncs.c Fri Jun 20 21:01:55 1997
--- metahtml-5.04/libmhtml/arrayfuncs.c Sat Jun 21 13:02:08 1997
*************** pf_array_shift (PFunArgs)
*** 278,284 ****
xfree (start_var);
}
! /* body
Perform body with ELEMENTVAR bound to successive memebers of
ARRAYVAR, starting with the element at START (default 0), and
ending at END (default ). */
--- 278,284 ----
xfree (start_var);
}
! /* body
Perform body with ELEMENTVAR bound to successive memebers of
ARRAYVAR, starting with the element at START (default 0), and
ending at END (default ). */
*************** pf_foreach (PFunArgs)
*** 342,360 ****
((start_index > end_index) && (i >= end_index)));
i += step)
{
- char *result;
Symbol *element = symbol_remove (element_var);
symbol_free (element);
element = symbol_intern (element_var);
symbol_add_value (element, array->values[i]);
! result = mhtml_evaluate_string (body->buffer);
! if (result != (char *)NULL)
{
! bprintf_insert (page, start, "%s", result);
! start += strlen (result);
! free (result);
}
}
}
--- 342,368 ----
((start_index > end_index) && (i >= end_index)));
i += step)
{
Symbol *element = symbol_remove (element_var);
+ PAGE *code;
symbol_free (element);
element = symbol_intern (element_var);
symbol_add_value (element, array->values[i]);
! code = page_copy_page (body);
! page_process_page_internal (code);
! if (code != (PAGE *)NULL)
{
! int broken = (code->attachment != (void *)NULL);
!
! if (code->bindex != 0)
! {
! bprintf_insert (page, start, "%s", code->buffer);
! start += (code->bindex);
! }
!
! page_free_page (code);
! if (broken) break;
}
}
}
Binary files metahtml-5.03/libmhtml/bootstrap.lib and metahtml-5.04/libmhtml/bootstrap.lib differ
diff -cprP metahtml-5.03/libmhtml/flowfuncs.c metahtml-5.04/libmhtml/flowfuncs.c
*** metahtml-5.03/libmhtml/flowfuncs.c Wed Dec 31 16:00:00 1969
--- metahtml-5.04/libmhtml/flowfuncs.c Sat Jun 21 13:52:02 1997
***************
*** 0 ****
--- 1,342 ----
+ /* flowfuncs.c: -*- C -*- Flow control functions for Meta-HTML */
+
+ /* Copyright (c) 1997 Brian J. Fox
+ Author: Brian J. Fox (bfox@ai.mit.edu) Sat Jun 21 12:02:48 1997.
+
+ This file is part of (tm), a system for the rapid deployment
+ of Internet and Intranet applications via the use of the Meta-HTML
+ language.
+
+ Copyright (c) 1995, 1996, Brian J. Fox (bfox@ai.mit.edu).
+ Copyright (c) 1996, Universal Access Inc. (http://www.ua.com).
+
+ Meta-HTML is free software; you can redistribute it and/or modify
+ it under the terms of the UAI Free Software License as published
+ by Universal Access Inc.; either version 1, 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
+ UAI Free Software License for more details.
+
+ You should have received a copy of the UAI Free Software License
+ along with this program; if you have not, you may obtain one by
+ writing to:
+
+ Universal Access Inc.
+ 129 El Paseo Court
+ Santa Barbara, CA
+ 93101 */
+
+ #include "language.h"
+
+ /************************************************************/
+ /* */
+ /* Flow Control Functions */
+ /* */
+ /************************************************************/
+
+ /* If eval (test) produces non-zero length text, then... */
+ static void pf_if (PFunArgs);
+
+ /* If eval (this) = eval (that), then, else */
+ static void pf_ifeq (PFunArgs);
+
+ /* body */
+ static void pf_when (PFunArgs);
+
+ /* Do-this where == THAT. */
+ static void pf_var_case (PFunArgs);
+
+ /* body-text ... Do BODY-TEXT while TEST
+ produces non-zero length text. */
+ #define PAGE_ITERATOR_MAX_COUNT 500 /* No more than this many times. */
+ static void pf_while (PFunArgs);
+
+ /* Only valid inside of or . */
+ static void pf_break (PFunArgs);
+
+ /*
+ > --> 1
+ --> hello */
+ static void pf_with (PFunArgs);
+
+ static PFunDesc func_table[] =
+ {
+ { "IF", 0, 0, pf_if },
+ { "IFEQ", 0, 0, pf_ifeq },
+ { "WHEN", 1, 0, pf_when },
+ { "VAR-CASE", 0, 0, pf_var_case },
+ { "WHILE", 1, 0, pf_while },
+ { "BREAK", 0, 0, pf_break },
+ { "WITH", 1, 0, pf_with },
+
+ { (char *)NULL, 0, 0, (PFunHandler *)NULL }
+ };
+
+ PACKAGE_INITIALIZER (initialize_flowfunc_functions)
+
+ void
+ initialize_flowfunc_functions (Package *package)
+ {
+ register int i;
+ Symbol *sym;
+
+ for (i = 0; func_table[i].tag != (char *)NULL; i++)
+ {
+ sym = symbol_intern_in_package (package, func_table[i].tag);
+ sym->type = symtype_FUNCTION;
+ sym->values = (char **)(&func_table[i]);
+ }
+ }
+
+ static void
+ pf_if (PFunArgs)
+ {
+ char *test_clause = mhtml_evaluate_string (get_positional_arg (vars, 0));
+ char *then_clause = get_positional_arg (vars, 1);
+ char *else_clause = get_positional_arg (vars, 2);
+ char *consequence;
+
+ if (!empty_string_p (test_clause))
+ consequence = then_clause;
+ else
+ consequence = else_clause;
+
+ if (consequence != (char *)NULL)
+ bprintf_insert (page, start, "%s", consequence);
+
+ xfree (test_clause);
+ }
+
+ static void
+ pf_ifeq (PFunArgs)
+ {
+ char *left_clause = mhtml_evaluate_string (get_positional_arg (vars, 0));
+ char *right_clause = mhtml_evaluate_string (get_positional_arg (vars, 1));
+ char *then_clause = get_positional_arg (vars, 2);
+ char *else_clause = get_positional_arg (vars, 3);
+ int caseless_p = var_present_p (vars, "CASELESS");
+ char *consequence;
+
+ if (((empty_string_p (left_clause)) && (empty_string_p (right_clause))) ||
+ ((left_clause && right_clause) &&
+ (((!caseless_p) && (strcmp (left_clause, right_clause) == 0)) ||
+ ((caseless_p) && (strcasecmp (left_clause, right_clause) == 0)))))
+ consequence = then_clause;
+ else
+ consequence = else_clause;
+
+ if (consequence != (char *)NULL)
+ bprintf_insert (page, start, "%s", consequence);
+
+ xfree (left_clause);
+ xfree (right_clause);
+ }
+
+ static void
+ pf_when (PFunArgs)
+ {
+ char *test = mhtml_evaluate_string (get_positional_arg (vars, 0));
+
+ if (!empty_string_p (test))
+ bprintf_insert (page, start, "%s", body->buffer);
+
+ if (test) free (test);
+ }
+
+ static void
+ pf_break (PFunArgs)
+ {
+ page->attachment = (void *)bprintf_create_buffer ();
+ page->bindex = start;
+ page->buffer[start] = '\0';
+ }
+
+ static void
+ pf_while (PFunArgs)
+ {
+ char *test = get_positional_arg (vars, 0);
+ int iteration_count = 0;
+ char *limit_string = pagefunc_get_variable ("mhtml::iteration-limit");
+ int limit = limit_string ? atoi (limit_string) : PAGE_ITERATOR_MAX_COUNT;
+
+ while (1)
+ {
+ char *result = mhtml_evaluate_string (test);
+ int empty = empty_string_p (result);
+ PAGE *code;
+
+ xfree (result);
+ iteration_count++;
+
+ if (empty || (iteration_count > limit))
+ break;
+
+ code = page_copy_page (body);
+ page_process_page_internal (code);
+
+ if (code != (PAGE *)NULL)
+ {
+ int broken = (code->attachment != (void *)NULL);
+
+ if (code->bindex != 0)
+ {
+ bprintf_insert (page, start, "%s", code->buffer);
+ start += (code->bindex);
+
+ *newstart = start;
+ }
+
+ page_free_page (code);
+ if (broken)
+ break;
+ }
+ }
+ }
+
+ static void
+ pf_var_case (PFunArgs)
+ {
+ register int i = 0;
+ char **names = get_vars_names (vars);
+ char **vals = get_vars_vals (vars);
+ static char *nullval = "";
+ char *default_action = (char *)NULL;
+ int clause_found = 0;
+
+ if (names != (char **)NULL)
+ {
+ while (1)
+ {
+ char *name = (char *)NULL;
+ char *case_value = (char *)NULL;
+ char *page_value = (char *)NULL;
+ char *action = (char *)NULL;
+
+ if ((names[i] == (char *)NULL) || (names[i + 1] == (char *)NULL))
+ break;
+
+ name = mhtml_evaluate_string (names[i]);
+ case_value = mhtml_evaluate_string (vals[i]);
+ page_value = pagefunc_get_variable (name);
+ action = names[i + 1];
+ i += 2;
+
+ if (name != (char *)NULL)
+ {
+ /* Check for special "default" case. */
+ if (strcasecmp (name, "default") == 0)
+ {
+ default_action = action;
+ if (case_value) free (case_value);
+ if (page_value) free (page_value);
+ free (name);
+ continue;
+ }
+ free (name);
+ }
+
+ /* Check the value against the page value. */
+ if (empty_string_p (page_value))
+ {
+ page_value = nullval;
+ }
+
+ if (empty_string_p (case_value))
+ {
+ if (case_value) free (case_value);
+ case_value = nullval;
+ }
+
+ if ((page_value == case_value) ||
+ (strcasecmp (page_value, case_value) == 0))
+ {
+ clause_found = 1;
+ if (action != (char *)NULL)
+ bprintf_insert (page, start, "%s", action);
+
+ if (case_value != nullval) free (case_value);
+ break;
+ }
+
+ if (case_value != nullval) free (case_value);
+ }
+
+ if (default_action && !clause_found)
+ bprintf_insert (page, start, "%s", default_action);
+ }
+ }
+
+ /*
+ > --> 1
+ --> hello */
+ static void
+ pf_with (PFunArgs)
+ {
+ register int i = 0;
+ Package *saved_vars = symbol_get_package ((char *)NULL);
+ Package *pack = CurrentPackage;
+ char *packname = pack && pack->name ? strdup (pack->name) : (char *)NULL;
+ char **names = get_vars_names (vars);
+ char **vals = get_vars_vals (vars);
+ int jump_again = 0;
+
+ /* Save the current variables in our local package, and bind those
+ variables to their new values. */
+ for (i = 0; ((names != (char **)NULL) && (names[i] != (char *)NULL)); i++)
+ {
+ char *canonical_name = symbol_canonical_name (names[i]);
+ Symbol *sym = symbol_intern (canonical_name);
+ symbol_copy (sym, saved_vars);
+
+ pagefunc_set_variable (names[i], vals[i]);
+ free (canonical_name);
+ }
+
+ /* Execute the body. */
+ {
+ PageEnv *page_environ;
+ PAGE *body_code = page_copy_page (body);
+
+ page_environ = pagefunc_save_environment ();
+
+ if ((jump_again = setjmp (page_jmp_buffer)) == 0)
+ page_process_page_internal (body_code);
+ pagefunc_restore_environment (page_environ);
+
+ if (body_code != (PAGE *)NULL)
+ {
+ if (!jump_again && (body_code->buffer != (char *)NULL))
+ {
+ bprintf_insert (page, start, "%s", body_code->buffer);
+ *newstart = start + (body_code->bindex);
+ }
+
+ page_free_page (body_code);
+ }
+ }
+
+ /* If the package had a name before, get the named package again, because
+ the body code might have deleted it! If it had no name, there isn't
+ any way that the body code could delete it, so trust that it exists. */
+ if (packname)
+ {
+ pack = symbol_get_package (packname);
+ free (packname);
+ }
+
+ /* Restore the values. */
+ for (i = 0; ((names != (char **)NULL) && (names[i] != (char *)NULL)); i++)
+ {
+ char *canonical_name = symbol_canonical_name (names[i]);
+ Symbol *sym = symbol_intern_in_package (saved_vars, canonical_name);
+
+ symbol_copy (sym, pack);
+ free (canonical_name);
+ }
+
+ if (jump_again) longjmp (page_jmp_buffer, 1);
+ }
+
diff -cprP metahtml-5.03/libmhtml/pagefuncs.c metahtml-5.04/libmhtml/pagefuncs.c
*** metahtml-5.03/libmhtml/pagefuncs.c Thu Jun 19 02:51:11 1997
--- metahtml-5.04/libmhtml/pagefuncs.c Sat Jun 21 12:40:33 1997
*************** static void pf_alist_to_package (PFunArg
*** 91,105 ****
static void pf_in_package (PFunArgs);
static void pf_with_local_package (PFunArgs);
- /* If eval (test) produces non-zero length text, then... */
- static void pf_if (PFunArgs);
-
- /* If eval (this) = eval (that), then, else */
- static void pf_ifeq (PFunArgs);
-
- /* body */
- static void pf_when (PFunArgs);
-
/* --> "true" if TEST is empty, "" otherwise. */
static void pf_not (PFunArgs);
--- 91,96 ----
*************** static void pf_and (PFunArgs);
*** 110,118 ****
all are false. */
static void pf_or (PFunArgs);
- /* Do-this where == THAT. */
- static void pf_var_case (PFunArgs);
-
/* body
Store MACRO-NAME as a complex tag.
Do replacements on %1..%9 and %body in BODY at invocation time. */
--- 101,106 ----
*************** static void pf_undef (PFunArgs);
*** 143,153 ****
/* --> Prints out function defs. */
static void pf_function_def (PFunArgs);
- /* body-text ... Do BODY-TEXT while TEST
- produces non-zero length text. */
- #define PAGE_ITERATOR_MAX_COUNT 500 /* No more than this many times. */
- static void pf_while (PFunArgs);
-
/* Change the value of VAR by XX. */
static void pf_increment (PFunArgs);
--- 131,136 ----
*************** PFunDesc pagefunc_table[] = {
*** 291,304 ****
{ "PACKAGE-DELETE", 0, 0, pf_package_delete },
{ "INCREMENT", 0, 0, pf_increment },
{ "DECREMENT", 0, 0, pf_decrement },
- { "IF", 0, 0, pf_if },
- { "IFEQ", 0, 0, pf_ifeq },
- { "WHEN", 1, 0, pf_when },
{ "NOT", 0, 0, pf_not },
{ "AND", 0, 0, pf_and },
{ "OR", 0, 0, pf_or },
- { "VAR-CASE", 0, 0, pf_var_case },
- { "WHILE", 1, 0, pf_while },
{ "DEFMACRO", 1, 0, pf_defmacro },
{ "DEFWEAKMACRO", 1, 0, pf_defweakmacro },
{ "DEFINE-CONTAINER", 1, 0, pf_defmacro },
--- 274,282 ----
*************** pf_package_delete (PFunArgs)
*** 957,1006 ****
}
}
- static void
- pf_if (PFunArgs)
- {
- char *test_clause = mhtml_evaluate_string (get_positional_arg (vars, 0));
- char *then_clause = get_positional_arg (vars, 1);
- char *else_clause = get_positional_arg (vars, 2);
- char *consequence;
-
- if (!empty_string_p (test_clause))
- consequence = then_clause;
- else
- consequence = else_clause;
-
- if (consequence != (char *)NULL)
- bprintf_insert (page, start, "%s", consequence);
-
- xfree (test_clause);
- }
-
- static void
- pf_ifeq (PFunArgs)
- {
- char *left_clause = mhtml_evaluate_string (get_positional_arg (vars, 0));
- char *right_clause = mhtml_evaluate_string (get_positional_arg (vars, 1));
- char *then_clause = get_positional_arg (vars, 2);
- char *else_clause = get_positional_arg (vars, 3);
- int caseless_p = var_present_p (vars, "CASELESS");
- char *consequence;
-
- if (((empty_string_p (left_clause)) && (empty_string_p (right_clause))) ||
- ((left_clause && right_clause) &&
- (((!caseless_p) && (strcmp (left_clause, right_clause) == 0)) ||
- ((caseless_p) && (strcasecmp (left_clause, right_clause) == 0)))))
- consequence = then_clause;
- else
- consequence = else_clause;
-
- if (consequence != (char *)NULL)
- bprintf_insert (page, start, "%s", consequence);
-
- xfree (left_clause);
- xfree (right_clause);
- }
-
#if defined (MHTML_ARITHMETIC)
/* Arithmetic operations. This is pretty ugly. */
--- 935,940 ----
*************** pf_random (PFunArgs)
*** 1379,1395 ****
bprintf_insert (page, start, "%d", result);
}
-
- static void
- pf_when (PFunArgs)
- {
- char *test = mhtml_evaluate_string (get_positional_arg (vars, 0));
-
- if (!empty_string_p (test))
- bprintf_insert (page, start, "%s", body->buffer);
-
- if (test) free (test);
- }
static void
pf_not (PFunArgs)
--- 1313,1318 ----
*************** pf_or (PFunArgs)
*** 1459,1576 ****
{
bprintf_insert (page, start, "%s", result);
free (result);
- }
- }
-
- static void
- pf_while (PFunArgs)
- {
- char *test = get_positional_arg (vars, 0);
- int iteration_count = 0;
- char *limit_string = pagefunc_get_variable ("mhtml::iteration-limit");
- int limit = limit_string ? atoi (limit_string) : PAGE_ITERATOR_MAX_COUNT;
- char *result;
-
- while (((result = mhtml_evaluate_string (test)) != (char *)NULL) &&
- (result[0] != '\0'))
- {
- PAGE *code;
-
- iteration_count++;
-
- if (iteration_count > limit)
- break;
-
- code = page_copy_page (body);
- page_process_page_internal (code);
-
- if ((code != (PAGE *)NULL) && (code->bindex != 0))
- {
- bprintf_insert (page, start, "%s", code->buffer);
- start += (code->bindex);
-
- *newstart = start;
- }
-
- if (code != (PAGE *)NULL)
- page_free_page (code);
-
- free (result);
- }
-
- if (result) free (result);
- }
-
- static void
- pf_var_case (PFunArgs)
- {
- register int i = 0;
- char **names = get_vars_names (vars);
- char **vals = get_vars_vals (vars);
- static char *nullval = "";
- char *default_action = (char *)NULL;
- int clause_found = 0;
-
- if (names != (char **)NULL)
- {
- while (1)
- {
- char *name = (char *)NULL;
- char *case_value = (char *)NULL;
- char *page_value = (char *)NULL;
- char *action = (char *)NULL;
-
- if ((names[i] == (char *)NULL) || (names[i + 1] == (char *)NULL))
- break;
-
- name = mhtml_evaluate_string (names[i]);
- case_value = mhtml_evaluate_string (vals[i]);
- page_value = pagefunc_get_variable (name);
- action = names[i + 1];
- i += 2;
-
- if (name != (char *)NULL)
- {
- /* Check for special "default" case. */
- if (strcasecmp (name, "default") == 0)
- {
- default_action = action;
- if (case_value) free (case_value);
- if (page_value) free (page_value);
- free (name);
- continue;
- }
- free (name);
- }
-
- /* Check the value against the page value. */
- if (empty_string_p (page_value))
- {
- page_value = nullval;
- }
-
- if (empty_string_p (case_value))
- {
- if (case_value) free (case_value);
- case_value = nullval;
- }
-
- if ((page_value == case_value) ||
- (strcasecmp (page_value, case_value) == 0))
- {
- clause_found = 1;
- if (action != (char *)NULL)
- bprintf_insert (page, start, "%s", action);
-
- if (case_value != nullval) free (case_value);
- break;
- }
-
- if (case_value != nullval) free (case_value);
- }
-
- if (default_action && !clause_found)
- bprintf_insert (page, start, "%s", default_action);
}
}
--- 1382,1387 ----
diff -cprP metahtml-5.03/libmhtml/parser.c metahtml-5.04/libmhtml/parser.c
*** metahtml-5.03/libmhtml/parser.c Fri May 16 02:55:57 1997
--- metahtml-5.04/libmhtml/parser.c Sat Jun 21 13:58:57 1997
*************** mhtml_execute_function (UserFunction *uf
*** 1618,1623 ****
--- 1618,1625 ----
if (strcmp (packname, "local") == 0)
{
Package *current_package = CurrentPackage;
+ char *packname = current_package->name ?
+ strdup (current_package->name) : (char *)NULL;
char *x;
CurrentPackage = symbol_get_package ((char *)NULL);
*************** mhtml_execute_function (UserFunction *uf
*** 1634,1640 ****
--- 1636,1649 ----
bprintf_insert (page, start, "%s", x);
*newstart += strlen (x);
}
+
xfree (x);
+ if (packname)
+ {
+ current_package = symbol_get_package (packname);
+ free (packname);
+ }
+
CurrentPackage = current_package;
}
else
diff -cprP metahtml-5.03/libmhtml/symbols.c metahtml-5.04/libmhtml/symbols.c
*** metahtml-5.03/libmhtml/symbols.c Fri Jun 20 20:42:49 1997
--- metahtml-5.04/libmhtml/symbols.c Sat Jun 21 13:46:19 1997
*************** symbol_store_array (char *name, char **a
*** 1022,1027 ****
--- 1022,1057 ----
}
}
+ /* Return the canonicalized version of NAME. This just strips out
+ array brackets. Always returns a new string, unless the input
+ string is NULL. */
+ char *
+ symbol_canonical_name (char *name)
+ {
+ char *result = (char *)NULL;
+
+ if (name != (char *)NULL)
+ {
+ register int i;
+
+ result = strdup (name);
+
+ for (i = 0; ((name[i] != '\0') && (name[i] != '[')); i++);
+
+ /* If there is an open-bracket here, see if there is a close. */
+ if (name[i] == '[')
+ {
+ int zero = i;
+
+ for (; ((name[i] != '\0') && (name[i] != ']')); i++);
+ if (name[i] == ']')
+ name[zero] = '\0';
+ }
+ }
+
+ return (result);
+ }
+
#if defined (TEST)
int
diff -cprP metahtml-5.03/libmhtml/symbols.h metahtml-5.04/libmhtml/symbols.h
*** metahtml-5.03/libmhtml/symbols.h Sat Jun 14 12:21:41 1997
--- metahtml-5.04/libmhtml/symbols.h Sat Jun 21 13:46:32 1997
*************** extern void symbol_notify_value (Symbol
*** 211,216 ****
--- 211,221 ----
pointed to by ARRAY. */
extern void symbol_store_array (char *name, char **array);
+ /* Return the canonicalized version of NAME. This just strips out
+ array brackets. Always returns a new string, unless the input
+ string is NULL. */
+ extern char *symbol_canonical_name (char *name);
+
extern int symbol_get_flags (Symbol *symbol);
extern int symbol_get_flag (Symbol *symbol, int flag);
extern void symbol_set_flag (Symbol *symbol, int flag);
diff -cprP metahtml-5.03/libmhtml/tagsets/general.mhtml metahtml-5.04/libmhtml/tagsets/general.mhtml
*** metahtml-5.03/libmhtml/tagsets/general.mhtml Fri Jun 20 21:01:28 1997
--- metahtml-5.04/libmhtml/tagsets/general.mhtml Mon Jun 23 18:36:39 1997
***************
*** 10,15 ****
--- 10,19 ----
;;; , , , and
;;; are now all written as primitives.
+
+ "(.*\n)(.*$)" "\\2">
+
+
strip=true> >
***************
*** 102,120 ****
>
-
- > >
-
-
;;; turns the contents of PACKAGE into
;;; non-executable text.
>>
!
! >
! "&" "&" "<" "<" ">" ">">
!
!
<%0 %1>
--- 106,118 ----
>
;;; turns the contents of PACKAGE into
;;; non-executable text.
>>
!
! "&" "&" "<" "<" ">" ">">
!
<%0 %1>
diff -cprP metahtml-5.03/mhc/mhc.c metahtml-5.04/mhc/mhc.c
*** metahtml-5.03/mhc/mhc.c Fri Jun 13 09:39:45 1997
--- metahtml-5.04/mhc/mhc.c Mon Jun 23 18:38:09 1997
*************** static char *mhtml_version_string = "";
*** 39,44 ****
--- 39,46 ----
static char *mhtml_version_string = MHTML_VERSION_STRING;
#endif
+ static int call_bootstrap = 1;
+
#if !defined (macintosh)
extern char **environ;
#endif /* !macintosh */
*************** prep_for_page_process (PAGE *page, int a
*** 100,106 ****
{
register int i;
! bootstrap_metahtml (0);
if (page && page->buffer)
{
--- 102,109 ----
{
register int i;
! if (call_bootstrap)
! bootstrap_metahtml (0);
if (page && page->buffer)
{
*************** parse_program_args (int argc, char *argv
*** 179,185 ****
pagefunc_set_variable (name, value);
}
! else if (!filename && (*arg != "-"))
filename = arg;
else if (filename)
{
--- 182,190 ----
pagefunc_set_variable (name, value);
}
! else if (!filename && (strcmp (arg, "-z") == 0))
! call_bootstrap = 0;
! else if (!filename && (*arg != '-'))
filename = arg;
else if (filename)
{
Only in metahtml-5.03/release: 5.03
diff -cprP metahtml-5.03/release/5.04/ANNOUNCE-5.04 metahtml-5.04/release/5.04/ANNOUNCE-5.04
*** metahtml-5.03/release/5.04/ANNOUNCE-5.04 Wed Dec 31 16:00:00 1969
--- metahtml-5.04/release/5.04/ANNOUNCE-5.04 Fri Jun 20 09:36:49 1997
***************
*** 0 ****
--- 1,100 ----
+
+ Meta-HTML 5.03 Source Release
+
+ Version 5.03 of the Meta-HTML Web Language distribution is now
+ available for download from:
+
+ http://www.metahtml.com/download
+
+ It should be available from prep.ai.mit.edu, and other GNU mirror
+ sites within the next two weeks.
+
+ ------------------------------------------------------------
+
+ What is it?
+
+ Meta-HTML is a programming language specifically designed for working
+ within the World Wide Web environment. Although it is a genuine
+ programming language, suitable for large-scale symbolic manipulation,
+ it provides the most commonly wanted Web functionality as built-in
+ primitives, so you don't have to write them. You can find out more
+ about the theory of implementation in this white paper
+ [http://www.metahtml.com/documentation/manifesto.html].
+
+ Web pages are authored using HTML and Meta-HTML statements freely
+ intermixed. When a page is requested by a browser, the page is passed
+ through the Meta-HTML interpreter, which dynamically processes any
+ Meta-HTML statements to produce a final HTML page that is delivered
+ to the browser.
+
+ The source distribution provides several different interpreter options:
+
+ * A CGI engine which can be run by any Unix Web server,
+ * A FastCGI engine which can be run under FastCGI compliant servers,
+ * A full-featured Web server (mhttpd) with the interpreter built in,
+ * A standalone processor, much like Perl or Tcl, and
+ * An interactive debugger, with a feel similar to GDB (mdb)
+
+ ------------------------------------------------------------
+
+ Meta-HTML Changes in 5.03 from 5.02
+
+ * All reported bugs have been fixed. I'm happy to say that
+ just haven't been many bugs reported!
+
+ * The server is now able to perform DNS caching -- this should
+ improve request response time for sites that have client name
+ resolution turned on (the default). It is controlled by
+ a variable in the server config file.
+
+ * A new set of documented array operators, including:
+ array-append, array-member, array-size, array-add-unique,
+ array-shift, array-concat, foreach, and a new "sort"
+ function.
+
+ * Complete support for mSQL 2.x as well as mSQL 1.x. Many
+ bugs were found and fixed in this code.
+
+ * Improvements to various functions, documentation for same.
+ Specifically, cgi-exec, sort, with-open-stream, stream-get,
+ page-debug, system-error-output, and debugging-output have
+ all improved.
+
+ * Dynamically loaded modules allow C language extensions to be
+ added to the running Meta-HTML interpreter. Several useful
+ examples are included.
+
+ * FastCGI support for all platforms now built automatically.
+
+ * Better configuration mechanism allows compilation on many
+ more machine/OS's than before.
+
+ * Again, more and improved documentation.
+
+ * More control over cookie manipulation and session IDs.
+
+ * The ability to include binary representations of Meta-HTML
+ source code directly in the compiled Engine, Server,
+ Debugger, and Standalone Processor. See libmhtml/bootstrap.mhtml.
+
+ ------------------------------------------------------------
+
+ E-Mail Addresses and URLs
+
+ Bug reports for Meta-HTML should be sent to bug-metahtml@metahtml.com.
+ Bug reports for the documentation should be sent to bug-manual@metahtml.com.
+
+ There is a user mailing list: metahtml-users@metahtml.com. You can
+ subscribe on the Web [http://www.metahtml.com/E-Mail/], or by
+ sending mail to metahtml-users-request@metahtml.com.
+
+ ------------------------------------------------------------
+
+ Authors and Maintenance
+
+ Meta-HTML was designed and implemented by Brian J. Fox (bfox@ai.mit.edu).
+ Meta-HTML is owned by Universal Access Inc., and is released under
+ terms nearly identical to the GPL. The code and utilities are
+ maintained by Brian J. Fox and Jarlath O' Carroll at Universal Access
+ Inc.
+ ------------------------------------------------------------
diff -cprP metahtml-5.03/release/5.04/footer.mhtml metahtml-5.04/release/5.04/footer.mhtml
*** metahtml-5.03/release/5.04/footer.mhtml Wed Dec 31 16:00:00 1969
--- metahtml-5.04/release/5.04/footer.mhtml Fri Jun 20 10:05:37 1997
***************
*** 0 ****
--- 1,17 ----
+ ;;; footer.mhtml: -*- Meta-HTML -*- DESCRIPTIVE TEXT.
+ ;;;
+ ;;; Copyright (c) 1997 Brian J. Fox
+ ;;; Author: Brian J. Fox (bfox@ai.mit.edu) Sun Jun 15 08:45:15 1997.
+
+
+
+
+
+
+ Site design by
+
+ Universal Access Inc.
+ Implemented in
+
+