From: karl@claude.cs.umb.edu (Karl Berry)
Subject: rt internal compiler dump
Reply-To: karl@cs.umb.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 8 Jan 1993 05:31:50 GMT

gcc 2.3.3 on an IBM RT running 4.3 bsd (configured as romp-aos), gets an
internal compiler error on the following file.  Only option is -g.

# 1 "pstype1.c"
 


















# 1 ".././include/config.h" 1
 





















 
# 1 ".././include/c-auto.h" 1
 
 

 


 


 


 


 


 


 


 


 


 


 


 


 


 

# 24 ".././include/config.h" 2


 



 
# 1 ".././include/c-std.h" 1
 




















 


# 1 "/usr/include/math.h" 1 3
 



 
 
 





 

extern double asinh(), acosh(), atanh();
extern double erf(), erfc();
extern double fabs(), floor(), ceil(); 
extern double modf(), ldexp(), frexp(), atof();
extern double sqrt(), cbrt();
extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2();
extern double expm1(), log1p(), exp(), log(), log10(), pow();
extern double sinh(), cosh(), tanh();
extern double hypot(), cabs(), lgamma();
extern double j0(), j1(), jn(), y0(), y1(), yn();






# 25 ".././include/c-std.h" 2

# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 1 3

# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 1 3
 







































 






typedef void *__gnuc_va_list;



 

# 85 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3










# 137 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3





# 2 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 2 3

 



 
 
 





 









extern	struct	_iobuf {
	int	_cnt;
	char	*_ptr;		 
	char	*_base;		 
	int	_bufsiz;
	short	_flag;
	char	_file;		 
} _iob[];










		


























struct _iobuf 	*fopen();
struct _iobuf 	*fdopen();
struct _iobuf 	*freopen();
struct _iobuf 	*popen();
long	ftell();
char	*fgets();
char	*gets();




# 26 ".././include/c-std.h" 2


 
# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/sys/types.h" 1 3
 



 
 
 








 







 



 


 


 


typedef	unsigned char	u_char;
typedef	unsigned short	u_short;
typedef	unsigned int	u_int;
typedef	unsigned long	u_long;
typedef	unsigned short	ushort;		 








typedef	struct	_physadr { int r[1]; } *physadr;
typedef	struct	label_t	{
	int	val[11];
} label_t;


typedef	struct	_quad { long val[2]; } quad;
typedef	long	daddr_t;
typedef	char *	caddr_t;
typedef	u_long	ino_t;
typedef	long	swblk_t;


typedef	long	size_t;

typedef	long	time_t;
typedef	short	dev_t;
typedef	long	off_t;
typedef	u_short	uid_t;
typedef	u_short	gid_t;

typedef signed char prio_t;	 





 









typedef long	fd_mask;





typedef	struct fd_set {
	fd_mask	fds_bits[(((256 )+(( (sizeof(fd_mask) * 8		)	)-1))/( (sizeof(fd_mask) * 8		)	)) ];
} fd_set;







 



typedef struct qhdr {
	struct qhdr *link, *rlink;
} *queue_t;




# 29 ".././include/c-std.h" 2


 



 








 




extern char *getenv ();







extern void  *calloc (), *malloc (), *realloc ();


 
extern struct _iobuf  *popen ();
extern double hypot ();


# 31 ".././include/config.h" 2


 
# 1 ".././include/c-memstr.h" 1
 






















 


# 1 "/usr/include/string.h" 1 3
 



 
 
 





 







# 1 "/usr/include/strings.h" 1 3
 



 
 
 





 







 



char	*strcat();
char	*strncat();
int	strcmp();
int	strncmp();
char	*strcpy();
char	*strncpy();
int	strlen();
char	*index();
char	*rindex();
# 21 "/usr/include/string.h" 2 3


 



extern char *strcpyn();
extern char *strcatn();
extern int strcmpn();

 




extern char *strchr();
extern char *strrchr();
extern char *strpbrk();
extern int strspn();
extern int strcspn();
extern char *strtok();
# 27 ".././include/c-memstr.h" 2


 

# 1 "/usr/include/memory.h" 1 3
 



 
 
 





 







 



extern char *memccpy();
extern char *memchr();
extern int memcmp();
extern char *memcpy();
extern char *memset();
# 31 ".././include/c-memstr.h" 2
















# 60 ".././include/c-memstr.h"



# 34 ".././include/config.h" 2


 
# 1 ".././include/c-errno.h" 1
 




















# 1 "/usr/include/errno.h" 1 3
 




 
 
 






# 1 "/usr/include/sys/nfs_defines.h" 1 3
 




 
 
 





 



 





















# 15 "/usr/include/errno.h" 2 3



 







 




































 



 






 

	 













	 













	 



 




 

















 



 




# 22 ".././include/c-errno.h" 2


extern int errno;



# 37 ".././include/config.h" 2


 
# 1 "/usr/local/gnu/include/assert.h" 1 3
 








# 19 "/usr/local/gnu/include/assert.h" 3




 





extern void __eprintf (const char *, const char *, unsigned, const char *);









# 50 "/usr/local/gnu/include/assert.h" 3



# 40 ".././include/config.h" 2


 
# 1 ".././include/c-minmax.h" 1
 





















# 1 ".././include/c-limits.h" 1
 

























# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/limits.h" 1 3



 



 



 



 





 



 












 





 



 





 



 






 




 





 






# 27 ".././include/c-limits.h" 2




# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/float.h" 1 3
 


 

    


    


    


    


    


    


    


    


    


    


    



    


    


    


    


    


    


    


    


    



    


    


    



