Main Page   Compound List   File List   Compound Members   File Members  

zformat.vtc File Reference

Miscellaneous string-formatting code for vt. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

func clean_string (s)[buf, t]
 Translates non-printable characters to printable equivalents. More...

func fold_newlines (s)[buf, p, q, i]
 Collapse newlines into spaces. More...

func sh_quote (s)[r, p]
 Quote a string, suitable for passing it as a command-line parameter. More...

func softwrap (str, width)[result, p]
 Break a string into multiple lines no longer than a particular length. More...


Detailed Description

Miscellaneous string-formatting code for vt.

Author:
David Maze <dmaze@mit.edu>
Version:
$Id$

This file provides several miscellaneous functions that are useful for formatting strings for presentation to the user or to pass to system commands.

Definition in file zformat.vtc.


Function Documentation

func clean_string ( s )
 

Translates non-printable characters to printable equivalents.

Character code 1 is converted to "^A", 2 to "^B", etc.

Parameters:
s   The string to translate
Returns:
The translated string

Definition at line 20 of file zformat.vtc.

Referenced by make_line(), and zephyr_output().

func fold_newlines ( s )
 

Collapse newlines into spaces.

Also removes leading and trailing whitespace on each line.

Parameters:
s   The string to translate
Returns:
The translated string

Definition at line 44 of file zformat.vtc.

Referenced by make_line(), and zephyr_output().

func sh_quote ( s )
 

Quote a string, suitable for passing it as a command-line parameter.

Parameters:
s   The string to translate
Returns:
The translated string

Definition at line 76 of file zformat.vtc.

Referenced by zout_std_args().

func softwrap ( str,
width )
 

Break a string into multiple lines no longer than a particular length.

Like the vt wrap() primitive, but does't wrap in the middle of words. Doesn't support the indent and start position arguments for now.

Parameters:
str   String to word-wrap
width   Maximum line length
Returns:
The word-wrapped string

Definition at line 98 of file zformat.vtc.

Referenced by zephyr_outbound().


Generated at Mon Aug 13 16:45:55 2001 for dzm-vtc by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001