From mboxrd@z Thu Jan 1 00:00:00 1970 From: maciej@imsa.edu To: gcc-gnats@gcc.gnu.org Subject: optimization/4133: heavy optimization and -march=pentium leads to ICE Date: Sun, 26 Aug 2001 21:56:00 -0000 Message-id: <200108270445.f7R4j2O07008@apathy.killer-robot.net> X-SW-Source: 2001-08/msg00671.html List-Id: >Number: 4133 >Category: optimization >Synopsis: heavy optimization and -march=pentium leads to ICE >Confidential: no >Severity: serious >Priority: low >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Sun Aug 26 21:56:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Maciej >Release: 3.0 >Organization: >Environment: System: Linux apathy 2.4.9 #6 Fri Aug 24 00:57:59 CDT 2001 i586 unknown Architecture: i586 Pentium 200MMX, Linux 2.4.9, glibc-2.2.3 host: i586-pc-linux-gnu build: i586-pc-linux-gnu target: i586-pc-linux-gnu configured with: ./configure --prefix=/usr/opt/packages/gcc-3.0 : (reconfigured) ./configure --prefix=/usr/opt/packages/gcc-3.0 >Description: Setting -O3 produces an ICE. Full text: >How-To-Repeat: Command line: gcc -DHAVE_CONFIG_H -I. -I. -I/usr/opt -O3 -I/usr/opt/include -I./term -I./term -c term.c Full preprocessed text included at bottom. >Fix: Turn optimization down. # 2 "term.c" static char *RCSid = "$Id: term.c,v 1.19.2.3 1999/10/01 10:37:23 lhecking Exp $"; # 77 "term.c" # 1 "plot.h" 1 # 43 "plot.h" # 1 "config.h" 1 # 44 "plot.h" 2 # 1 "ansichek.h" 1 # 47 "plot.h" 2 # 1 "stdfn.h" 1 # 48 "stdfn.h" # 1 "/usr/include/ctype.h" 1 3 # 26 "/usr/include/ctype.h" 3 # 1 "/usr/include/features.h" 1 3 # 283 "/usr/include/features.h" 3 # 1 "/usr/include/sys/cdefs.h" 1 3 # 284 "/usr/include/features.h" 2 3 # 311 "/usr/include/features.h" 3 # 1 "/usr/include/gnu/stubs.h" 1 3 # 312 "/usr/include/features.h" 2 3 # 27 "/usr/include/ctype.h" 2 3 # 1 "/usr/include/bits/types.h" 1 3 # 26 "/usr/include/bits/types.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/bits/types.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 199 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 3 typedef unsigned int size_t; # 30 "/usr/include/bits/types.h" 2 3 typedef unsigned char __u_char; typedef unsigned short __u_short; typedef unsigned int __u_int; typedef unsigned long __u_long; __extension__ typedef unsigned long long int __u_quad_t; __extension__ typedef long long int __quad_t; # 49 "/usr/include/bits/types.h" 3 typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; typedef __quad_t *__qaddr_t; typedef __u_quad_t __dev_t; typedef __u_int __uid_t; typedef __u_int __gid_t; typedef __u_long __ino_t; typedef __u_int __mode_t; typedef __u_int __nlink_t; typedef long int __off_t; typedef __quad_t __loff_t; typedef int __pid_t; typedef int __ssize_t; typedef __u_long __rlim_t; typedef __u_quad_t __rlim64_t; typedef __u_int __id_t; typedef struct { int __val[2]; } __fsid_t; typedef int __daddr_t; typedef char *__caddr_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef long int __swblk_t; typedef long int __clock_t; typedef int __clockid_t; typedef int __timer_t; typedef int __key_t; typedef unsigned short int __ipc_pid_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef __quad_t __blkcnt64_t; typedef __u_long __fsblkcnt_t; typedef __u_quad_t __fsblkcnt64_t; typedef __u_long __fsfilcnt_t; typedef __u_quad_t __fsfilcnt64_t; typedef __u_quad_t __ino64_t; typedef __loff_t __off64_t; typedef long int __t_scalar_t; typedef unsigned long int __t_uscalar_t; typedef int __intptr_t; typedef unsigned int __socklen_t; # 1 "/usr/include/bits/pthreadtypes.h" 1 3 # 23 "/usr/include/bits/pthreadtypes.h" 3 # 1 "/usr/include/bits/sched.h" 1 3 # 68 "/usr/include/bits/sched.h" 3 struct __sched_param { int __sched_priority; }; # 24 "/usr/include/bits/pthreadtypes.h" 2 3 struct _pthread_fastlock { long int __status; int __spinlock; }; typedef struct _pthread_descr_struct *_pthread_descr; typedef struct __pthread_attr_s { int __detachstate; int __schedpolicy; struct __sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; size_t __stacksize; } pthread_attr_t; typedef struct { struct _pthread_fastlock __c_lock; _pthread_descr __c_waiting; } pthread_cond_t; typedef struct { int __dummy; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef struct { int __m_reserved; int __m_count; _pthread_descr __m_owner; int __m_kind; struct _pthread_fastlock __m_lock; } pthread_mutex_t; typedef struct { int __mutexkind; } pthread_mutexattr_t; typedef int pthread_once_t; # 140 "/usr/include/bits/pthreadtypes.h" 3 typedef unsigned long int pthread_t; # 144 "/usr/include/bits/types.h" 2 3 # 28 "/usr/include/ctype.h" 2 3 # 40 "/usr/include/ctype.h" 3 # 1 "/usr/include/endian.h" 1 3 # 22 "/usr/include/endian.h" 3 # 1 "/usr/include/features.h" 1 3 # 23 "/usr/include/endian.h" 2 3 # 37 "/usr/include/endian.h" 3 # 1 "/usr/include/bits/endian.h" 1 3 # 38 "/usr/include/endian.h" 2 3 # 41 "/usr/include/ctype.h" 2 3 enum { _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)), _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)), _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)), _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)), _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)), _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)), _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)), _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)), _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)), _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)), _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)), _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8)) }; # 75 "/usr/include/ctype.h" 3 extern __const unsigned short int *__ctype_b; extern __const __int32_t *__ctype_tolower; extern __const __int32_t *__ctype_toupper; # 91 "/usr/include/ctype.h" 3 extern int isalnum (int) ; extern int isalpha (int) ; extern int iscntrl (int) ; extern int isdigit (int) ; extern int islower (int) ; extern int isgraph (int) ; extern int isprint (int) ; extern int ispunct (int) ; extern int isspace (int) ; extern int isupper (int) ; extern int isxdigit (int) ; extern int tolower (int __c) ; extern int toupper (int __c) ; extern int isascii (int __c) ; extern int toascii (int __c) ; extern int _toupper (int) ; extern int _tolower (int) ; # 168 "/usr/include/ctype.h" 3 extern __inline int tolower (int __c) { return __c >= -128 && __c < 256 ? __ctype_tolower[__c] : __c; } extern __inline int toupper (int __c) { return __c >= -128 && __c < 256 ? __ctype_toupper[__c] : __c; } # 49 "stdfn.h" 2 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 1 3 # 36 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 # 1 "/usr/include/features.h" 1 3 # 37 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 43 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 2 3 # 1 "/usr/include/bits/types.h" 1 3 # 45 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 2 3 # 53 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 typedef struct _IO_FILE FILE; # 63 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 typedef struct _IO_FILE __FILE; # 73 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 # 1 "/usr/include/libio.h" 1 3 # 30 "/usr/include/libio.h" 3 # 1 "/usr/include/_G_config.h" 1 3 # 9 "/usr/include/_G_config.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 10 "/usr/include/_G_config.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 287 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 3 typedef long int wchar_t; # 312 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 3 typedef unsigned int wint_t; # 15 "/usr/include/_G_config.h" 2 3 # 24 "/usr/include/_G_config.h" 3 # 1 "/usr/include/wchar.h" 1 3 # 48 "/usr/include/wchar.h" 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 49 "/usr/include/wchar.h" 2 3 # 1 "/usr/include/bits/wchar.h" 1 3 # 51 "/usr/include/wchar.h" 2 3 # 67 "/usr/include/wchar.h" 3 typedef struct { int __count; union { wint_t __wch; char __wchb[4]; } __value; } __mbstate_t; # 25 "/usr/include/_G_config.h" 2 3 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; # 44 "/usr/include/_G_config.h" 3 # 1 "/usr/include/gconv.h" 1 3 # 26 "/usr/include/gconv.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/gconv.h" 2 3 # 1 "/usr/include/wchar.h" 1 3 # 48 "/usr/include/wchar.h" 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 49 "/usr/include/wchar.h" 2 3 # 1 "/usr/include/bits/wchar.h" 1 3 # 51 "/usr/include/wchar.h" 2 3 # 29 "/usr/include/gconv.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 31 "/usr/include/gconv.h" 2 3 enum { __GCONV_OK = 0, __GCONV_NOCONV, __GCONV_NODB, __GCONV_NOMEM, __GCONV_EMPTY_INPUT, __GCONV_FULL_OUTPUT, __GCONV_ILLEGAL_INPUT, __GCONV_INCOMPLETE_INPUT, __GCONV_ILLEGAL_DESCRIPTOR, __GCONV_INTERNAL_ERROR }; enum { __GCONV_IS_LAST = 0x0001, __GCONV_IGNORE_ERRORS = 0x0002 }; struct __gconv_step; struct __gconv_step_data; struct __gconv_loaded_object; struct __gconv_trans_data; typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *, int, int); typedef int (*__gconv_init_fct) (struct __gconv_step *); typedef void (*__gconv_end_fct) (struct __gconv_step *); typedef int (*__gconv_trans_fct) (struct __gconv_step *, struct __gconv_step_data *, void *, __const unsigned char *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *); typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, __const unsigned char *, unsigned char *, unsigned char *); typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, size_t *); typedef int (*__gconv_trans_init_fct) (void **, const char *); typedef void (*__gconv_trans_end_fct) (void *); struct __gconv_trans_data { __gconv_trans_fct __trans_fct; __gconv_trans_context_fct __trans_context_fct; __gconv_trans_end_fct __trans_end_fct; void *__data; struct __gconv_trans_data *__next; }; struct __gconv_step { struct __gconv_loaded_object *__shlib_handle; __const char *__modname; int __counter; char *__from_name; char *__to_name; __gconv_fct __fct; __gconv_init_fct __init_fct; __gconv_end_fct __end_fct; int __min_needed_from; int __max_needed_from; int __min_needed_to; int __max_needed_to; int __stateful; void *__data; }; struct __gconv_step_data { unsigned char *__outbuf; unsigned char *__outbufend; int __flags; int __invocation_counter; int __internal_use; __mbstate_t *__statep; __mbstate_t __state; struct __gconv_trans_data *__trans; }; typedef struct __gconv_info { size_t __nsteps; struct __gconv_step *__steps; __extension__ struct __gconv_step_data __data []; } *__gconv_t; # 45 "/usr/include/_G_config.h" 2 3 typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); # 31 "/usr/include/libio.h" 2 3 # 51 "/usr/include/libio.h" 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdarg.h" 1 3 # 43 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdarg.h" 3 typedef __builtin_va_list __gnuc_va_list; # 52 "/usr/include/libio.h" 2 3 # 158 "/usr/include/libio.h" 3 struct _IO_jump_t; struct _IO_FILE; # 168 "/usr/include/libio.h" 3 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 191 "/usr/include/libio.h" 3 }; enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; # 259 "/usr/include/libio.h" 3 struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _blksize; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; # 303 "/usr/include/libio.h" 3 __off64_t _offset; void *__pad1; void *__pad2; int _mode; char _unused2[15 * sizeof (int) - 2 * sizeof (void *)]; }; typedef struct _IO_FILE _IO_FILE; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 342 "/usr/include/libio.h" 3 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); # 394 "/usr/include/libio.h" 3 extern int __underflow (_IO_FILE *) ; extern int __uflow (_IO_FILE *) ; extern int __overflow (_IO_FILE *, int) ; extern wint_t __wunderflow (_IO_FILE *) ; extern wint_t __wuflow (_IO_FILE *) ; extern wint_t __woverflow (_IO_FILE *, wint_t) ; # 424 "/usr/include/libio.h" 3 extern int _IO_getc (_IO_FILE *__fp) ; extern int _IO_putc (int __c, _IO_FILE *__fp) ; extern int _IO_feof (_IO_FILE *__fp) ; extern int _IO_ferror (_IO_FILE *__fp) ; extern int _IO_peekc_locked (_IO_FILE *__fp) ; extern void _IO_flockfile (_IO_FILE *) ; extern void _IO_funlockfile (_IO_FILE *) ; extern int _IO_ftrylockfile (_IO_FILE *) ; # 454 "/usr/include/libio.h" 3 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, __gnuc_va_list, int *__restrict) ; extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, __gnuc_va_list) ; extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) ; extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) ; extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) ; extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) ; extern void _IO_free_backup_area (_IO_FILE *) ; # 74 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 2 3 # 88 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 typedef _G_fpos_t fpos_t; # 137 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 # 1 "/usr/include/bits/stdio_lim.h" 1 3 # 138 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 2 3 extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; extern int remove (__const char *__filename) ; extern int rename (__const char *__old, __const char *__new) ; extern FILE *tmpfile (void) ; # 169 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern char *tmpnam (char *__s) ; extern char *tmpnam_r (char *__s) ; # 186 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern char *tempnam (__const char *__dir, __const char *__pfx) __attribute__ ((__malloc__)); extern int fclose (FILE *__stream) ; extern int fflush (FILE *__stream) ; extern int fflush_unlocked (FILE *__stream) ; # 209 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) ; extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) ; # 239 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern FILE *fdopen (int __fd, __const char *__modes) ; # 262 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ; extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) ; extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) ; extern void setlinebuf (FILE *__stream) ; extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...) ; extern int printf (__const char *__restrict __format, ...) ; extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) ; extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) ; extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg) ; extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) ; extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 3, 0))); # 333 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) ; extern int scanf (__const char *__restrict __format, ...) ; extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) ; # 359 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern int fgetc (FILE *__stream) ; extern int getc (FILE *__stream) ; extern int getchar (void) ; extern int getc_unlocked (FILE *__stream) ; extern int getchar_unlocked (void) ; extern int fgetc_unlocked (FILE *__stream) ; extern int fputc (int __c, FILE *__stream) ; extern int putc (int __c, FILE *__stream) ; extern int putchar (int __c) ; extern int fputc_unlocked (int __c, FILE *__stream) ; extern int putc_unlocked (int __c, FILE *__stream) ; extern int putchar_unlocked (int __c) ; extern int getw (FILE *__stream) ; extern int putw (int __w, FILE *__stream) ; extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ; # 425 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern char *gets (char *__s) ; # 449 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream) ; # 459 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern int puts (__const char *__s) ; extern int ungetc (int __c, FILE *__stream) ; extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s) ; extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern int fseek (FILE *__stream, long int __off, int __whence) ; extern long int ftell (FILE *__stream) ; extern void rewind (FILE *__stream) ; # 503 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) ; extern int fsetpos (FILE *__stream, __const fpos_t *__pos) ; # 539 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern void clearerr (FILE *__stream) ; extern int feof (FILE *__stream) ; extern int ferror (FILE *__stream) ; extern void clearerr_unlocked (FILE *__stream) ; extern int feof_unlocked (FILE *__stream) ; extern int ferror_unlocked (FILE *__stream) ; extern void perror (__const char *__s) ; extern int sys_nerr; extern __const char *__const sys_errlist[]; # 570 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern int fileno (FILE *__stream) ; extern int fileno_unlocked (FILE *__stream) ; extern FILE *popen (__const char *__command, __const char *__modes) ; extern int pclose (FILE *__stream) ; extern char *ctermid (char *__s) ; # 617 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 extern void flockfile (FILE *__stream) ; extern int ftrylockfile (FILE *__stream) ; extern void funlockfile (FILE *__stream) ; # 638 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 3 # 1 "/usr/include/bits/stdio.h" 1 3 # 39 "/usr/include/bits/stdio.h" 3 extern __inline int vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } extern __inline int getchar (void) { return _IO_getc (stdin); } extern __inline int getc_unlocked (FILE *__fp) { return ((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline int getchar_unlocked (void) { return ((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline int putchar (int __c) { return _IO_putc (__c, stdout); } extern __inline int fputc_unlocked (int __c, FILE *__stream) { return (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putc_unlocked (int __c, FILE *__stream) { return (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putchar_unlocked (int __c) { return (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } # 117 "/usr/include/bits/stdio.h" 3 extern __inline int feof_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x10) != 0); } extern __inline int ferror_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x20) != 0); } # 639 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stdio.h" 2 3 # 50 "stdfn.h" 2 # 1 "syscfg.h" 1 # 46 "syscfg.h" # 1 "config.h" 1 # 47 "syscfg.h" 2 # 1 "ansichek.h" 1 # 50 "syscfg.h" 2 # 52 "stdfn.h" 2 # 1 "/usr/include/string.h" 1 3 # 26 "/usr/include/string.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/string.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 34 "/usr/include/string.h" 2 3 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) ; extern void *memmove (void *__dest, __const void *__src, size_t __n) ; extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) ; extern void *memset (void *__s, int __c, size_t __n) ; extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__pure__)); extern void *memchr (__const void *__s, int __c, size_t __n) __attribute__ ((__pure__)); # 77 "/usr/include/string.h" 3 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) ; extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) ; extern char *strcat (char *__restrict __dest, __const char *__restrict __src) ; extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) ; extern int strcmp (__const char *__s1, __const char *__s2) __attribute__ ((__pure__)); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__pure__)); extern int strcoll (__const char *__s1, __const char *__s2) __attribute__ ((__pure__)); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) ; # 120 "/usr/include/string.h" 3 extern char *strdup (__const char *__s) __attribute__ ((__malloc__)); # 155 "/usr/include/string.h" 3 extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__)); extern char *strrchr (__const char *__s, int __c) __attribute__ ((__pure__)); # 167 "/usr/include/string.h" 3 extern size_t strcspn (__const char *__s, __const char *__reject) __attribute__ ((__pure__)); extern size_t strspn (__const char *__s, __const char *__accept) __attribute__ ((__pure__)); extern char *strpbrk (__const char *__s, __const char *__accept) __attribute__ ((__pure__)); extern char *strstr (__const char *__haystack, __const char *__needle) __attribute__ ((__pure__)); # 187 "/usr/include/string.h" 3 extern char *strtok (char *__restrict __s, __const char *__restrict __delim) ; extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) ; extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) ; # 218 "/usr/include/string.h" 3 extern size_t strlen (__const char *__s) __attribute__ ((__pure__)); # 229 "/usr/include/string.h" 3 extern char *strerror (int __errnum) ; extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) ; extern void __bzero (void *__s, size_t __n) ; extern void bcopy (__const void *__src, void *__dest, size_t __n) ; extern void bzero (void *__s, size_t __n) ; extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__pure__)); extern char *index (__const char *__s, int __c) __attribute__ ((__pure__)); extern char *rindex (__const char *__s, int __c) __attribute__ ((__pure__)); extern int ffs (int __i) __attribute__ ((__const__)); # 272 "/usr/include/string.h" 3 extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__pure__)); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__pure__)); # 294 "/usr/include/string.h" 3 extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) ; # 356 "/usr/include/string.h" 3 # 1 "/usr/include/bits/string.h" 1 3 # 357 "/usr/include/string.h" 2 3 # 1 "/usr/include/bits/string2.h" 1 3 # 52 "/usr/include/bits/string2.h" 3 # 1 "/usr/include/endian.h" 1 3 # 53 "/usr/include/bits/string2.h" 2 3 # 1 "/usr/include/bits/types.h" 1 3 # 54 "/usr/include/bits/string2.h" 2 3 # 371 "/usr/include/bits/string2.h" 3 extern void *__rawmemchr (const void *__s, int __c); # 395 "/usr/include/bits/string2.h" 3 extern __inline char *__strcpy_small (char *, __uint16_t, __uint16_t, __uint32_t, __uint32_t, size_t); extern __inline char * __strcpy_small (char *__dest, __uint16_t __src0_2, __uint16_t __src4_2, __uint32_t __src0_4, __uint32_t __src4_4, size_t __srclen) { union { __uint32_t __ui; __uint16_t __usi; unsigned char __uc; } *__u = (void *) __dest; switch ((unsigned int) __srclen) { case 1: __u->__uc = '\0'; break; case 2: __u->__usi = __src0_2; break; case 3: __u->__usi = __src0_2; __u = __extension__ ((void *) __u + 2); __u->__uc = '\0'; break; case 4: __u->__ui = __src0_4; break; case 5: __u->__ui = __src0_4; __u = __extension__ ((void *) __u + 4); __u->__uc = '\0'; break; case 6: __u->__ui = __src0_4; __u = __extension__ ((void *) __u + 4); __u->__usi = __src4_2; break; case 7: __u->__ui = __src0_4; __u = __extension__ ((void *) __u + 4); __u->__usi = __src4_2; __u = __extension__ ((void *) __u + 2); __u->__uc = '\0'; break; case 8: __u->__ui = __src0_4; __u = __extension__ ((void *) __u + 4); __u->__ui = __src4_4; break; } return __dest; } # 873 "/usr/include/bits/string2.h" 3 extern __inline size_t __strcspn_c1 (__const char *__s, char __reject); extern __inline size_t __strcspn_c1 (__const char *__s, char __reject) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject) ++__result; return __result; } extern __inline size_t __strcspn_c2 (__const char *__s, char __reject1, char __reject2); extern __inline size_t __strcspn_c2 (__const char *__s, char __reject1, char __reject2) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2) ++__result; return __result; } extern __inline size_t __strcspn_c3 (__const char *__s, char __reject1, char __reject2, char __reject3); extern __inline size_t __strcspn_c3 (__const char *__s, char __reject1, char __reject2, char __reject3) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3) ++__result; return __result; } # 928 "/usr/include/bits/string2.h" 3 extern __inline size_t __strspn_c1 (__const char *__s, char __accept); extern __inline size_t __strspn_c1 (__const char *__s, char __accept) { register size_t __result = 0; while (__s[__result] == __accept) ++__result; return __result; } extern __inline size_t __strspn_c2 (__const char *__s, char __accept1, char __accept2); extern __inline size_t __strspn_c2 (__const char *__s, char __accept1, char __accept2) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2) ++__result; return __result; } extern __inline size_t __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3); extern __inline size_t __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3) ++__result; return __result; } # 983 "/usr/include/bits/string2.h" 3 extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, int __accept2); extern __inline char * __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline char * __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } # 1045 "/usr/include/bits/string2.h" 3 extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); extern __inline char * __strtok_r_1c (char *__s, char __sep, char **__nextp) { char *__result; if (__s == ((void *)0)) __s = *__nextp; while (*__s == __sep) ++__s; if (*__s == '\0') __result = ((void *)0); else { __result = __s; while (*__s != '\0' && *__s != __sep) ++__s; if (*__s == '\0') *__nextp = __s; else { *__s = '\0'; *__nextp = __s + 1; } } return __result; } # 1095 "/usr/include/bits/string2.h" 3 extern __inline char *__strsep_1c (char **__s, char __reject); extern __inline char * __strsep_1c (char **__s, char __reject) { register char *__retval = *__s; if (__retval == ((void *)0)) return *__s = ((void *)0); if (*__retval == __reject) *(*__s)++ = '\0'; else if ((*__s = (__extension__ (__builtin_constant_p (__reject) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : strchr (__retval, __reject)))) != ((void *)0)) *(*__s)++ = '\0'; else *__s = ((void *)0); return __retval; } extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); extern __inline char * __strsep_2c (char **__s, char __reject1, char __reject2) { register char *__retval = *__s; if (__retval == ((void *)0)) return *__s = ((void *)0); if (*__retval == __reject1 || *__retval == __reject2) *(*__s)++ = '\0'; else { register char *__cp = __retval; while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2) ++__cp; if (*__cp != '\0') { *__s = __cp; *(*__s)++ = '\0'; } else *__s = ((void *)0); } return __retval; } extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3); extern __inline char * __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) { register char *__retval = *__s; if (__retval == ((void *)0)) return *__s = ((void *)0); if (*__retval == __reject1 || *__retval == __reject2 || *__retval == __reject3) *(*__s)++ = '\0'; else { register char *__cp = __retval; while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2 && *__cp != __reject3) ++__cp; if (*__cp != '\0') { *__s = __cp; *(*__s)++ = '\0'; } else *__s = ((void *)0); } return __retval; } extern __inline char *__strsep_g (char **__s, __const char *__reject); extern __inline char * __strsep_g (char **__s, __const char *__reject) { register char *__retval = *__s; if (__retval == ((void *)0)) return ((void *)0); if ((*__s = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p (__reject) && ((size_t)(const void *)((__reject) + 1) - (size_t)(const void *)(__reject) == 1) ? ((__a0 = ((__const char *) (__reject))[0], __a0 == '\0') ? ((void) (__retval), ((void *)0)) : ((__a1 = ((__const char *) (__reject))[1], __a1 == '\0') ? (__extension__ (__builtin_constant_p (__a0) && (__a0) == '\0' ? (char *) __rawmemchr (__retval, __a0) : strchr (__retval, __a0))) : ((__a2 = ((__const char *) (__reject))[2], __a2 == '\0') ? __strpbrk_c2 (__retval, __a0, __a1) : (((__const char *) (__reject))[3] == '\0' ? __strpbrk_c3 (__retval, __a0, __a1, __a2) : strpbrk (__retval, __reject))))) : strpbrk (__retval, __reject)); })) != ((void *)0)) *(*__s)++ = '\0'; return __retval; } # 1188 "/usr/include/bits/string2.h" 3 # 1 "/usr/include/stdlib.h" 1 3 # 25 "/usr/include/stdlib.h" 3 # 1 "/usr/include/features.h" 1 3 # 26 "/usr/include/stdlib.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 34 "/usr/include/stdlib.h" 2 3 # 528 "/usr/include/stdlib.h" 3 extern void *malloc (size_t __size) __attribute__ ((__malloc__)); extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__malloc__)); # 1189 "/usr/include/bits/string2.h" 2 3 extern char *__strdup (__const char *__string) __attribute__ ((__malloc__)); # 1212 "/usr/include/bits/string2.h" 3 extern char *__strndup (__const char *__string, size_t __n) __attribute__ ((__malloc__)); # 360 "/usr/include/string.h" 2 3 # 55 "stdfn.h" 2 # 98 "stdfn.h" # 1 "/usr/include/stdlib.h" 1 3 # 25 "/usr/include/stdlib.h" 3 # 1 "/usr/include/features.h" 1 3 # 26 "/usr/include/stdlib.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 34 "/usr/include/stdlib.h" 2 3 # 94 "/usr/include/stdlib.h" 3 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; # 133 "/usr/include/stdlib.h" 3 extern size_t __ctype_get_mb_cur_max (void) ; extern double atof (__const char *__nptr) __attribute__ ((__pure__)); extern int atoi (__const char *__nptr) __attribute__ ((__pure__)); extern long int atol (__const char *__nptr) __attribute__ ((__pure__)); __extension__ extern long long int atoll (__const char *__nptr) __attribute__ ((__pure__)); extern double strtod (__const char *__restrict __nptr, char **__restrict __endptr) ; # 163 "/usr/include/stdlib.h" 3 extern long int strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern long long int strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern unsigned long long int strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern long long int strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern unsigned long long int strtoull (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; # 250 "/usr/include/stdlib.h" 3 extern double __strtod_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) ; extern float __strtof_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) ; extern long double __strtold_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) ; extern long int __strtol_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) ; extern unsigned long int __strtoul_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) ; __extension__ extern long long int __strtoll_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) ; __extension__ extern unsigned long long int __strtoull_internal (__const char * __restrict __nptr, char **__restrict __endptr, int __base, int __group) ; # 294 "/usr/include/stdlib.h" 3 extern __inline double strtod (__const char *__restrict __nptr, char **__restrict __endptr) { return __strtod_internal (__nptr, __endptr, 0); } extern __inline long int strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtol_internal (__nptr, __endptr, __base, 0); } extern __inline unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoul_internal (__nptr, __endptr, __base, 0); } # 326 "/usr/include/stdlib.h" 3 __extension__ extern __inline long long int strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoll_internal (__nptr, __endptr, __base, 0); } __extension__ extern __inline unsigned long long int strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoull_internal (__nptr, __endptr, __base, 0); } __extension__ extern __inline long long int strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoll_internal (__nptr, __endptr, __base, 0); } __extension__ extern __inline unsigned long long int strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base) { return __strtoull_internal (__nptr, __endptr, __base, 0); } extern __inline double atof (__const char *__nptr) { return strtod (__nptr, (char **) ((void *)0)); } extern __inline int atoi (__const char *__nptr) { return (int) strtol (__nptr, (char **) ((void *)0), 10); } extern __inline long int atol (__const char *__nptr) { return strtol (__nptr, (char **) ((void *)0), 10); } __extension__ extern __inline long long int atoll (__const char *__nptr) { return strtoll (__nptr, (char **) ((void *)0), 10); } # 385 "/usr/include/stdlib.h" 3 extern char *l64a (long int __n) ; extern long int a64l (__const char *__s) __attribute__ ((__pure__)); # 1 "/usr/include/sys/types.h" 1 3 # 26 "/usr/include/sys/types.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/sys/types.h" 2 3 # 1 "/usr/include/bits/types.h" 1 3 # 31 "/usr/include/sys/types.h" 2 3 typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino_t ino_t; # 58 "/usr/include/sys/types.h" 3 typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; typedef __off_t off_t; # 96 "/usr/include/sys/types.h" 3 typedef __pid_t pid_t; typedef __id_t id_t; typedef __ssize_t ssize_t; typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 126 "/usr/include/sys/types.h" 3 # 1 "/usr/include/time.h" 1 3 # 67 "/usr/include/time.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 68 "/usr/include/time.h" 2 3 typedef __time_t time_t; # 79 "/usr/include/time.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 80 "/usr/include/time.h" 2 3 typedef __clockid_t clockid_t; # 91 "/usr/include/time.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 92 "/usr/include/time.h" 2 3 typedef __timer_t timer_t; # 127 "/usr/include/sys/types.h" 2 3 # 140 "/usr/include/sys/types.h" 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 141 "/usr/include/sys/types.h" 2 3 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 184 "/usr/include/sys/types.h" 3 typedef int int8_t __attribute__ ((__mode__ (__QI__))); typedef int int16_t __attribute__ ((__mode__ (__HI__))); typedef int int32_t __attribute__ ((__mode__ (__SI__))); typedef int int64_t __attribute__ ((__mode__ (__DI__))); typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); typedef int register_t __attribute__ ((__mode__ (__word__))); # 206 "/usr/include/sys/types.h" 3 # 1 "/usr/include/endian.h" 1 3 # 207 "/usr/include/sys/types.h" 2 3 # 1 "/usr/include/sys/select.h" 1 3 # 25 "/usr/include/sys/select.h" 3 # 1 "/usr/include/features.h" 1 3 # 26 "/usr/include/sys/select.h" 2 3 # 1 "/usr/include/bits/types.h" 1 3 # 29 "/usr/include/sys/select.h" 2 3 # 1 "/usr/include/bits/select.h" 1 3 # 32 "/usr/include/sys/select.h" 2 3 # 1 "/usr/include/bits/sigset.h" 1 3 # 23 "/usr/include/bits/sigset.h" 3 typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 35 "/usr/include/sys/select.h" 2 3 typedef __sigset_t sigset_t; # 1 "/usr/include/time.h" 1 3 # 106 "/usr/include/time.h" 3 struct timespec { long int tv_sec; long int tv_nsec; }; # 44 "/usr/include/sys/select.h" 2 3 # 1 "/usr/include/bits/time.h" 1 3 # 63 "/usr/include/bits/time.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 64 "/usr/include/bits/time.h" 2 3 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 46 "/usr/include/sys/select.h" 2 3 typedef long int __fd_mask; typedef struct { __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 96 "/usr/include/sys/select.h" 3 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout) ; # 210 "/usr/include/sys/types.h" 2 3 # 1 "/usr/include/sys/sysmacros.h" 1 3 # 213 "/usr/include/sys/types.h" 2 3 # 224 "/usr/include/sys/types.h" 3 typedef __blkcnt_t blkcnt_t; typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; # 392 "/usr/include/stdlib.h" 2 3 extern long int random (void) ; extern void srandom (unsigned int __seed) ; extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) ; extern char *setstate (char *__statebuf) ; struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) ; extern int srandom_r (unsigned int __seed, struct random_data *__buf) ; extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) ; extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) ; extern int rand (void) ; extern void srand (unsigned int __seed) ; extern int rand_r (unsigned int *__seed) ; extern double drand48 (void) ; extern double erand48 (unsigned short int __xsubi[3]) ; extern long int lrand48 (void) ; extern long int nrand48 (unsigned short int __xsubi[3]) ; extern long int mrand48 (void) ; extern long int jrand48 (unsigned short int __xsubi[3]) ; extern void srand48 (long int __seedval) ; extern unsigned short int *seed48 (unsigned short int __seed16v[3]) ; extern void lcong48 (unsigned short int __param[7]) ; struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) ; extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) ; extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int srand48_r (long int __seedval, struct drand48_data *__buffer) ; extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) ; extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) ; # 537 "/usr/include/stdlib.h" 3 extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__malloc__)); extern void free (void *__ptr) ; extern void cfree (void *__ptr) ; # 1 "/usr/include/alloca.h" 1 3 # 22 "/usr/include/alloca.h" 3 # 1 "/usr/include/features.h" 1 3 # 23 "/usr/include/alloca.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 26 "/usr/include/alloca.h" 2 3 extern void *alloca (size_t __size) ; # 548 "/usr/include/stdlib.h" 2 3 extern void *valloc (size_t __size) __attribute__ ((__malloc__)); # 562 "/usr/include/stdlib.h" 3 extern void abort (void) __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) ; extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) ; extern void exit (int __status) __attribute__ ((__noreturn__)); # 588 "/usr/include/stdlib.h" 3 extern char *getenv (__const char *__name) ; extern char *__secure_getenv (__const char *__name) ; extern int putenv (char *__string) ; extern int setenv (__const char *__name, __const char *__value, int __replace) ; extern int unsetenv (__const char *__name) ; extern int clearenv (void) ; # 624 "/usr/include/stdlib.h" 3 extern char *mktemp (char *__template) ; extern int mkstemp (char *__template) ; # 651 "/usr/include/stdlib.h" 3 extern char *mkdtemp (char *__template) ; extern int system (__const char *__command) ; # 673 "/usr/include/stdlib.h" 3 extern char *realpath (__const char *__restrict __name, char *__restrict __resolved) ; typedef int (*__compar_fn_t) (__const void *, __const void *); # 690 "/usr/include/stdlib.h" 3 extern void *bsearch (__const void *__key, __const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar); extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar); extern int abs (int __x) __attribute__ ((__const__)); extern long int labs (long int __x) __attribute__ ((__const__)); # 711 "/usr/include/stdlib.h" 3 extern div_t div (int __numer, int __denom) __attribute__ ((__const__)); extern ldiv_t ldiv (long int __numer, long int __denom) __attribute__ ((__const__)); # 729 "/usr/include/stdlib.h" 3 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) ; extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) ; extern char *gcvt (double __value, int __ndigit, char *__buf) ; extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) ; extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) ; extern char *qgcvt (long double __value, int __ndigit, char *__buf) ; extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) ; extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) ; extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) ; extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) ; extern int mblen (__const char *__s, size_t __n) ; extern int mbtowc (wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n) ; extern int wctomb (char *__s, wchar_t __wchar) ; extern size_t mbstowcs (wchar_t *__restrict __pwcs, __const char *__restrict __s, size_t __n) ; extern size_t wcstombs (char *__restrict __s, __const wchar_t *__restrict __pwcs, size_t __n) ; extern int rpmatch (__const char *__response) ; # 859 "/usr/include/stdlib.h" 3 extern int getloadavg (double __loadavg[], int __nelem) ; # 99 "stdfn.h" 2 # 125 "stdfn.h" # 1 "/usr/include/unistd.h" 1 3 # 26 "/usr/include/unistd.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/unistd.h" 2 3 # 175 "/usr/include/unistd.h" 3 # 1 "/usr/include/bits/posix_opt.h" 1 3 # 176 "/usr/include/unistd.h" 2 3 # 190 "/usr/include/unistd.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 191 "/usr/include/unistd.h" 2 3 # 199 "/usr/include/unistd.h" 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 200 "/usr/include/unistd.h" 2 3 # 240 "/usr/include/unistd.h" 3 typedef __intptr_t intptr_t; typedef __socklen_t socklen_t; # 260 "/usr/include/unistd.h" 3 extern int access (__const char *__name, int __type) ; # 290 "/usr/include/unistd.h" 3 extern __off_t lseek (int __fd, __off_t __offset, int __whence) ; # 306 "/usr/include/unistd.h" 3 extern int close (int __fd) ; extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ; extern ssize_t write (int __fd, __const void *__buf, size_t __n) ; # 353 "/usr/include/unistd.h" 3 extern int pipe (int __pipedes[2]) ; # 362 "/usr/include/unistd.h" 3 extern unsigned int alarm (unsigned int __seconds) ; # 371 "/usr/include/unistd.h" 3 extern unsigned int sleep (unsigned int __seconds) ; extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) ; extern int usleep (__useconds_t __useconds) ; extern int pause (void) ; extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) ; extern int fchown (int __fd, __uid_t __owner, __gid_t __group) ; extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) ; extern int chdir (__const char *__path) ; extern int fchdir (int __fd) ; # 423 "/usr/include/unistd.h" 3 extern char *getcwd (char *__buf, size_t __size) ; # 436 "/usr/include/unistd.h" 3 extern char *getwd (char *__buf) ; extern int dup (int __fd) ; extern int dup2 (int __fd, int __fd2) ; extern char **__environ; extern int execve (__const char *__path, char *__const __argv[], char *__const __envp[]) ; # 467 "/usr/include/unistd.h" 3 extern int execv (__const char *__path, char *__const __argv[]) ; extern int execle (__const char *__path, __const char *__arg, ...) ; extern int execl (__const char *__path, __const char *__arg, ...) ; extern int execvp (__const char *__file, char *__const __argv[]) ; extern int execlp (__const char *__file, __const char *__arg, ...) ; extern int nice (int __inc) ; extern void _exit (int __status) __attribute__ ((__noreturn__)); # 1 "/usr/include/bits/confname.h" 1 3 # 25 "/usr/include/bits/confname.h" 3 enum { _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, _PC_SYNC_IO, _PC_ASYNC_IO, _PC_PRIO_IO, _PC_SOCK_MAXBUF, _PC_FILESIZEBITS, _PC_REC_INCR_XFER_SIZE, _PC_REC_MAX_XFER_SIZE, _PC_REC_MIN_XFER_SIZE, _PC_REC_XFER_ALIGN, _PC_ALLOC_SIZE_MIN, _PC_SYMLINK_MAX }; enum { _SC_ARG_MAX, _SC_CHILD_MAX, _SC_CLK_TCK, _SC_NGROUPS_MAX, _SC_OPEN_MAX, _SC_STREAM_MAX, _SC_TZNAME_MAX, _SC_JOB_CONTROL, _SC_SAVED_IDS, _SC_REALTIME_SIGNALS, _SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO, _SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE, _SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS, _SC_AIO_LISTIO_MAX, _SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX, _SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_VERSION, _SC_PAGESIZE, _SC_RTSIG_MAX, _SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, _SC_TIMER_MAX, _SC_BC_BASE_MAX, _SC_BC_DIM_MAX, _SC_BC_SCALE_MAX, _SC_BC_STRING_MAX, _SC_COLL_WEIGHTS_MAX, _SC_EQUIV_CLASS_MAX, _SC_EXPR_NEST_MAX, _SC_LINE_MAX, _SC_RE_DUP_MAX, _SC_CHARCLASS_NAME_MAX, _SC_2_VERSION, _SC_2_C_BIND, _SC_2_C_DEV, _SC_2_FORT_DEV, _SC_2_FORT_RUN, _SC_2_SW_DEV, _SC_2_LOCALEDEF, _SC_PII, _SC_PII_XTI, _SC_PII_SOCKET, _SC_PII_INTERNET, _SC_PII_OSI, _SC_POLL, _SC_SELECT, _SC_UIO_MAXIOV, _SC_IOV_MAX = _SC_UIO_MAXIOV, _SC_PII_INTERNET_STREAM, _SC_PII_INTERNET_DGRAM, _SC_PII_OSI_COTS, _SC_PII_OSI_CLTS, _SC_PII_OSI_M, _SC_T_IOV_MAX, _SC_THREADS, _SC_THREAD_SAFE_FUNCTIONS, _SC_GETGR_R_SIZE_MAX, _SC_GETPW_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_TTY_NAME_MAX, _SC_THREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_KEYS_MAX, _SC_THREAD_STACK_MIN, _SC_THREAD_THREADS_MAX, _SC_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKSIZE, _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_PROTECT, _SC_THREAD_PROCESS_SHARED, _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN, _SC_PHYS_PAGES, _SC_AVPHYS_PAGES, _SC_ATEXIT_MAX, _SC_PASS_MAX, _SC_XOPEN_VERSION, _SC_XOPEN_XCU_VERSION, _SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N, _SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, _SC_2_UPE, _SC_XOPEN_XPG2, _SC_XOPEN_XPG3, _SC_XOPEN_XPG4, _SC_CHAR_BIT, _SC_CHAR_MAX, _SC_CHAR_MIN, _SC_INT_MAX, _SC_INT_MIN, _SC_LONG_BIT, _SC_WORD_BIT, _SC_MB_LEN_MAX, _SC_NZERO, _SC_SSIZE_MAX, _SC_SCHAR_MAX, _SC_SCHAR_MIN, _SC_SHRT_MAX, _SC_SHRT_MIN, _SC_UCHAR_MAX, _SC_UINT_MAX, _SC_ULONG_MAX, _SC_USHRT_MAX, _SC_NL_ARGMAX, _SC_NL_LANGMAX, _SC_NL_MSGMAX, _SC_NL_NMAX, _SC_NL_SETMAX, _SC_NL_TEXTMAX, _SC_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFFBIG, _SC_XBS5_LP64_OFF64, _SC_XBS5_LPBIG_OFFBIG, _SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME, _SC_XOPEN_REALTIME_THREADS, _SC_ADVISORY_INFO, _SC_BARRIERS, _SC_BASE, _SC_C_LANG_SUPPORT, _SC_C_LANG_SUPPORT_R, _SC_CLOCK_SELECTION, _SC_CPUTIME, _SC_THREAD_CPUTIME, _SC_DEVICE_IO, _SC_DEVICE_SPECIFIC, _SC_DEVICE_SPECIFIC_R, _SC_FD_MGMT, _SC_FIFO, _SC_PIPE, _SC_FILE_ATTRIBUTES, _SC_FILE_LOCKING, _SC_FILE_SYSTEM, _SC_MONOTONIC_CLOCK, _SC_MULTI_PROCESS, _SC_SINGLE_PROCESS, _SC_NETWORKING, _SC_READER_WRITER_LOCKS, _SC_SPIN_LOCKS, _SC_REGEXP, _SC_REGEX_VERSION, _SC_SHELL, _SC_SIGNALS, _SC_SPAWN, _SC_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER, _SC_SYSTEM_DATABASE, _SC_SYSTEM_DATABASE_R, _SC_TIMEOUTS, _SC_TYPED_MEMORY_OBJECTS, _SC_USER_GROUPS, _SC_USER_GROUPS_R, _SC_2_PBS, _SC_2_PBS_ACCOUNTING, _SC_2_PBS_LOCATE, _SC_2_PBS_MESSAGE, _SC_2_PBS_TRACK, _SC_SYMLOOP_MAX, _SC_STREAMS, _SC_2_PBS_CHECKPOINT, _SC_V6_ILP32_OFF32, _SC_V6_ILP32_OFFBIG, _SC_V6_LP64_OFF64, _SC_V6_LPBIG_OFFBIG, _SC_HOST_NAME_MAX, _SC_TRACE, _SC_TRACE_EVENT_FILTER, _SC_TRACE_INHERIT, _SC_TRACE_LOG }; enum { _CS_PATH, # 563 "/usr/include/bits/confname.h" 3 _CS_V6_WIDTH_RESTRICTED_ENVS }; # 501 "/usr/include/unistd.h" 2 3 extern long int pathconf (__const char *__path, int __name) ; extern long int fpathconf (int __fd, int __name) ; extern long int sysconf (int __name) __attribute__ ((__const__)); extern size_t confstr (int __name, char *__buf, size_t __len) ; extern __pid_t getpid (void) ; extern __pid_t getppid (void) ; extern __pid_t getpgrp (void) ; # 536 "/usr/include/unistd.h" 3 extern __pid_t __getpgid (__pid_t __pid) ; # 545 "/usr/include/unistd.h" 3 extern int setpgid (__pid_t __pid, __pid_t __pgid) ; # 562 "/usr/include/unistd.h" 3 extern int setpgrp (void) ; # 580 "/usr/include/unistd.h" 3 extern __pid_t setsid (void) ; extern __uid_t getuid (void) ; extern __uid_t geteuid (void) ; extern __gid_t getgid (void) ; extern __gid_t getegid (void) ; extern int getgroups (int __size, __gid_t __list[]) ; # 613 "/usr/include/unistd.h" 3 extern int setuid (__uid_t __uid) ; extern int setreuid (__uid_t __ruid, __uid_t __euid) ; extern int seteuid (__uid_t __uid) ; extern int setgid (__gid_t __gid) ; extern int setregid (__gid_t __rgid, __gid_t __egid) ; extern int setegid (__gid_t __gid) ; extern __pid_t fork (void) ; extern __pid_t vfork (void) ; extern char *ttyname (int __fd) ; extern int ttyname_r (int __fd, char *__buf, size_t __buflen) ; extern int isatty (int __fd) ; extern int ttyslot (void) ; extern int link (__const char *__from, __const char *__to) ; extern int symlink (__const char *__from, __const char *__to) ; extern int readlink (__const char *__restrict __path, char *__restrict __buf, size_t __len) ; extern int unlink (__const char *__name) ; extern int rmdir (__const char *__path) ; extern __pid_t tcgetpgrp (int __fd) ; extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) ; extern char *getlogin (void) ; # 717 "/usr/include/unistd.h" 3 extern int setlogin (__const char *__name) ; # 726 "/usr/include/unistd.h" 3 # 1 "/usr/include/getopt.h" 1 3 # 47 "/usr/include/getopt.h" 3 extern char *optarg; # 61 "/usr/include/getopt.h" 3 extern int optind; extern int opterr; extern int optopt; # 145 "/usr/include/getopt.h" 3 extern int getopt (int __argc, char *const *__argv, const char *__shortopts); # 727 "/usr/include/unistd.h" 2 3 extern int gethostname (char *__name, size_t __len) ; extern int sethostname (__const char *__name, size_t __len) ; extern int sethostid (long int __id) ; extern int getdomainname (char *__name, size_t __len) ; extern int setdomainname (__const char *__name, size_t __len) ; extern int vhangup (void) ; extern int revoke (__const char *__file) ; extern int profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) ; extern int acct (__const char *__name) ; extern char *getusershell (void) ; extern void endusershell (void) ; extern void setusershell (void) ; extern int daemon (int __nochdir, int __noclose) ; extern int chroot (__const char *__path) ; extern char *getpass (__const char *__prompt) ; extern int fsync (int __fd) ; extern long int gethostid (void) ; extern void sync (void) ; extern int getpagesize (void) __attribute__ ((__const__)); extern int truncate (__const char *__file, __off_t __length) ; # 841 "/usr/include/unistd.h" 3 extern int ftruncate (int __fd, __off_t __length) ; # 857 "/usr/include/unistd.h" 3 extern int getdtablesize (void) ; # 866 "/usr/include/unistd.h" 3 extern int brk (void *__addr) ; extern void *sbrk (intptr_t __delta) ; # 887 "/usr/include/unistd.h" 3 extern long int syscall (long int __sysno, ...) ; # 907 "/usr/include/unistd.h" 3 extern int lockf (int __fd, int __cmd, __off_t __len) ; # 938 "/usr/include/unistd.h" 3 extern int fdatasync (int __fildes) ; # 983 "/usr/include/unistd.h" 3 extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) ; # 126 "stdfn.h" 2 # 1 "/usr/include/errno.h" 1 3 # 29 "/usr/include/errno.h" 3 # 1 "/usr/include/features.h" 1 3 # 30 "/usr/include/errno.h" 2 3 # 1 "/usr/include/bits/errno.h" 1 3 # 25 "/usr/include/bits/errno.h" 3 # 1 "/usr/include/linux/errno.h" 1 3 # 1 "/usr/include/asm/errno.h" 1 3 # 5 "/usr/include/linux/errno.h" 2 3 # 26 "/usr/include/bits/errno.h" 2 3 # 36 "/usr/include/bits/errno.h" 3 extern int errno; extern int *__errno_location (void) __attribute__ ((__const__)); # 37 "/usr/include/errno.h" 2 3 # 134 "stdfn.h" 2 # 1 "/usr/include/sys/types.h" 1 3 # 141 "stdfn.h" 2 # 1 "/usr/include/sys/stat.h" 1 3 # 26 "/usr/include/sys/stat.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/sys/stat.h" 2 3 # 1 "/usr/include/bits/types.h" 1 3 # 29 "/usr/include/sys/stat.h" 2 3 # 98 "/usr/include/sys/stat.h" 3 # 1 "/usr/include/bits/stat.h" 1 3 # 36 "/usr/include/bits/stat.h" 3 struct stat { __dev_t st_dev; unsigned short int __pad1; __ino_t st_ino; __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; unsigned short int __pad2; __off_t st_size; __blksize_t st_blksize; __blkcnt_t st_blocks; __time_t st_atime; unsigned long int __unused1; __time_t st_mtime; unsigned long int __unused2; __time_t st_ctime; unsigned long int __unused3; unsigned long int __unused4; unsigned long int __unused5; }; # 99 "/usr/include/sys/stat.h" 2 3 # 200 "/usr/include/sys/stat.h" 3 extern int stat (__const char *__restrict __file, struct stat *__restrict __buf) ; extern int fstat (int __fd, struct stat *__buf) ; # 228 "/usr/include/sys/stat.h" 3 extern int lstat (__const char *__restrict __file, struct stat *__restrict __buf) ; # 249 "/usr/include/sys/stat.h" 3 extern int chmod (__const char *__file, __mode_t __mode) ; extern int fchmod (int __fd, __mode_t __mode) ; extern __mode_t umask (__mode_t __mask) ; # 268 "/usr/include/sys/stat.h" 3 extern int mkdir (__const char *__path, __mode_t __mode) ; extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) ; extern int mkfifo (__const char *__path, __mode_t __mode) ; # 306 "/usr/include/sys/stat.h" 3 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) ; extern int __xstat (int __ver, __const char *__filename, struct stat *__stat_buf) ; extern int __lxstat (int __ver, __const char *__filename, struct stat *__stat_buf) ; # 337 "/usr/include/sys/stat.h" 3 extern int __xmknod (int __ver, __const char *__path, __mode_t __mode, __dev_t *__dev) ; extern __inline__ int stat (__const char *__path, struct stat *__statbuf) { return __xstat (3, __path, __statbuf); } extern __inline__ int lstat (__const char *__path, struct stat *__statbuf) { return __lxstat (3, __path, __statbuf); } extern __inline__ int fstat (int __fd, struct stat *__statbuf) { return __fxstat (3, __fd, __statbuf); } extern __inline__ int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) { return __xmknod (1, __path, __mode, &__dev); } # 145 "stdfn.h" 2 # 217 "stdfn.h" # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/limits.h" 1 3 # 11 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/limits.h" 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/syslimits.h" 1 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/limits.h" 1 3 # 130 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/limits.h" 3 # 1 "/usr/include/limits.h" 1 3 # 26 "/usr/include/limits.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/limits.h" 2 3 # 144 "/usr/include/limits.h" 3 # 1 "/usr/include/bits/posix1_lim.h" 1 3 # 126 "/usr/include/bits/posix1_lim.h" 3 # 1 "/usr/include/bits/local_lim.h" 1 3 # 36 "/usr/include/bits/local_lim.h" 3 # 1 "/usr/include/linux/limits.h" 1 3 # 37 "/usr/include/bits/local_lim.h" 2 3 # 127 "/usr/include/bits/posix1_lim.h" 2 3 # 145 "/usr/include/limits.h" 2 3 # 1 "/usr/include/bits/posix2_lim.h" 1 3 # 149 "/usr/include/limits.h" 2 3 # 131 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/limits.h" 2 3 # 8 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/syslimits.h" 2 3 # 12 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/limits.h" 2 3 # 218 "stdfn.h" 2 # 229 "stdfn.h" # 1 "/usr/include/time.h" 1 3 # 28 "/usr/include/time.h" 3 # 1 "/usr/include/features.h" 1 3 # 29 "/usr/include/time.h" 2 3 # 38 "/usr/include/time.h" 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 39 "/usr/include/time.h" 2 3 # 1 "/usr/include/bits/time.h" 1 3 # 39 "/usr/include/bits/time.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 40 "/usr/include/bits/time.h" 2 3 extern long int __sysconf (int); # 43 "/usr/include/time.h" 2 3 # 56 "/usr/include/time.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 57 "/usr/include/time.h" 2 3 typedef __clock_t clock_t; # 118 "/usr/include/time.h" 3 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; __const char *tm_zone; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; struct sigevent; # 163 "/usr/include/time.h" 3 extern clock_t clock (void) ; extern time_t time (time_t *__timer) ; extern double difftime (time_t __time1, time_t __time0) __attribute__ ((__const__)); extern time_t mktime (struct tm *__tp) ; extern size_t strftime (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) ; # 194 "/usr/include/time.h" 3 extern struct tm *gmtime (__const time_t *__timer) ; extern struct tm *localtime (__const time_t *__timer) ; extern struct tm *gmtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) ; extern struct tm *localtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) ; extern char *asctime (__const struct tm *__tp) ; extern char *ctime (__const time_t *__timer) ; extern char *asctime_r (__const struct tm *__restrict __tp, char *__restrict __buf) ; extern char *ctime_r (__const time_t *__restrict __timer, char *__restrict __buf) ; extern char *__tzname[2]; extern int __daylight; extern long int __timezone; extern char *tzname[2]; extern void tzset (void) ; extern int daylight; extern long int timezone; extern int stime (__const time_t *__when) ; # 271 "/usr/include/time.h" 3 extern time_t timegm (struct tm *__tp) ; extern time_t timelocal (struct tm *__tp) ; extern int dysize (int __year) __attribute__ ((__const__)); extern int nanosleep (__const struct timespec *__requested_time, struct timespec *__remaining) ; extern int clock_getres (clockid_t __clock_id, struct timespec *__res) ; extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) ; extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) ; # 309 "/usr/include/time.h" 3 extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) ; extern int timer_delete (timer_t __timerid) ; extern int timer_settime (timer_t __timerid, int __flags, __const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) ; extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) ; extern int timer_getoverrun (timer_t __timerid) ; # 230 "stdfn.h" 2 # 238 "stdfn.h" # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/float.h" 1 3 # 239 "stdfn.h" 2 # 1 "/usr/include/locale.h" 1 3 # 26 "/usr/include/locale.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/locale.h" 2 3 # 1 "/usr/opt/packages/gcc-3.0/lib/gcc-lib/i586-pc-linux-gnu/3.0/include/stddef.h" 1 3 # 30 "/usr/include/locale.h" 2 3 # 1 "/usr/include/bits/locale.h" 1 3 # 27 "/usr/include/bits/locale.h" 3 enum { __LC_CTYPE = 0, __LC_NUMERIC = 1, __LC_TIME = 2, __LC_COLLATE = 3, __LC_MONETARY = 4, __LC_MESSAGES = 5, __LC_ALL = 6, __LC_PAPER = 7, __LC_NAME = 8, __LC_ADDRESS = 9, __LC_TELEPHONE = 10, __LC_MEASUREMENT = 11, __LC_IDENTIFICATION = 12 }; # 31 "/usr/include/locale.h" 2 3 # 52 "/usr/include/locale.h" 3 struct lconv { char *decimal_point; char *thousands_sep; char *grouping; char *int_curr_symbol; char *currency_symbol; char *mon_decimal_point; char *mon_thousands_sep; char *mon_grouping; char *positive_sign; char *negative_sign; char int_frac_digits; char frac_digits; char p_cs_precedes; char p_sep_by_space; char n_cs_precedes; char n_sep_by_space; char p_sign_posn; char n_sign_posn; # 112 "/usr/include/locale.h" 3 char __int_p_cs_precedes; char __int_p_sep_by_space; char __int_n_cs_precedes; char __int_n_sep_by_space; char __int_p_sign_posn; char __int_n_sign_posn; }; extern char *setlocale (int __category, __const char *__locale) ; extern struct lconv *localeconv (void) ; # 243 "stdfn.h" 2 # 1 "/usr/include/math.h" 1 3 # 27 "/usr/include/math.h" 3 # 1 "/usr/include/features.h" 1 3 # 28 "/usr/include/math.h" 2 3 # 1 "/usr/include/bits/huge_val.h" 1 3 # 25 "/usr/include/bits/huge_val.h" 3 # 1 "/usr/include/features.h" 1 3 # 26 "/usr/include/bits/huge_val.h" 2 3 # 34 "/usr/include/math.h" 2 3 # 1 "/usr/include/bits/mathdef.h" 1 3 # 41 "/usr/include/math.h" 2 3 # 63 "/usr/include/math.h" 3 # 1 "/usr/include/bits/mathcalls.h" 1 3 # 54 "/usr/include/bits/mathcalls.h" 3 extern double acos (double __x) ; extern double __acos (double __x) ; extern double asin (double __x) ; extern double __asin (double __x) ; extern double atan (double __x) ; extern double __atan (double __x) ; extern double atan2 (double __y, double __x) ; extern double __atan2 (double __y, double __x) ; extern double cos (double __x) ; extern double __cos (double __x) ; extern double sin (double __x) ; extern double __sin (double __x) ; extern double tan (double __x) ; extern double __tan (double __x) ; # 78 "/usr/include/bits/mathcalls.h" 3 extern double cosh (double __x) ; extern double __cosh (double __x) ; extern double sinh (double __x) ; extern double __sinh (double __x) ; extern double tanh (double __x) ; extern double __tanh (double __x) ; extern double acosh (double __x) ; extern double __acosh (double __x) ; extern double asinh (double __x) ; extern double __asinh (double __x) ; extern double atanh (double __x) ; extern double __atanh (double __x) ; extern double exp (double __x) ; extern double __exp (double __x) ; # 106 "/usr/include/bits/mathcalls.h" 3 extern double frexp (double __x, int *__exponent) ; extern double __frexp (double __x, int *__exponent) ; extern double ldexp (double __x, int __exponent) ; extern double __ldexp (double __x, int __exponent) ; extern double log (double __x) ; extern double __log (double __x) ; extern double log10 (double __x) ; extern double __log10 (double __x) ; extern double modf (double __x, double *__iptr) ; extern double __modf (double __x, double *__iptr) ; extern double expm1 (double __x) ; extern double __expm1 (double __x) ; extern double log1p (double __x) ; extern double __log1p (double __x) ; extern double logb (double __x) ; extern double __logb (double __x) ; # 143 "/usr/include/bits/mathcalls.h" 3 extern double pow (double __x, double __y) ; extern double __pow (double __x, double __y) ; extern double sqrt (double __x) ; extern double __sqrt (double __x) ; extern double hypot (double __x, double __y) ; extern double __hypot (double __x, double __y) ; extern double cbrt (double __x) ; extern double __cbrt (double __x) ; extern double ceil (double __x) ; extern double __ceil (double __x) ; extern double fabs (double __x) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__const__)); extern double floor (double __x) ; extern double __floor (double __x) ; extern double fmod (double __x, double __y) ; extern double __fmod (double __x, double __y) ; extern int __isinf (double __value) __attribute__ ((__const__)); extern int __finite (double __value) __attribute__ ((__const__)); extern int isinf (double __value) __attribute__ ((__const__)); extern int finite (double __value) __attribute__ ((__const__)); extern double drem (double __x, double __y) ; extern double __drem (double __x, double __y) ; extern double significand (double __x) ; extern double __significand (double __x) ; extern double copysign (double __x, double __y) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__const__)); # 209 "/usr/include/bits/mathcalls.h" 3 extern int __isnan (double __value) __attribute__ ((__const__)); extern int isnan (double __value) __attribute__ ((__const__)); extern double j0 (double) ; extern double __j0 (double) ; extern double j1 (double) ; extern double __j1 (double) ; extern double jn (int, double) ; extern double __jn (int, double) ; extern double y0 (double) ; extern double __y0 (double) ; extern double y1 (double) ; extern double __y1 (double) ; extern double yn (int, double) ; extern double __yn (int, double) ; extern double erf (double) ; extern double __erf (double) ; extern double erfc (double) ; extern double __erfc (double) ; extern double lgamma (double) ; extern double __lgamma (double) ; # 238 "/usr/include/bits/mathcalls.h" 3 extern double gamma (double) ; extern double __gamma (double) ; extern double lgamma_r (double, int *__signgamp) ; extern double __lgamma_r (double, int *__signgamp) ; extern double rint (double __x) ; extern double __rint (double __x) ; extern double nextafter (double __x, double __y) __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) __attribute__ ((__const__)); extern double remainder (double __x, double __y) ; extern double __remainder (double __x, double __y) ; extern double scalb (double __x, double __n) ; extern double __scalb (double __x, double __n) ; extern double scalbn (double __x, int __n) ; extern double __scalbn (double __x, int __n) ; extern int ilogb (double __x) ; extern int __ilogb (double __x) ; # 64 "/usr/include/math.h" 2 3 # 82 "/usr/include/math.h" 3 # 1 "/usr/include/bits/mathcalls.h" 1 3 # 54 "/usr/include/bits/mathcalls.h" 3 extern float acosf (float __x) ; extern float __acosf (float __x) ; extern float asinf (float __x) ; extern float __asinf (float __x) ; extern float atanf (float __x) ; extern float __atanf (float __x) ; extern float atan2f (float __y, float __x) ; extern float __atan2f (float __y, float __x) ; extern float cosf (float __x) ; extern float __cosf (float __x) ; extern float sinf (float __x) ; extern float __sinf (float __x) ; extern float tanf (float __x) ; extern float __tanf (float __x) ; # 78 "/usr/include/bits/mathcalls.h" 3 extern float coshf (float __x) ; extern float __coshf (float __x) ; extern float sinhf (float __x) ; extern float __sinhf (float __x) ; extern float tanhf (float __x) ; extern float __tanhf (float __x) ; extern float acoshf (float __x) ; extern float __acoshf (float __x) ; extern float asinhf (float __x) ; extern float __asinhf (float __x) ; extern float atanhf (float __x) ; extern float __atanhf (float __x) ; extern float expf (float __x) ; extern float __expf (float __x) ; # 106 "/usr/include/bits/mathcalls.h" 3 extern float frexpf (float __x, int *__exponent) ; extern float __frexpf (float __x, int *__exponent) ; extern float ldexpf (float __x, int __exponent) ; extern float __ldexpf (float __x, int __exponent) ; extern float logf (float __x) ; extern float __logf (float __x) ; extern float log10f (float __x) ; extern float __log10f (float __x) ; extern float modff (float __x, float *__iptr) ; extern float __modff (float __x, float *__iptr) ; extern float expm1f (float __x) ; extern float __expm1f (float __x) ; extern float log1pf (float __x) ; extern float __log1pf (float __x) ; extern float logbf (float __x) ; extern float __logbf (float __x) ; # 143 "/usr/include/bits/mathcalls.h" 3 extern float powf (float __x, float __y) ; extern float __powf (float __x, float __y) ; extern float sqrtf (float __x) ; extern float __sqrtf (float __x) ; extern float hypotf (float __x, float __y) ; extern float __hypotf (float __x, float __y) ; extern float cbrtf (float __x) ; extern float __cbrtf (float __x) ; extern float ceilf (float __x) ; extern float __ceilf (float __x) ; extern float fabsf (float __x) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__const__)); extern float floorf (float __x) ; extern float __floorf (float __x) ; extern float fmodf (float __x, float __y) ; extern float __fmodf (float __x, float __y) ; extern int __isinff (float __value) __attribute__ ((__const__)); extern int __finitef (float __value) __attribute__ ((__const__)); extern int isinff (float __value) __attribute__ ((__const__)); extern int finitef (float __value) __attribute__ ((__const__)); extern float dremf (float __x, float __y) ; extern float __dremf (float __x, float __y) ; extern float significandf (float __x) ; extern float __significandf (float __x) ; extern float copysignf (float __x, float __y) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__const__)); # 209 "/usr/include/bits/mathcalls.h" 3 extern int __isnanf (float __value) __attribute__ ((__const__)); extern int isnanf (float __value) __attribute__ ((__const__)); extern float j0f (float) ; extern float __j0f (float) ; extern float j1f (float) ; extern float __j1f (float) ; extern float jnf (int, float) ; extern float __jnf (int, float) ; extern float y0f (float) ; extern float __y0f (float) ; extern float y1f (float) ; extern float __y1f (float) ; extern float ynf (int, float) ; extern float __ynf (int, float) ; extern float erff (float) ; extern float __erff (float) ; extern float erfcf (float) ; extern float __erfcf (float) ; extern float lgammaf (float) ; extern float __lgammaf (float) ; # 238 "/usr/include/bits/mathcalls.h" 3 extern float gammaf (float) ; extern float __gammaf (float) ; extern float lgammaf_r (float, int *__signgamp) ; extern float __lgammaf_r (float, int *__signgamp) ; extern float rintf (float __x) ; extern float __rintf (float __x) ; extern float nextafterf (float __x, float __y) __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__const__)); extern float remainderf (float __x, float __y) ; extern float __remainderf (float __x, float __y) ; extern float scalbf (float __x, float __n) ; extern float __scalbf (float __x, float __n) ; extern float scalbnf (float __x, int __n) ; extern float __scalbnf (float __x, int __n) ; extern int ilogbf (float __x) ; extern int __ilogbf (float __x) ; # 83 "/usr/include/math.h" 2 3 # 99 "/usr/include/math.h" 3 # 1 "/usr/include/bits/mathcalls.h" 1 3 # 54 "/usr/include/bits/mathcalls.h" 3 extern long double acosl (long double __x) ; extern long double __acosl (long double __x) ; extern long double asinl (long double __x) ; extern long double __asinl (long double __x) ; extern long double atanl (long double __x) ; extern long double __atanl (long double __x) ; extern long double atan2l (long double __y, long double __x) ; extern long double __atan2l (long double __y, long double __x) ; extern long double cosl (long double __x) ; extern long double __cosl (long double __x) ; extern long double sinl (long double __x) ; extern long double __sinl (long double __x) ; extern long double tanl (long double __x) ; extern long double __tanl (long double __x) ; # 78 "/usr/include/bits/mathcalls.h" 3 extern long double coshl (long double __x) ; extern long double __coshl (long double __x) ; extern long double sinhl (long double __x) ; extern long double __sinhl (long double __x) ; extern long double tanhl (long double __x) ; extern long double __tanhl (long double __x) ; extern long double acoshl (long double __x) ; extern long double __acoshl (long double __x) ; extern long double asinhl (long double __x) ; extern long double __asinhl (long double __x) ; extern long double atanhl (long double __x) ; extern long double __atanhl (long double __x) ; extern long double expl (long double __x) ; extern long double __expl (long double __x) ; # 106 "/usr/include/bits/mathcalls.h" 3 extern long double frexpl (long double __x, int *__exponent) ; extern long double __frexpl (long double __x, int *__exponent) ; extern long double ldexpl (long double __x, int __exponent) ; extern long double __ldexpl (long double __x, int __exponent) ; extern long double logl (long double __x) ; extern long double __logl (long double __x) ; extern long double log10l (long double __x) ; extern long double __log10l (long double __x) ; extern long double modfl (long double __x, long double *__iptr) ; extern long double __modfl (long double __x, long double *__iptr) ; extern long double expm1l (long double __x) ; extern long double __expm1l (long double __x) ; extern long double log1pl (long double __x) ; extern long double __log1pl (long double __x) ; extern long double logbl (long double __x) ; extern long double __logbl (long double __x) ; # 143 "/usr/include/bits/mathcalls.h" 3 extern long double powl (long double __x, long double __y) ; extern long double __powl (long double __x, long double __y) ; extern long double sqrtl (long double __x) ; extern long double __sqrtl (long double __x) ; extern long double hypotl (long double __x, long double __y) ; extern long double __hypotl (long double __x, long double __y) ; extern long double cbrtl (long double __x) ; extern long double __cbrtl (long double __x) ; extern long double ceill (long double __x) ; extern long double __ceill (long double __x) ; extern long double fabsl (long double __x) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__const__)); extern long double floorl (long double __x) ; extern long double __floorl (long double __x) ; extern long double fmodl (long double __x, long double __y) ; extern long double __fmodl (long double __x, long double __y) ; extern int __isinfl (long double __value) __attribute__ ((__const__)); extern int __finitel (long double __value) __attribute__ ((__const__)); extern int isinfl (long double __value) __attribute__ ((__const__)); extern int finitel (long double __value) __attribute__ ((__const__)); extern long double dreml (long double __x, long double __y) ; extern long double __dreml (long double __x, long double __y) ; extern long double significandl (long double __x) ; extern long double __significandl (long double __x) ; extern long double copysignl (long double __x, long double __y) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__const__)); # 209 "/usr/include/bits/mathcalls.h" 3 extern int __isnanl (long double __value) __attribute__ ((__const__)); extern int isnanl (long double __value) __attribute__ ((__const__)); extern long double j0l (long double) ; extern long double __j0l (long double) ; extern long double j1l (long double) ; extern long double __j1l (long double) ; extern long double jnl (int, long double) ; extern long double __jnl (int, long double) ; extern long double y0l (long double) ; extern long double __y0l (long double) ; extern long double y1l (long double) ; extern long double __y1l (long double) ; extern long double ynl (int, long double) ; extern long double __ynl (int, long double) ; extern long double erfl (long double) ; extern long double __erfl (long double) ; extern long double erfcl (long double) ; extern long double __erfcl (long double) ; extern long double lgammal (long double) ; extern long double __lgammal (long double) ; # 238 "/usr/include/bits/mathcalls.h" 3 extern long double gammal (long double) ; extern long double __gammal (long double) ; extern long double lgammal_r (long double, int *__signgamp) ; extern long double __lgammal_r (long double, int *__signgamp) ; extern long double rintl (long double __x) ; extern long double __rintl (long double __x) ; extern long double nextafterl (long double __x, long double __y) __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__const__)); extern long double remainderl (long double __x, long double __y) ; extern long double __remainderl (long double __x, long double __y) ; extern long double scalbl (long double __x, long double __n) ; extern long double __scalbl (long double __x, long double __n) ; extern long double scalbnl (long double __x, int __n) ; extern long double __scalbnl (long double __x, int __n) ; extern int ilogbl (long double __x) ; extern int __ilogbl (long double __x) ; # 100 "/usr/include/math.h" 2 3 # 113 "/usr/include/math.h" 3 extern int signgam; # 240 "/usr/include/math.h" 3 typedef enum { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_, _ISOC_ } _LIB_VERSION_TYPE; extern _LIB_VERSION_TYPE _LIB_VERSION; # 265 "/usr/include/math.h" 3 struct exception { int type; char *name; double arg1; double arg2; double retval; }; extern int matherr (struct exception *__exc); # 350 "/usr/include/math.h" 3 # 1 "/usr/include/bits/mathinline.h" 1 3 # 291 "/usr/include/bits/mathinline.h" 3 extern __inline double __sgn (double) ; extern __inline double __sgn (double __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } extern __inline float __sgnf (float) ; extern __inline float __sgnf (float __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } extern __inline long double __sgnl (long double) ; extern __inline long double __sgnl (long double __x) { return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } # 425 "/usr/include/bits/mathinline.h" 3 extern __inline double atan2 (double __y, double __x) { register long double __value; __asm __volatile__ ("fpatan" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); return __value; } extern __inline float atan2f (float __y, float __x) { register long double __value; __asm __volatile__ ("fpatan" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); return __value; } extern __inline long double atan2l (long double __y, long double __x) { register long double __value; __asm __volatile__ ("fpatan" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); return __value; } extern __inline long double __atan2l (long double __y, long double __x) { register long double __value; __asm __volatile__ ("fpatan" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); return __value; } extern __inline double fmod (double __x, double __y) { register long double __value; __asm __volatile__ ("1: fprem\n\t" "fnstsw %%ax\n\t" "sahf\n\t" "jp 1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; } extern __inline float fmodf (float __x, float __y) { register long double __value; __asm __volatile__ ("1: fprem\n\t" "fnstsw %%ax\n\t" "sahf\n\t" "jp 1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; } extern __inline long double fmodl (long double __x, long double __y) { register long double __value; __asm __volatile__ ("1: fprem\n\t" "fnstsw %%ax\n\t" "sahf\n\t" "jp 1b" : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc"); return __value; } # 440 "/usr/include/bits/mathinline.h" 3 extern __inline double sqrt (double __x) { register double __result; __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); return __result; } extern __inline float sqrtf (float __x) { register float __result; __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); return __result; } extern __inline long double sqrtl (long double __x) { register long double __result; __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); return __result; } extern __inline long double __sqrtl (long double __x) { register long double __result; __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); return __result; } extern __inline double fabs (double __x) { return __builtin_fabs (__x); } extern __inline float fabsf (float __x) { return __builtin_fabsf (__x); } extern __inline long double fabsl (long double __x) { return __builtin_fabsl (__x); } extern __inline long double __fabsl (long double __x) { return __builtin_fabsl (__x); } # 466 "/usr/include/bits/mathinline.h" 3 extern __inline double atan (double __x) { register double __result; __asm __volatile__ ("fld1; fpatan" : "=t" (__result) : "0" (__x) : "st(1)"); return __result; } extern __inline float atanf (float __x) { register float __result; __asm __volatile__ ("fld1; fpatan" : "=t" (__result) : "0" (__x) : "st(1)"); return __result; } extern __inline long double atanl (long double __x) { register long double __result; __asm __volatile__ ("fld1; fpatan" : "=t" (__result) : "0" (__x) : "st(1)"); return __result; } extern __inline long double __sgn1l (long double) ; extern __inline long double __sgn1l (long double __x) { __extension__ union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x }; __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; __n.__xi[1] = 0x80000000; __n.__xi[0] = 0; return __n.__xld; } # 492 "/usr/include/bits/mathinline.h" 3 extern __inline double floor (double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline float floorf (float __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline long double floorl (long double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstc! w %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } # 503 "/usr/include/bits/mathinline.h" 3 extern __inline double ceil (double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline float ceilf (float __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } extern __inline long double ceill (long double __x) { register long double __value; __volatile unsigned short int __cw; __volatile unsigned short int __cwtmp; __asm __volatile ("fnstcw %! 0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); return __value; } # 521 "/usr/include/bits/mathinline.h" 3 extern __inline double ldexp (double __x, int __y) { register long double __value; __asm __volatile__ ("fscale" : "=t" (__value) : "0" (__x), "u" ((long double) __y)); return __value; } # 539 "/usr/include/bits/mathinline.h" 3 extern __inline double log1p (double __x) { register long double __value; if (__fabsl (__x) >= 1.0 - 0.5 * 1.41421356237309504880L) __value = logl (1.0 + __x); else __asm __volatile__ ("fldln2\n\t" "fxch\n\t" "fyl2xp1" : "=t" (__value) : "0" (__x) : "st(1)"); return __value; } extern __inline float log1pf (float __x) { register long double __value; if (__fabsl (__x) >= 1.0 - 0.5 * 1.41421356237309504880L) __value = logl (1.0 + __x); else __asm __volatile__ ("fldln2\n\t" "fxch\n\t" "fyl2xp1" : "=t" (__value) : "0" (__x) : "st(1)"); return __value; } extern __inline long double log1pl (long double __x) { register long double __value; if (__fabsl (__x) >= 1.0 - 0.5 * 1.41421356237309504880L) __value = logl (1.0 + __x); else __asm __volatile__ ("fldln2\n\t" "fxch\n\t" "fyl2xp1" : "=t" (__value) : "0" (__x) : "st(1)"); return __value; } # 553 "/usr/include/bits/mathinline.h" 3 extern __inline double asinh (double __x) { register long double __y = __fabsl (__x); return (log1pl (__y * __y / (__sqrtl (__y * __y + 1.0) + 1.0) + __y) * __sgn1l (__x)); } extern __inline float asinhf (float __x) { register long double __y = __fabsl (__x); return (log1pl (__y * __y / (__sqrtl (__y * __y + 1.0) + 1.0) + __y) * __sgn1l (__x)); } extern __inline long double asinhl (long double __x) { register long double __y = __fabsl (__x); return (log1pl (__y * __y / (__sqrtl (__y * __y + 1.0) + 1.0) + __y) * __sgn1l (__x)); } extern __inline double acosh (double __x) { return logl (__x + __sqrtl (__x - 1.0) * __sqrtl (__x + 1.0)); } extern __inline float acoshf (float __x) { return logl (__x + __sqrtl (__x - 1.0) * __sqrtl (__x + 1.0)); } extern __inline long double acoshl (long double __x) { return logl (__x + __sqrtl (__x - 1.0) * __sqrtl (__x + 1.0)); } extern __inline double atanh (double __x) { register long double __y = __fabsl (__x); return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x); } extern __inline float atanhf (float __x) { register long double __y = __fabsl (__x); return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x); } extern __inline long double atanhl (long double __x) { register long double __y = __fabsl (__x); return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x); } extern __inline double hypot (double __x, double __y) { return __sqrtl (__x * __x + __y * __y); } extern __inline float hypotf (float __x, float __y) { return __sqrtl (__x * __x + __y * __y); } extern __inline long double hypotl (long double __x, long double __y) { return __sqrtl (__x * __x + __y * __y); } extern __inline double logb (double __x) { register long double __value; register long double __junk; __asm __volatile__ ("fxtract\n\t" : "=t" (__junk), "=u" (__value) : "0" (__x)); return __value; } extern __inline float logbf (float __x) { register long double __value; register long double __junk; __asm __volatile__ ("fxtract\n\t" : "=t" (__junk), "=u" (__value) : "0" (__x)); return __value; } extern __inline long double logbl (long double __x) { register long double __value; register long double __junk; __asm __volatile__ ("fxtract\n\t" : "=t" (__junk), "=u" (__value) : "0" (__x)); return __value; } # 652 "/usr/include/bits/mathinline.h" 3 extern __inline double drem (double __x, double __y) { register double __value; register int __clobbered; __asm __volatile__ ("1: fprem1\n\t" "fstsw %%ax\n\t" "sahf\n\t" "jp 1b" : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc"); return __value; } extern __inline float dremf (float __x, float __y) { register double __value; register int __clobbered; __asm __volatile__ ("1: fprem1\n\t" "fstsw %%ax\n\t" "sahf\n\t" "jp 1b" : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc"); return __value; } extern __inline long double dreml (long double __x, long double __y) { register double __value; register int __clobbered; __asm __volatile__ ("1: fprem1\n\t" "fstsw %%ax\n\t" "sahf\n\t" "jp 1b" : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc"); return __value; } # 665 "/usr/include/bits/mathinline.h" 3 extern __inline int __finite (double __x) { return (__extension__ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] | 0x800fffffu) + 1) >> 31)); } # 351 "/usr/include/math.h" 2 3 # 247 "stdfn.h" 2 # 289 "stdfn.h" # 1 "/usr/include/assert.h" 1 3 # 36 "/usr/include/assert.h" 3 # 1 "/usr/include/features.h" 1 3 # 37 "/usr/include/assert.h" 2 3 # 68 "/usr/include/assert.h" 3 extern void __assert_fail (__const char *__assertion, __const char *__file, unsigned int __line, __const char *__function) __attribute__ ((__noreturn__)); extern void __assert_perror_fail (int __errnum, __const char *__file, unsigned int __line, __const char *__function) __attribute__ ((__noreturn__)); extern void __assert (const char *__assertion, const char *__file, int __line) __attribute__ ((__noreturn__)); # 290 "stdfn.h" 2 # 49 "plot.h" 2 # 81 "plot.h" typedef int TBOOLEAN; # 222 "plot.h" typedef double coordval; # 343 "plot.h" typedef void (*sigfunc)(int); typedef int (*sortfunc) (const void *, const void *); enum operators { PUSH, PUSHC, PUSHD1, PUSHD2, PUSHD, CALL, CALLN, LNOT, BNOT, UMINUS, LOR, LAND, BOR, XOR, BAND, EQ, NE, GT, LT, GE, LE, PLUS, MINUS, MULT, DIV, MOD, POWER, FACTORIAL, BOOLE, DOLLARS, JUMP, JUMPZ, JUMPNZ, JTERN, SF_START }; enum DATA_TYPES { INTGR, CMPLX }; enum PLOT_TYPE { FUNC, DATA, FUNC3D, DATA3D }; enum PLOT_STYLE { LINES = 0*8 + 1, POINTSTYLE = 1*8 + 2, IMPULSES = 2*8 + 1, LINESPOINTS= 3*8 + 3, DOTS = 4*8 + 0, XERRORBARS = 5*8 + 6, YERRORBARS = 6*8 + 6, XYERRORBARS= 7*8 + 6, BOXXYERROR = 8*8 + 1, BOXES = 9*8 + 1, BOXERROR =10*8 + 1, STEPS =11*8 + 1, FSTEPS =12*8 + 1, HISTEPS =13*8 + 1, VECTOR =14*8 + 1, CANDLESTICKS=15*8 + 4, FINANCEBARS=16*8 + 1 }; enum PLOT_SMOOTH { NONE, UNIQUE, CSPLINES, ACSPLINES, BEZIER, SBEZIER }; enum JUSTIFY { LEFT, CENTRE, RIGHT }; struct cmplx { double real, imag; }; struct value { enum DATA_TYPES type; union { int int_val; struct cmplx cmplx_val; } v; }; struct lexical_unit { TBOOLEAN is_token; struct value l_val; int start_index; int length; }; struct udft_entry { struct udft_entry *next_udf; char udf_name[50 +1]; struct at_type *at; char *definition; struct value dummy_values[5]; }; struct udvt_entry { struct udvt_entry *next_udv; char udv_name[50 +1]; TBOOLEAN udv_undef; struct value udv_value; }; union argument { int j_arg; struct value v_arg; struct udvt_entry *udv_arg; struct udft_entry *udf_arg; }; struct at_entry { enum operators index; union argument arg; }; struct at_type { int a_count; struct at_entry actions[150]; }; typedef int (*FUNC_PTR) (union argument *arg); struct ft_entry { char *f_name; FUNC_PTR func; }; enum coord_type { INRANGE, OUTRANGE, UNDEFINED }; struct coordinate { enum coord_type type; coordval x, y, z; coordval ylow, yhigh; coordval xlow, xhigh; }; struct lp_style_type { int pointflag; int l_type, p_type; double l_width, p_size; }; struct curve_points { struct curve_points *next_cp; int token; enum PLOT_TYPE plot_type; enum PLOT_STYLE plot_style; enum PLOT_SMOOTH plot_smooth; char *title; struct lp_style_type lp_properties; int p_max; int p_count; int x_axis; int y_axis; struct coordinate *points; }; struct gnuplot_contours { struct gnuplot_contours *next; struct coordinate *coords; char isNewLevel; char label[32]; int num_pts; }; struct iso_curve { struct iso_curve *next; int p_max; int p_count; struct coordinate *points; }; struct surface_points { struct surface_points *next_sp; int token; enum PLOT_TYPE plot_type; enum PLOT_STYLE plot_style; char *title; struct lp_style_type lp_properties; int has_grid_topology; int num_iso_read; struct gnuplot_contours *contours; struct iso_curve *iso_crvs; }; # 591 "plot.h" struct TERMENTRY { char *name; char *description; unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic; void (*options) (void); void (*init) (void); void (*reset) (void); void (*text) (void); int (*scale) (double, double); void (*graphics) (void); void (*move) (unsigned int, unsigned int); void (*vector) (unsigned int, unsigned int); void (*linetype) (int); void (*put_text) (unsigned int, unsigned int,char*); int (*text_angle) (int); int (*justify_text) (enum JUSTIFY); void (*point) (unsigned int, unsigned int,int); void (*arrow) (unsigned int, unsigned int, unsigned int, unsigned int, int); int (*set_font) (char *font); void (*pointsize) (double); int flags; void (*suspend) (void); void (*resume) (void); void (*fillbox) (int, unsigned int, unsigned int, unsigned int, unsigned int); void (*linewidth) (double linewidth); }; # 633 "plot.h" enum position_type { first_axes, second_axes, graph, screen }; struct position { enum position_type scalex,scaley,scalez; double x,y,z; }; struct text_label { struct text_label *next; int tag; struct position place; enum JUSTIFY pos; int rotate; char text[1024 +1]; char font[1024 +1]; }; struct arrow_def { struct arrow_def *next; int tag; struct position start; struct position end; TBOOLEAN head; struct lp_style_type lp_properties; }; struct linestyle_def { struct linestyle_def *next; int tag; struct lp_style_type lp_properties; }; struct ticdef { int type; union { struct { double start, incr; double end; } series; struct ticmark *user; } def; }; struct ticmark { double position; char *label; struct ticmark *next; }; # 718 "plot.h" extern TBOOLEAN screen_ok; extern struct TERMENTRY *term; extern TBOOLEAN undefined; extern char *input_line; extern int input_line_len; extern char *replot_line; extern struct lexical_unit *token; extern int token_table_size; extern int num_tokens, c_token; extern int inline_num; extern char c_dummy_var[5][50 +1]; extern struct ft_entry ft[]; extern struct udft_entry *first_udf; extern struct udvt_entry *first_udv; extern TBOOLEAN interactive; extern char *infile_name; extern struct udft_entry *dummy_func; extern char dummy_var[5][50 +1]; # 782 "plot.h" # 1 "protos.h" 1 # 38 "protos.h" # 1 "ansichek.h" 1 # 39 "protos.h" 2 void extend_input_line (void); void extend_token_table (void); void init_memory (void); int com_line (void); int do_line (void); void done (int status); void define (void); void bail_to_command_line (void); typedef double tri_diag[3]; struct gnuplot_contours *contour (int num_isolines, struct iso_curve *iso_lines, int ZLevels, int approx_pts, int int_kind, int order1, int levels_kind, double *levels_list); int solve_tri_diag (tri_diag m[], double r[], double x[], int n); int df_open (int max_using); int df_readline (double v[], int max); void df_close (void); int df_2dbinary (struct curve_points *this_plot); int df_3dmatrix (struct surface_points *this_plot); struct udvt_entry * add_udv (int t_num); struct udft_entry * add_udf (int t_num); int standard (int t_num); void execute_at (struct at_type *at_ptr); char *get_next_word (char **s, char *subst); void init_fit (void); void setvar (char *varname, struct value data); int getivar (char *varname); void update (char *pfile, char *npfile); void do_fit (void); size_t wri_to_fil_last_fit_cmd (FILE *fp); void graph_error (char *text); void fixup_range (int axis, char *axis_name); void timetic_format (int axis, double amin, double amax); void do_plot (struct curve_points *plots, int pcount); double time_tic_just (int level, double ticplace); double make_ltic (int tlevel, double incr); int label_width (char *str, int *lines); double set_tic (double l10, int guide); void setup_tics (int axis, struct ticdef *def, char *format, int max); typedef void (*tic_callback) (int axis, double place, char *text, struct lp_style_type grid); void gen_tics (int axis, struct ticdef *def, int grid, int minitic, double minifreq, tic_callback callback); void write_multiline (unsigned int x, unsigned int y, char *text_will_be_mangled, enum JUSTIFY hor, int vert, int angle, char *font); void map3d_xy (double x, double y, double z, unsigned int *xt, unsigned int *yt); int map3d_z (double x, double y, double z); void do_3dplot (struct surface_points *plots, int pcount); int help (char *keyword, char *path, TBOOLEAN *subtopics); void FreeHelp (void); void StartOutput (void); void OutLine (char *line); void EndOutput (void); void clip_move (unsigned int x, unsigned int y); void clip_vector (unsigned int x, unsigned int y); void set_hidden3doptions (void); void show_hidden3doptions (void); void save_hidden3doptions (FILE *fp); void init_hidden_line_removal (void); void reset_hidden_line_removal (void); void term_hidden_line_removal (void); void plot3d_hidden (struct surface_points *plots, int pcount); void draw_line_hidden (unsigned int, unsigned int, unsigned int, unsigned int); # 145 "protos.h" void reset_stack (void); void check_stack (void); struct value *pop (struct value *x); void push (struct value *x); void gen_interp (struct curve_points *plot); void sort_points (struct curve_points *plot); void cp_implode (struct curve_points *cp); struct curve_points * cp_alloc (int num); void cp_extend (struct curve_points *cp, int num); void cp_free (struct curve_points *cp); struct iso_curve * iso_alloc (int num); void iso_extend (struct iso_curve *ip, int num); void iso_free (struct iso_curve *ip); struct surface_points * sp_alloc (int num_samp_1, int num_iso_1, int num_samp_2, int num_iso_2); void sp_replace (struct surface_points *sp, int num_samp_1, int num_iso_1, int num_samp_2, int num_iso_2); void sp_free (struct surface_points *sp); void save_functions (FILE *fp); void save_variables (FILE *fp); void save_all (FILE *fp); void save_set (FILE *fp); void save_set_all (FILE *fp); void load_file (FILE *fp, char *name, TBOOLEAN subst_args); FILE *lf_top (void); void load_file_error (void); int instring (char *str, int c); void show_functions (void); void show_at (void); void disp_at (struct at_type *curr_at, int level); int find_maxl_keys (struct curve_points *plots, int count, int *kcnt); int find_maxl_keys3d (struct surface_points *plots, int count, int *kcnt); TBOOLEAN valid_format (const char *format); void evaluate_at (struct at_type *at_ptr, struct value *val_ptr); struct value * const_express (struct value *valptr); struct at_type * temp_at (void); struct at_type * perm_at (void); void interrupt_setup (void); void plotrequest (void); void plot3drequest (void); # 216 "protos.h" extern char *readline(); extern void add_history(); # 227 "protos.h" int scanner (char expression[]); char *safe_strncpy (char *, char *, size_t); void term_set_output (char *); void term_init (void); void term_start_plot (void); void term_end_plot (void); void term_start_multiplot (void); void term_end_multiplot (void); void term_reset (void); void term_apply_lp_properties (struct lp_style_type *lp); void term_check_multiplot_okay (TBOOLEAN); __inline__ int term_count (void); void list_terms (void); struct TERMENTRY *set_term (int); struct TERMENTRY *change_term (char *name, int length); void init_terminal (void); void test_term (void); void UP_redirect (int called); # 267 "protos.h" int null_text_angle (int ang); int null_justify_text (enum JUSTIFY just); int null_scale (double x, double y); int do_scale (double x, double y); void options_null (void); void UNKNOWN_null (void); void MOVE_null (unsigned int, unsigned int); void LINETYPE_null (int); void PUTTEXT_null (unsigned int, unsigned int, char *); char * gstrptime (char *, char *, struct tm *); int gstrftime (char *, int, char *, double); double gtimegm (struct tm *); int ggmtime (struct tm *, double); int chr_in_str (int t_num, int c); int equals (int t_num, char *str); int almost_equals (int t_num, char *str); int isstring (int t_num); int isanumber (int t_num); int isletter (int t_num); int is_definition (int t_num); void copy_str (char str[], int t_num, int max); int token_len (int t_num); void quote_str (char str[], int t_num, int max); void capture (char str[], int start, int end, int max); void m_capture (char **str, int start, int end); void m_quote_capture (char **str, int start, int end); void convert (struct value *val_ptr, int t_num); void disp_value (FILE *fp, struct value *val); double real (struct value *val); double imag (struct value *val); double magnitude (struct value *val); double angle (struct value *val); struct value * Gcomplex (struct value *a, double realpart, double imagpart); struct value * Ginteger (struct value *a, int i); void os_error (char str[], int t_num); void int_error (char str[], int t_num); void int_warn (char str[], int t_num); void lower_case (char *s); void squash_spaces (char *s); void draw_clip_line (unsigned int, unsigned int, unsigned int, unsigned int); int clip_line (int *, int *, int *, int *); void edge3d_intersect (struct coordinate *points, int i, double *ex, double *ey, double *ez); TBOOLEAN two_edge3d_intersect (struct coordinate *points, int i, double *lx, double *ly, double *lz); void mat_unit (double mat[4][4]); void mat_trans (double tx, double ty, double tz, double mat[4][4]); void mat_scale (double sx, double sy, double sz, double mat[4][4]); void mat_rot_x (double teta, double mat[4][4]); void mat_rot_y (double teta, double mat[4][4]); void mat_rot_z (double teta, double mat[4][4]); void mat_mult (double mat_res[4][4], double mat1[4][4], double mat2[4][4]); int clip_point (unsigned int x, unsigned int y); void clip_put_text (unsigned int x, unsigned int y, char *str); void clip_put_text_just (unsigned int x, unsigned int y, char *str, enum JUSTIFY just); # 1 "alloc.h" 1 # 39 "alloc.h" char *gp_alloc (unsigned long size, char *message); void *gp_realloc (void *p, unsigned long size, char *message); # 338 "protos.h" 2 # 783 "plot.h" 2 # 78 "term.c" 2 # 1 "bitmap.h" 1 # 37 "bitmap.h" typedef unsigned int char_row; typedef char_row * char_box; # 47 "bitmap.h" extern char_row fnt5x9[96][9]; extern char_row fnt9x17[96][17]; extern char_row fnt13x25[96][25]; typedef unsigned char pixels; typedef pixels *bitmap[]; extern bitmap *b_p; extern unsigned int b_currx, b_curry; extern unsigned int b_xsize, b_ysize; extern unsigned int b_planes; extern unsigned int b_psize; extern unsigned int b_rastermode; extern unsigned int b_linemask; extern unsigned int b_value; extern unsigned int b_hchar; extern unsigned int b_hbits; extern unsigned int b_vchar; extern unsigned int b_vbits; extern unsigned int b_angle; extern char_box b_font[96]; extern unsigned int b_pattern[]; extern int b_maskcount; extern unsigned int b_lastx, b_lasty; struct rgb { unsigned char r, g, b; }; extern struct rgb web_color_rgbs[]; void b_makebitmap (unsigned int x, unsigned int y, unsigned int planes); void b_freebitmap (void); void b_setpixel (unsigned int x, unsigned int y, unsigned int value); void b_line (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2); void b_setmaskpixel (unsigned int x, unsigned int y, unsigned int value); void b_charsize (unsigned int size); void b_setvalue (unsigned int value); void b_setlinetype (int linetype); void b_move (unsigned int x, unsigned int y); void b_vector (unsigned int x, unsigned int y); void b_put_text (unsigned int x, unsigned int y, char *str); int b_text_angle (int ang); # 79 "term.c" 2 # 1 "setshow.h" 1 # 41 "setshow.h" # 1 "/usr/include/sys/utsname.h" 1 3 # 26 "/usr/include/sys/utsname.h" 3 # 1 "/usr/include/features.h" 1 3 # 27 "/usr/include/sys/utsname.h" 2 3 # 1 "/usr/include/bits/utsname.h" 1 3 # 31 "/usr/include/sys/utsname.h" 2 3 struct utsname { char sysname[65]; char nodename[65]; char release[65]; char version[65]; char machine[65]; char __domainname[65]; }; extern int uname (struct utsname *__name) ; # 42 "setshow.h" 2 # 53 "setshow.h" typedef struct { char text[1024 +1]; double xoffset, yoffset; char font[1024 +1]; } label_struct; extern TBOOLEAN multiplot; extern TBOOLEAN autoscale_r; extern TBOOLEAN autoscale_t; extern TBOOLEAN autoscale_u; extern TBOOLEAN autoscale_v; extern TBOOLEAN autoscale_x; extern TBOOLEAN autoscale_y; extern TBOOLEAN autoscale_z; extern TBOOLEAN autoscale_x2; extern TBOOLEAN autoscale_y2; extern TBOOLEAN autoscale_lt; extern TBOOLEAN autoscale_lu; extern TBOOLEAN autoscale_lv; extern TBOOLEAN autoscale_lx; extern TBOOLEAN autoscale_ly; extern TBOOLEAN autoscale_lz; extern double boxwidth; extern TBOOLEAN clip_points; extern TBOOLEAN clip_lines1; extern TBOOLEAN clip_lines2; extern struct lp_style_type border_lp; extern int draw_border; # 91 "setshow.h" extern TBOOLEAN draw_surface; extern char dummy_var[5][50 +1]; extern char default_font[]; extern char xformat[]; extern char yformat[]; extern char zformat[]; extern char x2format[]; extern char y2format[]; extern int format_is_numeric[]; extern char key_title[]; extern enum PLOT_STYLE data_style, func_style; extern double bar_size; extern struct lp_style_type work_grid, grid_lp, mgrid_lp; extern double polar_grid_angle; extern int key; extern struct position key_user_pos; extern int key_vpos, key_hpos, key_just; extern double key_swidth, key_vert_factor; extern double key_width_fix; extern TBOOLEAN key_reverse; extern struct lp_style_type key_box; extern TBOOLEAN is_log_x, is_log_y, is_log_z; extern double base_log_x, base_log_y, base_log_z; extern double log_base_log_x, log_base_log_y, log_base_log_z; extern TBOOLEAN is_log_x2, is_log_y2; extern double base_log_x2, base_log_y2; extern double log_base_log_x2, log_base_log_y2; extern char *outstr; extern TBOOLEAN parametric; extern double pointsize; extern TBOOLEAN polar; extern TBOOLEAN hidden3d; extern int angles_format; extern double ang2rad; extern int mapping3d; extern int samples; extern int samples_1; extern int samples_2; extern int iso_samples_1; extern int iso_samples_2; extern float xsize; extern float xoffset; extern float yoffset; extern float ysize; extern float zsize; extern float aspect_ratio; extern float surface_rot_z; extern float surface_rot_x; extern float surface_scale; extern float surface_zscale; extern char term_options[]; extern label_struct title, timelabel; extern label_struct xlabel, ylabel, zlabel; extern label_struct x2label, y2label; extern int timelabel_rotate; extern int timelabel_bottom; extern char timefmt[]; extern int datatype[]; extern int range_flags[]; extern double rmin, rmax; extern double tmin, tmax, umin, umax, vmin, vmax; extern double xmin, xmax, ymin, ymax, zmin, zmax; extern double x2min, x2max, y2min, y2max; extern double loff, roff, toff, boff; extern int draw_contour; extern TBOOLEAN label_contours; extern char contour_format[]; extern int contour_pts; extern int contour_kind; extern int contour_order; extern int contour_levels; extern double zero; extern int levels_kind; extern double levels_list[30]; extern int dgrid3d_row_fineness; extern int dgrid3d_col_fineness; extern int dgrid3d_norm_value; extern TBOOLEAN dgrid3d; extern int encoding; extern char *encoding_names[]; extern struct lp_style_type xzeroaxis; extern struct lp_style_type yzeroaxis; extern struct lp_style_type x2zeroaxis; extern struct lp_style_type y2zeroaxis; extern int xtics; extern int ytics; extern int ztics; extern int mxtics; extern int mytics; extern int mztics; extern int x2tics; extern int y2tics; extern int mx2tics; extern int my2tics; extern double mxtfreq; extern double mytfreq; extern double mztfreq; extern double mx2tfreq; extern double my2tfreq; extern TBOOLEAN rotate_xtics; extern TBOOLEAN rotate_ytics; extern TBOOLEAN rotate_ztics; extern TBOOLEAN rotate_x2tics; extern TBOOLEAN rotate_y2tics; extern float ticslevel; extern double ticscale; extern double miniticscale; extern struct ticdef xticdef; extern struct ticdef yticdef; extern struct ticdef zticdef; extern struct ticdef x2ticdef; extern struct ticdef y2ticdef; extern TBOOLEAN tic_in; extern struct text_label *first_label; extern struct arrow_def *first_arrow; extern struct linestyle_def *first_linestyle; extern int lmargin, bmargin,rmargin,tmargin; extern char cur_locale[50 +1]; extern char full_month_names[12][32]; extern char abbrev_month_names[12][8]; extern char full_day_names[7][32]; extern char abbrev_day_names[7][8]; void set_command (void); void reset_command (void); void show_command (void); enum PLOT_STYLE get_style (void); TBOOLEAN load_range (int axis, double *a, double *b, int autosc); void show_version (FILE *fp); void show_version_long (void); char * conv_text (char *s, char *t); void lp_use_properties (struct lp_style_type *lp, int tag, int pointflag ); extern char *missing_val; # 80 "term.c" 2 # 1 "term/driver.h" 1 # 47 "term/driver.h" void do_point (unsigned int x, unsigned int y, int number); void line_and_point (unsigned int x, unsigned int y, int number); void do_arrow (unsigned int sx, unsigned int sy, unsigned int ex, unsigned int ey, int head); int null_text_angle (int ang); int null_justify_text (enum JUSTIFY just); int null_scale (double x, double y); int do_scale (double x, double y); void options_null (void); void UNKNOWN_null (void); int set_font_null (char *s); void null_set_pointsize (double size); extern FILE *gpoutfile; extern struct TERMENTRY *term; extern float xsize, ysize; # 81 "term.c" 2 # 94 "term.c" static TBOOLEAN term_initialised; static TBOOLEAN term_graphics = 0; static TBOOLEAN term_suspended = 0; static TBOOLEAN opened_binary = 0; static TBOOLEAN term_force_init = 0; extern FILE *gpoutfile; extern char *outstr; extern float xsize, ysize; static double term_pointsize; static void term_suspend (void); static void term_close_output (void); static void null_linewidth (double); void do_point (unsigned int x, unsigned int y, int number); void do_pointsize (double size); void line_and_point (unsigned int x, unsigned int y, int number); void do_arrow (unsigned int sx, unsigned int sy, unsigned int ex, unsigned int ey, int head); # 148 "term.c" static int unixplot = 0; # 166 "term.c" static TBOOLEAN pipe_open = 0; static void term_close_output() { ; opened_binary = 0; if (!outstr) return; if (pipe_open) { (void) pclose(gpoutfile); pipe_open = 0; } else (void) fclose(gpoutfile); gpoutfile = stdout; free(outstr); outstr = ((void *)0); } # 205 "term.c" void term_set_output(dest) char *dest; { FILE *f; ; ((void) ((dest == ((void *)0) || dest != outstr) ? 0 : (__assert_fail ("dest == ((void *)0) || dest != outstr", "term.c", 211, __PRETTY_FUNCTION__), 0))); if (multiplot) { fputs("In multiplotmode you can't change the output\n", stderr); return; } if (term && term_initialised) { (*term->reset) (); term_initialised = 0; } if (dest == ((void *)0)) { UP_redirect(4); term_close_output(); } else { if (*dest == '|') { if ((f = popen(dest + 1, ("w"))) == (FILE *) ((void *)0)) os_error("cannot create pipe; output not changed", c_token); else pipe_open = 1; } else # 249 "term.c" { if (term && (term->flags & 4)) { f = fopen(dest, "wb"); } else f = fopen(dest, "w"); if (f == (FILE *) ((void *)0)) os_error("cannot open file; output not changed", c_token); } term_close_output(); gpoutfile = f; outstr = dest; opened_binary = (term && (term->flags & 4)); UP_redirect(1); } } void term_init() { ; if (!term) int_error("No terminal defined", (-1)); if (outstr && (((term->flags & 4) && !opened_binary) || ((!(term->flags & 4) && opened_binary)))) { char *temp = gp_alloc(strlen(outstr) + 1, "temp file string"); if (temp) { ; (__extension__ (__builtin_constant_p (outstr) ? (((size_t)(const void *)((outstr) + 1) - (size_t)(const void *)(outstr) == 1) && strlen (outstr) + 1 <= 8 ? __strcpy_small (temp, __extension__ (((__const unsigned char *) (__const char *) (outstr))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (outstr))[0]), __extension__ (((__const unsigned char *) (__const char *) (outstr))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (outstr))[4]), __extension__ (((((__const unsigned char *) (__const char *) (outstr))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (outstr))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (outstr))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (outstr))[0]), __extension__ (((((__const unsigned char *) (__const char *) (outstr))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (outstr))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (outstr))[4 + 1]) << 8 | ((__const ! unsigned char *) (__const char *) (outstr))[4]), strlen (outstr) + 1) : (char *) memcpy (temp, outstr, strlen (outstr) + 1)) : strcpy (temp, outstr))); term_set_output(temp); } else fputs("Cannot reopen output file in binary", stderr); } # 307 "term.c" if (!term_initialised || term_force_init) { ; (*term->init) (); term_initialised = 1; } } void term_start_plot() { ; if (!term_initialised) term_init(); if (!term_graphics) { ; (*term->graphics) (); term_graphics = 1; } else if (multiplot && term_suspended) { if (term->resume) { ; (*term->resume) (); } term_suspended = 0; } } void term_end_plot() { ; if (!term_initialised) return; if (!multiplot) { ; (*term->text) (); term_graphics = 0; } (void) fflush(gpoutfile); } void term_start_multiplot() { ; if (multiplot) term_end_multiplot(); multiplot = 1; term_start_plot(); } void term_end_multiplot() { ; if (!multiplot) return; if (term_suspended) { if (term->resume) (*term->resume) (); term_suspended = 0; } multiplot = 0; term_end_plot(); } static void term_suspend() { ; if (term_initialised && !term_suspended && term->suspend) { ; (*term->suspend) (); term_suspended = 1; } } void term_reset() { ; if (!term_initialised) return; if (term_suspended) { if (term->resume) { ; (*term->resume) (); } term_suspended = 0; } if (term_graphics) { (*term->text) (); term_graphics = 0; } if (term_initialised) { (*term->reset) (); term_initialised = 0; } } void term_apply_lp_properties(lp) struct lp_style_type *lp; { # 429 "term.c" if (lp->pointflag) { (*term->pointsize) (lp->p_size); } (*term->linewidth) (lp->l_width); (*term->linetype) (lp->l_type); } void term_check_multiplot_okay(f_interactive) TBOOLEAN f_interactive; { ; if (!term_initialised) return; # 462 "term.c" if (!f_interactive || (term->flags & 1) || ((gpoutfile != stdout) && !(term->flags & 2)) ) { term_suspend(); return; } term_end_multiplot(); if (term->flags & 2) int_error("This terminal does not support multiplot", (-1)); else int_error("Must set output to a file or put all multiplot commands on one input line", (-1)); } void do_point(x, y, number) unsigned int x, y; int number; { register int htic, vtic; register struct TERMENTRY *t = term; if (number < 0) { (*t->move) (x, y); (*t->vector) (x, y); return; } number %= 6; htic = (term_pointsize * t->h_tic / 2); vtic = (term_pointsize * t->v_tic / 2); switch (number) { case 0: (*t->move) (x - htic, y); (*t->vector) (x, y - vtic); (*t->vector) (x + htic, y); (*t->vector) (x, y + vtic); (*t->vector) (x - htic, y); (*t->move) (x, y); (*t->vector) (x, y); break; case 1: (*t->move) (x - htic, y); (*t->vector) (x - htic, y); (*t->vector) (x + htic, y); (*t->move) (x, y - vtic); (*t->vector) (x, y - vtic); (*t->vector) (x, y + vtic); break; case 2: (*t->move) (x - htic, y - vtic); (*t->vector) (x - htic, y - vtic); (*t->vector) (x + htic, y - vtic); (*t->vector) (x + htic, y + vtic); (*t->vector) (x - htic, y + vtic); (*t->vector) (x - htic, y - vtic); (*t->move) (x, y); (*t->vector) (x, y); break; case 3: (*t->move) (x - htic, y - vtic); (*t->vector) (x - htic, y - vtic); (*t->vector) (x + htic, y + vtic); (*t->move) (x - htic, y + vtic); (*t->vector) (x - htic, y + vtic); (*t->vector) (x + htic, y - vtic); break; case 4: (*t->move) (x, y + (4 * vtic / 3)); (*t->vector) (x - (4 * htic / 3), y - (2 * vtic / 3)); (*t->vector) (x + (4 * htic / 3), y - (2 * vtic / 3)); (*t->vector) (x, y + (4 * vtic / 3)); (*t->move) (x, y); (*t->vector) (x, y); break; case 5: (*t->move) (x - htic, y); (*t->vector) (x - htic, y); (*t->vector) (x + htic, y); (*t->move) (x, y - vtic); (*t->vector) (x, y - vtic); (*t->vector) (x, y + vtic); (*t->move) (x - htic, y - vtic); (*t->vector) (x - htic, y - vtic); (*t->vector) (x + htic, y + vtic); (*t->move) (x - htic, y + vtic); (*t->vector) (x - htic, y + vtic); (*t->vector) (x + htic, y - vtic); break; } } void do_pointsize(size) double size; { term_pointsize = (size >= 0 ? size : 1); } void line_and_point(x, y, number) unsigned int x, y; int number; { (*term->linetype) (0); do_point(x, y, number); } # 604 "term.c" void do_arrow(sx, sy, ex, ey, head) unsigned int sx, sy; unsigned int ex, ey; TBOOLEAN head; { register struct TERMENTRY *t = term; float len_tic = ((double) (t->h_tic + t->v_tic)) / 2.0; double dx = (double) sx - (double) ex; double dy = (double) sy - (double) ey; double len_arrow = sqrt(dx * dx + dy * dy); (*t->move) (sx, sy); (*t->vector) (ex, ey); if (head && fabs(len_arrow) >= 2.2204460492503131e-16) { double coeff_shortest = len_tic * (0.3) / len_arrow; double coeff_longest = len_tic * (2.0) / len_arrow; double head_coeff = ( (coeff_shortest) > (( ((0.3)) < (coeff_longest) ? ((0.3)) : (coeff_longest) )) ? (coeff_shortest) : (( ((0.3)) < (coeff_longest) ? ((0.3)) : (coeff_longest) )) ); int x, y; x = (int) (ex + ((0.96593) * dx - (0.25882) * dy) * head_coeff); y = (int) (ey + ((0.25882) * dx + (0.96593) * dy) * head_coeff); (*t->move) (x, y); (*t->vector) (ex, ey); x = (int) (ex + ((0.96593) * dx + (0.25882) * dy) * head_coeff); y = (int) (ey + (-(0.25882) * dx + (0.96593) * dy) * head_coeff); (*t->vector) (x, y); } } # 698 "term.c" # 1 "term.h" 1 # 220 "term.h" # 1 "term/aed.trm" 1 # 55 "term/aed.trm" # 1 "term/driver.h" 1 # 56 "term/aed.trm" 2 static void AED_init (void); static void AED_graphics (void); static void AED_text (void); static void AED_linetype (int linetype); static void AED_move (unsigned int x, unsigned int y); static void AED_vector (unsigned int x, unsigned int y); static void AED_put_text (unsigned int x, unsigned int y, char str[]); static void AED_reset (void); # 92 "term/aed.trm" static void AED_init() { fputs("\033SEN3DDDN.SEC.7.SCT.0.1.80.80.90.SBC.0.AAV2.MOV.0.9.CHR.0.FFD", gpoutfile); # 104 "term/aed.trm" } static void AED_graphics() { fputs("\033FFD\033", gpoutfile); } static void AED_text() { fputs("\033MOV.0.9.SEC.7.XXX", gpoutfile); } static void AED_linetype(linetype) int linetype; { static int color[2 + 9] = { 7, 1, 6, 2, 3, 5, 1, 6, 2, 3, 5 }; static int type[2 + 9] = { 85, 85, 255, 255, 255, 255, 255, 85, 85, 85, 85 }; if (linetype >= 10) linetype %= 10; fprintf(gpoutfile, "\033SLS%d.255.\033SEC%d.", type[linetype + 2], color[linetype + 2]); } static void AED_move(x, y) unsigned int x, y; { fprintf(gpoutfile, "\033MOV%d.%d.", x, y); } static void AED_vector(x, y) unsigned int x, y; { fprintf(gpoutfile, "\033DVA%d.%d.", x, y); } static void AED_put_text(x, y, str) unsigned int x, y; char str[]; { AED_move(x, y - 13 / 2 + 2); fprintf(gpoutfile, "\033XXX%s\033", str); } static void AED_reset() { fputs("\033SCT0.1.0.0.0.SBC.0.FFD", gpoutfile); } # 221 "term.h" 2 # 231 "term.h" # 1 "term/gpic.trm" 1 # 56 "term/gpic.trm" # 1 "term/driver.h" 1 # 57 "term/gpic.trm" 2 static void GPIC_options (void); static void GPIC_init (void); static void GPIC_graphics (void); static void GPIC_text (void); static void GPIC_linetype (int linetype); static void GPIC_move (unsigned int x, unsigned int y); static void GPIC_vector (unsigned int ux, unsigned int uy); static void GPIC_arrow (unsigned int sx, unsigned int sy, unsigned int ex, unsigned int ey, TBOOLEAN head); static void GPIC_put_text (unsigned int x, unsigned int y, char str[]); static int GPIC_justify_text (enum JUSTIFY mode); static int GPIC_text_angle (int ang); static void GPIC_reset (void); # 98 "term/gpic.trm" void GPIC_close_line (void); static float GPIC_x, GPIC_y; static unsigned int GPIC_ltype; enum JUSTIFY GPIC_justify = LEFT; static char *GPIC_lines[] = { "thickness 1.0", "", "", "dotted", "dashed 0.05", "dashed 0.075", }; static int GPIC_linecount = 0; static void GPIC_options() { float x, y; struct value a; GPIC_x = 0; GPIC_y = 0; if (!(c_token >= num_tokens || equals(c_token,";"))) { x = real(const_express(&a)); if (!(c_token >= num_tokens || equals(c_token,";"))) { y = real(const_express(&a)); GPIC_x = x; GPIC_y = y; } } sprintf(term_options, "Origin is at (%f,%f)", GPIC_x, GPIC_y); } static void GPIC_init() { GPIC_linetype(-1); fputs(".\\\"GNUPLOT: GROFF picture using the gpic preprocessor\n", gpoutfile); } static void GPIC_graphics() { register struct TERMENTRY *t = term; fprintf(gpoutfile, ".PS %f %f\n", ((float)t->xmax)/((float)(300)), ((float)t->ymax)/((float)(300))); fprintf(gpoutfile, "x=%f; y=%f\n", GPIC_x, GPIC_y); } static void GPIC_text() { GPIC_close_line(); fputs(".PE\n", gpoutfile); } static void GPIC_linetype(linetype) int linetype; { if (linetype >= (sizeof(GPIC_lines)/sizeof(char *)) - 2) linetype %= ((sizeof(GPIC_lines)/sizeof(char *)) - 2); GPIC_ltype = linetype; } void GPIC_close_line() { if (GPIC_linecount > 0) { fputs("; reset linewid\n", gpoutfile); GPIC_linecount = 0; } } static void GPIC_move(x, y) unsigned int x, y; { GPIC_close_line(); fprintf(gpoutfile, "move to (x+%f,y+%f)\n", ((float)x)/((float)(300)), ((float)y)/((float)(300))); GPIC_linecount = 1; } static void GPIC_vector(ux, uy) unsigned int ux, uy; { if (GPIC_linecount == 1) { fprintf(gpoutfile, "line %s to (x+%f,y+%f)", GPIC_lines[GPIC_ltype + 2], ((float)ux)/((float)(300)), ((float)uy)/((float)(300))); } else { fprintf(gpoutfile, " \\\n then to (x+%f,y+%f)", ((float)ux)/((float)(300)), ((float)uy)/((float)(300))); } GPIC_linecount++; } static void GPIC_arrow(sx, sy, ex, ey, head) unsigned int sx, sy, ex, ey; TBOOLEAN head; { GPIC_close_line(); if (head) { fprintf(gpoutfile, "arrowhead=7; arrow from x+%f,y+%f to x+%f,y+%f\n", ((float)sx)/((float)(300)), ((float)sy)/((float)(300)), ((float)ex)/((float)(300)), ((float)ey)/((float)(300))); } else { fprintf(gpoutfile, "line from x+%f,y+%f to x+%f,y+%f\n", ((float)sx)/((float)(300)), ((float)sy)/((float)(300)), ((float)ex)/((float)(300)), ((float)ey)/((float)(300))); } } static void GPIC_put_text(x, y, str) unsigned int x, y; char str[]; { GPIC_close_line(); fprintf(gpoutfile, "\"%s\" ", str); switch (GPIC_justify) { case LEFT:{ fputs("ljust ", gpoutfile); break; } case CENTRE:{ fputs(" ", gpoutfile); break; } case RIGHT:{ fputs("rjust ", gpoutfile); break; } } fprintf(gpoutfile, "at x+%f,y+%f\n", ((float)x)/((float)(300)), ((float)y)/((float)(300))); } static int GPIC_justify_text(mode) enum JUSTIFY mode; { GPIC_justify = mode; return (1); } static int GPIC_text_angle(ang) int ang; { GPIC_close_line(); return (0); } static void GPIC_reset() { fflush(gpoutfile); } # 232 "term.h" 2 # 1 "term/regis.trm" 1 # 51 "term/regis.trm" # 1 "term/driver.h" 1 # 52 "term/regis.trm" 2 static void REGISinit (void); static void REGISgraphics (void); static void REGISinit (void); static void REGISgraphics (void); static void REGIStext (void); static void REGISlinetype (int linetype); static void REGISmove (unsigned int x, unsigned int y); static void REGISvector (unsigned int x, unsigned int y); static void REGISput_text (unsigned int x, unsigned int y, char *str); static int REGIStext_angle (int ang); static void REGISreset (void); static void REGISoptions (void); # 94 "term/regis.trm" static int REGIS16color = 0; static int REGISang = 0; static void REGISinit() { fputs("\033[r\033[24;1H", gpoutfile); } static void REGISgraphics() { fputs("\033[2J\033P1pS(C0)S(E)T(A0)\n", gpoutfile); (void) REGIStext_angle(0); } static void REGIStext() { fputs("\033\\\033[24;1H", gpoutfile); } static void REGISlinetype(linetype) int linetype; { static int in_16_map[15 + 2] = { 7, 7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; static int lt_16_map[15 + 2] = { 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static int in_map[9 + 2] = { 2, 2, 3, 2, 1, 3, 2, 1, 3, 2, 1 }; static int lt_map[9 + 2] = { 1, 4, 1, 1, 1, 4, 4, 4, 6, 6, 6 }; if (!REGIS16color) { if (linetype >= 9) linetype %= 9; fprintf(gpoutfile, "W(I%d)\n", in_map[linetype + 2]); fprintf(gpoutfile, "W(P%d)\n", lt_map[linetype + 2]); } else { if (linetype >= 15) linetype %= 15; fprintf(gpoutfile, "W(I%d)\n", in_16_map[linetype + 2]); fprintf(gpoutfile, "W(P%d)\n", lt_16_map[linetype + 2]); } } # 168 "term/regis.trm" static void REGISmove(x, y) unsigned int x, y; { fprintf(gpoutfile, "P[%d,%d]\n", x, (440 - 1) - y); } static void REGISvector(x, y) unsigned int x, y; { fprintf(gpoutfile, "v[]v[%d,%d]\n", x, (440 - 1) - y); } static void REGISput_text(x, y, str) unsigned int x, y; char *str; { if (REGISang == 1) REGISmove(x - 20 / 2 - 1, y); else REGISmove(x, y + 20 / 2 - 1); (void) _IO_putc ('T', gpoutfile); (void) _IO_putc ('\'', gpoutfile); while (*str) { (void) _IO_putc (*str, gpoutfile); if (*str == '\'') (void) _IO_putc ('\'', gpoutfile); str++; } (void) _IO_putc ('\'', gpoutfile); (void) _IO_putc ('\n', gpoutfile); } static int REGIStext_angle(ang) int ang; { REGISang = ang; if (ang == 1) fputs("T(D90,S1)\n", gpoutfile); else fputs("T(D0,S1)\n", gpoutfile); return 1; } static void REGISreset() { fputs("\033[2J\033[24;1H", gpoutfile); } static void REGISoptions() { int i = 0; struct value a; if (!(c_token >= num_tokens || equals(c_token,";"))) { i = (int) real(const_express(&a)); } REGIS16color = (i == 16); sprintf(term_options, "%s", REGIS16color ? "16" : "4"); } # 235 "term.h" 2 # 1 "term/t410x.trm" 1 # 67 "term/t410x.trm" # 1 "term/driver.h" 1 # 68 "term/t410x.trm" 2 static void T410X_init (void); static void T410X_reset (void); static void T410X_graphics (void); static void T410X_text (void); static void T410X_move (unsigned int x, unsigned int y); static void T410X_vector (unsigned int x, unsigned int y); static void T410X_point (unsigned int x, unsigned int y, int number); static void T410X_linetype (int linetype); static void T410X_put_text (unsigned int x, unsigned int y, char str[]); static int T410X_text_angle (int ang); # 95 "term/t410x.trm" void T410X_encode_x_y (unsigned int x, unsigned int y); void T410X_encode_int (int number); static int T410X_angle = 0; static void T410X_init() { fputs("\033%%!0\033MN0\033MCB7C;\033MQ1\033MT1", gpoutfile); fputs("\033MG1\033RK!\033SK!\033LZ\033%%!1", gpoutfile); # 117 "term/t410x.trm" (void) fflush(gpoutfile); } static void T410X_reset() { fputs("\033%%!0\033LZ\033%%!1", gpoutfile); (void) fflush(gpoutfile); } static void T410X_graphics() { fputs("\033%%!0\033\014\033LV0", gpoutfile); (void) fflush(gpoutfile); } static void T410X_text() { fputs("\033LV1\033%%!1", gpoutfile); (void) fflush(gpoutfile); } static void T410X_move(x, y) unsigned int x, y; { fputs("\033LF", gpoutfile); (void) T410X_encode_x_y(x, y); (void) fflush(gpoutfile); } static void T410X_vector(x, y) unsigned int x, y; { fputs("\033LG", gpoutfile); (void) T410X_encode_x_y(x, y); (void) fflush(gpoutfile); } static void T410X_point(x, y, number) unsigned int x, y; int number; { fputs("\033MM", gpoutfile); (void) T410X_encode_int(( (number) > (0) ? (number) : (0) ) % 11); fputs("\033LH", gpoutfile); (void) T410X_encode_x_y(x, y); (void) fflush(gpoutfile); } static void T410X_linetype(linetype) int linetype; { switch (linetype) { case -1: fputs("\033ML5", gpoutfile); break; case -2: fputs("\033ML?", gpoutfile); break; default: fputs("\033ML", gpoutfile); (void) T410X_encode_int(linetype % 14 + 2); break; } fputs("\033MV", gpoutfile); (void) T410X_encode_int(( (linetype) > (0) ? (linetype) : (0) ) % 8); (void) fflush(gpoutfile); } static void T410X_put_text(x, y, str) unsigned int x, y; char str[]; { if (T410X_angle == 0) { (void) T410X_move(x, y - 71 / 2 + 6); fputs("\033MR00", gpoutfile); } else { (void) T410X_move(x + 51 / 2 - 6, y); fputs("\033MRE:0", gpoutfile); } (void) fputs("\033LT", gpoutfile); (void) T410X_encode_int(strlen(str)); (void) fputs(str, gpoutfile); (void) fflush(gpoutfile); } static int T410X_text_angle(ang) int ang; { T410X_angle = ang; return (1); } void T410X_encode_x_y(x, y) unsigned int x, y; { static char chix = 0, chiy = 0, cloy = 0, ceb = 0; register unsigned int hix, lox, hiy, loy, eb, lx, ly; lx = (x <= 4095) ? x : 4095; ly = (y <= 3131) ? y : 3131; hix = lx / 128 + 32; lox = (lx / 4) % 32 + 64; hiy = ly / 128 + 32; loy = (ly / 4) % 32 + 96; eb = (ly % 4) * 4 + lx % 4 + 96; if (chiy != hiy) (void) _IO_putc (hiy, gpoutfile); if (ceb != eb) (void) _IO_putc (eb, gpoutfile); if ((cloy != loy) || (ceb != eb) || (chix != hix)) (void) _IO_putc (loy, gpoutfile); if (chix != hix) (void) _IO_putc (hix, gpoutfile); (void) _IO_putc (lox, gpoutfile); chix = hix; chiy = hiy; cloy = loy; ceb = eb; } void T410X_encode_int(number) int number; { register unsigned int mag, hi1, hi2, lo; mag = ((number) >= 0 ? (number) : -(number)); hi1 = mag / 1024 + 64; hi2 = (mag / 16) % 64 + 64; lo = mag % 16 + 32; if (number >= 0) lo += 16; if (hi1 != 64) (void) _IO_putc (hi1, gpoutfile); if ((hi2 != 64) || (hi1 != 64)) (void) _IO_putc (hi2, gpoutfile); (void) _IO_putc (lo, gpoutfile); } # 238 "term.h" 2 # 1 "term/tek.trm" 1 # 62 "term/tek.trm" # 1 "term/driver.h" 1 # 63 "term/tek.trm" 2 # 82 "term/tek.trm" static void TEK40init (void); static void TEK40graphics (void); static void TEK40text (void); static void TEK40linetype (int linetype); static void TEK40move (unsigned int x, unsigned int y); static void TEK40vector (unsigned int x, unsigned int y); static void TEK40put_text (unsigned int x, unsigned int y, char str[]); static void TEK40reset (void); static void BG_text (void); static void BG_put_text (unsigned int x, unsigned int y, char str[]); static void KTEK40graphics (void); static void KTEK40Ctext (void); static void KTEK40Clinetype (int linetype); static void KTEK40Mlinetype (int linetype); static void KTEK40reset (void); static void SEL_init (void); static void SEL_graphics (void); static void SEL_text (void); static void SEL_reset (void); static void VTTEK40init (void); static void VTTEK40reset (void); static void VTTEK40linetype (int linetype); static void VTTEK40put_text (unsigned int x, unsigned int y, char str[]); static void CTEK_linetype (int linetype); static void CTEK_move (unsigned int x, unsigned int y); static void CTEK_vector (unsigned int x, unsigned int y); # 136 "term/tek.trm" static void TEK40init() { } static void TEK40graphics() { fputs("\033\014", gpoutfile); (void) fflush(gpoutfile); sleep(1); } static void TEK40text() { TEK40move(0, 12); fputs("\037", gpoutfile); } static void TEK40linetype(linetype) int linetype; { } static void TEK40move(x, y) unsigned int x, y; { (void) _IO_putc ('\035', gpoutfile); TEK40vector(x, y); } static void TEK40vector(x, y) unsigned int x, y; { (void) _IO_putc ((0x20 | (y & (31<<5)) >> 5), gpoutfile); (void) _IO_putc ((0x60 | (y & 31)), gpoutfile); (void) _IO_putc ((0x20 | (x & (31<<5)) >> 5), gpoutfile); (void) _IO_putc ((0x40 | (x & 31)), gpoutfile); } static void TEK40put_text(x, y, str) unsigned int x, y; char str[]; { TEK40move(x, y - 11); fprintf(gpoutfile, "\037%s\n", str); } static void TEK40reset() { } # 241 "term/tek.trm" static void BG_text() { TEK40move(0, 1024 - 2 * 16); fputs("\037", gpoutfile); } static void BG_put_text(x, y, str) unsigned int x, y; char str[]; { TEK40move(x, y - 11); fprintf(gpoutfile, "\037%s\n", str); } # 275 "term/tek.trm" static void KTEK40graphics() { fputs("\033\014", gpoutfile); } static void KTEK40Ctext() { TEK40text(); KTEK40Clinetype(0); } static char *kermit_color[15] = {"\033[0;37m", "\033[1;30m", "\033[0;32m", "\033[0;36m", "\033[0;31m", "\033[0;35m", "\033[1;34m", "\033[1;33m", "\033[1;31m", "\033[1;37m", "\033[1;35m", "\033[1;32m", "\033[1;36m", "\033[0;34m", "\033[0;33m"}; static void KTEK40Clinetype(linetype) int linetype; { if (linetype >= 13) linetype %= 13; fprintf(gpoutfile, "%s", kermit_color[linetype + 2]); } static char *kerm_linetype = "`a`abcde"; static void KTEK40Mlinetype(linetype) int linetype; { if (linetype >= 6) linetype %= 6; fprintf(gpoutfile, "\033%c", kerm_linetype[linetype + 2]); } static void KTEK40reset() { fputs("\030\n", gpoutfile); } # 346 "term/tek.trm" static void SEL_init() { fputs("\033\062", gpoutfile); } static void SEL_graphics() { fputs("\033[H\033[J\033\061\033\014", gpoutfile); # 366 "term/tek.trm" } static void SEL_text() { TEK40move(0, 12); fputs("\033\062", gpoutfile); } static void SEL_reset() { fputs("\033\061\033\012\033\062\033[H\033[J", gpoutfile); } static void VTTEK40init() { fputs("\033[?38h", gpoutfile); fflush(gpoutfile); sleep(1); } static void VTTEK40reset() { fputs("\033[?38l", gpoutfile); fflush(gpoutfile); sleep(1); } static char *vt_linetype = "`a`abcdhijkl"; static int last_vt_linetype = 0; static void VTTEK40linetype(linetype) int linetype; { if (linetype >= 10) linetype %= 10; fprintf(gpoutfile, "\033%c", vt_linetype[linetype + 2]); last_vt_linetype = linetype; } static void VTTEK40put_text(x, y, str) unsigned int x, y; char str[]; { int linetype; linetype = last_vt_linetype; VTTEK40linetype(0); TEK40put_text(x, y, str); VTTEK40linetype(linetype); } # 471 "term/tek.trm" static void CT_solid_vector (int x, int y); static void CT_draw_vpoint (int x, int y, int last); static void CT_pattern_vector (int x1, int y1); static unsigned long CT_lines[] = {0xffffffff, 0x000fffff, 0x00ff00ff, 0x00f00fff, 0x00f07fff, 0x07070707, 0x07ff07ff, 0x070707ff}; static unsigned long *CT_pattern = &CT_lines[0]; static int CT_last_linetype = 0, CT_last_x, CT_last_y; static void CTEK_linetype(linetype) int linetype; { if (linetype < 0) linetype = 0; linetype %= (sizeof(CT_lines) / sizeof(unsigned long)); CT_pattern = &CT_lines[linetype]; CT_last_linetype = linetype; } static void CTEK_move(x, y) unsigned int x; unsigned int y; { TEK40move(x, y); CT_last_x = x; CT_last_y = y; } static void CT_solid_vector(x, y) int x; int y; { TEK40vector(x, y); CT_last_x = x; CT_last_y = y; } static int CT_penon = 0; static void CT_draw_vpoint(x, y, last) int x; int y; int last; { static int xx0, yy0, xx1, yy1; if ((*CT_pattern) & 1) { if (CT_penon) { xx1 = x; yy1 = y; } else { xx0 = xx1 = x; yy0 = yy1 = y; CT_penon = 1; } *CT_pattern = ((*CT_pattern) >> 1) | 0x80000000; if (last) { TEK40move(xx0, yy0); TEK40vector(xx1, yy1); CT_penon = 0; } } else { if (CT_penon) { TEK40move(xx0, yy0); TEK40vector(xx1, yy1); CT_penon = 0; } *CT_pattern = (*CT_pattern) >> 1; } } static void CT_pattern_vector(x1, y1) int x1; int y1; { int op; int x0 = CT_last_x; int y0 = CT_last_y; int dx = x1 - x0; int dy = y1 - y0; int ax = ((dx) >= 0 ? (dx) : -(dx)) << 1; int ay = ((dy) >= 0 ? (dy) : -(dy)) << 1; int sx = (((dx) >= 0)? 1:-1); int sy = (((dy) >= 0)? 1:-1); if (ax >= ay) { for (op = ay - (ax >> 1); x0 != x1; x0 += sx, op += ay) { CT_draw_vpoint(x0, y0, 0); if (op > 0 || (op == 0 && sx == 1)) { op -= ax; y0 += sy; } } } else { for (op = ax - (ay >> 1); y0 != y1; y0 += sy, op += ax) { CT_draw_vpoint(x0, y0, 0); if (op > 0 || (op == 0 && sy == 1)) { op -= ay; x0 += sx; } } } CT_draw_vpoint(x0, y0, 1); CT_last_x = x1; CT_last_y = y1; } static void CTEK_vector(x, y) unsigned int x; unsigned int y; { if (CT_last_linetype <= 0) CT_solid_vector(x, y); else CT_pattern_vector(x, y); } # 241 "term.h" 2 # 1 "term/xlib.trm" 1 # 47 "term/xlib.trm" # 1 "term/driver.h" 1 # 48 "term/xlib.trm" 2 static void Xlib_init (void); static void Xlib_graphics (void); static void Xlib_text (void); static void Xlib_reset (void); static void Xlib_move (unsigned int x, unsigned int y); static void Xlib_vector (unsigned int x, unsigned int y); static void Xlib_linetype (int lt); static void Xlib_put_text (unsigned int x, unsigned int y, char str[]); static int Xlib_justify_text (enum JUSTIFY mode); # 79 "term/xlib.trm" static void Xlib_init() { } static void Xlib_graphics() { fputs("G\n", gpoutfile); } static void Xlib_text() { fputs("E\n", gpoutfile); fflush(gpoutfile); } static void Xlib_reset() { fputs("R\n", gpoutfile); fflush(gpoutfile); } static void Xlib_move(x, y) unsigned int x, y; { fprintf(gpoutfile, "M%04d%04d\n", x, y); } static void Xlib_vector(x, y) unsigned int x, y; { fprintf(gpoutfile, "V%04d%04d\n", x, y); } static void Xlib_linetype(lt) int lt; { fprintf(gpoutfile, "L%04d\n", lt); } static void Xlib_put_text(x, y, str) unsigned int x, y; char str[]; { fprintf(gpoutfile, "T%04d%04d%s\n", x, y, str); } static int Xlib_justify_text(mode) enum JUSTIFY mode; { fprintf(gpoutfile, "J%04d\n", mode); return (1); } # 244 "term.h" 2 # 253 "term.h" # 1 "term/x11.trm" 1 # 40 "term/x11.trm" # 1 "term/driver.h" 1 # 41 "term/x11.trm" 2 int X11_args (int argc, char *argv[]); static void X11_options (void); static void X11_init (void); static void X11_graphics (void); static void X11_text (void); static void X11_reset (void); static void X11_move (unsigned int x, unsigned int y); static void X11_vector (unsigned int x, unsigned int y); static void X11_linewidth (double lw); static void X11_pointsize (double ps); static void X11_linetype (int lt); static void X11_put_text (unsigned int x, unsigned int y, char str[]); static int X11_justify_text (enum JUSTIFY mode); static void X11_point (unsigned int x, unsigned int y, int number); static void X11_fillbox (int style, unsigned int x, unsigned y, unsigned int width, unsigned int height); # 78 "term/x11.trm" int X11_Display = 0; # 101 "term/x11.trm" static void X11_atexit (void); typedef enum { hasNoArg, hasArg } OptionArg; static struct x11opt { const char *option; OptionArg arg; } X11_opts[] = { { "-mono", hasNoArg }, { "-gray", hasNoArg }, { "-clear", hasNoArg }, { "-tvtwm", hasNoArg }, { "-pointsize", hasArg }, { "-iconic", hasNoArg }, { "-rv", hasNoArg }, { "-reverse", hasNoArg }, { "+rv", hasNoArg }, { "-synchronous", hasNoArg }, { "-display", hasArg }, { "-geometry", hasArg }, { "-bg", hasArg }, { "-background", hasArg }, { "-bd", hasArg }, { "-bordercolor", hasArg }, { "-bw", hasArg }, { "-borderwidth", hasArg }, { "-fg", hasArg }, { "-foreground", hasArg }, { "-fn", hasArg }, { "-font", hasArg }, { "-name", hasArg }, { "-selectionTimeout", hasArg }, { "-title", hasArg }, { "-xnllanguage", hasArg }, { "-xrm", hasArg }, { "-raise", hasNoArg }, { "-noraise", hasNoArg }, { "-persist", hasNoArg } }; static FILE *X11_ipc; static char **xargv = (char **)((void *)0); static char *optvec[2*(sizeof(X11_opts) / sizeof(X11_opts[0]))+1]; static char X11_command[] = "gnuplot_x11"; int X11_args(argc, argv) int argc; char *argv[]; { int nx11 = 0, i = 0, n; xargv = (char **) gp_alloc (argc*sizeof(char *), ""); if (!xargv) { fputs ("not enough memory to copy argv - quitting\n", stderr); exit (1); } memcpy (xargv, argv, argc*sizeof(char *)); optvec[i++] = X11_command; while (++argv, ++xargv, --argc > 0) { for (n = 0; n < (sizeof(X11_opts) / sizeof(X11_opts[0])); n++) { if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (*argv) && __builtin_constant_p (X11_opts[n].option) && (__s1_len = strlen (*argv), __s2_len = strlen (X11_opts[n].option), (!((size_t)(const void *)((*argv) + 1) - (size_t)(const void *)(*argv) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((X11_opts[n].option) + 1) - (size_t)(const void *)(X11_opts[n].option) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (*argv), (__const char *) (X11_opts[n].option), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (*argv) && ((size_t)(const void *)((*argv) + 1) - (size_t)(const void *)(*argv) == 1) && (__s1_len = strlen (*argv), __s1_len < 4) ? (__builtin_constant_p (X11_opts[n].option) && ((size_t)(const void *)((X11_opts[n].option) + 1) - (size_t)(const void *)(X11_opts[n].option) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (*argv))[0] - ((__const unsigned char *) (__co! nst char *)(X11_opts[n].option))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[1] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[2] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (*argv))[3] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (X11_opts[n].option); register int __result = (((__const unsigned char *) (__const char *) (*argv))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) ! (__const char *) (*argv))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (*argv))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (X11_opts[n].option) && ((size_t)(const void *)((X11_opts[n].option) + 1) - (size_t)(const void *)(X11_opts[n].option) == 1) && (__s2_len = strlen (X11_opts[n].option), __s2_len < 4) ? (__builtin_constant_p (*argv) && ((size_t)(const void *)((*argv) + 1) - (size_t)(const void *)(*argv) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (*argv))[0] - ((__const unsigned char *) (__const char *)(X11_opts[n].option))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[1] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[2] - ((__const unsigned char *) (__const cha! r *) (X11_opts[n].option))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (*argv))[3] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (*argv); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (X11_opts[n].option))[3]); } } __result; }))) : strcmp (*argv, X11_opts[n].option)))); }) == 0) { optvec[i++] = *xargv; if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (*argv) && __builtin_constant_p ("-display") && (__s1_len = strlen (*argv), __s2_len = strlen ("-display"), (!((size_t)(const void *)((*argv) + 1) - (size_t)(const void *)(*argv) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("-display") + 1) - (size_t)(const void *)("-display") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (*argv), (__const char *) ("-display"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (*argv) && ((size_t)(const void *)((*argv) + 1) - (size_t)(const void *)(*argv) == 1) && (__s1_len = strlen (*argv), __s1_len < 4) ? (__builtin_constant_p ("-display") && ((size_t)(const void *)(("-display") + 1) - (size_t)(const void *)("-display") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (*argv))[0] - ((__const unsigned char *) (__const char *)("-display"))[0]); if (__s1_len > 0 && __result =! = 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[1] - ((__const unsigned char *) (__const char *) ("-display"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[2] - ((__const unsigned char *) (__const char *) ("-display"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (*argv))[3] - ((__const unsigned char *) (__const char *) ("-display"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("-display"); register int __result = (((__const unsigned char *) (__const char *) (*argv))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const un! signed char *) (__const char *) (*argv))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("-display") && ((size_t)(const void *)(("-display") + 1) - (size_t)(const void *)("-display") == 1) && (__s2_len = strlen ("-display"), __s2_len < 4) ? (__builtin_constant_p (*argv) && ((size_t)(const void *)((*argv) + 1) - (size_t)(const void *)(*argv) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (*argv))[0] - ((__const unsigned char *) (__const char *)("-display"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[1] - ((__const unsigned char *) (__const char *) ("-display"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (*argv))[2] - ((__const unsigned char *) (__const char *) ("-display"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (*argv))[3] - ((__const unsigned ! char *) (__const char *) ("-display"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (*argv); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("-display"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("-display"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("-display"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("-display"))[3]); } } __result; }))) : strcmp (*argv, "-display")))); }) == 0) X11_Display++; if (X11_opts[n].arg == hasArg) { if (--argc <= 0) return nx11; optvec[i++] = *++xargv, ++argv; nx11++; } nx11++; break; } } if (n == (sizeof(X11_opts) / sizeof(X11_opts[0]))) break; } return (nx11); } static unsigned int X11_plot_number; static void X11_options() { if (almost_equals(c_token, "res$et")) { X11_atexit (); ++c_token; } if (!(c_token >= num_tokens || equals(c_token,";"))) { struct value a; X11_plot_number = (int) real(const_express(&a)); } sprintf(term_options, "%d", X11_plot_number); } # 240 "term/x11.trm" static void X11_atexit () { if (X11_ipc) { fputs("R\n", X11_ipc); fclose(X11_ipc); X11_ipc = ((void *)0); } } static void X11_init() { static int been_here = 0; if (!X11_ipc) { int fdes[2]; if (pipe(fdes)) perror("pipe() failed:"); if (fork() == 0) { close(fdes[1]); dup2(fdes[0], 0); execvp(X11_command, optvec); perror("exec failed"); exit(1); } close(fdes[0]); X11_ipc = fdopen(fdes[1], "w"); } if (!been_here) { atexit(X11_atexit); been_here++; } } static void X11_reset() { } # 529 "term/x11.trm" static void X11_graphics() { ; fprintf(X11_ipc, "G%d\n",X11_plot_number); } static void X11_text() { fprintf(X11_ipc, "E\n"); fflush(X11_ipc); ; } static void X11_move(x, y) unsigned int x, y; { fprintf(X11_ipc, "M%04d%04d\n",x,y); } static void X11_vector(x, y) unsigned int x, y; { fprintf(X11_ipc, "V%04d%04d\n",x,y); } static void X11_pointsize(ps) double ps; { fprintf(X11_ipc, "P7%04d%04d\n",(int) (term->h_tic * ps * 0.5),(int) (term->v_tic * ps * 0.5)); } static void X11_linewidth(lw) double lw; { fprintf(X11_ipc, "W%04d\n",(int) lw); } static void X11_linetype(lt) int lt; { fprintf(X11_ipc, "L%04d\n",lt); } static void X11_put_text(x, y, str) unsigned int x, y; char str[]; { if (x < 10000 && y < 10000) { fprintf(X11_ipc, "T%04d%04d%s\n",x,y,str); } } static int X11_justify_text(mode) enum JUSTIFY mode; { fprintf(X11_ipc, "J%04d\n",mode); return (1); } static void X11_point(x, y, number) unsigned int x, y; int number; { if (number >= 0) number %= 6; number += 1; fprintf(X11_ipc, "P%01d%04d%04d\n",number,x,y); } static void X11_fillbox(style, x, y, w, h) int style; unsigned int x, y, w, h; { fprintf(X11_ipc, "F%04d%04u%04u%04u%04u\n",style,x,y,w,h); } # 254 "term.h" 2 # 1 "term/ai.trm" 1 # 64 "term/ai.trm" # 1 "term/driver.h" 1 # 65 "term/ai.trm" 2 static void AI_init (void); static void AI_graphics (void); static void AI_text (void); static void AI_linetype (int linetype); static void AI_move (unsigned int x, unsigned int y); static void AI_vector (unsigned int x, unsigned int y); static void AI_put_text (unsigned int x, unsigned int y, char *str); static int AI_text_angle (int ang); static void AI_reset (void); static void AI_options (void); static int AI_justify_text (enum JUSTIFY mode); static void AI_suspend (); static void AI_resume (); static int AI_set_font (char *font); # 112 "term/ai.trm" extern char version[]; extern char patchlevel[]; char ai_font[50 + 1] = "Times-Roman"; int ai_fontsize = 14; char ai_oldfont[50 + 1] = "Times-Roman"; int ai_oldfontsize = 14; TBOOLEAN ai_color = 0; TBOOLEAN ai_stroke = 0; int ai_page = 0; int ai_path_count = 0; int ai_ang = 0; int ai_subgroup_level = 0; int ai_multiplot_group = 0; enum JUSTIFY ai_justify = LEFT; static void AI_options() { if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "d$efault")) { ai_color = 0; (__extension__ (__builtin_constant_p ("Times-Roman") ? (((size_t)(const void *)(("Times-Roman") + 1) - (size_t)(const void *)("Times-Roman") == 1) && strlen ("Times-Roman") + 1 <= 8 ? __strcpy_small (ai_font, __extension__ (((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("Times-Roman"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("Times-Roman"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Times-Ro! man"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[4]), strlen ("Times-Roman") + 1) : (char *) memcpy (ai_font, "Times-Roman", strlen ("Times-Roman") + 1)) : strcpy (ai_font, "Times-Roman"))); ai_fontsize = 14; (__extension__ (__builtin_constant_p ("Times-Roman") ? (((size_t)(const void *)(("Times-Roman") + 1) - (size_t)(const void *)("Times-Roman") == 1) && strlen ("Times-Roman") + 1 <= 8 ? __strcpy_small (ai_oldfont, __extension__ (((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("Times-Roman"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("Times-Roman"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Times! -Roman"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Times-Roman"))[4]), strlen ("Times-Roman") + 1) : (char *) memcpy (ai_oldfont, "Times-Roman", strlen ("Times-Roman") + 1)) : strcpy (ai_oldfont, "Times-Roman"))); ai_oldfontsize = 14; c_token++; } } if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "m$onochrome")) { ai_color = 0; c_token++; } else if (almost_equals(c_token, "c$olor") || almost_equals(c_token, "c$olour")) { ai_color = 1; c_token++; } } if (!(c_token >= num_tokens || equals(c_token,";")) && isstring(c_token)) { quote_str(ai_font, c_token, 50); (__extension__ (__builtin_constant_p (ai_font) ? (((size_t)(const void *)((ai_font) + 1) - (size_t)(const void *)(ai_font) == 1) && strlen (ai_font) + 1 <= 8 ? __strcpy_small (ai_oldfont, __extension__ (((__const unsigned char *) (__const char *) (ai_font))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (ai_font))[0]), __extension__ (((__const unsigned char *) (__const char *) (ai_font))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (ai_font))[4]), __extension__ (((((__const unsigned char *) (__const char *) (ai_font))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (ai_font))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (ai_font))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (ai_font))[0]), __extension__ (((((__const unsigned char *) (__const char *) (ai_font))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (ai_font))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (ai_font))[4 + 1]) ! << 8 | ((__const unsigned char *) (__const char *) (ai_font))[4]), strlen (ai_font) + 1) : (char *) memcpy (ai_oldfont, ai_font, strlen (ai_font) + 1)) : strcpy (ai_oldfont, ai_font))); c_token++; } if (!(c_token >= num_tokens || equals(c_token,";"))) { struct value a; ai_fontsize = (int) real(const_express(&a)); ai_oldfontsize = ai_fontsize; c_token++; term->v_char = (unsigned int) (ai_fontsize * (10.0)); term->h_char = (unsigned int) (ai_fontsize * (10.0) * 6 / 10); } sprintf(term_options, "%s \"%s\" %d", ai_color ? "color" : "monochrome", ai_font, ai_fontsize); } static void AI_init() { ai_page = 0; fprintf(gpoutfile, "%%!PS-Adobe-2.0 EPSF-1.2\n%%%%Creator: Adobe Illustrator(TM) 3.2\n%%%%TrueCreator: gnuplot %s patchlevel %s ai terminal\n%%%%BoundingBox: %d %d %d %d\n%%%%Template:\n%%%%EndComments\n%%%%EndProlog\n", version, patchlevel, 50, 50, (int) ((5000) / (10.0) + 0.5 + 50), (int) ((3500) / (10.0) + 0.5 + 50)); } static void AI_graphics() { ai_page++; fputs("0 G\n1 j\n1 J\nu\n", gpoutfile); ai_path_count = 0; ai_stroke = 0; } static void AI_text() { if (ai_stroke) { fputs("S\n", gpoutfile); ai_stroke = 0; } while (ai_subgroup_level) { fputs("U\n", gpoutfile); ai_subgroup_level--; } fputs("U\n", gpoutfile); ai_path_count = 0; ai_multiplot_group = 0; } static void AI_reset() { fputs("%%%%Trailer\n", gpoutfile); } static void AI_linetype(linetype) int linetype; { if (ai_stroke) { fputs("S\n", gpoutfile); ai_stroke = 0; } if (ai_subgroup_level) { fputs("U\n", gpoutfile); ai_subgroup_level--; } if (linetype == -2 && multiplot) { switch (ai_multiplot_group) { case 0: fputs("u\n", gpoutfile); ai_subgroup_level++; ai_multiplot_group = 1; break; case 1: ai_multiplot_group = 2; break; case 2: ai_multiplot_group = 1; fputs("U\nu\n", gpoutfile); break; } } if (linetype == -2 && !multiplot) { if (ai_multiplot_group) { fputs("U\n", gpoutfile); ai_subgroup_level--; ai_multiplot_group = 0; } } fputs("u\n", gpoutfile); ai_subgroup_level++; switch (linetype) { case -2: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0) * 2.0); if (ai_color) { fputs("0 0 0 1 K\n", gpoutfile); } else { fputs("[] 0 d\n", gpoutfile); } break; case -1: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0) / 2.0); if (ai_color) { fputs("0 0 0 1 K\n", gpoutfile); } else { fputs("[1 2] 0 d\n", gpoutfile); } break; case 0: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("1 0 1 0 K\n", gpoutfile); } else { fputs("[] 0 d\n", gpoutfile); } break; case 1: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("1 1 0 0 K\n", gpoutfile); } else { fputs("[4 2] 0 d\n", gpoutfile); } break; case 2: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("0 1 1 0 K\n", gpoutfile); } else { fputs("[2 3] 0 d\n", gpoutfile); } break; case 3: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("0 1 0 0 K\n", gpoutfile); } else { fputs("[1 1.5] 0 d\n", gpoutfile); } break; case 4: fprintf(gpoutfile, "%f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("1 0 0 0 K\n", gpoutfile); } else { fputs("[5 2 1 2] 0 d\n", gpoutfile); } break; case 5: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("0 0 1 0 K\n", gpoutfile); } else { fputs("[4 3 1 3] 0 d\n", gpoutfile); } break; case 6: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("0 0 0 1 K\n", gpoutfile); } else { fputs("[2 2 2 4] 0 d\n", gpoutfile); } break; case 7: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("0 0.7 1 0 K\n", gpoutfile); } else { fputs("[2 2 2 2 2 4] 0 d\n", gpoutfile); } break; case 8: fprintf(gpoutfile, "%.2f w\n", (0.5*(10.0)) / (10.0)); if (ai_color) { fputs("0.5 0.5 0.5 0 K\n", gpoutfile); } else { fputs("[2 2 2 2 2 2 2 4] 0 d\n", gpoutfile); } break; } ai_path_count = 0; } static void AI_move(x, y) unsigned int x, y; { if (ai_stroke) fputs("S\n", gpoutfile); fprintf(gpoutfile, "%.2f %.2f m\n", x / (10.0), y / (10.0)); ai_path_count += 1; ai_stroke = 1; } static void AI_vector(x, y) unsigned int x, y; { fprintf(gpoutfile, "%.2f %.2f l\n", x / (10.0), y / (10.0)); ai_path_count += 1; ai_stroke = 1; if (ai_path_count >= 400) { fprintf(gpoutfile, "S\n%.2f %.2f m\n", x / (10.0), y / (10.0)); ai_path_count = 0; } } static void AI_put_text(x, y, str) unsigned int x, y; char *str; { char ch; if (ai_stroke) { fputs("S\n", gpoutfile); ai_stroke = 0; } switch (ai_justify) { case LEFT: fprintf(gpoutfile, "/_%s %d 0 0 0 z\n", ai_font, ai_fontsize); break; case CENTRE: fprintf(gpoutfile, "/_%s %d 0 0 1 z\n", ai_font, ai_fontsize); break; case RIGHT: fprintf(gpoutfile, "/_%s %d 0 0 2 z\n", ai_font, ai_fontsize); break; } if (ai_ang == 0) { fprintf(gpoutfile, "[ 1 0 0 1 %.2f %.2f] e\n", x / (10.0), y / (10.0) - ai_fontsize / 3.0); } else { fprintf(gpoutfile, "[ 0 1 -1 0 %.2f %.2f] e\n", x / (10.0) - ai_fontsize / 3.0, y / (10.0)); } _IO_putc ('(', gpoutfile); ch = *str++; while (ch != '\0') { if ((ch == '(') || (ch == ')') || (ch == '\\')) _IO_putc ('\\', gpoutfile); _IO_putc (ch, gpoutfile); ch = *str++; } fputs(") t\nT\n", gpoutfile); ai_path_count = 0; } static int AI_text_angle(ang) int ang; { ai_ang = ang; return 1; } static int AI_justify_text(mode) enum JUSTIFY mode; { ai_justify = mode; return 1; } static int AI_set_font(font) char *font; { char name[32]; int size, sep; if (font && *font) { sep = __extension__ ({ char __r0, __r1, __r2; (__builtin_constant_p (",") && ((size_t)(const void *)((",") + 1) - (size_t)(const void *)(",") == 1) ? ((__r0 = ((__const char *) (","))[0], __r0 == '\0') ? strlen (font) : ((__r1 = ((__const char *) (","))[1], __r1 == '\0') ? __strcspn_c1 (font, __r0) : ((__r2 = ((__const char *) (","))[2], __r2 == '\0') ? __strcspn_c2 (font, __r0, __r1) : (((__const char *) (","))[3] == '\0' ? __strcspn_c3 (font, __r0, __r1, __r2) : strcspn (font, ","))))) : strcspn (font, ",")); }); (__extension__ (__builtin_constant_p (font) && __builtin_constant_p (sep) ? (strlen (font) + 1 >= ((size_t) (sep)) ? (char *) memcpy (name, font, sep) : strncpy (name, font, sep)) : strncpy (name, font, sep))); name[sep] = '\0'; size = ai_fontsize; sscanf(&(font[sep + 1]), "%d", &size); if (*name) (__extension__ (__builtin_constant_p (name) ? (((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && strlen (name) + 1 <= 8 ? __strcpy_small (ai_font, __extension__ (((__const unsigned char *) (__const char *) (name))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (name))[0]), __extension__ (((__const unsigned char *) (__const char *) (name))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (name))[4]), __extension__ (((((__const unsigned char *) (__const char *) (name))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (name))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (name))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (name))[0]), __extension__ (((((__const unsigned char *) (__const char *) (name))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (name))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (name))[4 + 1]) << 8 | ((__const unsigned char *) (__const c! har *) (name))[4]), strlen (name) + 1) : (char *) memcpy (ai_font, name, strlen (name) + 1)) : strcpy (ai_font, name))); if (size) ai_fontsize = size; } else { ai_fontsize = ai_oldfontsize; (__extension__ (__builtin_constant_p (ai_oldfont) ? (((size_t)(const void *)((ai_oldfont) + 1) - (size_t)(const void *)(ai_oldfont) == 1) && strlen (ai_oldfont) + 1 <= 8 ? __strcpy_small (ai_font, __extension__ (((__const unsigned char *) (__const char *) (ai_oldfont))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (ai_oldfont))[0]), __extension__ (((__const unsigned char *) (__const char *) (ai_oldfont))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (ai_oldfont))[4]), __extension__ (((((__const unsigned char *) (__const char *) (ai_oldfont))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (ai_oldfont))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (ai_oldfont))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (ai_oldfont))[0]), __extension__ (((((__const unsigned char *) (__const char *) (ai_oldfont))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (ai_oldfont))[4 + 2]) << 8 | ((__const unsigned char ! *) (__const char *) (ai_oldfont))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) (ai_oldfont))[4]), strlen (ai_oldfont) + 1) : (char *) memcpy (ai_font, ai_oldfont, strlen (ai_oldfont) + 1)) : strcpy (ai_font, ai_oldfont))); } return 1; } static void AI_suspend() { } static void AI_resume() { } # 258 "term.h" 2 # 1 "term/cgm.trm" 1 # 54 "term/cgm.trm" # 1 "term/driver.h" 1 # 55 "term/cgm.trm" 2 static void CGM_options (void); static void CGM_init (void); static void CGM_reset (void); static void CGM_text (void); static void CGM_graphics (void); static void CGM_move (unsigned int x, unsigned int y); static void CGM_dashed_vector (unsigned int ux, unsigned int uy); static void CGM_solid_vector (unsigned int ux, unsigned int uy); static void CGM_linetype (int linetype); static void CGM_linecolor (int color); static void CGM_dashtype (int dashtype); static void CGM_linewidth (double width); static void CGM_put_text (unsigned int x, unsigned int y, char *str); static int CGM_text_angle (int ang); static int CGM_justify_text (enum JUSTIFY mode); static void CGM_point (unsigned int x, unsigned int y, int number); static int CGM_find_font (char *font, int numchar); static int CGM_set_font (char *font); static void CGM_set_pointsize (double size); # 115 "term/cgm.trm" # 1 "/usr/include/ctype.h" 1 3 # 116 "term/cgm.trm" 2 # 127 "term/cgm.trm" # 1 "/usr/include/assert.h" 1 3 # 36 "/usr/include/assert.h" 3 # 1 "/usr/include/features.h" 1 3 # 37 "/usr/include/assert.h" 2 3 # 68 "/usr/include/assert.h" 3 extern void __assert_fail (__const char *__assertion, __const char *__file, unsigned int __line, __const char *__function) __attribute__ ((__noreturn__)); extern void __assert_perror_fail (int __errnum, __const char *__file, unsigned int __line, __const char *__function) __attribute__ ((__noreturn__)); extern void __assert (const char *__assertion, const char *__file, int __line) __attribute__ ((__noreturn__)); # 128 "term/cgm.trm" 2 static unsigned int cgm_posx; static unsigned int cgm_posy; static unsigned int cgm_linetype = 1; static unsigned int cgm_dashtype = 0; static unsigned int cgm_color = 0; static int cgm_polyline[104]; static int cgm_coords = 0; enum JUSTIFY cgm_justify = LEFT; static int cgm_vert_text = 0; static int cgm_vert_text_requested = 0; static int cgm_step_sizes[8]; static int cgm_step_index = 0; static int cgm_step = 0; static int cgm_tic, cgm_tic707, cgm_tic866, cgm_tic500, cgm_tic1241, cgm_tic1077, cgm_tic621; static char cgm_font_data[] = {"\005Arial\014Arial Italic\012Arial Bold\021Arial Bold Italic\013Times Roman\022Times Roman Italic\020Times Roman Bold\027Times Roman Bold Italic\011Helvetica\005Roman"}; # 164 "term/cgm.trm" static char cgm_font[32] = "Arial Bold"; static unsigned int cgm_fontsize = 10; static unsigned cgm_linewidth; static unsigned cgm_linewidth_pt = 1; static TBOOLEAN cgm_monochrome = 0; static int cgm_plotwidth = 432; static TBOOLEAN cgm_portrait = 0; static TBOOLEAN cgm_rotate = 1; static TBOOLEAN cgm_dashed = 1; static TBOOLEAN cgm_winword6_mode = 0; static void CGM_flush_polyline (void); static void CGM_flush_polygon (void); static void CGM_write_char_record (int class, int cgm_id, int length, char *data); static void CGM_write_code (int class, int cgm_id, int length); static void CGM_write_int (int value); static void CGM_write_int_record (int class, int cgm_id, int length, int *data); static void CGM_write_mixed_record (int class, int cgm_id, int numint, int *int_data, int numchar, char *char_data); static void CGM_write_byte_record (int class, int cgm_id, int length, char *data); static void CGM_init() { cgm_posx = cgm_posy = 0; cgm_linetype = 0; cgm_vert_text = 0; } static void CGM_graphics() { register struct TERMENTRY *t = term; static int version_data[] = { 1 }; static char description_data[] = "Computer Graphics Metafile version of Gnuplot"; static int vdc_type_data[] = { 0 }; static int integer_precision_data[] = { 16 }; static int real_precision_data[] = { 1, 16, 16 }; static int index_precision_data[] = { 16 }; static int color_precision_data[] = { 16 }; static int color_index_precision_data[] = { 16 }; static int maximum_color_index_data_data[] = { 7 }; static int scaling_mode_data[] = { 0, 0, 0 }; static int color_value_extent_data[] = { 0, 0, 0, 255, 255, 255 }; static int color_table_data[] = { 0, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 255, 255, 0, 255, 0, 255, 0, 255, 255 }; static int color_selection_mode_data[] = { 0 }; static int linewidth_specification_mode_data[] = { 0 }; static int marker_size_specification_mode_data[] = { 0 }; static int vdc_extent_data[] = { 0, 0, 0, 0 }; static int vdc_integer_precision_data[] = { 16 }; static int transparency_data[] = { 1 }; static int clip_indicator_data[] = { 0 }; static int line_type_data[] = { 1 }; static int interior_style_data[] = { 1 }; static int elements_list_data[] = { 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 2, 1, 2, 2, 2, 3, 2, 4, 2, 6, 3, 1, 3, 4, 3, 6, 4, 1, 4, 3, 4, 4, 4, 7, 4, 11, 4, 12, 4, 15, 4, 16, 4, 17, 4, 18, 4, 19, 5, 2, 5, 3, 5, 4, 5, 6, 5, 7, 5, 8, 5, 10, 5, 14, 5, 15, 5, 16, 5, 18, 5, 22, 5, 23, 5, 24, 6, 1, 7, 2 }; if (!outstr) CGM_write_char_record(0, 1, 1, outstr); else CGM_write_char_record(0, 1, strlen(outstr) + 1, outstr); CGM_write_int_record(1, 1, 2, version_data); CGM_write_char_record(1, 2, sizeof(description_data), description_data); CGM_write_int_record(1, 3, 2, vdc_type_data); CGM_write_int_record(1, 4, 2, integer_precision_data); CGM_write_int_record(1, 5, 6, real_precision_data); CGM_write_int_record(1, 6, 2, index_precision_data); CGM_write_int_record(1, 7, 2, color_precision_data); CGM_write_int_record(1, 8, 2, color_index_precision_data); CGM_write_int_record(1, 9, 2, maximum_color_index_data_data); CGM_write_int_record(1, 10, sizeof(color_value_extent_data) / (sizeof(int)/sizeof(short)), color_value_extent_data); elements_list_data[0] = (sizeof(elements_list_data) / (sizeof(int)/sizeof(short)) - 2) / 4; CGM_write_int_record(1, 11, sizeof(elements_list_data) / (sizeof(int)/sizeof(short)), elements_list_data); if (cgm_winword6_mode == 0) CGM_write_byte_record(1, 13, strlen(cgm_font_data), cgm_font_data); CGM_write_char_record(0, 3, 8, "PICTURE1"); CGM_write_int_record(2, 1, 6, scaling_mode_data); CGM_write_int_record(2, 2, 2, color_selection_mode_data); CGM_write_int_record(2, 3, 2, linewidth_specification_mode_data); CGM_write_int_record(2, 4, 2, marker_size_specification_mode_data); vdc_extent_data[2] = t->xmax + (32767/180); vdc_extent_data[3] = t->ymax + (32767/180); CGM_write_int_record(2, 6, 8, vdc_extent_data); CGM_write_int_record(3, 1, 2, vdc_integer_precision_data); CGM_write_int_record(3, 4, sizeof(transparency_data) / (sizeof(int)/sizeof(short)), transparency_data); CGM_write_int_record(3, 6, sizeof(clip_indicator_data) / (sizeof(int)/sizeof(short)), clip_indicator_data); CGM_write_int_record(0, 4, 0, ((void *)0)); if (!cgm_winword6_mode) CGM_write_int_record(5, 34, sizeof(color_table_data) / (sizeof(int)/sizeof(short)), color_table_data); CGM_write_int_record(5, 2, sizeof(line_type_data) / (sizeof(int)/sizeof(short)), line_type_data); cgm_linewidth = cgm_linewidth_pt * ((term->xmax + (32767/180))/cgm_plotwidth); CGM_write_int_record(5, 3, sizeof(cgm_linewidth) / (sizeof(int)/sizeof(short)), (int *) &cgm_linewidth); CGM_linecolor(0); CGM_write_int_record(5, 15, 2, (int *) &t->v_char); CGM_write_int_record(5, 22, 2, interior_style_data); { char buf[45]; sprintf(buf, "%.31s,%d", cgm_font, cgm_fontsize); CGM_set_font(buf); } CGM_set_pointsize(pointsize); } static int CGM_find_font(font, numchar) char *font; int numchar; { int font_index = 1; char *s; for (s = cgm_font_data; s < cgm_font_data + strlen(cgm_font_data); s += (int) *s + 1) { if (numchar == (int) *s && strncasecmp(font, s + 1, numchar - 1) == 0) return font_index; font_index++; } return 0; } static int CGM_set_font(font) char *font; { register struct TERMENTRY *t = term; int size, font_index; char *comma; int sep; comma = (__extension__ (__builtin_constant_p (',') && (',') == '\0' ? (char *) __rawmemchr (font, ',') : strchr (font, ','))); if (comma == ((void *)0)) return 0; sep = comma - font; font_index = CGM_find_font(font, sep); if (font_index == 0) font_index = 1; CGM_write_int_record(5, 10, 2, &font_index); size = cgm_fontsize; sscanf(comma + 1, "%d", &size); if (sep > 31) sep = 31; (__extension__ (__builtin_constant_p (font) && __builtin_constant_p (sep) ? (strlen (font) + 1 >= ((size_t) (sep)) ? (char *) memcpy (cgm_font, font, sep) : strncpy (cgm_font, font, sep)) : strncpy (cgm_font, font, sep))); cgm_font[sep] = ('\0'); t->v_char = size * ((term->xmax + (32767/180))/cgm_plotwidth); t->h_char = (t->v_char * 5) / 9; CGM_write_int_record(5, 15, 2, (int *) &t->v_char); return 1; } static void CGM_text() { CGM_flush_polyline(); CGM_write_int_record(0, 5, 0, ((void *)0)); CGM_write_int_record(0, 2, 0, ((void *)0)); } static void CGM_linetype(linetype) int linetype; { ((void) ((linetype >= -2) ? 0 : (__assert_fail ("linetype >= -2", "term/cgm.trm", 411, __PRETTY_FUNCTION__), 0))); if (linetype == cgm_linetype) return; cgm_linetype = linetype; CGM_linecolor(linetype); if (cgm_dashed) { CGM_dashtype(linetype); } else { CGM_dashtype(linetype == -1 ? 2 : 0); } } static void CGM_linecolor(linecolor) int linecolor; { ((void) ((linecolor >= -2) ? 0 : (__assert_fail ("linecolor >= -2", "term/cgm.trm", 430, __PRETTY_FUNCTION__), 0))); linecolor = (linecolor < 1) ? 1 : linecolor % 7 + 1; if (cgm_monochrome || linecolor == cgm_color) return; cgm_color = linecolor; CGM_flush_polyline(); CGM_write_int_record(5, 4, 2, (int *) &cgm_color); CGM_write_int_record(5, 23, 2, (int *) &cgm_color); } static void CGM_linewidth(width) double width; { int new_linewidth; ((void) ((width >= 0) ? 0 : (__assert_fail ("width >= 0", "term/cgm.trm", 446, __PRETTY_FUNCTION__), 0))); new_linewidth = width * cgm_linewidth_pt * ((term->xmax + (32767/180))/cgm_plotwidth); if (new_linewidth == cgm_linewidth) return; cgm_linewidth = new_linewidth; CGM_write_int_record(5, 3, sizeof(cgm_linewidth) / (sizeof(int)/sizeof(short)), (int *) &cgm_linewidth); CGM_dashtype(cgm_dashtype); } static void CGM_dashtype(dashtype) int dashtype; { int i, j; static int dot_length[9 * 8] = { 5, 8, 5, 8, 5, 8, 5, 8, 5, 3, 5, 3, 5, 3, 5, 3, 4, 1, 4, 1, 4, 1, 4, 1, 4, 8, 4, 1, 4, 8, 4, 1, 4, 9, 4, 1, 4, 1, 0, 0, 4, 10, 4, 1, 4, 1, 4, 1, 4, 10, 4, 10, 4, 1, 0, 0, 4, 10, 4, 10, 4, 1, 4, 1}; ((void) ((dashtype >= -2) ? 0 : (__assert_fail ("dashtype >= -2", "term/cgm.trm", 476, __PRETTY_FUNCTION__), 0))); if (dashtype == cgm_dashtype) return; cgm_dashtype = dashtype; CGM_flush_polyline(); if (dashtype >= 9) dashtype = dashtype % 9; if (dashtype < 1) { term->vector = CGM_solid_vector; return; } term->vector = CGM_dashed_vector; j = (dashtype - 1) * 8; for (i = 0; i < 8; i++, j++) { if (dot_length[j]) cgm_step_sizes[i] = (dot_length[j] * cgm_linewidth) * 2 / 3; else cgm_step_sizes[i] = 0; } cgm_step = cgm_step_sizes[1]; cgm_step_index = 1; } static void CGM_move(x, y) unsigned int x, y; { ((void) ((x < term->xmax && y < term->ymax) ? 0 : (__assert_fail ("x < term->xmax && y < term->ymax", "term/cgm.trm", 507, __PRETTY_FUNCTION__), 0))); if (x == cgm_posx && y == cgm_posy) return; CGM_flush_polyline(); cgm_posx = x; cgm_posy = y; } static void CGM_flush_polyline() { if (cgm_coords == 0) return; CGM_write_int_record(4, 1, cgm_coords * 2, cgm_polyline); cgm_coords = 0; } static void CGM_write_char_record(class, cgm_id, numbytes, data) int class, cgm_id, numbytes; char *data; { int i, pad, length; static unsigned char flag = 0xff; static unsigned char paddata = 0; char short_len; pad = 0; length = numbytes + 1; if (numbytes >= 255) length += 2; if (length & 1) pad = 1; CGM_write_code(class, cgm_id, length); if (numbytes < 255) { short_len = (char)numbytes; fwrite(&short_len, 1, 1, gpoutfile); } else { fwrite(&flag, 1, 1, gpoutfile); CGM_write_int(numbytes); } if (data) fwrite(data, 1, numbytes, gpoutfile); else for (i=0; i>= 1; for (i = 0; i < numbytes; i++) CGM_write_int(data[i]); } static void CGM_write_mixed_record(class, cgm_id, numint, int_data, numchar, char_data) int class, cgm_id, numint, *int_data, numchar; char *char_data; { int i, pad, length; static unsigned char paddata = 0; static unsigned char flag = 0xff; char short_len; pad = 0; length = numchar + 1; if (numchar >= 255) length += 2; if (length & 1) pad = 1; CGM_write_code(class, cgm_id, numint * 2 + length); for (i = 0; i < numint; i++) CGM_write_int(int_data[i]); if (numchar < 255) { short_len = (char)numchar; fwrite(&short_len, 1, 1, gpoutfile); } else { fwrite(&flag, 1, 1, gpoutfile); CGM_write_int(numchar); } fwrite(char_data, 1, numchar, gpoutfile); if(pad) fwrite(&paddata, 1, 1, gpoutfile); } # 627 "term/cgm.trm" static void CGM_write_code(class, cgm_id, length) int class, cgm_id, length; { unsigned code; ((void) (((0 <= class) &&(class <16)) ? 0 : (__assert_fail ("(0 <= class) &&(class <16)", "term/cgm.trm", 632, __PRETTY_FUNCTION__), 0))); ((void) (((0 <= cgm_id) && (cgm_id < 128)) ? 0 : (__assert_fail ("(0 <= cgm_id) && (cgm_id < 128)", "term/cgm.trm", 633, __PRETTY_FUNCTION__), 0))); ((void) ((0 <= length) ? 0 : (__assert_fail ("0 <= length", "term/cgm.trm", 634, __PRETTY_FUNCTION__), 0))); if (length < 31) { code = ((class &0x0f) <<12) | ((cgm_id & 0x7f) << 5) | ((length & 0x1f)); CGM_write_int(code); } else { code = ((class &0x0f) <<12) | ((cgm_id & 0x7f) << 5) | 0x1f; CGM_write_int(code); CGM_write_int(length); } } static void CGM_write_int(value) int value; { union { short s; char c[2]; } u; ((void) ((-32768 <= value && value <= 32767) ? 0 : (__assert_fail ("-32768 <= value && value <= 32767", "term/cgm.trm", 658, __PRETTY_FUNCTION__), 0))); u.c[0] = (value >> 8) & 255; u.c[1] = value & 255; fwrite(&u.s, 1, 2, gpoutfile); } static void CGM_dashed_vector(ux, uy) unsigned int ux, uy; { int xa, ya; int dx, dy, adx, ady; int dist; long remain; ((void) ((ux < term->xmax && uy < term->ymax) ? 0 : (__assert_fail ("ux < term->xmax && uy < term->ymax", "term/cgm.trm", 683, __PRETTY_FUNCTION__), 0))); dx = (ux - cgm_posx); dy = (uy - cgm_posy); adx = abs(dx); ady = abs(dy * 10); if (10 * adx < ady) dist = (ady / 2 + 25 * adx / ady * adx / 6 * 5) / 5; else { if (adx == 0) return; dist = (adx * 10 + (ady / 24) * (ady / adx)) / 10; } remain = dist; xa = cgm_posx; ya = cgm_posy; while (remain > cgm_step) { remain -= cgm_step; if (cgm_step_index & 1) CGM_solid_vector((int) (ux - (remain * dx) / dist), (int) (uy - (remain * dy) / dist)); else { xa = (int) (ux - (remain * dx) / dist); ya = (int) (uy - (remain * dy) / dist); CGM_move(xa, ya); } if (++cgm_step_index >= 8) cgm_step_index = 0; cgm_step = cgm_step_sizes[cgm_step_index]; } if (cgm_step_index & 1) CGM_solid_vector(ux, uy); else CGM_move(ux, uy); cgm_step -= (int) remain; } static void CGM_solid_vector(ux, uy) unsigned int ux, uy; { ((void) ((ux < term->xmax && uy < term->ymax) ? 0 : (__assert_fail ("ux < term->xmax && uy < term->ymax", "term/cgm.trm", 728, __PRETTY_FUNCTION__), 0))); if (ux == cgm_posx && uy == cgm_posy) return; if (cgm_coords > 104 - 2) { CGM_flush_polyline(); cgm_polyline[cgm_coords++] = cgm_posx; cgm_polyline[cgm_coords++] = cgm_posy + (32767/180); } else if (cgm_coords == 0) { cgm_polyline[cgm_coords++] = cgm_posx; cgm_polyline[cgm_coords++] = cgm_posy + (32767/180); } cgm_polyline[cgm_coords++] = ux; cgm_polyline[cgm_coords++] = uy + (32767/180); cgm_posx = ux; cgm_posy = uy; } static void CGM_put_text(x, y, str) unsigned int x, y; char str[]; { static int where[3] = { 0, 0, 1 }; int data[4]; char *s = str; while (*s) if (!(__ctype_b[(int) (((int) *s++))] & (unsigned short int) _ISspace)) goto showit; return; showit: if (cgm_vert_text != cgm_vert_text_requested) { cgm_vert_text = cgm_vert_text_requested; if (cgm_vert_text) { data[0] = -term->v_char; data[1] = data[2] = 0; data[3] = term->v_char; } else { data[1] = data[2] = term->v_char; data[0] = data[3] = 0; } CGM_write_int_record(5, 16, 8, data); } CGM_flush_polyline(); where[0] = x; where[1] = y + (32767/180); CGM_write_mixed_record(4, 4, 3, where, strlen(str), str); cgm_posx = cgm_posy = -2000; } static int CGM_text_angle(ang) int ang; { if (cgm_rotate) { cgm_vert_text_requested = ang; return 1; } return ang ? 0 : 1; } static int CGM_justify_text(mode) enum JUSTIFY mode; { static int data[6] = { 1, 3, 0, 0, 0, 0 }; switch (mode) { case LEFT: data[0] = 1; break; case CENTRE: data[0] = 2; break; case RIGHT: data[0] = 3; break; default: ((void) ((0) ? 0 : (__assert_fail ("0", "term/cgm.trm", 805, __PRETTY_FUNCTION__), 0))); } CGM_write_int_record(5, 18, 12, data); return (1); } static void CGM_reset() { cgm_posx = cgm_posy = 0; } static void CGM_point(x, y, number) unsigned int x, y; int number; { int old_dashtype; if (number < 0) { CGM_move(x, y); CGM_solid_vector(x + 1, y); return; } number %= 8; CGM_flush_polyline(); old_dashtype = cgm_dashtype; CGM_dashtype(0); switch (number) { case 0: CGM_move(x - cgm_tic, y); CGM_solid_vector(x, y - cgm_tic); CGM_solid_vector(x + cgm_tic, y); CGM_solid_vector(x, y + cgm_tic); CGM_flush_polygon(); break; case 1: CGM_move(x - cgm_tic, y); CGM_solid_vector(x + cgm_tic, y); CGM_move(x, y - cgm_tic); CGM_solid_vector(x, y + cgm_tic); break; case 2: CGM_move(x - cgm_tic707, y - cgm_tic707); CGM_solid_vector(x + cgm_tic707, y - cgm_tic707); CGM_solid_vector(x + cgm_tic707, y + cgm_tic707); CGM_solid_vector(x - cgm_tic707, y + cgm_tic707); CGM_flush_polygon(); break; case 3: CGM_move(x - cgm_tic707, y - cgm_tic707); CGM_solid_vector(x + cgm_tic707, y + cgm_tic707); CGM_move(x - cgm_tic707, y + cgm_tic707); CGM_solid_vector(x + cgm_tic707, y - cgm_tic707); break; case 4: CGM_move(x, y + cgm_tic1241); CGM_solid_vector(x - cgm_tic1077, y - cgm_tic621); CGM_solid_vector(x + cgm_tic1077, y - cgm_tic621); CGM_flush_polygon(); break; case 5: CGM_move(x, y - cgm_tic); CGM_solid_vector(x, y + cgm_tic); CGM_move(x + cgm_tic866, y - cgm_tic500); CGM_solid_vector(x - cgm_tic866, y + cgm_tic500); CGM_move(x + cgm_tic866, y + cgm_tic500); CGM_solid_vector(x - cgm_tic866, y - cgm_tic500); break; case 6: CGM_move(x, y - cgm_tic1241); CGM_solid_vector(x - cgm_tic1077, y + cgm_tic621); CGM_solid_vector(x + cgm_tic1077, y + cgm_tic621); CGM_flush_polygon(); break; case 7: CGM_move(x, y - cgm_tic); CGM_solid_vector(x + cgm_tic500, y - cgm_tic866); CGM_solid_vector(x + cgm_tic866, y - cgm_tic500); CGM_solid_vector(x + cgm_tic, y); CGM_solid_vector(x + cgm_tic866, y + cgm_tic500); CGM_solid_vector(x + cgm_tic500, y + cgm_tic866); CGM_solid_vector(x, y + cgm_tic); CGM_solid_vector(x - cgm_tic500, y + cgm_tic866); CGM_solid_vector(x - cgm_tic866, y + cgm_tic500); CGM_solid_vector(x - cgm_tic, y); CGM_solid_vector(x - cgm_tic866, y - cgm_tic500); CGM_solid_vector(x - cgm_tic500, y - cgm_tic866); CGM_flush_polygon(); break; } CGM_dashtype(old_dashtype); } static void CGM_set_pointsize(size) double size; { # 924 "term/cgm.trm" cgm_tic = (size * term->h_tic / 2); cgm_tic707 = cgm_tic * 12 / 17; cgm_tic866 = cgm_tic * 13 / 15; cgm_tic500 = cgm_tic / 2; cgm_tic1241 = cgm_tic * 36 / 29; cgm_tic1077 = cgm_tic * 14 / 13; cgm_tic621 = cgm_tic * 18 / 29; } static void CGM_flush_polygon() { if (cgm_coords == 0) return; CGM_write_int_record(4, 7, cgm_coords * 2, cgm_polyline); cgm_coords = 0; } static void CGM_options() { (__extension__ (__builtin_constant_p ("Arial Bold") ? (((size_t)(const void *)(("Arial Bold") + 1) - (size_t)(const void *)("Arial Bold") == 1) && strlen ("Arial Bold") + 1 <= 8 ? __strcpy_small (cgm_font, __extension__ (((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 2]) << 8 |! ((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[4]), strlen ("Arial Bold") + 1) : (char *) memcpy (cgm_font, "Arial Bold", strlen ("Arial Bold") + 1)) : strcpy (cgm_font, "Arial Bold"))); cgm_fontsize = 10; term->v_char = (unsigned int) (cgm_fontsize * ((term->xmax + (32767/180))/cgm_plotwidth)); term->h_char = (unsigned int) (cgm_fontsize * ((term->xmax + (32767/180))/cgm_plotwidth) * 5 / 9); cgm_linewidth_pt = 1; cgm_monochrome = 0; cgm_plotwidth = 6 * 72; cgm_portrait = 0; cgm_rotate = 1; cgm_dashed = 1; cgm_winword6_mode = 0; while (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "p$ortrait")) { cgm_portrait = 1; c_token++; continue; } if (almost_equals(c_token, "la$ndscape")) { cgm_portrait = 0; c_token++; continue; } if (almost_equals(c_token, "de$fault")) { (__extension__ (__builtin_constant_p ("Arial Bold") ? (((size_t)(const void *)(("Arial Bold") + 1) - (size_t)(const void *)("Arial Bold") == 1) && strlen ("Arial Bold") + 1 <= 8 ? __strcpy_small (cgm_font, __extension__ (((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 2]! ) << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Arial Bold"))[4]), strlen ("Arial Bold") + 1) : (char *) memcpy (cgm_font, "Arial Bold", strlen ("Arial Bold") + 1)) : strcpy (cgm_font, "Arial Bold"))); cgm_fontsize = 10; term->v_char = (unsigned int) (cgm_fontsize * ((term->xmax + (32767/180))/cgm_plotwidth)); term->h_char = (unsigned int) (cgm_fontsize * ((term->xmax + (32767/180))/cgm_plotwidth) * 5 / 9); cgm_linewidth_pt = 1; cgm_monochrome = 0; cgm_plotwidth = 6 * 72; cgm_portrait = 0; cgm_rotate = 1; cgm_dashed = 1; cgm_winword6_mode = 0; c_token++; continue; } if (almost_equals(c_token, "w$inword6")) { cgm_winword6_mode = 1; c_token++; continue; } if (almost_equals(c_token, "m$onochrome")) { cgm_monochrome = 1; c_token++; continue; } if (almost_equals(c_token, "c$olor") || almost_equals(c_token, "c$olour")) { cgm_monochrome = 0; c_token++; continue; } if (almost_equals(c_token, "r$otate")) { cgm_rotate = 1; c_token++; continue; } if (almost_equals(c_token, "nor$otate")) { cgm_rotate = 0; c_token++; continue; } if (almost_equals(c_token, "da$shed")) { cgm_dashed = 1; c_token++; continue; } if (almost_equals(c_token, "s$olid")) { cgm_dashed = 0; c_token++; continue; } if (almost_equals(c_token, "li$newidth")) { c_token++; if (!(c_token >= num_tokens || equals(c_token,";"))) { struct value a; cgm_linewidth_pt = (unsigned int) real(const_express(&a)); if (cgm_linewidth_pt > 10000) { fputs("gnuplot(cgm.trm): linewidth out of range\n", stderr); cgm_linewidth_pt = 1; } } continue; } if (almost_equals(c_token, "wid$th")) { c_token++; if (!(c_token >= num_tokens || equals(c_token,";"))) { struct value a; cgm_plotwidth = (int) real(const_express(&a)); if (cgm_plotwidth < 0 || cgm_plotwidth > 10000) { fputs("gnuplot(cgm.trm): width out of range\n", stderr); cgm_plotwidth = 6 * 72; } } continue; } break; } if (!(c_token >= num_tokens || equals(c_token,";")) && isstring(c_token)) { quote_str(cgm_font, c_token, 50); if (CGM_find_font(cgm_font, strlen(cgm_font)) == 0) { int n; n = strlen(cgm_font); if (n + 1 <= sizeof(cgm_font_data) && n <= 255) { cgm_font_data[0] = n; (__extension__ (__builtin_constant_p (cgm_font) && __builtin_constant_p (n) ? (strlen (cgm_font) + 1 >= ((size_t) (n)) ? (char *) memcpy (cgm_font_data + 1, cgm_font, n) : strncpy (cgm_font_data + 1, cgm_font, n)) : strncpy (cgm_font_data + 1, cgm_font, n))); cgm_font_data[n + 1] = 0; } } c_token++; } if (!(c_token >= num_tokens || equals(c_token,";"))) { struct value a; cgm_fontsize = (int) real(const_express(&a)); term->v_char = (unsigned int) (cgm_fontsize * ((term->xmax + (32767/180))/cgm_plotwidth)); term->h_char = (unsigned int) (cgm_fontsize * ((term->xmax + (32767/180))/cgm_plotwidth) * 5 / 9); } if (cgm_portrait) { term->xmax = 32767/18*13 - (32767/180); term->ymax = 32767 - (32767/180); } else { term->xmax = 32767 - (32767/180); term->ymax = 32767/18*13 - (32767/180); } sprintf(default_font, "%s,%d", cgm_font, cgm_fontsize); sprintf(term_options, "%s %s %s %s %s width %d linewidth %d \"%s\" %d", cgm_portrait ? "portrait" : "landscape", cgm_monochrome ? "monochrome" : "color", cgm_rotate ? "rotate" : "norotate", cgm_dashed ? "dashed" : "solid", cgm_winword6_mode ? "winword6" : "", cgm_plotwidth, cgm_linewidth_pt, cgm_font, cgm_fontsize); } # 261 "term.h" 2 # 1 "term/corel.trm" 1 # 28 "term/corel.trm" # 1 "term/driver.h" 1 # 29 "term/corel.trm" 2 static void COREL_options (void); static void COREL_init (void); static void COREL_graphics (void); static void COREL_text (void); static void COREL_reset (void); static void COREL_linetype (int linetype); static void COREL_move (unsigned int x, unsigned int y); static void COREL_vector (unsigned int x, unsigned int y); static void COREL_put_text (unsigned int x, unsigned int y, char *str); static int COREL_text_angle (int ang); static int COREL_justify_text (enum JUSTIFY mode); # 59 "term/corel.trm" char corel_font[50 + 1] = "SwitzerlandLight"; int corel_fontsize = 22; TBOOLEAN corel_color = 0; TBOOLEAN corel_stroke = 0; int corel_path_count = 0; int corel_ang = 0; enum JUSTIFY corel_justify = LEFT; # 74 "term/corel.trm" unsigned int corel_xmax = 5960; unsigned int corel_ymax = 7200; float corel_lw = (1.2*(10.0)); static void COREL_options() { struct value a; if (!(c_token >= num_tokens || equals(c_token,";")) && almost_equals(c_token, "def$ault")) { corel_color = 0; (__extension__ (__builtin_constant_p ("SwitzerlandLight") ? (((size_t)(const void *)(("SwitzerlandLight") + 1) - (size_t)(const void *)("SwitzerlandLight") == 1) && strlen ("SwitzerlandLight") + 1 <= 8 ? __strcpy_small (corel_font, __extension__ (((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[4 + ! 3] << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("SwitzerlandLight"))[4]), strlen ("SwitzerlandLight") + 1) : (char *) memcpy (corel_font, "SwitzerlandLight", strlen ("SwitzerlandLight") + 1)) : strcpy (corel_font, "SwitzerlandLight"))); corel_fontsize = 22; corel_lw = (1.2*(10.0)); corel_xmax = 5960; corel_ymax = 7200; c_token++; } if (!(c_token >= num_tokens || equals(c_token,";")) && almost_equals(c_token, "mono$chrome")) { corel_color = 0; c_token++; } else if (!(c_token >= num_tokens || equals(c_token,";")) && (almost_equals(c_token, "color$") || almost_equals(c_token, "colour$"))) { corel_color = 1; c_token++; } if (!(c_token >= num_tokens || equals(c_token,";")) && isstring(c_token)) { quote_str(corel_font, c_token, 50); c_token++; } if (!(c_token >= num_tokens || equals(c_token,";"))) { corel_fontsize = (int) real(const_express(&a)); c_token++; term->v_char = (unsigned int) (corel_fontsize * (10.0)); term->h_char = (unsigned int) (corel_fontsize * (10.0) * 6 / 10); } if (!(c_token >= num_tokens || equals(c_token,";"))) { corel_xmax = (unsigned int) (real(const_express(&a)) * 720); c_token++; if (!(c_token >= num_tokens || equals(c_token,";"))) { corel_ymax = (unsigned int) (real(const_express(&a)) * 720); c_token++; } term->xmax = corel_xmax; term->ymax = corel_ymax; term->v_tic = corel_ymax / 80; term->h_tic = corel_ymax / 80; } if (!(c_token >= num_tokens || equals(c_token,";"))) { corel_lw = real(const_express(&a)) * (10.0); c_token++; } sprintf(term_options, "%s \"%s\" %d,%0.1f,%0.1f,%0.1f", corel_color ? "color" : "monochrome", corel_font, corel_fontsize, corel_xmax / 720.0, corel_ymax / 720.0, corel_lw / (10.0)); } static void COREL_init() { fprintf(gpoutfile, "%%!PS-Adobe-2.0 EPSF-1.2\n%%%%BoundingBox: %d %d %d %d\n%%%%TemplateBox: %d %d %d %d\n%%%%EndComments\n%%%%EndProlog\n%%%%BeginSetup\n%%%%EndSetup\n", 0, 0, (int) ((corel_xmax) / (10.0) + 0.5 + 0), (int) ((corel_ymax) / (10.0) + 0.5 + 0), 0, 0, (int) ((corel_xmax) / (10.0) + 0.5 + 0), (int) ((corel_ymax) / (10.0) + 0.5 + 0)); } static void COREL_graphics() { corel_path_count = 0; corel_stroke = 0; } static void COREL_text() { if (corel_stroke) { fputs("S\n", gpoutfile); corel_stroke = 0; } corel_path_count = 0; } static void COREL_reset() { fputs("%%%%Trailer\n", gpoutfile); } static void COREL_linetype(linetype) int linetype; { if (corel_stroke) { fputs("S\n", gpoutfile); corel_stroke = 0; } switch (linetype) { case -2: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0 0 0 1 K\n", gpoutfile); } else { fputs("[] 0 d\n0 j\n0 G\n", gpoutfile); } break; case -1: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0 0 0 1 K\n", gpoutfile); } else { fputs("[1 2] 0 d\n0 j\n0 G\n", gpoutfile); } break; case 0: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("1 0 1 0 K\n", gpoutfile); } else { fputs("[] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 1: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("1 1 0 0 K\n", gpoutfile); } else { fputs("[4 2] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 2: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0 1 1 0 K\n", gpoutfile); } else { fputs("[2 3] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 3: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0 1 0 0 K\n", gpoutfile); } else { fputs("[1 1.5] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 4: fprintf(gpoutfile, "%f w\n", corel_lw / (10.0)); if (corel_color) { fputs("1 0 0 0 K\n", gpoutfile); } else { fputs("[5 2 1 2] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 5: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0 0 1 0 K\n", gpoutfile); } else { fputs("[4 3 1 3] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 6: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0 0 0 1 K\n", gpoutfile); } else { fputs("[2 2 2 4] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 7: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0 0.7 1 0 K\n", gpoutfile); } else { fputs("[2 2 2 2 2 4] 0 d\n2 j\n0 G\n", gpoutfile); } break; case 8: fprintf(gpoutfile, "%.2f w\n", corel_lw / (10.0)); if (corel_color) { fputs("0.5 0.5 0.5 0 K\n", gpoutfile); } else { fputs("[2 2 2 2 2 2 2 4] 0 d\n2 j\n0 G\n", gpoutfile); } break; } corel_path_count = 0; } static void COREL_move(x, y) unsigned int x, y; { if (corel_stroke) fputs("S\n", gpoutfile); fprintf(gpoutfile, "%0.2f %0.2f m\n", x / (10.0), y / (10.0)); corel_path_count += 1; corel_stroke = 1; } static void COREL_vector(x, y) unsigned int x, y; { fprintf(gpoutfile, "%.2f %.2f l\n", x / (10.0), y / (10.0)); corel_path_count += 1; corel_stroke = 1; if (corel_path_count >= 400) { fprintf(gpoutfile, "S\n%.2f %.2f m\n", x / (10.0), y / (10.0)); corel_path_count = 0; } } static void COREL_put_text(x, y, str) unsigned int x, y; char *str; { char ch; if (corel_stroke) { fputs("S\n", gpoutfile); corel_stroke = 0; } switch (corel_justify) { case LEFT: fprintf(gpoutfile, "/_%s %d %d 0 0 z\n", corel_font, corel_fontsize, corel_fontsize); break; case CENTRE: fprintf(gpoutfile, "/_%s %d %d 0 1 z\n", corel_font, corel_fontsize, corel_fontsize); break; case RIGHT: fprintf(gpoutfile, "/_%s %d %d 0 2 z\n", corel_font, corel_fontsize, corel_fontsize); break; } if (corel_ang == 0) { fprintf(gpoutfile, "[1 0 0 1 %.2f %.2f]e\n0 g\n", x / (10.0), y / (10.0) - corel_fontsize / 3.0); } else { fprintf(gpoutfile, "[0 1 -1 0 %.2f %.2f]e\n0 g\n", x / (10.0) - corel_fontsize / 3.0, y / (10.0)); } _IO_putc ('(', gpoutfile); ch = *str++; while (ch != ('\0')) { if ((ch == '(') || (ch == ')') || (ch == '\\')) _IO_putc ('\\', gpoutfile); _IO_putc (ch, gpoutfile); ch = *str++; } fputs(")t\nT\n", gpoutfile); corel_path_count = 0; } static int COREL_text_angle(ang) int ang; { corel_ang = ang; return 1; } static int COREL_justify_text(mode) enum JUSTIFY mode; { corel_justify = mode; return 1; } # 264 "term.h" 2 # 1 "term/dumb.trm" 1 # 51 "term/dumb.trm" # 1 "term/driver.h" 1 # 52 "term/dumb.trm" 2 static void DUMB_options (void); static void DUMB_init (void); static void DUMB_graphics (void); static void DUMB_text (void); static void DUMB_reset (void); static void DUMB_linetype (int linetype); static void DUMB_move (unsigned int x, unsigned int y); static void DUMB_point (unsigned int x, unsigned int y, int point); static void DUMB_vector (unsigned int x, unsigned int y); static void DUMB_put_text (unsigned int x, unsigned int y, char *str); static void DUMB_arrow (unsigned int sx, unsigned int sy, unsigned int ex, unsigned int ey, int head); # 85 "term/dumb.trm" static char *dumb_matrix = ((void *)0); static char *dumb_priority = ((void *)0); static char dumb_pen; static int dumb_x; static int dumb_y; static int dumb_xmax = 79; static int dumb_ymax = 24; static int dumb_feed = 1; static void dumb_set_pixel (int x, int y, int v, int p); static void dumb_set_pixel(x, y, v, p) int x, y, v, p; { if ((unsigned) x <= dumb_xmax && (unsigned) y <= dumb_ymax && p > dumb_priority[dumb_xmax * y + x]) { dumb_matrix[dumb_xmax * y + x] = v; dumb_priority[dumb_xmax * y + x] = p; } } static void DUMB_options() { int x, y; struct value a; if (almost_equals(c_token, "f$eed")) ++c_token, dumb_feed = 1; else if (almost_equals(c_token, "nof$eed")) ++c_token, dumb_feed = 0; if (!(c_token >= num_tokens || equals(c_token,";"))) { x = (int) real(const_express(&a)); if (!(c_token >= num_tokens || equals(c_token,";"))) { y = (int) real(const_express(&a)); dumb_xmax = term->xmax = x; dumb_ymax = term->ymax = y; } } sprintf(term_options, "%sfeed %d %d", dumb_feed ? "" : "no", dumb_xmax, dumb_ymax); } static void DUMB_init() { if (dumb_matrix) free(dumb_matrix); dumb_matrix = gp_alloc((unsigned long) dumb_xmax * dumb_ymax * 2, "dumb terminal"); dumb_priority = dumb_matrix + dumb_xmax * dumb_ymax; } static void DUMB_graphics() { int i; char *pm = dumb_matrix, *pp = dumb_priority; for (i = dumb_xmax * dumb_ymax; i > 0; i--) { *pm++ = ' '; *pp++ = 0; } } static void DUMB_text() { int x, y, l; _IO_putc ('\f', gpoutfile); for (y = dumb_ymax - 1; y >= 0; y--) { for (l = dumb_xmax; l > 0 && dumb_matrix[dumb_xmax*(y)+(l - 1)] == ' '; l--); for (x = 0; x < l; x++) _IO_putc (dumb_matrix[dumb_xmax*(y)+(x)], gpoutfile); if (dumb_feed || y > 0) _IO_putc ('\n', gpoutfile); } fflush(gpoutfile); } static void DUMB_reset() { free(dumb_matrix); dumb_matrix = ((void *)0); } static void DUMB_linetype(linetype) int linetype; { static char pen_type[7] = { '*', '#', '$', '%', '@', '&', '=' }; if (linetype == -2) dumb_pen = '\2'; else if (linetype == -1) dumb_pen = '\1'; else { linetype = linetype % 7; dumb_pen = pen_type[linetype]; } } static void DUMB_move(x, y) unsigned int x, y; { dumb_x = x; dumb_y = y; } static void DUMB_point(x, y, point) unsigned int x, y; int point; { dumb_set_pixel(x, y, point == -1 ? '.' : point % 26 + 'A', 4); } static void DUMB_vector(_x, _y) unsigned int _x, _y; { int x = _x; int y = _y; char pen, pen1; int priority; int delta; if (((y - dumb_y) >= 0 ? (y - dumb_y) : -(y - dumb_y)) > ((x - dumb_x) >= 0 ? (x - dumb_x) : -(x - dumb_x))) { switch (dumb_pen) { case '\1': pen = ':'; pen1 = '+'; priority = 1; break; case '\2': pen = '|'; pen1 = '+'; priority = 2; break; default: pen = dumb_pen; pen1 = dumb_pen; priority = 3; break; } dumb_set_pixel(dumb_x, dumb_y, pen1, priority); for (delta = 1; delta < ((y - dumb_y) >= 0 ? (y - dumb_y) : -(y - dumb_y)); delta++) { dumb_set_pixel(dumb_x + (int) ((double) (x - dumb_x) * delta / ((y - dumb_y) >= 0 ? (y - dumb_y) : -(y - dumb_y)) + 0.5), dumb_y + delta * ((y - dumb_y) >= 0 ? 1 : -1), pen, priority); } dumb_set_pixel(x, y, pen1, priority); } else if (((x - dumb_x) >= 0 ? (x - dumb_x) : -(x - dumb_x)) > ((y - dumb_y) >= 0 ? (y - dumb_y) : -(y - dumb_y))) { switch (dumb_pen) { case '\1': pen = '.'; pen1 = '+'; priority = 1; break; case '\2': pen = '-'; pen1 = '+'; priority = 2; break; default: pen = dumb_pen; pen1 = dumb_pen; priority = 3; break; } dumb_set_pixel(dumb_x, dumb_y, pen1, priority); for (delta = 1; delta < ((x - dumb_x) >= 0 ? (x - dumb_x) : -(x - dumb_x)); delta++) dumb_set_pixel(dumb_x + delta * ((x - dumb_x) >= 0 ? 1 : -1), dumb_y + (int) ((double) (y - dumb_y) * delta / ((x - dumb_x) >= 0 ? (x - dumb_x) : -(x - dumb_x)) + 0.5), pen, priority); dumb_set_pixel(x, y, pen1, priority); } else { switch (dumb_pen) { case '\1': pen = '+'; priority = 1; break; case '\2': pen = '+'; priority = 2; break; default: pen = dumb_pen; priority = 3; break; } for (delta = 0; delta <= ((x - dumb_x) >= 0 ? (x - dumb_x) : -(x - dumb_x)); delta++) dumb_set_pixel(dumb_x + delta * ((x - dumb_x) >= 0 ? 1 : -1), dumb_y + delta * ((y - dumb_y) >= 0 ? 1 : -1), pen, priority); } dumb_x = x; dumb_y = y; } static void DUMB_put_text(x, y, str) unsigned int x, y; char *str; { int length; length = strlen(str); if (x + length > dumb_xmax) x = ( (0) > (dumb_xmax - length) ? (0) : (dumb_xmax - length) ); for (; x < dumb_xmax && *str; x++, str++) dumb_set_pixel(x, y, *str, 5); } static void DUMB_arrow(sx, sy, ex, ey, head) unsigned int sx, sy, ex, ey; int head; { char saved_pen; char saved_x; char saved_y; saved_pen = dumb_pen; saved_x = dumb_x; saved_y = dumb_y; dumb_pen = '>'; dumb_x = sx; dumb_y = sy; DUMB_vector(ex, ey); dumb_pen = saved_pen; dumb_x = saved_x; dumb_y = saved_y; } # 272 "term.h" 2 # 1 "term/dxf.trm" 1 # 55 "term/dxf.trm" # 1 "term/driver.h" 1 # 56 "term/dxf.trm" 2 static void DXF_init (void); static void DXF_graphics (void); static void DXF_text (void); static void DXF_linetype (int linetype); static void DXF_move (unsigned int x, unsigned int y); static void DXF_vector (unsigned int ux, unsigned int uy); static void DXF_put_text (unsigned int x, unsigned int y, char str[]); static int DXF_text_angle (int ang); static int DXF_justify_text (enum JUSTIFY mode); static void DXF_reset (void); # 103 "term/dxf.trm" static unsigned int DXF_posx; static unsigned int DXF_posy; static unsigned int dxf_linetype; enum JUSTIFY dxf_justify = LEFT; static float dxf_angle = 0.0; static char *text_style = "STANDARD"; static char *layer_name[] ={ "0", "1", "2", "3", "4", "5", "6" }; static char *layer_colour[] = { "7", "1", "2", "3", "4", "5", "6" }; static char *layer_lines[] = { "CONTINUOUS", "DASHED", "HIDDEN", "CENTER", "PHANTOM", "DOT", "DASHDOT" }; static TBOOLEAN vector_was_last = 0; static void DXF_init() { DXF_posx = DXF_posy = 0; dxf_linetype = 0; dxf_angle = 0.0; vector_was_last = 0; } static void DXF_graphics() { register struct TERMENTRY *t = term; int i; static char dxfi1[] = "999\n%% GNUPLOT: dxf file for AutoCad\n 0\nSECTION\n 2\nHEADER\n 9\n$EXTMIN\n 10\n0.000\n 20\n0.000\n 9\n$EXTMAX\n 10\n%-6.3f\n 20\n%-6.3f\n 9\n$LIMMIN\n 10\n0.000\n 20\n0.000\n 9\n$LIMMAX\n 10\n%-6.3f\n 20\n%-6.3f\n 9\n$TEXTSTYLE\n 7\n%s\n 9\n$TEXTSIZE\n 40\n%-6.3f\n 9\n$PLINEWID\n 40\n%-6.4f\n 9\n$LTSCALE\n 40\n%-6.3f\n 9\n$COORDS\n 70\n 1\n 9\n$CELTYPE\n 6\nBYLAYER\n 9\n$CLAYER\n 8\n0\n 9\n$CECOLOR\n 62\n %s\n 9\n$MENU\n 1\nacad\n 0\nENDSEC\n 0\nSECTION\n 2\nTABLES\n"; # 165 "term/dxf.trm" static char dxfi2[] = "0\nTABLE\n 2\nLTYPE\n 70\n %d\n0\nLTYPE\n 2\nCONTINUOUS\n 70\n 64\n 3\nSolid line\n 72\n 65\n 73\n 0\n 40\n0.0\n 0\nLTYPE\n 2\nDASHED\n 70\n 64\n 3\n__ __ __ __ __ __ __ __ __ __ __ __ __ __ __\n 72\n 65\n 73\n 2\n 40\n0.75\n 49\n0.5\n 49\n-0.25\n 0\nLTYPE\n 2\nHIDDEN\n 70\n 64\n 3\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n 72\n 65\n 73\n 2\n 40\n0.375\n 49\n0.25\n 49\n-0.125\n 0\nLTYPE\n 2\nCENTER\n 70\n 64\n 3\n____ _ ____ _ ____ _ ____ _ ____ _ ____ _ ____\n 72\n 65\n 73\n 4\n 40\n2.0\n 49\n1.25\n 49\n-0.25\n 49\n0.25\n 49\n-0.25\n 0\nLTYPE\n 2\nPHANTOM\n 70\n 64\n 3\n_____ _ _ _____ _ _ _____ _ _ _____ _ _ ____\n 72\n 65\n 73\n 6\n 40\n2.5\n 49\n1.25\n 49\n-0.25\n 49\n0.25\n 49\n-0.25\n 49\n0.25\n 49\n-0.25\n 0\nLTYPE\n 2\nDOT\n 70\n 64\n 3\n...............................................\n 72\n 65\n 73\n 2\n 40\n0.25\n 49\n0.0\n 49\n-0.25\n 0\nLTYPE\n 2\n! DASHDOT\n 70\n 64\n 3\n__ . __ . __ . __ . __ . __ . __ . __ . __ . __\n 72\n 65\n 73\n 4\n 40\n1.0\n 49\n0.5\n 49\n-0.25\n 49\n0.0\n 49\n-0.25\n 0\nENDTAB\n"; # 192 "term/dxf.trm" fprintf(gpoutfile, dxfi1, t->xmax / 60.0, t->ymax / 60.0, t->xmax / 60.0, t->ymax / 60.0, text_style, (0.7 * (0.026 * (80.0 * 60.0))) / 60.0, 0.0351, (double) 1, layer_colour[0]); fprintf(gpoutfile, dxfi2, 7); fprintf(gpoutfile, " 0\nTABLE\n 2\nLAYER\n 70\n %-d\n", 7); for (i = 1; i <= 7; i++) fprintf(gpoutfile, " 0\nLAYER\n 2\n%s\n 70\n 64\n62\n %s\n 6\n%s\n", layer_name[i - 1], layer_colour[i - 1], layer_lines[i - 1]); fputs(" 0\nENDTAB\n0\nENDSEC\n 0\nSECTION\n 2\nBLOCKS\n 0\nENDSEC\n 0\nSECTION\n 2\nENTITIES\n", gpoutfile); } static void DXF_text() { if (vector_was_last) fputs(" 0\nSEQEND\n", gpoutfile); fputs(" 0\nENDSEC\n 0\nEOF\n", gpoutfile); } static void DXF_linetype(linetype) int linetype; { linetype = ((linetype) >= 0 ? (linetype) : -(linetype)); linetype = linetype % 7; dxf_linetype = linetype; } static void DXF_move(x, y) unsigned int x, y; { DXF_posx = x; DXF_posy = y; if (vector_was_last) fputs(" 0\nSEQEND\n", gpoutfile); vector_was_last = 0; fprintf(gpoutfile, " 0\nPOLYLINE\n 8\n%s\n 66\n 1\n 6\n%s\n 0\nVERTEX\n 8\n%s\n 6\n%s\n 10\n%-6.3f\n 20\n%-6.3f\n 30\n0.000\n", layer_name[dxf_linetype], layer_lines[dxf_linetype], layer_name[dxf_linetype], layer_lines[dxf_linetype], DXF_posx / 60.0, DXF_posy / 60.0); } static void DXF_vector(ux, uy) unsigned int ux, uy; { DXF_posx = ux; DXF_posy = uy; vector_was_last = 1; fprintf(gpoutfile, " 0\nVERTEX\n 8\n%s\n 6\n%s\n 10\n%-6.3f\n 20\n%-6.3f\n 30\n0.000\n", layer_name[dxf_linetype], layer_lines[dxf_linetype], DXF_posx / 60.0, DXF_posy / 60.0); } static void DXF_put_text(x, y, str) unsigned int x, y; char str[]; { int stl; float xleftpos, yleftpos, xrightpos, yrightpos; xleftpos = yleftpos = xrightpos = yrightpos = 1.0; if (str[0] == ('\0')) return; stl = 0; while (str[stl] != ('\0')) ++stl; if (vector_was_last) fputs(" 0\nSEQEND\n", gpoutfile); vector_was_last = 0; fprintf(gpoutfile, " 0\nTEXT\n 8\n%s\n", layer_name[0]); if (dxf_angle != 90.0) { switch (dxf_justify) { case LEFT: xleftpos = (float) x; yleftpos = (float) (y - (0.026 * (80.0 * 60.0)) / 4.0); xrightpos = (float) (x + stl * (0.7 * (0.014 * (120.0 * 60.0)))); yrightpos = yleftpos; break; case RIGHT: xleftpos = (float) (x - stl * (0.7 * (0.014 * (120.0 * 60.0)))); yleftpos = (float) (y - (0.026 * (80.0 * 60.0)) / 4.0); xrightpos = (float) x; yrightpos = yleftpos; break; case CENTRE: xleftpos = (float) (x - stl * (0.7 * (0.014 * (120.0 * 60.0))) / 2.0); yleftpos = (float) (y - (0.026 * (80.0 * 60.0)) / 4.0); xrightpos = (float) x; yrightpos = yleftpos; break; } } else { switch (dxf_justify) { case LEFT: xleftpos = (float) (x + (0.026 * (80.0 * 60.0)) / 4.0); yleftpos = (float) y; xrightpos = xleftpos; yrightpos = (float) (y + stl * (0.7 * (0.014 * (120.0 * 60.0)))); break; case RIGHT: xleftpos = (float) (x + (0.026 * (80.0 * 60.0)) / 4.0); yleftpos = (float) (y - stl * (0.014 * (120.0 * 60.0))); xrightpos = xleftpos; yrightpos = (float) y; break; case CENTRE: xleftpos = (float) (x + (0.026 * (80.0 * 60.0)) / 4.0); yleftpos = (float) (y - stl * (0.7 * (0.014 * (120.0 * 60.0))) / 2.0); xrightpos = xleftpos; yrightpos = (float) y; break; } } fprintf(gpoutfile, " 10\n%-6.3f\n 20\n%-6.3f\n 30\n0.000\n 40\n%-6.3f\n 1\n%s\n 50\n%-6.3f\n 7\n%s\n", xleftpos / 60.0, yleftpos / 60.0, (0.7 * (0.026 * (80.0 * 60.0))) / 60.0, str, dxf_angle, text_style); if (dxf_justify != LEFT) { fprintf(gpoutfile, " 72\n%d\n 11\n%-6.3f\n 21\n%-6.3f\n 31\n0.000\n", dxf_justify, xrightpos / 60.0, yrightpos / 60.0); } } static int DXF_text_angle(ang) int ang; { dxf_angle = 0.0; if (ang == 1) dxf_angle = 90.0; return (1); } static int DXF_justify_text(mode) enum JUSTIFY mode; { dxf_justify = mode; return (1); } static void DXF_reset() { DXF_posx = DXF_posy = 0; } # 275 "term.h" 2 # 1 "term/fig.trm" 1 # 63 "term/fig.trm" # 1 "term/driver.h" 1 # 64 "term/fig.trm" 2 static void FIG_options (void); static void FIG_init (void); static void FIG_graphics (void); static void FIG_text (void); static void FIG_linetype (int linetype); static void FIG_move (unsigned int x, unsigned int y); static void FIG_vector (unsigned int ux, unsigned int uy); static void FIG_arrow (unsigned int sx, unsigned int sy, unsigned int ex, unsigned int ey, TBOOLEAN head); static void FIG_put_text (unsigned int x, unsigned int y, char *str); static int FIG_justify_text (enum JUSTIFY mode); static int FIG_text_angle (int ang); static void FIG_pointsize (double arg_pointsize); static void FIG_linewidth (double linewidth); static void FIG_reset (void); static void FIG_lpoint (unsigned int x, unsigned int y, int number); # 1 "term/object.h" 1 # 49 "term/object.h" typedef struct f_point { int x, y; } F_point; typedef struct f_pos { int x, y; } F_pos; typedef struct f_arrow { int type; int style; float thickness; float wid; float ht; } F_arrow; typedef struct f_ellipse { int tagged; int distrib; int type; int style; int thickness; int pen_color; int fill_color; int fill_style; int depth; float style_val; int pen_style; float angle; int direction; struct f_pos center; struct f_pos radiuses; struct f_pos start; struct f_pos end; struct f_ellipse *next; } F_ellipse; typedef struct f_arc { int tagged; int distrib; int type; int style; int thickness; int pen_color; int fill_color; int fill_style; int depth; int pen_style; struct f_arrow *for_arrow; struct f_arrow *back_arrow; int cap_style; float style_val; int direction; struct { float x, y; } center; struct f_pos point[3]; struct f_arc *next; } F_arc; typedef struct f_pic { char file[4095]; int subtype; int flipped; unsigned char *bitmap; int numcols; float hw_ratio; int size_x, size_y; struct f_pos bit_size; int color; int pix_rotation, pix_width, pix_height, pix_flipped; } F_pic; extern char EMPTY_PIC[]; typedef struct f_line { int tagged; int distrib; int type; int style; int thickness; int pen_color; int fill_color; int fill_style; int depth; int pen_style; struct f_arrow *for_arrow; struct f_arrow *back_arrow; int cap_style; struct f_point *points; int join_style; float style_val; int radius; struct f_pic *pic; struct f_line *next; } F_line; typedef struct f_text { int tagged; int distrib; int type; int font; int size; int color; int depth; float angle; int flags; int ascent; int length; int descent; int base_x; int base_y; int pen_style; char *cstring; struct f_text *next; } F_text; # 250 "term/object.h" typedef struct f_control { float lx, ly, rx, ry; struct f_control *next; } F_control; # 263 "term/object.h" typedef struct f_spline { int tagged; int distrib; int type; int style; int thickness; int pen_color; int fill_color; int fill_style; int depth; int pen_style; struct f_arrow *for_arrow; struct f_arrow *back_arrow; int cap_style; struct f_point *points; float style_val; struct f_control *controls; struct f_spline *next; } F_spline; typedef struct f_compound { int tagged; int distrib; struct f_pos nwcorner; struct f_pos secorner; struct f_line *lines; struct f_ellipse *ellipses; struct f_spline *splines; struct f_text *texts; struct f_arc *arcs; struct f_compound *compounds; struct f_compound *next; } F_compound; typedef struct f_linkinfo { struct f_line *line; struct f_point *endpt; struct f_point *prevpt; int two_pts; struct f_linkinfo *next; } F_linkinfo; # 381 "term/object.h" extern F_compound objects; extern F_line *cur_l, *new_l, *old_l; extern F_arc *cur_a, *new_a, *old_a; extern F_ellipse *cur_e, *new_e, *old_e; extern F_text *cur_t, *new_t, *old_t; extern F_spline *cur_s, *new_s, *old_s; extern F_compound *cur_c, *new_c, *old_c; extern F_point *first_point, *cur_point; extern F_linkinfo *cur_links; extern int cur_linewidth; extern int cur_linestyle; extern int cur_joinstyle; extern int cur_capstyle; extern float cur_dashlength; extern float cur_dotgap; extern float cur_styleval; extern int cur_fillcolor, cur_pencolor; extern int cur_fillstyle, cur_penstyle; extern int cur_boxradius; extern int cur_arrowmode; extern int cur_arrowtype; extern int cur_arctype; extern int cur_fontsize; extern int cur_latex_font; extern int cur_ps_font; extern int cur_textjust; extern int cur_textflags; extern float cur_elltextangle; # 93 "term/fig.trm" 2 # 122 "term/fig.trm" enum FIG_poly_stat { FIG_poly_new, FIG_poly_part }; static int FIG_posx; static int FIG_posy; static long FIG_poly_vec_cnt; static int FIG_depth = 10; static int FIG_linedepth = 10; static int FIG_thickness = 1; static int FIG_default_thickness = 1; static double FIG_current_pointsize = 1.; static double FIG_current_linewidth = 1.; static int FIG_poly_vec_max = 999; static enum FIG_poly_stat FIG_polyvec_stat; # 156 "term/fig.trm" static F_point *FIG_points = ((void *)0); static F_line FIG_line; # 168 "term/fig.trm" static int FIG_type; static float FIG_spacing; static int FIG_justify; static float FIG_angle; static int FIG_use_color = 0; static int FIG_is_big = 0; static int FIG_color = (-1); static int FIG_xoff = ((1200)/4); static int FIG_yoff = ((1200)/4); static int FIG_font_s = (10); static int FIG_portrait = 0; static int FIG_inches = 0; static void FIG_poly_clean (enum FIG_poly_stat fig_stat); static void FIG_poly_clean(fig_stat) enum FIG_poly_stat fig_stat; { int i, j; if (fig_stat == FIG_poly_part) { fprintf(gpoutfile, "%d %d %d %d %d %d %d %d %d %9.3f %d %d %d %d %d %ld\n\t", 2, FIG_line.type, FIG_line.style, FIG_line.thickness, FIG_line.pen_color, FIG_line.fill_color, FIG_line.depth, FIG_line.pen_style, FIG_line.fill_style, FIG_line.style_val, FIG_line.join_style, FIG_line.cap_style, FIG_line.radius, 0, 0, FIG_poly_vec_cnt); j = 0; for (i = 0; i < FIG_poly_vec_cnt; i++) { fprintf(gpoutfile, " %d %d", FIG_points[i].x, FIG_points[i].y); if (j++ > 4 && i != FIG_poly_vec_cnt - 1) { fputs("\n\t", gpoutfile); j = 0; } } if (j != 0) { _IO_putc ('\n', gpoutfile); } free(FIG_points); FIG_points = ((void *)0); } FIG_polyvec_stat = FIG_poly_new; } static void FIG_options() { static char *options_list = "expecting monochrome, color, small, big, portrait, landscape,\n \t inches, metric, size , fontsize ,\n \t thickness , depth or pointsmax "; int parse_error = 0; long temp_max; struct value a; unsigned int tmax_t; double xsize_t, ysize_t; FIG_use_color = 0; FIG_is_big = 0; FIG_portrait = 0; FIG_font_s = 0; FIG_default_thickness = 1; xsize_t = ysize_t = 0.; FIG_inches = 1; while (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "mo$nochrome")) { FIG_use_color = 0; c_token++; } else if (almost_equals(c_token, "c$olor") || almost_equals(c_token, "c$olour")) { FIG_use_color = 1; c_token++; } else if (almost_equals(c_token, "sm$all")) { FIG_is_big = 0; c_token++; } else if (almost_equals(c_token, "b$ig")) { FIG_is_big = 1; c_token++; } else if (almost_equals(c_token, "in$ches")) { FIG_inches = 1; c_token++; } else if (almost_equals(c_token, "me$tric")) { FIG_inches = 0; c_token++; } else if (almost_equals(c_token, "por$trait")) { FIG_portrait = 1; c_token++; } else if (almost_equals(c_token, "l$andscape")) { FIG_portrait = 0; c_token++; } else if (almost_equals(c_token, "si$ze")) { c_token++; if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("size: 2 numbers expected", c_token); } else { xsize_t = real(const_express(&a)); if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("size: 2 numbers expected", c_token); xsize_t = 0.; } else { ysize_t = real(const_express(&a)); } if (xsize_t < 2. || ysize_t < 2. || xsize_t > 99. || ysize_t > 99.) { if (xsize_t != 0. || ysize_t != 0.) int_error("size: out of range", c_token); xsize_t = ysize_t = 0.; } } } else if (almost_equals(c_token, "f$ontsize")) { c_token++; if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("fontsize: number expected", c_token); } else { FIG_font_s = (int) real(const_express(&a)); if (FIG_font_s < 5 || FIG_font_s > 36) { int_error("fontsize out of range", c_token - 1); FIG_font_s = 0; } } } else if (almost_equals(c_token, "t$hickness")) { c_token++; if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("thickness: number expected", c_token); } else { FIG_default_thickness = (int) real(const_express(&a)); if (FIG_default_thickness < 1 || FIG_default_thickness > 10) { int_error("thickness out of range", c_token - 1); FIG_default_thickness = 1; } } } else if (almost_equals(c_token, "d$epth")) { c_token++; if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("depth: number expected", c_token); } else { FIG_depth = (int) real(const_express(&a)); if (FIG_depth < 0 || FIG_depth > 99) { int_error("depth out of range", c_token - 1); FIG_depth = 10; } FIG_linedepth = FIG_depth; } } else if (almost_equals(c_token, "poi$ntsmax")) { c_token++; if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("max. points per polyline: number expected", c_token); } else { temp_max = (long) real(const_express(&a)); if ((temp_max > 1) && (temp_max < (99999L + 2))) { FIG_poly_vec_max = temp_max - 1; } else { char t[128]; sprintf(t, "pointsmax: number out of range (2,%ld)", (99999L + 1)); int_error(t, c_token); } } } else { parse_error = 1; int_error(options_list, c_token); } } sprintf(term_options, "%s %s %s %d %s %s %s %d %s %d %s %d", FIG_use_color ? "color" : "monochrome", FIG_is_big ? "big" : "small", "pointsmax", FIG_poly_vec_max + 1, FIG_portrait ? "portrait" : "landscape", FIG_inches ? "inches" : "metric", "fontsize", (FIG_font_s > 0 ? FIG_font_s : (FIG_is_big ? (16) : (10))), "thickness", FIG_default_thickness, "depth", FIG_depth); if (xsize_t > 0. && ysize_t > 0.) { if (xsize_t - (int) xsize_t == 0. && ysize_t - (int) ysize_t == 0.) sprintf(term_options + strlen(term_options), " size %d %d", (int) xsize_t, (int) ysize_t); else sprintf(term_options + strlen(term_options), " size %f %f", xsize_t, ysize_t); } if (!FIG_is_big) { if (FIG_font_s == 0) FIG_font_s = (10); term->xmax = (5 * (1200)); term->ymax = (3 * (1200)); term->v_tic = (5*(1200)/80); term->h_tic = (5*(1200)/80); FIG_xoff = ((1200)/4); FIG_yoff = ((1200)/4); } else { if (FIG_font_s == 0) FIG_font_s = (16); term->xmax = (8 * (1200)); term->ymax = (5 * (1200)); term->v_tic = (7*(1200)/80); term->h_tic = (7*(1200)/80); FIG_xoff = ((1200)/2); FIG_yoff = ((1200)/2); } if (FIG_portrait) { tmax_t = term->xmax; term->xmax = term->ymax; term->ymax = tmax_t; } if (xsize_t > 0. && ysize_t > 0.) { if (FIG_inches) { term->xmax = (unsigned int) (xsize_t * (1200)); term->ymax = (unsigned int) (ysize_t * (1200)); } else { term->xmax = (unsigned int) (xsize_t / 2.54 * (1200)); term->ymax = (unsigned int) (ysize_t / 2.54 * (1200)); } } term->v_char = ((FIG_font_s)*(1200)/72*3/4); term->h_char = (((FIG_font_s)*(1200)/72*3/4)*6/10); FIG_thickness = FIG_default_thickness; if (parse_error) { int_error(options_list, c_token); } } static void FIG_init() { FIG_posx = FIG_posy = 0; FIG_polyvec_stat = FIG_poly_new; FIG_linetype(-1); FIG_justify_text(LEFT); FIG_text_angle(0); FIG_line.tagged = (-1); FIG_line.distrib = (-1); FIG_line.type = 1; FIG_line.style = 0; FIG_line.thickness = FIG_thickness; FIG_line.fill_style = -1; FIG_line.depth = FIG_linedepth; FIG_line.pen_style = 0; FIG_line.for_arrow = ((void *)0); FIG_line.back_arrow = ((void *)0); FIG_line.cap_style = 0; FIG_line.join_style = 0; FIG_line.style_val = 0.0; FIG_line.radius = 0; FIG_line.pic = ((void *)0); FIG_line.next = ((void *)0); fprintf(gpoutfile, "%s\n%s\n%s\n%s\n%d %d\n", "#FIG 3.1", (FIG_portrait?"Portrait":"Landscape"), "Center", (FIG_inches?"Inches":"Metric"), (1200), 2); } static void FIG_graphics() { FIG_posx = FIG_posy = 0; FIG_polyvec_stat = FIG_poly_new; } static void FIG_text() { FIG_poly_clean(FIG_polyvec_stat); FIG_posx = FIG_posy = 0; fflush(gpoutfile); } # 473 "term/fig.trm" static void FIG_linetype(linetype) int linetype; { int last_FIG_type = FIG_type; int last_FIG_spacing = FIG_spacing; int last_FIG_color = FIG_color; int last_FIG_depth = FIG_linedepth; int last_FIG_thickness = FIG_thickness; FIG_linedepth = FIG_depth; FIG_thickness = FIG_current_linewidth * FIG_default_thickness; if (FIG_thickness < 1) FIG_thickness = 1; FIG_color = (-1); if (linetype < -2) linetype = -2; switch (linetype) { case 0: case -2:{ FIG_type = 0; FIG_spacing = 0.0; if (FIG_use_color) FIG_color = 0; break; } case -1:{ FIG_type = 2; FIG_spacing = 4.0; if (FIG_use_color) FIG_color = 0; break; } default:{ FIG_linedepth = FIG_depth + linetype / 1000; linetype %= 1000; if ((FIG_thickness = linetype / 100) == 0) FIG_thickness = FIG_current_linewidth * FIG_default_thickness; if (FIG_thickness < 1) FIG_thickness = 1; linetype %= 100; if (FIG_use_color) { FIG_type = (linetype >= 7); FIG_color = linetype % 7; FIG_spacing = (linetype / 7) * 3; } else { FIG_type = linetype % 2 + 1; FIG_spacing = (linetype + 1) / 2 * 3; } break; } } if (FIG_type != last_FIG_type || FIG_spacing != last_FIG_spacing || FIG_color != last_FIG_color || FIG_linedepth != last_FIG_depth || FIG_thickness != last_FIG_thickness) FIG_poly_clean(FIG_polyvec_stat); } static void FIG_move(x, y) unsigned int x, y; { int last_FIG_posx = FIG_posx; int last_FIG_posy = FIG_posy; FIG_posx = x; FIG_posy = y; if (FIG_posx != last_FIG_posx || FIG_posy != last_FIG_posy) FIG_poly_clean(FIG_polyvec_stat); } static void FIG_vector(ux, uy) unsigned int ux, uy; { int x = ux, y = uy; if (FIG_polyvec_stat != FIG_poly_part) { FIG_line.pen_color = FIG_color; FIG_line.fill_color = FIG_color; FIG_line.style = FIG_type; FIG_line.style_val = FIG_spacing; FIG_line.depth = FIG_linedepth; FIG_line.thickness = FIG_thickness; FIG_poly_vec_cnt = 0; FIG_points = (F_point *) gp_realloc(FIG_points, sizeof(F_point), "FIG_points"); FIG_points[FIG_poly_vec_cnt].x = FIG_xoff + FIG_posx; FIG_points[FIG_poly_vec_cnt].y = term->ymax + FIG_yoff - FIG_posy; FIG_poly_vec_cnt = 1; FIG_polyvec_stat = FIG_poly_part; } FIG_points = (F_point *) gp_realloc(FIG_points, (FIG_poly_vec_cnt + 1) * sizeof(F_point), "FIG_points"); FIG_points[FIG_poly_vec_cnt].x = FIG_xoff + x; FIG_points[FIG_poly_vec_cnt].y = term->ymax + FIG_yoff - y; FIG_poly_vec_cnt++; if (FIG_poly_vec_cnt > FIG_poly_vec_max) FIG_poly_clean(FIG_polyvec_stat); FIG_posx = x; FIG_posy = y; } static void FIG_arrow(sx, sy, ex, ey, head) unsigned int sx, sy; unsigned int ex, ey; TBOOLEAN head; { FIG_poly_clean(FIG_polyvec_stat); fprintf(gpoutfile, "%d %d %d %d %d %d %d %d %d %9.3f %d %d %d %d %d %d\n", 2, FIG_line.type, FIG_line.style, FIG_line.thickness, FIG_line.pen_color, FIG_line.fill_color, FIG_line.depth, FIG_line.pen_style, FIG_line.fill_style, FIG_line.style_val, FIG_line.join_style, FIG_line.cap_style, FIG_line.radius, head ? 1 : 0, 0, 2); if (head) fprintf(gpoutfile, "%d %d %.3f %.3f %.3f\n", 0, 0, 1.0, (double) (term->h_tic / 2 + 1), (double) term->h_tic); fprintf(gpoutfile, "%d %d %d %d\n", FIG_xoff + sx, FIG_yoff + term->ymax - sy, FIG_yoff + ex, FIG_yoff + term->ymax - ey); FIG_posx = ex; FIG_posy = ey; } static void FIG_put_text(x, y, str) unsigned int x, y; char *str; { if (strlen(str) == 0) return; FIG_poly_clean(FIG_polyvec_stat); y -= term->v_char / 2; fprintf(gpoutfile, "%d %d %d %d %d %d %6.3f %6.3f %d %6.3f %6.3f %d %d %s\\001\n", 4, FIG_justify, FIG_color, 0, (-1), (0), (float) FIG_font_s, FIG_angle, 2, (float) term->v_char, (float) term->h_char * strlen(str), FIG_xoff + x, term->ymax + FIG_yoff - y, str); } static int FIG_justify_text(mode) enum JUSTIFY mode; { switch (mode) { case LEFT: FIG_justify = 0; break; case CENTRE: FIG_justify = 1; break; case RIGHT: FIG_justify = 2; break; default: FIG_justify = 0; return (0); break; } return (1); } static int FIG_text_angle(ang) int ang; { if (ang) FIG_angle = 3.141592653589793 / 2.0; else FIG_angle = 0.0; return (1); } static void FIG_lpoint(x, y, number) unsigned int x, y; int number; { FIG_type = 0; if (number % 100 >= 49 && number % 100 < 99) { int r, d, h, xpc, ypc; int line_color, fill_color, fill_style; int cnum, tnum, color, depth; FIG_poly_clean(FIG_polyvec_stat); depth = FIG_linedepth - 1; if (number > 1000) depth = FIG_depth + number / 1000 - 1; number %= 1000; if (depth < 0) depth = 0; if (number < 100) color = FIG_color; else if (FIG_use_color) color = number / 100 - 1; else if (number / 100 >= 7) color = 7; else color = (-1); number %= 100; cnum = (number + 1) % 10; tnum = (number - 49) / 10; if (cnum < 5) line_color = (FIG_use_color ? 0 : (-1)); else line_color = FIG_color; fill_color = color; if (cnum == 0 || cnum == 5) fill_style = -1; else fill_style = (cnum % 5) * 5; xpc = FIG_xoff + x; ypc = term->ymax + FIG_yoff - y; if (tnum == 0) { r = FIG_current_pointsize * term->v_char / 4 + 1; fprintf(gpoutfile, "1 3 %d %d %d %d %d %d %d %6.3f 1 0.000 %d %d %d %d %d %d %d %d\n", FIG_type, FIG_thickness, line_color, fill_color, depth, 0, fill_style, FIG_spacing, xpc, ypc, r, r, xpc, ypc, xpc, ypc - r); } else { fprintf(gpoutfile, "2 3 %d %d %d %d %d %d %d %6.3f 0 0 0 0 0 ", FIG_type, FIG_thickness, line_color, fill_color, depth, 0, fill_style, FIG_spacing); if (tnum == 1) { d = FIG_current_pointsize * term->v_char / 4 + 1; fprintf(gpoutfile, "5\n\t%d %d %d %d %d %d %d %d %d %d\n", xpc - d, ypc - d, xpc - d, ypc + d, xpc + d, ypc + d, xpc + d, ypc - d, xpc - d, ypc - d); } else if (tnum == 2) { d = FIG_current_pointsize * term->v_char / 3 + 1; fprintf(gpoutfile, "5\n\t%d %d %d %d %d %d %d %d %d %d\n", xpc - d, ypc, xpc, ypc + d, xpc + d, ypc, xpc, ypc - d, xpc - d, ypc); } else if (tnum == 3) { d = FIG_current_pointsize * term->v_char / 3 + 1; h = d * 4 / 7; fprintf(gpoutfile, "4\n\t%d %d %d %d %d %d %d %d\n", xpc - d, ypc + h, xpc, ypc - 2 * h, xpc + d, ypc + h, xpc - d, ypc + h); } else if (tnum == 4) { d = FIG_current_pointsize * term->v_char / 3 + 1; h = d * 4 / 7; fprintf(gpoutfile, "4\n\t%d %d %d %d %d %d %d %d\n", xpc - d, ypc - h, xpc, ypc + 2 * h, xpc + d, ypc - h, xpc - d, ypc - h); } } } else do_point(x, y, number); } static void FIG_pointsize(arg_pointsize) double arg_pointsize; { FIG_current_pointsize = arg_pointsize; do_pointsize(arg_pointsize * FIG_font_s / (double) (10)); } static void FIG_linewidth(linewidth) double linewidth; { FIG_current_linewidth = linewidth; } static void FIG_reset() { FIG_poly_clean(FIG_polyvec_stat); FIG_posx = FIG_posy = 0; fflush(gpoutfile); } # 283 "term.h" 2 # 294 "term.h" # 1 "term/hp26.trm" 1 # 55 "term/hp26.trm" # 1 "term/driver.h" 1 # 56 "term/hp26.trm" 2 static void HP26_vector (unsigned int x, unsigned int y); static void HP26_move (unsigned int x, unsigned int y); static void HP26_init (void); static void HP26_graphics (void); static void HP26_text (void); static void HP26_reset (void); static int HP26_text_angle (int ang); static void HP26_put_text (unsigned int x, unsigned int y, char *str); static void HP26_linetype (int linetype); static void HP26_line_and_point (unsigned int x, unsigned int y, int number); # 90 "term/hp26.trm" void HP26_do_point (unsigned int x, unsigned int y, int number); int compact_slope (int xp[], int yp[], int isa_move[], int *sz, double delta); int compact_int (int xp[], int yp[], int isa_move[], int *size); struct _HP26_Buffer_Node *BN_create (int index, int size, int linetype); void BN_delete (struct _HP26_Buffer_Node * the_node); int HP26_flush (struct _HP26_Buffer_Node * the_buff); void HP26_handle_overflow (void); # 1 "term/compact.c" 1 # 44 "term/compact.c" int compact_slope(xp, yp, isa_move, sz, delta) int xp[], yp[], isa_move[]; int *sz; double delta; { int dx, dy, old_size, new_index, i, start; float slope, old_slope; old_size = *sz; new_index = 0; start = 0; if (xp[1] != xp[0]) old_slope = (float) (yp[1] - yp[0]) / (float) (xp[1] - xp[0]); else old_slope = (float) (yp[1] - yp[0]) / (float) (0.00001 + xp[1] - xp[0]); for (i = 2; i < old_size; i++) { dx = xp[i] - xp[i - 1]; dy = yp[i] - yp[i - 1]; if (dx != 0) slope = (float) dy / (float) dx; else slope = (float) dy / ((float) dx + 0.00001); if ((((slope - old_slope) >= 0 ? (slope - old_slope) : -(slope - old_slope)) > delta) || (isa_move[i])) { xp[new_index] = xp[start]; yp[new_index] = yp[start]; isa_move[new_index] = isa_move[start]; new_index++; if (start != i - 1) { xp[new_index] = xp[i - 1]; yp[new_index] = yp[i - 1]; isa_move[new_index] = isa_move[i - 1]; new_index++; } start = i; old_slope = slope; } } xp[new_index] = xp[old_size - 1]; yp[new_index] = yp[old_size - 1]; isa_move[new_index] = isa_move[old_size - 1]; new_index++; *sz = new_index; return (old_size - *sz); } int compact_int(xp, yp, isa_move, size) int xp[], yp[], isa_move[], *size; { int dx, dy, old_dx, old_dy, start, index, i, old_size; start = index = 0; old_dx = xp[1] - xp[0]; old_dy = yp[1] - yp[0]; for (i = 2; i < *size; i++) { dx = xp[i] - xp[i - 1]; dy = yp[i] - yp[i - 1]; if ((((dx - old_dx) >= 0 ? (dx - old_dx) : -(dx - old_dx)) + ((dy - old_dy) >= 0 ? (dy - old_dy) : -(dy - old_dy)) != 0) || (isa_move[i])) { xp[index] = xp[start]; yp[index] = yp[start]; isa_move[index] = isa_move[start]; index++; if (start != i - 1) { xp[index] = xp[i - 1]; yp[index] = yp[i - 1]; isa_move[index] = isa_move[i - 1]; index++; } start = i; old_dx = dx; old_dy = dy; } } xp[index] = xp[*size - 1]; yp[index] = yp[*size - 1]; isa_move[index] = isa_move[*size - 1]; index++; old_size = *size; *size = index; return (old_size - *size); } # 99 "term/hp26.trm" 2 typedef struct _HP26_Buffer_Node { int index; int size; int next; int linetype; int *x; int *y; TBOOLEAN *isa_move; } HP26_Buffer_Node; HP26_Buffer_Node *BN_create(index, size, linetype) int index, size, linetype; { HP26_Buffer_Node *the_node; the_node = (HP26_Buffer_Node *) malloc(sizeof(HP26_Buffer_Node)); the_node->index = index; the_node->linetype = linetype; the_node->size = size; the_node->next = 0; the_node->x = (int *) calloc(the_node->size, sizeof(int)); the_node->y = (int *) calloc(the_node->size, sizeof(int)); the_node->isa_move = (TBOOLEAN *) calloc(the_node->size, sizeof(TBOOLEAN)); if (the_node->x == ((void *)0) || the_node->y == ((void *)0) || the_node->isa_move == ((void *)0)) return (((void *)0)); else return (the_node); } void BN_delete(the_node) HP26_Buffer_Node *the_node; { free(the_node->x); free(the_node->y); free(the_node->isa_move); free(the_node); } HP26_Buffer_Node *HP26_gnu_map[12]; HP26_Buffer_Node *HP26_buff; int HP26_pen_x; int HP26_pen_y; int HP26_angle; int HP26_cursor_x; int HP26_cursor_y; TBOOLEAN HP26_in_text; int HP26_linetype_current; int HP26_reduction_int; int HP26_reduction_slope; int HP26_overflows; int HP26_nop_move; int HP26_nop_vect; int HP26_nop_line; # 176 "term/hp26.trm" char HP26_bin_short_table[32] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/' }; # 191 "term/hp26.trm" char HP26_bin_table[32] = { ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?' }; # 215 "term/hp26.trm" int HP26_flush(the_buff) HP26_Buffer_Node *the_buff; { int i, delta_x, delta_y, half_dx, half_dy; int *buff_x, *buff_y; TBOOLEAN *isa_move; TBOOLEAN bin_short; if (the_buff->next == 0) return (0); buff_x = the_buff->x; buff_y = the_buff->y; isa_move = the_buff->isa_move; if (HP26_in_text) { fputs("\033*dT", gpoutfile); HP26_in_text = 0; } if (HP26_linetype_current != the_buff->linetype && (the_buff->next > 1 || !isa_move[0])) { fprintf(gpoutfile, "\033*m%dB", the_buff->linetype); HP26_linetype_current = the_buff->linetype; } if (the_buff->next > 30 && the_buff->linetype != 11) { HP26_reduction_slope += compact_slope(buff_x, buff_y, isa_move, &(the_buff->next), 0.1); } fputs("\033*p", gpoutfile); delta_x = buff_x[0] - HP26_pen_x; delta_y = buff_y[0] - HP26_pen_y; if (((delta_x>-17)&&(delta_y>-17)&&(delta_x<16)&&(delta_y<16))) { fputc('j', gpoutfile); bin_short = 1; } else { fputc('i', gpoutfile); bin_short = 0; } for (i = 0; i < the_buff->next; i++) { if (i > 0) { delta_x = buff_x[i] - buff_x[i - 1]; delta_y = buff_y[i] - buff_y[i - 1]; } if ((delta_x == 0) && (delta_y == 0)) { if (i > 0 && !isa_move[i - 1] && !isa_move[i]) { HP26_nop_vect++; continue; } else if (isa_move[i]) { HP26_nop_move++; continue; } } else if (i > 0 && i + 1 < the_buff->next && isa_move[i] && isa_move[i + 1]) { HP26_nop_move++; continue; } else if (!((delta_x>-17)&&(delta_y>-17)&&(delta_x<16)&&(delta_y<16)) && i > 0 && i + 2 < the_buff->next && isa_move[i] && !isa_move[i + 1] && isa_move[i + 2] && ((buff_x[i + 1] - buff_x[i - 1]>-17)&&(buff_y[i + 1] - buff_y[i - 1]>-17)&&(buff_x[i + 1] - buff_x[i - 1]<16)&&(buff_y[i + 1] - buff_y[i - 1]<16))) { buff_x[i] ^= buff_x[i + 1]; buff_x[i + 1] ^= buff_x[i]; buff_x[i] ^= buff_x[i + 1];; buff_y[i] ^= buff_y[i + 1]; buff_y[i + 1] ^= buff_y[i]; buff_y[i] ^= buff_y[i + 1];; delta_x = buff_x[i] - buff_x[i - 1]; delta_y = buff_y[i] - buff_y[i - 1]; } if (((delta_x>-17)&&(delta_y>-17)&&(delta_x<16)&&(delta_y<16))) { if (!bin_short) { fputc('j', gpoutfile); bin_short = 1; } if (isa_move[i]) fputc('a', gpoutfile); fputc((HP26_bin_short_table[delta_x+16]), gpoutfile); fputc((HP26_bin_short_table[delta_y+16]), gpoutfile); } else { half_dx = (delta_x + (delta_x > 0 ? 1 : -1)) / 2; half_dy = (delta_y + (delta_y > 0 ? 1 : -1)) / 2; if (bin_short && ((half_dx>-17)&&(half_dy>-17)&&(half_dx<16)&&(half_dy<16))) { if (isa_move[i]) fputc('a', gpoutfile); fputc((HP26_bin_short_table[half_dx+16]), gpoutfile); fputc((HP26_bin_short_table[half_dy+16]), gpoutfile); if (isa_move[i]) fputc('a', gpoutfile); fputc((HP26_bin_short_table[delta_x - half_dx+16]), gpoutfile); fputc((HP26_bin_short_table[delta_y - half_dy+16]), gpoutfile); } else { if (bin_short) { bin_short = 0; fputc('i', gpoutfile); } if (isa_move[i]) fputc('a', gpoutfile); fputc((HP26_bin_table[buff_x[i]>>5]), gpoutfile); fputc((HP26_bin_table[buff_x[i] & 31]), gpoutfile); fputc((HP26_bin_table[buff_y[i]>>5]), gpoutfile); fputc((HP26_bin_table[buff_y[i] & 31]), gpoutfile); } } } fputc('Z', gpoutfile); HP26_pen_x = buff_x[the_buff->next - 1]; HP26_pen_y = buff_y[the_buff->next - 1]; the_buff->next = 0; return (1); } void HP26_handle_overflow() { HP26_Buffer_Node *bigger, *old; int x, y; x = (HP26_buff->x)[HP26_buff->next - 1]; y = (HP26_buff->y)[HP26_buff->next - 1]; HP26_flush(HP26_buff); bigger = BN_create(HP26_buff->index, HP26_buff->size * 2, HP26_buff->linetype); if (bigger != ((void *)0)) { old = HP26_buff; HP26_gnu_map[bigger->index] = bigger; if (bigger->index == 0) { HP26_gnu_map[1] = bigger; HP26_gnu_map[3] = bigger; } HP26_buff = bigger; BN_delete(old); } (HP26_buff->x)[0] = x; (HP26_buff->y)[0] = y; (HP26_buff->isa_move)[0] = 1; HP26_buff->next = 1; HP26_overflows++; } static void HP26_vector(x, y) unsigned int x, y; { if (HP26_buff->next > 2 && x == (HP26_buff->x)[HP26_buff->next - 1] && y == (HP26_buff->y)[HP26_buff->next - 1] && !(HP26_buff->isa_move)[HP26_buff->next - 1]) { HP26_nop_vect++; return; } if (HP26_buff->next == HP26_buff->size) HP26_handle_overflow(); (HP26_buff->x)[HP26_buff->next] = x; (HP26_buff->y)[HP26_buff->next] = y; (HP26_buff->isa_move)[HP26_buff->next] = 0; HP26_buff->next++; } static void HP26_move(x, y) unsigned int x, y; { if (HP26_buff->next > 0) { if (((HP26_buff->x)[HP26_buff->next - 1] == x) && ((HP26_buff->y)[HP26_buff->next - 1] == y)) { HP26_nop_move++; return; } else if ((HP26_buff->isa_move)[HP26_buff->next - 1]) { (HP26_buff->x)[HP26_buff->next - 1] = x; (HP26_buff->y)[HP26_buff->next - 1] = y; HP26_nop_move++; return; } } if (HP26_buff->next == HP26_buff->size) HP26_handle_overflow(); (HP26_buff->x)[HP26_buff->next] = x; (HP26_buff->y)[HP26_buff->next] = y; (HP26_buff->isa_move)[HP26_buff->next] = 1; HP26_buff->next++; return; } static void HP26_init() { HP26_gnu_map[-2 + 2] = BN_create(0, 2048, 7); HP26_gnu_map[-1 + 2] = HP26_gnu_map[-2 + 2]; HP26_gnu_map[0 + 2] = BN_create(2, 3072, 1); HP26_gnu_map[1 + 2] = HP26_gnu_map[-2 + 2]; HP26_gnu_map[2 + 2] = BN_create(4, 1024, 5); HP26_gnu_map[3 + 2] = BN_create(5, 256, 6); HP26_gnu_map[4 + 2] = BN_create(6, 256, 8); HP26_gnu_map[5 + 2] = BN_create(7, 128, 9); HP26_gnu_map[6 + 2] = BN_create(8, 128, 10); HP26_gnu_map[7 + 2] = BN_create(9, 64, 6); HP26_gnu_map[8 + 2] = BN_create(10, 64, 4); HP26_gnu_map[9 + 2] = BN_create(11, 512, 11); HP26_buff = HP26_gnu_map[10]; HP26_linetype_current = 0; HP26_angle = 1; fputs("\033*mp1m2a2Q", gpoutfile); fflush(gpoutfile); } static void HP26_graphics() { fputs("\033*daflsC", gpoutfile); HP26_pen_x = HP26_pen_y = -200; HP26_cursor_x = HP26_cursor_y = 800; HP26_in_text = 1; HP26_reduction_int = 0; HP26_reduction_slope = 0; HP26_nop_move = 0; HP26_nop_vect = 0; HP26_nop_line = 0; HP26_overflows = 0; } static void HP26_text() { int i, j, curr; for (i = 0; i < 12; i++) if ((HP26_gnu_map[i])->linetype == HP26_linetype_current) HP26_flush(HP26_gnu_map[i]); for (i = 0; i < 12; i++) { HP26_flush(HP26_gnu_map[i]); curr = HP26_gnu_map[i]->linetype; for (j = 0; j < 12; j++) if ((HP26_gnu_map[j])->linetype == curr) HP26_flush(HP26_gnu_map[j]); } fputs("\033*deT", gpoutfile); fflush(gpoutfile); # 506 "term/hp26.trm" } static void HP26_reset() { int i; for (i = 2; i < 12; i++) BN_delete(HP26_gnu_map[i]); } static int HP26_text_angle(ang) int ang; { HP26_angle = ang + 1; fprintf(gpoutfile, "\033*m%dN", HP26_angle); return (1); } static void HP26_put_text(x, y, str) unsigned int x, y; char *str; { char abs_str[10], rel_str[10]; if (!strlen(str)) return; else { fputs("\033*d", gpoutfile); if (!HP26_in_text) { fputc('s', gpoutfile); HP26_in_text = 1; } sprintf(rel_str, "%d,%dP", x - HP26_cursor_x, y - HP26_cursor_y); sprintf(abs_str, "%d,%dO", x, y); if (strlen(rel_str) < strlen(abs_str)) fputs(rel_str, gpoutfile); else fputs(abs_str, gpoutfile); fputs(str, gpoutfile); HP26_pen_x = HP26_cursor_x = x; HP26_pen_y = HP26_cursor_y = y; } # 557 "term/hp26.trm" return; } static void HP26_linetype(linetype) int linetype; { if (linetype > 8) linetype %= 9; linetype += 2; if (HP26_gnu_map[linetype] == HP26_buff) { HP26_nop_line++; return; } HP26_buff = HP26_gnu_map[linetype]; } static void HP26_line_and_point(x, y, number) unsigned int x, y; int number; { int line_save, not_solid; line_save = 0; not_solid = (HP26_buff->linetype != 1); if (not_solid) { line_save = HP26_buff->linetype; HP26_linetype(0); } HP26_do_point(x, y, number); if (not_solid) HP26_linetype(line_save); } void HP26_do_point(x, y, number) unsigned int x, y; int number; { int htic, vtic; HP26_Buffer_Node *tmp; vtic = 5 / 2; htic = 5 / 2; if (number < 0) { tmp = HP26_buff; HP26_buff = HP26_gnu_map[11]; HP26_vector(x, y); HP26_buff = tmp; } switch (number % 9) { case 0: HP26_move(x - htic, y - vtic); HP26_vector(x, y + vtic); HP26_vector(x + htic, y - vtic); HP26_vector(x - htic, y - vtic); break; case 1: HP26_move(x - htic, y + vtic); HP26_vector(x, y - vtic); HP26_vector(x + htic, y + vtic); HP26_vector(x - htic, y + vtic); break; case 2: HP26_move(x - htic, y); HP26_vector(x + htic, y + vtic); HP26_vector(x + htic, y - vtic); HP26_vector(x - htic, y); break; case 3: HP26_move(x + htic, y); HP26_vector(x - htic, y + vtic); HP26_vector(x - htic, y - vtic); HP26_vector(x + htic, y); break; case 4: HP26_move(x - htic, y - vtic); HP26_vector(x - htic, y + vtic); HP26_vector(x + htic, y + vtic); HP26_vector(x + htic, y - vtic); HP26_vector(x - htic, y - vtic); break; case 5: HP26_move(x, y + vtic); HP26_vector(x, y - vtic); HP26_move(x - htic, y); HP26_vector(x + htic, y); break; case 6: HP26_move(x + htic, y + vtic); HP26_vector(x - htic, y - vtic); HP26_move(x - htic, y + vtic); HP26_vector(x + htic, y - vtic); break; default: HP26_move(x, y - vtic); HP26_vector(x - htic, y); HP26_vector(x, y + vtic); HP26_vector(x + htic, y); HP26_vector(x, y - vtic); break; } } # 295 "term.h" 2 # 1 "term/hp2648.trm" 1 # 55 "term/hp2648.trm" # 1 "term/driver.h" 1 # 56 "term/hp2648.trm" 2 static void HP2648init (void); static void HP2648graphics (void); static void HP2648text (void); static void HP2648linetype (int linetype); static void HP2648move (unsigned int x, unsigned int y); static void HP2648vector (unsigned int x, unsigned int y); static void HP2648put_text (unsigned int x, unsigned int y, char *str); static int HP2648_text_angle (int ang); static void HP2648reset (void); # 87 "term/hp2648.trm" static void HP2648init() { fprintf(gpoutfile, "\033*m1m1n136,1cZ"); } static void HP2648graphics() { fprintf(gpoutfile, "\033*dacZ"); } static void HP2648text() { } static void HP2648linetype(linetype) int linetype; { static int hpline[] = { 1, 7, 1, 4, 5, 6, 8, 9, 10, 7, 2 }; fprintf(gpoutfile, "\033*m%dbZ", hpline[(linetype + 2) % 11]); } static void HP2648move(x, y) unsigned int x, y; { fprintf(gpoutfile, "\033*paf%d,%dZ", x, y); } static void HP2648vector(x, y) unsigned int x, y; { fprintf(gpoutfile, "\033*pbf%d,%dZ", x, y); } static void HP2648put_text(x, y, str) unsigned int x, y; char *str; { HP2648move(x, y - 12 / 2 + 1); fprintf(gpoutfile, "\033*l%s\n", str); } static int HP2648_text_angle(ang) int ang; { fprintf(gpoutfile, "\033*m%dnZ\n", ang + 1); return 1; } static void HP2648reset() { } # 298 "term.h" 2 # 1 "term/hp500c.trm" 1 # 69 "term/hp500c.trm" # 1 "term/driver.h" 1 # 70 "term/hp500c.trm" 2 static void HP500Coptions (void); static void HP500Cinit (void); static void HP500Creset (void); static void HP500Clinetype (int linetype); static void HP500Cgraphics (void); static void HP500Ctext (void); # 125 "term/hp500c.trm" static int HPcompress (unsigned char *op, unsigned char *oe, unsigned char *cp); static unsigned char HPcomplement (int c); static int HPcompress_to_TIFF (unsigned char *op, unsigned char *oe, unsigned char *cp); static int HPnocompress (unsigned char *op, unsigned char *oe, unsigned char *cp); static int hpdj_dpp = 4; static int HP_COMP_MODE = 0; static unsigned int b_300ppi_pattern[] = { 0xffff, 0x1111, 0xffff, 0x3333, 0x0f0f, 0x3f3f, 0x0fff, 0x00ff, 0x33ff }; static void HP500Coptions() { char opt[6]; while (!(c_token >= num_tokens || equals(c_token,";"))) { if (token[c_token].length > 4) int_error("expecting dots per inch size 75, 100, 150 or 300 and/or compression method", c_token); capture(opt, c_token, c_token, 6); if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("75") && (__s1_len = strlen (opt), __s2_len = strlen ("75"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("75"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("75") && ((size_t)(const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("75"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__co! nst unsigned char *) (__const char *) ("75"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("75"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("75"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("75"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("75") && ((size_t)(! const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) && (__s2_len = strlen ("75"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("75"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("75"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("75"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("75"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (opt); register int __resu! lt = __s1[0] - ((__const unsigned char *) (__const char *) ("75"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("75"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("75"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("75"))[3]); } } __result; }))) : strcmp (opt, "75")))); })) { hpdj_dpp = 4; HP_COMP_MODE = 0; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("100") && (__s1_len = strlen (opt), __s2_len = strlen ("100"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("100"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("100") && ((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("100"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (o! pt))[1] - ((__const unsigned char *) (__const char *) ("100"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("100"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("100"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("100"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ! ("100") && ((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) && (__s2_len = strlen ("100"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("100"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("100"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("100"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("100"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *! ) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("100"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("100"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("100"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("100"))[3]); } } __result; }))) : strcmp (opt, "100")))); })) { hpdj_dpp = 3; HP_COMP_MODE = 0; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("150") && (__s1_len = strlen (opt), __s2_len = strlen ("150"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("150"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("150") && ((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("150"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (o! pt))[1] - ((__const unsigned char *) (__const char *) ("150"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("150"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("150"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("150"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ! ("150") && ((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) && (__s2_len = strlen ("150"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("150"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("150"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("150"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("150"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *! ) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("150"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("150"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("150"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("150"))[3]); } } __result; }))) : strcmp (opt, "150")))); })) { hpdj_dpp = 2; HP_COMP_MODE = 0; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("300") && (__s1_len = strlen (opt), __s2_len = strlen ("300"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("300"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("300") && ((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("300"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (o! pt))[1] - ((__const unsigned char *) (__const char *) ("300"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("300"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("300"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("300"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ! ("300") && ((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) && (__s2_len = strlen ("300"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("300"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("300"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("300"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("300"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *! ) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("300"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("300"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("300"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("300"))[3]); } } __result; }))) : strcmp (opt, "300")))); })) { hpdj_dpp = 1; HP_COMP_MODE = 0; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("rle") && (__s1_len = strlen (opt), __s2_len = strlen ("rle"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("rle") + 1) - (size_t)(const void *)("rle") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("rle"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("rle") && ((size_t)(const void *)(("rle") + 1) - (size_t)(const void *)("rle") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("rle"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (o! pt))[1] - ((__const unsigned char *) (__const char *) ("rle"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("rle"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("rle"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("rle"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ! ("rle") && ((size_t)(const void *)(("rle") + 1) - (size_t)(const void *)("rle") == 1) && (__s2_len = strlen ("rle"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("rle"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("rle"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("rle"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("rle"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *! ) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("rle"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("rle"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("rle"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("rle"))[3]); } } __result; }))) : strcmp (opt, "rle")))); })) { HP_COMP_MODE = 1; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("tiff") && (__s1_len = strlen (opt), __s2_len = strlen ("tiff"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("tiff") + 1) - (size_t)(const void *)("tiff") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("tiff"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("tiff") && ((size_t)(const void *)(("tiff") + 1) - (size_t)(const void *)("tiff") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("tiff"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const c! har *) (opt))[1] - ((__const unsigned char *) (__const char *) ("tiff"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("tiff"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("tiff"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("tiff"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builti! n_constant_p ("tiff") && ((size_t)(const void *)(("tiff") + 1) - (size_t)(const void *)("tiff") == 1) && (__s2_len = strlen ("tiff"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("tiff"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("tiff"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("tiff"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("tiff"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned ch! ar *) (__const char *) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("tiff"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("tiff"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("tiff"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("tiff"))[3]); } } __result; }))) : strcmp (opt, "tiff")))); })) { HP_COMP_MODE = 2; } c_token++; } term->xmax = (8*(unsigned int)(xsize*1920/(hpdj_dpp)/8.0+0.9)); term->ymax = (8*(unsigned int)(ysize*1920/(hpdj_dpp)/8.0+0.9)); switch (hpdj_dpp) { case 1: (__extension__ (__builtin_constant_p ("300") ? (((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) && strlen ("300") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("300"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("300"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("300"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("300"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("300"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("300"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("300"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("300"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("300"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("300"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("300"))[4 + 1]) << 8 | ((__const unsigned ch! ar *) (__const char *) ("300"))[4]), strlen ("300") + 1) : (char *) memcpy (term_options, "300", strlen ("300") + 1)) : strcpy (term_options, "300"))); term->v_tic = 15; term->h_tic = 15; break; case 2: (__extension__ (__builtin_constant_p ("150") ? (((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) && strlen ("150") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("150"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("150"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("150"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("150"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("150"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("150"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("150"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("150"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("150"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("150"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("150"))[4 + 1]) << 8 | ((__const unsigned ch! ar *) (__const char *) ("150"))[4]), strlen ("150") + 1) : (char *) memcpy (term_options, "150", strlen ("150") + 1)) : strcpy (term_options, "150"))); term->v_tic = 8; term->h_tic = 8; break; case 3: (__extension__ (__builtin_constant_p ("100") ? (((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) && strlen ("100") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("100"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("100"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("100"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("100"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("100"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("100"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("100"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("100"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("100"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("100"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("100"))[4 + 1]) << 8 | ((__const unsigned ch! ar *) (__const char *) ("100"))[4]), strlen ("100") + 1) : (char *) memcpy (term_options, "100", strlen ("100") + 1)) : strcpy (term_options, "100"))); term->v_tic = 6; term->h_tic = 6; break; case 4: (__extension__ (__builtin_constant_p ("75") ? (((size_t)(const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) && strlen ("75") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("75"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("75"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("75"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("75"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("75"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("75"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("75"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("75"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("75"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("75"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("75"))[4 + 1]) << 8 | ((__const unsigned char *) (__const ! char *) ("75"))[4]), strlen ("75") + 1) : (char *) memcpy (term_options, "75", strlen ("75") + 1)) : strcpy (term_options, "75"))); term->v_tic = 5; term->h_tic = 5; break; } switch (HP_COMP_MODE) { case 0: strcat(term_options, " no comp"); break; case 1: strcat(term_options, " RLE"); break; case 2: strcat(term_options, " TIFF"); break; case 3: strcat(term_options, " Delta Row"); break; } } static void HP500Cinit() { switch (hpdj_dpp) { case 1: b_charsize(2); term->v_char = 31; term->h_char = 19; break; case 2: b_charsize(2); term->v_char = 31; term->h_char = 19; break; case 3: b_charsize(1); term->v_char = 21; term->h_char = 13; break; case 4: b_charsize(0); term->v_char = 11; term->h_char = 7; break; } } static void HP500Creset() { } static void HP500Clinetype(linetype) int linetype; { if (linetype < 0) linetype = 7; else if (linetype >= 8) { linetype %= 8; } switch (linetype) { case 0: linetype = 6; break; case 1: linetype = 5; break; case 2: linetype = 3; break; case 3: linetype = 2; break; case 4: linetype = 1; break; case 5: linetype = 4; break; case 6: linetype = 7; } b_setvalue(linetype); } # 303 "term/hp500c.trm" static void HP500Cgraphics() { b_makebitmap((8*(unsigned int)(ysize*1920/(hpdj_dpp)/8.0+0.9)), (8*(unsigned int)(xsize*1920/(hpdj_dpp)/8.0+0.9)), 3); b_rastermode = 1; } static int HPcompress(op, oe, cp) unsigned char *op, *oe, *cp; { unsigned char *ce = cp; while (op < oe) { unsigned char prevchar; unsigned char count; prevchar = *op; count = 1; while (++op < oe && *op == prevchar && count < 255) { count++; } *ce++ = --count; *ce++ = prevchar; } *ce = 0; return ce - cp; } static unsigned char HPcomplement(c) int c; { return (unsigned char) (256 - c); } static int HPcompress_to_TIFF(op, oe, cp) unsigned char *op; unsigned char *oe; unsigned char *cp; { unsigned char *countposition; unsigned char *ce = cp; while (op < oe) { unsigned char prevchar; unsigned char count; prevchar = *op; count = 1; while (++op < oe && *op == prevchar && count < 128) { count++; } *ce = HPcomplement(count - 1); countposition = ce++; *ce++ = prevchar; if (count < 2) { while (op < oe && (prevchar != *op || *op != *(op + 1))) { *ce++ = *op; count++; prevchar = *op++; if (op > oe) puts("FATAL op> oe!!\n"); } if (op < oe && prevchar == *op) { op--; count--; ce--; } *countposition = count - 1; } } return ce - cp; } static int HPnocompress(op, oe, cp) unsigned char *op; unsigned char *oe; unsigned char *cp; { unsigned char *ce = cp; while (op < oe) *ce++ = *op++; return ce - cp; } static void HP500Ctext() { register int x, j, row, count = 0; unsigned char *obuf, *oe, *cbuf, *ce; if ((obuf = (unsigned char *) malloc(100 * b_psize)) == 0) puts("FATAL!-- couldn't get enough memory for obuf"); if ((cbuf = (unsigned char *) malloc(400 * b_psize)) == 0) puts("FATAL!-- couldn't get enough memory for cbuf"); oe = obuf; fprintf(gpoutfile, "\033*t%dR\033*r1A\033*b%1dM\033*r%dS\033*r-3U", (300/(hpdj_dpp)), HP_COMP_MODE, b_ysize); for (x = b_xsize - 1; x >= 0; x--) { row = (b_ysize / 8) - 1; for (j = row; j >= 0; j--) { *oe++ = (char) (*((*b_p)[j] + x)); } switch (HP_COMP_MODE) { case 2: count = HPcompress_to_TIFF(obuf, oe, cbuf); break; case 1: count = HPcompress(obuf, oe, cbuf); break; case 0: count = HPnocompress(obuf, oe, cbuf); break; } fprintf(gpoutfile, "\033*b%dV", count); ce = cbuf; while (count--) fputc(*ce++, gpoutfile); oe = obuf; for (j = row; j >= 0; j--) { *oe++ = (char) (*((*b_p)[j + b_psize] + x)); } switch (HP_COMP_MODE) { case 2: count = HPcompress_to_TIFF(obuf, oe, cbuf); break; case 1: count = HPcompress(obuf, oe, cbuf); break; case 0: count = HPnocompress(obuf, oe, cbuf); break; } fprintf(gpoutfile, "\033*b%dV", count); ce = cbuf; while (count--) fputc(*ce++, gpoutfile); oe = obuf; for (j = row; j >= 0; j--) { *oe++ = (char) (*((*b_p)[j + (2 * b_psize)] + x)); } switch (HP_COMP_MODE) { case 2: count = HPcompress_to_TIFF(obuf, oe, cbuf); break; case 1: count = HPcompress(obuf, oe, cbuf); break; case 0: count = HPnocompress(obuf, oe, cbuf); break; } fprintf(gpoutfile, "\033*b%dW", count); ce = cbuf; while (count--) fputc(*ce++, gpoutfile); oe = obuf; } fputs("\033*rbC", gpoutfile); free(cbuf); free(obuf); b_freebitmap(); _IO_putc ('\f', gpoutfile); } # 301 "term.h" 2 # 1 "term/hpgl.trm" 1 # 64 "term/hpgl.trm" # 1 "term/driver.h" 1 # 65 "term/hpgl.trm" 2 static void HPGL_options (void); static void HPGL2_options (void); static void PCL_options (void); static void HPGL_init (void); static void PCL_init (void); static void HPGL_graphics (void); static void HPGL2_graphics (void); static void PCL_graphics (void); static void HPGL_text (void); static void PCL_text (void); static void HPGL_linetype (int linetype); static void HPGL2_linetype (int linetype); static void HPGL_put_text (unsigned int x, unsigned int y, char *str); static void HPGL2_put_text (unsigned int x, unsigned int y, char *str); static void HPGL_move (unsigned int x, unsigned int y); static void HPGL_vector (unsigned int x, unsigned int y); static void HPGL2_move (unsigned int x, unsigned int y); static void HPGL2_vector (unsigned int x, unsigned int y); static void HPGL2_encode (int d); static int HPGL_text_angle (int ang); static int HPGL2_text_angle (int ang); static void HPGL_reset (void); static void PCL_reset (void); static int HPGL2_justify_text (enum JUSTIFY just); # 185 "term/hpgl.trm" struct HPGL2_font_str { char *compare, *name; int symbol_set, spacing; double pitch, height; int posture, stroke_weight, typeface; }; struct PCL_mode_str { char *compare, *name, *command; int xmax, ymax; }; static struct HPGL2_font_str HPGL2_font_table[] = { {"u$nivers", "univers", 277, 1, 0.0, 14, 0, 0, 4148}, {"s$tick", "stick", 277, 0, (3 * 72 / (14 * 2)), 0.0, 0, 0, 48}, {"c$g_times", "cg_times", 277, 1, 0.0, 14, 0, 0, 4101} }; static struct HPGL2_font_str *HPGL2_font = &HPGL2_font_table[0]; static struct PCL_mode_str PCL_mode_table[] = { {"l$andscape", "landscape", "\033&l1O", 10000, (7500 -60)}, {"p$ortrait", "portrait", "\033&l0O", (7500 -60), 10000} }; static struct PCL_mode_str *PCL_mode = &PCL_mode_table[0]; static char *HPGL2_lt[] = { "", "4,2", "5,2", "6,2", "7,2", "8,2" }, *HPGL2_pw[] = { ".15", ".12", ".08" }; static char hpgl_cp_850[128][4] = { "\0164\017", "\016O\017", "\016E\017", "\016@\017", "\016L\017", "\016H\017", "\016T\017", "\0165\017", "\016A\017", "\016M\017", "\016I\017", "\016]\017", "\016Q\017", "\016Y\017", "\016X\017", "\016P\017", "\016\134\017", "\016W\017", "\016S\017", "\016B\017", "\016N\017", "\016J\017", "\016C\017", "\016K\017", "\016o\017", "\016Z\017", "\016[\017", "\016V\017", "\016;\017", "\016R\017", "", "\016>\017", "\016D\017", "\016U\017", "\016F\017", "\016G\017", "\0167\017", "\0166\017", "\016y\017", "\016z\017", "\0169\017", "", "", "\016x\017", "\016w\017", "\0168\017", "\016{\017", "\016}\017", "", "", "", "", "", "\016`\017", "\016\042\017", "\016!\017", "", "", "", "", "", "\016?\017", "\016<\017", "", "", "", "", "", "", "", "\016b\017", "\016a\017", "", "", "", "", "", "", "", "\016:\017", "\016d\017", "\016c\017", "\016$\017", "\016%\017", "\016#\017", "", "\016e\017", "\016&\017", "\016'\017", "", "", "", "", "", "\016f\017", "", "\016g\017", "\016^\017", "\016_\017", "\016h\017", "\016j\017", "\016i\017", "", "\016q\017", "\016p\017", "\016m\017", "\016.\017", "\016-\017", "", "", "\0160\017", "\016(\017", "\016v\017", "\016~\017", "", "", "", "\016=\017", "", "", "\016z\017", "\016+\017", "", "", "", "", "", "" }; static char hpgl_iso_8859_1[128][4] = { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\016\017", "\016\017", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\0168\017", "\0165\017", "\016;\017", "\016:\017", "\016<\017", "\017|\017", "\016=\017", "\016+\017", "", "\016y\017", "\016{\017", "", "", "", "\0160\017", "\016z\017", "\016~\017", "", "", "", "", "", "", "", "", "\016z\017", "\016}\017", "\016w\017", "\016x\017", "", "\0169\017", "\016!\017", "\016`\017", "\016\042\017", "\016a\017", "\016X\017", "\016P\017", "\016S\017", "\0164\017", "\016#\017", "\016\134\017", "\016$\017", "\016%\017", "\016f\017", "\016e\017", "\016\046\017", "\016'\017", "\016c\017", "\0166\017", "\016h\017", "\016g\017", "\016_\017", "\016i\017", "\016Z\017", "", "\016R\017", "\016-\017", "\016m\017", "\016.\017", "\016[\017", "", "\016p\017", "\016^\017", "\016H\017", "\016D\017", "\016@\017", "\016b\017", "\016L\017", "\016T\017", "\016W\017", "\0165\017", "\016I\017", "\016E\017", "\016A\017", "\016M\017", "\016Y\017", "\016U\017", "\016Q\017", "\016]\017", "\016d\017", "\0167\017", "\016J\017", "\016F\017", "\016B\017", "\016j\017", "\016N\017", "", "\016V\017", "\016K\017", "\016G\017", "\016C\017", "\016O\017", "", "\016q\017", "\016o\017" }; static int HPGL_ang = 0, HPGL_x = -10, HPGL_y = -10, HPGL_penstate = -10, HPGL_pentype = -10, HPGL2_in_pe, HPGL2_lost; static int HPGL_numpen, HPGL_eject; static void HPGL_options() { HPGL_numpen = 6; HPGL_eject = 0; while (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "eje$ct")) HPGL_eject = 1; else if (isanumber(c_token)) { HPGL_numpen = (int) real(&token[c_token].l_val); if (HPGL_numpen <= 0) { HPGL_numpen = 6; int_error("Number of pens must be positive", c_token); } } else int_error("expecting \"eject\" or number of pens", c_token); c_token++; } sprintf(term_options, "%d pens %s", HPGL_numpen, HPGL_eject ? "eject" : "noeject"); } static void HPGL2_options() { struct TERMENTRY *t = term; int i; double point_size; char tmp_options[50]; if (!(c_token >= num_tokens || equals(c_token,";"))) { for (i = 0; i < (sizeof(HPGL2_font_table) / sizeof (struct HPGL2_font_str)) && !almost_equals(c_token, HPGL2_font_table[i].compare); i++); if (i < (sizeof(HPGL2_font_table) / sizeof (struct HPGL2_font_str))) { HPGL2_font = &HPGL2_font_table[i]; } else int_error("expecting font: stick, cg_times, or univers", c_token); c_token++; if (!(c_token >= num_tokens || equals(c_token,";"))) { if ((point_size = real(&token[c_token].l_val)) > 0.0) { t->v_char = (int) 1016 *point_size / 72; t->h_char = t->v_char * 2 / 3; if (HPGL2_font->spacing) HPGL2_font->height = point_size; else HPGL2_font->pitch = 72 * 3 / (point_size * 2); } else int_error("expecting font point size: real number", c_token); c_token++; } } sprintf(tmp_options, " %s", HPGL2_font->name); strcat(term_options, tmp_options); if (HPGL2_font->spacing) { sprintf(tmp_options, " %f", HPGL2_font->height); strcat(term_options, tmp_options); } else { sprintf(tmp_options, " %f", HPGL2_font->pitch); strcat(term_options, tmp_options); } } static void PCL_options() { int i; if (!(c_token >= num_tokens || equals(c_token,";"))) { for (i = 0; i < (sizeof(PCL_mode_table) / sizeof (struct PCL_mode_str)) && !almost_equals(c_token, PCL_mode_table[i].compare); i++); if (i < (sizeof(PCL_mode_table) / sizeof (struct PCL_mode_str))) PCL_mode = &PCL_mode_table[i]; else int_error("expecting mode: portrait or landscape", c_token); c_token++; } sprintf(term_options, " %s", PCL_mode->name); HPGL2_options(); } static void HPGL_init() { } static void PCL_init() { struct TERMENTRY *t = term; fprintf(gpoutfile, "\033E\033&l1X%s\n", PCL_mode->command); t->xmax = PCL_mode->xmax; t->ymax = PCL_mode->ymax; } static void HPGL_graphics() { fputs("\033.Y\n\033.I81;;17:\033.N;19:\033.M500:\n", gpoutfile); fprintf(gpoutfile, "IN;%s\nSC0,%d,0,%d;\nSR%f,%f;\n", ((encoding == 3) || (encoding == 1)) ? "CA7;" : "", 10000, 7500, ((double) ((10000/100*12/10)) * 200 / 3 / 10000), ((double) ((7500/100*32/10)) * 100 / 2 / 7500)); HPGL_ang = 0; } static void HPGL2_graphics() { fprintf(gpoutfile, "INSP1SD1,%d,2,%d,", HPGL2_font->symbol_set, HPGL2_font->spacing); if (HPGL2_font->spacing) fprintf(gpoutfile, "4,%f,", HPGL2_font->height); else fprintf(gpoutfile, "3,%f,", HPGL2_font->pitch); fprintf(gpoutfile, "5,%d,6,%d,7,%d\n", HPGL2_font->posture, HPGL2_font->stroke_weight, HPGL2_font->typeface); HPGL_ang = 0; HPGL2_in_pe = 0; HPGL2_lost = 1; HPGL_penstate = 1; } static void PCL_graphics() { fputs("\033%0B", gpoutfile); HPGL2_graphics(); } static void HPGL_text() { if (HPGL_eject == 0) { fputs("PUSP0;\033.Z\n\0", gpoutfile); } else { fputs("PUSP0;PG;\033.Z\n\0", gpoutfile); } HPGL_penstate = 1; } # 756 "term/hpgl.trm" static void PCL_text() { if (HPGL2_in_pe) { fputs(";\n", gpoutfile); HPGL2_in_pe = 0; } fputs("\033%1A\033&l0H\n\0", gpoutfile); } static void HPGL_linetype(linetype) int linetype; { linetype = (linetype + 2) % HPGL_numpen + 1; if (HPGL_pentype != linetype) { fprintf(gpoutfile, "PU;\nSP%d;\n", linetype); HPGL_pentype = linetype; HPGL_penstate = 1; } } static void HPGL2_linetype(linetype) int linetype; { if (HPGL2_in_pe) { fputs(";\n", gpoutfile); HPGL2_in_pe = 0; } if (linetype >= 0) linetype = linetype % ((sizeof(HPGL2_lt) / sizeof(char *)) * (sizeof(HPGL2_pw) / sizeof(char *))); if (linetype != HPGL_pentype) { if (linetype >= 0) { fprintf(gpoutfile, "PW%sLT%s", HPGL2_pw[linetype / (sizeof(HPGL2_lt) / sizeof(char *))], HPGL2_lt[linetype % (sizeof(HPGL2_lt) / sizeof(char *))]); } else if (linetype == -2) fprintf(gpoutfile, "PW.2LT"); else if (linetype == -1) fprintf(gpoutfile, "PW.1LT1,.25"); HPGL_pentype = linetype; } } static void HPGL_put_text(x, y, str) unsigned int x, y; char *str; { if (HPGL_ang == 1) HPGL_move(x + (7500/100*32/10) / 4, y); else HPGL_move(x, y - (7500/100*32/10) / 4); if (encoding == 3) { unsigned char *s; fputs("LB", gpoutfile); for (s = (unsigned char *) str; *s; ++s) if (*s >= 128 && hpgl_cp_850[*s - 128][0]) fputs(hpgl_cp_850[*s - 128], gpoutfile); else _IO_putc (*s, gpoutfile); fputs("\003\n", gpoutfile); } else if (encoding == 1) { unsigned char *s; fputs("LB", gpoutfile); for (s = (unsigned char *) str; *s; ++s) if (*s >= 128 && hpgl_iso_8859_1[*s - 128][0]) fputs(hpgl_iso_8859_1[*s - 128], gpoutfile); else _IO_putc (*s, gpoutfile); fputs("\003\n", gpoutfile); } else fprintf(gpoutfile, "LB%s\003\n", str); } static void HPGL2_put_text(x, y, str) unsigned int x, y; char *str; { struct TERMENTRY *t = term; if (HPGL_ang == 1) HPGL2_move(x + t->v_char / 4, y); else HPGL2_move(x, y - t->v_char / 4); if (HPGL2_in_pe) { fputs(";\n", gpoutfile); HPGL2_in_pe = 0; } fprintf(gpoutfile, "LB%s\003\n", str); HPGL2_lost = 1; } static void HPGL_move(x, y) unsigned int x, y; { if (HPGL_x != x || HPGL_y != y) { fprintf(gpoutfile, "PU;PA%d,%d;\n", x, y); HPGL_penstate = 1; HPGL_x = x; HPGL_y = y; } } static void HPGL_vector(x, y) unsigned int x, y; { if (HPGL_penstate != 0) { fprintf(gpoutfile, "PD;PA%d,%d;\n", x, y); HPGL_penstate = 0; } else fprintf(gpoutfile, "PA%d,%d;\n", x, y); HPGL_x = x; HPGL_y = y; } static void HPGL2_move(x, y) unsigned int x, y; { register int dx, dy; if (HPGL2_in_pe) { dx = x - HPGL_x; dy = y - HPGL_y; fputs("<", gpoutfile); } else { fputs("PE<", gpoutfile); if (HPGL2_lost) { dx = x; dy = y; HPGL2_lost = 0; fputs("=", gpoutfile); } else { dx = x - HPGL_x; dy = y - HPGL_y; } HPGL2_in_pe = 1; } HPGL2_encode(dx); HPGL2_encode(dy); fputs("\n", gpoutfile); HPGL_x = x; HPGL_y = y; } static void HPGL2_vector(x, y) unsigned int x, y; { register int dx, dy; if (HPGL2_in_pe) { dx = x - HPGL_x; dy = y - HPGL_y; } else { fputs("PE", gpoutfile); if (HPGL2_lost) { dx = x; dy = y; HPGL2_lost = 0; fputs("=", gpoutfile); } else { dx = x - HPGL_x; dy = y - HPGL_y; } HPGL2_in_pe = 1; } # 969 "term/hpgl.trm" HPGL2_encode(dx); HPGL2_encode(dy); fputs("\n", gpoutfile); HPGL_x = x; HPGL_y = y; } static void HPGL2_encode(d) register int d; { register int c; if ((d <<= 1) < 0) d = 1 - d; do { c = d & 63; d >>= 6; if (d > 0) fputc((char) (c + 63), gpoutfile); else fputc((char) (c + 191), gpoutfile); } while (d > 0); } static int HPGL_text_angle(ang) int ang; { HPGL_ang = ang; if (ang == 1) fputs("DI0,1;\n", gpoutfile); else fputs("DI1,0;\n", gpoutfile); return 1; } static int HPGL2_text_angle(ang) int ang; { if (HPGL2_in_pe) { fputs(";", gpoutfile); HPGL2_in_pe = 0; } if (ang == 1) fputs("DI0,1", gpoutfile); else fputs("DI1,0", gpoutfile); HPGL_ang = ang; return 1; } static void HPGL_reset() { } # 1057 "term/hpgl.trm" static void PCL_reset() { fputs("\033%0A\033E\n", gpoutfile); } static int HPGL2_justify_text(just) enum JUSTIFY just; { if (HPGL2_in_pe) { fputs(";\n", gpoutfile); HPGL2_in_pe = 0; } switch (just) { case LEFT: fputs("LO1", gpoutfile); break; case CENTRE: fputs("LO4", gpoutfile); break; case RIGHT: fputs("LO7", gpoutfile); break; default: return 0; } return 1; } # 304 "term.h" 2 # 1 "term/hpljii.trm" 1 # 68 "term/hpljii.trm" # 1 "term/driver.h" 1 # 69 "term/hpljii.trm" 2 static void HPLJIIoptions (void); static void HPLJIIinit (void); static void HPLJIIgraphics (void); static void HPLJIItext (void); static void HPLJIIlinetype (int linetype); static void HPLJIIput_text (unsigned int x, unsigned int y, char *str); static void HPLJIIreset (void); static void HPDJgraphics (void); static void HPDJtext (void); # 123 "term/hpljii.trm" void HPLJIIputc (unsigned int x, unsigned int y, char c, int ang); static int hplj_dpp = 4; # 135 "term/hpljii.trm" static void HPLJIIoptions() { char opt[4]; int parse_error = 0; if ((c_token >= num_tokens || equals(c_token,";"))) { term_options[0] = ('\0'); } else { if (token[c_token].length > 3) { parse_error = 1; } else { capture(opt, c_token, c_token, 4); if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("75") && (__s1_len = strlen (opt), __s2_len = strlen ("75"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("75"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("75") && ((size_t)(const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("75"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((! __const unsigned char *) (__const char *) ("75"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("75"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("75"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("75"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("75") && ((size! _t)(const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) && (__s2_len = strlen ("75"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("75"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("75"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("75"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("75"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (opt); register int __! result = __s1[0] - ((__const unsigned char *) (__const char *) ("75"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("75"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("75"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("75"))[3]); } } __result; }))) : strcmp (opt, "75")))); })) { hplj_dpp = 4; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("100") && (__s1_len = strlen (opt), __s2_len = strlen ("100"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("100"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("100") && ((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("100"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *! ) (opt))[1] - ((__const unsigned char *) (__const char *) ("100"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("100"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("100"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("100"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constan! t_p ("100") && ((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) && (__s2_len = strlen ("100"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("100"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("100"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("100"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("100"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const ch! ar *) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("100"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("100"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("100"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("100"))[3]); } } __result; }))) : strcmp (opt, "100")))); })) { hplj_dpp = 3; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("150") && (__s1_len = strlen (opt), __s2_len = strlen ("150"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("150"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("150") && ((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("150"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *! ) (opt))[1] - ((__const unsigned char *) (__const char *) ("150"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("150"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("150"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("150"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constan! t_p ("150") && ((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) && (__s2_len = strlen ("150"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("150"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("150"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("150"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("150"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const ch! ar *) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("150"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("150"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("150"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("150"))[3]); } } __result; }))) : strcmp (opt, "150")))); })) { hplj_dpp = 2; } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("300") && (__s1_len = strlen (opt), __s2_len = strlen ("300"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("300"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("300") && ((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("300"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *! ) (opt))[1] - ((__const unsigned char *) (__const char *) ("300"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("300"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("300"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("300"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constan! t_p ("300") && ((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) && (__s2_len = strlen ("300"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("300"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("300"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("300"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("300"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const ch! ar *) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("300"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("300"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("300"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("300"))[3]); } } __result; }))) : strcmp (opt, "300")))); })) { hplj_dpp = 1; } else { parse_error = 1; } c_token++; } } term->xmax = (8*(unsigned int)(xsize*1920/(hplj_dpp)/8.0+0.9)); term->ymax = (8*(unsigned int)(ysize*1920/(hplj_dpp)/8.0+0.9)); switch (hplj_dpp) { case 1: (__extension__ (__builtin_constant_p ("300") ? (((size_t)(const void *)(("300") + 1) - (size_t)(const void *)("300") == 1) && strlen ("300") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("300"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("300"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("300"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("300"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("300"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("300"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("300"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("300"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("300"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("300"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("300"))[4 + 1]) << 8 | ((__const unsigned ch! ar *) (__const char *) ("300"))[4]), strlen ("300") + 1) : (char *) memcpy (term_options, "300", strlen ("300") + 1)) : strcpy (term_options, "300"))); term->v_tic = 15; term->h_tic = 15; break; case 2: (__extension__ (__builtin_constant_p ("150") ? (((size_t)(const void *)(("150") + 1) - (size_t)(const void *)("150") == 1) && strlen ("150") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("150"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("150"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("150"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("150"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("150"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("150"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("150"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("150"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("150"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("150"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("150"))[4 + 1]) << 8 | ((__const unsigned ch! ar *) (__const char *) ("150"))[4]), strlen ("150") + 1) : (char *) memcpy (term_options, "150", strlen ("150") + 1)) : strcpy (term_options, "150"))); term->v_tic = 8; term->h_tic = 8; break; case 3: (__extension__ (__builtin_constant_p ("100") ? (((size_t)(const void *)(("100") + 1) - (size_t)(const void *)("100") == 1) && strlen ("100") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("100"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("100"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("100"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("100"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("100"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("100"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("100"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("100"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("100"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("100"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("100"))[4 + 1]) << 8 | ((__const unsigned ch! ar *) (__const char *) ("100"))[4]), strlen ("100") + 1) : (char *) memcpy (term_options, "100", strlen ("100") + 1)) : strcpy (term_options, "100"))); term->v_tic = 6; term->h_tic = 6; break; case 4: (__extension__ (__builtin_constant_p ("75") ? (((size_t)(const void *)(("75") + 1) - (size_t)(const void *)("75") == 1) && strlen ("75") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("75"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("75"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("75"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("75"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("75"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("75"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("75"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("75"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("75"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("75"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("75"))[4 + 1]) << 8 | ((__const unsigned char *) (__const ! char *) ("75"))[4]), strlen ("75") + 1) : (char *) memcpy (term_options, "75", strlen ("75") + 1)) : strcpy (term_options, "75"))); term->v_tic = 5; term->h_tic = 5; break; } if (parse_error) int_error("expecting dots per inch size 75, 100, 150 or 300", c_token); } static void HPLJIIinit() { term->v_char = ((300/(hplj_dpp))/6); term->h_char = ((300/(hplj_dpp))/10); } static void HPLJIIgraphics() { fputs("\033(0N\033(s0p10.0h12.0v0s0b3T\033&l6D",gpoutfile); fputs("\033&f0S",gpoutfile); b_makebitmap((8*(unsigned int)(ysize*1920/(hplj_dpp)/8.0+0.9)), (8*(unsigned int)(xsize*1920/(hplj_dpp)/8.0+0.9)), 1); b_rastermode = 1; } static void HPLJIItext() { register int x, j, row; fprintf(gpoutfile, "\033*t%dR", (300/(hplj_dpp))); fputs("\033&f1S",gpoutfile); fputs("\033*r1A", gpoutfile); for (x = b_xsize - 1; x >= 0; x--) { row = (b_ysize / 8) - 1; fprintf(gpoutfile, "\033*b0m%dW", b_ysize / 8); for (j = row; j >= 0; j--) { (void) fputc((char) (*((*b_p)[j] + x)), gpoutfile); } } fputs("\033*rB", gpoutfile); b_freebitmap(); _IO_putc ('\f', gpoutfile); } static void HPLJIIlinetype(linetype) int linetype; { if (hplj_dpp == 1) { if (linetype >= 7) linetype %= 7; b_linemask = b_300ppi_pattern[linetype + 2]; b_maskcount = 0; } else { b_setlinetype(linetype); } } static void HPLJIIput_text(x, y, str) unsigned int x, y; char *str; { switch (b_angle) { case 0: y -= ((300/(hplj_dpp))/6) / 5; fputs("\033&f1S",gpoutfile); fputs("\033&f0S",gpoutfile); fprintf(gpoutfile, "\033*p%+dx%+dY", x * (hplj_dpp) ,((8*(unsigned int)(ysize*1920/(hplj_dpp)/8.0+0.9)) - y - 1) * (hplj_dpp)); fputs(str, gpoutfile); break; case 1: y += (((300/(hplj_dpp))/10) - 2 * ((300/(hplj_dpp))/6)) / 2; y += (((300/(hplj_dpp))/6) + ((300/(hplj_dpp))/10)) * strlen(str) / 2; for (; *str; ++str, y -= ((300/(hplj_dpp))/6)) HPLJIIputc(x, y, *str, b_angle); break; } } void HPLJIIputc(unsigned int x, unsigned int y, char c, int ang) { fputs("\033&f1S",gpoutfile); fputs("\033&f0S",gpoutfile); fprintf(gpoutfile, "\033*p%+dx%+dY", x * (hplj_dpp) ,((8*(unsigned int)(ysize*1920/(hplj_dpp)/8.0+0.9)) - y - 1) * (hplj_dpp)); fputc(c, gpoutfile); } static void HPLJIIreset() { } static void HPDJgraphics() { switch (hplj_dpp) { case 1: b_charsize(2); term->v_char = 31; term->h_char = 19; break; case 2: b_charsize(2); term->v_char = 31; term->h_char = 19; break; case 3: b_charsize(1); term->v_char = 21; term->h_char = 13; break; case 4: b_charsize(0); term->v_char = 11; term->h_char = 7; break; } b_makebitmap((8*(unsigned int)(ysize*1920/(hplj_dpp)/8.0+0.9)), (8*(unsigned int)(xsize*1920/(hplj_dpp)/8.0+0.9)), 1); b_rastermode = 1; } static void HPDJtext() { register int x, j, row; fprintf(gpoutfile, "\033*b0M\033*t%dR\033*r1A", (300/(hplj_dpp))); for (x = b_xsize - 1; x >= 0; x--) { row = (b_ysize / 8) - 1; fprintf(gpoutfile, "\033*b%dW", b_ysize / 8); for (j = row; j >= 0; j--) { (void) fputc((char) (*((*b_p)[j] + x)), gpoutfile); } } fputs("\033*rbC", gpoutfile); b_freebitmap(); _IO_putc ('\f', gpoutfile); } # 307 "term.h" 2 # 1 "term/hppj.trm" 1 # 64 "term/hppj.trm" # 1 "term/driver.h" 1 # 65 "term/hppj.trm" 2 static void HPPJoptions (void); static void HPPJinit (void); static void HPPJreset (void); static void HPPJgraphics (void); static void HPPJtext (void); static void HPPJlinetype (int linetype); # 100 "term/hppj.trm" static int hppj_font = 1; static void HPPJoptions() { char opt[10]; term_options[0] = ('\0'); hppj_font = 1; if (!(c_token >= num_tokens || equals(c_token,";"))) { if (token[c_token].length > 8) { int_error("expecting font size FNT5X9, FNT9X17, or FNT13X25", c_token); } capture(opt, c_token, c_token, 9); if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("FNT5X9") && (__s1_len = strlen (opt), __s2_len = strlen ("FNT5X9"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("FNT5X9") + 1) - (size_t)(const void *)("FNT5X9") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("FNT5X9"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("FNT5X9") && ((size_t)(const void *)(("FNT5X9") + 1) - (size_t)(const void *)("FNT5X9") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("FNT5X9"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *)! (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("FNT5X9"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - __s2[3]); } } __resul! t; }))) : (__builtin_constant_p ("FNT5X9") && ((size_t)(const void *)(("FNT5X9") + 1) - (size_t)(const void *)("FNT5X9") == 1) && (__s2_len = strlen ("FNT5X9"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("FNT5X9"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[3]); } } __result; })) : (__extension__ ({ __const unsigne! d char *__s1 = (__const unsigned char *) (__const char *) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("FNT5X9"))[3]); } } __result; }))) : strcmp (opt, "FNT5X9")))); })) { hppj_font = 0; (__extension__ (__builtin_constant_p ("FNT5X9") ? (((size_t)(const void *)(("FNT5X9") + 1) - (size_t)(const void *)("FNT5X9") == 1) && strlen ("FNT5X9") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("FNT5X9"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("FNT5X9"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("FNT5X9"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("FNT5X9"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("FNT5X9"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("FNT5X9"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("FNT5X9"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("FNT5X9"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("FNT5X9"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("FNT5X9"))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *)! ("FNT5X9"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("FNT5X9"))[4]), strlen ("FNT5X9") + 1) : (char *) memcpy (term_options, "FNT5X9", strlen ("FNT5X9") + 1)) : strcpy (term_options, "FNT5X9"))); } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("FNT9X17") && (__s1_len = strlen (opt), __s2_len = strlen ("FNT9X17"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("FNT9X17") + 1) - (size_t)(const void *)("FNT9X17") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("FNT9X17"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("FNT9X17") && ((size_t)(const void *)(("FNT9X17") + 1) - (size_t)(const void *)("FNT9X17") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("FNT9X17"))[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const ! unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("FNT9X17"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - _! _s2[3]); } } __result; }))) : (__builtin_constant_p ("FNT9X17") && ((size_t)(const void *)(("FNT9X17") + 1) - (size_t)(const void *)("FNT9X17") == 1) && (__s2_len = strlen ("FNT9X17"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("FNT9X17"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[3]); } } __result; })) : (__ex! tension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("FNT9X17"))[3]); } } __result; }))) : strcmp (opt, "FNT9X17")))); })) { hppj_font = 1; (__extension__ (__builtin_constant_p ("FNT9X17") ? (((size_t)(const void *)(("FNT9X17") + 1) - (size_t)(const void *)("FNT9X17") == 1) && strlen ("FNT9X17") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("FNT9X17"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("FNT9X17"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("FNT9X17"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("FNT9X17"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("FNT9X17"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("FNT9X17"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("FNT9X17"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("FNT9X17"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("FNT9X17"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("FNT9X17"))[4 + 2]) << 8 | ((__const unsigned char *) (_! _const char *) ("FNT9X17"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("FNT9X17"))[4]), strlen ("FNT9X17") + 1) : (char *) memcpy (term_options, "FNT9X17", strlen ("FNT9X17") + 1)) : strcpy (term_options, "FNT9X17"))); } else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (opt) && __builtin_constant_p ("FNT13X25") && (__s1_len = strlen (opt), __s2_len = strlen ("FNT13X25"), (!((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("FNT13X25") + 1) - (size_t)(const void *)("FNT13X25") == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (opt), (__const char *) ("FNT13X25"), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) && (__s1_len = strlen (opt), __s1_len < 4) ? (__builtin_constant_p ("FNT13X25") && ((size_t)(const void *)(("FNT13X25") + 1) - (size_t)(const void *)("FNT13X25") == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("FNT13X25"))[0]); if (__s1_len > 0 && __result == 0) { __result = ((! (__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("FNT13X25"); register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ! (opt))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("FNT13X25") && ((size_t)(const void *)(("FNT13X25") + 1) - (size_t)(const void *)("FNT13X25") == 1) && (__s2_len = strlen ("FNT13X25"), __s2_len < 4) ? (__builtin_constant_p (opt) && ((size_t)(const void *)((opt) + 1) - (size_t)(const void *)(opt) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (opt))[0] - ((__const unsigned char *) (__const char *)("FNT13X25"))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[1] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (opt))[2] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (opt))[3] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[3]); } } ! __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (opt); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("FNT13X25"))[3]); } } __result; }))) : strcmp (opt, "FNT13X25")))); })) { hppj_font = 2; (__extension__ (__builtin_constant_p ("FNT13X25") ? (((size_t)(const void *)(("FNT13X25") + 1) - (size_t)(const void *)("FNT13X25") == 1) && strlen ("FNT13X25") + 1 <= 8 ? __strcpy_small (term_options, __extension__ (((__const unsigned char *) (__const char *) ("FNT13X25"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("FNT13X25"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("FNT13X25"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("FNT13X25"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("FNT13X25"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("FNT13X25"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("FNT13X25"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("FNT13X25"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("FNT13X25"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("FNT13X25"))[4 + 2]) << 8 | ((__const unsig! ned char *) (__const char *) ("FNT13X25"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("FNT13X25"))[4]), strlen ("FNT13X25") + 1) : (char *) memcpy (term_options, "FNT13X25", strlen ("FNT13X25") + 1)) : strcpy (term_options, "FNT13X25"))); } else { int_error("expecting font size FNT5X9, FNT9X17, or FNT13X25", c_token); } c_token++; } } static void HPPJinit() { switch (hppj_font) { case 0: term->v_char = 11; term->h_char = 7; term->v_tic = 11 / 2; term->h_tic = 7 / 2; break; case 1: term->v_char = 21; term->h_char = 13; term->v_tic = 21 / 2; term->h_tic = 13 / 2; break; case 2: term->v_char = 31; term->h_char = 19; term->v_tic = 31 / 2; term->h_tic = 19 / 2; break; } } static void HPPJreset() { } static void HPPJgraphics() { b_charsize(hppj_font); b_makebitmap((8*(unsigned int)(9.5 * 180 / 8.0 + 0.9)), (8 * 180), 3); } static void HPPJtext() { int x, plane, y; int minRow, maxRow; int numBytes; int numReps; fprintf(gpoutfile, "\033E\033*t%dR\033*r%dS\033*b0X\033*b0Y\033*r%dU\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*v%dA\033*v%dB\033*v%dC\033*v%dI\033*b1M\033*r1A", # 195 "term/hppj.trm" 180, (8 * 180), 3, 90, 88, 85, 0, 53, 8, 14, 1, 3, 26, 22, 2, 4, 4, 29, 3, 53, 5, 25, 4, 2, 22, 64, 5, 89, 83, 13, 6, 4, 4, 6, 7); for (x = (8*(unsigned int)(9.5 * 180 / 8.0 + 0.9)) - 1; x >= 0; --x) { for (plane = 0; plane < 3; plane++) { minRow = b_psize * plane; maxRow = b_psize * plane + b_psize - 1; numBytes = 0; for (y = maxRow; y >= minRow; --y) { if (y == minRow || *((*b_p)[y] + x) != *((*b_p)[y - 1] + x)) { numBytes += 2; } } fprintf(gpoutfile, "\033*b%d", numBytes); (void) fputc((char) (plane < 3 - 1 ? 'V' : 'W'), gpoutfile); numReps = 0; for (y = maxRow; y >= minRow; --y) { if (y == minRow || *((*b_p)[y] + x) != *((*b_p)[y - 1] + x)) { (void) fputc((char) (numReps), gpoutfile); (void) fputc((char) (*((*b_p)[y] + x)), gpoutfile); numReps = 0; } else { numReps++; } } } } fputs("\033*r1B\033E", gpoutfile); b_freebitmap(); } static void HPPJlinetype(linetype) int linetype; { if (linetype >= 0) { b_setlinetype(0); b_setvalue((linetype % ((1 << 3) - 1)) + 1); } else { b_setlinetype(linetype + 2); b_setvalue((1 << 3) - 1); } } # 310 "term.h" 2 # 1 "term/imagen.trm" 1 # 63 "term/imagen.trm" # 1 "term/driver.h" 1 # 64 "term/imagen.trm" 2 static void IMAGEN_init (void); static void IMAGEN_graphics (void); static void IMAGEN_options (void); static void IMAGEN_text (void); static void IMAGEN_linetype (int lt); static void IMAGEN_move (unsigned int x, unsigned int y); static void IMAGEN_vector (unsigned int ux, unsigned int uy); static int IMAGEN_text_angle (int ang); static int IMAGEN_justify_text (enum JUSTIFY mode); static void IMAGEN_put_text (unsigned int x, unsigned int y, char str[]); static void IMAGEN_reset (void); # 93 "term/imagen.trm" static void IM_page (void); static void IMAGEN_draw_path (void); static void IMAGEN_setpos (int ux, int uy); static unsigned char *IMAGEN_cvts (unsigned char *str, int *width, int *height); static void IMAGEN_putwd (unsigned int w); static void IMAGEN_createfamily (char *c, int sz); static void IMAGEN_setfont (int sz); void IMP_set_draw_pattern (int pattern, int sz); void IMAGEN_mapsinit (void); void IMAGEN_createmap (int name, unsigned short *map); # 1 "term/impcodes.h" 1 # 111 "term/imagen.trm" 2 static int IMAGEN_Xmax = ((300) * 11); static int IMAGEN_Ymax = ((300) * 78 / 10); unsigned short IMP_gmap[128]; unsigned char IMP_chmap[256]; static int IMAGEN_page_h = ((300) * 83 / 10); static int IMAGEN_page_w = ((300) * 116 / 10); static int IM_win_horiz = 1; static int IM_win_verti = 1; static int IM_plot_nr = 0; static int IMAGEN_fontsize = 12; static int IMAGEN_familytable[36]; static int IMAGEN_orgX; static int IMAGEN_orgY; static int IMAGEN_orgx; static int IMAGEN_orgy; static int IMAGEN_posx; static int IMAGEN_posy; static int IMAGEN_xmax = ((300) * 11); static int IMAGEN_ymax = ((300) * 78 / 10); static int IMAGEN_winx = ((300) * 11); static int IMAGEN_winy = ((300) * 78 / 10); static int IMAGEN_hchar; static int IMAGEN_wchar; static int IMAGEN_blofs; static int IMAGEN_angle = -1; static int IMAGEN_portrait; static enum JUSTIFY IMAGEN_justify = LEFT; unsigned int IM_xvector[100]; unsigned int IM_yvector[100]; unsigned int IM_veclen; unsigned int IM_vecpos = 0; char IMPdrpattern[10][10] = { {0}, {1, 8, 0}, {0}, {16, 4, 0}, {3, 8, 0}, {8, 8, 0}, {16, 6, 3, 6, 0}, {16, 6, 8, 6, 0}, {16, 4, 1, 4, 8, 4, 1, 4, 0}, {16, 4, 1, 8, 1, 4, 0} }; static void IMAGEN_init() { register struct TERMENTRY *t = term; IMAGEN_posx = IMAGEN_posy = 0; IMAGEN_orgX = (IMAGEN_page_w - IMAGEN_Xmax) / 2; IMAGEN_orgY = (IMAGEN_page_h - IMAGEN_Ymax) / 2; IMAGEN_xmax = IMAGEN_winx = (int) (IMAGEN_Xmax / IM_win_horiz); IMAGEN_ymax = IMAGEN_winy = (int) (IMAGEN_Ymax / IM_win_verti); t->xmax = (unsigned int) (IMAGEN_xmax); t->ymax = (unsigned int) (IMAGEN_ymax); fputs("@document(language impress, paper a4)", gpoutfile); if (IMAGEN_portrait) { _IO_putc (137, gpoutfile); IMAGEN_putwd(3520); } _IO_putc (205, gpoutfile); _IO_putc (((IMAGEN_portrait ? 3 : 0) << 5) | (3 << 3) | (IMAGEN_portrait ? 0 : 5), gpoutfile); IMAGEN_mapsinit(); IMAGEN_createmap(1, IMP_gmap); IMAGEN_setfont(IMAGEN_fontsize); IMAGEN_text_angle(0); _IO_putc (135, gpoutfile); IMAGEN_putwd(0); _IO_putc (137, gpoutfile); IMAGEN_putwd(0); IMAGEN_linetype(-1); # 228 "term/imagen.trm" IM_veclen = 100; IM_vecpos = 0; } static void IM_page() { if (IM_vecpos) { IMAGEN_draw_path(); } _IO_putc (219, gpoutfile); } static void IMAGEN_graphics() { int tmpx, tmpy; if (IM_vecpos) { IMAGEN_draw_path(); } if (IM_plot_nr >= (IM_win_horiz * IM_win_verti)) { IM_page(); IM_plot_nr = 0; } IM_plot_nr++; tmpx = IMAGEN_orgX + ((IM_plot_nr - 1) % IM_win_horiz) * IMAGEN_winx; tmpy = IMAGEN_orgY + ((IM_win_verti - 1) - (int) ((IM_plot_nr - 1) / IM_win_horiz)) * IMAGEN_winy; IMAGEN_orgx = tmpx + (int) ((IMAGEN_winx - IMAGEN_xmax) / 2); IMAGEN_orgy = tmpy + (int) ((IMAGEN_winy - IMAGEN_ymax) / 2); } static void IMAGEN_options() { struct value a; while (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "p$ortrait")) { IMAGEN_portrait = 1; IMAGEN_page_h = ((300) * 116 / 10); IMAGEN_page_w = ((300) * 83 / 10); IMAGEN_Xmax = ((300) * 78 / 10); IMAGEN_Ymax = ((300) * 11); c_token++; } else if (almost_equals(c_token, "l$andscape")) { IMAGEN_portrait = 0; c_token++; } else if (equals(c_token, "[")) { c_token++; if (equals(c_token, "]")) { IM_page(); c_token++; continue; } if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("no. windows: [horizontal,vertical] expected", c_token); } else if (!equals(c_token, ",")) { IM_win_horiz = (int) real(const_express(&a)); } if (!equals(c_token, ",")) int_error("',' expected", c_token); c_token++; if (!equals(c_token, "]")) { IM_win_verti = (int) real(const_express(&a)); } if (!equals(c_token, "]")) int_error("expecting ']'", c_token); c_token++; } else { IMAGEN_fontsize = (int) real(const_express(&a)); if (IMAGEN_fontsize < 8) IMAGEN_fontsize = 8; if (IMAGEN_fontsize > 15) IMAGEN_fontsize = 15; } } sprintf(term_options, "%d %s [%1d,%1d]", IMAGEN_fontsize, (IMAGEN_portrait) ? "portrait" : "landscape", IM_win_horiz, IM_win_verti); } static void IMAGEN_text() { } static void IMAGEN_linetype(lt) int lt; { static int lastlinetype = -10; int pen ; if (IM_vecpos) { IMAGEN_draw_path(); } if (lt == -2) { pen = 4; } else { pen = (int) (lt / 8) * 2; if (pen <= 0) pen = 1; } lt = (lt % 8) + 2; if (lastlinetype == lt) return; lastlinetype = lt; _IO_putc (232, gpoutfile); _IO_putc (pen, gpoutfile); IMP_set_draw_pattern(lt, pen); } static void IMAGEN_move(x, y) unsigned int x, y; { if (IM_vecpos) { IMAGEN_draw_path(); } IM_xvector[0] = x + IMAGEN_orgx; IM_yvector[0] = y + IMAGEN_orgy; IM_vecpos = 1; } static void IMAGEN_vector(ux, uy) unsigned int ux, uy; { IM_xvector[IM_vecpos] = ux + IMAGEN_orgx; IM_yvector[IM_vecpos] = uy + IMAGEN_orgy; IM_vecpos++; if (IM_vecpos >= IM_veclen) { IMAGEN_draw_path(); IM_xvector[0] = ux + IMAGEN_orgx; IM_yvector[0] = uy + IMAGEN_orgy; IM_vecpos = 1; } } static void IMAGEN_draw_path() { register int i; _IO_putc (230, gpoutfile); IMAGEN_putwd(IM_vecpos); for (i = 0; i < IM_vecpos; i++) { IMAGEN_putwd(IM_xvector[i]); IMAGEN_putwd(IM_yvector[i]); } IM_vecpos = 0; _IO_putc (234, gpoutfile); _IO_putc (15, gpoutfile); } static void IMAGEN_setpos(ux, uy) int ux, uy; { _IO_putc (135, gpoutfile); IMAGEN_putwd(ux + IMAGEN_orgx); _IO_putc (137, gpoutfile); IMAGEN_putwd(uy + IMAGEN_orgy); _IO_putc (209, gpoutfile); if (IMAGEN_angle == 1) IMAGEN_putwd(uy + IMAGEN_orgx); else IMAGEN_putwd(ux + IMAGEN_orgx); } static int IMAGEN_text_angle(ang) int ang; { if (IM_vecpos) { IMAGEN_draw_path(); } if (IMAGEN_angle != ang) { IMAGEN_angle = ang; _IO_putc (206, gpoutfile); _IO_putc (ang == 0 ? 0 : 7, gpoutfile); } return (1); } static int IMAGEN_justify_text(mode) enum JUSTIFY mode; { if (IM_vecpos) { IMAGEN_draw_path(); } IMAGEN_justify = mode; return (1); } static unsigned char *IMAGEN_cvts(str, width, height) unsigned char *str; int *width; int *height; { unsigned char *cp1; unsigned char *cp2; static unsigned char *buf = ((void *)0); int h; int maxw; int w; if (buf != ((void *)0)) (void) free(buf); buf = (unsigned char *) gp_alloc(strlen((char *) str), "converted label string"); cp1 = str; cp2 = buf; h = 1; maxw = 0; w = 0; while (strlen((char *) cp1) > 0) { switch (*cp1) { case ' ': *cp2++ = 128; w++; break; case '\\': if (*++cp1 == '\\') { h++; if (w > maxw) maxw = w; w = 0; *cp2++ = '\n'; break; } default: *cp2++ = IMP_chmap[*cp1]; w++; break; } cp1++; } *cp2++ = '\n'; *cp2 = '\0'; if (w > maxw) maxw = w; if (height != ((void *)0)) *height = IMAGEN_angle ? IMAGEN_wchar * maxw : IMAGEN_hchar * h; if (width != ((void *)0)) *width = IMAGEN_angle ? IMAGEN_hchar * h : IMAGEN_wchar * maxw; return (buf); } static void IMAGEN_put_text(x, y, str) unsigned int x, y; char str[]; { unsigned char *cvstr, *p; int height; int width; int sx, sy; if (IM_vecpos) { IMAGEN_draw_path(); } cvstr = IMAGEN_cvts((unsigned char *) str, &width, &height); if (IMAGEN_angle) { x -= width / 2 - IMAGEN_hchar; } else y += height / 2 - IMAGEN_hchar; while ((p = (unsigned char *) (__extension__ (__builtin_constant_p ('\n') && ('\n') == '\0' ? (char *) __rawmemchr ((char *) cvstr, '\n') : strchr ((char *) cvstr, '\n'))))) { *p = '\0'; sx = x; sy = y; if (IMAGEN_angle) sx = x - IMAGEN_blofs; else sy = y + IMAGEN_blofs; width = strlen((char *) cvstr) * IMAGEN_wchar; switch (IMAGEN_justify) { case LEFT: break; case CENTRE: if (IMAGEN_angle) { sy = y - width / 2; } else { sx = x - width / 2; } break; case RIGHT: if (IMAGEN_angle) { sy = y - width; } else { sx = x - width; } break; } IMAGEN_setpos(sx, sy); fputs((char *) cvstr, gpoutfile); cvstr = ++p; if (IMAGEN_angle) { x += IMAGEN_hchar; } else { y -= IMAGEN_hchar; } } } static void IMAGEN_reset() { if (IM_vecpos) { IMAGEN_draw_path(); } _IO_putc (255, gpoutfile); } static void IMAGEN_putwd(w) unsigned int w; { _IO_putc (w >> 8, gpoutfile); _IO_putc (w, gpoutfile); } static void IMAGEN_createfamily(c, sz) char *c; int sz; { _IO_putc (221, gpoutfile); _IO_putc (sz, gpoutfile); _IO_putc (1, gpoutfile); _IO_putc (1, gpoutfile); fputs(c, gpoutfile); _IO_putc (0, gpoutfile); } static void IMAGEN_setfont(sz) int sz; { char font[20]; if (!IMAGEN_familytable[sz]) { sprintf(font, "%s%02d", "cour", sz); IMAGEN_createfamily(font, sz); IMAGEN_familytable[sz] = sz; } IMAGEN_hchar = sz * 5; IMAGEN_wchar = IMAGEN_hchar / 2; IMAGEN_blofs = IMAGEN_hchar / 3; term->v_char = IMAGEN_hchar; term->h_char = IMAGEN_wchar; _IO_putc (207, gpoutfile); _IO_putc (sz, gpoutfile); _IO_putc (210, gpoutfile); IMAGEN_putwd(IMAGEN_wchar); _IO_putc (208, gpoutfile); IMAGEN_putwd(IMAGEN_hchar); } void IMP_set_draw_pattern(pattern, sz) int pattern, sz; { int i ; _IO_putc (237, gpoutfile); _IO_putc (0, gpoutfile); _IO_putc (237, gpoutfile); _IO_putc (strlen(IMPdrpattern[pattern]), gpoutfile); for (i = 0; i < strlen(IMPdrpattern[pattern]); i++) { IMAGEN_putwd(IMPdrpattern[pattern][i] * sz); } } void IMAGEN_mapsinit() { register int i ; for (i = 32; i < 127; i++) { IMP_gmap[i] = i; } IMP_gmap[1] = 225; IMP_gmap[2] = 233; IMP_gmap[3] = 61736; IMP_gmap[4] = 241; IMP_gmap[5] = 249; IMP_gmap[6] = 61864; IMP_gmap[7] = 162; IMP_gmap[8] = 163; IMP_gmap[9] = 164; IMP_gmap[10] = 165; IMP_gmap[11] = 167; IMP_gmap[12] = 171; IMP_gmap[13] = 182; IMP_gmap[14] = 61346; IMP_gmap[15] = 191; IMP_gmap[16] = 187; IMP_gmap[17] = 188; IMP_gmap[18] = 189; IMP_gmap[19] = 190; IMP_gmap[20] = 210; IMP_gmap[21] = 211; IMP_gmap[22] = 251; IMP_gmap[23] = 61232; IMP_gmap[24] = 212; IMP_gmap[25] = 137; IMP_gmap[26] = 176; IMP_gmap[27] = 161; IMP_gmap[28] = 139; IMP_gmap[29] = 133; IMP_gmap[30] = 140; IMP_gmap[31] = 61249; IMP_gmap[32] = 8738; IMP_gmap[34] = 186; IMP_gmap[36] = 164; IMP_gmap[39] = 185; IMP_gmap[127] = 61286; for (i = 32; i <= 127; i++) { IMP_chmap[i] = i; } for (i = 128; i <= 255; i++) { IMP_chmap[i] = 128; } IMP_chmap[161] = 27; IMP_chmap[162] = 7; IMP_chmap[163] = 8; IMP_chmap[164] = 120; IMP_chmap[165] = 10; IMP_chmap[166] = 124; IMP_chmap[167] = 11; IMP_chmap[168] = 25; IMP_chmap[169] = 21; IMP_chmap[170] = 45; IMP_chmap[171] = 12; IMP_chmap[172] = 83; IMP_chmap[173] = 45; IMP_chmap[174] = 20; IMP_chmap[175] = 126; IMP_chmap[176] = 26; IMP_chmap[177] = 12; IMP_chmap[178] = 1; IMP_chmap[179] = 2; IMP_chmap[180] = 29; IMP_chmap[181] = 52; IMP_chmap[182] = 13; IMP_chmap[183] = 5; IMP_chmap[184] = 28; IMP_chmap[185] = 3; IMP_chmap[186] = 45; IMP_chmap[187] = 16; IMP_chmap[188] = 17; IMP_chmap[189] = 18; IMP_chmap[190] = 19; IMP_chmap[191] = 15; IMP_chmap[192] = 65; IMP_chmap[193] = 65; IMP_chmap[194] = 65; IMP_chmap[195] = 65; IMP_chmap[196] = 65; IMP_chmap[197] = 3; IMP_chmap[198] = 1; IMP_chmap[199] = 67; IMP_chmap[200] = 69; IMP_chmap[201] = 69; IMP_chmap[202] = 69; IMP_chmap[203] = 69; IMP_chmap[204] = 73; IMP_chmap[205] = 73; IMP_chmap[206] = 73; IMP_chmap[207] = 73; IMP_chmap[208] = 68; IMP_chmap[209] = 78; IMP_chmap[210] = 79; IMP_chmap[211] = 79; IMP_chmap[212] = 79; IMP_chmap[213] = 79; IMP_chmap[214] = 79; IMP_chmap[215] = 13; IMP_chmap[216] = 2; IMP_chmap[217] = 85; IMP_chmap[218] = 85; IMP_chmap[219] = 85; IMP_chmap[220] = 85; IMP_chmap[221] = 89; IMP_chmap[222] = 32; IMP_chmap[223] = 22; IMP_chmap[224] = 97; IMP_chmap[225] = 97; IMP_chmap[226] = 97; IMP_chmap[227] = 97; IMP_chmap[228] = 97; IMP_chmap[229] = 6; IMP_chmap[230] = 4; IMP_chmap[231] = 99; IMP_chmap[232] = 101; IMP_chmap[233] = 101; IMP_chmap[234] = 101; IMP_chmap[235] = 101; IMP_chmap[236] = 105; IMP_chmap[237] = 105; IMP_chmap[238] = 105; IMP_chmap[239] = 105; IMP_chmap[240] = 100; IMP_chmap[241] = 110; IMP_chmap[242] = 111; IMP_chmap[243] = 111; IMP_chmap[244] = 111; IMP_chmap[245] = 111; IMP_chmap[246] = 111; IMP_chmap[247] = 10; IMP_chmap[248] = 5; IMP_chmap[249] = 117; IMP_chmap[250] = 117; IMP_chmap[251] = 117; IMP_chmap[252] = 117; IMP_chmap[253] = 121; IMP_chmap[254] = 32; IMP_chmap[255] = 121; } void IMAGEN_createmap(name, map) unsigned short *map; int name; { register int i, j; unsigned char s[4], *p; p = s; *p++ = 222; *p++ = name; j = 0; for (i = 0; i < 127; i++) { if (map[i]) j++; } *p = j; for (i = 0; i < 3; i++) _IO_putc (s[i], gpoutfile); s[3] = 1; for (j = 0; j < 127; j++) { if (map[j]) { p = s; *p++ = j; *p++ = map[j] >> 8; *p = map[j] & 255; for (i = 0; i < 4; i++) _IO_putc (s[i], gpoutfile); } } } # 313 "term.h" 2 # 1 "term/mif.trm" 1 # 90 "term/mif.trm" # 1 "term/driver.h" 1 # 91 "term/mif.trm" 2 # 99 "term/mif.trm" static void MIF_init (void); static void MIF_graphics (void); static void MIF_text (void); static void MIF_linetype (int linetype); static void MIF_move (unsigned int x, unsigned int y); static void MIF_vector (unsigned int x, unsigned int y); static void MIF_put_text (unsigned int x, unsigned int y, char *str); static int MIF_text_angle (int ang); static void MIF_reset (void); static void MIF_options (void); static int MIF_justify_text (enum JUSTIFY mode); static void MIF_point (unsigned int x, unsigned int y, int number); # 126 "term/mif.trm" static int insert_mif_line (double fx, double fy); static int proc_group_id (int group_id); static void free_mif_line (void); static void put_mif_line (void); static void MIF_set_font (char *); static void mif_put_point (unsigned int x, unsigned int y, int np); extern char term_options[]; extern char version[]; extern char patchlevel[]; static struct mif_line { float fpos_x; float fpos_y; struct mif_line *next; struct mif_line *prev; } mif_line = { ((0) / 1000.0), (((10000 - 1)) / 1000.0), &mif_line, &mif_line }; # 168 "term/mif.trm" static char mif_justify[64]; static char mif_pen[64], mif_pen_width[64], mif_separation[64]; static int mif_text_ang = 0; static int mif_pentype = 0; static int mif_pattern_table[16] = { 0, 1, 2, 3, 4, 8, 12, 13, 5, 9, 10, 11, 12, 13, 14, 15 }; static struct mif_group_id { int group_existance; int group_id; } mif_group_id[20]; static int mif_initialized = 0; static int mif_in_frame = 0; static int mif_frameno = -1; static int mif_colour = 1; static int mif_polyline = 1; struct mpt { int chr; float x_offset, y_offset; char *font; }; char zgnuplot[] = "ZGnuplot"; char zgnuplotp[] = "ZGnuplotP"; char zgnuplotd[] = "ZGnuplotD"; char *mif_font = ((void *)0); struct mpt mpt[6 + 1] = { {'.', 0.000, 0.005, zgnuplotd, }, {'G', 0.002, 0.084, zgnuplotp, }, {';', 0.002, 0.084, zgnuplotp, }, {'n', 0.002, 0.084, zgnuplotp, }, {'5', 0.002, 0.084, zgnuplotp, }, {'s', 0.002, 0.062, zgnuplotp, }, {'K', 0.005, 0.075, zgnuplotp, }, }; struct mpt *mif_point = &(mpt[1]); # 243 "term/mif.trm" static int insert_mif_line (double fx, double fy); static int proc_group_id (int group_id); static void MIF_options() { if (!(c_token >= num_tokens || equals(c_token,";"))) { if (!(c_token >= num_tokens || equals(c_token,";")) && almost_equals(c_token, "m$onochrome")) { mif_colour = 0; c_token++; } if (!(c_token >= num_tokens || equals(c_token,";")) && (almost_equals(c_token, "c$olor") || almost_equals(c_token, "c$olour"))) { mif_colour = 1; c_token++; } if (!(c_token >= num_tokens || equals(c_token,";")) && almost_equals(c_token, "v$ectors")) { mif_polyline = 0; c_token++; } if (!(c_token >= num_tokens || equals(c_token,";")) && almost_equals(c_token, "p$olyline")) { mif_polyline = 1; c_token++; } if (!(c_token >= num_tokens || equals(c_token,";")) && (almost_equals(c_token, "h$elp") || almost_equals(c_token, "?$"))) { fprintf(stderr, "Usage: set terminal mif [options]\n\toptions:\n\t\tcolour / Draw primitives with line types >= 0 in colour (sep. 2-7)\n\t\tmonochrome Draw primitives in black (sep. 0)\n\n\t\tpolyline / Draw lines as continous curves\n\t\tvectors Draw lines as collections of vectors\n\n\t\thelp / ? Print short usage description on stderr\n"); # 284 "term/mif.trm" c_token++; } } sprintf(term_options, "%s %s", (mif_colour == 1) ? "colour" : "monochrome", (mif_polyline == 1) ? "polyline" : "vectors"); } static void free_mif_line() { struct mif_line *tline; while (mif_line.prev != &mif_line) { tline = mif_line.prev; mif_line.prev = mif_line.prev->prev; mif_line.prev->next = &mif_line; free(tline); } mif_line.prev = &mif_line; mif_line.next = &mif_line; } static void put_mif_line() { int np, i; struct mif_line *tline; if (mif_initialized != 0 && mif_in_frame != 0) { for (tline = mif_line.next, np = 1; tline != &mif_line; tline = tline->next, np++); if (np >= 2) { fprintf(gpoutfile, "\t %s %s %s\n", ( 1 + (mif_pentype) ), mif_pen, mif_pen_width, mif_separation); fprintf(gpoutfile, "\t\t ", np); for (i = 0, tline = &mif_line; i < np; i++, tline = tline->next) { if (i % 4 == 0) fputs("\n\t\t", gpoutfile); fprintf(gpoutfile, " ", tline->fpos_x, tline->fpos_y); } fputs("\n\t>\n", gpoutfile); proc_group_id(( 1 + (mif_pentype) )); mif_pen[0] = '\0'; mif_pen_width[0] = '\0'; mif_separation[0] = '\0'; mif_line.fpos_x = mif_line.prev->fpos_x; mif_line.fpos_y = mif_line.prev->fpos_y; free_mif_line(); } } } static void mif_put_point(x, y, np) unsigned int x, y; int np; { if (mif_initialized != 0 && mif_in_frame != 0) { if (mif_polyline == 1) put_mif_line(); MIF_move(x, y); MIF_justify_text(CENTRE); fprintf(gpoutfile, "\t\n", ( 1 + (mif_pentype) )); MIF_set_font(mif_point[np].font); fprintf(gpoutfile, "\t\t %s \n", mif_line.fpos_x + mif_point[np].x_offset, mif_line.fpos_y + mif_point[np].y_offset, mif_justify, mif_point[np].chr); fputs("\t>\n", gpoutfile); proc_group_id(( 1 + (mif_pentype) )); mif_justify[0] = '\0'; } } static void MIF_point(x, y, number) unsigned int x, y; int number; { if (number < 0) { number = -1; } else { number %= 6; } mif_put_point(x, y, number); } static void MIF_init() { int i; if (mif_initialized == 0 && mif_in_frame == 0) { mif_initialized = 1; mif_in_frame = 0; free_mif_line(); mif_line.fpos_x = ((0) / 1000.0); mif_line.fpos_y = (((10000 - 1)) / 1000.0); mif_pen[0] = '\0'; mif_pen_width[0] = '\0'; mif_separation[0] = '\0'; MIF_justify_text(LEFT); for (i = 0; i < 20; i++) { mif_group_id[i].group_id = 0; mif_group_id[i].group_existance = 0; } fprintf(gpoutfile, " # Generated by gnuplot version %s patchlevel %s; identifies this as a MIF file\n#\n# show borders\n\n>\n# Set a default pen pattern, pen width, unit and font for subsequent objects\n\n\n\n\n\n>\n\t>\n\t>\n>\n#\n", # 467 "term/mif.trm" version, patchlevel, zgnuplot, 9, zgnuplotp, zgnuplotd); } } static void MIF_reset() { if (mif_initialized != 0 && mif_in_frame == 0) { fputs("#\n# End of MIFFile\n", gpoutfile); mif_initialized = 0; mif_frameno = -1; } } static void MIF_graphics() { int i; if (mif_initialized != 0 && mif_in_frame == 0) { mif_in_frame = 1; mif_frameno++; free_mif_line(); mif_line.fpos_x = ((0) / 1000.0); mif_line.fpos_y = (((10000 - 1)) / 1000.0); mif_pen[0] = '\0'; mif_pen_width[0] = '\0'; mif_separation[0] = '\0'; MIF_justify_text(LEFT); for (i = 0; i < 20; i++) { mif_group_id[i].group_id = 0; mif_group_id[i].group_existance = 0; } fprintf(gpoutfile, "#\n# Frame number %d with plot of graphics\n\n\t\n\t\n\t\n\t\n\t\n\t\n", # 536 "term/mif.trm" mif_frameno, ((float) mif_frameno) * ((10000 + 100) / 1000.0), ((15000) / 1000.0), ((10000) / 1000.0)); } } static void MIF_text() { int i; if (mif_initialized != 0 && mif_in_frame != 0) { if (mif_polyline == 1) put_mif_line(); fputs("\t#\n\t# Group the the objects in groups to make the chart easier to manipulate\n\t# after it's imported into FrameMaker.\n", gpoutfile); for (i = 0; i < 20; i++) { if (mif_group_id[i].group_id != 0 && mif_group_id[i].group_existance == 1) { fprintf(gpoutfile, "\t\n\t>\n", mif_group_id[i].group_id); } } fprintf(gpoutfile, ">\n# End of Frame number %d\n#\n", mif_frameno); mif_in_frame = 0; } } static void MIF_linetype(linetype) int linetype; { if (mif_initialized != 0 && mif_in_frame != 0) { if (mif_polyline == 1) put_mif_line(); if (linetype < 0) { if (linetype == -1) { mif_pentype = 8 + 16; if (mif_colour == 1) sprintf(mif_separation, " "); } else { mif_pentype = 0 + 16; if (mif_colour == 1) sprintf(mif_separation, " "); } sprintf(mif_pen_width, " "); } else { mif_pentype = (linetype) % 16; sprintf(mif_pen_width, " "); if (mif_colour == 1) sprintf(mif_separation, " ", 2 + (mif_pentype % 6)); } sprintf(mif_pen, " ", mif_pattern_table[mif_pentype % 16]); } } static int MIF_text_angle(ang) int ang; { if (ang != 0) mif_text_ang = 1; else mif_text_ang = 0; return (1); } static int MIF_justify_text(mode) enum JUSTIFY mode; { int rval = 1; if (mif_initialized != 0 && mif_in_frame != 0) { switch (mode) { case LEFT: sprintf(mif_justify, " "); break; case CENTRE: sprintf(mif_justify, " "); break; case RIGHT: sprintf(mif_justify, " "); break; default: rval = 0; break; } } else { rval = 0; } return (rval); } static void MIF_vector(x, y) unsigned int x, y; { if (mif_initialized != 0 && mif_in_frame != 0) { insert_mif_line(((x) / 1000.0), (((10000 - 1) - (int) y) / 1000.0)); if (mif_polyline == 0) put_mif_line(); } } static void MIF_move(x, y) unsigned int x, y; { if (mif_initialized != 0 && mif_in_frame != 0) { if (mif_polyline == 1) put_mif_line(); mif_line.fpos_x = ((x) / 1000.0); mif_line.fpos_y = (((10000 - 1) - (int) y) / 1000.0); } } static void MIF_set_font(font) char *font; { if (font != mif_font) { fprintf(gpoutfile, "\t\t\n\t\t>\n", font); mif_font = font; } } static void MIF_put_text(x, y, str) unsigned int x, y; char str[]; { if (mif_initialized != 0 && mif_in_frame != 0) { if (mif_polyline == 1) put_mif_line(); MIF_move(x, y - (10000/31) / 5); if (strlen(str) > 0) { fprintf(gpoutfile, "\t %s %s %s\n", ( 1 + (mif_pentype) ), mif_pen, mif_pen_width, mif_separation); MIF_set_font(zgnuplot); fprintf(gpoutfile, "\t\t %s %s \n\t>\n", mif_line.fpos_x, mif_line.fpos_y, mif_justify, (mif_text_ang == 1) ? "" : "", str); proc_group_id(( 1 + (mif_pentype) )); mif_pen[0] = '\0'; mif_pen_width[0] = '\0'; mif_separation[0] = '\0'; mif_justify[0] = '\0'; } } } static int insert_mif_line(fx, fy) double fx, fy; { int rval = 1; if ((mif_line.prev->next = (struct mif_line *) gp_alloc(sizeof(struct mif_line), "MIF driver")) != (struct mif_line *) ((void *)0)) { mif_line.prev->next->next = &mif_line; mif_line.prev->next->prev = mif_line.prev; mif_line.prev = mif_line.prev->next; mif_line.prev->fpos_x = fx; mif_line.prev->fpos_y = fy; rval = 1; } else { mif_line.prev->next = &mif_line; rval = 0; } return (rval); } static int proc_group_id(group_id) int group_id; { int i, rval = 0; if (mif_initialized != 0 && mif_in_frame != 0) { for (i = 0; i < 20 && mif_group_id[i].group_id != 0 && mif_group_id[i].group_id != group_id; i++) { } if (i < 20) { if (mif_group_id[i].group_id == 0) { mif_group_id[i].group_id = group_id; mif_group_id[i].group_existance = 0; } else { if (mif_group_id[i].group_id == group_id) { mif_group_id[i].group_existance = 1; rval = 1; } } } else { rval = -2; } } else { rval = -1; } return (rval); } # 319 "term.h" 2 # 1 "term/pbm.trm" 1 # 63 "term/pbm.trm" # 1 "term/driver.h" 1 # 64 "term/pbm.trm" 2 static void PBMoptions (void); static void PBMinit (void); static void PBMreset (void); static void PBMsetfont (void); static void PBMgraphics (void); static void PBMmonotext (void); static void PBMgraytext (void); static void PBMcolortext (void); static void PBMtext (void); static void PBMlinetype (int linetype); static void PBMpoint (unsigned int x, unsigned int y, int point); # 93 "term/pbm.trm" static int pbm_font = 1; static int pbm_mode = 0; static int pgm_gray[] = { 7, 1, 6, 5, 4, 3, 2, 1, 7 }; static int ppm_color[] ={ 15, 8, 3, 5, 6, 2, 4, 1, 11, 13, 14 }; static void PBMoptions() { pbm_font = 1; pbm_mode = 0; term_options[0] = ('\0'); while (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "s$mall")) pbm_font = 1; else if (almost_equals(c_token, "me$dium")) pbm_font = 2; else if (almost_equals(c_token, "l$arge")) pbm_font = 3; else if (almost_equals(c_token, "mo$nochrome")) pbm_mode = 0; else if (almost_equals(c_token, "g$ray")) pbm_mode = 1; else if (almost_equals(c_token, "c$olor") || almost_equals(c_token, "c$olour")) pbm_mode = 2; else { pbm_font = 1; pbm_mode = 0; int_error("expecting: {small, medium, large} and {monochrome, gray, color}", c_token); } c_token++; } switch (pbm_font) { case 1: strcat(term_options, "small"); break; case 2: strcat(term_options, "medium"); break; case 3: strcat(term_options, "large"); break; } switch (pbm_mode) { case 0: strcat(term_options, " monochrome"); break; case 1: strcat(term_options, " gray"); break; case 2: strcat(term_options, " color"); break; } } static void PBMinit() { PBMsetfont(); } static void PBMreset() { } static void PBMsetfont() { switch (pbm_font) { case 1: b_charsize(0); term->v_char = 11; term->h_char = 7; term->v_tic = 5; term->h_tic = 5; break; case 2: b_charsize(1); term->v_char = 21; term->h_char = 13; term->v_tic = 9; term->h_tic = 9; break; case 3: b_charsize(2); term->v_char = 31; term->h_char = 19; term->v_tic = 13; term->h_tic = 13; break; } } static void PBMgraphics() { int numplanes = 1; switch (pbm_mode) { case 1: numplanes = 3; break; case 2: numplanes = 4; break; } b_makebitmap((unsigned int) ((480) * ysize), (unsigned int) ((640) * xsize), numplanes); b_rastermode = 1; if (pbm_mode != 0) b_setlinetype(0); } static void PBMmonotext() { register int x, j, row; fputs("P4\n", gpoutfile); fprintf(gpoutfile, "%u %u\n", b_ysize, b_xsize); for (x = b_xsize - 1; x >= 0; x--) { row = (b_ysize / 8) - 1; for (j = row; j >= 0; j--) { (void) fputc((char) (*((*b_p)[j] + x)), gpoutfile); } } b_freebitmap(); } static void PBMgraytext() { register int x, j, row; register int i, value; int mask, plane1, plane2, plane3; fprintf(gpoutfile, "P5\n%u %u\n%u\n", b_ysize, b_xsize, 255); for (x = b_xsize - 1; x >= 0; x--) { row = (b_ysize / 8) - 1; for (j = row; j >= 0; j--) { mask = 0x80; plane1 = (*((*b_p)[j] + x)); plane2 = (*((*b_p)[j + b_psize] + x)); plane3 = (*((*b_p)[j + b_psize + b_psize] + x)); for (i = 0; i < 8; i++) { value = 255; if (plane1 & mask) value -= 36; if (plane2 & mask) value -= 73; if (plane3 & mask) value -= 146; (void) fputc((char) (value), gpoutfile); mask >>= 1; } } } b_freebitmap(); } static void PBMcolortext() { register int x, j, row; register int i; int mask, plane1, plane2, plane3, plane4; int red, green, blue; fprintf(gpoutfile, "P6\n%u %u\n%u\n", b_ysize, b_xsize, 255); for (x = b_xsize - 1; x >= 0; x--) { row = (b_ysize / 8) - 1; for (j = row; j >= 0; j--) { mask = 0x80; plane1 = (*((*b_p)[j] + x)); plane2 = (*((*b_p)[j + b_psize] + x)); plane3 = (*((*b_p)[j + b_psize + b_psize] + x)); plane4 = (*((*b_p)[j + b_psize + b_psize + b_psize] + x)); for (i = 0; i < 8; i++) { red = (plane3 & mask) ? 1 : 3; green = (plane2 & mask) ? 1 : 3; blue = (plane1 & mask) ? 1 : 3; if (plane4 & mask) { red--; green--; blue--; } (void) fputc((char) (red * 85), gpoutfile); (void) fputc((char) (green * 85), gpoutfile); (void) fputc((char) (blue * 85), gpoutfile); mask >>= 1; } } } b_freebitmap(); } static void PBMtext() { switch (pbm_mode) { case 0: PBMmonotext(); break; case 1: PBMgraytext(); break; case 2: PBMcolortext(); break; } } static void PBMlinetype(linetype) int linetype; { switch (pbm_mode) { case 0: b_setlinetype(linetype); break; case 1: if (linetype >= 7) linetype %= 7; b_setvalue(pgm_gray[linetype + 2]); break; case 2: if (linetype >= 9) linetype %= 9; b_setvalue(ppm_color[linetype + 2]); break; } } static void PBMpoint(x, y, point) unsigned int x, y; int point; { if (pbm_mode == 0) line_and_point(x, y, point); else do_point(x, y, point); } # 322 "term.h" 2 # 1 "term/post.trm" 1 # 60 "term/post.trm" # 1 "term/driver.h" 1 # 61 "term/post.trm" 2 static void PS_options (void); static void PS_common_init (int encap, int portrait, int uses_fonts, unsigned int xoff, unsigned int yoff, unsigned int bb_xmin, unsigned int bb_ymin, unsigned int bb_xmax, unsigned int bb_ymax, char **dict); static void PS_init (void); static void PS_graphics (void); static void PS_text (void); static void PS_reset (void); static void PS_linetype (int linetype); static void PS_move (unsigned int x, unsigned int y); static void PS_vector (unsigned int x, unsigned int y); static void PS_put_text (unsigned int x, unsigned int y, char *str); static void ENHPS_put_text (unsigned int x, unsigned int y, char *str); static int PS_text_angle (int ang); static int PS_justify_text (enum JUSTIFY mode); static void PS_point (unsigned int x, unsigned int y, int number); static int PS_set_font (char * font); static int ENHPS_set_font (char * font); static void PS_fillbox (int style, unsigned int x1, unsigned int y1, unsigned int width, unsigned int height); static void PS_linewidth (double linewidth); static void PS_pointsize (double ptsize); # 110 "term/post.trm" extern char version[]; extern char patchlevel[]; static char *PS_RememberFont (char *fname, int reencode); static void ENHPS_put_text (unsigned int x, unsigned int y, char *str); static char *ENHPS_recurse (char *p, TBOOLEAN brace, char *fontname, double fontsize, double base, TBOOLEAN widthflag, TBOOLEAN showflag); static char ps_font[50 +1] = "Helvetica" ; static int ps_fontsize = 14; static char ps_enh_font[50 +1]; static int ps_enh_fontsize; static TBOOLEAN ps_portrait = 0; static TBOOLEAN ps_color = 0; static TBOOLEAN ps_solid = 0; static TBOOLEAN ps_eps = 0; static int ps_page=0; static int ps_path_count=0; static int ps_ang=0; static enum JUSTIFY ps_justify=LEFT; static TBOOLEAN ps_duplex_state = 0; static TBOOLEAN ps_duplex_option = 0; static char * PS_header[] = { "/M {moveto} bind def\n", "/L {lineto} bind def\n", "/R {rmoveto} bind def\n", "/V {rlineto} bind def\n", "/vpt2 vpt 2 mul def\n", "/hpt2 hpt 2 mul def\n", "/Lshow { currentpoint stroke M\n", " 0 vshift R show } def\n", "/Rshow { currentpoint stroke M\n", " dup stringwidth pop neg vshift R show } def\n", "/Cshow { currentpoint stroke M\n", " dup stringwidth pop -2 div vshift R show } def\n", "/UP { dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def\n", " /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def } def\n", "/DL { Color {setrgbcolor Solid {pop []} if 0 setdash }\n", " {pop pop pop Solid {pop []} if 0 setdash} ifelse } def\n", "/BL { stroke userlinewidth 2 mul setlinewidth } def\n", "/AL { stroke userlinewidth 2 div setlinewidth } def\n", "/UL { dup gnulinewidth mul /userlinewidth exch def\n", " 10 mul /udl exch def } def\n", "/PL { stroke userlinewidth setlinewidth } def\n", "/LTb { BL [] 0 0 0 DL } def\n", "/LTa { AL [1 udl mul 2 udl mul] 0 setdash 0 0 0 setrgbcolor } def\n", "/LT0 { PL [] 1 0 0 DL } def\n", "/LT1 { PL [4 dl 2 dl] 0 1 0 DL } def\n", "/LT2 { PL [2 dl 3 dl] 0 0 1 DL } def\n", "/LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def\n", "/LT4 { PL [5 dl 2 dl 1 dl 2 dl] 0 1 1 DL } def\n", "/LT5 { PL [4 dl 3 dl 1 dl 3 dl] 1 1 0 DL } def\n", "/LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def\n", "/LT7 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.3 0 DL } def\n", "/LT8 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def\n", "/Pnt { stroke [] 0 setdash\n", " gsave 1 setlinecap M 0 0 V stroke grestore } def\n", "/Dia { stroke [] 0 setdash 2 copy vpt add M\n", " hpt neg vpt neg V hpt vpt neg V\n", " hpt vpt V hpt neg vpt V closepath stroke\n", " Pnt } def\n", "/Pls { stroke [] 0 setdash vpt sub M 0 vpt2 V\n", " currentpoint stroke M\n", " hpt neg vpt neg R hpt2 0 V stroke\n", " } def\n", "/Box { stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M\n", " 0 vpt2 neg V hpt2 0 V 0 vpt2 V\n", " hpt2 neg 0 V closepath stroke\n", " Pnt } def\n", "/Crs { stroke [] 0 setdash exch hpt sub exch vpt add M\n", " hpt2 vpt2 neg V currentpoint stroke M\n", " hpt2 neg 0 R hpt2 vpt2 V stroke } def\n", "/TriU { stroke [] 0 setdash 2 copy vpt 1.12 mul add M\n", " hpt neg vpt -1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt 1.62 mul V closepath stroke\n", " Pnt } def\n", "/Star { 2 copy Pls Crs } def\n", "/BoxF { stroke [] 0 setdash exch hpt sub exch vpt add M\n", " 0 vpt2 neg V hpt2 0 V 0 vpt2 V\n", " hpt2 neg 0 V closepath fill } def\n", "/TriUF { stroke [] 0 setdash vpt 1.12 mul add M\n", " hpt neg vpt -1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt 1.62 mul V closepath fill } def\n", "/TriD { stroke [] 0 setdash 2 copy vpt 1.12 mul sub M\n", " hpt neg vpt 1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt -1.62 mul V closepath stroke\n", " Pnt } def\n", "/TriDF { stroke [] 0 setdash vpt 1.12 mul sub M\n", " hpt neg vpt 1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt -1.62 mul V closepath fill} def\n", "/DiaF { stroke [] 0 setdash vpt add M\n", " hpt neg vpt neg V hpt vpt neg V\n", " hpt vpt V hpt neg vpt V closepath fill } def\n", "/Pent { stroke [] 0 setdash 2 copy gsave\n", " translate 0 hpt M 4 {72 rotate 0 hpt L} repeat\n", " closepath stroke grestore Pnt } def\n", "/PentF { stroke [] 0 setdash gsave\n", " translate 0 hpt M 4 {72 rotate 0 hpt L} repeat\n", " closepath fill grestore } def\n", "/Circle { stroke [] 0 setdash 2 copy\n", " hpt 0 360 arc stroke Pnt } def\n", "/CircleF { stroke [] 0 setdash hpt 0 360 arc fill } def\n", "/C0 { BL [] 0 setdash 2 copy moveto vpt 90 450 arc } bind def\n", "/C1 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 0 90 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C2 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 90 180 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C3 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 0 180 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C4 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 180 270 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C5 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 0 90 arc\n", " 2 copy moveto\n", " 2 copy vpt 180 270 arc closepath fill\n", " vpt 0 360 arc } bind def\n", "/C6 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 90 270 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C7 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 0 270 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C8 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 270 360 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C9 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 270 450 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C10 { BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill\n", " 2 copy moveto\n", " 2 copy vpt 90 180 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C11 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 0 180 arc closepath fill\n", " 2 copy moveto\n", " 2 copy vpt 270 360 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C12 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 180 360 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C13 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 0 90 arc closepath fill\n", " 2 copy moveto\n", " 2 copy vpt 180 360 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/C14 { BL [] 0 setdash 2 copy moveto\n", " 2 copy vpt 90 360 arc closepath fill\n", " vpt 0 360 arc } bind def\n", "/C15 { BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill\n", " vpt 0 360 arc closepath } bind def\n", "/Rec { newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto\n", " neg 0 rlineto closepath } bind def\n", "/Square { dup Rec } bind def\n", "/Bsquare { vpt sub exch vpt sub exch vpt2 Square } bind def\n", "/S0 { BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare } bind def\n", "/S1 { BL [] 0 setdash 2 copy vpt Square fill Bsquare } bind def\n", "/S2 { BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def\n", "/S3 { BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare } bind def\n", "/S4 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def\n", "/S5 { BL [] 0 setdash 2 copy 2 copy vpt Square fill\n", " exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def\n", "/S6 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare } bind def\n", "/S7 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill\n", " 2 copy vpt Square fill\n", " Bsquare } bind def\n", "/S8 { BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare } bind def\n", "/S9 { BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare } bind def\n", "/S10 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill\n", " Bsquare } bind def\n", "/S11 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill\n", " Bsquare } bind def\n", "/S12 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare } bind def\n", "/S13 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill\n", " 2 copy vpt Square fill Bsquare } bind def\n", "/S14 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill\n", " 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def\n", "/S15 { BL [] 0 setdash 2 copy Bsquare fill Bsquare } bind def\n", "/D0 { gsave translate 45 rotate 0 0 S0 stroke grestore } bind def\n", "/D1 { gsave translate 45 rotate 0 0 S1 stroke grestore } bind def\n", "/D2 { gsave translate 45 rotate 0 0 S2 stroke grestore } bind def\n", "/D3 { gsave translate 45 rotate 0 0 S3 stroke grestore } bind def\n", "/D4 { gsave translate 45 rotate 0 0 S4 stroke grestore } bind def\n", "/D5 { gsave translate 45 rotate 0 0 S5 stroke grestore } bind def\n", "/D6 { gsave translate 45 rotate 0 0 S6 stroke grestore } bind def\n", "/D7 { gsave translate 45 rotate 0 0 S7 stroke grestore } bind def\n", "/D8 { gsave translate 45 rotate 0 0 S8 stroke grestore } bind def\n", "/D9 { gsave translate 45 rotate 0 0 S9 stroke grestore } bind def\n", "/D10 { gsave translate 45 rotate 0 0 S10 stroke grestore } bind def\n", "/D11 { gsave translate 45 rotate 0 0 S11 stroke grestore } bind def\n", "/D12 { gsave translate 45 rotate 0 0 S12 stroke grestore } bind def\n", "/D13 { gsave translate 45 rotate 0 0 S13 stroke grestore } bind def\n", "/D14 { gsave translate 45 rotate 0 0 S14 stroke grestore } bind def\n", "/D15 { gsave translate 45 rotate 0 0 S15 stroke grestore } bind def\n", "/DiaE { stroke [] 0 setdash vpt add M\n", " hpt neg vpt neg V hpt vpt neg V\n", " hpt vpt V hpt neg vpt V closepath stroke } def\n", "/BoxE { stroke [] 0 setdash exch hpt sub exch vpt add M\n", " 0 vpt2 neg V hpt2 0 V 0 vpt2 V\n", " hpt2 neg 0 V closepath stroke } def\n", "/TriUE { stroke [] 0 setdash vpt 1.12 mul add M\n", " hpt neg vpt -1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt 1.62 mul V closepath stroke } def\n", "/TriDE { stroke [] 0 setdash vpt 1.12 mul sub M\n", " hpt neg vpt 1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt -1.62 mul V closepath stroke } def\n", "/PentE { stroke [] 0 setdash gsave\n", " translate 0 hpt M 4 {72 rotate 0 hpt L} repeat\n", " closepath stroke grestore } def\n", "/CircE { stroke [] 0 setdash \n", " hpt 0 360 arc stroke } def\n", "/Opaque { gsave closepath 1 setgray fill grestore 0 setgray closepath } def\n", "/DiaW { stroke [] 0 setdash vpt add M\n", " hpt neg vpt neg V hpt vpt neg V\n", " hpt vpt V hpt neg vpt V Opaque stroke } def\n", "/BoxW { stroke [] 0 setdash exch hpt sub exch vpt add M\n", " 0 vpt2 neg V hpt2 0 V 0 vpt2 V\n", " hpt2 neg 0 V Opaque stroke } def\n", "/TriUW { stroke [] 0 setdash vpt 1.12 mul add M\n", " hpt neg vpt -1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt 1.62 mul V Opaque stroke } def\n", "/TriDW { stroke [] 0 setdash vpt 1.12 mul sub M\n", " hpt neg vpt 1.62 mul V\n", " hpt 2 mul 0 V\n", " hpt neg vpt -1.62 mul V Opaque stroke } def\n", "/PentW { stroke [] 0 setdash gsave\n", " translate 0 hpt M 4 {72 rotate 0 hpt L} repeat\n", " Opaque stroke grestore } def\n", "/CircW { stroke [] 0 setdash \n", " hpt 0 360 arc Opaque stroke } def\n", "/BoxFill { gsave Rec 1 setgray fill grestore } def\n", ((void *)0) }; static char * ENHPS_header[] = { "/MFshow {{dup dup 0 get findfont exch 1 get scalefont setfont\n", " [ currentpoint ] exch dup 2 get 0 exch rmoveto dup dup 5 get exch 4 get\n", " {show} {stringwidth pop 0 rmoveto}ifelse dup 3 get\n", " {2 get neg 0 exch rmoveto pop} {pop aload pop moveto}ifelse} forall} bind def\n", "/MFwidth {0 exch {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont\n", " 5 get stringwidth pop add}\n", " {pop} ifelse} forall} bind def\n", "/MLshow { currentpoint stroke M\n", " 0 exch R MFshow } bind def\n", "/MRshow { currentpoint stroke M\n", " exch dup MFwidth neg 3 -1 roll R MFshow } def\n", "/MCshow { currentpoint stroke M\n", " exch dup MFwidth -2 div 3 -1 roll R MFshow } def\n", ((void *)0) }; static struct PS_FontName { char *name; struct PS_FontName *next; } *PS_DocFonts = ((void *)0); static char *PS_RememberFont(fname, can_reencode) char *fname; int can_reencode; { struct PS_FontName *fnp; char *recode = ((void *)0); for (fnp=PS_DocFonts; fnp ; fnp = fnp->next) if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (fnp->name) && __builtin_constant_p (fname) && (__s1_len = strlen (fnp->name), __s2_len = strlen (fname), (!((size_t)(const void *)((fnp->name) + 1) - (size_t)(const void *)(fnp->name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((fname) + 1) - (size_t)(const void *)(fname) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) (fnp->name), (__const char *) (fname), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p (fnp->name) && ((size_t)(const void *)((fnp->name) + 1) - (size_t)(const void *)(fnp->name) == 1) && (__s1_len = strlen (fnp->name), __s1_len < 4) ? (__builtin_constant_p (fname) && ((size_t)(const void *)((fname) + 1) - (size_t)(const void *)(fname) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (fnp->name))[0] - ((__const unsigned char *) (__const char *)(fname))[0]); if (__s1_len > 0 && __result == 0) ! { __result = (((__const unsigned char *) (__const char *) (fnp->name))[1] - ((__const unsigned char *) (__const char *) (fname))[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (fnp->name))[2] - ((__const unsigned char *) (__const char *) (fname))[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (fnp->name))[3] - ((__const unsigned char *) (__const char *) (fname))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (fname); register int __result = (((__const unsigned char *) (__const char *) (fnp->name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (fnp->name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (fnp->name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const uns! igned char *) (__const char *) (fnp->name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (fname) && ((size_t)(const void *)((fname) + 1) - (size_t)(const void *)(fname) == 1) && (__s2_len = strlen (fname), __s2_len < 4) ? (__builtin_constant_p (fnp->name) && ((size_t)(const void *)((fnp->name) + 1) - (size_t)(const void *)(fnp->name) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) (fnp->name))[0] - ((__const unsigned char *) (__const char *)(fname))[0]); if (__s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (fnp->name))[1] - ((__const unsigned char *) (__const char *) (fname))[1]); if (__s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (fnp->name))[2] - ((__const unsigned char *) (__const char *) (fname))[2]); if (__s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (fnp->name))[3] - ((__const unsigned char! *) (__const char *) (fname))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (fnp->name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (fname))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (fname))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (fname))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (fname))[3]); } } __result; }))) : strcmp (fnp->name, fname)))); })==0) return ((void *)0); fnp = (struct PS_FontName *)gp_alloc(sizeof(struct PS_FontName), "PostScript Font record"); fnp->name = gp_alloc(1+strlen(fname), "PostScript Font name"); (__extension__ (__builtin_constant_p (fname) ? (((size_t)(const void *)((fname) + 1) - (size_t)(const void *)(fname) == 1) && strlen (fname) + 1 <= 8 ? __strcpy_small (fnp->name, __extension__ (((__const unsigned char *) (__const char *) (fname))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (fname))[0]), __extension__ (((__const unsigned char *) (__const char *) (fname))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (fname))[4]), __extension__ (((((__const unsigned char *) (__const char *) (fname))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (fname))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (fname))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (fname))[0]), __extension__ (((((__const unsigned char *) (__const char *) (fname))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (fname))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (fname))[4 + 1]) << 8 | ((__const unsigned char *) (_! _const char *) (fname))[4]), strlen (fname) + 1) : (char *) memcpy (fnp->name, fname, strlen (fname) + 1)) : strcpy (fnp->name, fname))); fnp->next = PS_DocFonts; PS_DocFonts = fnp; switch(encoding) { case 1: recode = "reencodeISO def\n"; break; case 2: recode = "reencodeCP437 def\n"; break; case 3 : recode = "reencodeCP850 def\n"; break; } if (can_reencode && recode) { fprintf(gpoutfile,"/%s %s",fname, recode); return ((void *)0); } else return recode; } static int PS_pen_x, PS_pen_y; static int PS_taken; static int PS_linetype_last; static TBOOLEAN PS_relative_ok; static void PS_options() { if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token,"p$ortrait")) { ps_portrait=1; ps_eps=0; c_token++; } else if (almost_equals(c_token,"l$andscape")) { ps_portrait=0; ps_eps=0; c_token++; } else if (almost_equals(c_token,"ep$sf")) { ps_portrait=1; ps_eps = 1; c_token++; } else if (almost_equals(c_token,"d$efault")) { ps_portrait=0; ps_eps=0; ps_color=0; ps_solid=0; ps_duplex_option=0; (__extension__ (__builtin_constant_p ("Helvetica") ? (((size_t)(const void *)(("Helvetica") + 1) - (size_t)(const void *)("Helvetica") == 1) && strlen ("Helvetica") + 1 <= 8 ? __strcpy_small (ps_font, __extension__ (((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 2]) v_char = (unsigned int)(ps_fontsize*(10)); term->h_char = (unsigned int)(ps_fontsize*(10)*6/10); term->put_text = PS_put_text; c_token++; } } if (almost_equals(c_token, "enh$anced")) { term->put_text = ENHPS_put_text; term->set_font = ENHPS_set_font; ++c_token; } else if (almost_equals(c_token, "noenh$anced")) { term->put_text = PS_put_text; term->set_font = PS_set_font; ++c_token; } if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token,"m$onochrome")) { ps_color=0; c_token++; } else if (almost_equals(c_token,"c$olor") || almost_equals(c_token,"c$olour")) { ps_color=1; c_token++; } } if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token,"so$lid")) { ps_solid=1; c_token++; } else if (almost_equals(c_token,"da$shed")) { ps_solid=0; c_token++; } } if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token,"si$mplex")) { ps_duplex_state = 0; ps_duplex_option = 1; c_token++; } else if (almost_equals(c_token,"du$plex")) { ps_duplex_state = 1; ps_duplex_option = 1; c_token++; } else if (almost_equals(c_token,"defaultp$lex")) { ps_duplex_option = 0; c_token++; } } if (!(c_token >= num_tokens || equals(c_token,";")) && isstring(c_token)) { quote_str(ps_font,c_token, 50); c_token++; } if (!(c_token >= num_tokens || equals(c_token,";"))) { struct value a; ps_fontsize = (int)real(const_express(&a)); term->v_char = (unsigned int)(ps_fontsize*(10)); term->h_char = (unsigned int)(ps_fontsize*(10)*6/10); } sprintf(default_font,"%s,%d",ps_font,ps_fontsize); sprintf(term_options,"%s %senhanced %s %s %s \"%s\" %d", ps_eps ? "eps" : (ps_portrait ? "portrait" : "landscape"), term->put_text == ENHPS_put_text ? "" : "no", ps_color ? "color" : "monochrome", ps_solid ? "solid" : "dashed", ps_duplex_option ? (ps_duplex_state ? "duplex" : "simplex") : "defaultplex", ps_font,ps_fontsize); } static int ps_common_encap; static int ps_common_portrait; static int ps_common_uses_fonts; static unsigned int ps_common_xoff, ps_common_yoff; static void PS_common_init(encap, portrait, uses_fonts, xoff, yoff, bb_xmin, bb_ymin, bb_xmax, bb_ymax, dict) int encap; int portrait; int uses_fonts; unsigned int xoff, yoff; unsigned int bb_xmin, bb_ymin, bb_xmax, bb_ymax; char **dict; { static char psi1[] = "%%%%Creator: gnuplot %s patchlevel %s\n%%%%CreationDate: %s%%%%DocumentFonts: %s\n"; static char psi2[] = "%%%%EndComments\n/gnudict 256 dict def\ngnudict begin\n/Color %s def\n/Solid %s def\n/gnulinewidth %.3f def\n/userlinewidth gnulinewidth def\n/vshift %d def\n/dl {%d mul} def\n/hpt_ %.1f def\n/vpt_ %.1f def\n/hpt hpt_ def\n/vpt vpt_ def\n"; # 675 "term/post.trm" static char * PS_iso_8859_1_encoding[] = { "/reencodeISO {\n", "dup dup findfont dup length dict begin\n", "{ 1 index /FID ne { def }{ pop pop } ifelse } forall\n", "currentdict /CharStrings known {\n", "\tCharStrings /Idieresis known {\n", "\t\t/Encoding ISOLatin1Encoding def } if\n} if\n", "currentdict end definefont\n", "} def\n", "/ISOLatin1Encoding [\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright\n", "/parenleft/parenright/asterisk/plus/comma/minus/period/slash\n", "/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon\n", "/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N\n", "/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright\n", "/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m\n", "/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve\n", "/dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut\n", "/ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar\n", "/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot\n", "/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior\n", "/acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine\n", "/guillemotright/onequarter/onehalf/threequarters/questiondown\n", "/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla\n", "/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex\n", "/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis\n", "/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute\n", "/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis\n", "/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave\n", "/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex\n", "/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis\n", "/yacute/thorn/ydieresis\n", "] def\n", ((void *)0) }; # 728 "term/post.trm" static char * PS_cp_437_encoding[] = { "/reencodeCP437 {\n", "dup dup findfont dup length dict begin\n", "{ 1 index /FID ne { def }{ pop pop } ifelse } forall\n", "currentdict /CharStrings known {\n", "\tCharStrings /Idieresis known {\n", "\t\t/Encoding CP437Encoding def } if\n} if\n", "currentdict end definefont\n", "} def\n", "/CP437Encoding [\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright\n", "/parenleft/parenright/asterisk/plus/comma/minus/period/slash\n", "/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon\n", "/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N\n", "/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright\n", "/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m\n", "/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde/.notdef\n", "/Ccedilla/udieresis/eacute/acircumflex/adieresis/agrave/aring/ccedilla\n", "/ecircumflex/edieresis/egrave/idieresis/icircumflex/igrave/Adieresis/Aring\n", "/Eacute/ae/AE/ocircumflex/odieresis/ograve/ucircumflex/ugrave\n", "/ydieresis/Odieresis/Udieresis/cent/sterling/yen/.notdef/florin\n", "/aacute/iacute/oacute/uacute/ntilde/Ntilde/ordfeminine/ordmasculine\n", "/questiondown/.notdef/logicalnot/onehalf/onequarter/exclamdown/guillemotleft/guillemotright\n", "/space/space/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/germandbls/.notdef/.notdef/.notdef/.notdef/mu/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/infinity/.notdef/.notdef/.notdef\n", "/.notdef/plusminus/greaterequal/lessequal/.notdef/.notdef/divide/.notdef\n", "/degree/bullet/periodcentered/.notdef/nsuperior/twosuperior/.notdef\n", "] def\n", ((void *)0) }; # 776 "term/post.trm" static char * PS_cp_850_encoding[] = { "/reencodeCP850 {\n", "dup dup findfont dup length dict begin\n", "{ 1 index /FID ne { def }{ pop pop } ifelse } forall\n", "currentdict /CharStrings known {\n", "\tCharStrings /Idieresis known {\n", "\t\t/Encoding CP850Encoding def } if\n} if\n", "currentdict end definefont\n", "} def\n", "/CP850Encoding [\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n", "/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright\n", "/parenleft/parenright/asterisk/plus/comma/minus/period/slash\n", "/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon\n", "/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N\n", "/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright\n", "/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m\n", "/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde/.notdef\n", "/Ccedilla/udieresis/eacute/acircumflex/adieresis/agrave/aring/ccedilla\n", "/ecircumflex/edieresis/egrave/idieresis/icircumflex/igrave/Adieresis/Aring\n", "/Eacute/ae/AE/ocircumflex/odieresis/ograve/ucircumflex/ugrave\n", "/ydieresis/Odieresis/Udieresis/oslash/sterling/Oslash/multiply/florin\n", "/aacute/iacute/oacute/uacute/ntilde/Ntilde/ordfeminine/ordmasculine\n", "/questiondown/registered/logicalnot/onehalf/onequarter/exclamdown/guillemotleft/guillemotright\n", "/space/space/.notdef/.notdef/.notdef/Aacute/Acircumflex/Agrave\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/cent/yen/.notdef\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/atilde/Atilde\n", "/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/currency\n", "/eth/Eth/Ecircumflex/Edieresis/Egrave/dotlessi/Iacute/Icircumflex\n", "/Idieresis/.notdef/.notdef/.notdef/.notdef/brokenbar/Igrave/.notdef\n", "/Oacute/germandbls/Ocircumflex/Ograve/otilde/Otilde/mu/thorn\n", "/Thorn/Uacute/Ucircumflex/Ugrave/yacute/Yacute/macron/acute\n", "/hyphen/plusminus/equal/threequarters/paragraph/section/divide/.notdef\n", "/degree/.notdef/periodcentered/onesuperior/threesuperior/twosuperior/.notdef\n", "] def\n", ((void *)0) }; struct TERMENTRY *t = term; int i; time_t now; ps_common_encap = encap; ps_common_portrait = portrait; ps_common_uses_fonts = uses_fonts; ps_common_xoff = xoff; ps_common_yoff = yoff; ps_page = 0; if (!encap) fprintf(gpoutfile,"%%!PS-Adobe-2.0\n"); else fprintf(gpoutfile,"%%!PS-Adobe-2.0 EPSF-2.0\n"); if (outstr) fprintf(gpoutfile, "%%%%Title: %s\n", outstr ); time(&now); fprintf(gpoutfile, psi1, version, patchlevel, asctime(localtime(&now)), uses_fonts ? "(atend)" : ""); fprintf(gpoutfile,"%%%%BoundingBox: %d %d %d %d\n", xoff + bb_xmin, yoff + bb_ymin, xoff + bb_xmax, yoff + bb_ymax); fprintf(gpoutfile,"%%%%Orientation: %s\n", ps_portrait ? "Portrait" : "Landscape"); if (!encap) fprintf(gpoutfile,"%%%%Pages: (atend)\n"); fprintf(gpoutfile, psi2, ps_color ? "true" : "false", ps_solid ? "true" : "false", (0.5*(10)), (int)(t->v_char)/(-3), (10), (5040/80)/2.0, (5040/80)/2.0); if (uses_fonts && (encoding == 1)) { for (i=0; PS_iso_8859_1_encoding[i] != ((void *)0); i++) { fprintf(gpoutfile,"%s",PS_iso_8859_1_encoding[i]); } } if (uses_fonts && (encoding == 2)) { for (i=0; PS_cp_437_encoding[i] != ((void *)0); i++) { fprintf(gpoutfile,"%s",PS_cp_437_encoding[i]); } } if (uses_fonts && (encoding == 3)) { for (i=0; PS_cp_850_encoding[i] != ((void *)0); i++) { fprintf(gpoutfile,"%s",PS_cp_850_encoding[i]); } } for ( i=0; PS_header[i] != ((void *)0); i++) fprintf(gpoutfile,"%s",PS_header[i]); if (ps_duplex_option) fprintf(gpoutfile, "statusdict begin %s setduplexmode end\n", ps_duplex_state ? "true" : "false"); PS_RememberFont(ps_font, 1); if (dict) while (*dict) fputs(*(dict++), gpoutfile); fprintf(gpoutfile,"end\n%%%%EndProlog\n"); } static void PS_init() { unsigned int xmin_t, ymin_t, xmax_t, ymax_t; if (ps_eps) { term->xmax = 7200; term->ymax = 5040; xmin_t = 7200 * xoffset / (2*(10)); xmax_t = 7200 * (xsize + xoffset) / (2*(10)); ymin_t = 5040 * yoffset / (2*(10)); ymax_t = 5040 * (yoffset + ysize) / (2*(10)); } else if (ps_portrait) { term->xmax = 5040; term->ymax = 7200; xmin_t = 5040 * xoffset / (10); xmax_t = 5040 * (xsize + xoffset) / (10); ymin_t = 7200 * yoffset / (10); ymax_t = 7200 * (ysize + yoffset) / (10); } else { term->xmax = 7200; term->ymax = 5040; ymin_t = 7200 * xoffset / (10); ymax_t = 7200 * (xsize+xoffset) / (10); xmin_t = 5040 * (1-ysize-yoffset) / (10); xmax_t = 5040 * (1-yoffset) / (10); } (__extension__ (__builtin_constant_p (ps_font) ? (((size_t)(const void *)((ps_font) + 1) - (size_t)(const void *)(ps_font) == 1) && strlen (ps_font) + 1 <= 8 ? __strcpy_small (ps_enh_font, __extension__ (((__const unsigned char *) (__const char *) (ps_font))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0]), __extension__ (((__const unsigned char *) (__const char *) (ps_font))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[4]), __extension__ (((((__const unsigned char *) (__const char *) (ps_font))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0]), __extension__ (((((__const unsigned char *) (__const char *) (ps_font))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (ps_font))[4 + 1])! << 8 | ((__const unsigned char *) (__const char *) (ps_font))[4]), strlen (ps_font) + 1) : (char *) memcpy (ps_enh_font, ps_font, strlen (ps_font) + 1)) : strcpy (ps_enh_font, ps_font))); ps_enh_fontsize = ps_fontsize; PS_common_init(ps_eps, ps_portrait, 1, 50, 50, xmin_t, ymin_t, xmax_t, ymax_t, (term->put_text == ENHPS_put_text) ? ENHPS_header : ((void *)0)); } static void PS_graphics() { static char psg1[] = "0 setgray\nnewpath\n"; struct TERMENTRY *t = term; ps_page++; if (!ps_common_encap) fprintf(gpoutfile,"%%%%Page: %d %d\n",ps_page,ps_page); fprintf(gpoutfile,"gnudict begin\ngsave\n"); fprintf(gpoutfile,"%d %d translate\n",ps_common_xoff, ps_common_yoff); fprintf(gpoutfile,"%.3f %.3f scale\n", (ps_eps ? 0.5 : 1.0)/(10), (ps_eps ? 0.5 : 1.0)/(10)); if (!ps_common_portrait) { fprintf(gpoutfile,"90 rotate\n0 %d translate\n", (int)(-5040)); } fprintf(gpoutfile, psg1); if (ps_common_uses_fonts) fprintf(gpoutfile, "(%s) findfont %d scalefont setfont\n", ps_font, (t->v_char) ); ps_path_count = 0; PS_relative_ok = 0; PS_pen_x = PS_pen_y = -4000; PS_taken = 0; PS_linetype_last = -1; } static void PS_text() { ps_path_count = 0; fprintf(gpoutfile,"stroke\ngrestore\nend\nshowpage\n"); } static void PS_reset() { fprintf(gpoutfile,"%%%%Trailer\n"); if (ps_common_uses_fonts) { fprintf(gpoutfile,"%%%%DocumentFonts: "); while (PS_DocFonts) { struct PS_FontName *fnp; fnp = PS_DocFonts->next; fprintf(gpoutfile, "%s%s", PS_DocFonts->name, fnp ? " " : "\n"); free(PS_DocFonts->name); free(PS_DocFonts); PS_DocFonts=fnp; } } if (!ps_common_encap) fprintf(gpoutfile,"%%%%Pages: %d\n",ps_page); } static void PS_linetype(linetype) int linetype; { linetype = (linetype % 9) + 2; if (linetype < 0) linetype = 0; PS_relative_ok = 0; # 1006 "term/post.trm" PS_linetype_last = linetype; fprintf(gpoutfile,"LT%c\n", "ba012345678"[linetype]); ps_path_count = 0; } static void PS_linewidth (linewidth) double linewidth; { fprintf(gpoutfile,"%.3f UL\n",linewidth); # 1038 "term/post.trm" } static void PS_pointsize (ptsize) double ptsize; { fprintf(gpoutfile,"%.3f UP\n",ptsize); # 1067 "term/post.trm" } static void PS_move(x,y) unsigned int x,y; { int dx, dy; char abso[5+2*(3*sizeof(int))], rel[5+2*(3*sizeof(int))]; dx = x - PS_pen_x; dy = y - PS_pen_y; if (dx==0 && dy==0 && PS_relative_ok) return; sprintf(abso, "%d %d M\n", x, y); sprintf(rel, "%d %d R\n", dx, dy); if (strlen(rel) < strlen(abso) && PS_relative_ok){ fputs(rel, gpoutfile); PS_taken++; }else fputs(abso, gpoutfile); PS_relative_ok = 1; ps_path_count += 1; PS_pen_x = x; PS_pen_y = y; } static void PS_vector(x,y) unsigned int x,y; { int dx, dy; char abso[5+2*(3*sizeof(int))], rel[5+2*(3*sizeof(int))]; dx = x - PS_pen_x; dy = y - PS_pen_y; if (dx==0 && dy==0) return; sprintf(abso, "%d %d L\n", x, y); sprintf(rel, "%d %d V\n", dx, dy); if (strlen(rel) < strlen(abso) && PS_relative_ok){ fputs(rel, gpoutfile); PS_taken++; }else fputs(abso, gpoutfile); PS_relative_ok = 1; ps_path_count += 1; PS_pen_x = x; PS_pen_y = y; if (ps_path_count >= 400) { fprintf(gpoutfile,"currentpoint stroke M\n"); ps_path_count = 0; } } static void PS_put_text(x,y,str) unsigned int x, y; char *str; { char ch; if (!strlen(str)) return; PS_move(x,y); if (ps_ang != 0) fprintf(gpoutfile,"currentpoint gsave translate %d rotate 0 0 M\n" ,ps_ang*90); _IO_putc ('(', gpoutfile); ch = *str++; while(ch!='\0') { if ( (ch=='(') || (ch==')') || (ch=='\\') ) _IO_putc ('\\', gpoutfile); _IO_putc (ch, gpoutfile); ch = *str++; } switch(ps_justify) { case LEFT : fprintf(gpoutfile,") Lshow\n"); break; case CENTRE : fprintf(gpoutfile,") Cshow\n"); break; case RIGHT : fprintf(gpoutfile,") Rshow\n"); break; } if (ps_ang != 0) fprintf(gpoutfile,"grestore\n"); ps_path_count = 0; PS_relative_ok = 0; } static int PS_text_angle(ang) int ang; { ps_ang=ang; return 1; } static int PS_justify_text(mode) enum JUSTIFY mode; { ps_justify=mode; return 1; } static int PS_set_font(font) char *font; { char name[32]; int size,sep; sep=__extension__ ({ char __r0, __r1, __r2; (__builtin_constant_p (",") && ((size_t)(const void *)((",") + 1) - (size_t)(const void *)(",") == 1) ? ((__r0 = ((__const char *) (","))[0], __r0 == '\0') ? strlen (font) : ((__r1 = ((__const char *) (","))[1], __r1 == '\0') ? __strcspn_c1 (font, __r0) : ((__r2 = ((__const char *) (","))[2], __r2 == '\0') ? __strcspn_c2 (font, __r0, __r1) : (((__const char *) (","))[3] == '\0' ? __strcspn_c3 (font, __r0, __r1, __r2) : strcspn (font, ","))))) : strcspn (font, ",")); }); (__extension__ (__builtin_constant_p (font) && __builtin_constant_p (sep) ? (strlen (font) + 1 >= ((size_t) (sep)) ? (char *) memcpy (name, font, sep) : strncpy (name, font, sep)) : strncpy (name, font, sep))); name[sep]=('\0'); size=ps_fontsize; sscanf (&(font[sep+1]),"%d",&size); fprintf(gpoutfile,"/%s findfont %d scalefont setfont\n",name,size*(10)); PS_RememberFont(name,1 ); return 1; } static void PS_point(x,y,number) unsigned int x,y; int number; { static char * pointFNS[] = {"Pnt", "Pls", "Crs", "Star", "Box", "BoxF", "Circle", "CircleF", "TriU", "TriUF", "TriD", "TriDF", "Dia", "DiaF", "Pent", "PentF", "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10", "C11", "C12", "C13", "C14", "C15", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", "S11", "S12", "S13", "S14", "S15", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15", "BoxE", "CircE", "TriUE", "TriDE", "DiaE", "PentE", "BoxW", "CircW", "TriUW", "TriDW", "DiaW", "PentW" }; if (number < 0) number = -1; else number %= sizeof(pointFNS)/sizeof(pointFNS[0]) -1; fprintf(gpoutfile,"%d %d %s\n", x, y, pointFNS[number+1]); PS_relative_ok = 0; ps_path_count = 0; PS_linetype_last = -1; } static void PS_fillbox(style, x1,y1,x2,y2) int style; unsigned int x1,y1,x2,y2; { if (ps_path_count) { fprintf(gpoutfile, "stroke "); ps_path_count = 0; } fprintf(gpoutfile, "%d %d %d %d BoxFill\n", x1,y1, x2,y2); PS_relative_ok = 0; PS_linetype_last = -1; } # 1246 "term/post.trm" static TBOOLEAN ENHps_opened_string; static float ENHps_max_height, ENHps_min_height; # 1264 "term/post.trm" static char *ENHPS_recurse(p, brace, fontname, fontsize, base, widthflag, showflag) char *p, *fontname; TBOOLEAN brace, widthflag, showflag; double fontsize, base; { # 1291 "term/post.trm" { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } if (base + fontsize > ENHps_max_height) { ENHps_max_height = base + fontsize; ; } if (base < ENHps_min_height) { ENHps_min_height = base; ; } while (*p) { float shift; switch (*p) { case '}' : if (brace) return (p); fprintf(stderr, "enhpost printer driver - spurious }\n"); break; case '_' : case '^' : shift = (*p == '^') ? 0.5 : -0.3; { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } p = ENHPS_recurse(p+1, 0, fontname, fontsize*0.8, base+shift*fontsize, widthflag, showflag); break; case '{' : { char *savepos=((void *)0), save=0; char *localfontname=fontname, ch; int recode=1; float f=fontsize; if (*++p == '/') { while (*++p == ' '); if (*p=='-') { recode=0; while (*++p == ' '); } localfontname = p; while ((ch = *p) > ' ' && ch != '=' && ch != '*') ++p; save = *(savepos=p); if (ch == '=') { *p++ = '\0'; f = (float)strtod(p, &p); if (f) f *= (10); else f = fontsize; } else if (ch == '*') { *p++ = '\0'; f = (float)strtod(p, &p); if (f) f *= fontsize; else f = fontsize; } else { *p++ = '\0'; f = fontsize; } while (*p == ' ') ++p; if (*localfontname) { char *recodestring = PS_RememberFont(localfontname, recode && !ENHps_opened_string); if (recode && recodestring) { { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } fprintf(gpoutfile, "/%s %s", localfontname, recodestring); } } else localfontname = fontname; } p = ENHPS_recurse(p, 1, localfontname, f, base, widthflag, showflag); ; { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } if (savepos) *savepos = save; break; } case '@' : { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } p = ENHPS_recurse(++p, 0, fontname, fontsize, base, 0, showflag); break; case '&' : { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } p = ENHPS_recurse(++p, 0, fontname, fontsize, base, widthflag, 0); break; case '(' : case ')' : { if (!ENHps_opened_string) { fprintf(gpoutfile, "[(%s) %.1f %.1f %s %s (", fontname, fontsize, base, widthflag ? "true" : "false", showflag ? "true" : "false"); ENHps_opened_string = 1; } } fputc('\\', gpoutfile); fputc(*p, gpoutfile); break; case '\\' : if (p[1]=='\\' || p[1]=='(' || p[1]==')') { { if (!ENHps_opened_string) { fprintf(gpoutfile, "[(%s) %.1f %.1f %s %s (", fontname, fontsize, base, widthflag ? "true" : "false", showflag ? "true" : "false"); ENHps_opened_string = 1; } } fputc('\\', gpoutfile); } else if (p[1] >= '0' && p[1] <= '7') { { if (!ENHps_opened_string) { fprintf(gpoutfile, "[(%s) %.1f %.1f %s %s (", fontname, fontsize, base, widthflag ? "true" : "false", showflag ? "true" : "false"); ENHps_opened_string = 1; } } fputc('\\', gpoutfile); fputc(p[1], gpoutfile); ++p; if (p[1] >= '0' && p[1] <= '7') { fputc(p[1], gpoutfile); ++p; if (p[1] >= '0' && p[1] <= '7') { fputc(p[1], gpoutfile); ++p; } } break; } ++p; default: { if (!ENHps_opened_string) { fprintf(gpoutfile, "[(%s) %.1f %.1f %s %s (", fontname, fontsize, base, widthflag ? "true" : "false", showflag ? "true" : "false"); ENHps_opened_string = 1; } } fputc(*p, gpoutfile); } if (!brace) { { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } return(p); } if (*p) ++p; } { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } return p; } static int ENHPS_set_font(font) char *font; { ; if (*font) { int sep=__extension__ ({ char __r0, __r1, __r2; (__builtin_constant_p (",") && ((size_t)(const void *)((",") + 1) - (size_t)(const void *)(",") == 1) ? ((__r0 = ((__const char *) (","))[0], __r0 == '\0') ? strlen (font) : ((__r1 = ((__const char *) (","))[1], __r1 == '\0') ? __strcspn_c1 (font, __r0) : ((__r2 = ((__const char *) (","))[2], __r2 == '\0') ? __strcspn_c2 (font, __r0, __r1) : (((__const char *) (","))[3] == '\0' ? __strcspn_c3 (font, __r0, __r1, __r2) : strcspn (font, ","))))) : strcspn (font, ",")); }); (__extension__ (__builtin_constant_p (font) && __builtin_constant_p (sep) ? (strlen (font) + 1 >= ((size_t) (sep)) ? (char *) memcpy (ps_enh_font, font, sep) : strncpy (ps_enh_font, font, sep)) : strncpy (ps_enh_font, font, sep))); ps_enh_font[sep]=('\0'); ps_enh_fontsize=ps_fontsize; sscanf (font+sep+1,"%d",&ps_enh_fontsize); PS_RememberFont(ps_enh_font, 1); } else { (__extension__ (__builtin_constant_p (ps_font) ? (((size_t)(const void *)((ps_font) + 1) - (size_t)(const void *)(ps_font) == 1) && strlen (ps_font) + 1 <= 8 ? __strcpy_small (ps_enh_font, __extension__ (((__const unsigned char *) (__const char *) (ps_font))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0]), __extension__ (((__const unsigned char *) (__const char *) (ps_font))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[4]), __extension__ (((((__const unsigned char *) (__const char *) (ps_font))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (ps_font))[0]), __extension__ (((((__const unsigned char *) (__const char *) (ps_font))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (ps_font))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (ps_font))! [4 + 1]) << 8 | ((__const unsigned char *) (__const char *) (ps_font))[4]), strlen (ps_font) + 1) : (char *) memcpy (ps_enh_font, ps_font, strlen (ps_font) + 1)) : strcpy (ps_enh_font, ps_font))); ps_enh_fontsize = ps_fontsize; } return 1; } static void ENHPS_put_text(x, y, str) unsigned int x, y; char *str; { if (!strlen(str)) return; if (ps_path_count) { fputs(" stroke\n",gpoutfile); ps_path_count=0; PS_relative_ok=0; } # 1572 "term/post.trm" PS_move(x,y); if (ps_ang != 0) fprintf(gpoutfile,"currentpoint gsave translate %d rotate 0 0 moveto\n", ps_ang*90); fputs("[ ",gpoutfile); ENHps_opened_string = 0; ENHps_max_height = -1000; ENHps_min_height = 1000; # 1598 "term/post.trm" while (*(str = ENHPS_recurse(str, 1, ps_enh_font, (double)(ps_enh_fontsize*(10)), 0.0, 1, 1))) { { if (ENHps_opened_string) { fputs(")]\n", gpoutfile); ENHps_opened_string = 0; } } if (*str == '}') fprintf(stderr, "enhpost printer driver - ignoring spurious }\n"); else fprintf(stderr, "internal error in enhpost driver - *str=0x%x\n", *str); if (!*++str) break; } ENHps_max_height += ENHps_min_height; fprintf(gpoutfile, "] %.1f ", -ENHps_max_height/3); switch(ps_justify) { case LEFT : fprintf(gpoutfile, "MLshow\n"); break; case CENTRE : fprintf(gpoutfile, "MCshow\n"); break; case RIGHT : fprintf(gpoutfile, "MRshow\n"); break; } if (ps_ang != 0) fputs("grestore\n", gpoutfile); ps_path_count = 0; PS_relative_ok=0; } # 330 "term.h" 2 # 1 "term/qms.trm" 1 # 55 "term/qms.trm" # 1 "term/driver.h" 1 # 56 "term/qms.trm" 2 static void QMS_init (void); static void QMS_graphics (void); static void QMS_text (void); static void QMS_linetype (int linetype); static void QMS_move (unsigned int x, unsigned int y); static void QMS_vector (unsigned int x2, unsigned int y2); static void QMS_put_text (unsigned int x, unsigned int y, char str[]); static void QMS_reset (void); # 85 "term/qms.trm" static int qms_line = 0; static void QMS_init() { fputs("^PY^-\n^IOL\n^ISYNTAX00000^F^IB11000^IJ00000^IT00000\n", gpoutfile); # 99 "term/qms.trm" } static void QMS_graphics() { fputs("^IGV\n", gpoutfile); } static void QMS_text() { fputs("^IGE\n^-^,", gpoutfile); } static void QMS_linetype(linetype) int linetype; { static int width[2 + 9] = { 7, 3, 3, 3, 3, 5, 5, 5, 7, 7, 7 }; static int type[2 + 9] = { 0, 1, 0, 2, 3, 0, 2, 3, 0, 2, 3 }; # 136 "term/qms.trm" qms_line = linetype; if (linetype >= 9) linetype %= 9; fprintf(gpoutfile, "^PW%02d\n", width[linetype + 2]); switch (type[linetype + 2]) { case 1: fputs("^PV102025^G\n^V1\n", gpoutfile); break; case 2: fputs("^PV202050^G\n^V2\n", gpoutfile); break; case 3: fputs("^PV302100^G\n^V3\n", gpoutfile); break; default: case 0: fputs("^V0\n", gpoutfile); break; } } static void QMS_move(x, y) unsigned int x, y; { fprintf(gpoutfile, "^U%05d:%05d\n", 1000 + x, (6000 - 1) + 1000 - y); } static void QMS_vector(x2, y2) unsigned int x2, y2; { fprintf(gpoutfile, "^D%05d:%05d\n", 1000 + x2, (6000 - 1) + 1000 - y2); } static void QMS_put_text(x, y, str) unsigned int x, y; char str[]; { char ch; QMS_move(x, y + 120 / 3); fputs("^IGE\n", gpoutfile); ch = *str++; while (ch != ('\0')) { if (ch == '^') _IO_putc ('^', gpoutfile); _IO_putc (ch, gpoutfile); ch = *str++; } fputs("\n^IGV\n", gpoutfile); QMS_linetype(qms_line); } static void QMS_reset() { fputs("^PN^-\n", gpoutfile); } # 333 "term.h" 2 # 1 "term/table.trm" 1 # 336 "term.h" 2 # 1 "term/tgif.trm" 1 # 69 "term/tgif.trm" # 1 "term/driver.h" 1 # 70 "term/tgif.trm" 2 static void TGIF_options (void); static void TGIF_init (void); static void TGIF_reset (void); static void TGIF_text (void); static void TGIF_graphics (void); static void TGIF_move (unsigned int ux, unsigned int uy); static void TGIF_vector (unsigned int ux, unsigned int uy); static void TGIF_linetype (int linetype); static void TGIF_put_text (unsigned int ux, unsigned int uy, char *str); static int TGIF_text_angle (int ang); static int TGIF_justify_text (enum JUSTIFY mode); static void TGIF_point (unsigned int ux, unsigned int uy, int number); static void TGIF_arrow (unsigned int sx, unsigned int sy, unsigned int ex, unsigned int ey, TBOOLEAN head); static int TGIF_set_font (char *font); static void TGIF_set_pointsize (double size); # 128 "term/tgif.trm" static unsigned int uLastTgifX, uLastTgifY; static unsigned int uActNr; static unsigned int uActPage; static unsigned int uActResolution; static unsigned int uActZoom; static unsigned int uActAngle; static unsigned int uActThick; static unsigned int uActPointSize; static unsigned int uActStyle; static unsigned int uActJust; static unsigned int uXshift; static unsigned int uYshift; static unsigned int uTgifPlotCount; static unsigned int uTgifPlotRow, uTgifPlotCol; static unsigned int uTgif_win_horiz, uTgif_win_verti; static char sActColor[255]; static unsigned int uDefaultFontSize; static unsigned int uActFontSize; static char sDefaultFont[255]; static char sActFont[255]; static TBOOLEAN TgifSolid = 0; static TBOOLEAN TgifPortrait = 1; static unsigned int uTgifPlotsPerPage = 1; static unsigned int uTextAngle[] = {0, 3}; static unsigned int uLineThick[] = { 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static unsigned int uLineStyle[] = { 0, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0 }; static char *psColors[] = { "black", "black", "red", "green", "blue", "magenta", "cyan", "yellow", "DarkSeaGreen", "HotPink", "black", "coral"}; # 182 "term/tgif.trm" static int iTgifPolyCount; static unsigned int uBuffX[100], uBuffY[100]; enum eState { NEWPOLY = 100, INPOLY }; static enum eState eTgifState = NEWPOLY; static void TGIF_flush_poly (void); static void TGIF_flush_poly() { int i; if (eTgifState == INPOLY) { fprintf(gpoutfile, "poly('%s',%d,[\n\t", sActColor, iTgifPolyCount); for (i = 0; i < iTgifPolyCount - 1; i++) { fprintf(gpoutfile, "%u,%u,", uBuffX[i], uBuffY[i]); if ((i + 1) % 8 == 0) fputs("\n\t", gpoutfile); } fprintf(gpoutfile, "%u,%u],0,%u,1,%u,0,0,%u,0,8,3,0,[\n]).\n", uBuffX[iTgifPolyCount - 1], uBuffY[iTgifPolyCount - 1], uActThick, uActNr, uActStyle); uActNr++; eTgifState = NEWPOLY; iTgifPolyCount = 0; if (gpoutfile != (FILE *) ((void *)0)) fflush(gpoutfile); } } static void TGIF_options() { struct value a, b; double dscaleH, dscaleV; (__extension__ (__builtin_constant_p ("Helvetica") ? (((size_t)(const void *)(("Helvetica") + 1) - (size_t)(const void *)("Helvetica") == 1) && strlen ("Helvetica") + 1 <= 8 ? __strcpy_small (sActFont, __extension__ (((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 2]) << 8 | ((__const uns! igned char *) (__const char *) ("Helvetica"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4]), strlen ("Helvetica") + 1) : (char *) memcpy (sActFont, "Helvetica", strlen ("Helvetica") + 1)) : strcpy (sActFont, "Helvetica"))); (__extension__ (__builtin_constant_p ("Helvetica") ? (((size_t)(const void *)(("Helvetica") + 1) - (size_t)(const void *)("Helvetica") == 1) && strlen ("Helvetica") + 1 <= 8 ? __strcpy_small (sDefaultFont, __extension__ (((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0]), __extension__ (((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4]), __extension__ (((((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[0]), __extension__ (((((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4 + 2]) << 8 | ((__const! unsigned char *) (__const char *) ("Helvetica"))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ("Helvetica"))[4]), strlen ("Helvetica") + 1) : (char *) memcpy (sDefaultFont, "Helvetica", strlen ("Helvetica") + 1)) : strcpy (sDefaultFont, "Helvetica"))); uActFontSize = 18; uDefaultFontSize = 18; term->v_char = (unsigned int) (uActFontSize); term->h_char = (unsigned int) (uActFontSize * 6 / 10); TgifPortrait = 1; uTgifPlotsPerPage = 1; uTgifPlotRow = 1; uTgifPlotCol = 1; uTgif_win_horiz = 1; uTgif_win_verti = 1; uActResolution = 100; if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "p$ortrait")) { TgifPortrait = 1; c_token++; } else if (almost_equals(c_token, "l$andscape")) { TgifPortrait = 0; uActResolution = 140; c_token++; } } if (!(c_token >= num_tokens || equals(c_token,";"))) { if (equals(c_token, "[")) { c_token++; if ((c_token >= num_tokens || equals(c_token,";"))) { int_error("no. windows: [horizontal,vertical] expected", c_token); } else if (!equals(c_token, ",")) { uTgif_win_horiz = (int) real(const_express(&a)); } if (!equals(c_token, ",")) int_error("',' expected", c_token); c_token++; if (!equals(c_token, "]")) { uTgif_win_verti = (int) real(const_express(&a)); } if (!equals(c_token, "]")) int_error("expecting ']'", c_token); c_token++; uTgifPlotsPerPage = uTgif_win_verti * uTgif_win_horiz; } } if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "s$olid")) { TgifSolid = 1; c_token++; } else if (almost_equals(c_token, "d$ashed")) { TgifSolid = 0; c_token++; } } if (!(c_token >= num_tokens || equals(c_token,";")) && isstring(c_token)) { quote_str(sActFont, c_token, 1024); (__extension__ (__builtin_constant_p (sActFont) ? (((size_t)(const void *)((sActFont) + 1) - (size_t)(const void *)(sActFont) == 1) && strlen (sActFont) + 1 <= 8 ? __strcpy_small (sDefaultFont, __extension__ (((__const unsigned char *) (__const char *) (sActFont))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (sActFont))[0]), __extension__ (((__const unsigned char *) (__const char *) (sActFont))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (sActFont))[4]), __extension__ (((((__const unsigned char *) (__const char *) (sActFont))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (sActFont))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (sActFont))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (sActFont))[0]), __extension__ (((((__const unsigned char *) (__const char *) (sActFont))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (sActFont))[4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (sA! ctFont))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) (sActFont))[4]), strlen (sActFont) + 1) : (char *) memcpy (sDefaultFont, sActFont, strlen (sActFont) + 1)) : strcpy (sDefaultFont, sActFont))); c_token++; } if (!(c_token >= num_tokens || equals(c_token,";"))) { uActFontSize = (unsigned int) real(const_express(&b)); uDefaultFontSize = uActFontSize; term->v_char = (unsigned int) (uActFontSize); term->h_char = (unsigned int) (uActFontSize * 6 / 10); } if (TgifPortrait) { dscaleH = (double) 100.0 *(950) / (xsize * (950 + (uTgif_win_horiz - 1) * 1030)); dscaleV = (double) 100.0 *(1400) / (ysize * (634 + (uTgif_win_verti - 1) * 714)); uActResolution = (int) ( (dscaleH) < (dscaleV) ? (dscaleH) : (dscaleV) ); switch (uTgif_win_verti) { case 1: uActZoom = 0; break; case 2: uActZoom = 1; break; default: uActZoom = 2; break; } } else { dscaleH = (double) 100.0 *(1400) / (xsize * (950 + (uTgif_win_horiz - 1) * 1030)); dscaleV = (double) 100.0 *(950) / (ysize * (634 + (uTgif_win_verti - 1) * 714)); uActResolution = (unsigned int) ( (dscaleH) < (dscaleV) ? (dscaleH) : (dscaleV) ); switch (uTgif_win_verti) { case 1: uActZoom = 0; break; case 2: uActZoom = 1; break; default: uActZoom = 2; break; } } sprintf(term_options, "%s [%u,%u] %s \"%s\" %u", TgifPortrait ? "portrait" : "landscape", uTgif_win_horiz, uTgif_win_verti, TgifSolid ? "solid" : "dashed", sActFont, uActFontSize); } static void TGIF_init() { if (multiplot) { uActResolution = (unsigned int) 100; if (uTgifPlotsPerPage > 1) { fputs("warning: using standard multiplot\n", stderr); uTgifPlotsPerPage = 1; } uActZoom = 1; } fprintf(gpoutfile, "%%TGIF 2.15-p7\nstate(%d,30,%u,0,0,%u,16,1,9,1,1,0,0,0,0,1,0,'%s',0,%u,0,0,1,10,0,0,1,1,0,16,0,0,1,1,1).\n%%\n%% @(#)$Header: /var/tmp/CVSROOT/gnuplot/term/tgif.trm,v 1.10 1998/12/16 19:48:20 lhecking Exp $\n%% %%W%%\n%%\npage(1,\"\").\n", TgifPortrait ? 0 : 1, uActResolution, uActZoom, sActFont, uActFontSize); eTgifState = NEWPOLY; iTgifPolyCount = 0; uTgifPlotCount = 0; uActPage = 1; } static void TGIF_graphics() { TGIF_flush_poly(); if (multiplot) { term->xmax = (TgifPortrait) ? 950 : 1400; term->ymax = (TgifPortrait) ? 1400 : 950; uLastTgifX = (TgifPortrait) ? 50 : 50; uLastTgifY = (TgifPortrait) ? 1400 + 50 : 950 + 50; uYshift = uLastTgifY; uXshift = uLastTgifX; } else { if (uTgifPlotCount < uTgifPlotsPerPage) uTgifPlotCount++; else { fprintf(stderr, "error: number of plots > plots per page\n"); return; } uXshift = (unsigned int) 50 *100 / uActResolution + (xsize * (uTgifPlotCol - 1) * 1030); uYshift = (unsigned int) 50 *100 / uActResolution + (ysize * (634 + (uTgifPlotRow - 1) * 714)); if (uTgifPlotCount % uTgif_win_horiz == 0) { uTgifPlotCol = 1; uTgifPlotRow++; } else { uTgifPlotCol++; } uLastTgifX = uXshift; uLastTgifY = uYshift; } iTgifPolyCount = 0; uActNr = 0; uActAngle = 0; uActThick = 1; uActStyle = 0; uActJust = LEFT; (__extension__ (__builtin_constant_p (psColors[0]) ? (((size_t)(const void *)((psColors[0]) + 1) - (size_t)(const void *)(psColors[0]) == 1) && strlen (psColors[0]) + 1 <= 8 ? __strcpy_small (sActColor, __extension__ (((__const unsigned char *) (__const char *) (psColors[0]))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (psColors[0]))[0]), __extension__ (((__const unsigned char *) (__const char *) (psColors[0]))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (psColors[0]))[4]), __extension__ (((((__const unsigned char *) (__const char *) (psColors[0]))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (psColors[0]))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (psColors[0]))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (psColors[0]))[0]), __extension__ (((((__const unsigned char *) (__const char *) (psColors[0]))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (psColors[0]))[4 + 2]) << 8 | ((__const un! signed char *) (__const char *) (psColors[0]))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) (psColors[0]))[4]), strlen (psColors[0]) + 1) : (char *) memcpy (sActColor, psColors[0], strlen (psColors[0]) + 1)) : strcpy (sActColor, psColors[0]))); } static void TGIF_text() { TGIF_flush_poly(); } static void TGIF_reset() { TGIF_flush_poly(); iTgifPolyCount = 0; uTgifPlotCount = 0; uTgifPlotRow = 1; uTgifPlotCol = 1; if (gpoutfile != (FILE *) ((void *)0)) fflush(gpoutfile); } static void TGIF_linetype(linetype) int linetype; { unsigned int ult; TGIF_flush_poly(); if (linetype >= 0) ult = 2 + linetype % 10; else ult = linetype + 2; (__extension__ (__builtin_constant_p (psColors[ult]) ? (((size_t)(const void *)((psColors[ult]) + 1) - (size_t)(const void *)(psColors[ult]) == 1) && strlen (psColors[ult]) + 1 <= 8 ? __strcpy_small (sActColor, __extension__ (((__const unsigned char *) (__const char *) (psColors[ult]))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))[0]), __extension__ (((__const unsigned char *) (__const char *) (psColors[ult]))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))[4]), __extension__ (((((__const unsigned char *) (__const char *) (psColors[ult]))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))[0]), __extension__ (((((__const unsigned char *) (__const char *) (psColors[ult]))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))! [4 + 2]) << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) (psColors[ult]))[4]), strlen (psColors[ult]) + 1) : (char *) memcpy (sActColor, psColors[ult], strlen (psColors[ult]) + 1)) : strcpy (sActColor, psColors[ult]))); uActThick = uLineThick[ult]; if (!TgifSolid) uActStyle = uLineStyle[ult]; else { if (ult == 1) uActStyle = uLineStyle[ult]; else uActStyle = uLineStyle[2]; } } static void TGIF_move(ux, uy) unsigned int ux, uy; { uLastTgifX = ux + uXshift; uLastTgifY = uYshift - uy; if (eTgifState == INPOLY) TGIF_flush_poly(); } static void TGIF_vector(ux, uy) unsigned int ux, uy; { ux = ux + uXshift; uy = uYshift - uy; if (eTgifState == NEWPOLY) { uBuffX[0] = uLastTgifX; uBuffY[0] = uLastTgifY; iTgifPolyCount = 1; eTgifState = INPOLY; } uBuffX[iTgifPolyCount] = ux; uBuffY[iTgifPolyCount] = uy; uLastTgifX = ux; uLastTgifY = uy; iTgifPolyCount++; eTgifState = INPOLY; if (iTgifPolyCount == 100) { TGIF_flush_poly(); } } static void TGIF_arrow(sx, sy, ex, ey, head) unsigned int sx, sy, ex, ey; TBOOLEAN head; { TGIF_flush_poly(); sx = sx + uXshift; ex = ex + uXshift; sy = uYshift - sy; ey = uYshift - ey; if (head) { fprintf(gpoutfile, "poly('%s',%d,[\n\t%u,%u,%u,%u],1,%u,1,%u,0,0,%u,0,8,3,0,[\n]).\n", sActColor, 2, sx, sy, ex, ey, uActThick, uActNr, uActStyle); } else { fprintf(gpoutfile, "poly('%s',%d,[\n\t%u,%u,%u,%u],1,%u,1,%u,0,0,%u,0,8,3,0,[\n]).\n", sActColor, 2, sx, sy, ex, ey, uActThick, uActNr, uActStyle); } uActNr++; uLastTgifX = ex; uLastTgifY = ey; } static void TGIF_put_text(ux, uy, str) unsigned int ux, uy; char *str; { unsigned int x, y; struct TERMENTRY *t = term; TGIF_flush_poly(); x = ux + uXshift; y = uYshift - uy - t->v_char / 2; if (strlen(str) == 0) return; fprintf(gpoutfile, "text('%s',%u,%u,'%s',0,%u,1,%u,%u,1,55,119,%u,0,15,4,0,0,0,0,[\n\t\"%s\"]).\n", sActColor, x, y, sActFont, uActFontSize, uActJust, uActAngle, uActNr, str); uActNr += 2; uActFontSize = uDefaultFontSize; (__extension__ (__builtin_constant_p (sDefaultFont) ? (((size_t)(const void *)((sDefaultFont) + 1) - (size_t)(const void *)(sDefaultFont) == 1) && strlen (sDefaultFont) + 1 <= 8 ? __strcpy_small (sActFont, __extension__ (((__const unsigned char *) (__const char *) (sDefaultFont))[0 + 1] << 8 | ((__const unsigned char *) (__const char *) (sDefaultFont))[0]), __extension__ (((__const unsigned char *) (__const char *) (sDefaultFont))[4 + 1] << 8 | ((__const unsigned char *) (__const char *) (sDefaultFont))[4]), __extension__ (((((__const unsigned char *) (__const char *) (sDefaultFont))[0 + 3] << 8 | ((__const unsigned char *) (__const char *) (sDefaultFont))[0 + 2]) << 8 | ((__const unsigned char *) (__const char *) (sDefaultFont))[0 + 1]) << 8 | ((__const unsigned char *) (__const char *) (sDefaultFont))[0]), __extension__ (((((__const unsigned char *) (__const char *) (sDefaultFont))[4 + 3] << 8 | ((__const unsigned char *) (__const char *) (sDefaultFont))[4 + 2]) << 8 |! ((__const unsigned char *) (__const char *) (sDefaultFont))[4 + 1]) << 8 | ((__const unsigned char *) (__const char *) (sDefaultFont))[4]), strlen (sDefaultFont) + 1) : (char *) memcpy (sActFont, sDefaultFont, strlen (sDefaultFont) + 1)) : strcpy (sActFont, sDefaultFont))); } static int TGIF_text_angle(ang) int ang; { uActAngle = uTextAngle[ang]; return (1); } static int TGIF_justify_text(mode) enum JUSTIFY mode; { uActJust = mode; return (1); } static void TGIF_point(ux, uy, number) unsigned int ux, uy; int number; { double p; double x, y; x = (double) (ux + uXshift); y = (double) (uYshift - uy); p = pointsize * 8.0; if (p == (double) 0.0) p = 0.1; TGIF_flush_poly(); if (number != -1) number = number % 63; switch (number) { case -1: fprintf(gpoutfile, "poly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,1,1,%u,0,0,0,0,8,3,0,[\n]).\n", sActColor, x, y, x + 1, y + 1, uActNr++); break; case 0: fprintf(gpoutfile, "group([\npoly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n]).\npoly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr+1, sActColor, x - p, y + p, x + p, y - p, uActNr+2); uActNr += 4; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 1: fprintf(gpoutfile, "group([\npoly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n]),\npoly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n])\n", sActColor, x, y - p - 1, x, y + p + 1, uActNr+1, sActColor, x - p - 1, y, x + p + 1, y, uActNr+2); uActNr += 4; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 2: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "poly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n]),\n", sActColor, x, y - p - 1, x, y + p + 1, uActNr++); fprintf(gpoutfile, "poly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n])\n", sActColor, x - p - 1, y, x + p + 1, y, uActNr++); fprintf(gpoutfile, "poly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "poly('%s',2,[\n\t%.1f,%.1f,%.1f,%.1f],0,2,1,%u,0,0,0,0,8,3,0,[\n]).\n", sActColor, x - p, y + p, x + p, y - p, uActNr++); uActNr += 4; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 3: fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr); uActNr++; break; case 4: fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr); uActNr++; break; case 5: fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr); uActNr++; break; case 6: fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr); uActNr++; break; case 7: fprintf(gpoutfile, "polygon('%s',4,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y + 0.75 * p, x - p, y + 0.75 * p, x, y - p, uActNr); uActNr++; break; case 8: fprintf(gpoutfile, "polygon('%s',4,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y + 0.75 * p, x - p, y + 0.75 * p, x, y - p, uActNr); uActNr++; break; case 9: fprintf(gpoutfile, "polygon('%s',4,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x - p, y - 0.75 * p, x + p, y - 0.75 * p, x, y + p, uActNr); uActNr++; break; case 10: fprintf(gpoutfile, "polygon('%s',4,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x - p, y - 0.75 * p, x + p, y - 0.75 * p, x, y + p, uActNr); uActNr++; break; case 11: fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); uActNr++; break; case 12: fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); uActNr++; break; case 13: fprintf(gpoutfile, "polygon('%s',6,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y - p / 4, x + 0.625 * p, y + p, x - 0.625 * p, y + p, x - p, y - p / 4, x, y - p, uActNr); uActNr++; break; case 14: fprintf(gpoutfile, "polygon('%s',6,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y - p / 4, x + 0.625 * p, y + p, x - 0.625 * p, y + p, x - p, y - p / 4, x, y - p, uActNr); uActNr++; break; case 15: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,4480,2560,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x + p * 0.342, y - p * 0.94, x - p * 0.342, y - p * 0.94, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 16: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,0,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x + p, y, x, y - p, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 17: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,5760,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y - p, x - p, y, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 18: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,0,11520,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x + p, y, x - p, y, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 19: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,11520,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x - p, y, x, y + p, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 20: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,0,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x + p, y, x, y - p, 2 * p, 2 * p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,11520,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x - p, y, x, y + p, 2 * p, 2 * p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 21: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,5760,11520,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y - p, x, y + p, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 22: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,0,17280,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x + p, y, x, y + p, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 23: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,17280,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y + p, x + p, y, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 24: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,17280,11520,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y + p, x, y - p, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 25: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,5760,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y - p, x - p, y, 2 * p, 2 * p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,17280,5760,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y + p, x + p, y, 2 * p, 2 * p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 26: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,17280,17280,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y + p, x - p, y, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 27: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,11520,11520,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x - p, y, x + p, y, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 28: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,11520,17280,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x - p, y, x, y - p, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 29: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "arc('%s',1,1,1,0,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,0,%.1f,%.1f,5760,17280,%u,0,0,8,3,0,[\n]).\n", sActColor, x - p, y - p, x, y, x, y - p, x + p, y, 2 * p, 2 * p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 30: fprintf(gpoutfile, "oval('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr); uActNr++; break; case 31: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p / 4, y - p, x + p / 4, y, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 32: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 33: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x, y, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 34: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 35: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y, x, y + p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 36: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y, x, y + p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 37: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x, y + p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 38: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y, x, y + p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 39: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x, y, x + p, y + p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 40: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y + p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 41: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x, y, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x, y, x + p, y + p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 42: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x, y, x + p, y + p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 43: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y, x + p, y + p, uActNr++); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 44: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x, y - p, x + p, y, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y, x + p, y + p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 45: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,2,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x, y, uActNr++); fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y, x + p, y + p, uActNr++); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 46: fprintf(gpoutfile, "box('%s',%.1f,%.1f,%.1f,%.1f,1,1,1,%u,0,0,0,[\n]).\n", sActColor, x - p, y - p, x + p, y + p, uActNr); uActNr++; break; case 47: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - 0.625 * p, y - 0.375 * p, x - 0.375 * p, y - 0.625 * p, x + p / 8, y - p / 8, x - p / 8, y + p / 8, x - 0.625 * p, y - 0.375 * p, uActNr); fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); uActNr += 2; break; case 48: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p / 2, y - p / 2, x, y - p, x + p / 2, y - p / 2, x, y, x - p / 2, y - p / 2, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 49: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p, y, x - p / 2, y - p / 2, x, y, x - p / 2, y + p / 2, x - p, y, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 50: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p, y, x, y - p, x + p / 2, y - p / 2, x - p / 2, y + p / 2, x - p, y, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 51: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p / 2, y + p / 2, x, y, x + p / 2, y + p / 2, x, y + p, x - p / 2, y + p / 2, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 52: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p / 2, y - p / 2, x, y - p, x + p / 2, y - p / 2, x, y, x - p / 2, y - p / 2, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p / 2, y + p / 2, x, y, x + p / 2, y + p / 2, x, y + p, x - p / 2, y + p / 2, uActNr); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 53: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p, y, x - p / 2, y - p / 2, x + p / 2, y + p / 2, x, y + p, x - p, y, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 54: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',7,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p, y, x, y - p, x + p / 2, y - p / 2, x, y, x + p / 2, y + p / 2, x, y + p, x - p, y, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 55: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y, x + p / 2, y - p / 2, x + p, y, x + p / 2, y + p / 2, x, y, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 56: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p / 2, y - p / 2, x, y - p, x + p, y, x + p / 2, y + p / 2, x - p / 2, y - p / 2, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 57: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p, y, x - p / 2, y - p / 2, x, y, x - p / 2, y + p / 2, x - p, y, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y, x + p / 2, y - p / 2, x + p, y, x + p / 2, y + p / 2, x, y, uActNr); uActNr += 3; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 58: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',7,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p, y, x, y - p, x + p, y, x + p / 2, y + p / 2, x, y, x - p / 2, y + p / 2, x - p, y, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 59: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p / 2, y + p / 2, x + p / 2, y - p / 2, x + p, y, x, y + p, x - p / 2, y + p / 2, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 60: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',7,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p / 2, y - p / 2, x, y - p, x + p, y, x, y + p, x - p / 2, y + p / 2, x, y, x - p / 2, y - p / 2, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 61: fprintf(gpoutfile, "group([\n"); fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],0,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); fprintf(gpoutfile, "polygon('%s',7,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x - p, y, x - p / 2, y - p / 2, x, y, x + p / 2, y - p / 2, x + p, y, x, y + p, x - p, y, uActNr); uActNr += 2; fprintf(gpoutfile, "],\n%u,0,[\n]).\n", uActNr++); break; case 62: fprintf(gpoutfile, "polygon('%s',5,[\n%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f],1,1,1,0,%u,0,0,0,0,0,[\n]).\n", sActColor, x, y + p, x + p, y, x, y - p, x - p, y, x, y + p, uActNr); uActNr++; break; } } static void TGIF_set_pointsize(size) double size; { uActPointSize = size; } static int TGIF_set_font(font) char *font; { char name[32]; int size, sep; sep = __extension__ ({ char __r0, __r1, __r2; (__builtin_constant_p (",") && ((size_t)(const void *)((",") + 1) - (size_t)(const void *)(",") == 1) ? ((__r0 = ((__const char *) (","))[0], __r0 == '\0') ? strlen (font) : ((__r1 = ((__const char *) (","))[1], __r1 == '\0') ? __strcspn_c1 (font, __r0) : ((__r2 = ((__const char *) (","))[2], __r2 == '\0') ? __strcspn_c2 (font, __r0, __r1) : (((__const char *) (","))[3] == '\0' ? __strcspn_c3 (font, __r0, __r1, __r2) : strcspn (font, ","))))) : strcspn (font, ",")); }); (__extension__ (__builtin_constant_p (font) && __builtin_constant_p (sep) ? (strlen (font) + 1 >= ((size_t) (sep)) ? (char *) memcpy (name, font, sep) : strncpy (name, font, sep)) : strncpy (name, font, sep))); name[sep] = ('\0'); size = uActFontSize; sscanf(&(font[sep + 1]), "%d", &size); uActFontSize = size; return 1; } # 339 "term.h" 2 # 1 "term/tkcanvas.trm" 1 # 75 "term/tkcanvas.trm" # 1 "term/driver.h" 1 # 76 "term/tkcanvas.trm" 2 static void TK_options (void); static void TK_init (void); static void TK_graphics (void); static void TK_text (void); static void TK_linetype (int linetype); static void TK_move (unsigned int x, unsigned int y); static void TK_vector (unsigned int x, unsigned int y); static void TK_put_text (unsigned int x, unsigned int y, char *str); static void TK_reset (void); static int TK_justify_text (enum JUSTIFY); static int TK_set_font (char *font); static void TK_linewidth (double linewidth); # 111 "term/tkcanvas.trm" extern double min_array[], max_array[], base_array[], log_base_array[]; extern TBOOLEAN log_array[]; extern int xleft, xright, ybot, ytop; extern TBOOLEAN is_3d_plot; static int tk_lastx; static int tk_lasty; static int tk_color = 0; static char tk_anchor[7] = "w"; static double tk_linewidth = 1.0; static int tk_perl = 0; static int tk_interactive = 0; static char *tk_colors[] = { "black", "gray", "red", "blue", "green", "brown", "magenta", "cyan" }; static void TK_options() { tk_perl = 0; tk_interactive = 0; if (!(c_token >= num_tokens || equals(c_token,";"))) { if (almost_equals(c_token, "p$erltk")) { tk_perl = 1; c_token++; } if (almost_equals(c_token, "i$nteractive")) { tk_interactive = 1; c_token++; } } sprintf(term_options, "%s %s", tk_perl ? "perltk" : "", tk_interactive ? "interactive" : ""); } static void TK_init() { } static void TK_graphics() { # 167 "term/tkcanvas.trm" if (tk_perl) { fputs("sub gnuplot {\nmy($can) = @_;\n$can->delete('all');\nmy $cmx = ($can->configure(-width))[4];\nmy $cmy = ($can->configure(-height))[4];\nmy $cmx = $can->width - 2 * $can->cget(-border);\nif ($cmx <= 1) {\n$cmx = ($can->cget(-width));\n}\nmy $cmy = $can->height - 2 * $can->cget(-border);\nif ($cmy <= 1) {\n$cmy = ($can->cget(-height));\n}\n", # 178 "term/tkcanvas.trm" gpoutfile); } else { fputs("proc gnuplot can {\n$can delete all\nset cmx [expr [winfo width $can]-2*[$can cget -border]]\nif {$cmx <= 1} {set cmx [$can cget -width]}\nset cmy [expr [winfo height $can]-2*[$can cget -border]]\nif {$cmy <= 1} {set cmy [$can cget -height]}\n", gpoutfile); } tk_lastx = tk_lasty = tk_color = 0; } static void TK_reset() { } static void TK_linetype(linetype) int linetype; { tk_color = (linetype + 2) & 7; } static void TK_linewidth(linewidth) double linewidth; { tk_linewidth = linewidth; } static void TK_move(x, y) unsigned int x, y; { tk_lastx = x; tk_lasty = 1000 - y; } # 230 "term/tkcanvas.trm" static void TK_vector(x, y) unsigned int x, y; { if (tk_interactive && !is_3d_plot) { if (tk_perl) fprintf(gpoutfile, "$can->bind("); else fprintf(gpoutfile, "$can bind [\n"); } y = 1000 - y; if (tk_perl) { fprintf(gpoutfile,"$can->createLine($cmx * %d / 1000, $cmy * %d / 1000, $cmx * %d / 1000, $cmy * %d / 1000, -fill => q{%s}, -width => %f, -capstyle => q{round})", tk_lastx, tk_lasty, x, y, tk_colors[tk_color], tk_linewidth); } else { fprintf(gpoutfile,"$can create line [expr $cmx * %d /1000] [expr $cmy * %d /1000] [expr $cmx * %d /1000] [expr $cmy * %d /1000] -fill %s -width %f -capstyle round\n", tk_lastx, tk_lasty, x, y, tk_colors[tk_color], tk_linewidth); } if (tk_interactive && !is_3d_plot) { if (tk_perl) { fprintf(gpoutfile,", '