union __convert_long_double {
  int __convert_long_double_i[4];
  long double __convert_long_double_d;
};


    


    


    


    


    


    




# 31 ".././include/c-limits.h" 2




# 23 ".././include/c-minmax.h" 2


 











































 















# 43 ".././include/config.h" 2


 
# 1 ".././include/c-seek.h" 1
 





























# 46 ".././include/config.h" 2


 





 
# 1 ".././include/c-proto.h" 1
 




















 




















# 59 ".././include/c-proto.h"



# 55 ".././include/config.h" 2


 
# 1 ".././include/global.h" 1
 





















# 1 ".././include/lib.h" 1
 




















# 1 ".././include/types.h" 1
 




















 
typedef enum { false = 0, true = 1 } boolean;

 






 
typedef char *string;

 
typedef void *address;

 
typedef double real;

 


typedef unsigned char charcode_type;


 
typedef unsigned char one_byte;
typedef signed char signed_byte;
typedef unsigned short two_bytes;
typedef short signed_2_bytes;
typedef unsigned int four_bytes;
typedef int signed_4_bytes;
typedef int byte_count_type;

 






 
typedef struct
{
  real real;
  real imag;
} complex;
typedef enum { first_complex_part, second_complex_part} complex_part_type;
typedef enum { polar_rep, rectangular_rep} complex_rep_type;


 
typedef struct
{
  unsigned height, width;
} dimensions_type;





 
typedef struct
{
  int x, y;
} coordinate_type;

typedef struct
{
  double x, y;
} real_coordinate_type;


# 22 ".././include/lib.h" 2


 
extern string concat (string s1,  string s2) ;
extern string concat3 (string,  string,  string) ;
extern string concat4 (string,  string,  string,  string) ;
extern string concat5 (string,  string,  string,  string,  string) ;


 
extern string xstrdup (string s) ;


 

extern boolean same_file_p (string filename1,  string filename2) ;


 

extern string find_suffix (string name) ;

 
extern string remove_suffix (string name) ;

 


extern string make_suffix (string s,  string suffix) ;

 


extern string make_prefix (string stem_prefix,  string name) ;

 

extern string extend_filename (string name,  string suffix) ;


 


extern address xmalloc (unsigned size) ;
extern address xrealloc (address old_address,  unsigned new_size) ;
extern address xcalloc (unsigned nelem,  unsigned elsize) ;

 






# 23 ".././include/global.h" 2



 

 
































 

 




 


 





 














 





 



 
extern string now (void);

 

extern boolean float_ok (string);
extern boolean integer_ok (string);

 
extern const unsigned atou (string);

 

extern string itoa (int);
extern string utoa (unsigned);
extern string xdtoa (double);

 

extern struct _iobuf  *xfopen (string filename, string mode);
extern void xfclose (struct _iobuf  *, string filename);
extern void xfseek (struct _iobuf  *, long, int, string filename);
extern four_bytes xftell (struct _iobuf  *, string filename);

 
extern void xrename (string from, string to);

 

extern string basename (string name);



 

extern void safe_free (address *p);


 

 






extern const boolean epsilon_equal (real v1, real v2);

 
extern const real acosd (real);

 
extern const real distance (real_coordinate_type, real_coordinate_type);
extern const real int_distance (coordinate_type, coordinate_type);

 
extern const real slope (real_coordinate_type, real_coordinate_type);

 
extern const real_coordinate_type int_to_real_coord (coordinate_type);
extern const coordinate_type real_to_int_coord (real_coordinate_type);

 
extern const boolean points_adjacent_p (int row1, int col1, int r2, int c2);

 
extern void find_bounds (real values[], unsigned value_count,
	                   real *the_min, real *the_max);

 
extern real *map_to_unit (real * values, unsigned value_count);


 

 

extern string substring (string source, const unsigned start,
                         const unsigned limit);

 
extern string lowercasify (string s);


 

 






extern charcode_type parse_charcode (string s, boolean *valid);

 

extern charcode_type xparse_charcode (string s);

 





# 58 ".././include/config.h" 2



# 20 "pstype1.c" 2


# 1 ".././include/bounding-box.h" 1
 























 

typedef struct
{
  signed_4_bytes min_row, max_row;
  signed_4_bytes min_col, max_col;
} bounding_box_type;

typedef struct
{
  real min_row, max_row;
  real min_col, max_col;
} real_bounding_box_type;

 






 





 

extern const bounding_box_type dimensions_to_bb (dimensions_type);
extern const dimensions_type bb_to_dimensions (bounding_box_type);


 
extern void update_real_bounding_box (real_bounding_box_type *bb,
                                      real_coordinate_type p);
extern void update_bounding_box (bounding_box_type *bb, coordinate_type p);


# 22 "pstype1.c" 2

# 1 ".././include/bzr.h" 1
 
























# 1 ".././include/font.h" 1
 




















# 1 ".././include/bitmap.h" 1
 























# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 1 3

# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 1 3
 







































 










 

# 85 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3










# 137 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3





# 2 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 2 3

 



 
 
 





 







# 80 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 3

# 25 ".././include/bitmap.h" 2





 





 
typedef struct
{
  dimensions_type dimensions;
  one_byte *bitmap;
} bitmap_type;

 


 



 



 


 







 


# 78 ".././include/bitmap.h"

 
 
extern bitmap_type new_bitmap (dimensions_type);

 
extern void free_bitmap (bitmap_type *);

 
extern bitmap_type copy_bitmap (bitmap_type bitmap);

 

extern bitmap_type extract_subbitmap (bitmap_type b, bounding_box_type bb);

 




