1 <HTML><HEAD><TITLE>Pine Technical Notes: Notes for Porting and Modification
</TITLE></HEAD><BODY>
2 <H1>Notes for Porting and Modification
</H1>
4 <H2><A NAME=
"new-port">Porting Pine to Other Platforms
</A></H2>
6 Substantial effort has gone into making
<EM>Pine
</EM>/
<EM>Pico
</EM> portable.
8 still, of course, a number of machine dependencies. Some of the ports are
9 well-tested and some are untested. In particular, the most heavily used
10 ports are the Ultrix, AIX, NeXT, Windows, and Dec Unix ports.
<P>
12 Each platform is given a three letter name (see the file
13 <CODE>doc/pine-ports
</CODE>). Make up a new one for your new port. We've
14 attempted to bring all potential platform dependencies into the files:
15 <CODE>{pico,pine}/osdep/os-xxx.h
</CODE>,
16 <CODE>{pico,pine}/osdep/os-xxx.ic
</CODE>,
17 and
<CODE>{pico,pine}/makefile.xxx
</CODE>, where
<EM>xxx
</EM>
18 is the three letter name of the port. Thus any new port will hopefully
19 just result in new versions of these files and some notes for the
20 <EM>pine-ports
</EM> file.
21 There are separate dependencies in the c-client source, but that
22 is handled in separate documentation there.
23 Regrettably, the source code is also full of instances of
<EM>ifdef DOS
</EM>.
24 Most of these are due to memory limit problems on
<EM>DOS
</EM> as
25 opposed to actual system dependencies.
<P>
27 The makefiles are kept as simple and straight-forward as possible, because
28 many previous attempts at automatically figuring out what to do seem to
29 have become complex and ineffective in what they set out to do: which is
30 to make compiling and installing the program easy. Each port is for a
31 specific hardware/software platform, also because past attempts to
32 generalize on versions of Unix or some CPU architecture don't seem to have
33 gained much. Thus, there is a separate makefile for each platform that
34 calls the appropriate compiler and linker with the appropriate flags.
35 Most of these makefiles are pretty similar. The makefile also specifies
36 which of the
<EM>os-xxx.c
</EM> and
<EM>os-xxx.h
</EM> files to use.
38 the root from which most platform dependencies are selected. In most cases
39 the makefile also defines a symbol named after the platform on which there
40 can be dependencies in the source code, though we've tried to minimize
41 relying on this where reasonable.
42 When different
"ports" are very similar, it is sometimes possible to use
43 the same pine code (for example) with only a small change in the c-client
44 or pico code. In those cases, that kind of dependency is reflected in
45 the top-level
<EM>build
</EM> script.
46 The
<EM>build
</EM> script can usually be
47 used to invoke the various makes correctly.
48 It may set some variables before running make so look to see what
<EM>build
</EM>
49 does before trying a make in one of the subdirectories. This is especially true
50 if LDAP is being included.
<P>
52 It is almost always easier to start with an existing port when trying to port
53 to a new system. There is a port called
<EM>gen
</EM> (generic) which may be
54 a good starting point. On the other hand, if another port is close to what
55 you want, start with it instead.
58 The file
<CODE>pico/osdep/os-xxx.h
</CODE> contains most of the general
59 platform dependent
<EM>#include
</EM>'s and
<EM>#defines
</EM>.
61 of
<EM>Pine
</EM> configuration settings that are defined in
62 <CODE>pine/osdep/os-xxx.h
</CODE>, as well, such as the
63 place it looks for certain files, defaults for the printer and folder
64 names, the maximum screen size, and so on.
65 Start by looking at the generic
<CODE>pico/osdep/os-gen.h
</CODE> file
66 and comparing it to some of the specific
<CODE>os-xxx.h
</CODE> files there.
<P>
68 The
<CODE>osdep/os-xxx.c
</CODE> files contain functions that are potentially
69 platform dependent. Again, the idea is to gather all the dependencies in
71 We use a complicated looking method to produce
72 the
<EM>os-xxx.c
</EM> files from a set of included files. Each included
73 file usually contains a single implementation method and we've
75 usually only two or three different methods in the
76 ports we've done so far. Hopefully, coming up with an
<CODE>os-xxx.c
</CODE>
77 for a new port will usually be a matter of including the right set of
78 these already written functions. This is done by writing a new
79 <CODE>os-xxx.ic
</CODE> file in the
<CODE>osdep
</CODE> subdirectories.
80 Starting with the generic
<CODE>os-gen.ic
</CODE>, as you did with
81 the
<CODE>os-gen.h
</CODE> file above, may be a useful strategy.
<P>
83 We strongly encourage that no changes be made to the general source when
84 porting and that all changes be contained in the system
85 dependent files if possible. The object is to maintain source code
86 integrity and assimilate ports to new platforms rapidly. The more
87 conventional way to do this is with a large collection of
88 <EM>#ifdefs
</EM>. The problem with this is that adding a port for a new
89 platform implies changing the source code for all the other platforms and
90 thereby risks breaking them. (We readily admit that there are still too
91 many
<EM>ifdefs
</EM> in the code.)
<P>
93 If you do port
<EM>Pine
</EM> to a new platform we hope that you will send us the
94 changes required so that we may attempt to include it in a later release.
99 <H2><A NAME=
"checklist">Test Checklist
</A></H2>
101 The following is a checklist of some things to check when testing a new
108 Sending mail, check that headers are correct
112 Sending mail with attachments
116 Sending mail with SMTP server
120 Sending mail without SMTP server
124 Sending mail with list of two SMTP servers, first one doesn't answer
128 Replying to and forwarding a message
132 Postponing messages under composition
140 Alternate editor,
<EM>enable-alternate-editor-implicitly
</EM>
144 Make sure local user names are expanded
148 Test spelling checker
152 Catching of SIGHUP while message is being composed
156 Setting of variables in
<CODE>.pinerc
</CODE>
160 New mail notification. Should happen with
<EM>Pine
</EM> idle to check timeouts
164 Reading mail (attachments, MIME, MIME with mailcap viewers)
168 Deleting, undeleting, expunging, sorting
172 Expunge to empty folder
176 Make sure that
<EM>~
</EM> expansion works in config files
180 Make sure that $VAR expansion works in config files
184 Save message to folder, check error conditions such as permission denied
188 Export message with FullHeaderMode on and off
192 Checkpointing (see the section on checkpointing)
196 Open IMAP and RIMAP folders
200 Default-fcc on remote IMAP server
204 Fcc-name-rule, fcc in addrbook (while composing)
208 Test opening bogus folders: invalid format, no permission
212 Open a USENET news group, list in folder-lister, read news, post news
216 Command line arguments
228 Address book operations (edit, delete, add, lists, whereis, composeto)
232 ReadOnly address book
236 Look at addrbook, change addrbook-sort-rule in Config, go back to
241 No permission to write in same directory as addrbook, should create
242 addrbook.lu in a temp directory
246 Multiple address books
250 Address book loops from one addrbook to another and back
254 TakeAddr command with one address, with multiple addresses
258 TakeAddr command with ReadOnly address books
262 TakeAddr command with one of two address books ReadOnly
266 Send mail with empty address book
270 Config Screen operation, does pinerc get written?
274 Make sure SIGTSTP, ^Z works
278 Sent-mail pruning (set back
<EM>last-time-prune-questioned
</EM> variable)
282 Printing using all three printer configurations, various screens
286 View help text and news
290 Folder list operations (rename, create, delete...)
298 Screen redrawing in various screens (^L)
302 Window resizing in various screens
306 Error messages for incorrect terminal types (try
"foo" and
"vt52")
310 Reading of
<CODE>/usr/local/lib/pine.conf
</CODE>
314 Fixing variables and features in
<CODE>/usr/local/lib/pine.conf.fixed
</CODE>
318 Flag command (check message status changed in mail folder)
322 Initial-keystroke-list
326 Aggregate operations (save, delete, export, takeaddr, ...)
330 Build xxx from scratch, build clean