1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Remove old cruft: osf/* and utils/prog*

The osf/ stuff includes uil, wml, etc - we expect these to be provided
by Motif, and make no attempt to build them in CDE, so no need for
them.

The only program in utils/prog/ is an ancient verion of lndir that we
do not need for CDE.  If you need lndir for some reason, use the
laters version from Xorg, usually installed via the xutils-dev
package.
This commit is contained in:
Jon Trulson 2018-03-28 12:15:04 -06:00
parent f65f512981
commit 700b9d2dd4
94 changed files with 0 additions and 53784 deletions

View file

@ -1,20 +0,0 @@
XCOMM $XConsortium: Imakefile /main/4 1995/10/27 08:47:01 rswiston $
#ifdef SunArchitecture
.NO_PARALLEL:
#endif
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
#if BUILD_UNITY_1_ONLY
SUBDIRS=wml uil xmbind
#else
SUBDIRS = wml mwm xmbind
#endif
/* Force a top path that works for external Motif subdirectories. */
TOP = ../../cde/.
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
LintSubdirs($(SUBDIRS))

View file

@ -1,39 +0,0 @@
! $XConsortium: CDE /main/4 1995/07/17 10:28:16 drk $
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF
! for the full copyright text.
!
!
! HISTORY
!
! Bindings for CDE 1.0, generic keyboard
!
! This file does not correspond to any specific server, so it cannot
! be accessed via xmbind.aliases. If you wish to use these bindings,
! copy them into ~/.motifbind or use xmbind to load this file directly.
osfActivate : <Key>KP_Enter, <Key>Execute
osfAddMode : Shift<Key>F8
osfBackSpace : <Key>BackSpace
osfBeginLine : <Key>Home, <Key>Begin
osfCancel : <Key>Escape, <Key>Cancel, Ctrl<Key>s
osfClear : <Key>Clear
osfCopy : Ctrl<Key>c, Ctrl<Key>Insert
osfCut : Ctrl<Key>x, Shift<Key>Delete
osfDelete : <Key>Delete
osfDown : <Key>Down
osfEndLine : <Key>End
osfHelp : <Key>F1, <Key>Help
osfInsert : <Key>Insert
osfLeft : <Key>Left
osfMenu : Shift<Key>F10, <Key>Menu
osfMenuBar : <Key>F10, Shift<Key>Menu
osfPageDown : <Key>Next
osfPageUp : <Key>Prior
osfPaste : Ctrl<Key>v, Shift<Key>Insert
osfRight : <Key>Right
osfSelect : <Key>Select
osfSwitchDirection : Alt<Key>Return, Alt<Key>KP_Enter
osfUndo : <Key>Undo
osfUp : <Key>Up

View file

@ -1,48 +0,0 @@
XCOMM
XCOMM @OSF_COPYRIGHT@
XCOMM COPYRIGHT NOTICE
XCOMM Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
XCOMM ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
XCOMM the full copyright text.
XCOMM
XCOMM
XCOMM HISTORY
XCOMM
XCOMM $TOG: Imakefile /main/8 1997/07/02 17:51:43 samborn $
INSTALLFLAGS = $(INSTINCFLAGS)
FILES = \
xmbind.alias \
acorn \
apollo \
dec \
dg_AViiON \
doubleclick \
hal \
hitachi \
hp \
ibm \
intergraph \
intergraph17 \
megatek \
motorola \
ncr_at \
ncr_vt \
pc \
sgi \
sni \
sni_97801 \
siemens_9733 \
siemens_wx200 \
sony \
sun_mit \
sun_news \
tek
all::
InstallMultiple($(FILES),VirtualBindingsPath)
depend::

View file

@ -1,39 +0,0 @@
/* $XConsortium: README /main/3 1996/07/15 13:55:02 drk $ */
This directory contains a collection of sample ".motifbind" files:
acorn
apollo
dec
dg_AViiON
doubleclick
hitachi
hp
ibm
intergraph17
intergraph
megatek
motorola
ncr_at
ncr_vt
sgi
siemens_9733
siemens_wx200
sun_mit
sun_news
tek
These files were provided by various vendors, though not necessarily
the vendors whose hardware they apply to. Each file contains a set of
keyboard bindings that is suggested for use on that particular
server/hardware combination. These files should be used as examples
of ~/.motifbind files to work from.
By copying the appropriate file into the user's home directory and
renaming it to ".motifbind", the bindings will be recognized and used
when the Motif window manager is (re)started.
These bindings will override any other default bindings except those
initiated within a client application (using XtOverrideTranslations).
These examples are provided, as is, only as a service to the vendors
and users.

View file

@ -1,35 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: acorn /main/6 1995/07/14 09:19:28 drk $
!
!"Acorn Computers Ltd"
! Acorn RISC iX versions 1.0->1.2 running on Acorn R140, R225, R260
! (all national keyboard variants)
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine :Alt <Key>Right
osfBeginLine :Alt <Key>Left
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfActivate : <Key>KP_Enter
osfCopy : <Key>Select

View file

@ -1,38 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: apollo /main/6 1995/07/14 09:19:33 drk $
!
!"Apollo Computer Inc."
!
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>apRightBar
osfBeginLine : <Key>apLeftBar
osfPageUp : <Key>apUpBox
osfPageDown : <Key>apDownBox
osfPageLeft : <Key>apLeftBox
osfPageRight : <Key>apRightBox
osfBackSpace : <Key>BackSpace
osfDelete : <Key>apCharDel
osfInsert : <Key>Select
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfCopy : <Key>apCopy
osfCut : <Key>apCut
osfPaste : <Key>apPaste
osfUndo : <Key>Undo

View file

@ -1,36 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: dec /main/6 1995/07/14 09:19:39 drk $
!
!"DECWINDOWS DigitalEquipmentCorp."
!
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine :Alt <Key>Right
osfBeginLine :Alt <Key>Left
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>Delete
osfDelete : <Key>DRemove
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfSelect : <Key>Select
osfActivate : <Key>KP_Enter
osfPrimaryPaste : <Key>F14
osfQuickPaste : <Key>F17

View file

@ -1,32 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: dg_AViiON /main/6 1995/07/14 09:19:45 drk $
!
!"Data General Corporation Rev 04"
! AViiON
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,32 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: doubleclick /main/6 1995/07/14 09:19:51 drk $
!
!"Double Click Imaging, Inc. KeyX"
! for the version of KeyX running on 386 AT bus compatibles.
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,32 +0,0 @@
! $XConsortium: hal /main/4 1995/07/17 10:28:29 drk $
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
! HISTORY
!
!
! "HaL" server for a Sun type 4 keyboard
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>F33
osfBeginLine : <Key>F27
osfPageUp : <Key>F29
osfPageDown : <Key>F35
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfCopy : <Key>F16
osfCut : <Key>F20
osfPaste : <Key>F18
osfUndo : <Key>F14

View file

@ -1,32 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: hitachi /main/6 1995/07/14 09:19:58 drk $
!
!
! Hitachi System 2050
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine :Alt <Key>Right
osfBeginLine :Alt <Key>Left
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,38 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: hp /main/7 1996/11/21 13:06:42 cde-hp $
!
!"Hewlett-Packard Company"
!
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfSelect : <Key>Select
osfClear : <Key>Clear
osfUndo : <Key>Undo
osfPrimaryPaste :Meta Ctrl <Key>Insert

View file

@ -1,32 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: ibm /main/6 1995/07/14 09:20:11 drk $
!
!"International Business Machines"
! for AIX/PS2 and RS/6000 systems
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,31 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: intergraph /main/6 1995/07/14 09:20:18 drk $
!
! Intergraph
! with Delete & Backspace keys
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine :Alt <Key>Right
osfBeginLine :Alt <Key>Left
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,31 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: intergraph17 /main/6 1995/07/14 09:20:24 drk $
!
! Intergraph
! with single Delete/Backspace keys (use F17 for Delete)
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine :Alt <Key>Right
osfBeginLine :Alt <Key>Left
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>F17
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,36 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: megatek /main/6 1995/07/14 09:20:29 drk $
!
!"Megatek Corporation"
! Megatek X-Cellerator
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>R13
osfBeginLine : <Key>F27
osfPageUp : <Key>F29
osfPageDown : <Key>F35
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfCopy : <Key>F16
osfCut : <Key>F20
osfPaste : <Key>F18
osfUndo : <Key>F14

View file

@ -1,37 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: motorola /main/6 1995/07/14 09:20:35 drk $
!
!"Motorola Inc. (Microcomputer Division) "
! (c) Copyright 1990 Motorola Inc.
! Motorola provides these key bindings as is,
! with no guarantees or warranties implied.
! Motorola is under no obligation to support,
! update, or extend these key bindings for
! future releases.
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,32 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: ncr_at /main/6 1995/07/14 09:20:41 drk $
!
! NCR XL Series X-Station
! PC AT keyboard
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfActivate : <Key>KP_Enter

View file

@ -1,36 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: ncr_vt /main/6 1995/07/14 09:20:46 drk $
!
! NCR XL Series X-Station
! VT 220 keyboard
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine :Alt <Key>Right
osfBeginLine :Alt <Key>Left
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfSelect : <Key>Select
osfActivate : <Key>KP_Enter
osfQuickPaste : <Key>F17

View file

@ -1,41 +0,0 @@
! $XConsortium: pc /main/4 1995/07/17 10:28:38 drk $
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
! HISTORY
! Generic OSF/Motif Style Guide bindings for PC keyboards
osfActivate : <Key>KP_Enter
osfCancel : <Key>Escape
osfMenuBar : <Key>F10
osfMenu : Shift <Key>F10
osfHelp : <Key>F1
osfBackSpace : <Key>BackSpace
osfInsert : <Key>Insert
osfDelete : <Key>Delete
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfPageLeft : Ctrl <Key>Prior
osfPageRight : Ctrl <Key>Next
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfLeft : <Key>Left
osfRight : <Key>Right
osfUp : <Key>Up
osfDown : <Key>Down
osfAddMode : Shift <Key>F8
osfCut : Shift <Key>Delete
osfCopy : Ctrl <Key>Insert
osfPaste : Shift <Key>Insert
osfPrimaryPaste :Meta Ctrl <Key>Insert

View file

@ -1,33 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: sgi /main/7 1995/07/14 09:20:51 drk $
!
!"Silicon Graphics Inc."
!
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfActivate : <Key>KP_Enter
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,35 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: siemens_9733 /main/6 1995/07/14 09:20:56 drk $
!
!"Siemens Munich (SP-4's hacker-clan)"
! Siemens 9733 system
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete_char
osfInsert : <Key>Insert_char
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help
osfMenu : <Key>Linefeed
osfMenuBar : <Key>F10

View file

@ -1,36 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: siemens_wx200 /main/6 1995/07/14 09:21:02 drk $
!
!"Siemens Munich by SP-4's Hacker Crew"
! Siemens WX200 system
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>Cancel
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete,<Key>F29
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>Help,<Key>F1
osfActivate : <Key>KP_Enter
osfMenu : <Key>Menu,Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,30 +0,0 @@
! $XConsortium: sni /main/4 1995/07/17 10:28:46 drk $
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
! HISTORY
!
!
! "Siemens Nixdorf Informationssysteme AG"
! SNI MFII keyboard
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode : Shift <Key>F8
osfHelp : <Key>F1
osfActivate : <Key>KP_Enter
osfMenu : Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,29 +0,0 @@
! $XConsortium: sni_97801 /main/4 1995/07/17 10:29:04 drk $
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
! HISTORY
!
! "Siemens Nixdorf Informationssysteme AG (97801)"
! SNI 97801 keyboard
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>Cancel,<Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete,<Key>F29
osfInsert : <Key>Insert
osfAddMode : Shift <Key>F8
osfHelp : <Key>Help,<Key>F1
osfActivate : <Key>KP_Enter
osfMenu : <Key>Menu,Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,34 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: sony /main/5 1995/07/14 09:21:08 drk $
!
!"Sony Corporation"
!
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine :Alt <Key>Right
osfBeginLine :Alt <Key>Left
osfPageUp :Alt <Key>Up
osfPageDown :Alt <Key>Down
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>F5
osfAddMode :Shift <Key>F18
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfSelect : <Key>Select
osfActivate : <Key>KP_Enter

View file

@ -1,31 +0,0 @@
!
!
! $Id: sun /main/3 1999/07/14 10:48:40 mgreess $
!
! "Sun Microsystems, Inc."
osfActivate : <Key>KP_Enter
osfCancel : <Key>Escape
osfHelp : <Key>Help,<Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfBeginLine : <Key>Home
osfEndLine : <Key>End
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfUndo : <Key>Undo
osfAddMode :Shift <Key>F8
osfCopy : <Key>SunCopy
osfCut : <Key>SunCut
osfPaste : <Key>SunPaste

View file

@ -1,26 +0,0 @@
!
!
! $Id: sun_at /main/2 1999/03/26 17:09:14 samborn $
!
! "Sun Microsystems, Inc."
osfActivate : <Key>KP_Enter
osfCancel : <Key>Escape
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfBeginLine : <Key>Home
osfEndLine : <Key>End
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8

View file

@ -1,32 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: tek /main/6 1995/07/14 09:21:24 drk $
!
!"Tektronix, Inc."
!
!
osfCancel : <Key>Escape
osfLeft : <Key>Left
osfUp : <Key>Up
osfRight : <Key>Right
osfDown : <Key>Down
osfEndLine : <Key>End
osfBeginLine : <Key>Home
osfPageUp : <Key>Prior
osfPageDown : <Key>Next
osfBackSpace : <Key>BackSpace
osfDelete : <Key>Delete
osfInsert : <Key>Insert
osfAddMode :Shift <Key>F8
osfHelp : <Key>F1
osfMenu :Shift <Key>F10
osfMenuBar : <Key>F10

View file

@ -1,49 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $TOG: xmbind.alias /main/6 1999/03/26 17:03:23 samborn $
!
!
! bindings alias file
!
! format:
! "<ServerVendor(display)>[<space><VendorRelease(display)>]" bindings_file
!
"Acorn Computers Ltd" acorn
"Apollo Computer Inc." apollo
"DECWINDOWS DigitalEquipmentCorp." dec
"DECWINDOWS DigitalEquipmentCorporation UWS2.2" dec
"Data General Corporation Rev 04" dg_AViiON
"Double Click Imaging, Inc. KeyX" doubleclick
"HaL" hal
"Hewlett-Packard Company" hp
! "Hitachi?" hitachi
"International Business Machines" ibm
"Intergraph Corporation" intergraph
! "Intergraph Corporation ?" intergraph17
"Megatek Corporation" megatek
"Motorola Inc. (Microcomputer Division) " motorola
! "NCR?" ncr_at
! "NCR?" ncr_vt
! "?" (Generic PC keyboard bindings) pc
"Silicon Graphics Inc." sgi
"Silicon Graphics" sgi
"Siemens Nixdorf Informationssysteme AG" sni
"Siemens Nixdorf Informationssysteme AG (97801)" sni_97801
"Siemens Munich by SP-4's Hacker Crew" siemens_wx200
"Siemens Munich (SP-4's hacker-clan)" siemens_9733
"Sony Corporation" sony
"X11/NeWS - Sun Microsystems Inc." sun
! sun: for Displays with Type-4/Type-5 keyboards
! sun_at: for Displays with PC AT style keyboards
"Sun Microsystems, Inc." sun
! "Sun Microsystems, Inc." sun_at
"Tektronix, Inc." tek

View file

@ -1,74 +0,0 @@
XCOMM
XCOMM @OSF_COPYRIGHT@
XCOMM COPYRIGHT NOTICE
XCOMM Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
XCOMM ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
XCOMM the full copyright text.
XCOMM
XCOMM
XCOMM HISTORY
XCOMM
XCOMM $TOG: Imakefile /main/23 1997/07/03 12:32:45 samborn $
#define DoNormalLib NormalLibUil
#define DoSharedLib SharedLibUil
#define DoDebugLib DebugLibUil
#define DoProfileLib ProfileLibUil
#define LibName Uil
#define SoRev SOUILREV
#define HasSharedData NO
#define IncSubdir uil
#ifdef SharedUilReqs
REQUIREDLIBS = SharedUilReqs
#endif
INCLUDES = -I. -I$(INCLUDESRC) -I$(MINCLUDESRC) -I$(MLIBSRC) -I$(MTOP)/include
DEPLIBS2 = MrmClientDepLibs
LOCAL_LIBRARIES = MrmClientLibs
LINTLIBS = $(LINTMRESOURCE) $(LINTXMLIB) $(LINTXMTOOL) $(LINTXLIB)
COMMON_SRC = UilCmd.c UilDiags.c UilKeyTab.c UilLexAna.c \
UilLexPars.c UilLstLst.c UilP2Out.c UilP2Reslv.c \
UilSarComp.c UilSarExp.c UilSarInc.c UilSarMod.c \
UilSarObj.c UilSarProc.c UilSarVal.c UilSrcSrc.c \
UilSymNam.c UilSymStor.c UilData.c \
UilLstMac.c UilSemVal.c UilSemCSet.c UilDB.c
SRCS = $(COMMON_SRC) UilParser.c
SRCS2 = $(COMMON_SRC) UilMain.c
COMMON_OBJ = UilCmd.o UilDiags.o UilKeyTab.o UilLexAna.o \
UilLexPars.o UilLstLst.o UilP2Out.o UilP2Reslv.o \
UilSarComp.o UilSarExp.o UilSarInc.o UilSarMod.o \
UilSarObj.o UilSarProc.o UilSarVal.o UilSrcSrc.o \
UilSymNam.o UilSymStor.o UilData.o \
UilLstMac.o UilSemVal.o UilSemCSet.o UilDB.o
OBJS = $(COMMON_OBJ) UilParser.o
OBJS2 = $(COMMON_OBJ) UilMain.o
HEADERS = Uil.h UilSymGl.h UilDBDef.h UilSymDef.h \
UilDef.h XmAppl.uil
#include <Library.tmpl>
PROGRAMS = uil
AllTarget($(PROGRAMS))
MComplexProgramTarget_2(uil,$(LOCAL_LIBRARIES),NullParameter)
SpecialLibObjectRule(UilDB.o,NullParameter,-DLIBDIR='"'$(XPROJECTROOT)/lib/X11'"' -DINCDIR='"'$(XPROJECTROOT)/include/X11'"')
LinkFile(UilParser.c,UilMain.c)
SpecialLibObjectRule(UilParser.o,NullParameter,-DCALLABLE)
DependTarget3($(COMMON_SRC),UilMain.c,UilParser.c)
#ifdef UseVista
VistaMapRule(uil.M,libUil.a)
#endif
MessageCatalogRule(Uil)

View file

@ -1,179 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: Uil.h /main/11 1995/07/14 09:32:19 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the set of definitions for use with
** UIL compiler callable interface.
**
**--
**/
#ifndef Uil_h
#define Uil_h
/*
**
** INCLUDE FILES
**
**/
/*
**
** Definition of Compiler Severity Statuses
**
*/
typedef unsigned int Uil_status_type;
#define Uil_k_min_status 0
#define Uil_k_success_status 0
#define Uil_k_info_status 1
#define Uil_k_warning_status 2
#define Uil_k_error_status 3
#define Uil_k_severe_status 4
#define Uil_k_max_status 4
/*
**
*/
typedef char (*string_array)[];
#define CEIL(a,b) ((a) < (b) ? (a) : (b))
/*
** Uil_command_type -- Input which describes how/what to compile.
*/
typedef struct _Uil_command_type
{
char *source_file; /* single source to compile */
char *resource_file; /* name of output file */
char *listing_file; /* name of listing file */
unsigned int include_dir_count; /* number of directories in */
/* include_dir array */
char **include_dir; /* directory to search for */
/* includes files */
unsigned listing_file_flag: 1; /* produce a listing */
unsigned resource_file_flag: 1; /* generate UID output */
unsigned machine_code_flag : 1; /* generate machine code */
unsigned report_info_msg_flag: 1;/* report info messages */
unsigned report_warn_msg_flag: 1;/* report warnings */
unsigned parse_tree_flag: 1; /* generate parse tree */
unsigned issue_summary: 1; /* issue diagnostics summary */
unsigned int status_update_delay; /* Number of times a status */
/* point is passed before */
/* calling statusCB routine */
/* 0 means called every time */
char *database; /* name of database file */
unsigned database_flag: 1; /* read a new database file */
unsigned use_setlocale_flag: 1; /* Enable calls to setlocale */
} Uil_command_type;
/*
** Uil_compile_desc_type -- Output information about the compilation including
** the compiler_version, data_structure_version, parse tree, and error counts.
*/
typedef struct _Uil_comp_desc
{
unsigned int compiler_version; /* version number of Compiler */
unsigned int data_version; /* version number of structures */
char *parse_tree_root; /* parse tree output */
unsigned int message_count[Uil_k_max_status+1];
/* array of severity counts */
} Uil_compile_desc_type;
/*
** Uil_continue_type -- A value returned from a Uil callback routine which
** allows the application to specify whether to terminate or continue the
** compilation.
*/
typedef unsigned int Uil_continue_type;
#define Uil_k_terminate 0
#define Uil_k_continue 1
/*
**
** Entry Points
**
*/
#ifndef _ARGUMENTS
#define _ARGUMENTS(arglist) arglist
#endif
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
extern Uil_status_type Uil
_ARGUMENTS((
Uil_command_type *command_desc ,
Uil_compile_desc_type *compile_desc ,
Uil_continue_type (*message_cb )(),
char *message_data ,
Uil_continue_type (*status_cb )(),
char *status_data ));
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#undef _ARGUMENTS
#endif /* Uil_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,97 +0,0 @@
$ $XConsortium: Uil.msg /main/4 1996/08/19 11:53:43 pascale $
$set UIL_SET1
UIL_0 duplicate option \"%s\" was ignored
UIL_1 unknown option \"%s\" was ignored
UIL_2 additional UIL source file: %s was ignored
UIL_3 error opening source file: %s
UIL_4 error reading next line of source file: %s
UIL_5 Internal error: %s
UIL_6 line truncated at %d characters
UIL_7 value of %s is out of range %s
UIL_8 %s not terminated %s
UIL_9 unprintable character \\%d\\ ignored
UIL_10 unknown sequence \"%s\" ignored
UIL_11 unknown escape sequence \"\\%c\" - \\ ignored
UIL_12 name exceeds %d characters - truncated to: %s
UIL_13 compiler ran out of virtual memory
UIL_14 unexpected %s token found - parsing resumes after \"%c\"
UIL_15 %s %s must be defined before this reference
UIL_16 context requires a %s - %s was specified
UIL_17 %s is not implemented yet
UIL_18 found %s value when expecting %s value
UIL_19 the %s %s is not supported for the %s object
UIL_20 this %s %s supersedes a previous definition in this %s %s
UIL_21 name %s previously defined as %s
UIL_22 value used in this context must be private
UIL_23 procedure %s was previously declared with %d arguments
UIL_24 found %s value - procedure %s argument must be %s value
UIL_25 found %s %s when expecting %s %s
UIL_26 %s %s was never defined
UIL_27 %s %s already specified for this %s %s
UIL_28 %s item not allowed in %s %s
UIL_29 compilation terminated - please fix previous errors
UIL_30 internal error - please submit defect report
UIL_31
UIL_32 %s missing following \"%s\" option
UIL_33 error opening listing file: %s
UIL_34 error writing to listing file: %s
UIL_35 invalid module structure - check UIL module syntax
UIL_36 too many source files open: %s
UIL_37 source line contains a null character
UIL_38 errors: %d warnings: %d informationals: %d
UIL_39 error opening UID file: %s
UIL_40 no UID file was produced
UIL_41 creation procedure is not supported by the %s widget
UIL_42 creation procedure is not allowed in a %s widget reference
UIL_43 creation procedure is required in a %s widget declaration
UIL_44 a NULL character in a string is not supported
UIL_45 widget %s is part of a circular definition
UIL_46 no source file specified
UIL_47 %s %s supports only a single %s %s
UIL_48 %s widget supports only a single control
UIL_49 unknown character set
UIL_50 place names clause before other module clauses
UIL_51 color letter string must be a single character
UIL_52 color letter used for prior color in this table
UIL_53 row %d must have same width as row 1
UIL_54 row %d, column %d: letter \"%c\" not in color table
UIL_55 too many %ss in %s, limit is %d
UIL_56 Subqualifier not allowed with negated qualifier
UIL_57 %s gadget is not supported - %s widget will be used instead
UIL_58 %s type is not valid for %s
UIL_59 support for this character set may be removed in a future release
UIL_60 the %s constraint is not supported for the %s %s
UIL_61 too many \"%s\" options, limit is %d
UIL_62 error closing source file: %s
UIL_63 the %s value is circularly defined
UIL_64 overriding built-in name %s
UIL_65 the %s argument does not support enumerated values
UIL_66 the %s argument does not support the %s enumerated value
UIL_67 $LANG contains an unknown character set
UIL_68 the %s object's controls hierarchy contains a reference to itself
UIL_69 value %s is too large for context buffer
UIL_70 forward referencing is not allowed for %s
UIL_71 cannot convert %s type to %s type
UIL_72 %s is invalid
UIL_V2_73 error reading binary database
UIL_V2_74 binary database compiled with a future version
UIL_V2_75 error opening database file: %s
UIL_V2_76 error writing UID file: %s
UIL_V2_77 '%s' is an unknown Toolkit class record name
UIL_78 invalid include file name
UIL_V2_79 incompatible unit types for arithmetic operation
UIL_V2_80 %s used as charset name; %s used as charset component
$set UIL_VALUES
UIL_VAL_0 ** error **
UIL_VAL_1 ** unknown **
$set UIL_SET_MISC
UIL_INF Info:
UIL_WAR Warning:
UIL_ERR Error:
UIL_SEV Severe:
UIL_MISC_0 \t\t line: %d file: %s
UIL_MISC_1 \t\t line: %d position: %d file: %s

View file

@ -1,332 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: UilCmd.c /main/11 1995/07/14 09:32:29 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** Command line interpreter for the
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include "UilDefI.h"
#include "UilCmdDef.h"
/*
**
** GLOBAL DECLARATIONS
**
**/
externaldef(uil_comp_glbl) cmd_command_line_type Uil_cmd_z_command;
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This procedure parses the command line and places the
** results of the parse in the global structure "Uil_cmd_z_command".
**
** FORMAL PARAMETERS:
**
** l_arg_count: number of command arguments
** rac_arg_value: array of pointers to null terminated character strings
** each of which is one of the command line arguments
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** Uil_cmd_z_command: respository for command line info
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** Uil_cmd_z_command is set
**
**--
**/
void cmd_decode_command_line( l_arg_count, rac_arg_value )
int l_arg_count;
char *rac_arg_value[ ];
{
static char *include_list [Uil_k_max_include_dir_count];
int i;
Uil_cmd_z_command.ac_source_file = NULL;
Uil_cmd_z_command.ac_resource_file = NULL;
Uil_cmd_z_command.ac_listing_file = NULL;
Uil_cmd_z_command.include_dir_count = 0;
Uil_cmd_z_command.ac_include_dir = (char **)include_list;
Uil_cmd_z_command.v_resource_file = TRUE;
Uil_cmd_z_command.v_listing_file = FALSE;
Uil_cmd_z_command.v_show_machine_code = FALSE;
Uil_cmd_z_command.v_report_info_msg = TRUE;
Uil_cmd_z_command.v_report_warn_msg = TRUE;
Uil_cmd_z_command.v_parse_tree = FALSE;
Uil_cmd_z_command.v_use_setlocale = FALSE;
Uil_cmd_z_command.status_update_delay = 0;
Uil_cmd_z_command.message_cb = (Uil_continue_type(*)())NULL;
Uil_cmd_z_command.status_cb = (Uil_continue_type(*)())NULL;
Uil_cmd_z_command.ac_database = NULL;
Uil_cmd_z_command.v_database = FALSE;
#if debug_version
uil_v_dump_tokens = FALSE;
uil_v_dump_symbols = FALSE;
#endif
/* traverse the options on the command line */
for (i = 1; i < l_arg_count; i++)
{
/* check for an output file */
if ( strcmp("-o", rac_arg_value[ i ]) == 0 )
{
/* the next argument is the output file name */
/* check next field is not an option */
if (((i+1) >= l_arg_count) ||
( '-' == rac_arg_value[ i+1 ][ 0 ] ))
{
diag_issue_diagnostic
( d_miss_opt_arg,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ],
"output file"
);
continue;
}
if (Uil_cmd_z_command.ac_resource_file == NULL)
Uil_cmd_z_command.ac_resource_file = rac_arg_value[ i+1 ];
else
diag_issue_diagnostic
( d_dupl_opt,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ]
);
i = i + 1;
}
/* check for a binary database file */
else if ( strcmp("-wmd", rac_arg_value[ i ]) == 0 )
{
/* the next argument is the binary database file name */
/* check next field is not an option */
if (((i+1) >= l_arg_count) ||
( '-' == rac_arg_value[ i+1 ][ 0 ] ))
{
diag_issue_diagnostic
( d_miss_opt_arg,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ],
"binary database file"
);
continue;
}
if (!Uil_cmd_z_command.v_database)
{
Uil_cmd_z_command.v_database = TRUE;
Uil_cmd_z_command.ac_database = rac_arg_value[ i+1 ];
}
else
diag_issue_diagnostic
( d_dupl_opt,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ]
);
i = i + 1;
}
/* check for an listing file */
else if ( strcmp("-v", rac_arg_value[ i ]) == 0 )
{
/* the next argument is the listing file name */
/* check next field is not an option */
if (((i+1) >= l_arg_count) ||
( '-' == rac_arg_value[ i+1 ][ 0 ] ))
{
diag_issue_diagnostic
( d_miss_opt_arg,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ],
"listing file"
);
continue;
}
if (!Uil_cmd_z_command.v_listing_file)
{
Uil_cmd_z_command.v_listing_file = TRUE;
Uil_cmd_z_command.ac_listing_file = rac_arg_value[ i+1 ];
}
else
diag_issue_diagnostic
( d_dupl_opt,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ]
);
i = i + 1;
}
/* check for the machine code option */
else if ( strcmp("-m", rac_arg_value[ i ]) == 0 )
{
Uil_cmd_z_command.v_show_machine_code = TRUE;
}
/* check if warnings are to be supressed */
else if ( strcmp("-w", rac_arg_value[ i ]) == 0 )
{
Uil_cmd_z_command.v_report_info_msg = FALSE;
Uil_cmd_z_command.v_report_warn_msg = FALSE;
}
/* check if setlocale is to be enabled */
else if ( strcmp("-s", rac_arg_value[ i ]) == 0 )
{
Uil_cmd_z_command.v_use_setlocale = TRUE;
}
/* check for an unexpected option */
else if ( '-' == rac_arg_value[ i ][ 0 ] )
{
/* check for an include directory */
if ( 'I' == rac_arg_value[ i ][ 1 ] )
{
if (Uil_cmd_z_command.include_dir_count < Uil_k_max_include_dir_count)
include_list[Uil_cmd_z_command.include_dir_count++] =
& rac_arg_value[i] [2];
else
diag_issue_diagnostic
( d_too_many_dirs,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ], Uil_k_max_include_dir_count
);
} else
{
diag_issue_diagnostic
( d_unknown_opt,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ]
);
}
}
/* assume it is a UIL source file specification
* validation of the file spec is done when file is opened */
else
{
if (Uil_cmd_z_command.ac_source_file == NULL)
Uil_cmd_z_command.ac_source_file = rac_arg_value[ i ];
else
diag_issue_diagnostic
( d_add_source,
diag_k_no_source, diag_k_no_column,
rac_arg_value[ i ]
);
}
}
/*
** Check for a source file - otherwise issue a diagnostic.
*/
if (Uil_cmd_z_command.ac_source_file == NULL)
diag_issue_diagnostic
( d_no_source, diag_k_no_source, diag_k_no_column );
if (Uil_cmd_z_command.ac_resource_file == NULL)
{
Uil_cmd_z_command.ac_resource_file = XtMalloc (strlen ("a.uid") + 1);
strcpy (Uil_cmd_z_command.ac_resource_file,"a.uid");
}
/*
** Machine code listing only makes sense if listing is set.
*/
Uil_cmd_z_command.v_show_machine_code =
( Uil_cmd_z_command.v_listing_file &
Uil_cmd_z_command.v_show_machine_code);
}

View file

@ -1,94 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilCmdDef.h /main/10 1995/07/14 09:32:45 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interface to the UIL command line
** processing.
**
**--
**/
#ifndef UilCmdDef_h
#define UilCmdDef_h
/*
**
** INCLUDE FILES
**
**/
typedef struct
{
char *ac_source_file;
char *ac_resource_file;
char *ac_listing_file;
unsigned int include_dir_count; /* number of directories in */
/* ac_include_dir array */
char **ac_include_dir; /* pointer to array of */
/* directories to search for */
/* includes in */
unsigned v_listing_file: 1;
unsigned v_resource_file: 1;
unsigned v_show_machine_code: 1;
unsigned v_report_info_msg: 1;
unsigned v_report_warn_msg: 1;
unsigned v_parse_tree: 1; /* generate parse tree */
unsigned v_issue_summary: 1;
unsigned int status_update_delay; /* Number of times a status */
/* point is passed before */
/* calling statusCB routine */
/* 0 means called every time */
Uil_continue_type (*message_cb)();
char *message_data;
Uil_continue_type (*status_cb)();
char *status_data;
unsigned v_use_setlocale: 1; /* Allow localized strings */
char *ac_database;
unsigned v_database: 1;
} cmd_command_line_type;
#endif /* UilCmdDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,147 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilCompGl.h /main/10 1995/07/14 09:32:57 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file contains external declarations of all Uil
** compiler globals excluding those which define the recognized
** language which are declared in UilSymGl.h
**
**--
**/
#ifndef UilCompGl_h
#define UilCompGl_h
#include <setjmp.h>
/*
* Defined in UilCmd.c
*/
externalref cmd_command_line_type Uil_cmd_z_command;
/*
* Defined in UilData
*/
externalref boolean uil_v_case_sensitive;
externalref jmp_buf uil_az_error_env_block;
externalref boolean uil_az_error_env_valid;
#if debug_version
externalref boolean uil_v_dump_tokens;
externalref boolean uil_v_dump_symbols;
#endif
externalref status uil_l_compile_status;
externalref Uil_compile_desc_type *Uil_compile_desc_ptr;
externalref int Uil_percent_complete;
externalref int Uil_lines_processed;
externalref char *Uil_current_file;
/*
* Defined in UilDiags
*/
externalref int Uil_message_count[];
/*
* Defined in UilLexAna
*/
externalref int Uil_lex_l_user_default_charset;
externalref sym_value_entry_type *Uil_lex_az_charset_entry;
externalref int Uil_lex_l_charset_specified;
externalref int Uil_lex_l_localized;
externalref int Uil_lex_l_literal_charset;
externalref sym_value_entry_type *Uil_lex_az_literal_charset;
externalref char *comment_text;
externalref int comment_size;
/* % Complete */
externalref int Uil_characters_read;
/*
* Defined in UilLstLst
*/
externalref char Uil_lst_c_title2[];
/*
* Defined in UilP2Out
*/
externalref IDBFile out_az_idbfile_id;
/*
* Defined in UilSarMod
*/
externalref src_source_record_type *src_az_module_source_record;
externalref unsigned short int *uil_urm_variant;
externalref unsigned short int *uil_arg_compr;
externalref unsigned short int *uil_reas_compr;
externalref unsigned short int *uil_widget_compr;
externalref unsigned short int *uil_child_compr;
/*
* Defined in UilSrcSrc
*/
externalref src_source_buffer_type *src_az_current_source_buffer;
externalref src_source_buffer_type *src_az_avail_source_buffer;
externalref src_message_item_type *src_az_orphan_messages;
externalref src_source_record_type *src_az_current_source_record;
externalref src_source_record_type *src_az_first_source_record;
externalref uil_fcb_type *src_az_source_file_table[];
externalref int src_l_last_source_file_number;
/* %COMPLETE */
externalref long Uil_file_size;
/*
* Defined in UilSymStor
*/
externalref sym_name_entry_type *sym_az_hash_table[];
externalref sym_value_entry_type *sym_az_error_value_entry;
externalref sym_external_def_entry_type *sym_az_external_def_chain;
externalref sym_forward_ref_entry_type *sym_az_forward_ref_chain;
externalref sym_val_forward_ref_entry_type *sym_az_val_forward_ref_chain;
externalref sym_module_entry_type *sym_az_module_entry;
externalref sym_root_entry_type *sym_az_root_entry;
externalref sym_section_entry_type *sym_az_current_section_entry;
externalref sym_entry_type *sym_az_entry_list_header;
externalref URMPointerListPtr sym_az_allocated_nodes;
externalref URMPointerListPtr sym_az_freed_nodes;
#endif /* UilCompGl_h */
/* DON'T ADD STUFF AFTER THIS #endif */

File diff suppressed because it is too large Load diff

View file

@ -1,210 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: UilData.c /main/14 1999/04/16 10:41:44 mgreess $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** Global data definitions
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include <setjmp.h>
#include <Dt/Editor.h>
#include <Dt/Help.h>
#include <Dt/HelpDialog.h>
#include <Dt/HelpQuickD.h>
#include <Dt/MenuButton.h>
#include <Dt/Print.h>
#include <Dt/TermPrim.h>
#include <Dt/Term.h>
#include <Mrm/MrmAppl.h>
#include <Mrm/Mrm.h>
#include <Xm/MwmUtil.h> /* For MWM_*_* defines. */
#include "UilDefI.h"
#include "UilSymGen.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/* Case sensitivity switch; TRUE if case sensitive. */
externaldef(uil_comp_glbl) boolean uil_v_case_sensitive = TRUE;
/* Location to store error type. */
externaldef(uil_comp_glbl) jmp_buf uil_az_error_env_block;
externaldef(uil_comp_glbl) boolean uil_az_error_env_valid = FALSE;
/* Debugging switches. */
#if debug_version
externaldef(uil_comp_glbl) boolean uil_v_dump_tokens = FALSE;
externaldef(uil_comp_glbl) boolean uil_v_dump_symbols = FALSE;
#endif
externaldef(uil_comp_glbl) status uil_l_compile_status = uil_k_success_status;
externaldef(uil_comp_glbl) Uil_compile_desc_type *Uil_compile_desc_ptr = NULL;
externaldef(uil_comp_glbl) int Uil_percent_complete = 0;
externaldef(uil_comp_glbl) int Uil_lines_processed = 0;
externaldef(uil_comp_glbl) char *Uil_current_file = "";
/* Define the user-defined object and default character set */
externaldef(uil_sym_glbl) unsigned short int uil_sym_user_defined_object =
sym_k_user_defined_object;
externaldef(uil_sym_glbl) unsigned short int uil_sym_default_charset =
sym_k_iso_latin1_charset;
externaldef(uil_sym_glbl) unsigned short int uil_sym_isolatin1_charset =
sym_k_iso_latin1_charset;
/* argument types, allowed tables, constraints, related arguments */
#include "UilSymArTy.h"
#include "UilSymRArg.h"
#include "UilSymArTa.h"
#include "UilSymReas.h"
#include "UilSymCtl.h"
#include "UilConst.h"
/* Allowed children and child classes */
#include "UilSymChCl.h"
#include "UilSymChTa.h"
/* sym_k... to name vectors. */
#include "UilSymNam.h"
/* Define mapping of sym_k_..._value to data type names. */
externaldef(uil_comp_glbl) int uil_max_value = sym_k_max_value;
externaldef(uil_comp_glbl) char *uil_datatype_names [] = {
"", /* NOT USED */
"any",
"boolean",
"string", /* char 8 */
"compound_string",
"float",
"integer",
"single_float",
"localized_string",
"wchar_string",
"horizontal_dimension_integer",
"vertical_dimension_integer",
"horizontal_dimension_float",
"vertical_dimension_float",
"argument",
"asciz_table",
"class_rec_name",
"color",
"color_table",
"font",
"font_table",
"icon",
"identifier",
"integer_table",
"keysym",
"pixmap",
"reason",
"rgb",
"string_table",
"translation_table",
"widget_ref",
"xbitmapfile",
"fontset",
"child",
};
/* Enumeration Set/Value tables */
#include "UilSymEnum.h"
/* Character set attribute tables */
#include "UilSymCSet.h"
/* Mrm encoding information */
#include "UilUrmClas.h"
/* Names of tokens in grammar */
#include "UilTokName.h"
/* The keyword tables */
#include "UilKeyTab.h"
/*
**
** OWN VARIABLE DECLARATIONS
**
**/

View file

@ -1,105 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilDef.h /main/13 1995/07/14 09:33:37 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the set of definitions used by the public
** access routines Uil and UilDumpSymbolTable.
**
**--
**/
#ifndef UilDef_h
#define UilDef_h
#if !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus) \
&& !defined(FUNCPROTO) && !defined(XTFUNCPROTO) && !defined(XMFUNCPROTO)
#define _NO_PROTO
#endif /* __STDC__ */
/*
**
** INCLUDE FILES
**
**/
/*
** Includes needed by other include files.
*/
#include <X11/Intrinsic.h>
/*
**
** Common includes needed by public functions.
**
*/
#include <uil/Uil.h>
#include <uil/UilDBDef.h> /* This has to be loaded first. */
#include <uil/UilSymGl.h>
#include <uil/UilSymDef.h>
/*
** Function declarations not defined elsewhere
*/
#define _ARGUMENTS(arglist) arglist
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* uilmain.c */
extern Uil_status_type Uil _ARGUMENTS((Uil_command_type
*comand_desc,Uil_compile_desc_type *compile_desc,Uil_continue_type
(*message_cb)(), char *message_data, Uil_continue_type (*status_cb)(),
char *status_data));
/* uilsymstor.c */
extern void UilDumpSymbolTable _ARGUMENTS(( sym_entry_type *node_entry ));
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* UilDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,620 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $TOG: UilDefI.h /main/13 1999/07/07 10:24:15 vipin $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the set of definitions used by all of
** modules of the UIL compiler.
**
**--
**/
#ifndef UilDefI_h
#define UilDefI_h
/*
**
** INCLUDE FILES
**
**/
#define X_INCLUDE_TIME_H
#define XOS_USE_XT_LOCKING
#include <X11/Xos_r.h> /* for _Xctimeparams */
#include <Mrm/MrmAppl.h>
#include <Mrm/Mrm.h>
/*
**
** Universal Definitions
**
*/
#define _compiler_version "V2.0-000"
#define _compiler_version_int 2
#define _data_version 2
#define _host_compiler "Motif Uil Compiler"
#ifdef TRUE
#undef TRUE
#endif
#define TRUE 1
#ifdef FALSE
#undef FALSE
#endif
#define FALSE 0
#ifndef debug_version
#define debug_version FALSE
#endif
#define NOSTRING_DIRECTION 2
#define k_normal 1
#define k_error 0
typedef int status;
typedef int boolean;
/*
** Copy const handling from XmP.h.
*/
#ifndef XmConst
#if defined(__STDC__) || !defined( NO_CONST )
#define XmConst const
#else
#define XmConst
#endif /* __STDC__ */
#endif /* XmConst */
/* Uil will automatically strip this prefix when saving name of automatically
* created child. This is used to prevent name conflicts in existing uil
* files. Children names without this prefix will be saved as is.
*/
#define AUTO_CHILD_PREFIX "Xm_"
/*
**
** Constants controlling limits in the compiler
**
*/
#define src_k_max_source_files 101
#define src_k_max_source_line_length 132
#define lex_k_unprint_sub '?'
#define sym_k_max_list_count 1000
#define sym_k_max_color_count 256
#define Uil_k_max_include_dir_count 32
/*
**
** Definition of Compiler Termination Statuses
**
*/
#define uil_k_min_status Uil_k_min_status
#define uil_k_success_status Uil_k_success_status
#define uil_k_info_status Uil_k_info_status
#define uil_k_warning_status Uil_k_warning_status
#define uil_k_error_status Uil_k_error_status
#define uil_k_severe_status Uil_k_severe_status
#define uil_k_max_status Uil_k_max_status
/*
**
** Macros to access bit vectors
**
*/
/* MOVED TO DBDef.h */
/*
**
** Upper and Lower Case Translation Macros
**
*/
#define _upper(c) ((c) >= 'a' && (c) <= 'z' ? (c) & 0x5F:(c))
#define _lower(c) ((c) >= 'A' && (c) <= 'Z' ? (c) | 0x20:(c))
/*
**
** Assert Macro
**
*/
#if debug_version
#define _assert( __condition, __text ) \
if (!(__condition)) \
{ diag_issue_internal_error( (__text)); }
#else
#define _assert( __condition, __text ) \
if (!(__condition)) \
{ diag_issue_internal_error( NULL ); }
#endif
/*
**
** _error and _okay macro
**
*/
#define _error( __status ) \
((__status & 1)==0)
#define _success( __status ) \
((__status & 1)==1)
/*
**
** Memory allocation definitions
**
*/
#define _get_memory XtMalloc
#define _free_memory XtFree
/*
**
** Move macro
**
*/
#ifdef NO_MEMMOVE
/* For fixing the bug CR 4581 */
extern char* uil_mmove(char*, char*, int);
#define _move uil_mmove
#else
#define _move memmove
#endif /* NO_MEMMOVE */
/*
**
** Compare macro
**
*/
#define _compare strcmp
/*
**
** Fill macro
**
*/
#define _fill( __string, __char, __len ) \
{ \
register int i = __len; \
while (--i >= 0) \
(__string)[i] = __char; \
}
/*
**
** Index macro
**
*/
#define _index( __char, __string, __len ) \
((int)((char *)memchr( __string, __char, __len ) - (char *)__string ))
/*
**
** Debug output macro
**
*/
#if debug_version
#define _debug_output lst_debug_output
#else
#define _debug_output printf
#endif
/*
**
** Common includes needed by most modules
**
*/
#include "Uil.h"
#include "UilDBDef.h" /* for binary database */
#include "UilMess.h"
#include "UilSymDef.h" /* must come before UilKeyDef.h */
#include "UilSrcDef.h" /* must come before UilIODef.h */
#include "UilIODef.h"
#include "UilDiagDef.h"
#include "UilSarDef.h"
#if defined(linux)
#define YYSTYPE yystype
#endif
#include "UilLexPars.h"
#include "UilCmdDef.h"
#include "UilLexDef.h"
/*
** Global declarations
*/
#include "UilSymGl.h"
#include "UilCompGl.h"
/* Needed for following macro. */
#include "UilSymGen.h"
#define DEFAULT_TAG uil_charset_names[sym_k_XmFONTLIST_DEFAULT_TAG_charset]
/*
** Function declarations not defined elsewhere
*/
#define _ARGUMENTS(arglist) arglist
/* uilcmd.c */
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
extern void diag_issue_diagnostic
_ARGUMENTS(( int d_message_number ,
src_source_record_type *az_src_rec ,
int l_start_column, ... ));
extern void lst_debug_output _ARGUMENTS(( char *format, ... ));
void cmd_decode_command_line _ARGUMENTS(( int l_arg_count , char *rac_arg_value []));
/* uildb.c */
extern void db_incorporate _ARGUMENTS(( void ));
extern void db_read_ints_and_string _ARGUMENTS((_db_header_ptr header));
extern void db_read_char_table _ARGUMENTS((_db_header_ptr header));
extern void db_read_length_and_string _ARGUMENTS((_db_header_ptr header));
extern void db_read_int_and_shorts _ARGUMENTS((_db_header_ptr header));
extern void db_open_file _ARGUMENTS(( void ));
extern String get_root_dir_name _ARGUMENTS(( void ));
extern String init_wmd_path _ARGUMENTS((String filename));
/* uildiags.c */
extern void diag_issue_summary _ARGUMENTS(( void ));
extern char *diag_tag_text _ARGUMENTS(( int XmConst b_tag ));
extern char *diag_object_text _ARGUMENTS(( int XmConst b_type ));
extern char *diag_value_text _ARGUMENTS(( int XmConst b_type ));
extern char *diag_charset_text _ARGUMENTS(( int XmConst b_type ));
extern void diag_initialize_diagnostics _ARGUMENTS(( void ));
extern void diag_restore_diagnostics _ARGUMENTS(( void ));
extern void diag_reset_overflow_handler _ARGUMENTS(( void ));
extern void diag_handler _ARGUMENTS(( int l_error ));
extern void diag_issue_internal_error _ARGUMENTS(( char *error_text ));
extern void write_msg_to_standard_error _ARGUMENTS(( XmConst int message_number , XmConst char *src_buffer , XmConst char *ptr_buffer , XmConst char *msg_buffer , XmConst char *loc_buffer ));
extern char XmConst *diag_get_message_abbrev _ARGUMENTS(( int d_message_number ));
extern void diag_report_status _ARGUMENTS(( void ));
/* uilkeytab.c */
extern key_keytable_entry_type *key_find_keyword _ARGUMENTS(( unsigned int symbol_length , char *symbol_ptr ));
extern void key_initialize _ARGUMENTS(( void ));
/* uillexana.c */
extern int yylex _ARGUMENTS(( void ));
extern void lex_initialize_analyzer _ARGUMENTS(( void ));
extern void Uil_lex_cleanup_analyzer _ARGUMENTS(( void ));
extern void lex_issue_error _ARGUMENTS(( int restart_token ));
extern void issue_control_char_diagnostic _ARGUMENTS(( unsigned char c_char ));
extern void lex_filter_unprintable_chars _ARGUMENTS(( unsigned char *buffer , int length , unsigned long flags ));
extern long cvt_ascii_to_long _ARGUMENTS(( unsigned char XmConst *c_text ));
extern sym_value_entry_type *create_str_entry _ARGUMENTS(( int l_size , int l_charset , sym_value_entry_type *az_charset_entry ));
/* uillstlst.c */
extern void lst_open_listing _ARGUMENTS(( void ));
extern void Uil_lst_cleanup_listing _ARGUMENTS(( void ));
extern status create_listing_file _ARGUMENTS(( uil_fcb_type *az_fcb ));
extern void lst_output_line _ARGUMENTS(( char *ac_line , boolean v_new_page ));
extern char *current_time _ARGUMENTS(( _Xctimeparams *ctime_buf ));
extern void lst_output_listing _ARGUMENTS(( void ));
extern void lst_output_messages _ARGUMENTS(( src_message_item_type *az_message_item ));
extern void lst_output_machine_code _ARGUMENTS(( src_source_record_type *az_src_rec ));
extern void lst_output_message_ptr_line _ARGUMENTS(( src_source_record_type *az_src_rec , char *src_buffer ));
/* uillstmac.c */
extern void save_widget_machine_code _ARGUMENTS(( sym_widget_entry_type *widget_entry , URMResourceContext *az_context ));
extern void unload_stack _ARGUMENTS(( char *rec , int rec_size , src_source_record_type *az_src_rec ));
extern void save_value_machine_code _ARGUMENTS(( sym_value_entry_type *value_entry , URMResourceContext *az_context ));
extern void save_module_machine_code _ARGUMENTS(( src_source_record_type *az_src_rec , URMResourceContext *az_context ));
extern void off_put _ARGUMENTS(( unsigned short off_type , unsigned short off_offset ));
extern void off_get _ARGUMENTS(( unsigned short *off_type , unsigned short *off_offset ));
extern char *type_from_code _ARGUMENTS(( MrmType type_code ));
extern char *access_from_code _ARGUMENTS(( MrmFlag access_code ));
extern char *group_from_code _ARGUMENTS(( MrmGroup group_code ));
extern void format_arg_value _ARGUMENTS(( RGMArgValuePtr argval_ptr , char *buffer ));
extern char *class_name_from_code _ARGUMENTS(( MrmCode mrm_class ));
extern char *resource_name_from_code _ARGUMENTS(( MrmCode resource ));
/* uilmain.c */
extern void uil_exit _ARGUMENTS(( int severity ));
extern Uil_status_type Uil _ARGUMENTS((Uil_command_type
*comand_desc,Uil_compile_desc_type *compile_desc,Uil_continue_type
(*message_cb)(), char *message_data, Uil_continue_type (*status_cb)(),
char *status_data));
/* uilp2out.c */
extern void sem_output_uid_file _ARGUMENTS(( void ));
extern void push _ARGUMENTS(( sym_entry_type *sym_entry ));
extern sym_entry_type *pop _ARGUMENTS(( void ));
extern void out_emit_widget _ARGUMENTS(( sym_widget_entry_type *widget_entry ));
extern void extract_subtree_control _ARGUMENTS(( sym_list_entry_type *list_entry , sym_control_entry_type **menu_entry , int *count ));
extern void extract_create_callback _ARGUMENTS(( sym_list_entry_type *list_entry , sym_callback_entry_type **create_entry ));
extern void process_all_callbacks _ARGUMENTS(( sym_list_entry_type *list_entry , int *arglist_index ));
extern void process_all_arguments _ARGUMENTS(( sym_list_entry_type *list_entry , int *arglist_index , int *related_count ));
extern void process_all_controls _ARGUMENTS(( sym_list_entry_type *list_entry , int *widget_index ));
extern void out_emit_value _ARGUMENTS(( sym_value_entry_type *value_entry ));
extern void emit_callback _ARGUMENTS(( sym_callback_entry_type *callback_entry , int *arglist_index , boolean emit_create ));
extern void emit_callback_procedures _ARGUMENTS(( sym_proc_ref_entry_type *proc_ref_entry_next, int *proc_ref_index, MrmOffset callback_offset ));
extern int count_proc _ARGUMENTS(( sym_list_entry_type *proc_list, int count));
extern void emit_argument _ARGUMENTS(( sym_argument_entry_type *argument_entry , int arglist_index , int *related_arg_count ));
extern void emit_control _ARGUMENTS(( sym_control_entry_type *control_entry , int control_offset ));
extern MrmCode ref_value _ARGUMENTS(( sym_value_entry_type *value_entry , MrmCode *arg_type , long *arg_value , MrmCode *arg_access , char **arg_index , MrmResource_id *arg_id , MrmCode *arg_group ));
extern MrmCode ref_control _ARGUMENTS(( sym_control_entry_type *control_entry , MrmCode *access , char **index , MrmResource_id *id ));
extern void issue_urm_error _ARGUMENTS(( char *problem ));
extern MrmCode Urm_code_from_uil_type _ARGUMENTS(( int uil_type ));
extern int compute_color_table_size _ARGUMENTS(( sym_value_entry_type *table_entry ));
extern void create_color_table _ARGUMENTS(( sym_value_entry_type *table_entry , char *buffer ));
extern int compute_icon_size _ARGUMENTS(( sym_value_entry_type *icon_entry ));
extern void create_icon _ARGUMENTS(( sym_value_entry_type *icon_entry , char *buffer ));
extern int compute_list_size _ARGUMENTS(( sym_list_entry_type *list_entry , int type ));
extern void create_int_compression_codes _ARGUMENTS(( void ));
extern void create_ext_compression_codes _ARGUMENTS(( void ));
/* uilp2reslv.c */
extern void sem_resolve_forward_refs _ARGUMENTS(( void ));
/* uilsarcomp.c */
extern sym_value_entry_type *sem_create_cstr _ARGUMENTS(( void ));
extern sym_value_entry_type *sem_create_wchar_str _ARGUMENTS(( void ));
extern void sem_append_str_to_cstr _ARGUMENTS(( sym_value_entry_type *az_cstr_entry , sym_value_entry_type *az_str_entry , boolean op2_temporary ));
extern void sem_append_cstr_to_cstr _ARGUMENTS(( sym_value_entry_type *az_cstr1_entry , sym_value_entry_type *az_cstr2_entry , boolean op2_temporary ));
extern sym_value_entry_type *sem_cat_str_to_str _ARGUMENTS(( sym_value_entry_type *az_str1_entry , boolean op1_temporary , sym_value_entry_type *az_str2_entry , boolean op2_temporary ));
extern int sem_map_subclass_to_charset _ARGUMENTS(( int charset_as_subclass ));
extern void sar_charset_verify _ARGUMENTS(( yystype *charset_frame ));
extern void sar_make_fallback_charset _ARGUMENTS((yystype *name_frame));
extern void sar_chk_charset_attr _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *prior_value_frame ));
extern void sar_make_charset _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *attr_frame , yystype *keyword_frame ));
/* uilsarexp.c */
extern void sar_binary_op _ARGUMENTS(( yystype *operator_frame , yystype *op1_frame , yystype *op2_frame ));
extern void sar_unary_op _ARGUMENTS(( yystype *operator_frame , yystype *op1_frame ));
/* uilsarinc.c */
extern void sar_include_file _ARGUMENTS(( yystype *file_frame , yystype *include_frame , yystype *semi_frame ));
/* uilsarmod.c */
extern void sar_initialize _ARGUMENTS(( void ));
extern void sar_create_root _ARGUMENTS(( yystype *root_frame ));
extern void sar_create_module _ARGUMENTS(( yystype *target_frame , yystype *id_frame , yystype *module_frame ));
extern void sar_process_module_version _ARGUMENTS(( yystype *value_frame , yystype *start_frame ));
extern void sar_process_module_sensitivity _ARGUMENTS(( yystype *token_frame , yystype *start_frame ));
extern void sar_process_module_charset _ARGUMENTS(( yystype *token_frame , yystype *start_frame ));
extern void sar_save_module_source _ARGUMENTS(( void ));
extern void sar_make_def_obj _ARGUMENTS(( yystype *object_frame ));
extern void sar_process_module_variant _ARGUMENTS(( yystype *obj_type_frame , yystype *variant_frame ));
extern void sar_save_section_source _ARGUMENTS(( yystype *header_frame , int section_type ));
/* uilsarobj.c */
extern void sar_assoc_comment _ARGUMENTS(( sym_obj_entry_type *object ));
extern void sar_create_object _ARGUMENTS(( yystype *object_frame , unsigned char object_type ));
extern void sar_create_child _ARGUMENTS(( yystype *object_frame ));
extern void sar_link_section _ARGUMENTS(( yystype *id_frame ));
extern void sar_save_src_semicolon_pos _ARGUMENTS(( yystype *semi_frame ));
extern void sar_save_list_end _ARGUMENTS(( yystype *close_frame ));
extern void sar_save_src_entry_end _ARGUMENTS(( yystype *close_frame , yystype *entry_frame ));
extern void sar_set_object_flags _ARGUMENTS(( yystype *current_frame , unsigned char mask ));
extern void sar_unset_object_flags _ARGUMENTS(( yystype *current_frame , unsigned char mask ));
extern void sar_set_list_type _ARGUMENTS(( yystype *current_frame ));
extern void sar_set_object_class _ARGUMENTS(( yystype *current_frame ));
extern void sar_set_object_variant _ARGUMENTS(( yystype *current_frame ));
extern yystype *sem_find_object _ARGUMENTS(( yystype *current_frame ));
extern void sar_object_reference _ARGUMENTS(( yystype *ref_frame ));
extern void sar_update_parent_list _ARGUMENTS(( yystype *control_list_frame ));
extern void parent_list_traverse _ARGUMENTS(( sym_widget_entry_type *widget_entry , sym_list_entry_type *control_list_entry ));
extern void sar_save_feature _ARGUMENTS(( yystype *feature_frame ));
extern void sar_save_argument_pair _ARGUMENTS(( yystype *argument_frame , yystype *value_frame , yystype *equals_frame ));
extern void sar_save_reason_binding _ARGUMENTS(( yystype *reason_frame , yystype *proc_ref_frame , yystype *equals_frame ));
extern void sar_save_control_item _ARGUMENTS(( yystype *managed_frame , yystype *item_frame ));
extern void sar_save_control_widget _ARGUMENTS(( yystype *control_frame , yystype *item_frame ));
extern void sar_save_user_proc_ref_src _ARGUMENTS(( yystype *procedure_frame , yystype *proc_id_frame , yystype *proc_arg_frame ));
extern void sar_process_proc_ref _ARGUMENTS(( yystype *proc_id_frame , yystype *proc_arg_frame , int context ));
extern void sar_add_list_entry _ARGUMENTS(( yystype *entry_frame ));
extern void sar_add_forward_list_entry _ARGUMENTS(( yystype *entry_frame ));
extern void sar_verify_object _ARGUMENTS(( yystype *current_frame ));
extern sym_entry_type *sem_allocate_node _ARGUMENTS(( unsigned char node_tag , unsigned short node_size ));
extern void sem_free_node _ARGUMENTS(( sym_entry_type *node_ptr ));
/* uilsarproc.c */
extern void sar_create_procedure _ARGUMENTS(( XmConst yystype *id_frame , XmConst yystype *param_frame , XmConst yystype *class_frame , XmConst yystype *semi_frame ));
extern sym_proc_ref_entry_type *sem_reference_procedure _ARGUMENTS(( yystype *id_frame , XmConst yystype *value_frame , XmConst int context ));
extern sym_entry_type *sem_ref_name _ARGUMENTS(( yystype *id_frame , XmConst int tag ));
/* uilsarval.c */
extern void sar_map_keyword_to_name _ARGUMENTS(( yystype *target_frame , yystype *keyword_frame ));
extern void sar_process_id _ARGUMENTS(( yystype *target_frame , yystype *id_frame ));
extern void sar_process_id_ref _ARGUMENTS(( yystype *id_frame ));
extern void sar_make_private_value _ARGUMENTS(( yystype *value_frame , yystype *token_frame , int value_type , yystype *keyword_frame , int arg_type ));
extern void sar_make_rgb_private_value _ARGUMENTS(( yystype *value_frame , yystype *token_frame , int value_type , yystype *keyword_frame , int arg_type ));
extern void sar_append_table_value _ARGUMENTS(( yystype *value_frame , yystype *table_frame , int table_type , yystype *comma_frame ));
extern void sar_value_not_implemented _ARGUMENTS(( yystype *value_frame , yystype *token_frame , char *error_text ));
extern void sar_cat_value _ARGUMENTS(( yystype *operator_frame , yystype *op1_frame , yystype *op2_frame ));
extern void sar_chk_comp_str_attr _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *prior_value_frame ));
extern void sar_make_comp_str _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *attr_frame , yystype *keyword_frame ));
extern void sar_make_comp_str_comp _ARGUMENTS((yystype *target_frame, yystype *type_frame, yystype *value_frame, yystype *keyword_frame));
extern void sar_make_wchar_str _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *attr_frame , yystype *keyword_frame ));
extern void sar_value_type_error _ARGUMENTS(( yystype *value_frame , int expected_type ));
extern void sar_private_error _ARGUMENTS(( yystype *value_frame ));
extern void sar_import_value_entry _ARGUMENTS(( yystype *target_frame , yystype *token_frame ));
extern void sar_bind_value_name _ARGUMENTS(( yystype *id_frame , yystype *value_frame , yystype *semi_frame ));
extern sym_name_entry_type *sem_dcl_name _ARGUMENTS(( XmConst yystype *id_frame ));
extern sym_value_entry_type *sem_create_value_entry _ARGUMENTS(( char *value , int length , int value_type ));
extern void sar_create_identifier _ARGUMENTS(( XmConst yystype *id_frame , XmConst yystype *semi_frame ));
extern void sar_make_font_table _ARGUMENTS(( yystype *target_frame , yystype *font_frame , yystype *prior_target_frame , yystype *keyword_frame ));
extern void sar_make_font_item _ARGUMENTS(( yystype *target_frame , yystype *charset_frame , yystype *font_frame ));
extern void sar_make_font _ARGUMENTS(( yystype *target_frame , yystype *charset_frame , yystype *value_frame , yystype *keyword_frame ));
extern void sar_make_fontset _ARGUMENTS(( yystype *target_frame , yystype *charset_frame , yystype *value_frame , yystype *keyword_frame ));
extern void sar_make_color_item _ARGUMENTS(( yystype *target_frame , yystype *color_frame , yystype *letter_frame ));
extern void sar_append_color_item _ARGUMENTS(( yystype *target_frame , yystype *item_frame , yystype *prior_target_frame ));
extern void sar_make_color_table _ARGUMENTS(( yystype *target_frame , yystype *list_frame , yystype *keyword_frame ));
extern void sar_make_color _ARGUMENTS(( yystype *target_frame , yystype *color_frame , yystype *mono_frame , yystype *keyword_frame ));
extern void sar_make_icon _ARGUMENTS(( yystype *target_frame , yystype *list_frame , yystype *table_frame , yystype *keyword_frame ));
/* uilsemcset.c */
extern char *sem_charset_name _ARGUMENTS(( int l_charset , sym_value_entry_type *az_charset_entry ));
extern void sem_charset_info _ARGUMENTS(( int l_charset , sym_value_entry_type *az_charset_entry , int *write_direction , int *parse_direction , int *sixteen_bit ));
extern int sem_charset_lang_name _ARGUMENTS(( char *lang_charset ));
/* uilsemval.c */
typedef union {
boolean boolean_value;
int integer_value;
double real_value;
char character_value; /* character data type RAP */
float single_float_value; /* single float data type RAP */
} data_value_type;
extern void sem_validation _ARGUMENTS(( void ));
extern void sem_validate_node _ARGUMENTS(( sym_entry_type *node ));
extern sym_value_entry_type *sem_validate_value_node _ARGUMENTS(( sym_value_entry_type *value_node ));
extern void sem_validate_widget_node _ARGUMENTS(( sym_widget_entry_type *widget_node ));
extern void sem_validate_argument_list _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_argument_entry_type **seen ));
extern void sem_validate_argument_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_argument_entry_type *argument_entry , sym_argument_entry_type **seen ));
extern void sem_validate_argument_enumset _ARGUMENTS(( sym_argument_entry_type *argument_entry , int arg_code , sym_value_entry_type *arg_value_entry ));
extern void sem_validate_constraint_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , sym_argument_entry_type *argument_entry, unsigned int widget_type ));
extern void sem_validate_callback_list _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_callback_entry_type **seen ));
extern void sem_validate_callback_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_callback_entry_type *callback_entry , sym_callback_entry_type **seen ));
extern void sem_validate_control_list _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , int *count ));
extern void sem_validate_control_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_control_entry_type *control_entry , int *gadget_count ));
extern void sem_validate_widget_cycle _ARGUMENTS(( sym_list_entry_type *list_entry , sym_name_entry_type *cycle_name ));
extern boolean sem_validate_widget_cycle_aux _ARGUMENTS(( sym_list_entry_type *list_entry , sym_name_entry_type *cycle_name ));
extern boolean sem_validate_verify_cycle _ARGUMENTS(( sym_widget_entry_type *cycle_obj , sym_list_entry_type *list_entry ));
extern void sem_validate_procref_list _ARGUMENTS(( sym_list_entry_type *list_entry ));
extern void sem_validate_procref_entry _ARGUMENTS(( sym_proc_ref_entry_type *procref_entry ));
extern boolean sem_argument_allowed _ARGUMENTS(( unsigned int arg_code , unsigned int class_code ));
extern boolean sem_reason_allowed _ARGUMENTS(( unsigned int rsn_code , unsigned int class_code ));
extern boolean sem_control_allowed _ARGUMENTS(( unsigned int ctl_code , unsigned int class_code ));
extern boolean sem_child_allowed _ARGUMENTS(( unsigned int ctl_code , unsigned int class_code ));
extern sym_value_entry_type *sem_evaluate_value _ARGUMENTS(( sym_value_entry_type *val_entry ));
extern sym_value_entry_type *sem_evaluate_value_cs _ARGUMENTS(( sym_value_entry_type *csval_entry ));
/* BEGIN OSF Fix CR 4859 */
/* END OSF Fix CR 4859 */
extern sym_value_entry_type *sem_evaluate_value_expr _ARGUMENTS(( sym_value_entry_type *value_entry ));
extern int validate_arg _ARGUMENTS(( sym_value_entry_type *operand_entry , int v_operator ));
extern int sem_convert_to_float _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value ));
extern int sem_convert_to_integer _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value ));
extern int sem_convert_to_single_float _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value ));
extern int sem_convert_to_error _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value ));
extern void sar_cat_value_entry _ARGUMENTS(( sym_value_entry_type **target_entry , sym_value_entry_type *op1_entry , sym_value_entry_type *op2_entry ));
/* uilsrcsrc.c */
extern void src_initialize_source _ARGUMENTS(( void ));
extern void Uil_src_cleanup_source _ARGUMENTS(( void ));
extern void src_open_file _ARGUMENTS(( XmConst char *c_file_name , char *full_file_name ));
extern status src_get_source_line _ARGUMENTS(( void ));
extern status open_source_file _ARGUMENTS(( XmConst char *c_file_name , uil_fcb_type *az_fcb , src_source_buffer_type *az_source_buffer ));
extern status close_source_file _ARGUMENTS(( uil_fcb_type *az_fcb ));
extern status get_line _ARGUMENTS(( uil_fcb_type *az_fcb ));
extern boolean reget_line _ARGUMENTS(( uil_fcb_type *az_fcb , char *c_buffer , XmConst z_key *z_access_key ));
extern char *src_get_file_name _ARGUMENTS(( XmConst src_source_record_type *az_src_rec ));
extern boolean src_retrieve_source _ARGUMENTS(( XmConst src_source_record_type *az_src_rec , char *c_buffer ));
extern void src_append_diag_info _ARGUMENTS(( XmConst src_source_record_type *az_src_rec , XmConst int l_src_pos , XmConst char *c_msg_text , XmConst int l_msg_number ));
extern void src_append_machine_code _ARGUMENTS(( src_source_record_type *az_src_rec , XmConst int l_offset , XmConst int l_code_len , XmConst char *c_code , XmConst char *c_text_arg ));
/* uilsymnam.c */
extern sym_name_entry_type *sym_find_name _ARGUMENTS(( int l_length , char *c_text ));
extern sym_name_entry_type *sym_insert_name _ARGUMENTS(( int l_length , char *c_text ));
extern int hash_function _ARGUMENTS(( int l_length , char *c_value ));
#if debug_version
extern void sym_dump_hash_table _ARGUMENTS(( void ));
#endif
/* uilsymstor.c */
extern void sym_initialize_storage _ARGUMENTS(( void ));
extern void Uil_sym_cleanup_storage _ARGUMENTS(( boolean freealloc ));
extern void sym_make_external_def _ARGUMENTS(( XmConst sym_name_entry_type *az_name ));
extern void sym_make_forward_ref _ARGUMENTS(( XmConst yystype *az_id_frame , XmConst int l_widget_type , XmConst char *a_location ));
extern void sym_make_value_forward_ref _ARGUMENTS(( XmConst yystype *az_value_frame , XmConst char *a_location , XmConst unsigned char fwd_ref_flags ));
extern void UilDumpSymbolTable _ARGUMENTS(( sym_entry_type *node_entry ));
extern void sym_dump_symbols _ARGUMENTS(( void ));
extern void sym_dump_symbol _ARGUMENTS(( sym_entry_type *az_symbol_entry ));
extern void sym_dump_widget _ARGUMENTS(( XmConst sym_widget_entry_type *az_widget_entry ));
extern void sym_dump_argument _ARGUMENTS(( XmConst sym_argument_entry_type *az_argument_entry ));
extern void sym_dump_control _ARGUMENTS(( XmConst sym_control_entry_type *az_control_entry ));
extern void sym_dump_callback _ARGUMENTS(( XmConst sym_callback_entry_type *az_callback_entry ));
extern void sym_dump_list _ARGUMENTS(( XmConst sym_list_entry_type *az_list_entry ));
extern void sym_dump_name _ARGUMENTS(( XmConst sym_name_entry_type *az_name_entry ));
extern void sym_dump_module _ARGUMENTS(( XmConst sym_module_entry_type *az_module_entry ));
extern void sym_dump_color_item _ARGUMENTS(( XmConst sym_color_item_entry_type *az_color_item_entry ));
extern void sym_dump_parent_list_item _ARGUMENTS(( XmConst sym_parent_list_type *az_parent_list_item ));
extern void sym_dump_external_def _ARGUMENTS(( XmConst sym_external_def_entry_type *az_external_def_entry ));
extern void sym_dump_proc_def _ARGUMENTS(( XmConst sym_proc_def_entry_type *az_proc_def_entry ));
extern void sym_dump_proc_ref _ARGUMENTS(( XmConst sym_proc_ref_entry_type *az_proc_ref_entry ));
extern void sym_dump_forward_ref _ARGUMENTS(( XmConst sym_forward_ref_entry_type *az_forward_ref_entry ));
extern void sym_dump_value _ARGUMENTS(( XmConst sym_value_entry_type *az_value_entry ));
extern void output_text _ARGUMENTS(( XmConst int length , XmConst char *text ));
extern void sym_dump_source_info _ARGUMENTS(( sym_entry_header_type *hdr ));
extern void sym_dump_obj_header _ARGUMENTS(( XmConst sym_obj_entry_type *az_obj_entry ));
extern void sym_dump_include_file _ARGUMENTS(( sym_include_file_entry_type *az_symbol_entry ));
extern void sym_dump_section _ARGUMENTS(( sym_section_entry_type *az_symbol_entry ));
extern void sym_dump_object_variant _ARGUMENTS(( sym_def_obj_entry_type *az_symbol_entry ));
extern void sym_dump_root_entry _ARGUMENTS(( sym_root_entry_type *az_symbol_entry ));
extern char *sym_section_text _ARGUMENTS(( int b_type ));
extern void dump_free_list _ARGUMENTS(( void ));
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* UilDefI_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,61 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilDiagDef.h /main/10 1995/07/14 09:34:00 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interface to the UIL diagnostic
** issuing procedures in the UIL compiler.
**
**--
**/
#ifndef UilDiagDef_h
#define UilDiagDef_h
#define diag_k_no_source NULL
#define diag_k_no_column 255
#endif /* UilDiagDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

File diff suppressed because it is too large Load diff

View file

@ -1,76 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilIODef.h /main/10 1995/07/14 09:34:21 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interface to the operating system
** io facilities.
**
**--
**/
#ifndef UilIODef_h
#define UilIODef_h
/*
** Define a UIL File Control Block or FCB.
*/
#include <stdio.h>
#ifndef NULL
#define NULL 0L
#endif
typedef struct
{
FILE *az_file_ptr;
char *c_buffer;
boolean v_position_before_get;
z_key last_key;
char expanded_name[ 256 ];
} uil_fcb_type;
#endif /* UilIODef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,238 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: UilKeyTab.c /main/11 1995/07/14 09:34:29 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module contains the keyword table used by the lexical analyzer
** to look up the keywords in the UIL.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include "UilDefI.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/* Keyword table pointer. */
static key_keytable_entry_type * key_keytable_ptr;
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This routine searches for a symbol in the compiler's keyword table.
** There are two arguments to the routine, the length of the symbol and
** the address of the start of the symbol. The routine returns the
** address of the keyword entry found, or a NULL pointer if the
** symbol is not found in the table.
**
** The search for the symbol is case sensitive depending upon the
** keytable binding that was established by the key_initialize routine.
**
** The require file UilKeyTab.h defines and initializes the keyword
** tables. It is built automatically from other files, thus it should
** not be hand editted.
**
** FORMAL PARAMETERS:
**
** symbol_length.rl.v : length of symbol to look up
** symbol_ptr.ra.v : address of symbol to look up
**
** IMPLICIT INPUTS:
**
** key_keytable_ptr : current keyword table
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** NULL : if the symbol is not in the keyword table
** otherwise : the address of the keyword table entry for
** the specified symbol.
**
** SIDE EFFECTS:
**
** none
**
**--
**/
key_keytable_entry_type *
key_find_keyword (symbol_length, symbol_ptr)
unsigned int symbol_length;
char * symbol_ptr;
{
int
lower_limit,
upper_limit;
/* Check the arguments. */
if (symbol_length > key_k_keyword_max_length)
return NULL;
/* Initialize region to search. */
lower_limit = 0;
upper_limit = key_k_keyword_count-1;
/* Perform binary search on keyword index. */
do {
int mid_point, result;
key_keytable_entry_type * keyword_entry_ptr;
mid_point = (lower_limit + upper_limit) >> 1; /* divide by 2 */
keyword_entry_ptr = & key_keytable_ptr [mid_point];
result = strcmp (symbol_ptr, keyword_entry_ptr -> at_name);
if (result == 0) {
return keyword_entry_ptr; /* Found keyword. */
} else if (result < 0) {
upper_limit = mid_point - 1; /* Search lower half. */
} else {
lower_limit = mid_point + 1; /* Search upper half. */
}
} while (lower_limit <= upper_limit);
/* If we fall out of the bottom of the loop, symbol was not found. */
return NULL;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This routine initializes the keyword lookup facility. It can be
** called multiple times during a single compilation. It must be called
** at least once before the keyword table is accessed.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** uil_v_case_sensitive : case sensitive switch, determines which
** : keyword table to use.
**
** IMPLICIT OUTPUTS:
**
** key_keytable_ptr : pointer to the keyword table to
** use for keyword lookups.
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void
key_initialize ()
{
/* Use the correct keyword table based on the global case
sensitivity. */
if (uil_v_case_sensitive) {
key_keytable_ptr = key_table;
} else {
key_keytable_ptr = key_table_case_ins;
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,84 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilLexDef.h /main/11 1995/07/14 09:34:58 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interface to the UIL lexical
** analyzer.
**
**--
**/
#ifndef UilLexDef_h
#define UilLexDef_h
/*
** Define flags to indicate whether certain characters are to be
** filtered in text output.
*/
#define lex_m_filter_tab (1 << 0)
/*
** Define the default character set. In Motif, the default character set is
** not isolatin1, but simply the null string, thus we must be able to
** distinguish the two.
*/
#define lex_k_default_charset -1
#define lex_k_userdefined_charset -2
#define lex_k_fontlist_default_tag -3
/*
** Since key_k_keyword_max_length assumes the length of the longest
** WML generated keyword, we need a new constant to define the
** longest allowable identifier. This length should not exceed
** URMMaxIndexLen. (CR 5566)
*/
#define lex_k_identifier_max_length 31
#endif /* UilLexDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,675 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: UilMain.c /main/14 1996/06/03 15:49:20 pascale $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module is the main procedure of the UIL Compiler.
**
**--
**/
/*
**
** INCLUDE FILES
**
*/
#include <X11/Xlocale.h>
/* Sun's locale.h defines ON && OFF, which is also defined in UilLexPars.h */
#ifdef ON
#undef ON
#endif
#ifdef OFF
#undef OFF
#endif
#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
#endif
#include "UilDefI.h"
#include <setjmp.h>
/*
**
** TABLE OF CONTENTS
**
*/
/*
** FORWARD DECLARATIONS
*/
extern int main _ARGUMENTS(( int l_argc , char *rac_argv []));
static void common_main _ARGUMENTS(( void ));
static void common_cleanup _ARGUMENTS(( void ));
#ifdef CALLABLE
static void UilWrapup _ARGUMENTS((Uil_compile_desc_type *compile_desc));
#endif /* CALLABLE */
/*
**
** EXTERNAL Definitions
**
*/
#ifndef NO_MESSAGE_CATALOG
#include <nl_types.h>
#if !defined(NL_CAT_LOCALE)
#define NL_CAT_LOCALE 0
#endif
externaldef(uilmsg) nl_catd uil_catd = NULL;
#endif
/*
**
** MODULE Definitions
**
*/
static status return_status = 0;
static jmp_buf environment;
static unsigned module_flags = 0;
static unsigned doing_exit = 0;
/* Bit definitions for module_flags */
#define compiler_called (1 << 0)
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This is the common part of the main routine.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** compilation occurs
**
**--
**/
static void common_main()
{
#ifndef NO_MESSAGE_CATALOG
if (uil_catd == NULL)
uil_catd = catopen("Uil", NL_CAT_LOCALE);
#endif
/* Initialize the X toolkit. */
XtToolkitInitialize();
/* use the user supplied data base instead */
if (Uil_cmd_z_command.v_database)
db_incorporate();
/* initialize the diagnostic system */
diag_initialize_diagnostics();
/* initialize the symbol table */
sym_initialize_storage();
/* initialize the source */
src_initialize_source();
/* open listing file if requested */
if (Uil_cmd_z_command.v_listing_file)
lst_open_listing();
/* initialize the lexical analyzer */
lex_initialize_analyzer();
/* initialize the keyword table */
key_initialize();
/* initialize the sar data structures */
sar_initialize();
/* call YACC to parse the source file */
/* return 0 for success, 1 for failure */
/* Make sure the root entry sections pointer is filled in */
if (yyparse() != 0)
diag_issue_diagnostic
(d_inv_module, diag_k_no_source, diag_k_no_column);
sym_az_root_entry->sections = sym_az_current_section_entry;
/* call forward reference resolver */
sem_resolve_forward_refs();
/* call semantic validation */
sem_validation ();
/* call the output phase if requested */
if (Uil_cmd_z_command.v_resource_file)
sem_output_uid_file();
/* call symbol table dumper - if requested */
#if debug_version
if (uil_v_dump_symbols == TRUE)
sym_dump_symbols();
#endif
/* write compilation summary */
diag_issue_summary();
/* write listing file if requested */
if (Uil_cmd_z_command.v_listing_file)
lst_output_listing();
/* Storage is not cleaned up, since we will exit */
uil_exit( uil_l_compile_status );
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This is the image termination procedure for the UIL compiler.
**
** FORMAL PARAMETERS:
**
** severity status of compilation on exit
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** never return from this procedure
**
**--
**/
void uil_exit(severity)
int severity;
{
/* Prevent multiple looping through this routine */
if ( doing_exit ) return;
doing_exit = 1;
return_status = (severity >= uil_k_error_status);
/* Close and remove the uid file if it's still open. */
/* It will only be open if a severe error occurred during the output */
/* of the uid file. */
if (out_az_idbfile_id != NULL)
UrmIdbCloseFile (out_az_idbfile_id, FALSE);
/* If compiler called, return to calling program rather than */
/* exiting process */
if (module_flags & compiler_called)
longjmp (environment, 1);
/* RAP FIX for listing files */
common_cleanup();
exit(return_status);
}
#ifndef CALLABLE
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This is the main routine
**
** FORMAL PARAMETERS:
**
** l_argc: the number of command line arguments
** rac_argv: an array of pointers to character array arguments
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** COMPLETION CODES:
**
** 1 if errors; 0 otherwise
**
** SIDE EFFECTS:
**
** produce possibly a resource file and a listing file
**--
**/
int main( l_argc, rac_argv )
int l_argc;
char *rac_argv[ ];
{
setlocale(LC_ALL, "");
/* call routine to parse the command line */
cmd_decode_command_line( l_argc, rac_argv );
/* call common main routine */
common_main();
}
#endif /* !CALLABLE */
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This is the dynamic memory cleanup routine. It calls all facility
** provided cleanup routines so that dynamic structures can be released.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** all dynamic memory is freed
**
**--
**/
static void common_cleanup()
{
/* cleanup the source file information */
Uil_src_cleanup_source();
/* cleanup listing facility */
Uil_lst_cleanup_listing();
/* cleanup the lexical analyzer */
Uil_lex_cleanup_analyzer();
return;
}
#ifdef CALLABLE
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This is the callable entry point for the UIL Compiler.
**
** FORMAL PARAMETERS:
**
** command_desc pointer to data structure defining UIL command line
**
** compile_desc pointer to data structure describing the results of
** the compilation.
**
** message_cb callback routine to process messages
**
** message_data user-data passed to the message_cb
**
** status_cb callback routine to process messages
**
** status_data user-data passed to the status_cb
**
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** COMPLETION CODES:
**
** uil$_normal if no errors; uil$_no_output otherwise
**
** SIDE EFFECTS:
**
** none
**--
**/
Uil_status_type Uil
(Uil_command_type *command_desc,
Uil_compile_desc_type *compile_desc,
Uil_continue_type (*message_cb)(),
char *message_data,
Uil_continue_type (*status_cb)(),
char *status_data)
{
/* Indicate compiler called rather than being started via command line */
module_flags = module_flags | compiler_called;
doing_exit = 0;
/* Initialize command line data structure */
Uil_cmd_z_command.ac_database = command_desc -> database;
Uil_cmd_z_command.v_database = command_desc -> database_flag;
Uil_cmd_z_command.ac_source_file = command_desc -> source_file;
Uil_cmd_z_command.ac_resource_file = command_desc -> resource_file;
Uil_cmd_z_command.ac_listing_file = command_desc -> listing_file;
Uil_cmd_z_command.include_dir_count = command_desc -> include_dir_count;
Uil_cmd_z_command.ac_include_dir = command_desc -> include_dir;
Uil_cmd_z_command.v_listing_file = command_desc -> listing_file_flag;
Uil_cmd_z_command.v_resource_file = command_desc -> resource_file_flag;
Uil_cmd_z_command.v_show_machine_code = command_desc -> machine_code_flag;
Uil_cmd_z_command.v_report_info_msg = command_desc -> report_info_msg_flag;
Uil_cmd_z_command.v_report_warn_msg = command_desc -> report_warn_msg_flag;
Uil_cmd_z_command.v_parse_tree = command_desc -> parse_tree_flag;
Uil_cmd_z_command.v_use_setlocale = command_desc -> use_setlocale_flag;
Uil_cmd_z_command.v_issue_summary = command_desc -> issue_summary;
Uil_cmd_z_command.status_update_delay = command_desc -> status_update_delay;
Uil_cmd_z_command.message_cb = message_cb;
Uil_cmd_z_command.message_data = message_data;
Uil_cmd_z_command.status_cb = status_cb;
Uil_cmd_z_command.status_data = status_data;
/* The setjmp function allows us to unwind from a fatal error setjmp is */
/* nonzero if we are returning from a fatal error */
if (setjmp(environment) == 0) {
/* use the user supplied data base instead. If no source file
is given (this call is only to change the database), return at
this point with a success. */
if ( Uil_cmd_z_command.v_database )
{
db_incorporate ();
if ( Uil_cmd_z_command.ac_source_file == NULL )
uil_exit (uil_k_success_status);
}
/* initialize the diagnostic system */
uil_l_compile_status = uil_k_success_status;
diag_initialize_diagnostics();
/* initialize the symbol table */
sym_initialize_storage();
/* initialize the source */
src_initialize_source();
/* open listing file if requested */
if (Uil_cmd_z_command.v_listing_file)
lst_open_listing();
/* initialize the lexical analyzer */
lex_initialize_analyzer();
/* initialize the keyword table */
key_initialize();
/* initialize the sar data structures */
sar_initialize();
/* call YACC to parse the source file */
/* return 0 for success, 1 for failure */
/* Make sure the root entry sections pointer is filled in */
if (yyparse() != 0)
diag_issue_diagnostic
(d_inv_module, diag_k_no_source, diag_k_no_column);
sym_az_root_entry->sections = sym_az_current_section_entry;
/* call forward reference resolver */
sem_resolve_forward_refs();
/* call semantic validation */
sem_validation ();
/* call the output phase if requested */
if (Uil_cmd_z_command.v_resource_file)
sem_output_uid_file();
/* call symbol table dumper - if requested */
#if debug_version
if (uil_v_dump_symbols == TRUE)
sym_dump_symbols();
#endif
/* Perform standard wrapup processing */
UilWrapup (compile_desc);
/*
* Fix for CR 5534 - call the routine to restore the old signal handlers
*/
diag_restore_diagnostics();
/*
* End Fix for CR 5534
*/
/* exit with the compile status */
return uil_l_compile_status;
}
/*
** longjmp return from setjmp. This is the case of a return via
** uil_exit the value return_status is set by uil_exit.
*/
else
{
/* Do standard compiler wrapup */
UilWrapup (compile_desc);
/* return the status set by uil_exit */
return uil_l_compile_status;
}
}
/*
* Local function to provide compiler wrapup processing. It is called both
* from the longjmp and sequential paths in the callable compiler above.
*/
static void UilWrapup (compile_desc)
Uil_compile_desc_type *compile_desc;
{
int i; /* loop index for copying message counts */
/* write compilation summary if requested */
if ( Uil_cmd_z_command.v_issue_summary )
diag_issue_summary();
/* write listing file if requested */
if (Uil_cmd_z_command.v_listing_file)
lst_output_listing();
/*
** fill in the "parse tree root" in the compile descriptor,
** and set the version for the compiler and the symbol table
** structure.
*/
compile_desc->parse_tree_root = (char *)sym_az_root_entry;
compile_desc->data_version = _data_version;
compile_desc->compiler_version = _compiler_version_int;
/* Fill in the message_summary array in the compile_desc */
for (i = uil_k_min_status; i <= uil_k_max_status; i++)
compile_desc->message_count[i] = Uil_message_count[i];
/* If there are any error/severe messages, then don't return */
/* a symbol table for the callable compiler - clean up here */
if ( Uil_message_count[Uil_k_error_status]>0 ||
Uil_message_count[Uil_k_severe_status]>0 )
{
Uil_cmd_z_command.v_parse_tree = FALSE;
compile_desc->parse_tree_root = NULL;
}
/* Call the cleanup routine to free dynamic memory */
common_cleanup();
/* Cleanup storage; what is cleaned up depends on whether compiler */
/* was called or not */
Uil_sym_cleanup_storage (Uil_cmd_z_command.v_parse_tree!=1);
}
#endif /* CALLABLE */
#ifdef NO_MEMMOVE
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This is a memmove function that explicitly handles
** overlapping memory areas. Written in response to
** CR 4851.
**
** FORMAL PARAMETERS:
**
** same as memcpy
**
** COMPLETION CODES:
**
** same as memcpy
**
** SIDE EFFECTS:
**
**--
**/
char *uil_mmove(s1, s2, n)
char *s1, *s2;
int n;
{
char *temp;
if(s2 == s1)
return(s2);
if(s2 < s1 && s1 <= s2 + n){
if(temp = (char *)malloc(n)){
memcpy(temp, s2, n);
memcpy(s1, temp, n);
free(temp);
return(s1);
}
printf("uil_mmove: Memory allocation failed!\n");
exit(-1);
}
return((char *)memcpy(s1, s2, n));
}
#endif /* NO_MEMMOVE */

View file

@ -1,117 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilMess.h /main/10 1995/07/14 09:35:51 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
#define d_add_source 2
#define d_arg_count 23
#define d_arg_type 24
#define d_backslash_ignored 11
#define d_bad_argument 72
#define d_bad_database 73
#define d_bad_lang_value 67
#define d_bug_check 5
#define d_cannot_convert 71
#define d_circular_def 45
#define d_circular_ref 63
#define d_control_char 9
#define d_create_proc 41
#define d_create_proc_inv 42
#define d_create_proc_req 43
#define d_ctx_req 16
#define d_default_charset 80
#define d_different_units 79
#define d_dup_letter 52
#define d_dup_list 27
#define d_dupl_opt 0
#define d_future_version 74
#define d_gadget_not_sup 57
#define d_icon_letter 54
#define d_icon_width 53
#define d_illegal_forward_ref 70
#define d_include_file 78
#define d_info 31
#define d_inv_module 35
#define d_invalid_enumval 66
#define d_list_item 28
#define d_listing_open 33
#define d_listing_write 34
#define d_miss_opt_arg 32
#define d_name_too_long 12
#define d_names 50
#define d_never_def 26
#define d_no_enumset 65
#define d_no_source 46
#define d_no_uid 40
#define d_nonpvt 22
#define d_not_impl 17
#define d_null 44
#define d_obj_type 25
#define d_operand_type 58
#define d_out_of_memory 13
#define d_out_range 7
#define d_override_builtin 64
#define d_prev_error 29
#define d_previous_def 21
#define d_single_control 48
#define d_single_letter 51
#define d_single_occur 47
#define d_src_close 62
#define d_src_limit 36
#define d_src_null_char 37
#define d_src_open 3
#define d_src_read 4
#define d_src_truncate 6
#define d_submit_spr 30
#define d_subnotall 56
#define d_summary 38
#define d_supersede 20
#define d_syntax 14
#define d_too_many 55
#define d_too_many_dirs 61
#define d_uid_open 39
#define d_uid_write 76
#define d_undefined 15
#define d_unknown_charset 49
#define d_unknown_classrecnam 77
#define d_unknown_opt 1
#define d_unknown_seq 10
#define d_unsupp_charset 59
#define d_unsupp_const 60
#define d_unsupported 19
#define d_unterm_seq 8
#define d_value_too_large 69
#define d_widget_cycle 68
#define d_wmd_open 75
#define d_wrong_type 18

View file

@ -1,245 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilMessTab.h /main/11 1995/07/14 09:36:09 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** DECwindows Toolkit User Interface Language Compiler (UIL)
**--
**/
char XmConst msg0[36] = "duplicate option \"%s\" was ignored";
char XmConst msg1[34] = "unknown option \"%s\" was ignored";
char XmConst msg2[43] = "additional UIL source file: %s was ignored";
char XmConst msg3[30] = "error opening source file: %s";
char XmConst msg4[43] = "error reading next line of source file: %s";
char XmConst msg5[19] = "Internal error: %s";
char XmConst msg6[32] = "line truncated at %d characters";
char XmConst msg7[31] = "value of %s is out of range %s";
char XmConst msg8[21] = "%s not terminated %s";
char XmConst msg9[37] = "unprintable character \\%d\\ ignored";
char XmConst msg10[32] = "unknown sequence \"%s\" ignored";
char XmConst msg11[46] = "unknown escape sequence \"\\%c\" - \\ ignored";
char XmConst msg12[46] = "name exceeds %d characters - truncated to: %s";
char XmConst msg13[35] = "compiler ran out of virtual memory";
char XmConst msg14[56] = "unexpected %s token seen - parsing resumes after \"%c\"";
char XmConst msg15[44] = "%s %s must be defined before this reference";
char XmConst msg16[41] = "context requires a %s - %s was specified";
char XmConst msg17[26] = "%s is not implemented yet";
char XmConst msg18[39] = "found %s value when expecting %s value";
char XmConst msg19[45] = "the %s %s is not supported for the %s object";
char XmConst msg20[62] = "this %s %s is superseded by the last definition in this %s %s";
char XmConst msg21[33] = "name %s previously defined as %s";
char XmConst msg22[43] = "value used in this context must be private";
char XmConst msg23[55] = "procedure %s was previously declared with %d arguments";
char XmConst msg24[56] = "found %s value - procedure %s argument must be %s value";
char XmConst msg25[33] = "found %s %s when expecting %s %s";
char XmConst msg26[24] = "%s %s was never defined";
char XmConst msg27[39] = "%s %s already specified for this %s %s";
char XmConst msg28[29] = "%s item not allowed in %s %s";
char XmConst msg29[45] = "compilation terminated - fix previous errors";
char XmConst msg30[38] = "internal error - submit defect report";
char XmConst msg31[2] = " ";
char XmConst msg32[35] = "%s missing following \"%s\" option";
char XmConst msg33[31] = "error opening listing file: %s";
char XmConst msg34[34] = "error writing to listing file: %s";
char XmConst msg35[51] = "invalid module structure - check UIL module syntax";
char XmConst msg36[31] = "too many source files open: %s";
char XmConst msg37[38] = "source line contains a null character";
char XmConst msg38[45] = "errors: %d warnings: %d informationals: %d";
char XmConst msg39[27] = "error opening UID file: %s";
char XmConst msg40[25] = "no UID file was produced";
char XmConst msg41[53] = "creation procedure is not supported by the %s widget";
char XmConst msg42[59] = "creation procedure is not allowed in a %s widget reference";
char XmConst msg43[58] = "creation procedure is required in a %s widget declaration";
char XmConst msg44[46] = "a NULL character in a string is not supported";
char XmConst msg45[43] = "widget %s is part of a circular definition";
char XmConst msg46[25] = "no source file specified";
char XmConst msg47[35] = "%s %s supports only a single %s %s";
char XmConst msg48[41] = "%s widget supports only a single control";
char XmConst msg49[22] = "unknown character set";
char XmConst msg50[47] = "place names clause before other module clauses";
char XmConst msg51[47] = "color letter string must be a single character";
char XmConst msg52[48] = "color letter used for prior color in this table";
char XmConst msg53[37] = "row %d must have same width as row 1";
char XmConst msg54[52] = "row %d, column %d: letter \"%c\" not in color table";
char XmConst msg55[32] = "too many %ss in %s, limit is %d";
char XmConst msg56[48] = "Subqualifier not allowed with negated qualifier";
char XmConst msg57[60] = "%s gadget is not supported - %s widget will be used instead";
char XmConst msg58[28] = "%s type is not valid for %s";
char XmConst msg59[66] = "support for this character set may be removed in a future release";
char XmConst msg60[49] = "the %s constraint is not supported for the %s %s";
char XmConst msg61[37] = "too many \"%s\" options, limit is %d";
char XmConst msg62[30] = "error closing source file: %s";
char XmConst msg63[35] = "the %s value is circularly defined";
char XmConst msg64[28] = "overriding built-in name %s";
char XmConst msg65[51] = "the %s argument does not support enumerated values";
char XmConst msg66[57] = "the %s argument does not support the %s enumerated value";
char XmConst msg67[40] = "$LANG contains an unknown character set";
char XmConst msg68[66] = "the %s object's controls hierarchy contains a reference to itself";
char XmConst msg69[41] = "value %s is too large for context buffer";
char XmConst msg70[42] = "forward referencing is not allowed for %s";
char XmConst msg71[34] = "cannot convert %s type to %s type";
char XmConst msg72[14] = "%s is invalid";
char XmConst msg73[30] = "error reading binary database";
char XmConst msg74[47] = "binary database compiled with a future version";
char XmConst msg75[32] = "error opening database file: %s";
char XmConst msg76[27] = "error writing UID file: %s";
char XmConst msg77[45] = "'%s' is an unknown Toolkit class record name";
char XmConst msg78[26] = "invalid include file name";
char XmConst msg79[49] = "incompatible unit types for arithmetic operation";
char XmConst msg80[54] = "%s used as charset name; %s used as charset component";
typedef struct
{
XmConst int l_severity;
char XmConst *ac_text;
} diag_rz_msg_entry;
XmConst diag_rz_msg_entry diag_rz_msg_table[81] =
{
{ 2, msg0 },
{ 2, msg1 },
{ 3, msg2 },
{ 4, msg3 },
{ 4, msg4 },
{ 4, msg5 },
{ 3, msg6 },
{ 3, msg7 },
{ 3, msg8 },
{ 3, msg9 },
{ 3, msg10 },
{ 3, msg11 },
{ 3, msg12 },
{ 4, msg13 },
{ 3, msg14 },
{ 3, msg15 },
{ 3, msg16 },
{ 3, msg17 },
{ 3, msg18 },
{ 2, msg19 },
{ 1, msg20 },
{ 3, msg21 },
{ 3, msg22 },
{ 3, msg23 },
{ 3, msg24 },
{ 3, msg25 },
{ 3, msg26 },
{ 3, msg27 },
{ 3, msg28 },
{ 4, msg29 },
{ 4, msg30 },
{ 1, msg31 },
{ 3, msg32 },
{ 4, msg33 },
{ 4, msg34 },
{ 3, msg35 },
{ 4, msg36 },
{ 3, msg37 },
{ 1, msg38 },
{ 4, msg39 },
{ 1, msg40 },
{ 3, msg41 },
{ 3, msg42 },
{ 3, msg43 },
{ 2, msg44 },
{ 3, msg45 },
{ 4, msg46 },
{ 2, msg47 },
{ 2, msg48 },
{ 3, msg49 },
{ 3, msg50 },
{ 3, msg51 },
{ 3, msg52 },
{ 3, msg53 },
{ 3, msg54 },
{ 3, msg55 },
{ 4, msg56 },
{ 2, msg57 },
{ 3, msg58 },
{ 2, msg59 },
{ 2, msg60 },
{ 2, msg61 },
{ 2, msg62 },
{ 3, msg63 },
{ 2, msg64 },
{ 2, msg65 },
{ 2, msg66 },
{ 3, msg67 },
{ 3, msg68 },
{ 4, msg69 },
{ 4, msg70 },
{ 3, msg71 },
{ 3, msg72 },
{ 4, msg73 },
{ 4, msg74 },
{ 4, msg75 },
{ 4, msg76 },
{ 2, msg77 },
{ 4, msg78 },
{ 4, msg79 },
{ 1, msg80 },
};
#ifndef NO_MESSAGE_CATALOG
#include <nl_types.h>
#include "UilMsgCatI.h"
externalref nl_catd uil_catd;
XmConst int msg_cat_table[81] = {
UIL_0, UIL_1, UIL_2, UIL_3, UIL_4,
UIL_5, UIL_6, UIL_7, UIL_8, UIL_9,
UIL_10, UIL_11, UIL_12, UIL_13, UIL_14,
UIL_15, UIL_16, UIL_17, UIL_18, UIL_19,
UIL_20, UIL_21, UIL_22, UIL_23, UIL_24,
UIL_25, UIL_26, UIL_27, UIL_28, UIL_29,
UIL_30, UIL_31, UIL_32, UIL_33, UIL_34,
UIL_35, UIL_36, UIL_37, UIL_38, UIL_39,
UIL_40, UIL_41, UIL_42, UIL_43, UIL_44,
UIL_45, UIL_46, UIL_47, UIL_48, UIL_49,
UIL_50, UIL_51, UIL_52, UIL_53, UIL_54,
UIL_55, UIL_56, UIL_57, UIL_58, UIL_59,
UIL_60, UIL_61, UIL_62, UIL_63, UIL_64,
UIL_65, UIL_66, UIL_67, UIL_68, UIL_69,
UIL_70, UIL_71, UIL_72,
UIL_V2_73, UIL_V2_74, UIL_V2_75, UIL_V2_76,
UIL_V2_77, UIL_78, UIL_V2_79, UIL_V2_80,
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,315 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: UilP2Reslv.c /main/11 1995/07/14 09:36:35 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module contain the second pass routines for resolving forward
** references.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include "UilDefI.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function processes forward references from the first pass.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** sym_az_forward_ref_chain
** sym_az_val_forward_ref_chain
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** error messages may be issued for objects that are still undefined
** or of the wrong type
**
**--
**/
void sem_resolve_forward_refs()
{
sym_forward_ref_entry_type * fwd_entry;
sym_forward_ref_entry_type * next_fwd_entry;
sym_val_forward_ref_entry_type * fwd_val_entry;
sym_val_forward_ref_entry_type * next_fwd_val_entry;
sym_widget_entry_type ** target_obj_entry;
sym_value_entry_type ** target_val_entry;
sym_parent_list_type * parent_node;
sym_parent_list_type * parent_ptr;
int found;
/*
** Forward references are placed on a chain by the first pass of
** the compiler. This routine walks the chain checking that
** 1) name is now defined
** 2) name points to the correct type of object
*/
for (fwd_entry = sym_az_forward_ref_chain;
fwd_entry != NULL;
fwd_entry = next_fwd_entry)
{
sym_name_entry_type * name_entry;
sym_widget_entry_type * object_entry;
unsigned short int object_type;
/*
** Save the pointer to the next forward entry so we can free the current
** entry after it is processed.
*/
next_fwd_entry = fwd_entry->az_next_ref;
/*
** Call the Status callback routine to report our progress.
*/
/* %COMPLETE */
Uil_percent_complete = 60;
if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL)
diag_report_status();
object_type = fwd_entry->header.b_type;
name_entry = fwd_entry->az_name;
object_entry = (sym_widget_entry_type *) name_entry->az_object;
if (object_entry == NULL)
{
diag_issue_diagnostic
( d_never_def,
_sar_source_pos2 (fwd_entry),
diag_object_text( object_type ),
name_entry->c_text );
continue;
}
/*
** Make sure object references are to correct type of object.
** A forward reference naming a widget class may be correctly
** resolved by the corresponding gadget class, and vice versa.
*/
if ((object_entry->header.b_type!=object_type) &&
(uil_gadget_variants[object_entry->header.b_type]!=object_type) &&
(uil_gadget_variants[object_type]!=object_entry->header.b_type))
{
diag_issue_diagnostic
(d_ctx_req,
_sar_source_pos2(fwd_entry),
diag_object_text(object_type),
diag_object_text(object_entry->header.b_type));
continue;
}
target_obj_entry =
(sym_widget_entry_type * *) fwd_entry->a_update_location;
*target_obj_entry = object_entry;
/*
** Update objects on forward refernce chain so that their parent_lists point
** to the objects which reference them
*/
if (fwd_entry -> parent != NULL)
{
found = FALSE;
for (parent_ptr = object_entry -> parent_list;
((parent_ptr != NULL) && (found == FALSE));
parent_ptr = parent_ptr -> next)
{
if (parent_ptr -> parent == fwd_entry -> parent)
found = TRUE;
}
if (found == FALSE)
{
parent_node = (sym_parent_list_type *)
sem_allocate_node (sym_k_parent_list_entry,
sym_k_parent_list_size);
parent_node -> next = object_entry -> parent_list;
object_entry -> parent_list = parent_node;
parent_node -> parent = fwd_entry -> parent;
}
}
/*
** Free the Forward reference entry now that it is no longer needed
*/
sem_free_node(( sym_entry_type *)fwd_entry);
}
/*
** Now resolve the forward references to values
**/
/*
** Forward references are placed on a chain by the first pass of
** the compiler. This routine walks the chain checking that
** 1) name is now defined
** 2) name points to the correct type of value
*/
for (fwd_val_entry = sym_az_val_forward_ref_chain;
fwd_val_entry != NULL;
fwd_val_entry = next_fwd_val_entry)
{
sym_name_entry_type * name_entry;
sym_value_entry_type * value_entry;
sym_obj_entry_type * obj_entry;
/*
** Save the pointer to the next forward entry so we can free the current
** entry after it is processed.
*/
next_fwd_val_entry = fwd_val_entry->az_next_ref;
/*
** Call the Status callback routine to report our progress.
*/
/* %COMPLETE */
Uil_percent_complete = 60;
if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL)
diag_report_status();
name_entry = fwd_val_entry->az_name;
value_entry = (sym_value_entry_type *) name_entry->az_object;
obj_entry = (sym_obj_entry_type *) name_entry->az_object;
if (value_entry == NULL)
{
diag_issue_diagnostic
( d_never_def,
_sar_source_pos2 (fwd_val_entry),
"value",
name_entry->c_text );
continue;
}
switch (fwd_val_entry->fwd_ref_flags)
{
case (sym_k_patch_add):
case (sym_k_patch_list_add):
{
target_val_entry =
(sym_value_entry_type * *) fwd_val_entry->a_update_location;
*target_val_entry = value_entry;
break;
}
default:
_assert(FALSE, "Illegal forward reference");
}
/*
** Free the Forward reference entry now that it is no longer needed
*/
sem_free_node(( sym_entry_type *)fwd_val_entry);
}
}

View file

@ -1,984 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: UilSarComp.c /main/11 1995/07/14 09:36:46 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module supports compound strings in UIL. It includes
** the basic operations for creating, copying, and concatenating
** strings.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include <Mrm/MrmAppl.h>
#ifdef DXM_V11
#include <DXm/DXmHelpB.h>
#endif
#include "UilDefI.h"
/*
**
** TABLE OF CONTENTS
**
**/
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
#define clear_class_mask (~(sym_m_private | sym_m_imported | sym_m_exported))
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
extern yystype yylval;
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function creates a null compound string.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** a copy of the primitive string may be made
**
**--
**/
sym_value_entry_type *sem_create_cstr()
{
sym_value_entry_type *az_cstr_entry;
az_cstr_entry = (sym_value_entry_type *)
sem_allocate_node
( sym_k_value_entry,
sym_k_value_entry_size + sizeof( char * ) );
az_cstr_entry->obj_header.b_flags = sym_m_builtin | sym_m_private;
az_cstr_entry->b_type = sym_k_compound_string_value;
az_cstr_entry->w_length = sizeof (char *);
az_cstr_entry->b_direction = NOSTRING_DIRECTION;
/* Fix for CN 16149 (DTS 10023) part 1 -- initialize charset info */
az_cstr_entry->b_charset = sym_k_error_charset;
az_cstr_entry->az_charset_value = NULL;
_sar_save_source_pos (&az_cstr_entry->header, &yylval);
return az_cstr_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function creates a null wide_character string.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** a copy of the primitive string may be made
**
**--
**/
sym_value_entry_type *sem_create_wchar_str()
{
sym_value_entry_type *az_wchar_str_entry;
az_wchar_str_entry = (sym_value_entry_type *)
sem_allocate_node
( sym_k_value_entry,
sym_k_value_entry_size + sizeof( char * ) );
az_wchar_str_entry->obj_header.b_flags = sym_m_builtin | sym_m_private;
az_wchar_str_entry->b_type = sym_k_wchar_string_value;
az_wchar_str_entry->w_length = sizeof (char *);
az_wchar_str_entry->b_direction = NOSTRING_DIRECTION;
_sar_save_source_pos (&az_wchar_str_entry->header, &yylval);
return az_wchar_str_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function appends a primitive or a localized string to a
** compound string.
**
** FORMAL PARAMETERS:
**
** az_cstr_entry compound string
** az_str_entry primitive string or localized string
** op2_temporary true if op2 is not needed after operation
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** a copy of the primitive string may be made
**
**--
**/
void sem_append_str_to_cstr(az_cstr_entry, az_str_entry, op2_temporary)
sym_value_entry_type *az_cstr_entry;
sym_value_entry_type *az_str_entry;
boolean op2_temporary;
{
sym_value_entry_type *last_str_entry;
sym_value_entry_type **ptr;
sym_value_entry_type *new_str_entry;
boolean merge;
/*
** A couple of points:
** 1) if op2_temporary = FALSE - we must make a copy
** of it
** 2) if the last string of the compound string has the same attributes
** as the string being appended, the strings are merged into 1
*/
/* find the last string of the compound string */
ptr = &(az_cstr_entry->az_first_table_value);
last_str_entry = *ptr;
merge = FALSE;
if (last_str_entry != NULL)
{
for ( ;
last_str_entry->az_next_table_value != NULL;
ptr = (sym_value_entry_type * *)
&(last_str_entry->az_next_table_value),
last_str_entry = *ptr);
if ((last_str_entry->b_charset == az_str_entry->b_charset)
&&
((last_str_entry->b_direction)== (az_str_entry->b_direction))
&&
((last_str_entry->b_aux_flags & sym_m_separate) == 0 ))
merge = TRUE;
else
ptr = (sym_value_entry_type * *)
&(last_str_entry->az_next_table_value);
}
if (merge)
{
new_str_entry =
sem_cat_str_to_str( last_str_entry, TRUE,
az_str_entry, op2_temporary );
}
else
{
/*
** Append a new segment to the compound string
*/
if( op2_temporary == FALSE )
{
unsigned short old_size;
/* must make a copy since user has access to string via name */
new_str_entry = (sym_value_entry_type *)
sem_allocate_node( sym_k_value_entry,
az_str_entry->header.w_node_size<<2 );
old_size = new_str_entry->header.w_node_size;
_sym_copy_entry( new_str_entry,
az_str_entry,
az_str_entry->header.w_node_size );
new_str_entry->header.w_node_size = old_size;
}
else
new_str_entry = az_str_entry;
}
/* link to the end of the compound string */
new_str_entry->b_aux_flags |= sym_m_table_entry;
new_str_entry->obj_header.b_flags = sym_m_private | sym_m_builtin;
new_str_entry->obj_header.az_name = NULL;
new_str_entry->az_next_table_value = NULL;
*ptr = new_str_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function appends a compound string to a compound string.
**
** FORMAL PARAMETERS:
**
** az_cstr1_entry compound string
** az_cstr2_entry compound string
** op2_temporary true if op2 is not needed after operation
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sem_append_cstr_to_cstr(az_cstr1_entry, az_cstr2_entry, op2_temporary)
sym_value_entry_type *az_cstr1_entry;
sym_value_entry_type *az_cstr2_entry;
boolean op2_temporary;
{
sym_value_entry_type *last_str_entry;
sym_value_entry_type **ptr;
sym_value_entry_type *next_str_entry;
/*
** A couple of points:
** 1) if op2_temporary = FALSE - we must make a copy of 2nd compound
** string
** 2) if the last string of 1st compound string has the same attributes
** as the 1st string of the 2nd compound string being appended,
** the strings are merged into 1
*/
/* find the last string of the 1st compound string */
ptr = &(az_cstr1_entry->az_first_table_value);
last_str_entry = *ptr;
next_str_entry = az_cstr2_entry->az_first_table_value;
if (op2_temporary)
sem_free_node(( sym_entry_type *) az_cstr2_entry );
if (next_str_entry == NULL)
return;
if (last_str_entry != NULL)
{
for ( ;
last_str_entry->az_next_table_value != NULL;
ptr = (sym_value_entry_type * *)
&(last_str_entry->az_next_table_value),
last_str_entry = *ptr);
if ((last_str_entry->b_charset == next_str_entry->b_charset)
&&
((last_str_entry->b_direction)== (next_str_entry->b_direction))
&&
((last_str_entry->b_aux_flags & sym_m_separate) == 0 ))
{
last_str_entry =
sem_cat_str_to_str( last_str_entry, TRUE,
next_str_entry, op2_temporary );
last_str_entry->b_aux_flags |= sym_m_table_entry;
*ptr = last_str_entry;
next_str_entry =
(sym_value_entry_type *) next_str_entry->az_next_table_value;
}
ptr = (sym_value_entry_type * *)
&(last_str_entry->az_next_table_value);
}
if (op2_temporary)
{
*ptr = next_str_entry;
return;
}
for ( ;
next_str_entry != NULL;
next_str_entry = (sym_value_entry_type *)
next_str_entry->az_next_table_value )
{
sym_value_entry_type *new_str_entry;
unsigned short old_size;
new_str_entry = (sym_value_entry_type *)
sem_allocate_node( sym_k_value_entry,
next_str_entry->header.w_node_size<<2 );
old_size = new_str_entry->header.w_node_size;
_sym_copy_entry( new_str_entry,
next_str_entry,
next_str_entry->header.w_node_size );
new_str_entry->header.w_node_size = old_size;
new_str_entry->obj_header.b_flags = sym_m_private | sym_m_builtin;
new_str_entry->obj_header.az_name = NULL;
new_str_entry->b_aux_flags |= sym_m_table_entry;
/* link to the end of the compound string */
*ptr = new_str_entry;
ptr = (sym_value_entry_type * *)
&(new_str_entry->az_next_table_value);
}
*ptr = NULL;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function concatenates 2 primitive strings.
**
** FORMAL PARAMETERS:
**
** az_str1_entry primitive string
** op1_temporary op1 is a temporary string
** az_str2_entry primitive string
** op2_temporary op2 is a temporary string
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** ptr to the result string
**
** SIDE EFFECTS:
**
** none
**
**--
**/
sym_value_entry_type
*sem_cat_str_to_str
(az_str1_entry, op1_temporary, az_str2_entry, op2_temporary)
sym_value_entry_type *az_str1_entry;
boolean op1_temporary;
sym_value_entry_type *az_str2_entry;
boolean op2_temporary;
{
sym_value_entry_type *new_str_entry;
int l1, l2;
/*
** Can only append two simple strings if they have the same direction and
** the first does not have the separate attribute.
*/
_assert(((az_str1_entry->b_charset == az_str2_entry->b_charset)
&&
((az_str1_entry->b_direction) == (az_str2_entry->b_direction))
),
"strings with different attrs concatenated" );
l1 = az_str1_entry->w_length;
l2 = az_str2_entry->w_length;
/* extra 1 is for terminating null */
new_str_entry = (sym_value_entry_type *)
sem_allocate_node( sym_k_value_entry,
sym_k_value_entry_size );
new_str_entry->value.c_value = XtCalloc(1, l1 + l2 + 1);
new_str_entry->obj_header.b_flags = sym_m_builtin | sym_m_private;
_sar_move_source_info_2 (&new_str_entry->header, &az_str1_entry->header);
new_str_entry->b_charset = az_str1_entry->b_charset;
new_str_entry->b_direction = az_str1_entry->b_direction;
new_str_entry->b_aux_flags =
(az_str1_entry->b_aux_flags & sym_m_separate);
new_str_entry->b_type = sym_k_char_8_value;
new_str_entry->w_length = l1 + l2;
_move( new_str_entry->value.c_value,
az_str1_entry->value.c_value, l1 );
_move( &new_str_entry->value.c_value[ l1 ],
az_str2_entry->value.c_value,
l2+1 );
/*
** if either of the operands is unnamed - free the node
*/
if (op1_temporary)
{
_free_memory( az_str1_entry->value.c_value );
sem_free_node(( sym_entry_type *) az_str1_entry );
}
if (op2_temporary)
{
_free_memory( az_str2_entry->value.c_value );
sem_free_node(( sym_entry_type *) az_str2_entry );
}
return new_str_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function takes the charset sets understood by the parser
** and maps them to charsets understood by the symbol table and
** toolkit.
**
** FORMAL PARAMETERS:
**
** charset_as_subclass sym_k_..._charset literal naming charset
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** sym_k...charset name for charset
**
** SIDE EFFECTS:
**
** none
**
**--
**/
int sem_map_subclass_to_charset(charset_as_subclass)
int charset_as_subclass;
{
switch (charset_as_subclass)
{
case lex_k_fontlist_default_tag:
case sym_k_fontlist_default_tag:
return sym_k_fontlist_default_tag;
case lex_k_default_charset:
return uil_sym_default_charset;
case lex_k_userdefined_charset:
return sym_k_userdefined_charset;
default:
_assert (charset_as_subclass!=0, "charset code==0");
_assert (charset_as_subclass<=uil_max_charset, "unknown charset");
return charset_as_subclass;
}
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function verifies the character set indicated by the user.
**
** FORMAL PARAMETERS:
**
** current_frame current stack frame
** charset_frame stack frame of CHARSET token
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_charset_verify ( charset_frame )
yystype *charset_frame;
{
key_keytable_entry_type *az_keyword_entry;
_assert(((charset_frame->b_tag == sar_k_token_frame) ||
(charset_frame->b_tag == sar_k_value_frame)),
"token or value frame missing" );
az_keyword_entry = charset_frame->value.az_keyword_entry;
/*
** Store the current charset so it can be used by LEX to processes a
** string literal (if the CHARSET_NAME is used to prefix a string literal)
*/
Uil_lex_l_literal_charset = az_keyword_entry->b_subclass;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function converts a random NAME into a CHARSET_NAME
** with the default charset.
**
** FORMAL PARAMETERS:
**
** name_frame current stack frame containing NAME
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** modified name_frame
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** name_frame converted from NAME to CHARSET_NAME
**
**--
**/
void sar_make_fallback_charset(name_frame)
yystype *name_frame;
{
sym_name_entry_type *symbol_entry;
static key_keytable_entry_type *az_keyword_entry = NULL;
_assert(((name_frame->b_tag == sar_k_token_frame) ||
(name_frame->b_tag == sar_k_value_frame)),
"token or value frame missing" );
/* Get symbol and check if already used as charset. */
symbol_entry = (sym_name_entry_type *)name_frame->value.az_symbol_entry;
if ((symbol_entry->b_flags & sym_m_charset) == 0)
{
symbol_entry->b_flags |= sym_m_charset;
diag_issue_diagnostic(d_default_charset,
_sar_source_pos2(symbol_entry),
symbol_entry->c_text,
DEFAULT_TAG);
}
/* Get the default charset keyword entry. */
if (az_keyword_entry == NULL)
az_keyword_entry = key_find_keyword(strlen(DEFAULT_TAG), DEFAULT_TAG);
_assert((az_keyword_entry !=NULL), "default charset keyword missing");
/* Change NAME to CHARSET_NAME */
name_frame->value.az_keyword_entry = az_keyword_entry;
name_frame ->b_type = az_keyword_entry->b_token;
/*
** Store the current charset so it can be used by LEX to processes a
** string literal (if the NAME is used to prefix a string literal)
*/
Uil_lex_l_literal_charset = az_keyword_entry->b_subclass;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function checks the attributes of CHARACTER_SET function.
**
** FORMAL PARAMETERS:
**
** target_frame pointer to resultant token stack frame
** value_frame pointer to frame holding keyword and value
** prior_value_frame pointer to previous properties
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** attribute information is stuffed in target frame
**
**--
**/
void sar_chk_charset_attr( target_frame, value_frame, prior_value_frame )
yystype *target_frame;
yystype *value_frame;
yystype *prior_value_frame;
{
/*
** Set up not specified values in the target frame.
** b_type will hold the sixteen_bit property
*/
switch (prior_value_frame->b_tag)
{
case sar_k_null_frame:
/*
** no prior values
*/
target_frame->b_tag = sar_k_token_frame;
target_frame->b_direction = NOSTRING_DIRECTION;
target_frame->b_charset = uil_sym_default_charset;
target_frame->b_type = 0;
break;
case sar_k_token_frame:
case sar_k_value_frame:
/*
** prior values - transfer them
*/
target_frame->b_tag = sar_k_token_frame;
target_frame->b_direction = prior_value_frame->b_direction;
target_frame->b_charset = prior_value_frame->b_charset;
target_frame->b_type = prior_value_frame->b_type;
break;
default:
_assert( FALSE, "prior value frame missing from stack" );
}
/*
** Case on the keyword for the attribute given
*/
switch (value_frame->b_type)
{
case RIGHT_TO_LEFT:
{
sym_value_entry_type *value_entry;
value_entry =
(sym_value_entry_type *) value_frame->value.az_symbol_entry;
/*
** If the value is a boolean, then just set the corresponding mask
** accordingly.
*/
if (value_entry->b_type == sym_k_bool_value)
if (value_entry->value.l_integer == TRUE)
target_frame->b_direction = XmSTRING_DIRECTION_R_TO_L;
else
target_frame->b_direction = XmSTRING_DIRECTION_L_TO_R;
break;
}
case SIXTEEN_BIT:
{
sym_value_entry_type *value_entry;
value_entry =
(sym_value_entry_type *) value_frame->value.az_symbol_entry;
/*
** If the value is a boolean, then just set the corresponding mask
** accordingly.
*/
if (value_entry->b_type == sym_k_bool_value)
if (value_entry->value.l_integer == TRUE)
target_frame->b_type |= sym_m_sixteen_bit;
else
target_frame->b_type &= ~sym_m_sixteen_bit;
break;
}
default:
_assert( FALSE, "keyword missing from stack" );
}
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function makes a CHARACTER_SET and sets the properties
** of the string.
**
** FORMAL PARAMETERS:
**
** target_frame pointer to resultant token stack frame
** value_frame pointer to string value
** attr_frame pointer to strings attributes
** keyword_frame frame to use as locator for result
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_make_charset (target_frame, value_frame, attr_frame, keyword_frame)
yystype *target_frame;
yystype *value_frame;
yystype *attr_frame;
yystype *keyword_frame;
{
sym_value_entry_type *value_entry;
_assert( value_frame->b_tag == sar_k_value_frame,
"value frame missing from stack" );
/*
** Set the character set information into the symbol table
** entry for the char_8 string that indentifies the name of this
** userdefined character set.
*/
value_entry =
(sym_value_entry_type *) value_frame->value.az_symbol_entry;
value_entry->b_charset = sym_k_userdefined_charset;
/* BEGIN HaL fix CR 5547 */
sem_evaluate_value (value_entry);
if (value_entry->b_type != sym_k_char_8_value)
diag_issue_diagnostic
(d_wrong_type,
_sar_source_pos2( value_entry ),
diag_value_text( value_entry->b_type ),
"null-terminated string");
/* END HaL fix CR 5547 */
/*
** If the attr_frame is not null, it must be a value frame with contains
** a pointer to the attributes frame for this userdefined charset.
*/
if (attr_frame->b_tag == sar_k_token_frame)
{
/*
** Set the attributes of the string, as specified by the options
** to the CHARACTER_SET function, without disturbing any
** existing bits.
*/
value_entry->b_direction = attr_frame->b_direction;
value_entry->b_aux_flags = (attr_frame->b_type & sym_m_sixteen_bit);
}
/*
** initialize the target frame
*/
_sar_move_source_info( target_frame, keyword_frame );
target_frame->b_tag = sar_k_value_frame;
target_frame->b_type = sym_k_char_8_value;
target_frame->b_flags = sym_m_private;
target_frame->value.az_symbol_entry = value_frame->value.az_symbol_entry;
/*
** Store the current charset so it can be used by LEX to processes a
** string literal (if the CHARACTER_SET function is used to prefix a
** string literal)
*/
Uil_lex_l_literal_charset = lex_k_userdefined_charset;
Uil_lex_az_literal_charset = value_entry;
}

View file

@ -1,157 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilSarDef.h /main/10 1995/07/14 09:36:55 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interface to the UIL parser.
** UIL uses YACC as its parsing tool.
**
**--
**/
#ifndef UilSarDef_h
#define UilSarDef_h
/*
** Format of a value on YACC value stack. This is also the form of a
** token created by the lexical analyzer.
*/
#define sar_k_null_frame 0 /* tag for an epsilon production */
#define sar_k_token_frame 1 /* tag for a token frame */
#define sar_k_value_frame 2 /* tag for a value frame */
#define sar_k_module_frame 3 /* tag for module frame */
#define sar_k_object_frame 4 /* tag for object frame */
#define sar_k_root_frame 5 /* tag for root frame */
typedef struct
{
src_source_record_type *az_source_record; /* actual record where token exists */
unsigned char b_source_pos; /* the character in az_source_record
where this token begins */
unsigned char b_source_end; /* the character in az_source_record
where this token ends */
unsigned char b_tag; /* tag of stack frame */
unsigned char b_type; /* for tokens - token number
for value - the data type */
unsigned short b_flags; /* used by value */
unsigned char b_direction; /* used by value */
unsigned char b_charset; /* used by value */
union
{
/* must be capable of holding a pointer */
long l_integer; /* integer value*/
sym_entry_type *az_symbol_entry; /* symbol entry */
key_keytable_entry_type
*az_keyword_entry; /* keyword entry */
} value;
} yystype;
/*
** Macros for moving source information to and from parse stack frames
*/
#define _sar_move_source_info( _target, _source ) \
{ \
yystype *__target; \
yystype *__source; \
\
__target = (_target); __source = (_source); \
__target->az_source_record = __source->az_source_record;\
__target->b_source_pos = __source->b_source_pos; \
__target->b_source_end = __source->b_source_end; \
}
#define _sar_move_source_info_2( _target, _source ) \
{ \
sym_entry_header_type *__target; \
sym_entry_header_type *__source; \
\
__target = (_target); __source = (_source); \
\
__target->az_src_rec = __source->az_src_rec; \
__target->b_src_pos = __source->b_src_pos; \
__target->b_end_pos = __source->b_end_pos; \
}
#define _sar_save_source_info( _target, _src_beg, _src_end ) \
{ \
sym_entry_header_type *__target; \
XmConst yystype *__src_end; \
\
__target = (_target); \
__src_end = (_src_end); \
\
__target->az_src_rec = __src_end->az_source_record; \
__target->b_src_pos = __src_end->b_source_pos; \
__target->b_end_pos = __src_end->b_source_end; \
}
#define _sar_save_source_pos( _target, _src ) \
{ \
sym_entry_header_type *__target; \
XmConst yystype *__src; \
\
__target = (_target); __src = (_src); \
\
__target->az_src_rec = __src->az_source_record; \
__target->b_src_pos = __src->b_source_pos; \
__target->b_end_pos = __src->b_source_end; \
}
#define _sar_source_position( _source ) \
_source->az_source_record, \
_source->b_source_pos
#define _sar_source_pos2( _source ) \
_source->header.az_src_rec, \
_source->header.b_src_pos
#endif /* UilSarDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,337 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: UilSarExp.c /main/11 1995/07/14 09:37:03 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module supports value expressions in UIL.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include "UilDefI.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function processes a binary arithmetic operator in an expression
**
** FORMAL PARAMETERS:
**
** operator_frame: [in-out] frame holding the operator and the
** target frame
** op1_frame: [in] frame holding operand 1
** op2_frame: [in] frame holding operand 2
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** op1 or op2 symbol entry may be freed
**
**--
**/
void sar_binary_op(operator_frame, op1_frame, op2_frame)
yystype *operator_frame;
yystype *op1_frame;
yystype *op2_frame;
{
sym_value_entry_type *res_entry;
int operator;
_assert( operator_frame->b_tag == sar_k_token_frame,
"operator missing" );
res_entry = (sym_value_entry_type *)
sem_allocate_node( sym_k_value_entry,
sym_k_value_entry_size );
res_entry->obj_header.b_flags = sym_m_builtin | sym_m_private;
res_entry->b_type = sym_k_any_value;
/* res_entry->az_source_rec = op1_frame->az_source_record; */
_sar_save_source_pos (&res_entry->header, op1_frame);
/*
** Determine the operator from the operator frame
*/
switch (operator_frame->b_type)
{
case AND:
operator = sym_k_and_op;
break;
case PLUS:
operator = sym_k_add_op;
break;
case MINUS:
operator = sym_k_subtract_op;
break;
case MULTIPLY:
operator = sym_k_multiply_op;
break;
case DIVIDE:
operator = sym_k_divide_op;
break;
case LEFT_SHIFT:
operator = sym_k_left_shift_op;
break;
case RIGHT_SHIFT:
operator = sym_k_right_shift_op;
break;
case OR:
operator = sym_k_or_op;
break;
case XOR:
operator = sym_k_or_op;
break;
default:
_assert( FALSE, "unknown binary operator" );
}
res_entry->b_expr_opr = operator;
/*
** If the value is a forward reference, we'll patch in the
** address of the the referenced value between passes. Otherwise,
** just point to the referenced value node.
*/
if ((op1_frame->b_flags & sym_m_forward_ref) != 0)
sym_make_value_forward_ref (op1_frame,
(char*)&(res_entry->az_exp_op1), sym_k_patch_add);
else
res_entry->az_exp_op1 =
(sym_value_entry_type *) op1_frame->value.az_symbol_entry;
if ((op2_frame->b_flags & sym_m_forward_ref) != 0)
sym_make_value_forward_ref (op2_frame,
(char*)&(res_entry->az_exp_op2), sym_k_patch_add);
else
res_entry->az_exp_op2 =
(sym_value_entry_type *) op2_frame->value.az_symbol_entry;
operator_frame->b_tag = sar_k_value_frame;
operator_frame->b_type = res_entry->b_type;
operator_frame->b_flags = res_entry->obj_header.b_flags;
operator_frame->value.az_symbol_entry =
(sym_entry_type *) res_entry;
return;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function processes a unary arithmetic operator in an expression
**
** FORMAL PARAMETERS:
**
** operator_frame: [in-out] frame holding the operator and the
** target frame
** op1_frame: [in] frame holding operand 1
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** op1 symbol entry may be freed
**
**--
**/
void sar_unary_op(operator_frame, op1_frame)
yystype *operator_frame;
yystype *op1_frame;
{
sym_value_entry_type *res_entry;
int operator;
int res_type;
_assert( operator_frame->b_tag == sar_k_token_frame,
"operator missing" );
/*
** Determine the operator from the operator frame
*/
switch (operator_frame->b_type)
{
case PLUS:
operator = sym_k_unary_plus_op;
break;
case MINUS:
operator = sym_k_unary_minus_op;
break;
case NOT:
operator = sym_k_not_op;
break;
case INTEGER:
res_type = sym_k_integer_value;
operator = sym_k_coerce_op;
break;
case FLOAT:
res_type = sym_k_float_value;
operator = sym_k_coerce_op;
break;
case SINGLE_FLOAT:
res_type = sym_k_single_float_value;
operator = sym_k_coerce_op;
break;
case KEYSYM:
res_type = sym_k_keysym_value;
operator = sym_k_coerce_op;
break;
default:
_assert( FALSE, "unknown unary operator" );
}
/*
** Create the result
*/
res_entry = (sym_value_entry_type *)
sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size);
res_entry->b_expr_opr = operator;
/* Begin fixing OSF CR 5691 */
res_entry->b_type = operator;
/* End fixing OSF CR 5691 */
res_entry->az_exp_op1 =
(sym_value_entry_type *) op1_frame->value.az_symbol_entry;
res_entry->obj_header.b_flags = sym_m_builtin | sym_m_private;
if (operator == sym_k_coerce_op)
res_entry->b_type = res_type;
_sar_save_source_pos (&res_entry->header, op1_frame );
operator_frame->b_tag = sar_k_value_frame;
operator_frame->b_type = res_entry->b_type;
operator_frame->b_flags = res_entry->obj_header.b_flags;
operator_frame->value.az_symbol_entry = (sym_entry_type *) res_entry;
return;
}

View file

@ -1,247 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: UilSarInc.c /main/12 1997/03/12 15:21:31 dbl $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module contain the routines for processing the INCLUDE construct.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include <Xm/Xm.h>
#include "UilDefI.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This routine handles the include directive.
**
** FORMAL PARAMETERS:
**
** file_frame parser stack frame that contains the name of the
** file to be included.
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_include_file ( file_frame, include_frame, semi_frame )
yystype * file_frame;
yystype * include_frame;
yystype * semi_frame;
{
sym_value_entry_type * value_entry;
sym_include_file_entry_type * include_entry;
sym_section_entry_type * section_entry;
sym_section_entry_type * section_tail_entry;
char * buffer;
unsigned char tmp1;
int i,j;
value_entry =
(sym_value_entry_type *) file_frame -> value . az_symbol_entry;
/*
* Fix for CR 5465 - If the value_entry is not of type char_8, print an
* error message and abort the compilation
*/
if ((value_entry->b_type != sym_k_char_8_value) &&
(value_entry->b_type != sym_k_localized_string_value))
diag_issue_diagnostic (
d_include_file,
_sar_source_pos2(value_entry));
/*
* End Fix for CR 5465
*/
/*
* If the direction is RtoL then reverse the include file.
*/
if (value_entry->b_direction == XmSTRING_DIRECTION_R_TO_L)
{
/*
** Just reverse the bytes from the first to last
*/
for (i=0, j=value_entry->w_length-1;
i < (int)((int)value_entry->w_length>>1);
i++,j--)
{
tmp1 = value_entry->value.c_value[ i ];
value_entry->value.c_value[ i ] =
value_entry->value.c_value[ j ];
value_entry->value.c_value[ j ] = tmp1;
}
}
_assert (value_entry -> header . b_tag == sym_k_value_entry,
"missing value entry for include");
/*
** Allocate an INCLUDE entry
*/
include_entry = (sym_include_file_entry_type *) sem_allocate_node
( sym_k_include_file_entry, sym_k_include_file_entry_size );
/*
** Open the include file. Set up a null-terminated name string.
*/
buffer = (char *) _get_memory (value_entry -> w_length + 1);
_move (buffer, value_entry -> value . c_value,
value_entry -> w_length);
buffer [value_entry -> w_length] = 0 ;
src_open_file (buffer, include_entry->full_file_name);
/*
** Allocate a section entry for this include "section".
** Store the source info in it
*/
section_entry = (sym_section_entry_type *) sem_allocate_node
( sym_k_section_entry, sym_k_section_entry_size );
section_entry->header.b_type = sym_k_include_section;
_sar_save_source_info ( &section_entry->header , include_frame , semi_frame );
/*
** Link this section into the current section list.
*/
section_entry->next = (sym_entry_type *) sym_az_current_section_entry;
section_entry->prev_section = sym_az_current_section_entry->prev_section;
sym_az_current_section_entry = section_entry;
/*
** Link the include intry we created earlier onto the section list
*/
section_entry->entries = (sym_entry_type *)include_entry;
/*
** Save the file name
*/
_move (include_entry->file_name, buffer, value_entry->w_length);
include_entry->file_name [value_entry->w_length] = 0;
/*
** Since this is an INCLUDE we want included sections to hang off
** of it so we create a new place holder entry (tail) and change the
** "current" section list to it.
*/
section_tail_entry = (sym_section_entry_type *) sem_allocate_node
( sym_k_section_entry, sym_k_section_entry_size );
section_tail_entry->header.b_type = sym_k_section_tail;
include_entry->sections = section_tail_entry;
section_tail_entry->prev_section = sym_az_current_section_entry;
sym_az_current_section_entry = section_tail_entry;
_free_memory (buffer);
}

View file

@ -1,887 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: UilSarMod.c /main/13 1997/03/12 15:21:36 dbl $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module contain the routines for processing the module construct.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include "UilDefI.h"
/*
**
** TABLE OF CONTENTS
**
*/
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
extern yystype yylval;
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
externaldef(uil_comp_glbl) src_source_record_type
*src_az_module_source_record;
externaldef(uil_comp_glbl) unsigned short int
*uil_urm_variant = NULL;
externaldef(uil_comp_glbl) unsigned short int
*uil_arg_compr = NULL;
externaldef(uil_comp_glbl) unsigned short int
*uil_reas_compr = NULL;
externaldef(uil_comp_glbl) unsigned short int
*uil_widget_compr = NULL;
externaldef(uil_comp_glbl) unsigned short int
*uil_child_compr = NULL;
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
unsigned int module_clauses;
#define m_version_clause (1<<0)
#define m_names_clause (1<<1)
#define m_charset_clause (1<<2)
#define m_objects_clause (1<<3)
#define m_after_names (m_charset_clause)
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function initializes all static data structure for the semantic
** action routines.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** uil_urm_variant
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** global variables are initialized
**
**--
**/
void sar_initialize ()
{
int i; /* loop index */
/* BEGIN OSF Fix CR 5443 */
/* Initialize uil_sym_default_charset based on XmFALLBACK_CHARSET */
if (strcmp(XmFALLBACK_CHARSET, "ISO8859-1") != 0) /* Most common case. */
for (i = 0; i < (int)charset_lang_table_max; i++)
if (strcmp(XmFALLBACK_CHARSET, charset_lang_names_table[i]) == 0)
{
uil_sym_default_charset = charset_lang_codes_table[i];
break;
}
/* END OSF Fix CR 5443 */
/*
* Allocate vectors for the variant and usage vectors if they are NULL,
*/
if ( uil_urm_variant == NULL )
uil_urm_variant = (unsigned short int *)
XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
if ( uil_arg_compr == NULL )
uil_arg_compr = (unsigned short int *)
XtMalloc(sizeof(unsigned short int)*(uil_max_arg+1));
if ( uil_reas_compr == NULL )
uil_reas_compr = (unsigned short int *)
XtMalloc(sizeof(unsigned short int)*(uil_max_reason+1));
if ( uil_widget_compr == NULL )
uil_widget_compr = (unsigned short int *)
XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
if ( uil_child_compr == NULL )
uil_child_compr = (unsigned short int *)
XtMalloc(sizeof(unsigned short int)*(uil_max_child+1));
/*
** Loop throught the array of object variants and set them all to NULL.
*/
for (i = 0; i<uil_max_object+1; i++)
uil_urm_variant[i] = 0;
/*
** Initialize all compression vectors
*/
for ( i=0 ; i<uil_max_arg+1 ; i++ )
uil_arg_compr[i] = 0;
for ( i=0 ; i<uil_max_reason+1 ; i++ )
uil_reas_compr[i] = 0;
for ( i=0 ; i<uil_max_object+1 ; i++ )
uil_widget_compr[i] = 0;
for ( i=0 ; i<uil_max_child+1 ; i++ )
uil_child_compr[i] = 0;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function creates the root entry node for the compilation.
** The "root" entry is the root node of the symbol tree and is
** what's passed back to the caller of the compiler.
**
** FORMAL PARAMETERS:
**
** root_frame ptr to root frame that will remain on the stack
** throughout the compilation
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** sym_az_root_entry global pointer used thoughout the compilation
** sym_az_curent_section_entry global pointer used thoughout the compilation
** src_az_first_source_record global pointer to the source record list
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_create_root (root_frame)
yystype *root_frame;
{
/*
** Allocate the symbol nodes
*/
sym_az_root_entry = (sym_root_entry_type *)
sem_allocate_node (sym_k_root_entry, sym_k_root_entry_size);
/*
** Create a place holder entry (tail) and change the "current" section list to it.
*/
sym_az_current_section_entry = (sym_section_entry_type *) sem_allocate_node
( sym_k_section_entry, sym_k_section_entry_size );
sym_az_current_section_entry->header.b_type = sym_k_section_tail;
sym_az_root_entry->sections = sym_az_current_section_entry;
sym_az_root_entry->src_record_list = src_az_first_source_record;
/*
** Save the file name and the expanded version of it.
*/
strcpy (sym_az_root_entry->file_name, Uil_cmd_z_command.ac_source_file);
strcpy (sym_az_root_entry->full_file_name, src_az_source_file_table[0]->expanded_name);
/*
** Save the symbol node in the root frame.
*/
root_frame->b_tag = sar_k_root_frame;
root_frame->b_type = sym_k_root_entry;
root_frame->value.az_symbol_entry = (sym_entry_type *)sym_az_root_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function create the module entry symbol node for the compilation.
**
** FORMAL PARAMETERS:
**
** target_frame ptr to module frame that will remain on the stack
** throughout the compilation
** id_frame ptr to token frame for the module name
**
** IMPLICIT INPUTS:
**
** sym_az_root_entry global that points to the root entry
**
** IMPLICIT OUTPUTS:
**
** sym_az_module_entry global that points to module entry
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** set second line of the listing title
**
**--
**/
void sar_create_module(target_frame, id_frame, module_frame)
yystype *target_frame;
yystype *id_frame;
yystype *module_frame;
{
sym_name_entry_type *name_entry;
/*
** Call standard routine to check name entry for id_frame.
** This routine handles font name, color names, etc used as ids
*/
name_entry = (sym_name_entry_type *) sem_dcl_name( id_frame );
/*
** Allocate the module entry and fill it in
*/
sym_az_module_entry = (sym_module_entry_type *)
sem_allocate_node (sym_k_module_entry, sym_k_module_entry_size);
sym_az_module_entry->obj_header.az_name = name_entry;
_sar_save_source_pos (&sym_az_module_entry->header, module_frame);
/* preserve module header comments */
sar_assoc_comment ((sym_obj_entry_type *)sym_az_module_entry);
/*
** Hang the module entry off the root entry
*/
sym_az_root_entry->module_hdr = sym_az_module_entry;
/*
** Have name entry point to the module entry too. This stops the
** name from being reused to name another construct.
*/
name_entry->az_object = (sym_entry_type *) sym_az_module_entry;
/*
** Save the source information about module name identifier
*/
_sar_save_source_info ( &name_entry->header , module_frame , id_frame );
/*
** Set up target frame
*/
target_frame->b_tag = sar_k_module_frame;
/*
** Set up listing title
*/
if (Uil_cmd_z_command.v_listing_file)
sprintf(Uil_lst_c_title2,
"Module: %s",
name_entry->c_text );
/*
** Set mask to no clauses seen
*/
module_clauses = 0;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function sets a version string for the module.
**
** FORMAL PARAMETERS:
**
** value_frame ptr to value frame for version string
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** sym_az_module_entry global that point to module entry
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** set up second line of the listing title
**
**--
**/
void sar_process_module_version (value_frame, start_frame)
yystype *value_frame;
yystype *start_frame;
{
sym_value_entry_type *value_entry;
_assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" );
if ((module_clauses & m_version_clause) != 0)
diag_issue_diagnostic
( d_single_occur,
_sar_source_position( value_frame ),
"UIL", "module", "version", "clause"
);
/*
** FORWARD REFERENCING OF VERSION NO LONGER ALLOWED
** If it's not a forward reference, verify its length and stick a pointer
** to the value node of the version in the module entry.
*/
if ((value_frame->b_flags & sym_m_forward_ref) != 0)
diag_issue_diagnostic(d_illegal_forward_ref,
_sar_source_position(value_frame),
"Module Version"
);
else
{
value_entry = (sym_value_entry_type *)
value_frame->value.az_symbol_entry;
if (value_entry->w_length > 31)
{
diag_issue_diagnostic
( d_out_range,
_sar_source_position( value_frame ),
"version string",
"0..31 characters"
);
value_entry->w_length = 31;
}
sym_az_module_entry->az_version = value_entry;
}
/*
** Save source info
*/
_sar_save_source_info ( &sym_az_module_entry->az_version->header , start_frame , value_frame);
/*
** Set up listing title
*/
if (Uil_cmd_z_command.v_listing_file)
sprintf(Uil_lst_c_title2,
"Module: %s \t Version: %s",
sym_az_module_entry->obj_header.az_name->c_text,
value_entry->value.c_value );
module_clauses |= m_version_clause;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function sets the case sensitivity of names for the module.
**
** FORMAL PARAMETERS:
**
** token_frame ptr to token frame for keyword sensitive or insensitive
**
** IMPLICIT INPUTS:
**
** sym_az_module_entry global which points to module entry
**
** IMPLICIT OUTPUTS:
**
** uil_v_case_sensitive global which control case sensitivity of names
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_process_module_sensitivity (token_frame, start_frame)
yystype *token_frame;
yystype *start_frame;
{
_assert( token_frame->b_tag == sar_k_token_frame, "token frame missing" );
if ((module_clauses & m_names_clause) != 0)
diag_issue_diagnostic
( d_single_occur,
_sar_source_position( token_frame ),
"UIL", "module", "names", "clause"
);
if ((module_clauses & m_after_names) != 0)
diag_issue_diagnostic
( d_names,
_sar_source_position( token_frame )
);
uil_v_case_sensitive = (token_frame->b_type == CASE_SENSITIVE);
sym_az_module_entry->az_case_sense = (sym_value_entry_type *)
sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size);
sym_az_module_entry->az_case_sense->header.b_type = uil_v_case_sensitive;
/*
** Save source info
*/
_sar_save_source_info ( &sym_az_module_entry->az_case_sense->header , start_frame , token_frame);
/* let the keyword table know of the sensitivity change */
key_initialize();
/*
** The default for name sensitivity is SENSITIVE.
** At the point that this semantic routine is called, the only valid
** name seen so far is the module name.
*/
module_clauses |= m_names_clause;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function sets the default charset for the module.
**
** FORMAL PARAMETERS:
**
** token_frame ptr to token frame for charset
**
** IMPLICIT INPUTS:
**
** sym_az_module_entry global pointer to the module entry
**
** IMPLICIT OUTPUTS:
**
** Uil_lex_l_user_default_charset
** Uil_lex_az_charset_entry
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_process_module_charset(token_frame , start_frame)
yystype *token_frame;
yystype *start_frame;
{
sym_value_entry_type *value_entry;
_assert( (token_frame->b_tag == sar_k_token_frame) ||
(token_frame->b_tag == sar_k_value_frame), "token or value frame missing" );
if ((module_clauses & m_charset_clause) != 0)
diag_issue_diagnostic
( d_single_occur,
_sar_source_position( token_frame ),
"UIL", "module", "character_set", "clause"
);
/*
** There are two different ways that the charset info may be specified.
** If the charset_frame is a token frame, then we can just grab the
** token class and map it into a charset value. If it is a value frame
** the it is the result of the CHARACTER_SET function and is a string
** value representing the character set.
*/
switch (token_frame->b_tag)
{
case sar_k_token_frame:
{
key_keytable_entry_type *az_keyword_entry;
az_keyword_entry = token_frame->value.az_keyword_entry;
Uil_lex_l_user_default_charset = az_keyword_entry->b_subclass;
value_entry = sem_create_value_entry (
token_frame->value.az_keyword_entry->at_name,
token_frame->value.az_keyword_entry->b_length, sym_k_char_8_value );
break;
}
case sar_k_value_frame:
{
Uil_lex_l_user_default_charset = lex_k_userdefined_charset;
Uil_lex_az_charset_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
value_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
break;
}
}
/* If charset specified for module, then localized strings not allowed */
Uil_lex_l_localized = FALSE;
module_clauses |= m_charset_clause;
sym_az_module_entry->az_character_set = value_entry;
/*
** Save source info
*/
_sar_save_source_info ( &value_entry->header , start_frame , token_frame);
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function saves the source record for the module header
** for possible later use in the machine code listing.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** yylval Current token information from the lexical analyzer
**
** IMPLICIT OUTPUTS:
**
** src_az_module_source_record source record for the module header
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_save_module_source ()
{
src_az_module_source_record = yylval.az_source_record;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This routine creates and saves a default object specification
** for the module entry itself.
**
** FORMAL PARAMETERS:
**
** object_frame ptr to token frame for "OBJECT"
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** sym_az_module_entry global pointer to the module entry
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_make_def_obj (object_frame)
yystype *object_frame;
{
sym_def_obj_entry_type *def_obj_entry;
/*
* Make def_obj entry and link into the chain headed in the module
*/
def_obj_entry = (sym_def_obj_entry_type *) sem_allocate_node
(sym_k_def_obj_entry, sym_k_def_obj_entry_size);
_sar_save_source_pos (&def_obj_entry->header, object_frame);
def_obj_entry->next = sym_az_module_entry->az_def_obj;
sym_az_module_entry->az_def_obj = def_obj_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function sets the default variants for objects which
** are defined in the module.
**
** FORMAL PARAMETERS:
**
** type_frame ptr to token frame for object type
** variant_frame ptr to token frame for variant
**
** IMPLICIT INPUTS:
**
** uil_gadget_variants table to see if the gadget variant is supported
** uil_urm_variant table to see if the object type has been
** specified previously
** sym_az_module_entry global pointing to the module entry
**
** IMPLICIT OUTPUTS:
**
** uil_urm_variant table to contain the default variant for this
** object type.
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sar_process_module_variant (obj_type_frame, variant_frame)
yystype *obj_type_frame;
yystype *variant_frame;
{
unsigned int obj_type, obj_variant;
yystype *source_frame;
sym_def_obj_entry_type *def_obj_entry;
source_frame = & yylval;
obj_type = obj_type_frame->value.az_keyword_entry->b_subclass;
obj_variant = variant_frame->b_type;
/* See if this object type has been specified before. */
if ( uil_urm_variant[obj_type] != 0 )
{
diag_issue_diagnostic
(d_supersede,
_sar_source_position ( source_frame ),
diag_object_text (obj_type),
diag_tag_text (obj_variant),
diag_tag_text (sym_k_module_entry),
"" );
}
/* See if this object type supports gadgets. */
if ( obj_variant == sym_k_gadget_entry )
{
if ( uil_gadget_variants[obj_type] == 0 )
{
diag_issue_diagnostic
(d_gadget_not_sup,
_sar_source_position ( source_frame ),
diag_object_text (obj_type),
diag_object_text (obj_type) );
obj_variant = sym_k_widget_entry;
}
}
/* Save the default variant information */
uil_urm_variant[obj_type] = obj_variant;
/*
** get the latest def_obj entry and fill in
*/
def_obj_entry = sym_az_module_entry->az_def_obj->next;
def_obj_entry->b_object_info = obj_type;
def_obj_entry->b_variant_info = obj_variant;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This procedure saves source info for the various sections declaration
** lists in the Uil file (i.e. value, identifier, procedure, object, and
** list).
**
** FORMAL PARAMETERS:
**
** header_frame ptr to token frame for the section declaration
** section_type integer describing what section this is
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** sym_az_root_entry global pointer to the root entry
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** none
**
**--
*/
void sar_save_section_source (header_frame, section_type)
yystype *header_frame;
int section_type;
{
sym_section_entry_type *section_entry;
section_entry = (sym_section_entry_type *) sem_allocate_node
( sym_k_section_entry, sym_k_section_entry_size );
section_entry->header.b_type = section_type;
/*
** Save source info
*/
_sar_save_source_info ( &section_entry->header , header_frame, header_frame);
/*
** Link this section into the current section list.
*/
section_entry->next = (sym_entry_type *) sym_az_current_section_entry;
section_entry->prev_section = sym_az_current_section_entry->prev_section;
sym_az_current_section_entry = section_entry;
}

File diff suppressed because it is too large Load diff

View file

@ -1,464 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: UilSarProc.c /main/12 1995/07/14 09:37:43 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module contain the routines for processing procedures.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include "UilDefI.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function create the procedure definition entry symbol
** node a procedure declaration.
**
** FORMAL PARAMETERS:
**
** id_frame ptr to token frame for the procedure name
** param_frame ptr to token frame or null frame holding the
** type of the argument
** class_frame ptr to frame whose b_flags holds private, etc. info
**
** IMPLICIT INPUTS:
**
** sym_az_current_section_entry the "current" section list
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** errors may be issued for previously defined name
**
**--
**/
void
sar_create_procedure(XmConst yystype *id_frame,
XmConst yystype *param_frame,
XmConst yystype *class_frame,
XmConst yystype *semi_frame)
{
sym_name_entry_type *name_entry;
sym_proc_def_entry_type *proc_def_entry;
sym_section_entry_type *section_entry;
sym_obj_entry_type *obj_entry;
/*
** Call standard routine to check name entry for id_frame.
** This routine handles font name, color names, etc used as ids
*/
name_entry = (sym_name_entry_type *) sem_dcl_name( id_frame );
if (name_entry == NULL)
return;
/*
** Allocate the procedure definition entry and fill it in
*/
proc_def_entry = (sym_proc_def_entry_type *)
sem_allocate_node (sym_k_proc_def_entry, sym_k_proc_def_entry_size);
proc_def_entry->b_widget_type = uil_max_object + 1;
proc_def_entry->obj_header.az_name = (sym_name_entry_type *) name_entry;
name_entry->az_object = (sym_entry_type *) proc_def_entry;
/*
** Parameter frame has 4 cases:
** 1) no argument checking desired
** syntax: PROCEDURE id
** 2) argument checking desired - no argument
** syntax: PROCEDURE id( )
** 3) argument checking desired - single argument
** syntax: PROCEDURE id( type )
** 4) argument checking desired - single typed widget argument
** syntax: PROCEDURE id( CLASS_NAME )
** These cases are distinguished as follows:
** 1) tag = null type = 0
** 2) tag = null type = sar_k_no_value
** 3) tag = token type = argument type
** 4) tag = object type = widget type
*/
proc_def_entry->v_arg_checking = TRUE;
switch (param_frame->b_tag)
{
case sar_k_null_frame:
if (param_frame->b_type == sym_k_no_value )
{
proc_def_entry->b_arg_count = 0;
proc_def_entry->b_arg_type = sym_k_no_value;
}
else
proc_def_entry->v_arg_checking = FALSE;
break;
case sar_k_token_frame:
proc_def_entry->b_arg_type = param_frame->b_type;
proc_def_entry->b_arg_count = 1;
break;
case sar_k_object_frame:
_assert((param_frame->b_type == sym_k_widget_entry),
"object frame not widget entry");
obj_entry =
(sym_obj_entry_type *)param_frame->value.az_symbol_entry;
proc_def_entry->b_arg_type = sym_k_widget_ref_value;
proc_def_entry->b_arg_count = 1;
proc_def_entry->b_widget_type = obj_entry->header.b_type;
break;
default:
_assert( FALSE, "param frame in error" );
}
/*
** Process the class clause
*/
switch (class_frame->b_flags)
{
case sym_m_exported:
sym_make_external_def( name_entry );
case sym_m_private:
case sym_m_imported:
break;
default:
_assert( FALSE, "class frame in error" );
}
proc_def_entry->obj_header.b_flags = class_frame->b_flags;
/*
** save the source file info for this procedure entry
*/
_sar_save_source_info (&proc_def_entry->header, id_frame, semi_frame );
sar_assoc_comment((sym_obj_entry_type *)proc_def_entry); /* preserve comments */
/*
** allocate a section entry to link the proc_def entry into the structure
*/
section_entry = (sym_section_entry_type *) sem_allocate_node
(sym_k_section_entry, sym_k_section_entry_size);
/*
** Link this entry off of the current section list
*/
section_entry->next = (sym_entry_type *) sym_az_current_section_entry->entries;
sym_az_current_section_entry->entries = (sym_entry_type *) section_entry;
section_entry->entries = (sym_entry_type *) proc_def_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function processes a reference to a procedure.
**
** FORMAL PARAMETERS:
**
** id_frame ptr to token frame for the procedure name
** value_frame ptr to token frame or null frame holding the
** value of the argument to the procedure
** context value indicating how the procedure is being used
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** a procedure reference entry / NULL in case of an illegal reference
**
** SIDE EFFECTS:
**
** errors may be issued
**
**--
**/
sym_proc_ref_entry_type
*sem_reference_procedure( yystype *id_frame,
XmConst yystype *value_frame,
XmConst int context )
{
sym_value_entry_type *value_entry;
sym_proc_def_entry_type *proc_def_entry;
sym_proc_ref_entry_type *proc_ref_entry;
/*
** Call standard routine to check name entry for id_frame.
** This routine handles font name, color names, etc used as ids
*/
proc_def_entry =
(sym_proc_def_entry_type *)
sem_ref_name( id_frame, sym_k_proc_def_entry );
switch (value_frame->b_tag)
{
case sar_k_null_frame:
value_entry = NULL;
break;
case sar_k_value_frame:
if ((value_frame->b_flags & sym_m_forward_ref) != 0)
value_entry = NULL;
else
value_entry = (sym_value_entry_type *)
value_frame->value.az_symbol_entry;
break;
case sar_k_object_frame:
value_entry =
(sym_value_entry_type *) value_frame->value.az_symbol_entry;
break;
default:
_assert( FALSE, "actual arg in error" );
}
/*
** Allocate the procedure reference entry and fill it in
*/
proc_ref_entry = (sym_proc_ref_entry_type *)
sem_allocate_node (sym_k_proc_ref_entry, sym_k_proc_ref_entry_size);
if ((id_frame->b_flags & sym_m_forward_ref) != 0)
sym_make_value_forward_ref (id_frame,
(char*)&(proc_ref_entry->az_proc_def), sym_k_patch_list_add);
else
proc_ref_entry->az_proc_def = proc_def_entry;
if ((value_frame->b_flags & sym_m_forward_ref) != 0)
sym_make_value_forward_ref (value_frame,
(char*)&(proc_ref_entry->az_arg_value), sym_k_patch_add);
else
proc_ref_entry->az_arg_value = value_entry;
/*
** Apply context constraints
**
** If this is a procedure being used as a user object,
** it should not have any arguments. The arguments to such
** a procedure are always a parent widget id and an argument list.
** This constraint is currently inforced by the grammar.
**
** At this time the compiler permits all types of values for callback
** arguments. This may be limited shortly when we see if it is
** reasonable to pass fonts, colors, reasons, etc.
*/
return proc_ref_entry;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function checks to see if a object is defined with the name
** corresponding to the id given in the first parameter.
**
** FORMAL PARAMETERS:
**
** id_frame ptr to a token frame on the parse stack holding the name
** tag the type of construct needed
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** ptr to a symbol entry for construct or NULL
**
** SIDE EFFECTS:
**
** error message if the name is undefined or for a different construct
** forward_ref bit may be turned on in id_frame
**--
**/
sym_entry_type
*sem_ref_name(yystype *id_frame,
XmConst int tag)
{
sym_name_entry_type *name_entry;
sym_entry_type *symbol_entry;
_assert( id_frame->b_tag == sar_k_token_frame, "arg1 not id frame" );
/*
** The id frame may hold a name or the keyword for a font name, color
** name, reason name etc. If it is one of these special name, then
** we must see if the symbol table holds a name for the special type.
*/
if (id_frame->b_type != NAME)
{
name_entry =
sym_find_name
( id_frame->value.az_keyword_entry->b_length,
id_frame->value.az_keyword_entry->at_name );
if (name_entry == NULL)
{
diag_issue_diagnostic
( d_undefined,
_sar_source_position( id_frame ),
diag_tag_text( sym_k_proc_def_entry ),
id_frame->value.az_keyword_entry->at_name );
return NULL;
}
}
else
name_entry =
(sym_name_entry_type *) id_frame->value.az_symbol_entry;
/*
** If the name entry already has no object linked from it, we are
** referencing an undefined object.
*/
symbol_entry = name_entry->az_object;
if (symbol_entry == NULL )
{
id_frame->b_flags |= sym_m_forward_ref;
return NULL;
}
/*
** If the name entry has the wrong type of object, this is also
** an error.
*/
if (symbol_entry->header.b_tag != tag )
{
diag_issue_diagnostic
( d_ctx_req,
_sar_source_position( id_frame ),
diag_tag_text( tag ),
diag_tag_text( symbol_entry->header.b_tag ) );
return NULL;
}
return symbol_entry;
}

File diff suppressed because it is too large Load diff

View file

@ -1,297 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: UilSemCSet.c /main/10 1997/03/12 15:21:53 dbl $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This file contains and routines related to the semantics of
** character sets.
** semantic validation.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include <Xm/Xm.h>
#include "UilDefI.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function returns a pointer to a character set name given
** its sym_k_..._charset code and possibly a userdefined charset
** value entry.
**
** FORMAL PARAMETERS:
**
** l_charset charset of the string (token value)
** az_charset_entry charset of the string (symbol table value entry)
**
** IMPLICIT INPUTS:
**
** charset data tables
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** pointer to name (must NOT be freed)
**
** SIDE EFFECTS:
**
** error messages may be issued for objects that are still undefined
** or of the wrong type
**
**--
**/
char *sem_charset_name (l_charset, az_charset_entry)
int l_charset;
sym_value_entry_type *az_charset_entry;
{
int charset; /* mapped character set */
charset = sem_map_subclass_to_charset (l_charset);
switch ( charset )
{
case sym_k_fontlist_default_tag:
return XmFONTLIST_DEFAULT_TAG;
case sym_k_userdefined_charset:
/*
** If the charset is user-defined, then fetch info from the symbol
** table entry for it.
*/
_assert (az_charset_entry!=NULL, "null userdefined charset entry");
return az_charset_entry->value.c_value;
default:
return charset_xmstring_names_table[charset];
}
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function returns information about the character set specified
** (writing direction and sixteen_bit properties).
**
** FORMAL PARAMETERS:
**
** l_charset charset of the string (token value)
** az_charset_entry charset of the string (symbol table value entry)
** direction string writing direction
** sixteen_bit Boolean return value
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** none
**
** SIDE EFFECTS:
**
** none
**
**--
**/
void sem_charset_info
(l_charset, az_charset_entry, write_direction, parse_direction, sixteen_bit)
int l_charset;
sym_value_entry_type *az_charset_entry;
int *write_direction;
int *parse_direction;
int *sixteen_bit;
{
int charset; /* mapped character set */
charset = sem_map_subclass_to_charset (l_charset);
switch (charset)
{
/*
** If the charset is user-defined, then fetch info from the symbol
** table entry for it.
*/
case sym_k_userdefined_charset:
{
*write_direction = az_charset_entry->b_direction;
*parse_direction = az_charset_entry->b_direction;
*sixteen_bit = (az_charset_entry->b_aux_flags &
sym_m_sixteen_bit) != 0;
break;
}
default:
{
*write_direction = charset_writing_direction_table[charset];
*parse_direction = charset_parsing_direction_table[charset];
if ( charset_character_size_table[charset] != sym_k_onebyte_charsize )
*sixteen_bit = TRUE;
else
*sixteen_bit = FALSE;
break;
}
}
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This function returns the charset id corresponding to the
** charset specified in a $LANG variable. User-defined character
** sets are not recognized - it must be one available in the
** the compiler tables.
**
** The name match is case-insensitive.
**
** FORMAL PARAMETERS:
**
** lang_charset string naming a character set
**
** IMPLICIT INPUTS:
**
** none
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** 0 no match - character set not found
** >0 character set code from sym_k_..._charset.
** sym_k_userdefined_charset is never returned.
**
**
** SIDE EFFECTS:
**
** none
**
**--
**/
int sem_charset_lang_name (lang_charset)
char *lang_charset;
{
char uname[200]; /* upper-case character set name */
int ndx; /* loop index */
/*
* Convert name to upper case, then search table (which is already in
* upper case).
*/
strcpy (uname, lang_charset);
for ( ndx=0 ; ndx<(int)strlen(uname) ; ndx++ )
uname[ndx] = _upper (uname[ndx]);
for ( ndx=0 ; ndx<(int)charset_lang_table_max ; ndx++ )
if ( strcmp(uname,charset_lang_names_table[ndx]) == 0 )
return (int)charset_lang_codes_table[ndx];
return 0;
}

File diff suppressed because it is too large Load diff

View file

@ -1,164 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilSrcDef.h /main/10 1995/07/14 09:38:34 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interface to the UIL source
** management procedures in the UIL compiler.
**
**--
**/
#ifndef UilSrcDef_h
#define UilSrcDef_h
/*
** Interface to src_open_source
*/
#define src_k_open_normal 1 /* open succeeded */
#define src_k_open_error 0 /* open was unsuccessful */
/*
** Close return statuses
*/
#define src_k_close_normal 1 /* close succeeded */
#define src_k_close_error 0 /* close was unsuccessful */
/*
** Interface to src_get_source_line
*/
#define src_k_read_truncated 3 /* record truncated */
#define src_k_read_error 2 /* error during read */
#define src_k_read_normal 1 /* record read normally */
#define src_k_end_source 0 /* end of source */
/*
** Source records describe the lines of the source program. The are
** used to retrieve the source file for the listing and diagnostics.
** Diagnostics randomly access these data structures by maintaining
** the address of the corresponding source record in tokens, the parse
** stack and symbol table entries. The listing file walks the source
** records via the linked list provide by ar_next_source_record.
*/
#define _src_null_access_key( _key ) (_key.l_key == EOF)
#define src_k_key_length 4
typedef struct
{
unsigned long l_key;
} z_key;
typedef struct _src_message_item_type
{
struct _src_message_item_type *az_next_message;
status l_message_number;
unsigned char b_source_pos;
char c_text[ 1 ];
} src_message_item_type;
#define src_message_item_type_size \
(sizeof(src_message_item_type) -\
sizeof( struct _src_message_item_type.c_text))
typedef struct _src_machine_code_type
{
struct _src_machine_code_type *az_next_machine_code;
unsigned short int w_offset;
unsigned short int w_code_len;
union {
long q_longdata[1]; /* longword alias for data*/
char c_data[ 1 ]; /* byte alias for data */
} data;
} src_machine_code_type;
#define src_machine_code_type_size \
(sizeof(src_machine_code_type) -\
sizeof( struct _src_machine_code_type.c_text))
/*
** Mask for bits in b_flags of the source record
*/
#define src_m_form_feed (1<<0)
#define src_m_unprintable_chars (1<<1)
typedef struct _src_source_record_type
{
struct _src_source_record_type *az_next_source_record;
src_message_item_type *az_message_list;
unsigned short w_line_number;
unsigned char b_file_number;
unsigned char b_flags;
z_key z_access_key;
src_machine_code_type *az_machine_code_list;
unsigned short w_machine_code_cnt;
} src_source_record_type;
/*
** Source buffers describe the lines of the source program that are
** currently being SCAN. Include files and macros a can cause a program
** to have more than 1 source buffer. These buffers are managed as a
** stack, implemented via a linked list.
*/
typedef struct _src_source_buffer_type
{
struct _src_source_buffer_type *az_prior_source_buffer;
unsigned short w_current_line_number;
unsigned short w_current_position;
char b_file_number;
char c_text[ src_k_max_source_line_length+1];
} src_source_buffer_type;
#endif /* UilSrcDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

File diff suppressed because it is too large Load diff

View file

@ -1,938 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilSymDef.h /main/12 1995/07/14 09:38:52 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interface to the UIL symbol table.
**
**--
**/
#ifndef UilSymDef_h
#define UilSymDef_h
/*
**
** INCLUDE FILES
**
**/
#include <Mrm/MrmPublic.h>
#include <Xm/Xm.h>
/*
** constraint check access macro
*/
#define _constraint_check(arg) \
(constraint_tab[((arg)-1)/8] & (1 << ((arg)-1)%8))
/*
** Hash table size
*/
/* MOVED TO DBDef.h */
/*
** Symbol tags. These values are used in the tag field of every object header
** to identify the type of the entry.
*/
/* MOVED TO DBDef.h */
/*
** Common attribute masks -- These values are used in the b_flags field of
** the object_header.
*/
/* MOVED TO DBDef.h */
/*
** Output states - order is important
*/
/* MOVED TO DBDef.h */
/*
** Constants to define compiler-recognized data types. It is
** important that the names used in .wml language descriptions
** match these names. These values were once automatically generated
** by WML. They are now maintained by hand to reduce compiler
** dependence on WML artifacts.
*/
/* MOVED TO DBDef.h */
/*
** Header for each symbol entry
*/
typedef struct
{
char b_tag;
/* type of entry The values of this field ia a sym_k_XXX_entry as */
/* defined above. */
char b_type;
/* generic subtype field usage depends on value of b_tag field */
/* above (sym_k_value_entry -> b_type is a sym_k_XXX_value as */
/* defined in UilSymGen.h, sym_k_list_entry -> b_type is a */
/* sym_k_XXX_list as defined below, sym_k_widget_entry -> b_type */
/* is a sym_k_XXX_object as defined in UilSymGen.h, */
/* sym_k_child_entry -> b_type is a sym_k_XXX_child as defined in */
/* UilSymGen.h, sym_k_section_entry -> b_type is a */
/* sym_k_XXX_section as defined below). */
/* */
unsigned short w_node_size;
/* size of the node in longwords */
int user_data;
/* not used directly by the compiler. It is for use by */
/* applications making use of callable UIL only. */
/*
** Fields to save source information about the symbol: We currently save
** five things. The source record where the symbol "begins" (begins is in
** quotes because this may point to just white space before the actual
** symbol), the position (character) within that record where the symbol
** begins, the source record where the symbol ends, the position within
** that record that symbol really begins (i.e. no white space or anything),
** and the position where the symbol definition ends.
*/
struct _src_source_record_type *az_src_rec;
/* Source record where symbol defined */
unsigned char b_src_pos;
/* Starting position within the source record */
unsigned char b_end_pos;
/* Ending position within the source record */
} sym_entry_header_type;
/*
** Common view of a symbol entry
*/
typedef struct
{
sym_entry_header_type header;
/* common part of all symbol entries. */
char b_value[ 1 ];
/* information specific to each different entry type. */
} sym_entry_type;
/*
** Name entry
*/
/* Flags for name entries */
#define sym_m_referenced (1 << 0)
/* Used in the b_flags field of a name entry. Set if this name is */
/* reference elsewhere in this UIL source module. */
#define sym_m_cycle_checked (1 << 1)
/* set if the widget entry for this name has been checked for */
/* cyclic references. */
#define sym_m_has_cycle (2 << 1)
/* set if a cycle was detected for a widget entry */
#define sym_m_charset (1 << 3)
/* set if symbol being used as charset name. */
typedef struct _sym_name_entry_type
{
sym_entry_header_type header;
/* common header */
sym_entry_type *az_object;
/* pointer to the object entry with this name */
struct _sym_name_entry_type *az_next_name_entry;
/* next name on hash chain */
struct _sym_name_entry_type *az_prev_name_entry;
/* prev name on hash chain */
int az_cycle_id;
/* unique id for each cycle check */
unsigned char b_flags;
/* flags (possible value is sym_m_referenced as declared above) */
char c_text[ 1 ];
/* text of the name */
} sym_name_entry_type;
/*
** Size of the fixed part of a name entry
*/
#define sym_k_name_entry_size (sizeof( sym_name_entry_type)- \
sizeof( char[ 1 ]) )
/*
** Value entry
*/
/*
** Types of values are included in UilSymDef.h
*/
/*
** Charsets supported by UIL are defined via WML in UilSymGen.h
*/
/*
** Common header for each "object" entry. This header is shared by all
** widget, gadget, list, argument, callback, and control node types. It
** always appears immediately following the standard entry header field. Also
** defined here is a prototype node for these types of "object" entries.
*/
typedef struct
{
sym_name_entry_type * az_name;
/* pointer to the name entry that holds the object name. */
sym_entry_type * az_reference;
/* pointer to the entry that references this object. */
sym_entry_type * az_next;
/* pointer to next entry in a list, if this entry is linked under */
/* a list entry. */
char * az_comment;
/* pointer to comment entry associated with this object. */
unsigned int b_flags;
/* object flags. */
} sym_obj_header_type;
typedef struct
{
sym_entry_header_type header;
/* common entry header */
sym_obj_header_type obj_header;
/* common object header */
} sym_obj_entry_type;
/*
** This structure defines an element in a color table. A color table contains
** an array of such elements.
*/
typedef struct
{
unsigned char b_letter;
/* letter for this color */
unsigned char b_index;
/* index for this color */
unsigned short w_desc_offset;
/* descriptor offset at in context */
struct _sym_value_entry_type *az_color;
/* pointer to the value entry for this color */
} sym_color_element;
/*
** This structure defines the data for an icon.
*/
typedef struct
{
unsigned short w_height;
/* height in pixels of the icon */
unsigned short w_width;
/* width in pixels of the icon */
struct _sym_value_entry_type *az_color_table;
/* pointer to the value entry for the color table */
struct _sym_value_entry_type *az_rows;
/* pointer to the list of icon rows */
} sym_icon_element;
/*
** This structure define an enumeration set entry
*/
/* MOVED TO DBDef.h */
/*
** Auxiliary sym_k_flags for values stored in b_aux_flags field
*/
#define sym_m_table_entry (1 << 0)
/* This item is a component of table */
#define sym_m_separate (1 << 2)
/* add CDA separator to end of string */
#define sym_m_sixteen_bit sym_m_separate
/* character set is 16-bit */
#define sym_m_exp_eval (1 << 3)
/* if set, indicates that expression has already been evaluated */
/*
** Types of colors - stored in b_arg_type
*/
#define sym_k_unspecified_color 0
#define sym_k_background_color 1
/* This color should displayed in the background on a monochrome */
/* display. */
#define sym_k_foreground_color 2
/* This color should displayed in the foreground on a monochrome */
/* display. */
/*
** value sets defining expression operators
*/
/* MOVED TO DBDef.h */
typedef struct _sym_value_entry_type
{
sym_entry_header_type header;
/* common header */
sym_obj_header_type obj_header;
/* common header for objects */
unsigned char b_type;
/* b_type distinguishes usage. Possible values are sym_k_XXX_value */
/* as defined in UilSymGen.h */
unsigned short w_length;
/* length for variable length types */
char output_state;
/* output_state (only byte is needed) */
unsigned char b_table_count;
/* number of strings in table, colors in a color table, or fonts in */
/* a font table. */
unsigned char b_aux_flags;
/* auxiliary flags */
unsigned char b_arg_type;
/* type of argument value or monochrome treatment of a color */
unsigned char b_data_offset;
/* offset of bits in context for an icon */
unsigned char b_pixel_type;
/* pixel size encoding of an icon */
unsigned char b_charset;
/* character set of a string */
unsigned char b_direction;
/* writing direction of a string, from XmSTRING_DIRECTION_... */
unsigned char b_max_index;
/* max index in a color table */
unsigned char b_expr_opr;
/* operator for an expression value node */
unsigned int l_circular_ref_chk;
/* field to mark when checking for circular references */
unsigned short int b_enumeration_value_code;
/* if non-0, the node takes its value from the value of the */
/* sym_k_..._enumval code in this field (currently integer) */
MrmResource_id resource_id;
/*
resource id for private values. */
/* Structure for different kinds of nodes pointing to other value nodes */
struct _sym_value_entry_type * az_charset_value;
/* pointer to value entry describing a userdefined charset. */
/* Valid only when b_charset == sym_k_userdefined_charset */
struct _sym_value_entry_type * az_next_table_value;
/* next element for tables. */
struct _sym_value_entry_type *az_first_table_value;
/* pointer to first table entry (font, string, etc.) if */
/* value is a table. */
struct _sym_value_entry_type * az_exp_op1;
struct _sym_value_entry_type * az_exp_op2;
/* pointer to the one or two value operands of an */
/* expression value node. Special operands have an */
/* explicitly state semantic. */
/* Union for the actual value of a value node */
union _sym_value_entry_value_union
{
/* must be capable of holding a pointer, chs */
long l_integer;
/* value if an integer. */
double d_real;
/* value if a double float. */
char *c_value;
/* value of ASCIZ string */
XmString xms_value;
/* value of XmString */
float single_float;
/* value if a single float */
sym_color_element *z_color;
/* value if color table. */
sym_icon_element *z_icon;
/* value if icon */
char *az_data;
/* pointer to any other kind of allocated data */
} value;
} sym_value_entry_type;
/*
** Define the fixed size of the value entry structure
*/
#define sym_k_value_entry_size (sizeof(sym_value_entry_type))
/*
** List entry
*/
/*
** The types of lists, values for the header.b_type field of a list entry.
*/
#define sym_k_error_list sym_k_error_entry
#define sym_k_callback_list sym_k_callback_entry
#define sym_k_argument_list sym_k_argument_entry
#define sym_k_control_list sym_k_control_entry
#define sym_k_proc_ref_list sym_k_proc_ref_entry
typedef struct _sym_list_entry_type
{
sym_entry_header_type header;
/* common header */
sym_obj_header_type obj_header;
/* common header for objects */
unsigned short w_count;
/* number of elements in the list. */
unsigned short w_gadget_count;
/* number of gadgets in the list. */
} sym_list_entry_type;
/*
** Define the size of the list structure
*/
#define sym_k_list_entry_size (sizeof(sym_list_entry_type))
/*
** Nested List entry
*/
/*
** A nested list entry appears in a list as the entry specifying a reference
** to another list (a nested list reference). It has its b_type field set
** to the list type (necessarily the same type as the list it is contained
** in, and the list it points to). The az_next field locates the next list
** element, as usual. The az_list field points to the list entry for the
** list which is referenced.
*/
typedef struct _sym_nested_list_entry_type
{
sym_entry_header_type header;
/* common header */
sym_obj_header_type obj_header;
/* common header for objects */
sym_list_entry_type *az_list;
/* pointer to the referenced list */
} sym_nested_list_entry_type;
/*
** Define the size of the nested_list structure
*/
#define sym_k_nested_list_entry_size (sizeof(sym_nested_list_entry_type))
/*
** Argument entry
*/
typedef struct _sym_argument_entry_type
{
sym_entry_header_type header;
/* common entry header */
sym_obj_header_type obj_header;
/* common object header */
sym_value_entry_type * az_arg_name;
/* pointer to the value entry containing the argument name. */
sym_value_entry_type * az_arg_value;
/* pointer to the value entry containing the argument value. */
} sym_argument_entry_type;
#define sym_k_argument_entry_size (sizeof(sym_argument_entry_type))
/*
** Procedure Definition Entry
*/
typedef struct
{
sym_entry_header_type header;
/* common header. */
sym_obj_header_type obj_header;
/* common header for objects */
unsigned char v_arg_checking;
/* should argument type be checked. */
unsigned char b_arg_count;
/* number of arguments. */
unsigned char b_arg_type;
/* The type of single argument (tag) for this procedure. It should */
/* be a sym_k_XXX_value as defined in UilDBDef.h. */
unsigned char b_widget_type;
/* If b_arg_type is sym_k_widget_ref_value, then this field should */
/* be a sym_k_XXX_object as defined in UilSymGen.h or */
/* (uil_max_object + 1) if the type is unspecified. */
} sym_proc_def_entry_type;
#define sym_k_proc_def_entry_size (sizeof( sym_proc_def_entry_type))
/*
** Procedure Reference Entry
*/
typedef struct
{
sym_entry_header_type header;
/* common header. */
sym_obj_header_type obj_header;
/* common object header. */
sym_proc_def_entry_type *az_proc_def;
/* pointer to the procedure definition entry for the procedure to */
/* be called. */
sym_value_entry_type *az_arg_value;
/* pointer to the value entry for the argument to be passed as the */
/* callback tag to the procedure. */
} sym_proc_ref_entry_type;
#define sym_k_proc_ref_entry_size (sizeof( sym_proc_ref_entry_type))
/*
** These values are passed from the grammar to the semantic action routines
** (SAR) to identify how the procedure is used.
*/
#define sym_k_callback_proc 1
/* The procedure was used as a callback routine. */
#define sym_k_object_proc 2
/* The procedure was used as a creation routine for a user defined */
/* widget */
/*
** Callback entry
*/
typedef struct _sym_callback_entry_type
{
sym_entry_header_type header;
/* common entry header. */
sym_obj_header_type obj_header;
/* common object header. */
sym_value_entry_type * az_call_reason_name;
/* pointer to the value entry containing the reason (callback) name */
sym_proc_ref_entry_type * az_call_proc_ref;
/* pointer to the procedure reference to be invoked for this */
/* callback reason. */
sym_list_entry_type * az_call_proc_ref_list;
/* list entry of procedure references when multiple callbacks are */
/* used for the callback. */
} sym_callback_entry_type;
#define sym_k_callback_entry_size (sizeof(sym_callback_entry_type))
/*
** Parent list for widgets and gadgets
**
** This list contains pointers to each of the widgets and gadgets that
** reference the current widget in their control list. This information is
** required in order to check constraint arguments.
*/
typedef struct _sym_parent_list_type
{
sym_entry_header_type header;
/* common entry header */
struct _sym_widget_entry_type * parent;
/* pointer to a widget entry that references the originating widget */
/* in its controls list. */
struct _sym_parent_list_type * next;
/* pointer to next parent list entry. */
} sym_parent_list_type;
#define sym_k_parent_list_size (sizeof(sym_parent_list_type))
/*
** Widget entry and Gadget entry
**
** Gadgets have the same form as a widget. They are distinguished
** simply by the setting of sym_m_obj_is_gadget in obj_header.b_flags .
*/
/* widget and gadget node structure. */
typedef struct _sym_widget_entry_type
{
sym_entry_header_type header;
/* common entry header */
sym_obj_header_type obj_header;
/* common object header */
sym_list_entry_type * az_callbacks;
/* pointer to a list entry of type sym_k_callback_list which */
/* contains the callbacks for this widget. */
sym_list_entry_type * az_arguments;
/* pointer to a list entry of type sym_k_argument_list which */
/* contains the arguments for this widget. */
sym_list_entry_type * az_controls;
/* pointer to a list entry of type sym_k_controls_list which */
/* contains the widgets that are children (are controlled by) this */
/* widget. */
sym_proc_ref_entry_type * az_create_proc;
/* for user_defined widgets this points to the procedure reference */
/* entry that specifies the creation routine for the widget. */
sym_parent_list_type * parent_list;
/* pointer to a parent list entry that links all objects which */
/* reference this object in there controls lists. It is used to */
/* traverse through the parents to verify that all contraint */
/* arguments specified on this widget are really inherited from one */
/* of its parents. */
int output_state;
/* Used when generating the UID file. Possible values: */
/* sym_k_queued, sym_k_emitted, sym_k_not_processed. (only a byte */
/* is needed). */
MrmResource_id resource_id;
/* The resource id if the object is private. This is used when */
/* generating the UID file. */
} sym_widget_entry_type;
#define sym_k_widget_entry_size (sizeof(sym_widget_entry_type))
/*
** Control entry
*/
/*
** Control flags -- These are additional values that may occur in the b_flags
** field for control entries. NOTE: Must not overlap common flags defined
** above.
*/
#define sym_m_def_in_progress (1 << 6)
/* used in all lists. */
#define sym_m_managed (1 << 7)
/* This bit is set when the controlled object is to be managed. */
#define sym_m_obj_is_reference (1 << 8)
#define sym_m_forward_ref (1 << 9)
/* This bit is set if the item is a forward reference not yet resolved*/
#define sym_m_validated (1 << 10)
/* Used for widgets to indicate if it has been validated */
/* Control node structure. */
typedef struct _sym_control_entry_type
{
sym_entry_header_type header;
/* common entry header */
sym_obj_header_type obj_header;
/* common object header */
sym_widget_entry_type * az_con_obj;
/* pointer to the widget entry that is controlled by this widget. */
} sym_control_entry_type;
#define sym_k_control_entry_size (sizeof(sym_control_entry_type))
/*
** External Definition Entry
*/
typedef struct _sym_external_def_entry_type
{
sym_entry_header_type header;
/* common header */
struct _sym_external_def_entry_type *az_next_object;
/* pointer next external definition entry. */
sym_name_entry_type *az_name;
/* pointer to the name entry for the external object. */
} sym_external_def_entry_type;
#define sym_k_external_def_entry_size (sizeof( sym_external_def_entry_type))
/*
** Forward Reference Entry
*/
typedef struct _sym_forward_ref_entry_type
{
sym_entry_header_type header;
/* common header. The b_type field holds the object type. */
struct _sym_forward_ref_entry_type *az_next_ref;
/* pointer to the next forward reference entry. */
char *a_update_location;
/* address of the longword field in the referencing entry that */
/* needs to be updated with the address of the widget entry that */
/* this forward reference entry was created for. When this forward */
/* reference entry is processed in UilP2Reslv.c, then the widget */
/* named in the az_name field will be defined and it can be */
/* assigned directly into the a_update_location. */
sym_name_entry_type *az_name;
/* pointer to the name entry for the widget being referenced before */
/* it has been defined. */
sym_widget_entry_type *parent;
/* pointer to the widget entry of the parent of the forward */
/* referenced object. */
} sym_forward_ref_entry_type;
#define sym_k_forward_ref_entry_size (sizeof( sym_forward_ref_entry_type))
/*
** Forward Reference Entry
*/
#define sym_k_patch_add 1
#define sym_k_bind_value_name 2
#define sym_k_patch_list_add 3
typedef struct _sym_val_forward_ref_entry_type
{
sym_entry_header_type header;
/* common header. The b_type field holds the expected value type. */
struct _sym_val_forward_ref_entry_type *az_next_ref;
/* pointer to the next forward reference entry. */
char *a_update_location;
/* address of the longword field in the referencing entry that */
/* needs to be updated with the address of the value entry that */
/* this forward reference entry was created for. When this forward */
/* reference entry is processed in UilP2Reslv.c, then the value */
/* named in the az_name field will be defined and it can be */
/* assigned directly into the a_update_location. */
sym_name_entry_type *az_name;
/* pointer to the name entry for the value being referenced before */
/* it has been defined. */
unsigned char fwd_ref_flags;
/* flags used to indicate how to process entry on forward reference */
/* chain. */
} sym_val_forward_ref_entry_type;
#define sym_k_val_forward_ref_entry_size (sizeof( sym_val_forward_ref_entry_type))
/*
** Default object entry. Pointed to from the module entry. The first one in
** the list contains source information for the "OBJECTS = " text. The 'next'
** field is a pointer to a list which contains the data on the actual clauses.
*/
typedef struct _sym_def_obj_entry_type
{
sym_entry_header_type header;
/* common header */
struct _sym_def_obj_entry_type *next;
/* pointer to next default object entry in the list. */
char b_object_info;
char b_variant_info;
} sym_def_obj_entry_type;
#define sym_k_def_obj_entry_size (sizeof( sym_def_obj_entry_type))
/*
** Module entry (only 1 per compilation)
*/
typedef struct _sym_module_entry_type
{
sym_entry_header_type header;
/* common header */
sym_obj_header_type obj_header;
/* common header for objects */
sym_value_entry_type *az_version;
/* pointer to the value entry containing version string for the */
/* module (version clause). */
sym_value_entry_type *az_character_set;
/* pointer to the value entry containing the default character set */
/* information for the module (character set clause). */
sym_value_entry_type *az_case_sense;
/* pointer to the value entry containing the value of the module */
/* case sensitivity clause. */
sym_def_obj_entry_type *az_def_obj;
/* pointer to the default object type specified in the module */
/* default object variant clause. */
} sym_module_entry_type;
#define sym_k_module_entry_size (sizeof( sym_module_entry_type))
/*
** Section entry
*/
/*
** Posiblilities for header.b_type when header.b_tag is sym_k_section_entry.
*/
#define sym_k_list_section 1
/* list section */
#define sym_k_procedure_section 2
/* procedure section */
#define sym_k_value_section 3
/* value section */
#define sym_k_identifier_section 4
/* identifier section */
#define sym_k_object_section 5
/* widget/gadget section */
#define sym_k_include_section 6
/* include directive */
#define sym_k_section_tail 7
/* This section has no corresponding UIL construct and exists only */
/* to aid in saving source information */
typedef struct _sym_section_entry_type
{
sym_entry_header_type header;
/* common header */
struct _sym_section_entry_type *prev_section;
/* previous section "LIST". */
sym_entry_type *next;
/* pointer to the entry for the next section _OR_ next child. */
sym_entry_type *entries;
/* points to entries in the section _OR_ the entry in the symbol */
/* table for this child. */
} sym_section_entry_type;
#define sym_k_section_entry_size (sizeof (sym_section_entry_type))
/*
** Include file entry
*/
typedef struct _sym_include_file_entry_type
{
sym_entry_header_type header;
/* common header */
sym_section_entry_type *sections;
/* pointer to a section list; this list is all of the sections that */
/* exist in this include file. */
char file_name[255];
/* the file name as specified in the include statement in the UIL */
/* source. */
char full_file_name[255];
/* the expanded name for the include file actually opened. */
} sym_include_file_entry_type;
#define sym_k_include_file_entry_size (sizeof( sym_include_file_entry_type))
/*
** Symbol table root entry (root of symbol table tree)
*/
typedef struct _sym_root_entry_type
{
sym_entry_header_type header;
/* common header */
struct _src_source_record_type *src_record_list;
/* pointer to a list of source records. */
char file_name[255];
/* the main UIL file name as specified on the command line. */
char full_file_name[255];
/* the expanded name for the main UIL file that was actually */
/* opened. */
sym_section_entry_type *sections;
/* pointer to section list entry. */
sym_module_entry_type *module_hdr;
/* pointer to module header entry. */
} sym_root_entry_type;
#define sym_k_root_entry_size (sizeof( sym_root_entry_type))
/*
** Color Item Entry
*/
typedef struct _sym_color_item_entry_type
{
sym_entry_header_type header;
/* common header */
struct _sym_color_item_entry_type *az_next;
/* next item */
unsigned char b_letter;
/* letter used for color */
unsigned char b_index;
/* color table index */
unsigned char b_spare1;
sym_value_entry_type *az_color;
/* name or value entry for the color. */
} sym_color_item_entry_type;
#define sym_k_color_item_entry_size (sizeof( sym_color_item_entry_type))
/*
** This macro copies the contents of one entry to another without disturbing
** the the linked list of entries used to connect all symbol table entries.
*/
#define _sym_copy_entry(__dest, __src, __size) _move (__dest, __src, __size)
#endif /* UilSymDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,113 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilSymGl.h /main/9 1995/07/14 09:39:03 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file contains external declarations of all
** global data defining the language accepted by the Uil compiler.
** This is exactly the global data generated by WML, plus any
** invariant matching definitions.
**
**--
**/
#ifndef UilSymGl_h
#define UilSymGl_h
/*
* Defined in files included in UilData.c
*/
externalref unsigned char *constraint_tab;
externalref key_keytable_entry_type *key_table;
externalref int key_k_keyword_max_length;
externalref int key_k_keyword_count;
externalref key_keytable_entry_type *key_table_case_ins;
externalref unsigned char **allowed_argument_table;
externalref unsigned char *argument_type_table;
externalref unsigned char **allowed_child_table;
externalref unsigned char *child_class_table;
externalref char **charset_xmstring_names_table;
externalref unsigned char *charset_writing_direction_table;
externalref unsigned char *charset_parsing_direction_table;
externalref unsigned char *charset_character_size_table;
externalref char **charset_lang_names_table;
externalref unsigned short int *charset_lang_codes_table;
externalref unsigned short int charset_lang_table_max;
externalref unsigned char **allowed_control_table;
externalref UilEnumSetDescDef *enum_set_table;
externalref unsigned short int *argument_enumset_table;
externalref int *enumval_values_table;
externalref int uil_max_object;
externalref char **uil_widget_names;
externalref int uil_max_arg;
externalref char **uil_argument_names;
externalref int uil_max_child;
externalref char **uil_child_names;
externalref int uil_max_reason;
externalref char **uil_reason_names;
externalref int uil_max_enumset;
externalref int uil_max_enumval;
externalref char **uil_enumval_names;
externalref int uil_max_charset;
externalref char **uil_charset_names;
externalref unsigned short int *related_argument_table;
externalref unsigned char **allowed_reason_table;
externalref char **tok_token_name_table;
externalref int tok_num_tokens;
externalref char **uil_widget_funcs;
externalref unsigned short int *uil_gadget_variants;
externalref unsigned short int *uil_urm_nondialog_class;
externalref unsigned short int *uil_urm_subtree_resource;
externalref char **uil_argument_toolkit_names;
externalref char **uil_reason_toolkit_names;
externalref unsigned short int uil_sym_user_defined_object;
externalref unsigned short int uil_sym_default_charset;
externalref unsigned short int uil_sym_isolatin1_charset;
externalref int uil_max_value;
externalref char *uil_datatype_names[];
#endif /* UilSymGl_h */
/* DON'T ADD STUFF AFTER THIS #endif */

View file

@ -1,474 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: UilSymNam.c /main/13 1997/09/08 11:12:50 cshi $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This module inserts names into the name table.
**
**--
**/
/*
**
** INCLUDE FILES
**
**/
#include "UilDefI.h"
/*
**
** DEFINE and MACRO DEFINITIONS
**
**/
/*
**
** EXTERNAL VARIABLE DECLARATIONS
**
**/
/*
**
** GLOBAL VARIABLE DECLARATIONS
**
**/
/*
**
** OWN VARIABLE DECLARATIONS
**
**/
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This routine searches for a name entry of the same name as its parameters.
** If the entry is found, a pointer to that name node is
** returned as the value of the function. If no entry is found, a NULL
** pointer is returned.
**
** See sym_insert_name for a description of the name lookup alorithm.
**
** FORMAL PARAMETERS:
**
** l_length length of the name not including the null
** c_text pointer to a null terminated string for name
**
** IMPLICIT INPUTS:
**
** sym_az_hash_table the hash table
**
** IMPLICIT OUTPUTS:
**
** sym_az_hash_table may be updated with an additional name
**
** FUNCTION VALUE:
**
** a pointer to a name entry
**
** SIDE EFFECTS:
**
** none
**
**--
**/
sym_name_entry_type
*sym_find_name(l_length, c_text)
int l_length; /* length of name to find */
char *c_text; /* text of the name */
{
sym_name_entry_type *az_current_name;
int l_hash_code;
int l_compare_result;
/* obtain the hash code of for the name */
l_hash_code = hash_function( l_length, c_text );
/*
** chain along hash chain looking for symbol - exit loop under 3 condition
** 1) come to the end of the chain: name not found
** 2) find symbol: return this symbol
** 3) find node > symbol: name not found
*/
for (az_current_name = sym_az_hash_table[ l_hash_code ];
az_current_name != NULL;
az_current_name = az_current_name->az_next_name_entry)
{
l_compare_result = _compare(c_text, az_current_name->c_text);
if (l_compare_result == 0) /* c_text = current name */
{
/* found the name we are looking for */
return az_current_name;
}
if (l_compare_result > 0) /* c_text > current name */
{
/* return NULL - name should be before this spot in list */
return NULL;
}
}
/* came to end of the list without finding the name */
return NULL;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This routine searches for a name entry of the same name as its parameters.
** If the entry is found, a pointer to that name node is
** returned as the value of the function. If no entry is found, one is
** inserted. In this case the value of the function is a pointer to
** the name entry created.
**
** Name entries are linked off of a hash table. Those
** entries that have the same hash code, are sorted according to the
** collating sequence. Thus the algorithm involves hashing the symbol and
** then following the chain for that hash code until one of the following
** conditions is met. 1) the identifier is found, then return a pointer
** to that name entry. 2) come to the end of the chain or a name
** entry that comes later in the collating sequence than the symbol being
** searched for. In this case the name is inserted just prior to this
** point in the chain.
**
** FORMAL PARAMETERS:
**
** l_length length of the name not including the null
** c_text pointer to a null terminated string for name
**
** IMPLICIT INPUTS:
**
** sym_az_hash_table the hash table
**
** IMPLICIT OUTPUTS:
**
** sym_az_hash_table may be updated with an additional name
**
** FUNCTION VALUE:
**
** a pointer to a name entry
**
** SIDE EFFECTS:
**
** may create a name entry and update the hash table
**
**--
**/
sym_name_entry_type *sym_insert_name(l_length, c_text)
int l_length; /* length of name to insert */
char *c_text; /* text of the name */
{
sym_name_entry_type *az_previous_name;
sym_name_entry_type *az_current_name;
sym_name_entry_type *az_new_name;
int l_hash_code;
int l_compare_result;
/*
** algorithm keeps 2 pointers, one for the previous name and one
** for the current name. This permits easy insertion of a new name
*/
/* obtain the hash code of for the name */
l_hash_code = hash_function( l_length, c_text );
/*
** chain along hash chain looking for symbol - exit loop under 3 condition
** 1) come to the end of the chain: insert new node on end
** 2) find symbol: return this symbol
** 3) find node > symbol: insert new node prior to current node
*/
for (az_current_name = sym_az_hash_table[ l_hash_code ],
az_previous_name = NULL;
az_current_name != NULL;
az_previous_name = az_current_name,
az_current_name = az_current_name->az_next_name_entry)
{
l_compare_result = _compare(c_text, az_current_name->c_text);
if (l_compare_result == 0) /* c_text = current name */
{
/* found the name we are looking for */
return az_current_name;
}
if (l_compare_result > 0) /* c_text > current name */
{
/* exit the loop to insert just prior to current name */
goto insert_name;
}
}
insert_name:
/*
** name is not in the table so it must be inserted between the
** az_previous_name and az_current_name entries.
*/
/* allocate and initialize the name entry */
az_new_name = (sym_name_entry_type *)
sem_allocate_node (sym_k_name_entry,
sym_k_name_entry_size + l_length + 1);
az_new_name->header.b_type = l_length; /* b_type holds length */
az_new_name->az_object = NULL;
az_new_name->az_cycle_id = 0;
_move( az_new_name->c_text, c_text, l_length+1 );
/*
** link the name entry into the hash table
*/
az_new_name->az_next_name_entry = az_current_name;
if (az_previous_name == NULL)
sym_az_hash_table[ l_hash_code ] = az_new_name;
else
az_previous_name->az_next_name_entry =
(sym_name_entry_type *) az_new_name;
return az_new_name;
}
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This procedure is a hashing function. It takes a length and a
** pointer to a value. Using this value as a string, the function
** returns an integer in the range of 0 to sym_k_hash_table_limit-1.
**
** FORMAL PARAMETERS:
**
** l_length length of the value in bytes not including null
** c_value a null terminated string
**
** IMPLICIT INPUTS:
**
** sym_k_hash_table_limit
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** integer (the hash code) in range 0 to sym_k_hash_table_limit-1
**
** SIDE EFFECTS:
**
** none
**
**--
**/
int hash_function(l_length, c_value)
int l_length;
char *c_value;
{
#ifdef WORD64
#define _shift 3
static unsigned int XmConst mask[ 8 ] =
{ 0x00000000000000FF, 0x000000000000FFFF,
0x0000000000FFFFFF, 0x00000000FFFFFFFF,
0x00000000FFFFFFFF, 0x0000FFFFFFFFFFFF,
0x00FFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, };
#elif defined (LONG64)
#define _shift 3
static long XmConst mask[ 8 ] =
{ 0x00000000000000FF, 0x000000000000FFFF,
0x0000000000FFFFFF, 0x00000000FFFFFFFF,
0x00000000FFFFFFFF, 0x0000FFFFFFFFFFFF,
0x00FFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, };
#else
#define _shift 2
static unsigned int XmConst mask[ 4 ] =
{ 0x000000FF, 0x0000FFFF, 0x00FFFFFF, 0xFFFFFFFF };
#endif
#ifdef LONG64
long l_hash_code;
long al_value[20];
#else
int l_hash_code;
int al_value[20];
#endif
int l_limit;
int l_extra;
int i;
l_limit = (l_length-1) >> _shift; /* divide by wordsize */
l_extra = (l_length-1) & _slm; /* remainder from divide by wordsize */
#ifdef LONG64
bzero((char *)al_value, sizeof(long) * 20);
#else
bzero((char *)al_value, sizeof(int) * 20);
#endif
strncpy((char *)al_value, c_value, l_length);
l_hash_code = 0;
for (i = 0; i < l_limit; i++)
{
l_hash_code = l_hash_code ^ al_value[ i ];
}
l_hash_code = l_hash_code ^ (al_value[ i ] & mask[ l_extra ]);
return (int)(l_hash_code % sym_k_hash_table_limit);
}
#if debug_version
/*
**++
** FUNCTIONAL DESCRIPTION:
**
** This debugging routine will dump out the name entries linked
** from the hash table.
**
** FORMAL PARAMETERS:
**
** none
**
** IMPLICIT INPUTS:
**
** sym_az_hash_table
**
** IMPLICIT OUTPUTS:
**
** none
**
** FUNCTION VALUE:
**
** void
**
** SIDE EFFECTS:
**
** prints out the hash table
**
**--
**/
void sym_dump_hash_table()
{
int i;
int total_count;
int max_length;
int empty_count;
total_count = 0;
empty_count = 0;
max_length = 0;
for (i=0; i<sym_k_hash_table_limit; i++)
{
int bucket_count;
sym_name_entry_type *az_name;
bucket_count = 0;
for (az_name = sym_az_hash_table[ i ];
az_name != NULL;
az_name = az_name->az_next_name_entry)
{
bucket_count++;
_debug_output("\t %s \n", az_name->c_text);
}
total_count += bucket_count;
if (bucket_count == 0)
empty_count++;
max_length = ( max_length > bucket_count )? max_length : bucket_count;
_debug_output("bucket: %d length: %d\n", i, bucket_count);
}
_debug_output("name count: %d \n empty count: %d \n max length: %d",
total_count, empty_count, max_length );
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,88 +0,0 @@
!
! @OSF_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
!
!
! HISTORY
!
! $XConsortium: XmAppl.uil /main/11 1995/07/14 09:39:39 drk $
! (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!******************************************************************************
!++
! FACILITY:
!
! UIL -- Include file for Xm constant definitions.
!
! ABSTRACT:
!
! This include file contains UIL value definintions corresponding
! to those defined in Xm.h
!
!--
/* Version information */
value XmVERSION : 2;
value XmREVISION : 0;
value XmVersion : (XmVERSION * 1000 + XmREVISION);
/* XmString definitions */
value XmSTRING_DIRECTION_REVERT : 2;
value XmSTRING_COMPONENT_UNKNOWN : 0;
value XmSTRING_COMPONENT_CHARSET : 1;
value XmSTRING_COMPONENT_TEXT : 2;
value XmSTRING_COMPONENT_DIRECTION : 3;
value XmSTRING_COMPONENT_SEPARATOR : 4; /* 5-125 reserved */
value XmSTRING_COMPONENT_END : 126; /* no more comp in string */
value XmSTRING_COMPOUND_STRING : 127; /* tag for whole TCS */
value XmSTRING_COMPONENT_USER_BEGIN : 128; /* 128-255 are user tags */
value XmSTRING_COMPONENT_USER_END : 255;
/* Callback reasons */
value XmCR_NONE : 0;
value XmCR_HELP : 1;
value XmCR_VALUE_CHANGED : 2;
value XmCR_INCREMENT : 3;
value XmCR_DECREMENT : 4;
value XmCR_PAGE_INCREMENT : 5;
value XmCR_PAGE_DECREMENT : 6;
value XmCR_TO_TOP : 7;
value XmCR_TO_BOTTOM : 8;
value XmCR_DRAG : 9;
value XmCR_ACTIVATE : 10;
value XmCR_ARM : 11;
value XmCR_DISARM : 12;
value XmCR_MAP : 16;
value XmCR_UNMAP : 17;
value XmCR_FOCUS : 18;
value XmCR_LOSING_FOCUS : 19;
value XmCR_MODIFYING_TEXT_VALUE : 20;
value XmCR_MOVING_INSERT_CURSOR : 21;
value XmCR_EXECUTE : 22;
value XmCR_SINGLE_SELECT : 23;
value XmCR_MULTIPLE_SELECT : 24;
value XmCR_EXTENDED_SELECT : 25;
value XmCR_BROWSE_SELECT : 26;
value XmCR_DEFAULT_ACTION : 27;
value XmCR_CLIPBOARD_DATA_REQUEST : 28;
value XmCR_CLIPBOARD_DATA_DELETE : 29;
value XmCR_CASCADING : 30;
value XmCR_OK : 31;
value XmCR_ENTER : 31;
value XmCR_CANCEL : 32;
value XmCR_APPLY : 34;
value XmCR_NO_MATCH : 35;
value XmCR_COMMAND_ENTERED : 36;
value XmCR_COMMAND_CHANGED : 37;
value XmCR_EXPOSE : 38;
value XmCR_RESIZE : 39;
value XmCR_INPUT : 40;

View file

@ -1,507 +0,0 @@
/* $TOG: libUil.elist /main/4 1999/10/15 12:00:56 mgreess $ */
/*************************************************************************
* Export list for libUil
* This list *must* be updated whenever a change is made to the libUil API.
*
* The syntax for the symbol declarations in this list is as follows:
* public sym => Public C symbol, i.e., publicized API
* private sym => Private C symbol, i.e., unpublicized API
* internal sym => Internal C symbol, i.e., not part of API
*
**************************************************************************/
/**************************************************************************
* libUil public symbols -- available to developers
**************************************************************************/
public Uil
public UilDumpSymbolTable
public allowed_argument_table
public allowed_child_table
public allowed_control_table
public allowed_reason_table
public argument_enumset_table
public argument_type_table
public charset_character_size_table
public charset_lang_codes_table
public charset_lang_names_table
public charset_lang_table_max
public charset_parsing_direction_table
public charset_writing_direction_table
public charset_xmstring_names_table
public child_class_table
public constraint_tab
public enum_set_table
public enumval_values_table
public key_k_keyword_count
public key_k_keyword_max_length
public key_table
public key_table_case_ins
public related_argument_table
public tok_num_tokens
public tok_token_name_table
public uil_argument_names
public uil_argument_toolkit_names
public uil_charset_names
public uil_child_names
public uil_datatype_names
public uil_enumval_names
public uil_gadget_variants
public uil_max_arg
public uil_max_charset
public uil_max_child
public uil_max_enumset
public uil_max_enumval
public uil_max_object
public uil_max_reason
public uil_max_value
public uil_reason_names
public uil_reason_toolkit_names
public uil_sym_default_charset
public uil_sym_isolatin1_charset
public uil_sym_user_defined_object
public uil_urm_nondialog_class
public uil_urm_subtree_resource
public uil_widget_funcs
public uil_widget_names
/********************************************************************
* libUil private symbols -- Undocumented APIs that are exported
* for backward compatibilty.
********************************************************************/
/********************************************************************
* libUil internal symbols -- not to be used outside the library.
********************************************************************/
internal Uil_characters_read
internal Uil_cmd_z_command
internal Uil_compile_desc_ptr
internal Uil_current_file
#if !defined(__hpux)
internal Uil_file_size
#endif
internal Uil_lex_az_charset_entry
internal Uil_lex_az_literal_charset
internal Uil_lex_cleanup_analyzer
internal Uil_lex_l_charset_specified
internal Uil_lex_l_literal_charset
internal Uil_lex_l_localized
internal Uil_lex_l_user_default_charset
internal Uil_lines_processed
internal Uil_lst_c_title2
internal Uil_lst_cleanup_listing
internal Uil_message_count
internal Uil_percent_complete
internal Uil_src_cleanup_source
internal Uil_sym_cleanup_storage
internal Urm_code_from_uil_type
internal access_from_code
internal class_name_from_code
internal close_source_file
internal cmd_decode_command_line
internal comment_size
internal comment_text
internal compute_color_table_size
internal compute_icon_size
internal compute_list_size
internal count_proc
internal create_color_table
internal create_ext_compression_codes
internal create_icon
internal create_int_compression_codes
internal create_listing_file
internal create_str_entry
internal current_time
internal cvt_ascii_to_long
internal db_incorporate
internal db_open_file
internal db_read_char_table
internal db_read_int_and_shorts
internal db_read_ints_and_string
internal db_read_length_and_string
internal diag_charset_text
internal diag_get_message_abbrev
internal diag_handler
internal diag_initialize_diagnostics
internal diag_issue_diagnostic
internal diag_issue_internal_error
internal diag_issue_summary
internal diag_object_text
internal diag_report_status
internal diag_reset_overflow_handler
internal diag_restore_diagnostics
internal diag_rz_msg_table
internal diag_store_handlers
internal diag_tag_text
internal diag_value_text
internal emit_argument
internal emit_callback
internal emit_callback_procedures
internal emit_control
internal extract_create_callback
internal extract_subtree_control
internal format_arg_value
internal get_line
internal get_root_dir_name
internal group_from_code
internal gz_yynullval
internal hash_function
internal init_wmd_path
internal issue_control_char_diagnostic
internal issue_urm_error
internal key_find_keyword
internal key_initialize
internal lex_filter_unprintable_chars
internal lex_initialize_analyzer
internal lex_issue_error
internal lst_debug_output
internal lst_open_listing
internal lst_output_line
internal lst_output_listing
internal lst_output_machine_code
internal lst_output_message_ptr_line
internal lst_output_messages
internal module_clauses
internal msg0
internal msg1
internal msg10
internal msg11
internal msg12
internal msg13
internal msg14
internal msg15
internal msg16
internal msg17
internal msg18
internal msg19
internal msg2
internal msg20
internal msg21
internal msg22
internal msg23
internal msg24
internal msg25
internal msg26
internal msg27
internal msg28
internal msg29
internal msg3
internal msg30
internal msg31
internal msg32
internal msg33
internal msg34
internal msg35
internal msg36
internal msg37
internal msg38
internal msg39
internal msg4
internal msg40
internal msg41
internal msg42
internal msg43
internal msg44
internal msg45
internal msg46
internal msg47
internal msg48
internal msg49
internal msg5
internal msg50
internal msg51
internal msg52
internal msg53
internal msg54
internal msg55
internal msg56
internal msg57
internal msg58
internal msg59
internal msg6
internal msg60
internal msg61
internal msg62
internal msg63
internal msg64
internal msg65
internal msg66
internal msg67
internal msg68
internal msg69
internal msg7
internal msg70
internal msg71
internal msg72
internal msg73
internal msg74
internal msg75
internal msg76
internal msg77
internal msg78
internal msg79
internal msg8
internal msg80
internal msg9
internal msg_cat_table
internal off_get
internal off_put
internal open_source_file
internal out_az_idbfile_id
internal out_emit_value
internal out_emit_widget
internal output_text
internal parent_list_traverse
internal pop
#if !defined(__hpux)
internal prev_yylval
#endif
internal process_all_arguments
internal process_all_callbacks
internal process_all_controls
internal push
internal ref_control
internal ref_value
internal reget_line
internal resource_name_from_code
internal sar_add_forward_list_entry
internal sar_add_list_entry
internal sar_append_color_item
internal sar_append_table_value
internal sar_assoc_comment
internal sar_binary_op
internal sar_bind_value_name
internal sar_cat_value
internal sar_cat_value_entry
internal sar_charset_verify
internal sar_chk_charset_attr
internal sar_chk_comp_str_attr
internal sar_create_child
internal sar_create_identifier
internal sar_create_module
internal sar_create_object
internal sar_create_procedure
internal sar_create_root
internal sar_get_units_type
internal sar_import_value_entry
internal sar_include_file
internal sar_initialize
internal sar_link_section
internal sar_make_charset
internal sar_make_color
internal sar_make_color_item
internal sar_make_color_table
internal sar_make_comp_str
internal sar_make_comp_str_comp
internal sar_make_def_obj
internal sar_make_fallback_charset
internal sar_make_font
internal sar_make_font_item
internal sar_make_font_table
internal sar_make_fontset
internal sar_make_icon
internal sar_make_private_value
internal sar_make_rgb_private_value
internal sar_make_wchar_str
internal sar_map_keyword_to_name
internal sar_object_reference
internal sar_private_error
internal sar_process_id
internal sar_process_id_ref
internal sar_process_module_charset
internal sar_process_module_sensitivity
internal sar_process_module_variant
internal sar_process_module_version
internal sar_process_proc_ref
internal sar_save_argument_pair
internal sar_save_control_item
internal sar_save_control_widget
internal sar_save_feature
internal sar_save_list_end
internal sar_save_module_source
internal sar_save_reason_binding
internal sar_save_section_source
internal sar_save_src_entry_end
internal sar_save_src_semicolon_pos
internal sar_save_user_proc_ref_src
internal sar_set_list_type
internal sar_set_object_class
internal sar_set_object_flags
internal sar_set_object_variant
internal sar_unary_op
internal sar_unset_object_flags
internal sar_update_parent_list
internal sar_value_not_implemented
internal sar_value_type_error
internal sar_verify_object
internal save_module_machine_code
internal save_value_machine_code
internal save_widget_machine_code
internal sem_allocate_node
internal sem_append_cstr_to_cstr
internal sem_append_str_to_cstr
internal sem_argument_allowed
internal sem_cat_str_to_str
internal sem_charset_info
internal sem_charset_lang_name
internal sem_charset_name
internal sem_child_allowed
internal sem_control_allowed
internal sem_convert_to_error
internal sem_convert_to_float
internal sem_convert_to_integer
internal sem_convert_to_single_float
internal sem_create_cstr
internal sem_create_value_entry
internal sem_create_wchar_str
internal sem_dcl_name
internal sem_evaluate_value
internal sem_evaluate_value_cs
internal sem_evaluate_value_expr
internal sem_find_object
internal sem_free_node
internal sem_map_subclass_to_charset
internal sem_output_uid_file
internal sem_reason_allowed
internal sem_ref_name
internal sem_reference_procedure
internal sem_resolve_forward_refs
internal sem_validate_argument_entry
internal sem_validate_argument_enumset
internal sem_validate_argument_list
internal sem_validate_callback_entry
internal sem_validate_callback_list
internal sem_validate_constraint_entry
internal sem_validate_control_entry
internal sem_validate_control_list
internal sem_validate_node
internal sem_validate_procref_entry
internal sem_validate_procref_list
internal sem_validate_value_node
internal sem_validate_verify_cycle
internal sem_validate_widget_cycle
internal sem_validate_widget_cycle_aux
internal sem_validate_widget_node
internal sem_validation
internal src_append_diag_info
internal src_append_machine_code
#if !defined(__hpux)
internal src_az_avail_source_buffer
internal src_az_current_source_buffer
internal src_az_current_source_record
internal src_az_first_source_record
internal src_az_module_source_record
internal src_az_orphan_messages
internal src_az_source_file_table
#endif
internal src_get_file_name
internal src_get_source_line
internal src_initialize_source
#if !defined(__hpux)
internal src_l_last_source_file_number
#endif
internal src_open_file
internal src_retrieve_source
internal stbuf
#if !defined(__hpux)
internal sym_az_allocated_nodes
internal sym_az_current_section_entry
#endif
internal sym_az_entry_list_header
internal sym_az_error_value_entry
#if !defined(__hpux)
internal sym_az_external_def_chain
internal sym_az_forward_ref_chain
internal sym_az_freed_nodes
internal sym_az_hash_table
internal sym_az_module_entry
internal sym_az_root_entry
internal sym_az_val_forward_ref_chain
#endif
internal sym_dump_argument
internal sym_dump_callback
internal sym_dump_color_item
internal sym_dump_control
internal sym_dump_external_def
internal sym_dump_forward_ref
internal sym_dump_include_file
internal sym_dump_list
internal sym_dump_module
internal sym_dump_name
internal sym_dump_obj_header
internal sym_dump_object_variant
internal sym_dump_parent_list_item
internal sym_dump_proc_def
internal sym_dump_proc_ref
internal sym_dump_root_entry
internal sym_dump_section
internal sym_dump_source_info
internal sym_dump_symbol
internal sym_dump_symbols
internal sym_dump_value
internal sym_dump_widget
internal sym_find_name
internal sym_initialize_storage
internal sym_insert_name
internal sym_make_external_def
internal sym_make_forward_ref
internal sym_make_value_forward_ref
internal sym_section_text
internal type_from_code
internal uil_arg_compr
#if !defined(__hpux)
internal uil_az_error_env_block
#endif
internal uil_az_error_env_valid
internal uil_catd
internal uil_child_compr
internal uil_exit
internal uil_l_compile_status
internal uil_reas_compr
internal uil_urm_variant
internal uil_v_case_sensitive
internal uil_widget_compr
internal unload_stack
internal validate_arg
internal write_msg_to_standard_error
internal yydebug
internal yyerror
internal yylex
internal yynerrs
internal yyparse
#if defined(hpux)
internal yymaxdepth
#endif
#if defined(sun)
internal yy_yys
internal yy_yyv
internal yyact
internal yychar
internal yychk
internal yydef
internal yyerrflag
internal yyexca
internal yylval
internal yypact
internal yypgo
internal yyps
internal yypv
internal yyr1
internal yyr2
internal yyreds
internal yys
internal yystate
internal yytmp
internal yytoks
internal yyv
internal yyval
#endif

View file

@ -1,103 +0,0 @@
XCOMM $TOG: Imakefile /main/16 1998/03/11 20:19:03 mgreess $
XCOMM
XCOMM @OSF_COPYRIGHT@
XCOMM COPYRIGHT NOTICE
XCOMM Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
XCOMM ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
XCOMM the full copyright text.
INCLUDES = -I. -I$(INCLUDESRC) -I$(MINCLUDESRC) -I$(MLIBSRC) -I$(MTOP)/include
DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(XMLIB) $(XTOOLLIB) $(XLIB)
SRCS1 = wml.c wmlouth.c wmloutmm.c \
wmloutp1.c wmlresolve.c wmlsynbld.c wmlutils.c \
wmldbcreate.c
OBJS1 = wml.o wmloutkey.o wmlouth.o wmloutmm.o \
wmloutp1.o wmlresolve.o wmlsynbld.o wmlutils.o
SRCS2 = wmluiltok.l
OBJS2 = wmlparse.o
SRCS = $(SRCS1) $(SRCS2)
YACCTARGETS = UilLexPars.c UilLexPars.h
WMLTARGETS = UilConst.h UilKeyTab.h \
UilSymArTa.h UilSymArTy.h UilSymCSet.h UilSymCtl.h \
UilSymEnum.h UilSymGen.h UilSymNam.h UilSymRArg.h \
UilSymReas.h UilTokName.h UilUrmClas.h UilSymChCl.h \
UilSymChTa.h
TARGETS = $(YACCTARGETS) $(WMLTARGETS)
TABLE = motif.wml
WMDTABLE = motif.wmd
WMLTOOLS = wml wmluiltok
REPORT = wml.report
NormalLibraryObjectRule()
all:: DONE
DONE: $(WMDTABLE) $(TARGETS)
(cd $(UILSRC); $(RM) $(TARGETS) UilDBDef.h)
cp $(TARGETS) UilDBDef.h $(UILSRC)
touch DONE
NormalLibraryTarget(wml,$(OBJS2) $(OBJS1))
install:: all
wml:: libwml.a
$(CC) $(CFLAGS) libwml.a -o wml
NormalProgramTarget(wmldbcreate,wmldbcreate.o,$(DEPLIBS),$(LOCAL_LIBRARIES),$(SYSLIBS))
wmlparse.c: wmlparse.y wmllex.l
$(LEX) wmllex.l
$(MV) lex.yy.c wmllex.c
$(YACC) -d $(YACCFLAGS) wmlparse.y
$(RM) wmlparse.c wmlparse.h
$(MV) y.tab.c wmlparse.c
$(MV) y.tab.h wmlparse.h
wmlparse.h:: wmlparse.y wmllex.l
$(LEX) wmllex.l
$(MV) lex.yy.c wmllex.c
$(YACC) -d $(YACCFLAGS) wmlparse.y
$(MV) y.tab.c wmlparse.c
$(MV) y.tab.h wmlparse.h
wmluiltok:: wmluiltok.l
$(LEX) wmluiltok.l
$(CC) $(CFLAGS) lex.yy.c $(LEXLIB) -o wmluiltok
$(TARGETS): $(WMLTOOLS) $(TABLE)
$(RM) $(TARGETS) $(REPORT) wml-uil.mm
$(YACC) -d $(YACCFLAGS) Uil.y
$(MV) y.tab.c UilLexPars.c
$(MV) y.tab.h UilLexPars.h
$(CLIENTENVSETUP) ./wmluiltok < Uil.y > tokens.dat
$(RM) wml-uil.mm
$(CLIENTENVSETUP) ./wml $(TABLE)
$(RM) tokens.dat
$(WMDTABLE): wmldbcreate
$(CLIENTENVSETUP) ./wmldbcreate -o $@
clean::
$(RM) $(TARGETS) $(WMDTABLE) $(REPORT) lex.yy.c libwml.a wml \
*.mm *.sdml *.txt wmlparse.c wmlparse.h wmluiltok wmllex.c \
tokens.dat DONE
depend:: wmlparse.h
DependTarget()
includes:: $(TARGETS)
(cd $(UILSRC); $(RM) $(TARGETS) UilDBDef.h)
cp $(TARGETS) UilDBDef.h $(UILSRC)

View file

@ -1,416 +0,0 @@
/* $XConsortium: README /main/4 1996/07/15 14:38:42 drk $ */
This memo documents the Widget MetaLanguage (WML) facility which generates
the Uil compiler language description.
1. Introduction
The Uil compiler's language definition has the following components:
- Invariant parts of the language grammar. This consists of the
basic syntax and keywords, for example, the 'arguments' directive.
- Dynamic parts of the language. This consists of the widget/gadget
classes supported by the language, including all resources
(arguments and reasons), and the definitions of legal relationships
among these parts (which classes are legal controls (children)
of any given class, default values, and so on).
- The data types supported by the compiler. The code which supports
the data types is invariant, but the data types must also be
declared and made known in WML in order to provide a clean
specification.
The dynamic parts of the language definition in the compiler are represented
as follows. The representation falls into two classes:
- Definitions of the language used for validity checking and
reporting:
o A set of #define literals name all data types, classes,
arguments, and reasons in the language.
o A set of statically compiled tables defines the names and
legal relationships among these entities.
- All data types, classes, arguments, and reasons are treated as
keywords in the Uil grammar. This is supported by:
o A set of #define literals which names all the tokens in
the language. Some of these tokens receive identical
values to the literals mentioned above (this identity is
crucial to the compiler's correct functioning).
o A set of statically compiled tables used by lexical
analysis to detect and classify the language keywords.
o A yacc grammar including these token definitions which
generates a compilable Uil language parser.
These representations are all contained in .h files except for the parser,
which is contained in a .y file and its resulting .c file.
The WML system's task is to generate all these literals and tables based on
a specification of the dynamic parts of the Uil language - the data types,
widget/gadget classes, arguments, and reasons. The components of the system
are:
- A specification of the of set of widgets to be supported. This
specification is an ASCII file containing a WML language
specification as described below. The WML language is a simple
declarative language whose syntax is similar to Uil itself.
- A process named wml, which parses the WML specification and
produces the following output:
o The .h files which define the first class of language
representations - the validity checking and reporting
information.
o A set of .dat files which are used by succeeding processes
to produce the Uil grammar.
o A report file which describes the toolkit being supported.
o A .mm file to be incorporated in the Uil language
documentation, which tabulates the built-in language
tables for Uil user reference.
- A process named wmluily which generates the Uil grammar.
- A process named wmltokens which generates token data
- A process named wmlkeyword which generates the token and lexical
analysis tables.
A shell script is provided which runs the system. The individual processes
and inputs can usually be ignored.
2. Environment
The generation and use of the WML system requires the following:
- The C language compiler and runtime system (cc).
- The lexical generator facility (lex)
- the compiler compiler facility (yacc)
The WML facility is found in directory /wmlsrc. It assumes the following
directories also exist:
/uilsrc - the directory to which the output files are to be moved
/mrmsrc/Mrm - contains MrmCmpr.h and other .h files required to
compile the uil compiler.
The tables produced by WML must be consistent with the Mrm compression
code tables emboded in /mrmsrc/Mrm/MrmCmpr.h and /mrmsrc/Mrm/MrmCmprTbl.h.
If in doubt, refer to /mrmsrc/Mrm/urmc.README for details.
3. WML input
Input to WML consists of:
- A description of the widget set (toolkit) to be suppported in
the WML specification language.
- Data files supplied with WML facility, and which you will
usually not need to modify. These are:
o grammar.y - specifies the invariant part of the
Uil grammar
o charset.dat - specifies the character sets supported by
the compiler when handling compound strings
Any other .dat files found in /wmlsrc are the result of running
the facility, and may be ignored.
3.A. WML specification language
The WML specification is a simple declarative language whose syntax is
similar to that of Uil itself. It models the widget set to be suppored in
a way that is very similar to the Uil language. It differs in having class
inheritance similar to Xt widget classes, which minimizes the amount of
specification and reduces errors. The properties of the model are:
- Class properties
o Classes are differentiated into two types - metaclasses
and classes. Metaclasses cannot instantiate widgets.
Typically, a WML metaclass is generated for each metaclass
in the widget set to be supported.
o A regular class is defined for every low-level create
routine in the widget set. There are typically more WML
classes that widget set classes. For instance, there
is one XmRowColumn class, with six WML classes (XmRowColumn
XmMenuBar, XmOptionMenu, XmPopupMenu, XmPulldownMenu,
XmRadioBox).
o Gadgets are modelled as variants of a corresponding
widget class.
o A class may have zero or one superclasses. A class
inherits all the resources and controls of its superclass
(recursively). An inherited resource may have some of
its properties overridden.
o A class is given a name which becomes its Uil language
keyword (for regular classes). Metaclass names do
not appear in Uil.
o A class is identified to Mrm by its creation
convenience function (low-level create function). Examples
are XmCreateLabel, XmCreatePushButtonGadget.
- Resource properties
o Resources are divided into two classes - arguments and
and reasons. This models the Uil language distinction
between callbacks and all other resources.
o A resource is considered to have universal scope. Once
defined, it may be used in any class. Its name and datatype
are invariant, but its default value may be overridden.
o A resource is included in a class by referencing it.
Resources are inherited. Inherited resources may be
excluded, which meancs they are not available in the
class which provides this override (and its subclasses).
This corresponds to the Motif toolkit N/A access value.
o A resource is given a name which becomes its Uil language
keyword.
o A resource is identified to Mrm by the toolkit literal
used to name it in arglists. Examples are
XmNheight, XmNancestorSensitive, XmNhelpCallback. The
resource literal defaults to the resource name, and need
not be explicitly specified where they are identical.
- Control properties
o A control is a class which is permitted as the child
of some other class.
o Naming the controls of a class is a WML feature which
supports validity checking. There is no coresponding
explicit feature in any Xt widget set.
3.A.1 WML syntax and semantics
The WML syntax can be quickly inferred from the standard input file
provided with WML - motif-tables.wml. A quick BNF is provided in section 7.
WML semantics are:
- '!' introduces a comment. Comments run from '!' to EOL.
- A string value may be quoted by enclosing in double quotes '"'.
Names as well as values may be quoted. Keywords may not.
- All names are case-sensitive. Forward and backward references
are allowed. All references to be resolved are to items defined
in WML. These are:
o Type = <an item defined in a DataType statement>
o SuperClass =
WidgetClass = <an item defined in a Class statement>
o Resources { <items defined in Resource statement> };
o Controls { <items defined in Class or ControlList>
statements> };
- A convenience function name is required for all classes except
Metaclasses.
- Datatypes are required for all Arguments, Constraints, and
SubResources.
- Arguments and SubResources are functionally identical, and
are distinguished only because they are different kinds of
resources in Xt widget sets. Constraints apply only to the
referencing class's children. The same name may not be
used for both an Argument and a Constraint (once a Constraint,
always a Constraint).
- If a resource occurs in the widget set with more than one
datatype, the Uil datatype 'any' must be used.
- The ResourceLiteral attribute for resources is optional, and
need only be specified when the name is not identical to the literal.
- The DocName and Default attributes are only used for documentation.
They are arbitrary strings.
- The WidgetClass attribute identifies the Widget class
associated with a Gadget class, and is required.
- The DialogClass attribute is optional.
- The ControlList statement is a simply macro for lists of
controls. It avoids tedious repetition of identical lists.
A Controls block in a Class statement allows Class and
ControlList names to be freely mixed.
4. WML output
- The .h files and parser required by the compiler. These
are automatically moved to /uilsrc by the runwml script.
- A report describing the supported widget set, always named
wml.report. This report is intended to aid in validating
the WML source. The report is organized in a way which makes
if fairly easy to compare the Uil langauge against widget
set documentation as exemplified by the Motif Programmer's
Reference Manual. The reported is sorted as follows:
- alphabetically by class name
- Resources ordered by ancestor (top of tree first).
Resources are listed alphabetically, with datatype
and default always shown.
- Reasons ordered by ancestor (top of tree first),
then alphabetically.
- Controls listed alphabetically.
- A file which provides documentation for the language, intended
to be an appendix to a Uil manual as exemplified by the
Guide to the Motif User Interface Language Compiler. This file
is named wml-uil.mm
5. Generating and running WML
The script file /wmlsrc/genwml will build WML. The script file /wmlsrc/runwml
will run WML with motif-tables.src as input.
6. Gotchas and problems in current WML implementation
The script files genwml and runwml should be replaced by Makefiles.
The documentation file ?.mm is relatively untested. The tables should
probably be modified, as they are currently too big to print cleanly.
The handling of the DocName attribute is incorrect.
The specification of the Motif toolkit in motif-tables.wml has not been
fully validated against the latest toolkit documentation. We believe there
are no or very few errors in the actual resources and the classes which
use them. There may be errors in the default values, which will appear
in the documentation.
7. WML BNF
WML-specification : statement_block_list
statement_block_list:
<empty>
statement_block_list statement_block
statement_block:
class_statement_block
| resource_statement_block
| datatype_statement_block
| control_list_statement_block
class_statement_block:
'Class' class_statement_list
resource_statement_block:
'Resource' resource_statement_list
datatype_statement_block:
'Datatype' datatype_statement_list
control_list_statement_block:
'ControlList' control_list_statement_list
class_statement_list:
class_statement ';'
| class_statement_list class_statement ';'
resource_statement_list:
resource_statement ';'
| resource_statement_list resource_statement ';'
datatype_statement_list:
datatype_statement ';'
| datatype_statement_list datatype_statement ';'
control_list_statement_list:
control_list_statement ';'
| control_list_statement_list control_list_statement ';'
class_statement:
<name> ':' class_type class_definition
class_type:
'MetaClass' | 'Widget' | 'Gadget'
class_definition:
<empty>
| '{' '}'
| '{' class_attribute_list '}'
class_attribute_list:
class_attribute_name '=' <string> ';'
| class_boolean_attribute_name '=' boolean_attribute_value ';'
| class_resources ';'
| class_controls ';'
class_attribute_name:
'SuperClass' | 'Alias' | 'ConvenienceFunction' | 'WidgetClass' |
'DocName'
class_boolean_attribute_name:
'DialogClass'
boolean_attribute_value:
'True' | 'False'
class_resources:
'Resources' class_resources_block
class_resources_block:
<empty>
'{' '}'
'{' class_resource_list '}'
class_resource_list:
class_resource_element
| class_resource_list class_resource_element
class_resource_element:
<name> class_resource_attributes ';'
class_resource_attributes:
<empty>
'{' '}' ';'
'{' class_resource_attribute_list '}'
class_resource_attribute_list:
class_resource_attribute_element
| class_resource_attribute_list class_resource_attribute_element
class_attribute_element
class_resource_attribute_name '=' <string> ';'
| boolean_class_resource_attribute_name '=' boolean_attribute_value ';'
class_resource_attribute_name:
'Default'
boolean_class_resource_attribute_name:
'Exclude'
class_controls:
'Controls' class_controls_block
class_controls_block:
<empty>
| '{' '}' ';'
| '{' class_controls_list '}'
class_controls_list:
class_controls_element
class_controls_list class_controls_element
class_controls_element:
<name> ;
resource_statement:
<name> ':' resource_type resource_definition
resource_type:
'Argument' | 'Reason' | 'Constraint' | 'SubResource'
resource_definition:
<empty>
'{' '}'
'{' resource_attribute_list '}'
resource_attribute_list:
resource_attribute
resource_attribute_list resource_attribute
resource_attribute:
resource_attribute_name '=' <string> ';'
resource_attribute_name:
'Type' | 'ResourceLiteral' | 'Alias' | 'Related' | 'Default' |
'DocName'
datatype_statement:
<name> datatype_definition
datatype_definition:
<empty>
| '{' '}'
| '{' datatype_attribute_list '}'
datatype_attribute_list:
datatype_attribuute
datatype_attribute_list datatype_attribute
datatype_attribute:
datatype-attribute_name '=' <string> ';'
datatype_attribute_name:
'Alias' | 'DocName'
control_list_statement:
<name> control_list_definition
control_list_definition:
<empty>
'{' '}'
'{' control_list_controls_list '}'
control_list_controls_list:
control_list_control
control_list_controls_list control_list_control
control_list_control:
<name> ';'

File diff suppressed because it is too large Load diff

View file

@ -1,447 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: UilDBDef.h /main/8 1995/07/13 21:03:16 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
**++
** FACILITY:
**
** User Interface Language Compiler (UIL)
**
** ABSTRACT:
**
** This include file defines the interfaces necessry to the binary
** data base in the WML & UIL compilers.
**
**--
**/
#ifndef UilDBDef_h
#define UilDBDef_h
/***********************************************************************
****************** From UilDef.h ***************************************/
#define _BIT_INDEX(_type) \
(((unsigned int) (_type)) >> 3)
#define _BIT_MASK(_type) \
(1 << (((unsigned int) (_type)) & 0x7))
#define _BIT_SET(table_entry_addr, _type) \
( _BIT_MASK (_type) & \
( ((unsigned char *) (table_entry_addr)) \
[ _BIT_INDEX (_type) ] ) )
/*******************************************************************
**************** From UilSymDef.h *********************************/
/*
** Hash table size
*/
#define sym_k_hash_table_limit 127
/*
** Symbol tags. These values are used in the tag field of every object header
** to identify the type of the entry.
*/
#define sym_k_error_entry (127)
/* An error entry is used when compilation errors are detected in the */
/* source program. Its use reduces cascading errors caused by missing */
/* information and allows the compilation to continue and thus */
/* additional errors may be detected */
#define sym_k_value_entry 1
/* A value entry contains information about a UIL literal value */
/* (integer, string, compound string, xbitmapfile, argument, color, */
/* icon, etc.). The b_type field is used to determine the datatype of */
/* this value. */
#define sym_k_name_entry 2
/* A name entry corresponds to a name (identifier) used in the UIL */
/* source. */
#define sym_k_widget_entry 3
/* A widget entry represents a widget declaration. It points off to */
/* the arguments, callbacks, and controls lists for the widget. */
#define sym_k_control_entry 4
/* A control entry hangs off a list entry and identifes an object */
/* (widget or gadget) that is controlled. It also contains the */
/* managed/unmanaged information. */
#define sym_k_forward_ref_entry 5
/* forward reference entries are a linked listed of objects */
/* (widgets/gadgets) that were not defined at the time of the */
/* reference. After all objects have been seen, then this list is */
/* traversed and all objects in it should now be defined and the */
/* specified pointers can be filled-in. */
#define sym_k_external_def_entry 6
/* An external definition entry identifies a name that has been */
/* imported and thus in not declared within this source module. */
#define sym_k_argument_entry 7
/* An argument entry hangs off a list entry and identifies an object */
/* argument. It contains informtation about the argument name and */
/* argument value. */
#define sym_k_callback_entry 8
/* An calllback entry hangs off a list entry and identifies an object */
/* callback. It contains informtation about the callback name, */
/* callback procedure, and callback tag. */
#define sym_k_module_entry 9
/* A module entry contains information specified on the module */
/* statement. */
#define sym_k_proc_def_entry 10
/* A procedure definition entry is created for each procedure listed */
/* in a procedure section. I contains informaion on the number and */
/* types of the arguments. */
#define sym_k_proc_ref_entry 11
/* A procedure reference entry contains information about a the use of */
/* a procedure (e.g. as a callback). It also stores the tag to be */
/* passed to the procedure. */
#define sym_k_list_entry 12
/* A list entry is a typed list of other symbol table entries. It */
/* contains a count and a pointer to the next entry on the list via */
/* the obj_header.az_next field. */
#define sym_k_child_entry 13
/* A child entry represents a declaration for an */
/* automatically created child. It points off to */
/* the arguments, callbacks, and controls lists for the child. Since */
/* the structures for widget and child are the same, the */
/* datastructure for children is really a sym_k_widget_entry_type. */
#define sym_k_identifier_entry 14
/* identifier entry tag is used for diagnostic messages only */
#define sym_k_color_item_entry 15
/* entry describing a color. */
#define sym_k_gadget_entry 16
/* A gadget entry represents a gadget declaration. It points off to */
/* the arguments, callbacks, and controls lists for the gadget. Since */
/* the structures for widget and gadgets are the same, the */
/* datastructure for gadgets is really a sym_k_widget_entry_type. */
#define sym_k_root_entry 17
/* An entry used to group all the other entries together. It is */
/* returned in the parse_tree_root field of the compilation descriptor */
/* when using the callable interface. */
#define sym_k_parent_list_entry 18
/* This is a list of parents of a widget. It is used to check for */
/* constraints provided by the parent that may be used on this widget. */
#define sym_k_nested_list_entry 19
/* This entry occurs as a list entry for a nested list. It occupies */
/* the correct position in the list for the reference to a list, and */
/* points to the actual list entry. */
#define sym_k_include_file_entry 20
/* An include file entry is used to describe the contents of an */
/* include file. It is needed only maintain information about the */
/* source file from which this parse tree was generated. It is not */
/* used by UIL directly. */
#define sym_k_section_entry 21
/* A section entry is used to describe the contents of an source file. */
/* It is needed only maintain information about the structure of */
/* source file from which this parse tree was generated. It is not */
/* used by UIL directly. */
/* */
#define sym_k_def_obj_entry 22
/* This entry corresponds to the default object clause on the module */
/* declaration it is used to store source information about the file */
/* from which this parse tree was generated. It is not used by UIL */
/* directly. */
#define sym_k_UNUSED23_entry 23
#define sym_k_val_forward_ref_entry 24
/* val forward reference entries are a linked listed of values */
/* that were not defined at the time of the */
/* reference. After all values have been seen, then this list is */
/* traversed and all values in it should now be defined and the */
/* specified pointers can be filled-in. */
#define sym_k_max_entry 24
/* this is the largest possible value for an entry constant. */
/*
** Common attribute masks -- These values are used in the b_flags field of
** the object_header.
*/
#define sym_m_private (1 << 0)
/* This item is private to this source module and thus need not be */
/* output into the UID file. */
#define sym_m_exported (1 << 1)
/* This is an exported definition and must be put in the UID file. */
#define sym_m_imported (1 << 2)
/* This item is a reference external to this source module and thus */
/* will be resolved at runtime by searching the resourec hierarchy. */
#define sym_m_reference (1 << 3)
#define sym_m_builtin (1 << 4)
/* This item is builtin as oppose to a userdefined item. */
#define sym_m_obj_is_gadget (1 << 5)
/* This object is a gadget as oppose to a widget. */
/*
** Output states - order is important
*/
#define sym_k_not_processed 0
#define sym_k_queued 1
#define sym_k_emitted 2
/*
** Constants to define compiler-recognized data types. It is
** important that the names used in .wml language descriptions
** match these names. These values were once automatically generated
** by WML. They are now maintained by hand to reduce compiler
** dependence on WML artifacts.
**
** We have also separated the values loosely into two classes:
** values which can be used to verify operator legality and values
** which cannot (see UilSemVal.c -- the legal_operand_type table).
** There is a comment below denoting where the separation is. Any
** values above the comment may be used for validation of an operator
** while any values below may not.
**
** The order of the values below is unimportant except that the
** entries in the uil_datatype_names table in UilData.c must be
** ordered the same way.
*/
#define sym_k_any_value 1
#define sym_k_bool_value 2
#define sym_k_char_8_value 3
#define sym_k_compound_string_value 4
#define sym_k_float_value 5
#define sym_k_integer_value 6
#define sym_k_single_float_value 7
#define sym_k_localized_string_value 8
#define sym_k_wchar_string_value 9
#define sym_k_horizontal_integer_value 10
#define sym_k_vertical_integer_value 11
#define sym_k_horizontal_float_value 12
#define sym_k_vertical_float_value 13
/* Values after here may not be used for operator argument validation */
#define sym_k_argument_value 14
#define sym_k_asciz_table_value 15
#define sym_k_class_rec_name_value 16
#define sym_k_color_value 17
#define sym_k_color_table_value 18
#define sym_k_font_value 19
#define sym_k_font_table_value 20
#define sym_k_icon_value 21
#define sym_k_identifier_value 22
#define sym_k_integer_table_value 23
#define sym_k_keysym_value 24
#define sym_k_pixmap_value 25
#define sym_k_reason_value 26
#define sym_k_rgb_value 27
#define sym_k_string_table_value 28
#define sym_k_trans_table_value 29
#define sym_k_widget_ref_value 30
#define sym_k_xbitmapfile_value 31
#define sym_k_fontset_value 32
#define sym_k_child_value 33
#define sym_k_max_value 33
#define sym_k_no_value (sym_k_max_value+1)
/*
* Error values for all kind of sym_k_... literal set
*/
#define sym_k_error_value 0
#define sym_k_error_object 0
#define sym_k_error_charset 0
/*
* Literals associated with character sets
*
* Character set character sizes
*/
#define sym_k_onebyte_charsize 1
#define sym_k_twobyte_charsize 2
#define sym_k_mixed1_2byte_charsize 3
/*
* User-defined character set
*/
#define sym_k_userdefined_charset 1
/*
* XmFONTLIST_DEFAULT_TAG
*/
#define sym_k_fontlist_default_tag 0
/*
** value sets defining expression operators
*/
#define sym_k_unspecified_op 0
#define sym_k_not_op 1
#define sym_k_unary_plus_op 2
#define sym_k_unary_minus_op 3
#define sym_k_comp_str_op 4
#define sym_k_wchar_str_op 5
#define sym_k_last_unary_op 5
#define sym_k_multiply_op 6
#define sym_k_divide_op 7
#define sym_k_add_op 8
#define sym_k_subtract_op 9
#define sym_k_left_shift_op 10
#define sym_k_right_shift_op 11
#define sym_k_and_op 12
#define sym_k_xor_op 13
#define sym_k_or_op 14
#define sym_k_cat_op 15
#define sym_k_last_binary_op 15
#define sym_k_valref_op 16 /* az_exp_op1 points to the value node
whose value is referenced by this
value node. */
#define sym_k_coerce_op 17 /* az_exp_op1 points to the value node
whose value is to be coerced to the
data type of this node. */
#define sym_k_last_special_op 17
/*
* Structure of an enumeration set entry
*/
typedef struct
{
short int values_cnt;
/* number of values in the enuemration set descriptor */
unsigned short int *values;
/* vector of values */
} UilEnumSetDescDef, *UilEnumSetDescDefPtr;
/**********************************************************************
**************** From UilKeyDef.h ************************************/
/*
* Token class literals
*/
#define tkn_k_class_argument 1
#define tkn_k_class_charset 2
#define tkn_k_class_color 3
#define tkn_k_class_enumval 4
#define tkn_k_class_font 5
#define tkn_k_class_identifier 6
#define tkn_k_class_keyword 7
#define tkn_k_class_literal 8
#define tkn_k_class_reason 9
#define tkn_k_class_reserved 10
#define tkn_k_class_special 11
#define tkn_k_class_unused 12
#define tkn_k_class_class 13
#define tkn_k_class_child 14
/*
* Keyword table entry structure
*/
typedef struct
{
unsigned char b_class;
unsigned short int b_subclass;
unsigned char b_length;
unsigned char b_token;
char *at_name;
} key_keytable_entry_type;
/*************************************************************************
************************ New Stuff **************************************/
/* For COMPOUND_STRING_COMPONENT */
#define XmStringComponent "XmStringComponent"
/*
* Names of the tables put in the binary database
*/
#define Constraint_Tab 1
#define Key_Table 2
#define Key_Table_Case_Ins 3
#define Allowed_Argument_Table 4
#define Argument_Type_Table_Value 5
#define Charset_Xmstring_Names_Table 6
#define Charset_Wrdirection_Table 7
#define Charset_Parsdirection_Table 8
#define Charset_Charsize_Table 9
#define Charset_Lang_Names_Table 10
#define Charset_Lang_Codes_Table 11
#define Allowed_Control_Table 12
#define Enum_Set_Table 13
#define Argument_Enum_Set_Table 14
#define Enumval_Values_Table 15
#define Uil_Widget_Names 16
#define Uil_Argument_Names 17
#define Uil_Reason_Names 18
#define Uil_Enumval_names 19
#define Uil_Charset_Names 20
#define Related_Argument_Table 21
#define Allowed_Reason_Table 22
#define Uil_Widget_Funcs 23
#define Uil_Gadget_Funcs 24
#define Uil_Urm_Nondialog_Class 25
#define Uil_Urm_Subtree_Resource 26
#define Uil_Argument_Toolkit_Names 27
#define Uil_Reason_Toolkit_Names 28
#define Child_Class_Table 29
#define Allowed_Child_Table 30
#define Uil_Children_Names 31
/*
* Binary Data Base Work
*/
#define DB_Compiled_Version 2
typedef struct _db_globals_struct
{
int version;
int uil_max_arg;
int uil_max_charset;
int charset_lang_table_max;
int uil_max_object;
int uil_max_reason;
int uil_max_enumval;
int uil_max_enumset;
int key_k_keyword_count;
int key_k_keyword_max_length;
int uil_max_child;
} _db_globals;
typedef struct _db_header_struct
{
int table_id;
int num_items;
int table_size;
} _db_header, *_db_header_ptr;
#endif /* UilDBDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */

File diff suppressed because it is too large Load diff

View file

@ -1,271 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: wml.c /main/8 1999/04/16 09:41:47 mgreess $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
* This is the main program for WML. It declares all global data structures
* used during a compilation, and during output.
*/
/*
* WML is a semi-standard Unix application. It reads its input from
* stdin, which is expected to be a stream containing a WML description
* of a UIL language. If this stream is successfully parsed and semantically
* validated, then WML writes a series of standard .h and .dat files into
* the user directory. The .h files will be used directly to construct
* the UIL compiler. The .dat files are used by other phases of UIL
* table generation.
*
* The files created by WML are:
*
* .h files:
* UilSymGen.h
* UilSymArTy.h
* UilSymRArg.h
* UilDrmClas.h
* UilConst.h
* UilSymReas.h
* UilSymArTa.h
* UilSymCtl.h
* UilSymNam.h
* .dat files
* argument.dat
* reason.dat
* grammar.dat
* .mm files
* wml-uil.mm
*/
#include "wml.h"
#if defined(SYSV) || defined(SVR4)
#include <fcntl.h>
#else
#include <sys/file.h>
#endif
#include <stdio.h>
/*
* Globals used during WML parsing.
*
* WML uses globals exclusively to communicate data during parsing. The
* current object being constructed is held by these globals, and all
* routines called from the parse assume correct setting of these globals.
* This simplisitic approach is possible since the WML description language
* has no recursive constructs requiring a frame stack.
*/
/*
* Error and other counts
*/
int wml_err_count = 0; /* total errors */
int wml_line_count = 0; /* lines read from input */
/*
* Dynamic ordered vector of all objects encountered during parse. This
* is used to detect name collisions, and is the primary order vector
* used for all other vectors constructed curing the semantic resolution
* phase of processing.
*/
DynamicHandleListDef wml_synobj;
DynamicHandleListDefPtr wml_synobj_ptr = &wml_synobj;
/*
* Dynamic vectors of vectors partitioned and ordered
* as required by the semantic processing and output routines. All
* point to resolved objects rather than syntactic objects.
*/
DynamicHandleListDef wml_obj_datatype; /* datatype objects */
DynamicHandleListDefPtr wml_obj_datatype_ptr = &wml_obj_datatype;
DynamicHandleListDef wml_obj_enumval; /* enumeration value objects */
DynamicHandleListDefPtr wml_obj_enumval_ptr = &wml_obj_enumval;
DynamicHandleListDef wml_obj_enumset; /* enumeration set objects */
DynamicHandleListDefPtr wml_obj_enumset_ptr = &wml_obj_enumset;
DynamicHandleListDef wml_obj_reason; /* reason resource objects */
DynamicHandleListDefPtr wml_obj_reason_ptr = &wml_obj_reason;
DynamicHandleListDef wml_obj_arg; /* argument resource objects */
DynamicHandleListDefPtr wml_obj_arg_ptr = &wml_obj_arg;
DynamicHandleListDef wml_obj_child; /* argument resource objects */
DynamicHandleListDefPtr wml_obj_child_ptr = &wml_obj_child;
DynamicHandleListDef wml_obj_allclass; /* metaclass, widget, gadget */
DynamicHandleListDefPtr wml_obj_allclass_ptr = &wml_obj_allclass;
DynamicHandleListDef wml_obj_class; /* widget & gadget objects */
DynamicHandleListDefPtr wml_obj_class_ptr = &wml_obj_class;
DynamicHandleListDef wml_obj_ctrlist; /* controls list objects */
DynamicHandleListDefPtr wml_obj_ctrlist_ptr = &wml_obj_ctrlist;
DynamicHandleListDef wml_obj_charset; /* charset objects */
DynamicHandleListDefPtr wml_obj_charset_ptr = &wml_obj_charset;
DynamicHandleListDef wml_tok_sens; /* case-sensitive tokens */
DynamicHandleListDefPtr wml_tok_sens_ptr = &wml_tok_sens;
DynamicHandleListDef wml_tok_insens; /* case-insensitive tokens */
DynamicHandleListDefPtr wml_tok_insens_ptr = &wml_tok_insens;
/*
* Routines only accessible in this module
*/
void wmlInit ();
/*
* External variables
*/
extern int yyleng;
/*
* The WML main routine:
*
* 1. Initialize global storage
* 2. Open the input file if there is one
* 3. Parse the WML description in stdin. Exit on errors
* 4. Perform semantic validation and resolution. Exit on errors.
* 5. Output files
*/
int main (argc, argv)
int argc;
char **argv;
{
int done;
int fd; /* input file descriptor */
/*
* Initialize storage
*/
wmlInit ();
/*
* Assume that anything in argv must be an input file. Open it, and
* dup it to stdin
*/
if ( argc > 1 )
{
if ( (fd=open(argv[1],O_RDONLY)) == -1 )
printf ("\nCouldn't open file %s", argv[1]);
else
dup2 (fd, 0);
}
/*
* Process the input
*/
done = 0;
while (!done)
{
/*
* Parse the input stream
*/
yyleng = 0; /* initialization safety */
yyparse ();
if ( wml_err_count > 0 ) break;
printf ("\nParse of WML input complete");
/*
* Perform semantic validation, and construct resolved data structures
*/
wmlResolveDescriptors ();
if ( wml_err_count > 0 ) break;
printf ("\nSemantic validation and resolution complete");
/*
* Output
*/
wmlOutput ();
if ( wml_err_count > 0 ) break;
printf ("\nWML Uil*.h and wml-uil.mm file creation complete\n");
done = 1;
}
/*
* Report inaction on errors
*/
if ( wml_err_count > 0 )
{
printf ("\nWML found %d errors, no or incomplete output produced\n",
wml_err_count);
/* Begin fixing the bug CR 4748 */
exit(1);
/* End fixing the bug CR 4748 */
}
return (0);
}
/*
* Routine to initialize WML.
*
* The main job is to dynamically allocate any dynamic lists to a reasonable
* initial state.
*/
void wmlInit ()
{
/*
* Initialize the list of all syntactic objects
*/
wmlInitHList (wml_synobj_ptr, 1000, TRUE);
}
yywrap()
{
return(1);
}

View file

@ -1,708 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* $XConsortium: wml.h /main/9 1995/08/29 11:10:33 drk $ */
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
* This file contains the structure and literal definitions required
* by the WML processor
*/
#if defined(__STDC__)
#include <stddef.h>
#else
#include <stdio.h>
#endif
#define TRUE 1
#define FALSE 0
#define SUCCESS 1
#define FAILURE 0
/*
* Generic object pointer
*/
typedef char *ObjectPtr;
/*
* True and False for attributes, so setting is explicit
*/
#define WmlAttributeUnspecified 0
#define WmlAttributeTrue 1
#define WmlAttributeFalse 2
/*
* Values of character set direction
*/
#define WmlCharSetDirectionLtoR 1
#define WmlCharSetDirectionRtoL 2
/*
* Values of character set character size
*/
#define WmlCharSizeOneByte 1
#define WmlCharSizeTwoByte 2
#define WmlCharSizeMixed1_2Byte 3
/*
* Upper case and lower case converters
*/
#define _upper(c) ((c) >= 'a' && (c) <= 'z' ? (c) & 0x5F:(c))
#define _lower(c) ((c) >= 'A' && (c) <= 'Z' ? (c) | 0x20:(c))
/*
* The Uil token classes which are dealt with WML. Matched to definitions
* in UilKeyDef.h, although this isn't required.
*/
#define WmlTokenClassArgument 1
#define WmlTokenClassCharset 2
#define WmlTokenClassColor 3
#define WmlTokenClassEnumval 4
#define WmlTokenClassFont 5
#define WmlTokenClassIdentifier 6
#define WmlTokenClassKeyword 7
#define WmlTokenClassLiteral 8
#define WmlTokenClassReason 9
#define WmlTokenClassReserved 10
#define WmlTokenClassSpecial 11
#define WmlTokenClassUnused 12
#define WmlTokenClassClass 13
#define WmlTokenClassChild 14
/*
* Structures for WML objects. Two kinds are created for each object
* recognized and built as a WML description is read:
* - A syntactic descriptor, which captures the information parse
* from the input in pretty much its raw form
* - A semantically resolved descriptor, in which pointers to
* other descriptors have been resolved, ordering is done,
* superclass inheritance is complete, etc.
*/
/*
* Syntactic structures. These are constructred during input parse.
*/
/*
* A dummy holding only a header. Allows access to the validation field.
*/
typedef struct
{
int validation; /* a unique validation code */
ObjectPtr rslvdef; /* the resolved object pointer */
} WmlSynDef, *WmlSynDefPtr;
/*
* A class resource descriptor. This a subset of a full resource descriptor,
* which captures those elements which can be overridden in a class declaration
*/
#define WmlClassResDefValid 871253
typedef struct WmlSynClassResDefStruct
{
int validation; /* WmlClassResDefValid */
struct WmlSynClassResDefStruct
*next; /* next descriptor in chain */
char *name; /* resource name */
char *type; /* override type name */
char *dflt; /* override default value */
short int exclude; /* WmlAttributeTrue if to be excluded */
} WmlSynClassResDef, *WmlSynClassResDefPtr;
/*
* A class child descriptor.
*/
#define WmlClassChildDefValid 780344
typedef struct WmlSynClassChildDefStruct
{
int validation; /* WmlClassChildDefValid */
struct WmlSynClassChildDefStruct
*next; /* next descriptor in chain */
char *name; /* child name */
} WmlSynClassChildDef, *WmlSynClassChildDefPtr;
/*
* A class controls descriptor. It contains elements which can be added
* to a controls reference.
*/
#define WmlClassCtrlDefValid 7132320
typedef struct WmlSynClassCtrlDefStruct
{
int validation; /* WmlClassCtrlDefValid */
struct WmlSynClassCtrlDefStruct
*next; /* next descriptor in chain */
char *name; /* controlled class name */
} WmlSynClassCtrlDef, *WmlSynClassCtrlDefPtr;
/*
* A class structure. One exists for each Class statement in a WML
* description.
*/
#define WmlClassDefValid 93741
#define WmlClassTypeMetaclass 1
#define WmlClassTypeWidget 2
#define WmlClassTypeGadget 3
typedef struct WmlSynClassDefStruct
{
int validation; /* WmlClassDefValid */
struct WmlClassDefStruct
*rslvdef; /* resolved definition */
short int type; /* from WmlClassType... */
short int dialog; /* TRUE if a dialog class (has
window manager decoration, etc) */
char *name; /* class name */
char *superclass; /* superclass name */
char *parentclass; /* parentclass name */
char *widgetclass; /* widget class name */
char *int_lit; /* internal literal name */
char *convfunc; /* convenience function name */
char *docname; /* name for docs */
char *ctrlmapto; /* resource controls map to */
WmlSynClassCtrlDefPtr
controls; /* list of controlled classes */
WmlSynClassResDefPtr
resources; /* list of resources from input */
WmlSynClassChildDefPtr
children; /* list of automatic children */
} WmlSynClassDef, *WmlSynClassDefPtr;
/*
* A controls list structure. One is created for each ControlsList statement
* in a WML description.
*/
#define WmlCtrlListDefValid 621298
typedef struct WmlSynCtrlListDefStruct
{
int validation; /* WmlCtrlListDefValid */
struct WmlCtrlListDefStruct
*rslvdef; /* resolved definition */
char *name; /* controls list name */
WmlSynClassCtrlDefPtr
controls; /* list of controlled classes */
} WmlSynCtrlListDef, *WmlSynCtrlListDefPtr;
/*
* A resource descriptor. One is created for each Resource statement
* in a WML description
*/
#define WmlResourceDefValid 310538
#define WmlResourceTypeArgument 1
#define WmlResourceTypeReason 2
#define WmlResourceTypeConstraint 3
#define WmlResourceTypeSubResource 4
typedef struct WmlSynResourceDefStruct
{
int validation; /* WmlResourceDefValid */
struct WmlResourceDefStruct
*rslvdef; /* resolved definition */
short int type; /* from WmlResourceType... */
char *name; /* resource name */
char *datatype; /* resource data type */
char *int_lit; /* internal literal name */
char *resliteral; /* resource name literal */
char *enumset; /* enumeration set name */
char *docname; /* name for docs */
char *related; /* names related resource */
char *dflt; /* default value */
short int xrm_support; /* WmlAttributeTrue if can be
Xrm resource */
short int alias_cnt; /* alias count */
char **alias_list; /* vector of aliass */
} WmlSynResourceDef, *WmlSynResourceDefPtr;
/*
* A child descriptor. One is created for each Child statement
* in a WML description
*/
#define WmlChildDefValid 229629
typedef struct WmlSynChildDefStruct
{
int validation; /* WmlResourceDefValid */
struct WmlChildDefStruct
*rslvdef; /* resolved definition */
char *name; /* child name */
char *class; /* child class */
} WmlSynChildDef, *WmlSynChildDefPtr;
/*
* A datatype descriptor
*/
#define WmlDataTypeDefValid 714210
typedef struct WmlSynDataTypeDefStruct
{
int validation; /* WmlDataTypeDefValid */
struct WmlDataTypeDefStruct
*rslvdef; /* resolved definition */
char *name; /* data type name */
char *int_lit; /* internal literal name */
char *docname; /* name for docs */
short int xrm_support; /* WmlAttributeTrue if can be
Xrm resource */
} WmlSynDataTypeDef, *WmlSynDataTypeDefPtr;
/*
* An enumeration set values descriptor, as it occurs in the list for
* an enumeration set descriptor.
*/
typedef struct WmlSynEnumSetValDefStruct
{
int validation; /* WmlEnumValueDefValid */
struct WmlSynEnumSetValDefStruct
*next; /* next descriptor in chain */
char *name; /* enumeration value name */
} WmlSynEnumSetValDef, *WmlSynEnumSetValDefPtr;
/*
* An enumeration set descriptor
*/
#define WmlEnumSetDefValid 931184
typedef struct WmlSynEnumSetDefStruct
{
int validation; /* WmlEnumSetDefValid */
struct WmlEnumSetDefStruct
*rslvdef; /* resolved definition */
char *name; /* enumeration set name */
char *datatype; /* enumeration set data type */
WmlSynEnumSetValDefPtr
values; /* list of values in set */
} WmlSynEnumSetDef, *WmlSynEnumSetDefPtr;
/*
* An enumeration value descriptor
*/
#define WmlEnumValueDefValid 172938
typedef struct WmlSynEnumValueDefStruct
{
int validation; /* WmlEnumValueDefValid */
struct WmlEnumValueDefStruct
*rslvdef; /* resolved definition */
char *name; /* enumeration value name */
char *enumlit; /* name of defining literal */
} WmlSynEnumValueDef, *WmlSynEnumValueDefPtr;
/*
* A charset descriptor
*/
#define WmlCharSetDefValid 110983
typedef struct WmlSynCharSetDefStruct
{
int validation; /* WmlCharSetDefValid */
struct WmlCharSetDefStruct
*rslvdef; /* resolved definition */
char *name; /* data type name */
char *int_lit; /* internal literal name */
char *xms_name; /* identifying XmString name */
short int direction; /* WmlCharSetDirection... */
short int parsedirection; /* WmlCharSetDirection... */
short int charsize; /* WmlCharSize... */
short int alias_cnt; /* alias count */
char **alias_list; /* vector of aliases */
} WmlSynCharSetDef, *WmlSynCharSetDefPtr;
/*
* Data structures constructed during semantic validation. Each points
* as required to syntactic data structures. These are typically accessed
* from ordered pointer vectors.
*/
/*
* A datatype descriptor. It extends the syntactic element by assigning
* a code to the descriptor.
*/
typedef struct WmlDataTypeDefStruct
{
struct WmlSynDataTypeDefStruct
*syndef; /* syntactic definition */
char *tkname; /* name for generating literals */
} WmlDataTypeDef, *WmlDataTypeDefPtr;
/*
* A charset descriptor. It extends the syntactic element by assigning
* a code to the descriptor.
*/
typedef struct WmlCharSetDefStruct
{
struct WmlSynCharSetDefStruct
*syndef; /* syntactic definition */
char *tkname; /* name for generating literals */
short int sym_code; /* code value for literals */
} WmlCharSetDef, *WmlCharSetDefPtr;
/*
* A child descriptor. It extends the syntactic element by assigning
* a code and a pointer to the class to the descriptor.
*/
typedef struct WmlChildDefStruct
{
struct WmlSynChildDefStruct
*syndef; /* syntactic definition */
char *tkname; /* name for generating literals */
short int sym_code; /* code value for literals */
struct WmlClassDefStruct
*class; /* class structure */
struct WmlClassChildDefStruct
*ref_ptr; /* used dynamically for search */
} WmlChildDef, *WmlChildDefPtr;
/*
* An element in the values list of an enumeration set. These elements have
* separate lists in order to deal with the possibility of an enumeration
* value which is a member of more than one list.
*/
typedef struct WmlEnumSetValDefStruct
{
struct WmlEnumSetValDefStruct
*next; /* next value in list */
struct WmlEnumValueDefStruct
*value; /* value descriptor for element */
} WmlEnumSetValDef, *WmlEnumSetValDefPtr;
/*
* A resolved enumeration set descriptor
*/
typedef struct WmlEnumSetDefStruct
{
struct WmlSynEnumSetDefStruct
*syndef; /* syntactic definition */
char *tkname; /* name for generating literals */
short int sym_code; /* code value for literals */
WmlDataTypeDefPtr dtype_def; /* data type */
short int values_cnt; /* count of # of values in set */
WmlEnumSetValDefPtr
values; /* list of values in set */
} WmlEnumSetDef, *WmlEnumSetDefPtr;
/*
* A resolved enumeration value descriptor
*/
typedef struct WmlEnumValueDefStruct
{
struct WmlSynEnumValueDefStruct
*syndef; /* syntactic definition */
short int sym_code; /* code value for literals */
} WmlEnumValueDef, *WmlEnumValueDefPtr;
/*
* A resource descriptor
*/
typedef struct WmlResourceDefStruct
{
struct WmlSynResourceDefStruct
*syndef; /* syntactic definition */
char *tkname; /* name for generating literals */
short int sym_code; /* code value for literals */
WmlDataTypeDefPtr dtype_def; /* data type for base definition */
WmlEnumSetDefPtr enumset_def; /* enumeration set if specified */
short int related_code; /* if non-0, the sym_code for the
related (count) argument */
short int xrm_support; /* if AttributeTrue, then the resource
can be set in Xrm. Resolved
from either explicit setting or
data type setting */
struct WmlClassDefStruct
*ref_class; /* used for membership sort */
struct WmlClassResDefStruct
*ref_ptr; /* used dynamically for search */
} WmlResourceDef, *WmlResourceDefPtr;
/*
* A resource descriptor with overrides which is a member of the resource
* list of a class descriptor.
*/
typedef struct WmlClassResDefStruct
{
struct WmlClassResDefStruct
*next; /* next resource in list */
WmlResourceDefPtr act_resource; /* actual resource descriptor */
WmlDataTypeDefPtr over_dtype; /* overriding data type */
char *dflt; /* overriding default */
int exclude; /* WmlAttributeTrue if to be excluded */
} WmlClassResDef, *WmlClassResDefPtr;
/*
* A child descriptor which is a member of the children
* list of a class descriptor.
*/
typedef struct WmlClassChildDefStruct
{
struct WmlClassChildDefStruct
*next; /* next child in list */
WmlChildDefPtr act_child; /* actual child descriptor */
} WmlClassChildDef, *WmlClassChildDefPtr;
/*
* An element for the controls list of a resolved class descriptor
*/
typedef struct WmlClassCtrlDefStruct
{
struct WmlClassCtrlDefStruct
*next; /* next control in list */
struct WmlClassDefStruct
*ctrl; /* class being controlled */
} WmlClassCtrlDef, *WmlClassCtrlDefPtr;
/*
* A resolved class descriptor. It has a pointer to its superclass, and
* a resource list consisting of its inherited resources followed by
* its own resources.
*/
typedef struct WmlClassDefStruct
{
struct WmlSynClassDefStruct
*syndef; /* syntactic definition */
struct WmlClassDefStruct
*superclass; /* superclass structure */
struct WmlClassDefStruct
*parentclass; /* parentclass structure */
char *tkname; /* name to be used in literals.
int_lit or name if no int_lit */
short int sym_code; /* code value for literals */
short int inherit_done; /* TRUE when inheritance complete */
WmlClassResDefPtr arguments; /* linked argument list */
WmlClassResDefPtr reasons; /* lined reason list */
WmlClassCtrlDefPtr controls; /* list of controlled classes.
Controls list references will
be expanded into this list. */
WmlClassChildDefPtr children; /* list of automatic children */
struct WmlClassDefStruct
*variant; /* the gadget class for a widget */
struct WmlClassDefStruct
*nondialog; /* the non-dialog ancestor of a
dialog widget */
WmlResourceDefPtr ctrlmapto; /* the resource controls map to */
struct WmlClassCtrlDefStruct
*ref_ptr; /* used dynamically for search */
} WmlClassDef, *WmlClassDefPtr;
/*
* A resolved controls list descriptor.
*/
typedef struct WmlCtrlListDefStruct
{
struct WmlSynCtrlListDefStruct
*syndef; /* syntactic definition */
WmlClassCtrlDefPtr controls; /* list of controlled classes */
} WmlCtrlListDef, *WmlCtrlListDefPtr;
/*
* Data structures used to locate and order objects in various ways.
*/
/*
* Token structure used to create ordered token lists for generation of
* UilKeyTab.h. The token string is in the order vector.
*/
typedef struct WmlKeyWTokenStruct
{
int class; /* token class, WmlTokenClass... */
ObjectPtr objdef; /* object definition (resolved) */
} WmlKeyWToken, *WmlKeyWTokenPtr;
/*
* A grammar token as obtained from the UIL grammar file (Uil.y)
*/
typedef struct WmlGrammarTokenStruct
{
int class; /* token class, WmlTokenClass... */
char *token; /* token name (literal) */
int val; /* token id as value */
} WmlGrammarToken, *WmlGrammarTokenPtr;
/*
* A list element which allows association of a name with an object.
* Typically used to construct ordered lists.
*/
typedef struct
{
char *objname; /* object name */
ObjectPtr objptr; /* the object */
} ObjectHandleDef, *ObjectHandleDefPtr;
/*
* A dynamic handle element list, extensible by malloc'ing more space.
*/
typedef struct
{
int cnt; /* # entries in use */
int max; /* max # entries available */
int ordered; /* TRUE if list is lexicographically
ordered by object name */
ObjectHandleDefPtr hvec; /* vector of handle entries */
} DynamicHandleListDef, *DynamicHandleListDefPtr;
/*
* Global declarations
*/
/*
* Defined in wml.c
*/
extern int wml_err_count; /* total errors */
extern int wml_line_count; /* lines read from input */
extern DynamicHandleListDefPtr
wml_synobj_ptr; /* syntactic object list */
extern DynamicHandleListDefPtr wml_obj_datatype_ptr;
extern DynamicHandleListDefPtr wml_obj_enumval_ptr;
extern DynamicHandleListDefPtr wml_obj_enumset_ptr;
extern DynamicHandleListDefPtr wml_obj_reason_ptr;
extern DynamicHandleListDefPtr wml_obj_arg_ptr;
extern DynamicHandleListDefPtr wml_obj_child_ptr;
extern DynamicHandleListDefPtr wml_obj_allclass_ptr;
extern DynamicHandleListDefPtr wml_obj_class_ptr;
extern DynamicHandleListDefPtr wml_obj_ctrlist_ptr;
extern DynamicHandleListDefPtr wml_obj_charset_ptr;
extern DynamicHandleListDefPtr wml_tok_sens_ptr;
extern DynamicHandleListDefPtr wml_tok_insens_ptr;
/*
* Defined in wmlutils.c
*/
extern char *wmlAllocateString (); /* dynamic string copy */
extern void wmlUpperCaseString (); /* convert to upper case */
extern void wmlInitHList (); /* init dynamic list */
extern void wmlResizeHList (); /* resize a list */
extern void wmlClearHList (); /* clear a list for reuse */
extern int wmlFindInHList (); /* find name in list */
extern void wmlInsertInHList (); /* generic list insert */
extern void wmlInsertInKeyList (); /* specialized list insert */
extern WmlClassResDefPtr wmlResolveResIsMember ();
/* is resource in class? */
extern WmlClassChildDefPtr wmlResolveChildIsMember ();
/* is child in class? */
/*
* Defined in wmlsynbld.c
*/
extern char yystringval[]; /* any string value */
extern char yynameval[]; /* any name (identifier) */
extern int yytknval1; /* terminal token value 1 */
extern int yytknval2; /* terminal token value 2 */
extern ObjectPtr wml_cur_obj; /* object being constructed */
extern ObjectPtr wml_cur_subobj; /* current subobject */
extern void wmlCreateClass ();
extern void wmlAddClassAttribute ();
extern void wmlAddClassResource ();
extern void wmlAddClassResourceAttribute ();
extern void wmlAddClassControl ();
extern void wmlAddCtrList ();
extern void wmlCreateResource ();
extern void wmlCreateDatatype ();
extern void wmlAddResourceAttribute ();
extern void wmlAddDatatypeAttribute ();
extern void wmlAddCtrListControl ();
extern void wmlCreateEnumSet ();
extern void wmlAddEnumSetValue ();
extern void wmlCreateEnumValue ();
extern void wmlAddEnumValueAttribute ();
extern void wmlCreateCharset ();
extern void wmlAddCharsetAttribute ();
extern void LexIssueError ();
/*
* Defined in wmlresolve.c
*/
extern void wmlResolveDescriptors ();
extern void wmlMarkReferencePointers ();
/*
* Defined in wmlouth.c
*/
extern void wmlOutputHFiles ();
/*
* Defined in wmloutdat.c
*/
extern void wmlOutputDatFiles ();
/*
* Define in wmloutp1 or wmloutp2
*/
extern void wmlOutput ();

View file

@ -1,686 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: wmldbcreate.c /main/8 1997/04/14 12:55:30 dbl $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
* This is the program creates binary databases from WML output.
*/
#include <stdio.h>
#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
#endif
#include <Mrm/MrmWidget.h>
#include <Xm/Xm.h>
#include <Xm/MwmUtil.h>
#include <Dt/Editor.h>
#include <Dt/Help.h>
#include <Dt/HelpDialog.h>
#include <Dt/HelpQuickD.h>
#include <Dt/MenuButton.h>
#include <Dt/Print.h>
#include <Dt/TermPrim.h>
#include <Dt/Term.h>
/*
* User supplied widget public.h and/or private.h files are to be added here
* #ifdef for automatic use in uilwmdcreate script file
*/
/*
* End of User supplied widget files
*/
#include "UilDBDef.h"
#include "UilLexPars.h"
#include "UilSymGen.h" /* from WML */
#include "UilSymArTy.h" /* from WML */
#include "UilSymRArg.h" /* from WML */
#include "UilSymArTa.h" /* from WML */
#include "UilSymReas.h" /* from WML */
#include "UilSymCtl.h" /* from WML */
#include "UilConst.h" /* from WML */
#include "UilSymNam.h" /* from WML */
#include "UilSymEnum.h" /* from WML */
#include "UilSymCSet.h" /* from WML */
#include "UilUrmClas.h" /* from WML */
#include "UilKeyTab.h" /* from WML */
#include "UilSymChCl.h" /* from WML */
#include "UilSymChTa.h" /* from WML */
void emit_globals();
void emit_header(_db_header_ptr header);
void emit_chars(int table_id);
void emit_ints_and_string( int table_id);
void emit_char_table( int table_id);
void emit_length_and_string( int table_id);
void emit_shorts( int table_id);
void emit_int_and_table_shorts( int table_id);
void emit_ints( int table_id);
FILE *bfile, *afile;
int DEBUG=FALSE;
char outfilename[80];
char debugfilename[80];
main(argc, argv)
int argc;
char **argv;
{
_db_header header;
strcpy(outfilename, "motif.wmd");
strcpy(debugfilename, "motif.dbg");
for (argc--, argv++; argc; argc--, argv++)
{
if (strcmp("-debug", *argv) == 0)
{
DEBUG=TRUE;
}
else if ((strcmp("-o", *argv) == 0))
{
strcpy(outfilename, argv[1]);
}
}
bfile = fopen(outfilename, "w");
if (bfile == (FILE *) NULL)
{
printf("\nCouldnt't open %s", outfilename);
exit (1);
}
if (DEBUG)
{
afile = fopen(debugfilename, "w");
if (afile == (FILE *) NULL)
{
printf("\nCouldn't open %s", debugfilename);
exit (1);
}
}
emit_globals();
/*
* UilConst
* UilSymArty
* UilSymCset - parts of it
* UilSymChCl
*/
emit_chars(Constraint_Tab);
emit_chars(Argument_Type_Table_Value);
emit_chars(Charset_Wrdirection_Table);
emit_chars(Charset_Parsdirection_Table);
emit_chars(Charset_Charsize_Table);
emit_chars(Child_Class_Table);
/*
* UilKeyTab
*/
emit_ints_and_string (Key_Table);
emit_ints_and_string (Key_Table_Case_Ins);
/*
* UilSymArTa
* UilSymCtl
* UilSymReas
* UilSymChTa
*/
emit_char_table (Allowed_Argument_Table);
emit_char_table (Allowed_Control_Table);
emit_char_table (Allowed_Reason_Table);
emit_char_table (Allowed_Child_Table);
/*
* UilSymCset
* UilSymNam
* UilUrmClas
*/
emit_length_and_string (Charset_Xmstring_Names_Table);
emit_length_and_string (Charset_Lang_Names_Table);
emit_length_and_string (Uil_Widget_Names);
emit_length_and_string (Uil_Argument_Names);
emit_length_and_string (Uil_Reason_Names);
emit_length_and_string (Uil_Enumval_names);
emit_length_and_string (Uil_Charset_Names);
emit_length_and_string (Uil_Widget_Funcs);
emit_length_and_string (Uil_Argument_Toolkit_Names);
emit_length_and_string (Uil_Reason_Toolkit_Names);
emit_length_and_string (Uil_Children_Names);
/*
* UilSymCset
* UilSymEnum
* UilSymRArg
* UilUrmClas
*/
emit_shorts (Charset_Lang_Codes_Table);
emit_shorts (Argument_Enum_Set_Table);
emit_shorts (Related_Argument_Table);
emit_shorts (Uil_Gadget_Funcs);
emit_shorts (Uil_Urm_Nondialog_Class);
emit_shorts (Uil_Urm_Subtree_Resource);
/*
* UilSymEnum
*/
emit_int_and_table_shorts(Enum_Set_Table);
/*
* UilSymEnum
*/
emit_ints (Enumval_Values_Table);
exit (0);
}
void emit_globals()
{
_db_globals globals;
globals.version = DB_Compiled_Version;
globals.uil_max_arg = uil_max_arg;
globals.uil_max_charset = uil_max_charset;
globals.charset_lang_table_max = charset_lang_table_max;
globals.uil_max_object = uil_max_object;
globals.uil_max_reason = uil_max_reason;
globals.uil_max_enumval = uil_max_enumval;
globals.uil_max_enumset = uil_max_enumset;
globals.key_k_keyword_count = key_k_keyword_count;
globals.key_k_keyword_max_length = key_k_keyword_max_length;
globals.uil_max_child = uil_max_child;
fwrite (&globals, sizeof (_db_globals), 1, bfile);
if (DEBUG)
fprintf(afile, "%d %d %d %d %d %d %d %d %d %d ", globals.version,
globals.uil_max_arg, globals.uil_max_charset,
globals.charset_lang_table_max, globals.uil_max_object,
globals.uil_max_reason, globals.uil_max_enumval,
globals.uil_max_enumset, globals.key_k_keyword_count,
globals.key_k_keyword_max_length);
}
void emit_header(header)
_db_header_ptr header;
{
fwrite (header, sizeof(_db_header), 1, bfile);
if (DEBUG)
fprintf(afile,
"\n\nTableId=%d, NumEntries=%d, TableSize=%d \n",
header->table_id, header->num_items, header->table_size);
}
void emit_chars(table_id)
int table_id;
{
_db_header header;
unsigned char *ptr;
int i;
switch (table_id)
{
case Constraint_Tab:
/*
* NOTE: The first entry is not used but we copy it anyway
*/
header.table_size = sizeof(constraint_tab_vec);
header.num_items = header.table_size;
header.table_id = Constraint_Tab;
ptr = constraint_tab;
break;
case Argument_Type_Table_Value:
/*
* NOTE: The first entry is not used but we copy it anyway
*/
header.table_size = sizeof(argument_type_table_vec);
header.num_items = header.table_size;
header.table_id = Argument_Type_Table_Value;
ptr = argument_type_table;
break;
case Charset_Wrdirection_Table:
/*
* NOTE: The first entry is not used but we copy it anyway
*/
header.table_size = sizeof(charset_wrdirection_table_vec);
header.num_items = header.table_size;
header.table_id = Charset_Wrdirection_Table;
ptr = charset_writing_direction_table;
break;
case Charset_Parsdirection_Table:
/*
* NOTE: The first entry is not used but we copy it anyway
*/
header.table_size = sizeof(charset_parsdirection_table_vec);
header.num_items = header.table_size;
header.table_id = Charset_Parsdirection_Table;
ptr = charset_parsing_direction_table;
break;
case Charset_Charsize_Table:
/*
* NOTE: The first entry is not used but we copy it anyway
*/
header.table_size = sizeof(charset_charsize_table_vec);
header.num_items = header.table_size;
header.table_id = Charset_Charsize_Table;
ptr = charset_character_size_table;
break;
case Child_Class_Table:
/*
* NOTE: The first entry is not used but we copy it anyway
*/
header.table_size = sizeof(child_class_table_vec);
header.num_items = header.table_size;
header.table_id = Child_Class_Table;
ptr = child_class_table;
break;
}
emit_header(&header);
fwrite (ptr, header.table_size, 1, bfile);
if (DEBUG)
{
for (i=0; i<=header.num_items; i++)
{
fprintf(afile, "%d ", ptr[i]);
}
}
}
void emit_ints_and_string(table_id)
int table_id;
{
_db_header header;
key_keytable_entry_type *table;
int i;
switch (table_id)
{
/*
* All tables are zero based unless otherwise noted
*/
case Key_Table:
header.table_size = sizeof(key_table_vec);
header.num_items = key_k_keyword_count;
header.table_id = Key_Table;
table = key_table;
break;
case Key_Table_Case_Ins:
header.table_size = sizeof(key_table_case_ins_vec);
header.num_items = key_k_keyword_count;
header.table_id = Key_Table_Case_Ins;
table = key_table_case_ins;
break;
}
emit_header(&header);
fwrite (table, header.table_size, 1, bfile);
for (i=0; i<header.num_items; i++)
{
fwrite (table[i].at_name, table[i].b_length + 1, 1, bfile);
if (DEBUG)
fprintf (afile, "%d %d %d %d %s", table[i].b_class, table[i].b_subclass,
table[i].b_length, table[i].b_token, table[i].at_name);
}
}
void emit_char_table(table_id)
int table_id;
{
unsigned char **table;
_db_header header;
unsigned char *entry_vec;
int i, j;
int num_bits = (uil_max_object + 7) / 8;
switch (table_id)
{
/*
* All tables are 1 based unless otherwise specified
*/
case Allowed_Argument_Table:
header.table_size = sizeof(allowed_argument_table_vec);
header.num_items = uil_max_arg;
header.table_id = Allowed_Argument_Table;
table = allowed_argument_table;
break;
case Allowed_Control_Table:
header.table_size = sizeof(allowed_control_table_vec);
header.num_items = uil_max_object;
header.table_id = Allowed_Control_Table;
table = allowed_control_table;
break;
case Allowed_Reason_Table:
header.table_size = sizeof(allowed_reason_table_vec);
header.num_items = uil_max_reason;
header.table_id = Allowed_Reason_Table;
table = allowed_reason_table;
break;
case Allowed_Child_Table:
header.table_size = sizeof(allowed_child_table_vec);
header.num_items = uil_max_child;
header.table_id = Allowed_Child_Table;
table = allowed_child_table;
break;
}
emit_header(&header);
for (i=1; i<=header.num_items; i++) /* First not used */
{
entry_vec = table[i];
fwrite (entry_vec, sizeof (char) * num_bits, 1, bfile);
if (DEBUG)
{
for (j=0; j<num_bits; j++)
{
fprintf (afile, "%d, ", entry_vec[j]);
}
fprintf (afile, "\n");
}
}
}
void emit_length_and_string(table_id)
int table_id;
{
_db_header header;
int *lengths;
char *string_table;
char **table;
int i;
switch (table_id)
{
/*
* all the tables are 1 based unless otherwise documented
*/
case Charset_Xmstring_Names_Table:
header.table_size = sizeof(charset_xmstring_names_table_vec);
header.num_items = uil_max_charset;
header.table_id = Charset_Xmstring_Names_Table;
table = charset_xmstring_names_table;
break;
case Charset_Lang_Names_Table:
/*
* This table is 0 based
*/
header.table_size = sizeof(charset_lang_names_table_vec);
header.num_items = charset_lang_table_max - 1;
header.table_id = Charset_Lang_Names_Table;
table = charset_lang_names_table;
break;
case Uil_Widget_Names:
header.table_size = sizeof(uil_widget_names_vec);
header.num_items = uil_max_object;
header.table_id = Uil_Widget_Names;
table = uil_widget_names ;
break;
case Uil_Argument_Names:
header.table_size = sizeof(uil_argument_names_vec);
header.num_items = uil_max_arg;
header.table_id = Uil_Argument_Names;
table = uil_argument_names;
break;
case Uil_Reason_Names:
header.table_size = sizeof(uil_reason_names_vec);
header.num_items = uil_max_reason;
header.table_id = Uil_Reason_Names;
table = uil_reason_names;
break;
case Uil_Enumval_names:
header.table_size = sizeof(uil_enumval_names_vec);
header.num_items = uil_max_enumval;
header.table_id = Uil_Enumval_names;
table = uil_enumval_names;
break;
case Uil_Charset_Names:
header.table_size = sizeof(uil_charset_names_vec);
header.num_items = uil_max_charset;
header.table_id = Uil_Charset_Names;
table = uil_charset_names;
break;
case Uil_Widget_Funcs:
header.table_size = sizeof(uil_widget_funcs_vec);
header.num_items = uil_max_object;
header.table_id = Uil_Widget_Funcs;
table = uil_widget_funcs;
break;
case Uil_Argument_Toolkit_Names:
header.table_size = sizeof(uil_argument_toolkit_names_vec);
header.num_items = uil_max_arg;
header.table_id = Uil_Argument_Toolkit_Names;
table = uil_argument_toolkit_names;
break;
case Uil_Reason_Toolkit_Names:
header.table_size = sizeof(uil_reason_toolkit_names_vec);
header.num_items = uil_max_reason;
header.table_id = Uil_Reason_Toolkit_Names;
table = uil_reason_toolkit_names;
break;
case Uil_Children_Names:
header.table_size = sizeof(uil_child_names_vec);
header.num_items = uil_max_child;
header.table_id = Uil_Children_Names;
table = uil_child_names ;
break;
}
emit_header(&header);
lengths = (int *) malloc (sizeof (int) * (header.num_items + 1));
for (i=0; i<=header.num_items; i++)
{
if (table[i] != NULL)
{
/*
* Add one to the length for the null terminator
*/
lengths[i] = strlen(table[i]) + 1;
}
else
{
lengths[i] = 0;
}
if (DEBUG)
fprintf (afile, "%d ", lengths[i]);
}
fwrite (lengths, sizeof (int) * (header.num_items + 1), 1, bfile);
for (i=0; i<=header.num_items; i++)
{
if (lengths[i])
{
/*
* assumed lengths[i] = lengths[i] * sizeof(char)
* Add one for the null terminator
*/
fwrite (table[i], lengths[i] + 1, 1, bfile);
if (DEBUG)
fprintf (afile, "%s ", table[i]);
}
}
free (lengths);
}
void emit_shorts(table_id)
int table_id;
{
_db_header header;
unsigned short int *ptr;
int i;
switch (table_id)
{
/*
* All tables are 1 based unless otherwise noted
*/
case Charset_Lang_Codes_Table:
/*
* 0 based table
*/
header.table_size = sizeof(charset_lang_codes_table_vec);
header.num_items = charset_lang_table_max - 1;
header.table_id = Charset_Lang_Codes_Table;
ptr = charset_lang_codes_table;
break;
case Argument_Enum_Set_Table:
header.table_size = sizeof(argument_enumset_table_vec);
header.num_items = uil_max_arg;
header.table_id = Argument_Enum_Set_Table;
ptr = argument_enumset_table;
break;
case Related_Argument_Table:
header.table_size = sizeof(related_argument_table_vec);
header.num_items = uil_max_arg;
header.table_id = Related_Argument_Table;
ptr = related_argument_table;
break;
case Uil_Gadget_Funcs:
header.table_size = sizeof(uil_gadget_variants_vec);
header.num_items = uil_max_object;
header.table_id = Uil_Gadget_Funcs;
ptr = uil_gadget_variants;
break;
case Uil_Urm_Nondialog_Class:
header.table_size = sizeof(uil_urm_nondialog_class_vec);
header.num_items = uil_max_object;
header.table_id = Uil_Urm_Nondialog_Class;
ptr = uil_urm_nondialog_class;
break;
case Uil_Urm_Subtree_Resource:
header.table_size = sizeof(uil_urm_subtree_resource_vec);
header.num_items = uil_max_object;
header.table_id = Uil_Urm_Subtree_Resource;
ptr = uil_urm_subtree_resource;
break;
}
emit_header(&header);
fwrite (ptr, header.table_size, 1, bfile);
if (DEBUG)
{
for (i=0; i<header.num_items; i++)
{
fprintf(afile, "%d ", ptr[i]);
}
}
}
void emit_int_and_table_shorts(table_id)
int table_id;
{
_db_header header;
UilEnumSetDescDef *table;
int j, i;
unsigned short int *value_vec;
switch (table_id)
{
/*
* All tables are 1 based unless otherwise noted
*/
case Enum_Set_Table:
header.table_size = sizeof(enum_set_table_vec);
header.num_items = uil_max_enumset;
header.table_id = Enum_Set_Table;
table = enum_set_table;
break;
}
emit_header(&header);
fwrite (table, header.table_size, 1, bfile);
for (i=0; i<=header.num_items; i++) /* first is not used */
{
if (table[i].values_cnt)
{
fwrite (table[i].values, sizeof (short) * table[i].values_cnt, 1, bfile);
}
}
}
void emit_ints(table_id)
int table_id;
{
_db_header header;
int *ptr;
int i;
switch (table_id)
/*
* all tables are 1 based unless otherwise noted
*/
{
case Enumval_Values_Table:
header.table_size = sizeof(enumval_values_table_vec);
header.num_items = uil_max_enumval;
header.table_id = Enumval_Values_Table;
ptr = enumval_values_table;
break;
}
emit_header(&header);
fwrite (ptr, header.table_size, 1, bfile);
if (DEBUG)
{
for (i=0; i<header.num_items; i++)
{
fprintf(afile, "%d ", ptr[i]);
}
}
}

View file

@ -1,127 +0,0 @@
%{
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#if defined(__STDC__)
#include <string.h>
#endif
#ifndef XmConst
#if (defined(__STDC__) && __STDC__) || !defined( NO_CONST )
#define XmConst const
#else
#define XmConst
#endif /* __STDC__ */
#endif /* XmConst */
#ifdef YY_BUFFER_SIZE
#define BUF_SIZE YY_BUFFER_SIZE
#else
#define BUF_SIZE 8192
#endif
char yystringval[BUF_SIZE]; /* any string value */
char yynameval[BUF_SIZE]; /* any identifier (name) */
int yytknval1; /* terminal token value 1 */
int yytknval2; /* terminal token value 2 */
%}
%p 3000
%%
[ \t\f] {}
[\n] { wml_line_count += 1; }
"Class" { return CLASS; }
"Resource" { return RESOURCE; }
"DataType" { return DATATYPE; }
"ControlList" { return CONTROLLIST; }
"EnumerationSet" { return ENUMERATIONSET; }
"EnumerationValue" { return ENUMERATIONVALUE; }
"CharacterSet" { return CHARACTERSET; }
"Child" { return CHILD; }
"DocName" { return DOCNAME; }
"ConvenienceFunction" { return CONVFUNC; }
"Alias" { return ALIAS; }
"Type" { return TYPE; }
"ResourceLiteral" { return RESOURCELITERAL; }
"Related" { return RELATED; }
"InternalLiteral" { return INTERNALLITERAL; }
"Constraint" { return CONSTRAINT; }
"Exclude" { return EXCLUDE;}
"Resources" { return RESOURCES; }
"SuperClass" { return SUPERCLASS; }
"ParentClass" { return PARENTCLASS; }
"Controls" { return CONTROLS; }
"WidgetClass" { return WIDGETCLASS; }
"DialogClass" { return DIALOGCLASS; }
"Default" { return DEFAULT; }
"EnumLiteral" { return ENUMLITERAL; }
"XmStringCharsetName" { return XMSTRINGCHARSETNAME; }
"FontListElementTag" { return XMSTRINGCHARSETNAME; }
"Direction" { return DIRECTION; }
"ParseDirection" { return PARSEDIRECTION; }
"CharacterSize" { return CHARACTERSIZE; }
"ControlsMapToResource" { return CTRLMAPSRESOURCE; }
"Children" { return CHILDREN; }
"MetaClass" { return METACLASS;}
"Widget" { return WIDGET;}
"Gadget" { return GADGET;}
"Argument" { return ARGUMENT;}
"Reason" { return REASON;}
"Constraint" { return CONSTRAINT;}
"SubResource" { return SUBRESOURCE;}
"True" { return ATTRTRUE; }
"False" { return ATTRFALSE; }
"LeftToRight" { return LEFTTORIGHT; }
"RightToLeft" { return RIGHTTOLEFT; }
"OneByte" { return ONEBYTE; }
"TwoByte" { return TWOBYTE; }
"MixedOneAndTwoByte" { return MIXED1_2BYTE; }
":" { return COLON; }
";" { return SEMICOLON; }
"=" { return EQUALS; }
"{" { return LBRACE; }
"}" { return RBRACE; }
"!"[^\n]* {}
"#"[^\n]* {}
[a-zA-Z_][a-zA-Z0-9$_]* { /* string without quotes */
strcpy (yystringval, (XmConst char *) yytext);
return STRING;
}
\"[^"\n]*\\ { /* escaped character in the string */
yymore();
}
\"[^"\n]*\" { /* String in quotes */
strncpy(yystringval, (XmConst char *) yytext+1, yyleng - 2);
yystringval[yyleng-2] = '\0' ;
return STRING;
}
\"[^"\n]* {
printf ("\nUnterminated string near %s, line %d",
yytext, wml_line_count);
return ERRORTOKEN;
}
. {
printf ("\nEncountered illegal character '%c', line %d",
yytext[0], wml_line_count);
return ERRORTOKEN;
}

File diff suppressed because it is too large Load diff

View file

@ -1,834 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: wmloutkey.c /main/8 1997/04/14 12:55:51 dbl $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
* This module contains routines responsible for writing the .h files which
* define the UIL lexer's keyword (token) tables. All files are written
* into the current directory.
*
* Input:
* The resolved objects
* .dat files required to specify objects defined in Uil.y:
* keyword.dat
* reserved.dat
*
* Output:
* UilKeyTab.h
*
*/
#include "wml.h"
#if defined(__STDC__)
#include <stdlib.h>
#include <string.h>
#endif
#include <stdio.h>
/*
* Routines used only in this module
*/
void wmlKeyWBuildTables ();
void wmlKeyWClassTokens ();
void wmlKeyWGrammarTokens ();
int wmlKeyWGrammarClass ();
void wmlKeyWArgTokens ();
void wmlKeyWReasonTokens ();
void wmlKeyWCharsetTokens ();
void wmlKeyWEnumvalTokens ();
void wmlKeyWChildTokens ();
void wmlKeyWMakeTokens ();
void wmlOutputUilKeyTab ();
void wmlOutputUilKeyTabBody ();
void wmlTokenClassString ();
void wmlTokenSymKString ();
void wmlTokenTokenString ();
void wmlOutputUilTokName ();
/*
* globals
*/
static char *canned_warn =
"/*\n\
**\tThis file is automatically generated. Do not edit it by hand.\n\
**/\n\n";
#define GrTokenMax 200 /* limit on grammar tokens */
static int grtok_max_val = 0;
static WmlGrammarTokenPtr grtok_vec[GrTokenMax];
/*
* Output control routine
*/
void wmlOutputKeyWordFiles ()
{
wmlKeyWBuildTables ();
wmlOutputUilKeyTab ();
wmlOutputUilTokName ();
}
/*
* Routine to construct token tables for building UilKeyTab.h
*
* This routine constructs token entries for each token class which appears
* in UilKeyTab.h (the token classes are defined in UilKeyDef.h). These
* tokens are defined both by WML objects in object vectors, and by
* tokens defined in Uil.y.
*/
void wmlKeyWBuildTables ()
{
int ndx;
/*
* Initialize the token vectors
*/
wmlInitHList (wml_tok_sens_ptr, 1000, TRUE);
wmlInitHList (wml_tok_insens_ptr, 1000, TRUE);
for ( ndx=0 ; ndx<GrTokenMax ; ndx++ )
grtok_vec[ndx] = NULL;
/*
* Read and enter the tokens from Uil.y (via tokens.dat)
*/
wmlKeyWGrammarTokens ();
/*
* Enter the class, argument, reason, charset, child, and enumval tokens
*/
wmlKeyWClassTokens ();
wmlKeyWArgTokens ();
wmlKeyWReasonTokens ();
wmlKeyWCharsetTokens ();
wmlKeyWEnumvalTokens ();
wmlKeyWChildTokens ();
}
/*
* Routine to read and enter tokens defined in Uil.y into the token tables.
*/
void wmlKeyWGrammarTokens ()
{
FILE *infil; /* input file (tokens.dat) */
int scanres; /* result of fscanf */
int lineno = 1; /* current line number */
char token[100]; /* current token */
char class[100]; /* current class */
int tokval; /* current token id (as value) */
WmlGrammarTokenPtr grtok; /* new grammar token */
int ndx;
char sens_name[100]; /* for case-insensitive name */
/*
* Read tokens.dat. Recognize and save all tokens. Some are saved in the
* global tokens vector so they will be put into UilKeyTab.h. All are
* saved in an ordered vector to write UilTokName.h
*
* Special handling is required for tokens whose yacc definition conflicts
* with common literals. In these cases, the token literal does not map
* directly to its keyword in the language, and must be mapped as a special
* case:
* UILTRUE -> true/TRUE
* UILFALSE -> false/FALSE
* UILfile -> file/FILE
* UILeof -> eof/EOF
*/
infil = fopen ("tokens.dat", "r");
if ( infil == NULL )
{
printf ("\nCouldn't open tokens.dat");
return;
}
while ( TRUE )
{
scanres = fscanf (infil, "%s %d %s", token, &tokval, class);
if ( scanres == EOF ) break;
if ( scanres != 3 )
{
printf ("\nBadly formatted at line %d in tokens.dat", lineno);
continue;
}
lineno += 1;
/*
* Convert the token class, and construct a grammar token.
*/
grtok = (WmlGrammarTokenPtr) malloc(sizeof(WmlGrammarToken));
grtok->class = wmlKeyWGrammarClass (class);
grtok->token = wmlAllocateString (token);
grtok->val = tokval;
/*
* Save the token in the grammar token vector, indexed by its value
* (for UilTokName.h)
*/
if ( grtok->val < GrTokenMax )
{
grtok_vec[grtok->val] = grtok;
if ( grtok->val > grtok_max_val )
grtok_max_val = grtok->val;
}
else
printf ("\nToken id %d for %s exceed GrTokenMax",
grtok->val, grtok->token);
/*
* Enter tokens which appear in the keyword tables as keyword tokens.
* These have their lower case names entered as the case-insensitive
* keyword token string. Do special token literal mapping.
*/
switch ( grtok->class )
{
case WmlTokenClassKeyword:
case WmlTokenClassReserved:
strcpy (sens_name, grtok->token);
for ( ndx=0 ; ndx<(int)strlen(sens_name) ; ndx++ )
sens_name[ndx] = _lower(sens_name[ndx]);
if ( strcmp(sens_name,"uiltrue") == 0 )
strcpy (sens_name, "true");
if ( strcmp(sens_name,"uilfalse") == 0 )
strcpy (sens_name, "false");
if ( strcmp(sens_name,"uilfile") == 0 )
strcpy (sens_name, "file");
if ( strcmp(sens_name,"uileof") == 0 )
strcpy (sens_name, "eof");
wmlKeyWMakeTokens (sens_name, grtok->class, (ObjectPtr)grtok);
}
}
fclose (infil);
}
/*
* This routine translates a string identifying a token class into
* its matching internal literal.
*/
int wmlKeyWGrammarClass (token)
char *token;
{
if ( strcmp(token,"argument") == 0 )
return WmlTokenClassArgument;
if ( strcmp(token,"charset") == 0 )
return WmlTokenClassCharset;
if ( strcmp(token,"color") == 0 )
return WmlTokenClassColor;
if ( strcmp(token,"enumval") == 0 )
return WmlTokenClassEnumval;
if ( strcmp(token,"font") == 0 )
return WmlTokenClassFont;
if ( strcmp(token,"identifier") == 0 )
return WmlTokenClassIdentifier;
if ( strcmp(token,"keyword") == 0 )
return WmlTokenClassKeyword;
if ( strcmp(token,"literal") == 0 )
return WmlTokenClassLiteral;
if ( strcmp(token,"reason") == 0 )
return WmlTokenClassReason;
if ( strcmp(token,"reserved") == 0 )
return WmlTokenClassReserved;
if ( strcmp(token,"special") == 0 )
return WmlTokenClassSpecial;
if ( strcmp(token,"unused") == 0 )
return WmlTokenClassUnused;
if ( strcmp(token,"class") == 0 )
return WmlTokenClassClass;
if (strcmp(token,"child") == 0) return WmlTokenClassChild;
printf ("\nUnrecognized token class %s", token);
return 0;
}
/*
* Routine to process the class objects and enter them in the token tables.
* Aliases are also entered, under their own names.
*/
void wmlKeyWClassTokens ()
{
int ndx; /* loop index */
WmlClassDefPtr clsobj; /* class object */
WmlSynClassDefPtr synobj; /* syntactic object */
/*
* Make tokens for all class entries
*/
for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
{
clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
synobj = clsobj->syndef;
wmlKeyWMakeTokens (synobj->name, WmlTokenClassClass, (ObjectPtr)clsobj);
}
}
/*
* Routine to process the argument objects and enter them in the token tables.
* Aliases are also entered, under their own names.
*/
void wmlKeyWArgTokens ()
{
int ndx; /* loop index */
WmlResourceDefPtr resobj; /* resource object */
WmlSynResourceDefPtr synobj; /* syntactic object */
int alias_ndx; /* alias loop index */
/*
* Make tokens for all argument entries
*/
for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
{
resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
synobj = resobj->syndef;
wmlKeyWMakeTokens (synobj->name, WmlTokenClassArgument, (ObjectPtr)resobj);
for ( alias_ndx=0 ; alias_ndx<synobj->alias_cnt ; alias_ndx++ )
wmlKeyWMakeTokens (synobj->alias_list[alias_ndx],
WmlTokenClassArgument,
(ObjectPtr)resobj);
}
}
/*
* Routine to process the reason objects and enter them in the token tables.
*/
void wmlKeyWReasonTokens ()
{
int ndx; /* loop index */
WmlResourceDefPtr resobj; /* resource object */
WmlSynResourceDefPtr synobj; /* syntactic object */
int alias_ndx; /* alias loop index */
/*
* Make tokens for all reason entries
*/
for ( ndx=0 ; ndx<wml_obj_reason_ptr->cnt ; ndx++ )
{
resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr;
synobj = resobj->syndef;
wmlKeyWMakeTokens (synobj->name, WmlTokenClassReason, (ObjectPtr)resobj);
for ( alias_ndx=0 ; alias_ndx<synobj->alias_cnt ; alias_ndx++ )
wmlKeyWMakeTokens (synobj->alias_list[alias_ndx],
WmlTokenClassReason,
(ObjectPtr)resobj);
}
}
/*
* Routine to process the child objects and enter them in the token tables.
*/
void wmlKeyWChildTokens ()
{
int ndx; /* loop index */
WmlChildDefPtr childobj; /* child object */
WmlSynChildDefPtr synobj; /* syntactic object */
/*
* Make tokens for all child entries
*/
for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
{
childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
synobj = childobj->syndef;
wmlKeyWMakeTokens (synobj->name, WmlTokenClassChild, (ObjectPtr)childobj);
}
}
/*
* Routine to process the charset objects and enter them in the token tables.
*/
void wmlKeyWCharsetTokens ()
{
int ndx; /* loop index */
WmlCharSetDefPtr csobj; /* character set object */
WmlSynCharSetDefPtr synobj; /* syntactic object */
int alias_ndx; /* alias loop index */
/*
* Make tokens for all charset entries
*/
for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
{
csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
synobj = csobj->syndef;
wmlKeyWMakeTokens (synobj->name, WmlTokenClassCharset, (ObjectPtr)csobj);
for ( alias_ndx=0 ; alias_ndx<synobj->alias_cnt ; alias_ndx++ )
wmlKeyWMakeTokens (synobj->alias_list[alias_ndx],
WmlTokenClassCharset,
(ObjectPtr)csobj);
}
}
/*
* Routine to process the enumval objects and enter them in the token tables.
*/
void wmlKeyWEnumvalTokens ()
{
int ndx; /* loop index */
WmlEnumValueDefPtr esobj; /* enumeration value object */
WmlSynEnumValueDefPtr synobj; /* syntactic object */
/*
* Make tokens for all enumval entries
*/
for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
{
esobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
synobj = esobj->syndef;
wmlKeyWMakeTokens (synobj->name, WmlTokenClassEnumval, (ObjectPtr)esobj);
}
}
/*
* Routine to create tokens and enter them in the token list.
*
* This routine constructs a case-sensitive and a case-insensitive token
* and enters them the token vectors.
*/
void wmlKeyWMakeTokens (sens_name, class, obj)
char *sens_name;
int class;
ObjectPtr obj;
{
WmlKeyWTokenPtr senstok; /* case-sensitive token */
WmlKeyWTokenPtr insenstok; /* case-insensitive token */
char insens_name[100];
int ndx;
/*
* Create both tokens, with one having an upper-case name. The names are
* entered only in the order vector, not in the token itself.
*/
senstok = (WmlKeyWTokenPtr) malloc (sizeof(WmlKeyWToken));
insenstok = (WmlKeyWTokenPtr) malloc (sizeof(WmlKeyWToken));
senstok->class = class;
senstok->objdef = obj;
insenstok->class = class;
insenstok->objdef = obj;
strcpy (insens_name, sens_name);
for ( ndx=0 ; ndx<(int)strlen(insens_name) ; ndx++ )
insens_name[ndx] = _upper (insens_name[ndx]);
wmlInsertInKeyList(wml_tok_sens_ptr, sens_name, senstok);
wmlInsertInKeyList(wml_tok_insens_ptr, insens_name, insenstok);
}
/*
* Routine to output UilKeyTab.h
*
* This routine dumps the tokens defined in the token tables into
* UilKeyTab.h. Both the case-sensitive and case-insensitive token
* lists are used.
*/
void wmlOutputUilKeyTab ()
{
char *canned1 =
"\n/* case sensitive keyword table */\n\
static key_keytable_entry_type key_table_vec[] =\n\
{\n";
char *canned2 =
" };\n\
externaldef(uil_sym_glbl) key_keytable_entry_type *key_table =\n\
\t\tkey_table_vec;\n\n\
/* Maximum length of a keyword, and table size */\n\
externaldef(uil_sym_glbl) int key_k_keyword_max_length = %d;\n\
externaldef(uil_sym_glbl) int key_k_keyword_count = %d;\n\n\
/* case insensitive keyword table */\n\
static key_keytable_entry_type key_table_case_ins_vec[] =\n\
{\n";
char *canned3 =
" };\n\
externaldef(uil_sym_glbl) key_keytable_entry_type *key_table_case_ins =\n\
\t\tkey_table_case_ins_vec;\n";
FILE *outfil; /* output file */
int ndx; /* loop index */
int maxlen = 0; /* max keyword length */
int maxkey = 0; /* # entries in keyword table */
/*
* Open the output file.
*/
outfil = fopen ("UilKeyTab.h", "w");
if ( outfil == NULL )
{
printf ("\nCouldn't open UilKeyTab.h");
return;
}
fprintf (outfil, canned_warn);
/*
* Print the case sensitive and insensitive tables
*/
fprintf (outfil, canned1);
wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey);
fprintf (outfil, canned2, maxlen, maxkey);
wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey);
fprintf (outfil, canned3);
/*
* close the output file
*/
printf ("\nCreated UilKeyTab.h");
fclose (outfil);
}
/*
* Routine to output the body of a keyword table
*/
void wmlOutputUilKeyTabBody (outfil, tokvec, maxlen, maxkey)
FILE *outfil;
DynamicHandleListDefPtr tokvec;
int *maxlen;
int *maxkey;
{
int ndx; /* loop index */
WmlKeyWTokenPtr tok; /* current token */
char *tokstg; /* string for token (keyword) */
char tkclass[100]; /* token class string */
char tksym[100]; /* token sym_k string */
char tktoken[100]; /* token tkn_k_num string */
/*
* Loop over all tokens, and put out an entry for each.
*/
for ( ndx=0 ; ndx<tokvec->cnt ; ndx++ )
{
tok = (WmlKeyWTokenPtr) tokvec->hvec[ndx].objptr;
tokstg = tokvec->hvec[ndx].objname;
wmlTokenClassString (tkclass, tok);
wmlTokenSymKString (tksym, tok);
wmlTokenTokenString (tktoken, tok);
fprintf (outfil, " {%s, %s, %d, %s, \"%s\"},\n",
tkclass,
tksym,
strlen(tokstg),
tktoken,
tokstg);
if ( (int)strlen(tokstg) > *maxlen )
*maxlen = strlen (tokstg);
*maxkey += 1;
}
}
/*
* Routine to return the string for a token class, tkn_k_class_...
*/
void wmlTokenClassString (dststg, tok)
char *dststg;
WmlKeyWTokenPtr tok;
{
switch ( tok->class )
{
case WmlTokenClassArgument:
strcpy (dststg, "tkn_k_class_argument");
return;
case WmlTokenClassCharset:
strcpy (dststg, "tkn_k_class_charset");
return;
case WmlTokenClassEnumval:
strcpy (dststg, "tkn_k_class_enumval");
return;
case WmlTokenClassKeyword:
strcpy (dststg, "tkn_k_class_keyword");
return;
case WmlTokenClassReason:
strcpy (dststg, "tkn_k_class_reason");
return;
case WmlTokenClassReserved:
strcpy (dststg, "tkn_k_class_reserved");
return;
case WmlTokenClassClass:
strcpy (dststg, "tkn_k_class_class");
return;
case WmlTokenClassChild:
strcpy (dststg, "tkn_k_class_child");
return;
}
}
/*
* Routine to return the string for a sym_k_... for some object
*/
void wmlTokenSymKString (dststg, tok)
char *dststg;
WmlKeyWTokenPtr tok;
{
WmlClassDefPtr clsobj; /* class object */
WmlResourceDefPtr resobj; /* resource object */
WmlCharSetDefPtr csobj; /* character set object */
WmlEnumValueDefPtr esobj; /* enumeration value object */
WmlChildDefPtr chobj; /* child object */
switch ( tok->class )
{
case WmlTokenClassArgument:
resobj = (WmlResourceDefPtr) tok->objdef;
sprintf (dststg, "sym_k_%s_arg", resobj->tkname);
return;
case WmlTokenClassCharset:
csobj = (WmlCharSetDefPtr) tok->objdef;
sprintf (dststg, "sym_k_%s_charset", csobj->syndef->name);
return;
case WmlTokenClassEnumval:
esobj = (WmlEnumValueDefPtr) tok->objdef;
sprintf (dststg, "sym_k_%s_enumval", esobj->syndef->name);
return;
case WmlTokenClassKeyword:
strcpy (dststg, "0");
return;
case WmlTokenClassReason:
resobj = (WmlResourceDefPtr) tok->objdef;
sprintf (dststg, "sym_k_%s_reason", resobj->tkname);
return;
case WmlTokenClassReserved:
strcpy (dststg, "0");
return;
case WmlTokenClassClass:
clsobj = (WmlClassDefPtr) tok->objdef;
sprintf (dststg, "sym_k_%s_object", clsobj->tkname);
return;
case WmlTokenClassChild:
chobj = (WmlChildDefPtr) tok->objdef;
sprintf (dststg, "sym_k_%s_child", chobj->tkname);
return;
}
}
/*
* Routine to return the string for a token number, tkn_k_num_...
*/
void wmlTokenTokenString (dststg, tok)
char *dststg;
WmlKeyWTokenPtr tok;
{
WmlGrammarTokenPtr grtok; /* grammar token */
switch ( tok->class )
{
case WmlTokenClassArgument:
strcpy (dststg, "ARGUMENT_NAME");
return;
case WmlTokenClassCharset:
strcpy (dststg, "CHARSET_NAME");
return;
case WmlTokenClassEnumval:
strcpy (dststg, "ENUMVAL_NAME");
return;
case WmlTokenClassReason:
strcpy (dststg, "REASON_NAME");
return;
case WmlTokenClassKeyword:
case WmlTokenClassReserved:
grtok = (WmlGrammarTokenPtr) tok->objdef;
strcpy (dststg, grtok->token);
return;
case WmlTokenClassClass:
strcpy (dststg, "CLASS_NAME");
return;
case WmlTokenClassChild:
strcpy (dststg, "CHILD_NAME");
return;
}
}
/*
* routine to output UilTokName.h
*/
void wmlOutputUilTokName ()
{
char *canned1 =
"/*\tToken name table */\n\
static char *tok_token_name_table_vec[] = \n\
{\n";
char *canned2 =
" };\n\
externaldef(uil_sym_glbl) char **tok_token_name_table =\n\
\t\ttok_token_name_table_vec;\n\n\
/*\tNumber of entries in table */\n\
externaldef(uil_sym_glbl) int tok_num_tokens = %d;\n";
FILE *outfil; /* output file */
int ndx; /* loop index */
WmlGrammarTokenPtr grtok; /* current grammar token */
/*
* Open the output file.
*/
outfil = fopen ("UilTokName.h", "w");
if ( outfil == NULL )
{
printf ("\nCouldn't open UilTokName.h");
return;
}
fprintf (outfil, canned_warn);
fprintf (outfil, canned1);
/*
* Print the token name entries
* Note: vector size is max_val + 1 for zeroth token
*/
for ( ndx=0 ; ndx<grtok_max_val+1 ; ndx++ )
{
grtok = grtok_vec[ndx];
if ( grtok != NULL )
fprintf (outfil, " \"%s\",\n", grtok->token);
else
fprintf (outfil, " \"UNKNOWN_TOKEN\",\n");
}
/*
* close the output file
*/
fprintf (outfil, canned2, grtok_max_val+1);
printf ("\nCreated UilTokName.h");
fclose (outfil);
}

View file

@ -1,332 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: wmloutmm.c /main/9 1995/08/29 11:10:59 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
* This module contains routines responsible for writing the .mm files
* produced by WML. All files are written into the current directory.
*
* Input:
* The resolved objects
*
* Output:
* wml-uil.mm
*
*/
#include "wml.h"
#if defined(__STDC__)
#include <string.h>
#endif
#include <stdio.h>
/*
* Routines used only in this module
*/
void wmlOutputWmlUilMm ();
void wmlOutputWmlUilMmClass ();
/*
* globals
*/
int tabno = 1; /* table number */
/*
* lists re-used repeatedly to order lists for printing
*/
DynamicHandleListDef mm_arg;
DynamicHandleListDefPtr mm_arg_ptr = &mm_arg;
DynamicHandleListDef mm_rsn;
DynamicHandleListDefPtr mm_rsn_ptr = &mm_rsn;
DynamicHandleListDef mm_ctl;
DynamicHandleListDefPtr mm_ctl_ptr = &mm_ctl;
/*
* Output control routine, which simply outputs each .mm file in turn.
*/
void wmlOutputMmFiles ()
{
wmlOutputWmlUilMm ();
}
/*
* Routine to write out wml-uil.mm
*
* This .mm file contains the tables which are to be included as an
* appendix to the Uil manual. The tables give the arguments with their
* default values, reasons, constraints, and controls for each class
* in the class vectors.
*/
void wmlOutputWmlUilMm ()
{
FILE *outfil; /* output file */
int ndx; /* loop index */
WmlClassDefPtr clsobj; /* class object */
/*
* Open the output file. Write the canned header stuff
*/
outfil = fopen ("wml-uil.mm", "w");
if ( outfil == NULL )
{
printf ("\nCouldn't open wml-uil.mm");
return;
}
/*
* Initialize order lists for the tables.
*/
wmlInitHList (mm_arg_ptr, 200, TRUE);
wmlInitHList (mm_rsn_ptr, 200, TRUE);
wmlInitHList (mm_ctl_ptr, 200, TRUE);
/*
* Write out a table for each class, for both widget and gadget variants
*/
for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
{
clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
wmlOutputWmlUilMmClass (outfil, clsobj, clsobj->syndef->name);
}
/*
* close the output file
*/
printf ("\nCreated wml-uil.mm");
fclose (outfil);
}
/*
* Routine to write a table for a class entry
*/
void wmlOutputWmlUilMmClass (outfil, clsobj, name)
FILE *outfil;
WmlClassDefPtr clsobj;
char *name;
{
char *canned1 =
".bp\n\
.ps 12\n";
char *canned2 =
".ps 10\n\
.vs 12\n\
.LP\n\
.TS H\n\
tab(@);\n\
lB lB\n\
l l.\n\
_\n\
.sp 6p\n\
Controls@Reasons\n\
.sp 6p\n\
_\n\
.sp 6p\n\
.TH\n";
char *canned3 =
".TE\n\
.TS H\n\
tab(@);\n\
lB lB lB\n\
l l l.\n\
_\n\
.sp 6p\n\
UIL Argument Name@Argument Type@Default Value\n\
.sp 6p\n\
_\n\
.sp 6p\n\
.TH\n";
char *canned4 =
".TE\n";
WmlClassResDefPtr argref; /* current argument reference */
WmlClassResDefPtr rsnref; /* current reason reference */
WmlClassCtrlDefPtr ctlref; /* current controls reference */
int argndx; /* to access ordered vector */
int rsnndx; /* to access ordered vector */
int ctlndx; /* to access ordered vector */
/*
* Write out header information
*/
fprintf (outfil, canned1);
fprintf (outfil, "%s\n", name);
fprintf (outfil, canned2);
/*
* Alphabetize the controls, reason, and argument lists
*/
wmlClearHList (mm_arg_ptr);
wmlClearHList (mm_rsn_ptr);
wmlClearHList (mm_ctl_ptr);
argref = clsobj->arguments;
while ( argref!= NULL )
{
while ( argref != NULL && argref->exclude == WmlAttributeTrue )
argref = argref->next;
if ( argref != NULL )
{
wmlInsertInHList (mm_arg_ptr,
argref->act_resource->syndef->name,
(ObjectPtr)argref);
argref = argref->next;
}
}
rsnref = clsobj->reasons;
while ( rsnref!=NULL )
{
while ( rsnref != NULL && rsnref->exclude == WmlAttributeTrue )
rsnref = rsnref->next;
if ( rsnref != NULL )
{
wmlInsertInHList (mm_rsn_ptr,
rsnref->act_resource->syndef->name,
(ObjectPtr)rsnref);
rsnref = rsnref->next;
}
}
ctlref = clsobj->controls;
while ( ctlref != NULL )
{
wmlInsertInHList (mm_ctl_ptr,
ctlref->ctrl->syndef->name,
(ObjectPtr)ctlref);
ctlref = ctlref->next;
}
/*
* Write out the controls and reason table.
*/
rsnndx = 0;
ctlndx = 0;
if ( mm_ctl_ptr->cnt == 0 )
fprintf (outfil, "No children are supported");
while ( rsnndx<mm_rsn_ptr->cnt || ctlndx<mm_ctl_ptr->cnt )
{
if ( ctlndx < mm_ctl_ptr->cnt )
{
ctlref = (WmlClassCtrlDefPtr) mm_ctl_ptr->hvec[ctlndx].objptr;
fprintf (outfil, "%s@",
ctlref->ctrl->syndef->name);
ctlndx += 1;
}
else
fprintf (outfil, "@");
if ( rsnndx < mm_rsn_ptr->cnt )
{
rsnref = (WmlClassResDefPtr) mm_rsn_ptr->hvec[rsnndx].objptr;
fprintf (outfil, "%s\n",
rsnref->act_resource->syndef->name);
rsnndx += 1;
}
else
fprintf (outfil, "\n");
}
fprintf (outfil, canned3);
/*
* Write out the argument table
*/
argndx = 0;
while ( argndx < mm_arg_ptr->cnt )
{
argref = (WmlClassResDefPtr) mm_arg_ptr->hvec[argndx].objptr;
fprintf (outfil, "%s@%s@",
argref->act_resource->syndef->name,
argref->act_resource->dtype_def->syndef->name);
if ( argref->dflt != NULL )
{
if ( strchr(argref->dflt,' ') != 0 )
fprintf (outfil, "T{\n%s\nT}\n",
argref->dflt);
else
fprintf (outfil, "%s\n",
argref->dflt);
}
else
{
if (argref->act_resource->syndef->dflt != NULL) {
if ( strchr(argref->act_resource->syndef->dflt,' ') != 0 )
fprintf (outfil, "T{\n%s\nT}\n",
argref->act_resource->syndef->dflt);
else
fprintf (outfil, "%s\n",
argref->act_resource->syndef->dflt);
}
else
fprintf (outfil, " \n");
}
argndx += 1;
}
fprintf (outfil, canned4);
}

View file

@ -1,75 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: wmloutp1.c /main/7 1995/07/13 21:04:31 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
* This is the standard output module for creating the UIL compiler
* .h files.
*/
#include "wml.h"
void wmlOutput ()
{
/*
* Output the .h files
*/
wmlOutputHFiles ();
if ( wml_err_count > 0 ) return;
/*
* Output the keyword (token) tables
*/
wmlOutputKeyWordFiles ();
if ( wml_err_count > 0 ) return;
/*
* Output the .mm files
*/
wmlOutputMmFiles ();
if ( wml_err_count > 0 ) return;
return;
}

View file

@ -1,728 +0,0 @@
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
/* "$TOG: wmlparse.y /main/10 1997/04/14 12:56:03 dbl $" */
/*
* This file defines the grammar for the Motif Widget Meta Language (WML),
* the declarative language which describes the widget, gadgets, and
* resources in the UIL language.
*/
%{
#include "wml.h"
#if defined(__STDC__)
#include <string.h> /* for strcpy() */
#endif
#ifndef XmConst
#if (defined(__STDC__) && __STDC__) || !defined( NO_CONST )
#define XmConst const
#else
#define XmConst
#endif /* __STDC__ */
#endif /* XmConst */
/*
* Undefine NULL, since it is defined in stdio
*/
#undef NULL
%}
/*
* Tokens defining terminals of the language
*/
/*
* token 0 is EOF, not defined here
*/
/*
* WML statements
*/
%token CLASS 1 /* CLASS statement */
%token RESOURCE 2 /* RESOURCE statement */
%token DATATYPE 3 /* DATATYPE statement */
%token CONTROLLIST 4 /* CONTROLLIST statement */
%token ENUMERATIONSET 5 /* ENUMERATIONSET statement */
%token ENUMERATIONVALUE 6 /* ENUMERATIONVALUE statement */
%token CHARACTERSET 7 /* CHARACTERSET statement */
%token CHILD 50 /* CHILD statement */
/*
* Statement attributes
*/
%token DOCNAME 8 /* DOCNAME attribute */
%token CONVFUNC 9 /* CONVENIENCEFUNCTION attribute */
%token ALIAS 10 /* ALIAS attribute */
%token TYPE 11 /* TYPE attribute */
%token RESOURCELITERAL 12 /* RESOURCELITERAL attribute */
%token RELATED 13 /* RELATED attribute */
%token INTERNALLITERAL 14 /* INTERNALLITERAL attribute */
%token XRMRESOURCE 15 /* XRMRESOURCE attribute */
%token EXCLUDE 16 /* EXCLUDE attribute */
%token RESOURCES 17 /* RESOURCES attribute */
%token SUPERCLASS 18 /* SUPERCLASS attribute */
%token CONTROLS 19 /* CONTROLS attribute */
%token WIDGETCLASS 20 /* WIDGETCLASS attribute */
%token DIALOGCLASS 21 /* DIALOGCLASS attribute */
%token DEFAULT 22 /* DEFAULT attribute */
%token ENUMLITERAL 23 /* ENUMLITERAL attribute */
%token XMSTRINGCHARSETNAME 24 /* XMSTRINGCHARSETNAME attribute */
%token DIRECTION 25 /* DIRECTION attribute */
%token PARSEDIRECTION 26 /* PARSEDIRECTION attribute */
%token CHARACTERSIZE 27 /* CHARACTERSIZE attribute */
%token CTRLMAPSRESOURCE 28 /* CTRLMAPSRESOURCE attribute */
%token CHILDREN 51 /* CHILDREN attribute */
%token PARENTCLASS 52 /* PARENTCLASS attribute */
/*
* Other keywords
*/
%token METACLASS 29 /* CLASS type */
%token WIDGET 30 /* CLASS type */
%token GADGET 31 /* CLASS type */
%token ARGUMENT 32 /* RESOURCE type */
%token REASON 33 /* RESOURCE type */
%token CONSTRAINT 34 /* RESOURCE type */
%token SUBRESOURCE 35 /* RESOURCE type */
%token ATTRTRUE 36 /* attribute value */
%token ATTRFALSE 37 /* attribute value */
%token LEFTTORIGHT 38 /* DIRECTION attribute */
%token RIGHTTOLEFT 39 /* DIRECTION attribute */
%token ONEBYTE 40 /* CHARACTERSIZE attribute */
%token TWOBYTE 41 /* CHARACTERSIZE attribute */
%token MIXED1_2BYTE 42 /* CHARACTERSIZE attribute */
/*
* Special characters
*/
%token COLON 43
%token SEMICOLON 44
%token EQUALS 45
%token LBRACE 46
%token RBRACE 47
/*
* non-terminals
*/
%token STRING 48 /* Any user literal */
/*
* Others
*/
%token ERRORTOKEN 49 /* Any unrecognized character */
%start statement_block_list
%%
/*
* Productions of the WML grammar. All routines assume that current
* data structures are kept in globals. This works as the language has
* no recursive elements.
*/
/*
* The language consists of blocks of statements. The blocks may occur
* in any order, and blocks of the same kind may be arbitrarily repeated.
*/
statement_block_list
: /* empty */
| statement_block_list statement_block
;
statement_block
: class_statement_block
| resource_statement_block
| child_statement_block
| datatype_statement_block
| ctrlist_statement_block
| enumset_statement_block
| enumval_statement_block
| charset_statement_block
| error { LexIssueError(0); } SEMICOLON
;
/*
* Statement blocks. Each statement block begins with its identifying
* keyword, then includes an arbitrary number of statements
*/
class_statement_block
: CLASS
class_statement_list
;
class_statement_list
: class_statement SEMICOLON
| class_statement_list class_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
resource_statement_block
: RESOURCE
resource_statement_list
;
resource_statement_list
: resource_statement SEMICOLON
| resource_statement_list resource_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
child_statement_block
: CHILD
child_statement_list
;
child_statement_list
: child_statement SEMICOLON
| child_statement_list child_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
datatype_statement_block
: DATATYPE
datatype_statement_list
;
datatype_statement_list
: datatype_statement SEMICOLON
| datatype_statement_list datatype_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
ctrlist_statement_block
: CONTROLLIST
ctrlist_statement_list
;
ctrlist_statement_list
: ctrlist_statement SEMICOLON
| ctrlist_statement_list ctrlist_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
enumset_statement_block
: ENUMERATIONSET
enumset_statement_list
;
enumset_statement_list
: enumset_statement SEMICOLON
| enumset_statement_list enumset_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
enumval_statement_block
: ENUMERATIONVALUE
enumval_statement_list
;
enumval_statement_list
: enumval_statement SEMICOLON
| enumval_statement_list enumval_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
charset_statement_block
: CHARACTERSET
charset_statement_list
;
charset_statement_list
: charset_statement SEMICOLON
| charset_statement_list charset_statement SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
/*
* The CLASS statement
*/
class_statement
: name
COLON
class_type
{ wmlCreateClass (yynameval, yytknval1); }
class_definition
;
class_type
: METACLASS { yytknval1 = METACLASS; }
| WIDGET { yytknval1 = WIDGET; }
| GADGET { yytknval1 = GADGET; }
;
class_definition
: /* empty */
| LBRACE RBRACE
| LBRACE class_attribute_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
class_attribute_list
: class_attribute
| class_attribute_list class_attribute
;
class_attribute
: class_attribute_name
EQUALS
STRING
{ wmlAddClassAttribute (yytknval1, yystringval); }
SEMICOLON
| boolean_class_attribute_name
EQUALS
boolean_attribute_value
{ wmlAddClassAttribute (yytknval1, yytknval2); }
SEMICOLON
| class_resources SEMICOLON
| class_controls SEMICOLON
| class_children SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
class_attribute_name
: SUPERCLASS { yytknval1 = SUPERCLASS; }
| PARENTCLASS { yytknval1 = PARENTCLASS; }
| INTERNALLITERAL { yytknval1 = INTERNALLITERAL; }
| DOCNAME { yytknval1 = DOCNAME; }
| CONVFUNC { yytknval1 = CONVFUNC; }
| WIDGETCLASS { yytknval1 = WIDGETCLASS; }
| CTRLMAPSRESOURCE { yytknval1 = CTRLMAPSRESOURCE; }
;
boolean_class_attribute_name
: DIALOGCLASS { yytknval1 = DIALOGCLASS; }
boolean_attribute_value
: ATTRTRUE { yytknval2 = ATTRTRUE; }
| ATTRFALSE { yytknval2 = ATTRFALSE; }
;
class_resources
: RESOURCES class_resources_block
;
class_resources_block
: /* empty */
| LBRACE RBRACE
| LBRACE class_resource_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
class_resource_list
: class_resource_element
| class_resource_list class_resource_element
;
class_resource_element
: name
{ wmlAddClassResource (yynameval); }
class_resource_attributes
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
class_resource_attributes
: /* empty */
| LBRACE RBRACE
| LBRACE class_resource_attribute_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
class_resource_attribute_list
: class_resource_attribute_element
| class_resource_attribute_list class_resource_attribute_element
;
class_resource_attribute_element
: class_resource_attribute_name
EQUALS
STRING
{ wmlAddClassResourceAttribute (yytknval1, yystringval); }
SEMICOLON
| boolean_class_resource_attribute_name
EQUALS
boolean_attribute_value
{ wmlAddClassResourceAttribute (yytknval1, yytknval2); }
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
class_resource_attribute_name
: TYPE { yytknval1 = TYPE; }
| DEFAULT { yytknval1 = DEFAULT; }
;
boolean_class_resource_attribute_name
: EXCLUDE { yytknval1 = EXCLUDE; }
;
class_controls
: CONTROLS class_controls_block
;
class_controls_block
: /* empty */
| LBRACE RBRACE
| LBRACE class_controls_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
class_controls_list
: class_controls_element
| class_controls_list class_controls_element
;
class_controls_element
: name
{ wmlAddClassControl (yynameval); }
class_controls_attributes
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
class_controls_attributes
: /* empty */
| LBRACE RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
class_children
: CHILDREN class_children_block
;
class_children_block
: /* empty */
| LBRACE RBRACE
| LBRACE class_children_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
class_children_list
: class_children_element
| class_children_list class_children_element
;
class_children_element
: name
{ wmlAddClassChild (yynameval); }
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
/*
* The RESOURCE statement
*/
resource_statement
: name
COLON
resource_type
{ wmlCreateResource (yynameval, yytknval1); }
resource_definition
;
resource_type
: ARGUMENT { yytknval1 = ARGUMENT; }
| REASON { yytknval1 = REASON; }
| CONSTRAINT { yytknval1 = CONSTRAINT; }
| SUBRESOURCE { yytknval1 = SUBRESOURCE; }
;
resource_definition
: /* empty */
| LBRACE RBRACE
| LBRACE resource_attribute_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
resource_attribute_list
: resource_attribute
| resource_attribute_list resource_attribute
;
resource_attribute
: resource_attribute_name
EQUALS
STRING
{ wmlAddResourceAttribute (yytknval1, yystringval); }
SEMICOLON
| boolean_resource_resource_attribute_name
EQUALS
boolean_attribute_value
{ wmlAddResourceAttribute (yytknval1, yytknval2); }
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
resource_attribute_name
: TYPE { yytknval1 = TYPE; }
| RESOURCELITERAL { yytknval1 = RESOURCELITERAL; }
| ENUMERATIONSET { yytknval1 = ENUMERATIONSET; }
| INTERNALLITERAL { yytknval1 = INTERNALLITERAL; }
| RELATED { yytknval1 = RELATED; }
| DOCNAME { yytknval1 = DOCNAME; }
| DEFAULT { yytknval1 = DEFAULT; }
| ALIAS { yytknval1 = ALIAS; }
;
boolean_resource_resource_attribute_name
: XRMRESOURCE { yytknval1 = XRMRESOURCE; }
;
/*
* The CHILD statement
*/
child_statement
: name COLON STRING
{ wmlCreateChild(yynameval, yystringval); }
;
/*
* DATATYPE statement
*/
datatype_statement
: name
{ wmlCreateDatatype (yystringval); }
datatype_definition
;
datatype_definition
: /* empty */
| LBRACE RBRACE
| LBRACE datatype_attribute_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
datatype_attribute_list
: datatype_attribute
| datatype_attribute_list datatype_attribute
;
datatype_attribute
: datatype_attribute_name
EQUALS
STRING
{ wmlAddDatatypeAttribute (yytknval1, yystringval); }
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
datatype_attribute_name
: INTERNALLITERAL { yytknval1 = INTERNALLITERAL; }
| DOCNAME { yytknval1 = DOCNAME; }
| XRMRESOURCE { yytknval1 = XRMRESOURCE; }
;
/*
* The CONTROLLIST statement
*/
ctrlist_statement
: name
{ wmlCreateOrAppendCtrlList (yynameval); }
ctrlist_definition
;
ctrlist_definition
: /* empty */
| LBRACE RBRACE
| LBRACE ctrlist_controls_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
ctrlist_controls_list
: ctrlist_control
| ctrlist_controls_list ctrlist_control
;
ctrlist_control
: name
{ wmlAddCtrlListControl (yynameval); }
ctrlist_controls_attributes
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
ctrlist_controls_attributes
: /* empty */
| LBRACE RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
/*
* The ENUMERATIONSET statement
*/
enumset_statement
: name
COLON
enumset_data_type
{ wmlCreateEnumSet (yynameval, yystringval); }
enumset_definition
;
enumset_data_type
:
STRING
;
enumset_definition
: /* empty */
| LBRACE RBRACE
| LBRACE enumset_value_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
enumset_value_list
: enumset_value
| enumset_value_list enumset_value
;
enumset_value
: name
{ wmlAddEnumSetValue (yynameval); }
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
/*
* The ENUMERATIONVALUE statement
*/
enumval_statement
: name
COLON
{ wmlCreateEnumValue (yynameval); }
enumvalue_definition
;
enumvalue_definition
: /* empty */
| LBRACE RBRACE
| LBRACE enumvalue_attributes_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
enumvalue_attributes_list
: enumvalue_attribute
| enumvalue_attributes_list enumvalue_attribute
;
enumvalue_attribute
: enumvalue_attribute_name
EQUALS
STRING
{ wmlAddEnumValueAttribute (yytknval1, yystringval); }
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
enumvalue_attribute_name
: ENUMLITERAL { yytknval1 = ENUMLITERAL; }
;
/*
* CHARACTERSET statement
*/
charset_statement
: name
{ wmlCreateCharset (yystringval); }
charset_definition
;
charset_definition
: /* empty */
| LBRACE RBRACE
| LBRACE charset_attribute_list RBRACE
| error { LexIssueError(RBRACE); } RBRACE
;
charset_attribute_list
: charset_attribute
| charset_attribute_list charset_attribute
;
charset_attribute
: charset_attribute_name
EQUALS
STRING
{ wmlAddCharsetAttribute (yytknval1, yystringval); }
SEMICOLON
| predefined_charset_attribute_name
EQUALS
predefined_charset_attribute_value
{ wmlAddCharsetAttribute (yytknval1, yytknval2); }
SEMICOLON
| error { LexIssueError(SEMICOLON); } SEMICOLON
;
charset_attribute_name
: INTERNALLITERAL { yytknval1 = INTERNALLITERAL; }
| ALIAS { yytknval1 = ALIAS; }
| XMSTRINGCHARSETNAME { yytknval1 = XMSTRINGCHARSETNAME; }
;
predefined_charset_attribute_name
: DIRECTION { yytknval1 = DIRECTION; }
| PARSEDIRECTION { yytknval1 = PARSEDIRECTION; }
| CHARACTERSIZE { yytknval1 = CHARACTERSIZE; }
;
predefined_charset_attribute_value
: LEFTTORIGHT { yytknval2 = LEFTTORIGHT; }
| RIGHTTOLEFT { yytknval2 = RIGHTTOLEFT; }
| ONEBYTE { yytknval2 = ONEBYTE; }
| TWOBYTE { yytknval2 = TWOBYTE; }
| MIXED1_2BYTE { yytknval2 = MIXED1_2BYTE; }
/*
* Other productions
*/
name
: STRING
{ strcpy (yynameval, (XmConst char *)yystringval); }
;
%%
/*
* Dummmy error routine, since we output our own.
*/
int yyerror (s)
char *s;
{
return 0;
}
#include "wmllex.c"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,194 +0,0 @@
%{
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#if defined(__STDC__)
#include <string.h>
#endif
#ifndef XmConst
#if (defined(__STDC__) && __STDC__) || !defined( NO_CONST )
#define XmConst const
#else
#define XmConst
#endif /* __STDC__ */
#endif /* XmConst */
/*
* lex program to construct token data for WML to generate token
* table data.
*
* stdin is the file Uil.y
*
* it is searched for each occurance of a line starting with '%token'
* when found various fields are extracted.
*
* when Uil.y has been scanned the collected data is written
* to stdout.
*/
%}
%a 9999 /* transitions */
%{
#include <stdio.h>
#define TRUE 1
#define FALSE 0
#define MAX_SYN 10
#ifdef yywrap
#undef yywrap
#endif
typedef struct _token
{
char * name;
char * id;
char * class;
int num_syn;
char * syn[MAX_SYN];
}
TokenRec, *Token;
TokenRec token[1000];
TokenRec temp;
void add_token ();
int phase = 0;
int keyword_count;
int line_num = 0;
int in_comment = 0;
int in_include = 0;
int in_token = 0;
int state = 0;
int used = 0;
%}
%%
[\n] {
if (in_token == TRUE)
{
add_token (&temp);
}
in_token = FALSE;
line_num++;
}
[ \t] { /* swallow */
}
"/\*" { /* swallow */
}
^%token {
in_token = TRUE;
state = 0;
}
[a-zA-Z0-9_]+ {
if (in_token == TRUE)
{
switch (state)
{
case 0:
temp.name = (char *)
strcpy ((char *)
malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext);
temp.num_syn = 0;
break;
case 1:
temp.id = (char *)
strcpy ((char *)
malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext);
break;
case 2:
temp.class = (char *)
strcpy ((char *)
malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext);
break;
case 3:
temp.syn[temp.num_syn] = (char *)
strcpy ((char *)
malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext);
temp.num_syn++;
if (temp.num_syn > MAX_SYN)
printf (
"ERROR, too many synonyms, line %d\n",
line_num);
break;
}
state++;
}
}
. { /* swallow */
}
%%
void
add_token (t) /* keep sorted by name */
Token t;
{
int i, j, k;
for (j=0; j<used; j++) /* for each token */
{
if (strcmp (token[j].name, t->name) > 0) /* goes here */
{
for (i=used++; i>j; i--) /* make hole */
token[i] = token[i-1];
token[j] = *t; /* insert it */
return;
}
}
/*
* if we get there then it goes at the end of the list
*/
token[used++] = *t;
}
yywrap ()
{
int i, j, k;
for (i=0; i<used; i++)
{
printf ("%s %s %s\n", token[i].name, token[i].id, token[i].class);
}
return (1);
}

View file

@ -1,438 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$XConsortium: wmlutils.c /main/8 1995/08/29 11:11:24 drk $"
#endif
#endif
/*
* (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
/*
* This file contains utilities used by WML.
*/
#include "wml.h"
#if defined(__STDC__)
#include <stdlib.h>
#include <string.h>
#endif
#include <stdio.h>
/*
* Utility to allocate dynamic space for a string, and return the
* dynamic copy. Produces a NULL on null input.
*/
char *wmlAllocateString (stg)
char *stg;
{
char *dynstg; /* the dynamic copy */
if ( stg == NULL ) return NULL;
dynstg = (char *) malloc (strlen(stg)+1);
strcpy (dynstg, stg);
return dynstg;
}
/*
* Utility to convert a string to upper case. The conversion happens in
* place, destroying the original string.
*/
void wmlUpperCaseString (stg)
char *stg;
{
int ndx; /* loop index */
if ( stg == NULL ) return;
for ( ndx=0 ; ndx<strlen(stg) ; ndx++ )
stg[ndx] = _upper (stg[ndx]);
}
/*
* Routines for accessing and manipulating dynamic handle lists.
*/
/*
* Initialize a dynamic handle list. Allocate a vector of the given
* size, and set the count and number used (0).
*
* listptr the list to be inited
* size # entries in handle vector
* is_ordered TRUE is list is to be ordered
*/
void wmlInitHList (listptr, size, is_ordered)
DynamicHandleListDefPtr listptr;
int size;
int is_ordered;
{
listptr->cnt = 0;
listptr->max = size;
listptr->ordered = is_ordered;
listptr->hvec = (ObjectHandleDefPtr) malloc(size*sizeof(ObjectHandleDef));
return;
}
/*
* Routine to resize a dynamic handle list. Increases the size if required,
* but does nothing if the list is already big enough.
*
* listptr the dynamic list
* new_size new list size
*/
void wmlResizeHList (listptr, new_size)
DynamicHandleListDefPtr listptr;
int new_size;
{
ObjectHandleDefPtr new_vec; /* reallocated vector */
if ( listptr->max >= new_size ) return;
listptr->max = new_size;
new_vec = (ObjectHandleDefPtr) realloc
(listptr->hvec, new_size*sizeof(ObjectHandleDef));
listptr->hvec = new_vec;
return;
}
/*
* Routine to clear a dynamic handle list. It leaves the handle vector intact,
* but frees all the allocated names. The count is reset to 0.
* but does nothing if the list is already big enough.
*
* listptr the dynamic list
*/
void wmlClearHList (listptr)
DynamicHandleListDefPtr listptr;
{
int ndx; /* current index in list */
for ( ndx=0 ; ndx<listptr->cnt ; ndx++ )
{
free (listptr->hvec[ndx].objname);
listptr->hvec[ndx].objname = NULL;
}
listptr->cnt = 0;
return;
}
/*
* Function to find a name in a dynamic list. This will function on both
* ordered and unordered lists.
*
* listptr the dynamic list
* name the name to look up in the list
*
* returns:
* >= 0 name found, index in list
* < 0 name not found
*/
int wmlFindInHList (listptr, name)
DynamicHandleListDefPtr listptr;
char *name;
{
int ndx; /* current index in list */
int londx; /* low index */
int hindx; /* high index */
int midndx; /* midpoint index */
int cmpres; /* strcmp result */
/*
* Binary search if ordered, brute force otherwise
*/
if ( listptr->ordered )
{
for ( londx=0,hindx=listptr->cnt-1 ; hindx>=londx ; )
{
midndx = (londx+hindx) / 2;
cmpres = strcmp (name, listptr->hvec[midndx].objname);
if ( cmpres < 0 )
hindx = midndx - 1;
if ( cmpres > 0 )
londx = midndx + 1;
if ( cmpres == 0 )
return midndx;
}
return -1;
}
else
{
for ( ndx=0 ; ndx<listptr->cnt ; ndx++ )
if ( strcmp(name,listptr->hvec[ndx].objname) == 0 )
return ndx;
return -1;
}
}
/*
* Routine to insert an entry into a list. The insertion is ordered or
* unordered depending on the way the list is marked. Unordered lists
* insert at the end. This routine assumes no duplicates will be entered
* in the list.
*
* listptr the list
* name the name under which to insert
* obj the object to insert
*/
void wmlInsertInHList (listptr, name, obj)
DynamicHandleListDefPtr listptr;
char *name;
ObjectPtr obj;
{
int ndx; /* current index in list */
int londx; /* low index */
int hindx; /* high index */
int midndx; /* midpoint index */
int newndx; /* new entry index */
int cmpres; /* strcmp result */
/*
* Guarantee enough space in the list
*/
wmlResizeHList (listptr, listptr->cnt+1);
/*
* Binary search and insert if ordered, brute force otherwise
*/
if ( listptr->ordered )
{
if ( listptr->cnt == 0 )
{
listptr->hvec[0].objname = wmlAllocateString (name);
listptr->hvec[0].objptr = obj;
listptr->cnt += 1;
return;
}
for ( londx=0,hindx=listptr->cnt-1 ; hindx>=londx ; )
{
midndx = (londx+hindx) / 2;
cmpres = strcmp (name, listptr->hvec[midndx].objname);
if ( cmpres == 0 )
{
printf ("\nwmlInsertInHList: duplicate name '%s'found\n", name);
return;
}
if ( londx == hindx ) break;
if ( cmpres < 0 )
hindx = midndx - 1;
if ( cmpres > 0 )
londx = midndx + 1;
}
/*
* The new entry will go either at midndx or after midndx. Move down
* the vector appropriately.
*/
if ( cmpres < 0 )
newndx = midndx;
else
newndx = midndx + 1;
for ( ndx=listptr->cnt-1 ; ndx>=newndx ; ndx-- )
{
listptr->hvec[ndx+1].objname = listptr->hvec[ndx].objname;
listptr->hvec[ndx+1].objptr = listptr->hvec[ndx].objptr;
}
listptr->hvec[newndx].objname = wmlAllocateString (name);
listptr->hvec[newndx].objptr = obj;
listptr->cnt += 1;
return;
}
else
{
listptr->hvec[listptr->cnt].objname = wmlAllocateString (name);
listptr->hvec[listptr->cnt].objptr = obj;
listptr->cnt += 1;
return;
}
}
/*
* Routine to insert an entry into a token list. The insertion is ordered.
* This routine allows duplicates
*
* listptr the list
* name the name under which to insert
* obj the object to insert
*/
void wmlInsertInKeyList (listptr, name, obj)
DynamicHandleListDefPtr listptr;
char *name;
ObjectPtr obj;
{
int ndx; /* current index in list */
int londx; /* low index */
int hindx; /* high index */
int midndx; /* midpoint index */
int newndx; /* new entry index */
int cmpres; /* strcmp result */
/*
* Guarantee enough space in the list
*/
wmlResizeHList (listptr, listptr->cnt+1);
/*
* Binary search and insert
*/
if ( listptr->cnt == 0 )
{
listptr->hvec[0].objname = wmlAllocateString (name);
listptr->hvec[0].objptr = obj;
listptr->cnt += 1;
return;
}
for ( londx=0,hindx=listptr->cnt-1 ; hindx>=londx ; )
{
midndx = (londx+hindx) / 2;
cmpres = strcmp (name, listptr->hvec[midndx].objname);
if ( londx == hindx ) break;
if ( cmpres < 0 )
hindx = midndx - 1;
if ( cmpres >= 0 )
londx = midndx + 1;
}
/*
* The new entry will go either at midndx or after midndx. Move down
* the vector appropriately.
*/
if ( cmpres < 0 )
newndx = midndx;
else
newndx = midndx + 1;
for ( ndx=listptr->cnt-1 ; ndx>=newndx ; ndx-- )
{
listptr->hvec[ndx+1].objname = listptr->hvec[ndx].objname;
listptr->hvec[ndx+1].objptr = listptr->hvec[ndx].objptr;
}
listptr->hvec[newndx].objname = wmlAllocateString (name);
listptr->hvec[newndx].objptr = obj;
listptr->cnt += 1;
return;
}
/*
* Indicate if a resource is in a resource reference list by returning its
* reference pointer.
*/
WmlClassResDefPtr wmlResolveResIsMember (resobj, resref)
WmlResourceDefPtr resobj;
WmlClassResDefPtr resref;
{
while ( resref != NULL )
{
if ( resref->act_resource == resobj ) return resref;
resref = resref->next;
}
return NULL;
}
/*
* Indicate if a child is in a child reference list by returning its
* reference pointer.
*/
WmlClassChildDefPtr wmlResolveChildIsMember (childobj, childref)
WmlChildDefPtr childobj;
WmlClassChildDefPtr childref;
{
while ( childref != NULL )
{
if ( childref->act_child == childobj ) return childref;
childref = childref->next;
}
return NULL;
}

View file

@ -1,38 +0,0 @@
#!/bin/sh
#####################################################################
### File: 0040.xmbind
###
### Default Location: /usr/dt/config/Xsession.d/
###
### Purpose: Set XMBINDDIR directory to CDE
### default /usr/dt/lib/bindings
###
### Description:
### This script is invoked by means of the Xsession file
### at user login. It sets a default value for the
### environment variable XMBINDDIR. Motif looks in the
### directory specified by this variable for the
### xmbind.alias and virtual bindings files.
###
###
### Invoked by: /usr/dt/bin/Xsession
###
### Product: @(#)Common Desktop Environment 1.0
###
### Note:
###
### The /usr/dt/config/Xsession.d/0040.dtims file is a
### factory-default file and will be unconditionally overwritten upon
### subsequent installation. To customize the XMBINDDIR value,
### copy this file to the configuration directory,
### /etc/dt/config/Xsession.d and change that version
### of the file.
###
### Revision: $XConsortium: 0040.xmbind /main/3 1995/07/14 09:40:09 drk $
#####################################################################
XMBINDDIR=/usr/dt/lib/bindings
export XMBINDDIR
########################## eof #####################

View file

@ -1,36 +0,0 @@
XCOMM
XCOMM @OSF_COPYRIGHT@
XCOMM COPYRIGHT NOTICE
XCOMM Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
XCOMM ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
XCOMM the full copyright text.
XCOMM
XCOMM
XCOMM HISTORY
XCOMM
XCOMM $XConsortium: Imakefile /main/8 1995/07/14 09:39:48 drk $
#ifdef CdeImake
# ifdef USLArchitecture
# if HasSharedLibraries
EXTRA_LOAD_FLAGS = -z nodefs
# endif
# endif
#endif /* CdeImake */
INCLUDES = -I. -I$(INCLUDESRC) -I$(MINCLUDESRC)
DEPLIBS1 = XmClientDepLibs
LOCAL_LIBRARIES = XmClientLibs
SRCS1= xmbind.c
OBJS1= xmbind.o
PROGRAMS = xmbind
NormalLibraryObjectRule()
MComplexProgramTarget_1(xmbind,$(LOCAL_LIBRARIES),NullParameter)

View file

@ -1,11 +0,0 @@
/* $XConsortium: README /main/3 1996/07/15 13:56:01 drk $ */
This directory contains the xmbind client.
xmbind is used to set up the bindings between keys on the
keyboard and Motif virtual keys.
Normally mwm will do this on initialization. If you are not
running mwm, or wish to change the bindings without restarting
mwm, use xmbind.
For more information see the xmbind and VirtualBindings man pages.

View file

@ -1,99 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* @OSF_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*/
/*
* HISTORY
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: xmbind.c /main/10 1997/06/18 17:34:48 samborn $"
#endif
#endif
#include <stdio.h>
#include <Xm/Xm.h>
/* Internal routines "borrowed" from libXm. Don't try this at home! */
extern Boolean _XmVirtKeysLoadFileBindings(char *fileName, String *binding);
extern int _XmVirtKeysLoadFallbackBindings(Display *display, String *binding);
void main(argc, argv)
int argc;
char **argv;
{
enum { XA_MOTIF_DEFAULT_BINDINGS, XA_MOTIF_BINDINGS };
static char *atom_names[] = {
"_MOTIF_DEFAULT_BINDINGS", "_MOTIF_BINDINGS" };
Atom atoms[XtNumber(atom_names)];
XtAppContext app_context;
Display *display;
String bindings = NULL;
XtToolkitInitialize();
app_context = XtCreateApplicationContext();
display = XtOpenDisplay(app_context, NULL, argv[0], "Xmbind",
NULL, 0, &argc, argv);
if (display == NULL) {
fprintf(stderr, "%s: Can't open display\n", argv[0]);
exit(1);
}
XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms);
if (argc == 2) {
if (_XmVirtKeysLoadFileBindings (argv[1], &bindings) == True) {
XDeleteProperty (display, RootWindow (display, 0),
atoms[XA_MOTIF_DEFAULT_BINDINGS]);
XChangeProperty (display, RootWindow(display, 0),
atoms[XA_MOTIF_BINDINGS],
XA_STRING, 8, PropModeReplace,
(unsigned char *)bindings, strlen(bindings));
XFlush (display);
XtFree (bindings);
exit(0);
}
else {
fprintf(stderr, "%s: Can't open %s\n", argv[0], argv[1]);
exit(1);
}
}
XDeleteProperty (display, RootWindow (display, 0),
atoms[XA_MOTIF_BINDINGS]);
XDeleteProperty (display, RootWindow (display, 0),
atoms[XA_MOTIF_DEFAULT_BINDINGS]);
_XmVirtKeysLoadFallbackBindings (display, &bindings);
XFlush (display);
XtFree (bindings);
exit(0);
}

View file

@ -1,242 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: lndir.c /main/2 1996/11/01 10:11:58 drk $ */
/* Create shadow link tree (after X11R4 script of the same name)
Mark Reinhold (mbr@lcs.mit.edu)/3 January 1990 */
/* Copyright 1990, Massachusetts Institute of Technology
Permission to use, copy, modify, and distribute this program for any purpose
and without fee is hereby granted, provided that this copyright and
permission notice appear on all copies and supporting documentation, that
the name of MIT not be used in advertising or publicity pertaining to
distribution of this program without specific prior permission, and that
notice be given in supporting documentation that copying and distribution is
by permission of MIT. MIT makes no representations about the suitability of
this software for any purpose. It is provided "as is" without expressed or
implied warranty.
*/
/* From the original /bin/sh script:
Used to create a copy of the a directory tree that has links for all
non-directories (except those named RCS or SCCS). If you are
building the distribution on more than one machine, you should use
this script.
If your master sources are located in /usr/local/src/X and you would like
your link tree to be in /usr/local/src/new-X, do the following:
% mkdir /usr/local/src/new-X
% cd /usr/local/src/new-X
% lndir ../X
*/
#include <X11/Xos.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <errno.h>
#ifndef X_NOT_POSIX
#include <dirent.h>
#else
#ifdef SYSV
#include <dirent.h>
#else
#ifdef USG
#include <dirent.h>
#else
#include <sys/dir.h>
#ifndef dirent
#define dirent direct
#endif
#endif
#endif
#endif
#ifdef X_NOT_STDC_ENV
extern int errno;
#endif
int silent;
void
quit (code, fmt, a1, a2, a3)
char *fmt;
{
fprintf (stderr, fmt, a1, a2, a3);
putc ('\n', stderr);
exit (code);
}
void
quiterr (code, s)
char *s;
{
perror (s);
exit (code);
}
void
msg (fmt, a1, a2, a3)
char *fmt;
{
fprintf (stderr, fmt, a1, a2, a3);
putc ('\n', stderr);
}
/* Recursively create symbolic links from the current directory to the "from"
directory. Assumes that files described by fs and ts are directories. */
dodir (fn, fs, ts, rel)
char *fn; /* name of "from" directory, either absolute or
relative to cwd */
struct stat *fs, *ts; /* stats for the "from" directory and cwd */
int rel; /* if true, prepend "../" to fn before using */
{
DIR *df;
struct dirent *dp;
char buf[MAXPATHLEN + 1], *p;
char symbuf[MAXPATHLEN + 1];
struct stat sb, sc;
int n_dirs;
if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino)) {
msg ("%s: From and to directories are identical!", fn);
return 1;
}
if (rel)
strcpy (buf, "../");
else
buf[0] = '\0';
strcat (buf, fn);
if (!(df = opendir (buf))) {
msg ("%s: Cannot opendir", buf);
return 1;
}
p = buf + strlen (buf);
*p++ = '/';
n_dirs = fs->st_nlink;
while (dp = readdir (df)) {
strcpy (p, dp->d_name);
if (n_dirs > 0) {
if (stat (buf, &sb) < 0) {
perror (buf);
continue;
}
if (sb.st_mode & S_IFDIR) {
/* directory */
n_dirs--;
if (dp->d_name[0] == '.' &&
(dp->d_name[1] == '\0' || (dp->d_name[1] == '.' &&
dp->d_name[2] == '\0')))
continue;
if (!strcmp (dp->d_name, "RCS"))
continue;
if (!strcmp (dp->d_name, "SCCS"))
continue;
if (!silent)
printf ("%s:\n", buf);
if ((stat (dp->d_name, &sc) < 0) && (errno == ENOENT)) {
if (mkdir (dp->d_name, 0777) < 0 ||
stat (dp->d_name, &sc) < 0) {
perror (dp->d_name);
continue;
}
}
if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) {
msg ("%s: is a link instead of a directory\n", dp->d_name);
continue;
}
if (chdir (dp->d_name) < 0) {
perror (dp->d_name);
continue;
}
dodir (buf, &sb, &sc, (buf[0] != '/'));
if (chdir ("..") < 0)
quiterr (1, "..");
continue;
}
}
/* non-directory */
if (symlink (buf, dp->d_name) < 0) {
int saverrno = errno;
int symlen;
symlen = readlink(dp->d_name, symbuf, sizeof(symbuf) - 1);
errno = saverrno;
if (symlen > 0)
symbuf[symlen] = '\0';
if (symlen < 0 || strcmp(symbuf, buf))
perror (dp->d_name);
}
}
closedir (df);
return 0;
}
main (ac, av)
int ac;
char **av;
{
char *fn, *tn;
struct stat fs, ts;
silent = 0;
if (ac > 1 && !strcmp(av[1], "-silent")) {
silent = 1;
}
if (ac < silent + 2 || ac > silent + 3)
quit (1, "usage: %s [-silent] fromdir [todir]", av[0]);
fn = av[silent + 1];
if (ac == silent + 3)
tn = av[silent + 2];
else
tn = ".";
/* to directory */
if (stat (tn, &ts) < 0)
quiterr (1, tn);
if (!(ts.st_mode & S_IFDIR))
quit (2, "%s: Not a directory", tn);
if (chdir (tn) < 0)
quiterr (1, tn);
/* from directory */
if (stat (fn, &fs) < 0)
quiterr (1, fn);
if (!(fs.st_mode & S_IFDIR))
quit (2, "%s: Not a directory", fn);
exit (dodir (fn, &fs, &ts, 0));
}