extern const bounding_box_type bitmap_to_bb (const bitmap_type);

 




extern unsigned *bitmap_find_transitions (const one_byte *row, unsigned width);

 
extern void print_bounded_bitmap (struct _iobuf  *, bitmap_type, bounding_box_type);
extern void print_bitmap (struct _iobuf  *, bitmap_type);



# 22 ".././include/font.h" 2


# 1 ".././include/tfm.h" 1
 






















# 1 ".././include/fix-num.h" 1
 
























 
typedef long fix_word;

 


extern const real fix_to_real (fix_word);
extern const fix_word real_to_fix (real);


# 24 ".././include/tfm.h" 2

# 1 ".././include/list.h" 1
 























typedef struct
{
  address *list;
  unsigned size;
} list_type;

 


 


 


 



 
extern list_type list_init (void);
extern void list_free (list_type *);

 

extern address list_append (list_type *, unsigned element_size);

 



# 25 ".././include/tfm.h" 2




 

extern boolean tfm_open_input_file (string filename);
extern void tfm_close_input_file (void);

 
extern string tfm_input_filename (void);


 


extern boolean tfm_open_pl_output_file (string filename);
extern void tfm_close_pl_output_file (void);

 




extern void tfm_convert_pl (string tfm_name, boolean verbose);


 




 


 



 





 


 



typedef struct
{
  charcode_type first_charcode, last_charcode;
  four_bytes checksum;
  real design_size;
  string coding_scheme;
  unsigned parameter_count;
  real parameters[30 ];
} tfm_global_info_type;

 


 


 


 


 




 




 






























 






 
extern tfm_global_info_type tfm_get_global_info (void);

 


extern unsigned tfm_get_checksum (void);
extern double tfm_get_design_size (void);
extern string tfm_get_coding_scheme (void);
extern double tfm_get_interword_space (void);
extern double tfm_get_x_height (void);


 
extern tfm_global_info_type tfm_init_global_info (void);


 


extern void tfm_put_global_info (tfm_global_info_type);


 







extern void tfm_set_header (string s, tfm_global_info_type *tfm_info);

 

extern void tfm_set_design_size (real design_size,
                                 tfm_global_info_type *tfm_info);

 



extern void tfm_set_fontdimens (string s, tfm_global_info_type *info);

 

extern unsigned tfm_fontdimen_number (string s);

 


extern string tfm_fontdimen_name (unsigned n);

 

extern void tfm_set_fontdimen (tfm_global_info_type *info, unsigned p, real v);
			
 

extern void tfm_set_fontsize (tfm_global_info_type *tfm_info);

 




typedef struct
{
  boolean exists;
  charcode_type code;
  real width, height, depth, italic_correction;
  fix_word fix_width, fix_height, fix_depth, fix_italic_correction;
  list_type kern;
  list_type ligature;
} tfm_char_type;

 


 


 









 


 



 

extern tfm_char_type *tfm_get_chars (void);

 

extern tfm_char_type *tfm_get_char (charcode_type code);

 


extern tfm_char_type tfm_new_char (void);
extern tfm_char_type *tfm_new_chars (void);

 

extern void tfm_put_chars (tfm_char_type *);

 
extern void tfm_put_char (tfm_char_type c);

 



typedef struct
{
  charcode_type character;
  charcode_type ligature;
} tfm_ligature_type;

 
typedef struct
{
  charcode_type character;
  real kern;
} tfm_kern_type;


 

extern real tfm_get_kern (tfm_char_type left, charcode_type right);

 


extern void tfm_set_kern (list_type *kern_list, charcode_type right, real k);

 

extern void tfm_set_ligature (list_type *lig_list, charcode_type right,
			      charcode_type ligature);


# 24 ".././include/font.h" 2




 


typedef struct
{
  real design_size;
  string comment;
  unsigned checksum;
  string filename;  
} bitmap_font_type;

 





 



 


 



 




extern bitmap_font_type get_bitmap_font (string font_name, unsigned dpi);

 

 

typedef struct
{
  bitmap_font_type bitmap_font;
  tfm_global_info_type tfm_font;
  string tfm_filename;
} font_info_type;

 


 


 


 





 




 


extern font_info_type get_font (string font_name, unsigned dpi);

 
 
extern void close_font (string font_name);

 






typedef struct
{
  charcode_type code;
  int set_width;
  fix_word tfm_width;
  bounding_box_type bb;
  bitmap_type bitmap;
} char_info_type;

 


 



 



 





 



 



 






 


 





 









 



extern char_info_type *get_char (string font_name, charcode_type code);


 
extern void print_char (struct _iobuf  *f, char_info_type c);


 
extern bitmap_type string_to_bitmap (string text,
                                     string font_name, unsigned dpi);

 


typedef enum { pk_format, gf_format } bitmap_format_type;

typedef struct
{
  bitmap_format_type bitmap_format;
  charcode_type code;
  one_byte *bytes;
  unsigned allocated;
  unsigned used;
  bounding_box_type bb;
  signed_4_bytes h_escapement;
  fix_word tfm_width;
} raw_char_type;

 



 


 


 


 


 



 


extern raw_char_type *get_raw_char (string font_name,
                                    charcode_type code);

 

extern void free_raw_char (raw_char_type *raw_char);

 

 



 




# 26 ".././include/bzr.h" 2

# 1 ".././include/spline.h" 1
 




















# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 1 3

# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 1 3
 







































 










 

# 85 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3










# 137 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3





# 2 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 2 3

 



 
 
 





 







# 80 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 3

# 22 ".././include/spline.h" 2





 
typedef enum
{
  LINEAR = 1, QUADRATIC = 2, CUBIC = 3
} polynomial_degree;


 




