home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name PRERROR -- Return a string corresponding to one
- * of the errors returned by the PR
- * function family.
- *
- * Synopsis errstr = prerror (errnum);
- *
- * const char *errstr Pointer to a static string (null-
- * terminated) that explains the
- * errnum error code.
- *
- * int errnum Error code received from another
- * PR call.
- *
- * Description This function returns a pointer to a static
- * text representation of a print spooler error.
- *
- * Note: If the string returned is modified, there
- * will be unknown consequences.
- *
- * Special If the errnum passed to the function is unknown,
- * Cases the error string returned is "unknown error".
- *
- * Returns errstr Address of a static string
- * describing the spooler error
- * reported by another PR function.
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1987,1989
- *
- **/
-
- #include <bprint.h>
-
- #define PR_NUM_MAP 16 /* Number of elements in the error */
- /* mapping array. */
-
- #define PR_NUM_ERRS 13 /* Number of actual error messages. */
-
-
- static const int err_map[] =
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, 10, -1, -1, 11, 12};
-
- static const char *errors [] =
- {
- "no error",
- "spooler not installed",
- "file not found",
- "path not found",
- "out of handles",
- "access denied",
- "queue empty",
- "out of range",
- "queue full",
- "spooler busy",
- "path too long",
- "invalid drive",
- "unknown error"
- };
-
-
- const char *prerror (err)
-
- int err;
-
- {
- if ((err < 0) || (err > PR_NUM_MAP) || (err_map [err] == -1))
- err = PR_NUM_MAP;
-
- return (errors [err_map [err]]);
- }