general_header.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * CDDL HEADER START
  3. *
  4. * The contents of this file are subject to the terms of the
  5. * Common Development and Distribution License (the "License").
  6. * You may not use this file except in compliance with the License.
  7. *
  8. * You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
  9. * or http://www.opensolaris.org/os/licensing.
  10. * See the License for the specific language governing permissions
  11. * and limitations under the License.
  12. *
  13. * When distributing Covered Code, include this CDDL HEADER in each
  14. * file and include the License file at src/OPENSOLARIS.LICENSE.
  15. * If applicable, add the following below this CDDL HEADER, with the
  16. * fields enclosed by brackets "[]" replaced with your own identifying
  17. * information: Portions Copyright [yyyy] [name of copyright owner]
  18. *
  19. * CDDL HEADER END
  20. */
  21. /*
  22. * Copyright (c) 1999 by Sun Microsystems, Inc.
  23. * All rights reserved.
  24. */
  25. #ifndef _GENERAL_HEADER_H
  26. #define _GENERAL_HEADER_H
  27. #include <sys/types.h>
  28. /* #include <nl_types.h> */
  29. #define WARN_SET 1
  30. #define ERR_SET 2
  31. #define USAGE_SET 3
  32. #ifndef MAXPATHLEN
  33. #define MAXPATHLEN 1024
  34. #endif
  35. #define MAXLINE 4096
  36. #define MAX_ENV_STRING 1024
  37. #define MAXLEN 4096 /* Maximum input line length */
  38. #define PTSZ_SCALE 10
  39. #define DEF_PTSZ 10
  40. #define TP1_STYLE 1
  41. #define TTF_STYLE 2
  42. #define PCF_STYLE 3
  43. #define DEFAULT_STYLE TP1_STYLE
  44. #define ROMNFONT 0
  45. #define BOLDFONT 1
  46. #define ITALFONT 2
  47. #define BDITFONT 3
  48. #define HDNGFONT 4
  49. #define DICTSIZE 256
  50. #define DICTTYPES 4
  51. #define FEND 0
  52. #define NRML 1
  53. #define IS_PCF(x) (print_info_st[x].font_style==PCF_STYLE)
  54. #define IS_TTF(x) (print_info_st[x].font_style==TTF_STYLE)
  55. #define IS_TP1(x) (print_info_st[x].font_style==TP1_STYLE)
  56. #define SPACE_WIDTH_PER_PTSZ 0.5866667
  57. #define TAB_STOPS 8
  58. #define ends_with_NL(s) (s[strlen(s)-1] == '\n')
  59. #define zapNL(s) (s[strlen(s)-1] = '\0')
  60. #define CFFS_STR " \t"
  61. #define CMNT_CHAR '#'
  62. #define is_comment_char(c) (c == CMNT_CHAR)
  63. #define next_tok() strtok(NULL, CFFS_STR)
  64. #define next_string_tok() strtok(NULL, "\"")
  65. #define is_tab(c) ((c)=='\t')
  66. #define is_newline(c) ((c)=='\n')
  67. #define is_backspace(c) ((c)=='\010')
  68. #define is_formfeed(c) ((c)=='\014')
  69. #define non_graphic_char(u) ((u<=0x1f)||(u>=0x7f&&u<=0x9f))
  70. #define is_motion_char(u) (is_tab(u)||is_newline(u)||\
  71. is_formfeed(u)||is_backspace(u))
  72. #define eq(s1,s2) (strcmp((s1),(s2)) == 0)
  73. #define eqn(s1,s2,n) (strncmp((s1),(s2),n) == 0)
  74. typedef unsigned int ucs4_t;
  75. #ifndef _XLIB_H_
  76. typedef int Bool;
  77. #endif
  78. /*extern nl_catd cat_fd ;
  79. //extern char *progname;
  80. //extern int current_pt_sz;
  81. //extern int set_pt_sz;
  82. //extern int mp_newdict_flg; */
  83. /*
  84. extern int printstyle;
  85. */
  86. /*extern int pcf_ret, ttf_ret, tp1_ret;
  87. //extern double SPACINGwidth;
  88. //extern ucs4_t SPACINGchar;
  89. //extern ucs4_t REFERENCEchar;
  90. //extern char *target_printer ;
  91. //extern int gen_incremental_pos(ucs4_t , double *, double *);
  92. //extern int presform_fontndx(ucs4_t);
  93. //extern int pres_pcfbm();
  94. //extern void err_exit(char *, ...);
  95. //extern void malloc_err_disp_exit(int , char *);
  96. //extern void set_xpr_headings(char *, unsigned char *, int);
  97. //extern void xpr_print(unsigned char *, int, int);
  98. //extern void xpr_end(); */
  99. #endif /* _GENERAL_HEADER_H */