typedef struct
{
  real_coordinate_type v[4];	 
  polynomial_degree degree;
  real linearity;
} spline_type;









 
extern spline_type new_spline (void);

 
extern void print_spline (struct _iobuf  *, spline_type);

 
extern real_coordinate_type evaluate_spline (spline_type spline, real t);



 

typedef struct
{
  spline_type *data;
  unsigned length;
} spline_list_type;

 


 


 


 



 







 
extern spline_list_type *new_spline_list (void);
extern spline_list_type *init_spline_list (spline_type);
extern void free_spline_list (spline_list_type *);

 
extern void append_spline (spline_list_type *s_list, spline_type s);

 
extern void concat_spline_lists (spline_list_type *s1, spline_list_type s2);



 

typedef struct
{
  spline_list_type *data;
  unsigned length;
} spline_list_array_type;

 






 
extern spline_list_array_type new_spline_list_array (void);
extern void free_spline_list_array (spline_list_array_type *);
extern void append_spline_list (spline_list_array_type *, spline_list_type);


# 27 ".././include/bzr.h" 2




 


extern boolean bzr_open_output_file (string filename);
extern boolean bzr_open_input_file (string filename);

 
extern void bzr_close_output_file (void);
extern void bzr_close_input_file (void);

 
typedef struct
{
  string comment;
  real design_size;
} bzr_preamble_type;

 



 



 
extern void bzr_put_preamble (bzr_preamble_type);

 




extern bzr_preamble_type bzr_get_preamble (void);

 

typedef struct
{
  charcode_type code;
  real set_width;
  real_bounding_box_type bb;
  spline_list_array_type shape;
} bzr_char_type;


 


 


 




 





 
extern void bzr_put_char (bzr_char_type);

 


extern bzr_char_type *bzr_get_next_char (void);

 


extern bzr_char_type *bzr_get_char (one_byte code);

 

typedef struct
{
  real_bounding_box_type font_bb;
  one_byte nchars;
} bzr_postamble_type;

 



 



 


extern void bzr_put_postamble (void);

 


extern bzr_postamble_type bzr_get_postamble (void);


# 23 "pstype1.c" 2

# 1 "char.h" 1
 





















# 1 "input-ccc.h" 1
 

























 
typedef struct
{
  real amount;
  boolean absolute;
  boolean valid;
} dimen_type;

 


 


 


 
typedef struct
{
  int opcode;
  boolean valid;
  union
  {
    charcode_type charcode;
    dimen_type dimen;
  } u;
} ccc_cmd_type;








 
typedef list_type ccc_cmd_list_type;

 
typedef ccc_cmd_list_type ccc_type;

 



typedef struct
{
  charcode_type code;
  string name;
} charname_type;

 


typedef struct
{
  int cap_height;
  int design_size;
  int em;
  int font_depth;
  int xheight;
} ccc_fontinfo_type;


 
extern struct _iobuf  *ccc_file;
extern string ccc_filename;
extern bzr_char_type **chars;
extern ccc_fontinfo_type ccc_fontinfo;
extern ccc_type *ccc_chars[];


 



extern ccc_type **parse_ccc_file
  (string name, bzr_char_type **chars, tfm_global_info_type *t,
   real design_size, boolean warn_p);


# 23 "char.h" 2


typedef enum { bzr_char_class, ccc_char_class } char_class_type;

typedef struct
{
  char_class_type tag;
  union
  {
    bzr_char_type *bzr_char;
    ccc_type *ccc_char;
  } u;
} char_type;






 
extern real oblique_angle;

 
extern spline_list_array_type oblique_splines (spline_list_array_type);


 

extern char_type **subr_chars (bzr_char_type *[], ccc_type *ccc_chars[],
                               charcode_type start, charcode_type end,
                               unsigned *subr_count);

 
extern void scale_char (bzr_char_type *, real scale_factor);


# 24 "pstype1.c" 2

# 1 ".././include/encoding.h" 1
 
























 


typedef struct
{
  string name;
  list_type ligature;
} encoding_char_type;

 


 
typedef struct
{
  string coding_scheme;
  encoding_char_type encoding_char[ 256 ];
} encoding_info_type;

 


 


 



 





 



 

extern int encoding_number (encoding_info_type e_i, string name);


 




extern string coding_scheme_to_filename (string codingscheme);


 


extern encoding_info_type read_encoding_file (string filename);


# 25 "pstype1.c" 2

# 1 ".././include/hexify.h" 1
 






















 



extern string hexify (one_byte *data, unsigned length);



# 26 "pstype1.c" 2


# 1 ".././include/varstring.h" 1
 























 
typedef struct
{
  unsigned allocated;
  unsigned used;
  string data;
} variable_string;

 


 


 



 
extern variable_string vs_init (void);

 
extern void vs_free (variable_string *);


 


extern void vs_set_char (variable_string *s, unsigned pos, char new_char);

 

extern void vs_append_char (variable_string *v, char new_char);

 
extern variable_string vs_concat (variable_string vs1, variable_string vs2);



# 28 "pstype1.c" 2

# 1 ".././include/vector.h" 1
 























 

typedef struct
{
  real dx, dy;
} vector_type;


 
extern const vector_type make_vector (const real_coordinate_type);

 
extern const real_coordinate_type vector_to_point (const vector_type);


 


extern const real magnitude (const vector_type);
extern const vector_type normalize (const vector_type);

extern const vector_type Vadd (const vector_type, const vector_type);
extern const real Vdot (const vector_type, const vector_type);
extern const vector_type Vmult_scalar (const vector_type, const real);
extern const real Vangle (const vector_type in, const vector_type out);

 


