xref: /csrg-svn/usr.bin/window/wwerror.c (revision 42422)
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
634909Sbostic  * provided that the above copyright notice and this paragraph are
734909Sbostic  * duplicated in all such forms and that any documentation,
834909Sbostic  * advertising materials, and other materials related to such
934909Sbostic  * distribution and use acknowledge that the software was developed
1034909Sbostic  * by the University of California, Berkeley.  The name of the
1134909Sbostic  * University may not be used to endorse or promote products derived
1234909Sbostic  * from this software without specific prior written permission.
1334909Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1434909Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1534909Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1618742Sedward  */
1718742Sedward 
1833514Sbostic #ifndef lint
19*42422Sbostic static char sccsid[] = "@(#)wwerror.c	3.6 (Berkeley) 05/28/90";
2033514Sbostic #endif /* not lint */
2133514Sbostic 
2214963Sedward #include "ww.h"
2314963Sedward 
2414963Sedward char *
2514963Sedward wwerror()
2614963Sedward {
27*42422Sbostic 	extern int errno;
28*42422Sbostic 	char *strerror();
2914963Sedward 
3014963Sedward 	switch (wwerrno) {
3114963Sedward 	case WWE_NOERR:
3214963Sedward 		return "No error";
3314963Sedward 	case WWE_SYS:
34*42422Sbostic 		return strerror(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