---
name: "cv2xview"
section: "1x"
platform: "linux"
package: "xviewg-dev"
version: "3.2p1.4-5"
release: "Debian 2.1 (Slink)"
platforms: ["linux"]
url: "https://new.carta.tech/cv2xview"
---

# cv2xview(1x)

convert a SunView1 source program to XView source

## NAME

convert\_to\_xview - convert a SunView1 source program to XView source

## SYNOPSIS

**convert\_to\_xview** \[ **-m** \]  *filename...*

## AVAILABILITY

This command is available with the XView software distribution.

## DESCRIPTION

**convert\_to\_xview** is a shell script which uses  [sed(1)](/sed/1.md)  scripts to convert  *SunView1.x* programs to the XView Application Programming Interface (API).   **convert\_to\_xview** parses filename and creates a new file with  the XView API in the current directory called  **filename.converted\_to\_xview.** The default conversion that is done is called FULL conversion.   FULL conversion of SunView source converts  everything to XView naming conventions regardless of API compatibility support  (e.g., changes  **WIN\_FONT** to  **XV\_FONT** even though  **WIN\_FONT** would still work).

The other type of conversion is called MINIMAL conversion.  MINIMAL conversion retains SunView  compatibility wherever possible and inserts a unique flag and comments at every instance  where manual conversion is necessary in C language source comment form.   The flag and comments will look something like this:

	**#ifdef XVIEW\_COMMENT**\
 	**XView CONVERSION - Make sure to use xv\_init to process the attrs**\
 	**first. Sect 3.2**\
 **#endif**

The original SunView1.x file is not modified.   After the file is converted, you should  then search for

**XView CONVERSION**

in the new converted program  **(filename.converted\_to\_xview).** Use the conversion  documentation, XView 1.0 Reference Manual: Converting SunView Applications,  to determine the proper conversion for these flagged items.   In some possible cases, the comments may make references to sections in  the manual which should be consulted to correctly convert something.

## OPTIONS

- \[-m\]

  Perform minimal conversion only.

## ENVIRONMENT

The script recognizes the environment variable $OPENWINHOME as the  root directory for the installation point for  **convert\_to\_xview.** By default it should be installed into the root directory '/'.   Additionally, the [sed(1)](/sed/1.md) scripts  that are used by  **convert\_to\_xview** must be located in the  **$OPENWINHOME/conversion** directory.

## EXAMPLES

Convert foo.c from SunView1 to XView:

**% convert\_to\_xview foo.c**\
 **----Converting File: foo.c**\
 **--Done**\
 **%**

Now go in and edit (with your favorite text editor such as vi,textedit,  etc.) the result of the conversion  (my\_program.c.converted\_to\_xview) and see if there is anythingthat  didn't get converted:

**% textedit foo.c.converted**

Do only minimal conversion of my\_program.c & your\_program.c to XView:

**% convert\_to\_xview -m foo.c blah.c**\
 **----Converting File: foo.c**\
 **----Converting File: blah.c**\
 **--Done**\
 **%**\
 The above would create two files new files and each will only had minimal conversion performed (just flags inserted).

## FILES

**$OPENWINHOME/bin/xview/convert\_to\_xview**\
 **$OPENWINHOME/bin/xview/convert\_to\_xview.README** (this file)

Where $OPENWINHOME is the installation/mount point for XView.

## SEE ALSO

**sunview(1), [sed(1)](/sed/1.md), [textedit(1)](/textedit/1.md), [vi(1)](/vi/1.md), [sh(1)](/sh/1.md)**