extern const real_coordinate_type Vadd_point
  (const real_coordinate_type, const vector_type);


extern const real_coordinate_type Vsubtract_point
  (const real_coordinate_type, const vector_type);

 

extern const coordinate_type Vadd_int_point
  (const coordinate_type, const vector_type);

 
extern const vector_type Vabs (const vector_type);



 


extern const vector_type Psubtract
  (const real_coordinate_type, const real_coordinate_type);

 












 

extern const vector_type IPsubtract
  (const coordinate_type, const coordinate_type);
extern const coordinate_type IPsubtractP
  (const coordinate_type, const coordinate_type);
extern const coordinate_type IPadd
  (const coordinate_type, const coordinate_type);
extern const coordinate_type IPmult_scalar (const coordinate_type, const int);
extern const real_coordinate_type IPmult_real
  (const coordinate_type, const real);
extern const boolean IPequal (const coordinate_type, const coordinate_type);


# 29 "pstype1.c" 2



# 1 "pstype1.h" 1
 



























 
extern void pstype1_start_output (string output_name,
				  bzr_preamble_type, bzr_postamble_type);

 
extern void pstype1_output_bzr_subr (bzr_char_type);
extern void pstype1_output_ccc_subr (ccc_type, charcode_type, char_type *[]);

 
extern void pstype1_start_subrs (unsigned subr_count);

 
extern void pstype1_start_chars (unsigned char_count);

 
extern void pstype1_output_bzr_char (bzr_char_type, char_type *[]);
extern void pstype1_output_ccc_char (ccc_type, charcode_type, char_type *[]);

 
extern void pstype1_finish_output (void);


# 32 "pstype1.c" 2

# 1 "psutil.h" 1
 





















# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 1 3

# 1 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 1 3
 







































 










 

# 85 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3










# 137 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdarg.h" 3





# 2 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 2 3

 



 
 
 





 







# 80 "/usr/local/gnu/lib/gcc-lib/romp-aos/2.3.3/include/stdio.h" 3

# 23 "psutil.h" 2





 
typedef struct
{
  string family_name;
  string font_name;
  real interword_space;
  int italic_angle;  
  boolean monospace_p;
  int underline_position, underline_thickness;  
  int unique_id;
  string version;
  string weight;
} ps_font_info_type;


 

extern ps_font_info_type ps_set_font_info (void);

 

extern void ps_start_font (struct _iobuf  *f, ps_font_info_type ps_info,
                           string comment);

 

extern void ps_output_encoding (struct _iobuf  *, boolean char_output_p[]);

 
extern string ps_encoding_name (charcode_type n);

 

extern int ps_encoding_number (string name);

 
extern string ps_global_info;


# 33 "pstype1.c" 2


# 1 "ccc.h" 1
typedef union
{
  int int_val;
  real real_val;
  dimen_type dimen_val;
  charname_type charname_val;
  ccc_cmd_type cmd_val;
  ccc_cmd_list_type *cmd_list_val;
} YYSTYPE;





















extern YYSTYPE yylval;
# 35 "pstype1.c" 2



 
static struct _iobuf  *ps_file;
static string ps_filename;

 

static real em_factor;

 
static real interword_space;

 

static boolean char_output_p[ 256 ];

 

static unsigned subr_number[255  + 1];

 



static variable_string charstring_buffer;

 
static variable_string pre_charstring_buffer;


 



 










 
typedef unsigned char type1_opcode;



















static void absolute_cs_number (int, variable_string *);
static void begin_char (string);
static void end_char (real, real);
static void cs_byte (one_byte, variable_string *);
static variable_string cs_encrypt (variable_string);
static void cs_number (real, variable_string *);
static void init_charstring_buffers (void);
static void out_bb_char
  (real_bounding_box_type *, real_coordinate_type *, bzr_char_type);
static void out_curveto (real_coordinate_type *, spline_type);
static void out_lineto (real_coordinate_type *, real_coordinate_type);
static void out_move (real_coordinate_type *, real, real, boolean);
static void out_moveto (real_coordinate_type *, real_coordinate_type);
static void out_point (real_coordinate_type *, real_coordinate_type);
static void out_relative_cmd (real_coordinate_type *, real_coordinate_type,
                              type1_opcode, type1_opcode, type1_opcode);
static void output_bzr_body (bzr_char_type);
static real_bounding_box_type output_ccc_body (ccc_type, char_type **);
static void output_char_finish (real, real, charcode_type);
static boolean output_char_start (charcode_type);
static void output_charstring_buffers (string);
static void output_private_dict_1 (unsigned);
static void output_private_dict_2 (void);
static void output_subr_end (void);
static void output_subr_start (charcode_type);
static int points_to_adobes (real);

 




static int
points_to_adobes (real n)
{
  int n_in_adobes = ((int) ((int) (n * em_factor) + .5 * ((n * em_factor) > 0 ? 1 : (n * em_factor) < 0 ? -1 : 0) )) ;
  
  return n_in_adobes;
}

 




