paren.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
* All Rights Reserved.
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
# include "e.h"
#ifndef NEQN
#else NEQN
#endif NEQN
if( n<2 ) n = 1;
m = n-2;
n = n%2 ? n : ++n;
if( n<3 ) n=3;
m = n-3;
}
#ifndef NEQN
#else NEQN
if (n%2 == 0)
#endif NEQN
switch( leftc ) {
case 'n': /* nothing */
case '\0':
break;
case 'f': /* floor */
if (n <= 1)
printf("\\(lf");
else
break;
case 'c': /* ceiling */
if (n <= 1)
printf("\\(lc");
else
break;
case '{':
printf("\\b'\\(lt");
printf("\\(lk");
printf("\\(lb'");
break;
case '(':
break;
case '[':
break;
case '|':
break;
default:
break;
}
if( rightc ) {
printf("\\|\\v'%du'", v);
switch( rightc ) {
case 'f': /* floor */
if (n <= 1)
printf("\\(rf");
else
break;
case 'c': /* ceiling */
if (n <= 1)
printf("\\(rc");
else
break;
case '}':
printf("\\b'\\(rt");
printf("\\(rk");
printf("\\(rb'");
break;
case ']':
break;
case ')':
break;
case '|':
break;
default:
break;
}
printf("\\v'%du'", -v);
}
printf("\n");
}
brack(m, t, c, b) int m; char *t, *c, *b; {
int j;
printf("\\b'%s", t);
for( j=0; j<m; j++)
printf("%s", c);
printf("%s'", b);
}