xref: /csrg-svn/usr.bin/window/wwerror.c (revision 34909)
118742Sedward /*
233514Sbostic  * Copyright (c) 1983 Regents of the University of California.
333514Sbostic  * All rights reserved.
433514Sbostic  *
533514Sbostic  * Redistribution and use in source and binary forms are permitted
6*34909Sbostic  * provided that the above copyright notice and this paragraph are
7*34909Sbostic  * duplicated in all such forms and that any documentation,
8*34909Sbostic  * advertising materials, and other materials related to such
9*34909Sbostic  * distribution and use acknowledge that the software was developed
10*34909Sbostic  * by the University of California, Berkeley.  The name of the
11*34909Sbostic  * University may not be used to endorse or promote products derived
12*34909Sbostic  * from this software without specific prior written permission.
13*34909Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*34909Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*34909Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1618742Sedward  */
1718742Sedward 
1833514Sbostic #ifndef lint
19*34909Sbostic static char sccsid[] = "@(#)wwerror.c	3.5 (Berkeley) 06/29/88";
2033514Sbostic #endif /* not lint */
2133514Sbostic 
2214963Sedward #include "ww.h"
2314963Sedward 
2414963Sedward char *
2514963Sedward wwerror()
2614963Sedward {
2714963Sedward 	extern errno;
2814963Sedward 	extern char *sys_errlist[];
2914963Sedward 
3014963Sedward 	switch (wwerrno) {
3114963Sedward 	case WWE_NOERR:
3214963Sedward 		return "No error";
3314963Sedward 	case WWE_SYS:
3414963Sedward 		return sys_errlist[errno];
3514963Sedward 	case WWE_NOMEM:
3614963Sedward 		return "Out of memory";
3714963Sedward 	case WWE_TOOMANY:
3814963Sedward 		return "Too many windows";
3914963Sedward 	case WWE_NOPTY:
4014963Sedward 		return "Out of pseudo-terminals";
4114963Sedward 	case WWE_SIZE:
4214963Sedward 		return "Bad window size";
4314963Sedward 	case WWE_BADTERM:
4414963Sedward 		return "Unknown terminal type";
4514963Sedward 	case WWE_CANTDO:
4614963Sedward 		return "Can't run window on this terminal";
4714963Sedward 	default:
4814963Sedward 		return "Unknown error";
4914963Sedward 	}
5014963Sedward }
51