void
pstype1_start_output (string output_name,
		      bzr_preamble_type pre, bzr_postamble_type post)
{
  ps_font_info_type ps_info = ps_set_font_info ();

   
  interword_space = ps_info.interword_space;

   




  ps_filename = extend_filename (output_name, "gsf");
  ps_file = xfopen (ps_filename, "w");
  
   
  do { fprintf (ps_file, "%%!FontType1-1.0: %s %s\n",  ps_info.font_name,  ps_info.version); } while (0) ;

  ps_start_font (ps_file, ps_info, ((pre).comment) );
  do { fprintf (ps_file, "%s\n", "/FontType 1 def"); } while (0)	;

   


  do { fprintf (ps_file, "%s\n", "/FontMatrix [0.001 0 0 0.001 0 0] readonly def"); } while (0)	; 
  em_factor = 1000.0 / ((pre).design_size) ;
  
   

  do { fprintf (ps_file, "/FontBBox {%d %d %d %d} def\n", 
        points_to_adobes (((((post).font_bb) ).min_col) ), 
        points_to_adobes (((((post).font_bb) ).min_row) ), 
        points_to_adobes (((((post).font_bb) ).max_col) ), 
        points_to_adobes (((((post).font_bb) ).max_row) ) ); } while (0) ;

   


  output_private_dict_1 (ps_info.unique_id);
}

 


  
void
pstype1_start_subrs (unsigned subr_count)
{
  do { fprintf (ps_file, "%s\n", "Private begin"); } while (0)	;
  do { fprintf (ps_file, "/Subrs %d array \n",  subr_count); } while (0) ;
}


 

void
pstype1_output_bzr_subr (bzr_char_type c)
{
  output_subr_start (((c).code) );
  output_bzr_body (c);
  output_subr_end ();
}


 

void
pstype1_output_ccc_subr (ccc_type c, charcode_type code, char_type *subrs[])
{
  output_subr_start (code);
  output_ccc_body (c, subrs);
  output_subr_end ();
}


 









 



static void
output_subr_start (charcode_type code)
{
  static unsigned current_subr_number = 0;
  
  subr_number[code] = current_subr_number;
  do { fprintf (ps_file, "dup %d ",  current_subr_number++); } while (0) ;
  init_charstring_buffers ();
}


 

static void
output_subr_end ()
{
  cs_byte (11 , &charstring_buffer);
  output_charstring_buffers ("|" );
}

 



     
void
pstype1_start_chars (unsigned char_count)
{
  do { fprintf (ps_file, "%s\n", "|-"  " % Subrs"); } while (0)	;
  do { fprintf (ps_file, "/CharStrings %d dict begin\n",  char_count + 2); } while (0) ;
}


 


void
pstype1_output_bzr_char (bzr_char_type c, char_type *subrs[])
{
  unsigned code = ((c).code) ;
  
  if (output_char_start (code))
    {
      if (subrs[code])
        do {	absolute_cs_number (subr_number[code], &charstring_buffer);	cs_byte (10 , &charstring_buffer);	} while (0) ;
      else
        output_bzr_body (c);
      
      output_char_finish (((((c).bb) ).min_col)  , ((c).set_width) , code);
    }
}


 


void
pstype1_output_ccc_char (ccc_type c, charcode_type code, char_type *subrs[])
{
  if (output_char_start (code))
    {
      if (subrs[code])
        do { fputs ("warning: ", (&_iob[2]) ) ; fprintf ((&_iob[2]) , "%s", "Sorry, CCC characters can't be subroutines yet"); fputs (".\n", (&_iob[2]) ); fflush ((&_iob[2]) ); } while (0)  ;
      else
        {
          real_bounding_box_type bb = output_ccc_body (c, subrs);
          output_char_finish (((bb).min_col) , ((bb).max_col) , code);
        }
    }
}


 

static boolean
output_char_start (charcode_type code)
{
  string charname = ps_encoding_name (code);
  boolean ok = !(strcmp (charname,  ".notdef") == 0) ;
  
  if (ok)
    begin_char (charname);
  
  return ok;
}


 





static void
begin_char (string name)
{
  do { fprintf (ps_file, "/%s\t",  name); } while (0) ;

   


  init_charstring_buffers ();
}


 

static void
output_char_finish (real lsb, real set_width, charcode_type code)
{
  end_char (lsb, set_width);
  char_output_p[code] = true;
}


 

static void
end_char (real lsb, real set_width)
{
  cs_number (lsb, &pre_charstring_buffer);
  cs_number (set_width, &pre_charstring_buffer);
  cs_byte (	13 , &pre_charstring_buffer);

  cs_byte (14 , &charstring_buffer);
  output_charstring_buffers ("|-" );
}

 

static void
output_bzr_body (bzr_char_type c)
{
  unsigned this_list;
  spline_list_array_type shape = ((c).shape) ;
  real_coordinate_type start = { 0.0, 0.0 };
  real_coordinate_type current = start;

   


  for (this_list = 0; this_list < ((shape).length) ;
       this_list++)
    {
      unsigned this_spline;
      spline_list_type list = (((shape).data) [ this_list]) ;
      spline_type first_spline = (((list).data) [ 0]) ;

       
      out_moveto (&current, ((first_spline).v[0]) );
      
       
      for (this_spline = 0; this_spline < ((list).length) ;
           this_spline++)
        {
          spline_type s = (((list).data) [ this_spline]) ;

          if (((s).degree)  == LINEAR)
            out_lineto (&current, 	((s).v[3]) );
          else
            out_curveto (&current, s);
        }
      cs_byte ( 9 , &charstring_buffer);
    }

   

  out_moveto (&current, start);
}


 




