home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-01 | 9.4 KB | 249 lines | [TEXT/KAHL] |
- /*
- * device.c -- cawf(1) output device support functions
- */
-
- /*
- * Copyright (c) 1991 Purdue University Research Foundation,
- * West Lafayette, Indiana 47907. All rights reserved.
- *
- * Written by Victor A. Abell <abe@cc.purdue.edu>, Purdue University
- * Computing Center. Not derived from licensed software; derived from
- * awf(1) by Henry Spencer of the University of Toronto.
- *
- * Permission is granted to anyone to use this software for any
- * purpose on any computer system, and to alter it and redistribute
- * it freely, subject to the following restrictions:
- *
- * 1. The author is not responsible for any consequences of use of
- * this software, even if they arise from flaws in it.
- *
- * 2. The origin of this software must not be misrepresented, either
- * by explicit claim or by omission. Credits must appear in the
- * documentation.
- *
- * 3. Altered versions must be plainly marked as such, and must not
- * be misrepresented as being the original software. Credits must
- * appear in the documentation.
- *
- * 4. This notice may not be removed or altered.
- */
-
- #include "cawf.h"
- #include <ctype.h>
-
- _PROTOTYPE(static unsigned char *Convstr,(char *s, int *len));
- _PROTOTYPE(static int Convfont,(char *nm, char *s, char **fn,
- unsigned char **fi));
-
- #if defined(__EMX__)
- #define strcasecmp stricmp
- #else /* !defined(__EMX__) */
- # if !defined(UNIX)
- #define strcasecmp strcmpi
- # endif /* !defined(UNIX) */
- #endif /* defined(__EMX__) */
-
-
-
- /*
- * Convstr(s, len) - convert a string
- */
-
- static unsigned char *
- Convstr(s, len)
- char *s; /* input string */
- int *len; /* length of result */
- {
- int c; /* character assembly */
- unsigned char *cp; /* temporary character pointer */
- char *em; /* error message */
- int i; /* temporary index */
- int l; /* length */
- unsigned char *r; /* result string */
- /*
- * Make space for the result.
- */
- if ((r = (unsigned char *)malloc(strlen((char *)s) + 1)) == NULL) {
- (void) fprintf(stderr, "%s: out of string space at %s\n",
- Pname, s);
- return(NULL);
- }
- /*
- *