home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / SCANCHAR.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  3KB  |  61 lines

  1. /* Copyright (C) 1990, 1991, 1994 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* scanchar.h */
  20. /* Character scanning table for Ghostscript */
  21. /* Requires scommon.h */
  22.  
  23. /* An array for fast scanning of names, numbers, and hex strings. */
  24. /*  Indexed by character code (including exceptions), it contains: */
  25. /*    0 - max_radix-1 for valid digits, */
  26. /*    ctype_name for other characters valid in names, */
  27. /*    ctype_btoken for characters introducing binary tokens */
  28. /*      (if the binary token feature is enabled), */
  29. /*    ctype_space for whitespace characters, */
  30. /*    ctype_exception for exceptions (see scommon.h), and */
  31. /*    ctype_other for everything else. */
  32. /* This table is defined in iscan.c, used in iscan.c and stream.c. */
  33. /* NOTE: If any of the values below change, you must edit the table. */
  34. /* Exceptions are negative values; we bias the table origin accordingly. */
  35. extern const byte scan_char_array[max_stream_exception + 256];
  36. #define scan_char_decoder (&scan_char_array[max_stream_exception])
  37. #define min_radix 2
  38. #define max_radix 36
  39. #define ctype_name 100
  40. #define ctype_btoken 101
  41. #define ctype_space 102
  42. #define ctype_other 103
  43. #define ctype_exception 104
  44. /* Special characters with no \xxx representation */
  45. #define char_NULL 0
  46. #define char_VT 013            /* ^K, vertical tab */
  47. #define char_DOS_EOF 032        /* ^Z */
  48. /*
  49.  * Most systems define '\n' as 0x0a and '\r' as 0x0d; however, OS-9
  50.  * has '\n' = '\r' = 0x0d and '\l' = 0x0a.  To deal with this,
  51.  * we introduce abstract characters char_CR and char_EOL such that
  52.  * any of [char_CR], [char_CR char_EOL], or [char_EOL] is recognized
  53.  * as an end-of-line sequence.
  54.  */
  55. #define char_CR '\r'
  56. #if '\r' == '\n'
  57. #  define char_EOL '\l'
  58. #else
  59. #  define char_EOL '\n'
  60. #endif
  61.