ex_set.c revision f6db9f272f0061301cfaa1c0001b7d636eae31f4
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/* Copyright (c) 1981 Regents of the University of California */
#pragma ident "%Z%%M% %I% %E% SMI"
#include "ex.h"
#include "ex_temp.h"
#include "ex_tty.h"
/*
* Set command.
*/
void
set(void)
{
unsigned char *cp;
int c;
bool no;
extern short ospeed;
#ifdef TRACE
int k, label;
#endif
setnoaddr();
if (skipend()) {
ignchar();
propts();
return;
}
do {
do {
*cp = 0;
if (inopen)
pofix();
prall();
goto next;
}
no = 0;
#ifdef TRACE
/*
* General purpose test code for looking at address of those
* invisible marks (as well as the visible ones).
*/
viprintf("Marks Address\n\r");
viprintf(" \n");
viprintf("\n");
for (k = 0; k <= 25; k++)
goto next;
}
/*
* General purpose test code for looking at
* named registers.
*/
if (inopen)
pofix();
shownam();
goto next;
}
/*
* General purpose test code for looking at
* numbered registers.
*/
if (inopen)
pofix();
shownbr();
goto next;
}
/*
* General purpose test code for looking at addresses
* in the edit and save areas of VI.
*/
if (inopen)
pofix();
viprintf("\nLabels Address Contents\n");
viprintf("====== ======= ========");
label =0;
viprintf("ZERO:\t");
label = 2;
}
if (label > 0)
viprintf("\nONE:\t");
else
viprintf("ONE:\t");
label = 1;
}
if (label > 0)
viprintf("\nDOT:\t");
else
viprintf("DOT:\t");
label = 1;
}
if (label > 0)
viprintf("\nUNDAP1:\t");
else
viprintf("UNDAP1:\t");
label = 1;
}
if (label > 0)
viprintf("\nUNDAP2:\t");
else
viprintf("UNDAP2:\t");
label = 1;
}
if (label > 0)
viprintf("\nUNDDEL:\t");
else
viprintf("UNDDEL:\t");
label = 1;
}
if (label > 0)
viprintf("\nDOL:\t");
else
viprintf("DOL:\t");
label = 1;
}
for (k=0; k<=25; k++)
if (label > 0)
else
label=1;
}
if (label == 0)
continue;
if (label == 2)
else {
putchar('\n');
}
}
label =0;
viprintf("DOL+1:\t");
label = 1;
}
if (label > 0)
viprintf("\nUNDDEL:\t");
else
viprintf("UNDDEL:\t");
label = 1;
}
if (label > 0)
viprintf("\nUNDDOL:\t");
else
viprintf("UNDDOL:\t");
label = 1;
}
for (k=0; k<=25; k++)
if (label > 0)
else
label=1;
}
if (label == 0)
continue;
if (label == 2)
else {
putchar('\n');
}
}
goto next;
}
#endif
cp += 2;
no++;
}
/* Implement w300, w1200, and w9600 specially */
(void)getchar(); /* = */
(void)getnum(); /* value */
continue;
}
cp = (unsigned char *)"window";
goto dontset;
cp = (unsigned char *)"window";
goto dontset;
cp = (unsigned char *)"window";
}
break;
gettext("%s: No such option") :
(unsigned char *)
c = skipwh();
if (peekchar() == '?') {
ignchar();
noonl();
goto next;
}
goto next;
}
if (no)
serror((unsigned char *)
if (c != 0 || setend())
goto printone;
if (getchar() != '=')
gettext("Missing =") :
(unsigned char *)
gettext("Missing = in assignment to option %s"),
case NUMERIC:
if (value(vi_TABSTOP) <= 0)
}
break;
case STRING:
case OTERM:
while (!setend()) {
/* adb change: allow whitepace in strings */
cp++;
}
*cp = 0;
/*
* At first glance it seems like we shouldn't care if the terminal type
* is changed inside visual mode, as long as we assume the screen is
* a mess and redraw it. However, it's a much harder problem than that.
* If you happen to change from 1 crt to another that both have the same
* size screen, it's OK. But if the screen size if different, the stuff
* that gets initialized in vop() will be wrong. This could be overcome
* by redoing the initialization, e.g. making the first 90% of vop into
* a subroutine. However, the most useful case is where you forgot to do
* a setenv before you went into the editor and it thinks you're on a dumb
* terminal. Ex treats this like hardcopy and goes into HARDOPEN mode.
* This loses because the first part of vop calls oop in this case.
*/
if (inopen)
unterm();
} else {
}
break;
}
next:
flush();
} while (!skipend());
eol();
}
void
unterm(void)
{
/*
* All terminal mapped statements must be deleted.
* All user-defined mapped statements, cap=descr,
* are left unchanged.
*/
int i;
for (i=0; i < MAXNOMACS; i++) {
/*
* Unmap any terminal-defined arrow keys
*/
/*
* Unmap any terminal-defined function keys
*/
}
}
int
setend(void)
{
}
void
prall(void)
{
gotab(24);
gotab(56);
}
putNFL();
}
}
void
propts(void)
{
continue;
case ONOFF:
case NUMERIC:
continue;
break;
case STRING:
continue;
break;
}
putchar(' ');
}
noonl();
flush();
}
void
{
unsigned char *name;
case ONOFF:
break;
case NUMERIC:
break;
case STRING:
case OTERM:
break;
}
}