static real_bounding_box_type
output_ccc_body (ccc_type ccc_char, char_type **subrs)
{
  unsigned this_cmd;
  real_coordinate_type current = (real_coordinate_type) { 0.0, 0.0 };
  real_bounding_box_type bb
    = (real_bounding_box_type) { 3.40282347e+38F , 1.17549435e-38F , 3.40282347e+38F , 1.17549435e-38F  };

  for (this_cmd = 0; this_cmd < ((ccc_char).size) ; this_cmd++)
    { 
      ccc_cmd_type cmd = *(ccc_cmd_type *) ((ccc_char).list) [ this_cmd] ;
      
      switch (((cmd).opcode) )
        {
        case 260 :
          {
            char_type subr = *subrs[((cmd).u.charcode) ];

            if (((subr).tag)  == bzr_char_class)
              {
                bzr_char_type bzr_char = *((subr).u.bzr_char) ;
                
                update_real_bounding_box (&bb, current);
                out_move (&current, ((((bzr_char).bb) ).min_col)  , 0.0,  false) ;

                out_bb_char (&bb, &current, bzr_char);

                out_move (&current, (((bzr_char).set_width)  - ((((bzr_char).bb) ).max_col)  ) , 0.0,  false) ;
                update_real_bounding_box (&bb, current);
              }
            else
               




              do { fputs ("warning: ", (&_iob[2]) ) ; fprintf ((&_iob[2]) , "%s", "Sorry, I can't `setchar' a CCC char yet"); fputs (".\n", (&_iob[2]) ); fflush ((&_iob[2]) ); } while (0)  ;
          }
          break;

        case 261 :
          {
            char_type subr = *subrs[((cmd).u.charcode) ];

            if (((subr).tag)  == bzr_char_class)
              out_bb_char (&bb, &current, *((subr).u.bzr_char) );
            else
              do { fputs ("warning: ", (&_iob[2]) ) ; fprintf ((&_iob[2]) , "%s", "Sorry, I can't `setcharbb' a CCC char yet"); fputs (".\n", (&_iob[2]) ); fflush ((&_iob[2]) ); } while (0)  ;
          }
          break;

        case 262 :
          out_move (&current, (((cmd).u.dimen).amount)  , 0.0,  (((cmd).u.dimen).absolute)  ) ;
          break;

        case 263 :
          out_move (&current, 0.0, (((cmd).u.dimen).amount)  ,  (((cmd).u.dimen).absolute)  ) ;
          break;

        default:
          do { fputs ("fatal: ", (&_iob[2]) ) ; fprintf ((&_iob[2]) , "Bad command %d in CCC character",  ((cmd).opcode) ); fputs (".\n", (&_iob[2]) ); exit (1); } while (0)  ;
	}
    }
  
  return bb;
}
 



static void
out_move (real_coordinate_type *current, real h, real v, boolean absolute)
{
  real_coordinate_type new
    = (real_coordinate_type) { current->x + h, current->y + v};

  if (absolute)
    do { fputs ("warning: ", (&_iob[2]) ) ; fprintf ((&_iob[2]) , "Move [by (%.2f,%.2f)] in absolute units unimplemented",  h,  v); fputs (".\n", (&_iob[2]) ); fflush ((&_iob[2]) ); } while (0)  ;

  out_moveto (current, new);
  *current = new;
}


 








static void
out_bb_char (real_bounding_box_type *bb, real_coordinate_type *current,
             bzr_char_type bzr_char)
{
   
  update_real_bounding_box (bb, ((real_coordinate_type) { current->x, current->y + (((((bzr_char).bb) ).min_row)  ) }) );

   
  do {	absolute_cs_number (subr_number[((bzr_char).code) ], &charstring_buffer);	cs_byte (10 , &charstring_buffer);	} while (0) ;
  
   
  out_move (current, (((((bzr_char).bb) ).max_col)  - ((((bzr_char).bb) ).min_col) ) , 0, false);

   
  update_real_bounding_box (bb, ((real_coordinate_type) { current->x, current->y + (((((bzr_char).bb) ).max_row)  ) }) );
}

 

static void
out_point (real_coordinate_type *current, real_coordinate_type p)
{
  cs_number (p.x - current->x, &charstring_buffer);
  cs_number (p.y - current->y, &charstring_buffer);
  *current = p;
}


 



static void
out_lineto (real_coordinate_type *current, real_coordinate_type p)
{
  out_relative_cmd (current, p,  5 ,  6 ,  7 );
}


 

static void
out_moveto (real_coordinate_type *current, real_coordinate_type p)
{
  out_relative_cmd (current, p, 21 , 22 ,  4 );
}


 



static void
out_relative_cmd (real_coordinate_type *current, real_coordinate_type p,
                  type1_opcode r_opcode, type1_opcode h_opcode,
                  type1_opcode v_opcode)
{
  boolean x_equal = epsilon_equal (p.x, current->x);
  boolean y_equal = epsilon_equal (p.y, current->y);
  
  if (x_equal)
    {  


      if (!y_equal)
        {
          cs_number (p.y - current->y, &charstring_buffer);
          cs_byte (v_opcode, &charstring_buffer);
          current->y = p.y;
        }
    }
  else if (y_equal)
    {
      cs_number (p.x - current->x, &charstring_buffer);
      cs_byte (h_opcode, &charstring_buffer);
      current->x = p.x;
    }
  else
    {
      out_point (current, p);
      cs_byte (r_opcode, &charstring_buffer);
    }
}


 


