2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: parutil.c /main/3 1995/11/08 10:23:54 rswiston $ */
25 Copyright 1986 Tandem Computers Incorporated.
26 This product and information is proprietary of Tandem Computers Incorporated.
27 Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co.
30 /* Parutil.c contains utility functions for program PARSER */
50 /* Adjust parsing state after each token if necessary */
51 void m_adjuststate(M_NOPAR)
53 if (m_curcon == START) {
55 if (m_stacktop->intext) m_curcon = NETCDATA ;
56 else if (m_textpermitted()) m_curcon = NETDATACON ;
57 else m_curcon = NETELCON ;
60 if (m_stacktop->intext) m_curcon = POUNDCDATA ;
61 else if (m_textpermitted()) m_curcon = DATACON ;
62 else m_curcon = ELCON ;
65 else if (m_netlevel) switch(m_curcon) {
70 if (m_stacktop->neednet) m_curcon = NETELCDATA ;
73 if (m_stacktop->neednet) m_curcon = NETRCDATA ;
80 /* Tests whether the element named in a tag is defined; if so, returns its
81 index; otherwise return FALSE */
82 M_ELEMENT m_eltname(M_NOPAR)
86 if (eltid = m_packedlook(m_entree, m_name)) return(eltid) ;
88 m_err1("Undefined element %s", m_name) ;
105 /* Program initialization */
106 void m_initialize(M_NOPAR)
110 m_signmsg(m_conform ?
112 "MARKUP PARSER (with non-canonical SGML enhancements) ") ;
113 m_signmsg(M_VERSION) ;
115 m_signmsg("(c) Copyright 1993, 1994, 1995 Hewlett-Packard Company\n");
116 m_signmsg("(c) Copyright 1993, 1994, 1995 International Business Machines Corp.\n");
117 m_signmsg("(c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.\n");
118 m_signmsg("(c) Copyright 1993, 1994, 1995 Unix System Labs, Inc., a subsidiary of Novell, Inc.\n");
119 /* took this out since it seemed frivolous and failed tests with
124 if (! (m_sysent[m_sysecnt] = m_openfirst()))
126 m_error("Unable to open input file") ;
130 setlocale(LC_ALL, "");
133 mb_delims = mb_dlmptr;
134 wc_delims = m_dlmptr;
138 *wc_delims++ = MakeWideCharString(*mb_delims);