english
version "1.0"
identify "wxyz"

# Copyright (c) 1998-1999 by Wayne C. Gramlich.
# All rights reserved.
#
# Permission to use, copy, modify, distribute, and sell this software
# for any purpose is hereby granted without fee provided that the above
# copyright notice and this permission are retained.  The author makes
# no representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.

module swit_tcl_command

#: This module implements TCL command portion of SWIT.


#: {tcl_command} procedures

procedure base64_append@tcl_command
    takes
	tcl_command tcl_command
	data string
    returns_nothing

    #: This procedure will append {data} to {tcl_command} as a base0-64
    #, string.  This is used to ship raw data over to the gif decoder in
    #, Tk.

    #, The 24-bits in the 3 bytes is grabbed 6 bits a time and
    #, converted into A-Z, a-z, +, and / in 0-63.  When the number
    #, of characters to be encoded is not an even multiple of 3,
    #, an = sign is used to pad out the last four character sequence.


procedure create@tcl_command
    takes_nothing
    returns tcl_command

    #: This procedure will create and return a {tcl_command} object:


procedure character_append@tcl_command
    takes
	tcl_command tcl_command
	character character
    returns_nothing

    #: This procedure will append {character} to {tcl_command}.


procedure color_append@tcl_command
    takes
	tcl_command tcl_command
	color color
    returns_nothing

    #: This procedure will append {character} to {tcl_command}.


procedure command_append@tcl_command
    takes
	tcl_command tcl_command
	command string
    returns_nothing

    #: This procedurw will append {command} to {tcl_command}.


procedure group_tag_append@tcl_command
    takes
	tcl_command tcl_command
	uid unsigned
    returns_nothing

    #: This procedure will append {uid} to {tcl_command} preceeded by
    #, a space and the letter "T".


procedure integer_append@tcl_command
    takes
	tcl_command tcl_command
	number integer
    returns_nothing

    #: This procedure will append number to {tcl_command} preceeded by
    #, a space.


procedure option_append@tcl_command
    takes
	tcl_command tcl_command
	option string
    returns_nothing

    #: This procedure will append {option} to {tcl_command}.


procedure send@tcl_command
    takes
	tcl_command tcl_command
	write_channel write_channel[clone]
    returns logical

    #: This procedure will send as much of {tcl_command} to {write_channel}
    #, as {write_channel} can take.  If the entire contents of {tcl_command}
    #, are sent, {true}@{logical} is returned; otherwise {false} is returned
    #, and this procedure will be called again.


procedure raw_string_append@tcl_command
    takes
	tcl_command tcl_command
	string string
    returns_nothing

    #: This procedure will append {string} to {tcl_command}.
    #, This command is dumb in the sense that the characters
    #, are appended without any further processing.


procedure space_append@tcl_command
    takes
	tcl_command tcl_command
    returns_nothing

    #: This procedure will append a space to {tcl_command}.


procedure string_append@tcl_command
    takes
	tcl_command tcl_command
	string string
    returns_nothing

    #: This procedure will append {string} to {tcl_command}.
    #, This command is dumb in the sense that the characters
    #, are appended without any further processing.


procedure quoted_string_append@tcl_command
    takes
	tcl_command tcl_command
	string string
    returns_nothing

    #: This procedure will append {string} to {tcl_command}
    #, as a double quoted string with a preceeding space.
    #, Any necessary back slash quoting is performed.


procedure tag_append@tcl_command
    takes
	tcl_command tcl_command
	uid unsigned
    returns_nothing

    #: This procedure will append {uid} to {tcl_command} preceeded by
    #, a space and the letter "T".


procedure unsigned_append@tcl_command
    takes
	tcl_command tcl_command
	number unsigned
    returns_nothing

    #: This procedure will append number to {tcl_command} preceeded by
    #, a space.