static void
out_curveto (real_coordinate_type *current, spline_type s)
{
   
  if (epsilon_equal (current->x, 	((s).v[1]) .x)
      && epsilon_equal (	((s).v[2]) .y, 	((s).v[3]) .y))
    {
      cs_number (	((s).v[1]) .y - current->y, &charstring_buffer);
      current->y = 	((s).v[1]) .y;
      out_point (current, 	((s).v[2]) );
      cs_number (	((s).v[3]) .x - current->x, &charstring_buffer);
      current->x = 	((s).v[3]) .x;
      cs_byte (30 , &charstring_buffer);
    }
  
   
  else if (epsilon_equal (current->y, 	((s).v[1]) .y)
      && epsilon_equal (	((s).v[2]) .x, 	((s).v[3]) .x))
    {
      cs_number (	((s).v[1]) .x - current->x, &charstring_buffer);
      current->x = 	((s).v[1]) .x;
      out_point (current, 	((s).v[2]) );
      cs_number (	((s).v[3]) .y - current->y, &charstring_buffer);
      current->y = 	((s).v[3]) .y;
      cs_byte (31 , &charstring_buffer);
    }
  
   
  else
    {
      out_point (current, 	((s).v[1]) );
      out_point (current, 	((s).v[2]) );
      out_point (current, 	((s).v[3]) );
      cs_byte ( 8 , &charstring_buffer);
    }
}

 

static void
init_charstring_buffers ()
{
  pre_charstring_buffer = vs_init ();
  charstring_buffer = vs_init ();
}


 

static void
cs_byte (one_byte b, variable_string *buffer)
{
  vs_append_char (buffer, b);
}


 


static void
cs_number (real n, variable_string *buffer)
{
  int n_in_adobes = points_to_adobes (n);

  absolute_cs_number (n_in_adobes, buffer);
}


 

static void
absolute_cs_number (int n, variable_string *buffer)
{
  if (-107 <= n && n <= 107)
    cs_byte (n + 139, buffer);
  else if (108 <= n && n <= 1131)
    {
      n -= 108;
      cs_byte (n / 256 + 247, buffer);
      cs_byte (n % 256, buffer);
    }
  else if (-1131 <= n && n <= -108)
    {
      n = -n - 108;
      cs_byte (n / 256 + 251, buffer);
      cs_byte (n % 256, buffer);
    }
  else
    {
      cs_byte (255, buffer);
      cs_byte ((n & 0xff000000) >> 24, buffer);
      cs_byte ((n & 0x00ff0000) >> 16, buffer);
      cs_byte ((n & 0x0000ff00) >> 8, buffer);
      cs_byte  (n & 0x000000ff, buffer);
    }
}


 






static variable_string
cs_encrypt (variable_string s)
{
  unsigned i;
  unsigned short cs_key = 4330;
  variable_string e = vs_init ();

  for (i = 0; i < ((s).used) ; i++)
    {
      unsigned char cipher = ((unsigned char) ((s).data) [i]) ^ (cs_key >> 8);
      cs_key = (cipher + cs_key) * 52845  + 22719 ;
      vs_append_char (&e, cipher);
    }
  
  return e;
}


 



static void
output_charstring_buffers (string end)
{
  variable_string encrypted_string;
  string hex_string;

  encrypted_string 
    = cs_encrypt (vs_concat (pre_charstring_buffer, charstring_buffer));

  hex_string = hexify (((encrypted_string).data) ,
                       ((encrypted_string).used) ); 

   

  do { fprintf (ps_file, "%d -| %s ",  ((encrypted_string).used) ,  hex_string); } while (0) ;
  do { fprintf (ps_file, "%s\n", end); } while (0)	;

  free (hex_string);
  vs_free (&encrypted_string);
  vs_free (&pre_charstring_buffer);
  vs_free (&charstring_buffer);
}

 


void
pstype1_finish_output ()
{
  int space_encoding = ps_encoding_number ("space");
  
   

  if (space_encoding == -1 || !char_output_p[space_encoding])
    {
      begin_char ("space");
      end_char (0, interword_space);
      if (space_encoding != -1)
        char_output_p[space_encoding] = true;
    }

   
  begin_char (".notdef");
  end_char (0, 0);

   

  do { fprintf (ps_file, "%s\n", "currentdict end readonly % CharStrings"); } while (0)	;
  do { fprintf (ps_file, "%s\n", "end % Private"); } while (0)	;
  do { fprintf (ps_file, "%s\n", "def % CharStrings"); } while (0)	;

   
  ps_output_encoding (ps_file, char_output_p);
  output_private_dict_2 ();

   
  do { fprintf (ps_file, "%s\n", "currentdict end definefont pop"); } while (0)	;
  
  xfclose (ps_file, ps_filename);
}

 


static void
output_private_dict_1 (unsigned unique_id)
{
  do { fprintf (ps_file, "%s\n", "/Private 9 dict begin"); } while (0)	;
  do { fprintf (ps_file, "%s\n", "  /MinFeature {16 16} def"); } while (0)	;
  do { fprintf (ps_file, "%s\n", "  /password 5839 def"); } while (0)	;

   



  do { fprintf (ps_file, "%s\n", "  /lenIV 0 def"); } while (0)	;

  if (unique_id)
    do { fprintf (ps_file, "  /UniqueID %d def\n",  unique_id); } while (0) ;

   





  do { fprintf (ps_file, "%s\n", "  /-| {string currentfile exch readhexstring pop} readonly def"); } while (0)	;

   
  do { fprintf (ps_file, "%s\n", "  /|- {readonly def} readonly def"); } while (0)	;

   
  do { fprintf (ps_file, "%s\n", "  /|  {readonly put} readonly def"); } while (0)	;
  
   
  do { fprintf (ps_file, "%s\n", "currentdict end def"); } while (0)	;
}


 



static void
output_private_dict_2 ()
{
  do { fprintf (ps_file, "%s\n", "Private begin"); } while (0)	;
  do { fprintf (ps_file, "%s\n", "  /BlueValues [] def"); } while (0)	;
  do { fprintf (ps_file, "%s\n", "currentdict end /Private exch readonly def"); } while (0)	;
}

Newsgroups: gnu.gcc.bug