|
On Tue, 12 Mar 2002, James Rich wrote: > > > > I found something strange -- I'll send you the SCS file, so you can > > reproduce it... > > Okay, that should be fixed now. The scs file you sent doesn't have the > spps code in it; it never sets the page size. scs2pdf had a default page > size that worked for the old code but not the new stuff. So fixing the > default helped. Then I noticed that the page size was being computed > wrong because we used ints instead of floats. That's all working now, > tested with the scs file you sent me. Except that my page is 14"x11", but your default cuts it off at 8.5x11. I wonder if we can guess at the page size by the number of columns of text that are sent to us? > Right, this is what I'm thinking, too. Almost like event-driven > programming? Create callbacks, etc., or is that not what you mean? That's exactly what I mean. Create a struct which contains pointers to the different "event" functions. Then, call an "init" routine that sets these pointers to the appropriate values. Maybe something like: struct _Tn5250DocFormatter { int (* start_doc) (arg1, arg2, etc); int (* start_page) (arg1, arg2, etc); int (* add_text) (int x, int y, char *text); int (* end_page) (etc); int (* end_doc) (etc); } #define tn5250_docformatter_start_doc(This, arg1, arg2, etc) \ (* (This->start_doc) ((This),(arg1),(arg2),(etc)) and so on... See stream.h and stream.c as an example of where we're using this sort of thing. It attaches the SSL stream object or the Telnet stream object as appropriate. > > This latest diff is available at the usual place: > > http://www.eaerich.com/tn5250.diff > This should now be in CVS.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.