FORTRAN Interface:

    gopwk(integer wkid, integer conid, integer wtype)

    if (wtype == 1 || wtype == 2) {
	if (conid == FORTRAN LUN) {
	    use name associated with FORTRAN LUN as filename
	} else {
	    use last gescid() argument as filename
	}
	if (filename contains '.cgm') {
	    open filename as CGM
	} else {
	    open filename as GKSM
	}
    } else if (wtype == 3) {
	open WISS `workstation'
    } else if (wtype == 4) {
	if (gescid() called) {
	    use last gescid() argument as hostname:display[.screen]
	} else {
	    use DISPLAY environment variable as hostname:display[.screen]
	}
    }

    NB:
	    wtype	type
	    -----	----
	    1		MI
	    2		MO
	    3		WISS
	    4		X


C Interface:

    gopenws(int ws_id, char *connection, char *ws_type)


    if (ws_type == NULL)
	ws_type	= connection;

    if (ws_type == "MI" || ws_type == "MO") {
	if (connection contains ".cgm") {
	    open file connection as CGM
	} else {
	    open file connection as GKSM
	}
    } else if (ws_type == "WISS") {
	open WISS `workstation'
    } else if (ws_type == NULL || ws_type contains ':') {
	if (connection != NULL) {
	    use connection as hostname:display[.screen]
	} else {
	    use DISPLAY environment variable as hostname:display[.screen]
	}
    }

    NB:
	    wtype	type
	    -----	----
	    "MI"	MI
	    "MO"	MO
	    "WISS"	WISS
	    NULL	X
