tin  2.4.4
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.4.4.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

tin.h
Go to the documentation of this file.
1 /*
2  * Project : tin - a Usenet reader
3  * Module : tin.h
4  * Author : I. Lea & R. Skrenta
5  * Created : 1991-04-01
6  * Updated : 2019-06-13
7  * Notes : #include files, #defines & struct's
8  *
9  * Copyright (c) 1997-2020 Iain Lea <iain@bricbrac.de>, Rich Skrenta <skrenta@pbm.com>
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  *
16  * 1. Redistributions of source code must retain the above copyright notice,
17  * this list of conditions and the following disclaimer.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in the
21  * documentation and/or other materials provided with the distribution.
22  *
23  * 3. Neither the name of the copyright holder nor the names of its
24  * contributors may be used to endorse or promote products derived from
25  * this software without specific prior written permission.
26  *
27  * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  * POSSIBILITY OF SUCH DAMAGE.
38  */
39 
40 
41 /*
42  * OS specific doda's
43  */
44 
45 #ifndef TIN_H
46 #define TIN_H 1
47 
48 #ifdef HAVE_CONFIG_H
49 # ifndef TIN_AUTOCONF_H
50 # include <autoconf.h> /* FIXME: normally we use 'config.h' */
51 # endif /* !TIN_AUTOCONF_H */
52 #else
53 # ifndef HAVE_CONFDEFS_H
54 # error "configure run missing"
55 # endif /* !HAVE_CONFDEFS_H */
56 #endif /* HAVE_CONFIG_H */
57 
58 
59 /*
60  * this causes trouble on Linux (forces nameserver lookups even for local
61  * connections - this is an (unwanted) feature of getaddrinfo) see also
62  * nntplib.c
63  */
64 /* IPv6 support */
65 #if defined(HAVE_GETADDRINFO) && defined(HAVE_GAI_STRERROR) && defined(ENABLE_IPV6)
66 # define INET6
67 #endif /* HAVE_GETADDRINFO && HAVE_GAI_STRERROR && ENABLE_IPV6 */
68 
69 
70 /*
71  * Native Language Support.
72  */
73 #ifndef NO_LOCALE
74 # ifdef HAVE_LOCALE_H
75 # include <locale.h>
76 # endif /* HAVE_LOCALE_H */
77 # ifndef HAVE_SETLOCALE
78 # define setlocale(Category, Locale) /* empty */
79 # endif /* !HAVE_SETLOCALE */
80 #endif /* !NO_LOCALE */
81 
82 #define N_(Str) Str
83 
84 #if defined(ENABLE_NLS) && !defined(__BUILD__)
85 # ifdef HAVE_LIBINTL_H
86 # include <libintl.h>
87 # endif /* HAVE_LIBINTL_H */
88 # define _(Text) gettext(Text)
89 #else
90 # undef bindtextdomain
91 # define bindtextdomain(Domain, Directory) /* empty */
92 # undef textdomain
93 # define textdomain(Domain) /* empty */
94 # define _(Text) Text
95 #endif /* ENABLE_NLS && !__BUILD__ */
96 
97 #ifndef LOCALEDIR
98 # define LOCALEDIR "/usr/share/locale"
99 #endif /* !LOCALEDIR */
100 
101 #if defined(__amiga__) || defined(__amiga)
102 # define SMALL_MEMORY_MACHINE
103 #endif /* __amiga__ || __amiga */
104 
105 #include <signal.h>
106 
109 enum resizer { cNo, cYes, cRedraw };
111 
112 #include <stdio.h>
113 #ifdef HAVE_ERRNO_H
114 # include <errno.h>
115 #else
116 # ifdef HAVE_SYS_ERRNO_H
117 # include <sys/errno.h>
118 /*
119  # else
120  # error "No errno.h or sys/errno.h found"
121 */
122 # endif /* HAVE_SYS_ERRNO_H */
123 #endif /* HAVE_ERRNO_H */
124 #if !defined(errno)
125 # ifdef DECL_ERRNO
126  extern int errno;
127 # endif /* DECL_ERRNO */
128 #endif /* !errno */
129 
130 #ifdef HAVE_STDDEF_H
131 # include <stddef.h>
132 #endif /* HAVE_STDDEF_H */
133 #ifdef HAVE_SYS_TYPES_H
134 # include <sys/types.h>
135 #endif /* HAVE_SYS_TYPES_H */
136 
137 #ifdef HAVE_SYS_STAT_H
138 # include <sys/stat.h>
139 #endif /* HAVE_SYS_STAT_H */
140 
141 #ifdef TIME_WITH_SYS_TIME
142 # include <sys/time.h>
143 # include <time.h>
144 #else
145 # ifdef HAVE_SYS_TIME_H
146 # include <sys/time.h>
147 # else
148 # include <time.h>
149 # endif /* HAVE_SYS_TIME_H */
150 #endif /* TIME_WITH_SYS_TIME */
151 
152 #ifdef HAVE_SYS_TIMES_H
153 # include <sys/times.h>
154 #endif /* HAVE_SYS_TIMES_H */
155 
156 #if defined(HAVE_LIBC_H) && defined(__NeXT__)
157 # include <libc.h>
158 #endif /* HAVE_LIBC_H && __NeXT__ */
159 
160 #ifdef HAVE_UNISTD_H
161 # include <unistd.h>
162 #endif /* HAVE_UNISTD_H */
163 
164 #ifdef HAVE_PWD_H
165 # include <pwd.h>
166 #endif /* HAVE_PWD_H */
167 
168 #ifdef HAVE_SYS_PARAM_H
169 # include <sys/param.h>
170 #endif /* HAVE_SYS_PARAM_H */
171 
172 #include <ctype.h>
173 
174 #ifdef HAVE_STDLIB_H
175 # include <stdlib.h>
176 #endif /* HAVE_STDLIB_H */
177 
178 #include <stdarg.h>
179 
180 #ifdef HAVE_GETOPT_H
181 # include <getopt.h>
182 #endif /* HAVE_GETOPT_H */
183 
184 #if defined(ENABLE_LONG_ARTICLE_NUMBERS) && !defined(SMALL_MEMORY_MACHINE)
185 /*
186  * defines and typedefs for 64 bit article numbers
187  *
188  * TODO: what if !CPP_DOES_CONCAT
189  * add configure check for PRIdLEAST64
190  * add configure check for SCNdLEAST64
191  */
192 # if defined(HAVE_INT_LEAST64_T) && !defined(HAVE_INTTYPES_H)
193 # undef HAVE_INT_LEAST64_T
194 # endif /* HAVE_INT_LEAST64_T && !HAVE_INTTYPES_H */
195 # if defined(HAVE_INT_LEAST64_T) || defined(HAVE_LONG_LONG) || defined(quad_t)
196 # if defined(HAVE_ATOLL) || defined(HAVE_ATOQ)
197 # ifdef HAVE_STRTOLL
198 # define USE_LONG_ARTICLE_NUMBERS 1
199 # endif /* HAVE_STRTOLL */
200 # endif /* HAVE_ATOLL || HAVE_ATOQ */
201 # endif /* HAVE_INT_LEAST64_T || HAVE_LONG_LONG || quad_t */
202 # ifdef HAVE_STDINT_H
203 # include <stdint.h>
204 # endif /* HAVE_STDINT_H */
205 #endif /* ENABLE_LONG_ARTICLE_NUMBERS && !SMALL_MEMORY_MACHINE */
206 #ifdef USE_LONG_ARTICLE_NUMBERS
207 # if defined(HAVE_INT_LEAST64_T) && defined(HAVE_INT64_C)
208 # include <inttypes.h>
209  typedef int_least64_t t_artnum;
210 # define T_ARTNUM_PFMT PRIdLEAST64
211 # define T_ARTNUM_SFMT SCNdLEAST64
212 # define T_ARTNUM_CONST(v) INT64_C(v)
213 # else
214  typedef long long t_artnum;
215 # define T_ARTNUM_PFMT "lld"
216 # define T_ARTNUM_SFMT "lld"
217 # define T_ARTNUM_CONST(v) v ## LL
218 # endif /* HAVE_INT_LEAST64_T && HAVE_INT64_C */
219 # ifdef HAVE_ATOLL
220 # define atoartnum atoll
221 # else
222 # define atoartnum atoq
223 # endif /* HAVE_ATOLL */
224 # define strtoartnum strtoll
225 #else
226  typedef long t_artnum;
227 # define T_ARTNUM_PFMT "ld"
228 # define T_ARTNUM_SFMT "ld"
229 # define T_ARTNUM_CONST(v) v ## L
230 # define atoartnum atol
231 # define strtoartnum strtol
232 #endif /* USE_LONG_ARTICLE_NUMBERS */
233 
234 /*
235  * FIXME: make this autoconf
236  */
237 #ifndef __QNX__
238 # ifdef HAVE_STRING_H
239 # include <string.h>
240 # else
241 # ifdef HAVE_STRINGS_H
242 # include <strings.h>
243 # endif /* HAVE_STRINGS_H */
244 # endif /* HAVE_STRING_H */
245 #else
246 # ifdef HAVE_STRING_H
247 # include <string.h>
248 # endif /* HAVE_STRING_H */
249 # ifdef HAVE_STRINGS_H
250 # include <strings.h>
251 # endif /* HAVE_STRINGS_H */
252 #endif /* !__QNX__ */
253 
254 /*
255  * FIXME: make this autoconf
256  */
257 #ifdef SEIUX
258 # include <bsd/sys/time.h>
259 # include <bsd/sys/signal.h>
260 # include <bsd/sys/types.h>
261 # include <posix/unistd.h>
262 # include <bsd/netinet/in.h>
263 #endif /* SEIUX */
264 /* *-next-nextstep3 && *-next-openstep4 */
265 #ifdef __NeXT__
266 # undef HAVE_SYS_UTSNAME_H
267 # undef HAVE_UNAME
268 # undef WEXITSTATUS
269 # undef WIFEXITED
270 # define IGNORE_SYSTEM_STATUS 1
271 # define HAVE_SYS_WAIT_H 1
272 # define NO_LOCKING 1
273 #endif /* __NeXT__ */
274 /* m68k-sun-sunos3.5 */
275 #if defined(sun) || defined(__sun) && (!defined(__SVR4) || !defined(__svr4__)) && defined(BSD) && BSD < 199306
276 # define IGNORE_SYSTEM_STATUS 1
277 #endif /* sun|| __sun && (!__SVR4 || __svr4__) && BSD && BSD < 199306 */
278 
279 #ifdef HAVE_FCNTL_H
280 # include <fcntl.h>
281 #endif /* HAVE_FCNTL_H */
282 
283 #ifdef HAVE_SYS_IOCTL_H
284 # include <sys/ioctl.h>
285 /* We don't need/use these, and they cause redefinition errors with SunOS 4.x
286  * when we include termio.h or termios.h
287  */
288 # if defined(sun) && !defined(__svr4)
289 # undef NL0
290 # undef NL1
291 # undef CR0
292 # undef CR1
293 # undef CR2
294 # undef CR3
295 # undef TAB0
296 # undef TAB1
297 # undef TAB2
298 # undef XTABS
299 # undef BS0
300 # undef BS1
301 # undef FF0
302 # undef FF1
303 # undef ECHO
304 # undef NOFLSH
305 # undef TOSTOP
306 # undef FLUSHO
307 # undef PENDIN
308 # endif /* sun && !__svr4 */
309 #endif /* HAVE_SYS_IOCTL_H */
310 
311 #ifdef HAVE_PROTOTYPES_H
312 # include <prototypes.h>
313 #endif /* HAVE_PROTOTYPES_H */
314 
315 #ifdef HAVE_SYS_UTSNAME_H
316 # include <sys/utsname.h>
317 #endif /* HAVE_SYS_UTSNAME_H */
318 
319 /*
320  * Needed for catching child processes
321  */
322 #ifdef HAVE_SYS_WAIT_H
323 # include <sys/wait.h>
324 #endif /* HAVE_SYS_WAIT_H */
325 
326 #ifndef WEXITSTATUS
327 # define WEXITSTATUS(status) ((int) (((status) >> 8) & 0xFF))
328 #endif /* !WEXITSTATUS */
329 
330 #ifndef WIFEXITED
331 # define WIFEXITED(status) ((int) (((status) & 0xFF) == 0))
332 #endif /* !WIFEXITED */
333 
334 /*
335  * Needed for timeout in user abort of indexing a group (BSD & SYSV variaties)
336  */
337 #ifdef HAVE_SYS_SELECT_H
338 # ifdef NEED_TIMEVAL_FIX
339 # define timeval fake_timeval
340 # include <sys/select.h>
341 # undef timeval
342 # else
343 # include <sys/select.h>
344 # endif /* NEED_TIMEVAL_FIX */
345 #endif /* HAVE_SYS_SELECT_H */
346 
347 #if defined(HAVE_STROPTS_H) && !defined(__dietlibc__)
348 # include <stropts.h>
349 #endif /* HAVE_STROPTS_H && !__dietlibc__ */
350 
351 #ifdef HAVE_POLL_H
352 # include <poll.h>
353 #else
354 # ifdef HAVE_SYS_POLL_H
355 # include <sys/poll.h>
356 # endif /* HAVE_SYS_POLL_H */
357 #endif /* HAVE_POLL_H */
358 
359 /*
360  * Directory handling code
361  */
362 #ifdef HAVE_DIRENT_H
363 # include <dirent.h>
364 /* # define NAMLEN(dirent) strlen((dirent)->d_name) */
365 #else
366 # define dirent direct
367 /* # define NAMLEN(dirent) (dirent)->d_namlen */
368 # ifdef HAVE_SYS_NDIR_H
369 # include <sys/ndir.h>
370 # endif /* HAVE_SYS_NDIR_H */
371 # ifdef HAVE_SYS_DIR_H
372 # include <sys/dir.h>
373 # endif /* HAVE_SYS_DIR_H */
374 # ifdef HAVE_NDIR_H
375 # include <ndir.h>
376 # endif /* HAVE_NDIR_H */
377 #endif /* HAVE_DIRENT_H */
378 
379 #ifndef DIR_BUF
380 # define DIR_BUF struct dirent
381 #endif /* !DIR_BUF */
382 
383 #ifndef HAVE_UNLINK
384 # define unlink(file) remove(file)
385 #endif /* !HAVE_UNLINK */
386 
387 /*
388  * If native OS hasn't defined STDIN_FILENO be a smartass and do it
389  */
390 #if !defined(STDIN_FILENO)
391 # define STDIN_FILENO 0
392 #endif /* !STDIN_FILENO */
393 
394 /*
395  * include <paths.h> if available to define _PATH_TMP
396  */
397 #ifdef HAVE_PATHS_H
398 # include <paths.h>
399 #endif /* HAVE_PATHS_H */
400 #ifndef _PATH_TMP
401 # define _PATH_TMP "/tmp/"
402 #endif /* _PATH_TMP */
403 
404 /*
405  * If OS misses the isascii() function
406  */
407 #if !defined(HAVE_ISASCII) && !defined(isascii)
408 # define isascii(c) (!((c) & ~0177))
409 #endif /* !HAVE_ISASCII && !isascii */
410 
411 
412 /*
413  * any pgp/gpp support possible and wanted
414  * sort out possible conflicts: gpg is preferred over pgp5 over pgp
415  */
416 #if defined(HAVE_PGP) || defined(HAVE_PGPK) || defined(HAVE_GPG)
417 # define HAVE_PGP_GPG 1
418 # if defined(HAVE_PGP) && defined(HAVE_PGPK)
419 # undef HAVE_PGP
420 # endif /* HAVE_PGP && HAVE_PGPK */
421 # if defined(HAVE_PGPK) && defined(HAVE_GPG)
422 # undef HAVE_PGPK
423 # endif /* HAVE_PGPK && HAVE_GPG */
424 # if defined(HAVE_PGP) && defined(HAVE_GPG)
425 # undef HAVE_PGP
426 # endif /* HAVE_PGP && HAVE_GPG */
427 #endif /* HAVE_PGP || HAVE_PGPK || HAVE_GPG */
428 
429 /*
430  * slrnface requires some things
431  */
432 #if defined(HAVE_SLRNFACE) && defined(HAVE_MKFIFO) && defined(HAVE_FORK) && defined(HAVE_EXECLP) && defined(HAVE_WAITPID) && !defined(DONT_HAVE_PIPING) && !defined(X_DISPLAY_MISSING)
433 # define XFACE_ABLE
434 #endif /* HAVE_SLRNFACE && HAVE_MKFIFO && HAVE_FORK && HAVE_EXECLP && HAVE_WAITPID && !DONT_HAVE_PIPING && !X_DISPLAY_MISSING */
435 
436 /*
437  * Setup support for reading from NNTP
438  */
439 #if defined(NNTP_ABLE) || defined(NNTP_ONLY)
440 # ifndef NNTP_ABLE
441 # define NNTP_ABLE 1
442 # endif /* !NNTP_ABLE */
443 # ifndef NNTP_INEWS
444 # define NNTP_INEWS 1
445 # endif /* !NNTP_INEWS */
446 #else
447 # ifdef XHDR_XREF
448 # undef XHDR_XREF
449 # endif /* XHDR_XREF */
450 # ifdef BROKEN_LISTGROUP
451 # undef BROKEN_LISTGROUP
452 # endif /* BROKEN_LISTGROUP */
453 #endif /* NNTP_ABLE || NNTP_ONLY */
454 
455 #define FAKE_NNTP_FP (FILE *) 9999
456 
457 /*
458  * Max time between the first character of a VT terminal escape sequence
459  * for special keys and the following characters to arrive (msec)
460  */
461 #define SECOND_CHARACTER_DELAY 200
462 
463 /*
464  * Maximum time (seconds) for a VT terminal escape sequence
465  */
466 #define VT_ESCAPE_TIMEOUT 1
467 
468 /*
469  * Determine machine configuration for external programs & directories
470  */
471 #if defined(BSD)
472 /*
473  * To catch 4.3 Net2 code base or newer
474  * (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386 1.1 and below).
475  * use
476  * #if (defined(BSD) && (BSD >= 199103))
477  *
478  * To detect if the code is being compiled on a 4.4 code base or newer
479  * (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or above).
480  * use
481  * #if (defined(BSD) && (BSD >= 199306))
482  *
483  * (defined in <sys/param.h>)
484  */
485 # ifndef HAVE_MEMCMP
486 # define memcmp(s1, s2, n) bcmp(s2, s1, n)
487 # endif /* !HAVE_MEMCMP */
488 # ifndef HAVE_MEMCPY
489 # define memcpy(s1, s2, n) bcopy(s2, s1, n)
490 # endif /* !HAVE_MEMCPY */
491 # ifndef HAVE_MEMSET
492 # define memset(s1, s2, n) bfill(s1, n, s2)
493 # endif /* !HAVE_MEMSET */
494 # ifndef HAVE_STRCHR
495 # define strchr(str, ch) index(str, ch)
496 # endif /* !HAVE_STRCHR */
497 # ifndef HAVE_STRRCHR
498 # define strrchr(str, ch) rindex(str, ch)
499 # endif /* !HAVE_STRRCHR */
500 # if defined(__386BSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
501 # define DEFAULT_PRINTER "/usr/bin/lpr"
502 # define DEFAULT_SUM "/usr/bin/cksum -o 1 <" /* use tailing <, otherwise get filename output too */
503 # else
504 # define DEFAULT_PRINTER "/usr/ucb/lpr"
505 # define DEFAULT_SUM "sum"
506 # endif /* __386BSD__ || __bsdi__ || __NetBSD__ || __FreeBSD__ || __OpenBSD__ */
507 # ifdef DGUX
508 # define USE_INVERSE_HACK
509 # endif /* DGUX */
510 # ifdef pyr
511 # define DEFAULT_MAILER "/usr/.ucbucb/mail"
512 # endif /* pyr */
513 #else /* !BSD */
514 # ifdef linux
515 # define DEFAULT_PRINTER "/usr/bin/lpr"
516 # endif /* linux */
517 # ifdef QNX42
518 # ifndef DEFAULT_EDITOR
519 # define DEFAULT_EDITOR "/bin/vedit"
520 # endif /* !DEFAULT_EDITOR */
521 # endif /* QNX42 */
522 # ifdef _AIX
523 # define DEFAULT_PRINTER "/bin/lp"
524 # define READ_CHAR_HACK
525 # endif /* _AIX */
526 # ifdef sinix
527 # define DEFAULT_PRINTER "/bin/lpr"
528 # endif /* sinix */
529 # ifdef sysV68
530 # define DEFAULT_MAILER "/bin/rmail"
531 # endif /* sysV68 */
532 # ifdef UNIXPC
533 # define DEFAULT_MAILER "/bin/rmail"
534 # endif /* UNIXPC */
535 
536 # ifndef DEFAULT_PRINTER
537 # define DEFAULT_PRINTER "/usr/bin/lp"
538 # endif /* !DEFAULT_PRINTER */
539 # ifndef PATH_SUM
540 # define DEFAULT_SUM "sum -r"
541 # endif /* !PATH_SUM */
542 #endif /* BSD */
543 
544 /*
545  * fallback values
546  */
547 #ifndef DEFAULT_EDITOR
548 # define DEFAULT_EDITOR "/usr/bin/vi"
549 #endif /* !DEFAULT_EDITOR */
550 #ifndef DEFAULT_MAILER
551 # define DEFAULT_MAILER "/usr/lib/sendmail"
552 #endif /* !DEFAULT_MAILER */
553 #ifndef DEFAULT_MAILBOX
554 # define DEFAULT_MAILBOX "/usr/spool/mail"
555 #endif /* !DEFAULT_MAILBOX */
556 
557 
558 /* FIXME: remove absolute-paths! */
559 /*
560  * Miscellaneous program-paths
561  */
562 #ifndef PATH_ISPELL
563 # define PATH_ISPELL "ispell"
564 #endif /* !PATH_ISPELL */
565 
566 #ifndef PATH_METAMAIL /* only unset if !HAVE_METAMAIL */
567 # define PATH_METAMAIL "metamail"
568 #endif /* !PATH_METAMAIL */
569 #define METAMAIL_CMD PATH_METAMAIL" -e -p -m \"tin\""
570 
571 #define INTERNAL_CMD "--internal"
572 
573 /*
574  * Fix up the 'sum' path and parameter for './configure'd systems
575  */
576 #ifdef PATH_SUM
577 # ifdef DEFAULT_SUM
578 # undef DEFAULT_SUM
579 # endif /* DEFAULT_SUM */
580 # ifdef SUM_TAKES_DASH_R
581 # define DEFAULT_SUM PATH_SUM_R
582 # else
583 # define DEFAULT_SUM PATH_SUM
584 # endif /* SUM_TAKES_DASH_R */
585 #endif /* PATH_SUM */
586 
587 #ifdef HAVE_LONG_FILE_NAMES
588 # define PATH_PART "part"
589 # define PATH_PATCH "patch"
590 # define INDEX_LOCK "tin.%s.LCK"
591 #else
592 # define PATH_PART ""
593 # define PATH_PATCH "p"
594 # define INDEX_LOCK "%s.LCK"
595 #endif /* HAVE_LONG_FILE_NAMES */
596 
597 /*
598  * How often should the active file be reread for new news
599  */
600 #ifndef REREAD_ACTIVE_FILE_SECS
601 # define REREAD_ACTIVE_FILE_SECS 1200 /* seconds (20 mins) */
602 #endif /* !REREAD_ACTIVE_FILE_SECS */
603 
604 /*
605  * Initial sizes of internal arrays for small (<4MB) & large memory machines
606  */
607 #ifdef SMALL_MEMORY_MACHINE
608 # define DEFAULT_ARTICLE_NUM 600
609 # define DEFAULT_SAVE_NUM 10
610 #else
611 # define DEFAULT_ARTICLE_NUM 1200
612 # define DEFAULT_SAVE_NUM 30
613 #endif /* SMALL_MEMORY_MACHINE */
614 #define DEFAULT_ACTIVE_NUM 1800
615 #define DEFAULT_NEWNEWS_NUM 5
616 #define DEFAULT_MAPKEYS_NUM 100 /* ~remappable keys per level (avoid massiv reallocs) */
617 #define DEFAULT_SCOPE_NUM 8
618 
619 #define RCDIR ".tin"
620 #define INDEX_MAILDIR ".mail"
621 #define INDEX_NEWSDIR ".news"
622 #define INDEX_SAVEDIR ".save"
623 
624 #define ACTIVE_FILE "active"
625 #define ACTIVE_MAIL_FILE "active.mail"
626 #define ACTIVE_SAVE_FILE "active.save"
627 #define ACTIVE_TIMES_FILE "active.times"
628 #define ATTRIBUTES_FILE "attributes"
629 #define CONFIG_FILE "tinrc"
630 #define SERVERCONFIG_FILE "serverrc"
631 #define DEFAULT_MAILDIR "Mail"
632 #define DEFAULT_SAVEDIR "News"
633 #define DEFAULT_URL_HANDLER "url_handler.pl"
634 /* Prefixes saved attachments with no set filename */
635 #define SAVEFILE_PREFIX "unknown"
636 
637 
638 /* MMDF-mailbox separator */
639 #ifndef MMDFHDRTXT
640 # define MMDFHDRTXT "\01\01\01\01\n"
641 #endif /* MMDFHDRTXT */
642 
643 
644 /*
645  * all regexps are extended -> # must be quoted!
646  */
647 #ifdef HAVE_COLOR
648 /* case insensitive */
649 # define DEFAULT_QUOTE_REGEX "^\\s{0,3}(?:[\\]{}>|:)]|\\w{1,3}[>|])(?!-)"
650 # define DEFAULT_QUOTE_REGEX2 "^\\s{0,3}(?:(?:[\\]{}>|:)]|\\w{1,3}[>|])\\s*){2}(?!-[})>])"
651 # define DEFAULT_QUOTE_REGEX3 "^\\s{0,3}(?:(?:[\\]{}>|:)]|\\w{1,3}[>|])\\s*){3}"
652 #endif /* HAVE_COLOR */
653 
654 /* case insensitive */
655 #if 0 /* single words only */
656 # define DEFAULT_SLASHES_REGEX "(?:^|(?<=\\s))/[^\\s/]+/(?:(?=[,.!?;]?\\s)|$)"
657 # define DEFAULT_STARS_REGEX "(?:^|(?<=\\s))\\*[^\\s*]+\\*(?:(?=[,.!?;]?\\s)|$)"
658 # define DEFAULT_UNDERSCORES_REGEX "(?:^|(?<=\\s))_[^\\s_]+_(?:(?=[,.!?;]?\\s)|$)"
659 # define DEFAULT_STROKES_REGEX "(?:^|(?<=\\s))-[^-\\s]+-(?:(?=[,.!?;]?\\s)|$)"
660 #else /* multiple words */
661 # define DEFAULT_SLASHES_REGEX "(?:^|(?<=\\s))/(?(?=[^-*/_\\s][^/\\s])[^-*/_\\s][^/]*[^-*/_\\s]|[^/\\s])/(?:(?=[,.!?;]?\\s)|$)"
662 # define DEFAULT_STARS_REGEX "(?:^|(?<=\\s))\\*(?(?=[^-*/_\\s][^*\\s])[^-*/_\\s][^*]*[^-*/_\\s]|[^*\\s])\\*(?:(?=[,.!?;]?\\s)|$)"
663 # define DEFAULT_UNDERSCORES_REGEX "(?:^|(?<=\\s))_(?(?=[^-*/_\\s][^_\\s])[^-*/_\\s][^_]*[^-*/_\\s]|[^_\\s])_(?:(?=[,.!?;]?\\s)|$)"
664 # define DEFAULT_STROKES_REGEX "(?:^|(?<=\\s))-(?(?=[^-*/_\\s][^-\\s])[^-*/_\\s][^-]*[^-*/_\\s]|[^-\\s])-(?:(?=[,.!?;]?\\s)|$)"
665 #endif /* 0 */
666 
667 /* case sensitive && ^-anchored */
668 #define DEFAULT_STRIP_RE_REGEX "(?:R[eE](?:\\^\\d+|\\[\\d+\\])?|A[wW]|Odp|Sv):\\s"
669 /* case sensitive */
670 #define DEFAULT_STRIP_WAS_REGEX "(?:(?<=\\S)|\\s)\\((?:[Ww]a[rs]|[Bb]y[l\\xb3]o):.*\\)\\s*$"
671 #define DEFAULT_U8_STRIP_WAS_REGEX "(?:(?<=\\S)|\\s)\\((?:[Ww]a[rs]|[Bb]y[l\\x{0142}]o):.*\\)\\s*$"
672 /*
673  * overkill regexp for balanced '()':
674  * #define DEFAULT_STRIP_WAS_REGEX "(?:(?<=\\S)|\\s)\\((?:[Ww]a[rs]|[Bb]y[l\xb3]o):(?:(?:[^)(])*(?:\\([^)(]*\\))*)+\\)\\s*$"
675  */
676 
677 /* case sensitive & ^-anchored */
678 #define UUBEGIN_REGEX "begin\\s\\s?[0-7]{3,4}\\s+"
679 /* case sensitive & ^-anchored */
680 #define UUBODY_REGEX "(?:`|.[\\x20-\\x60]{1,61})$"
681 
682 /* case sensitive & ^-anchored */
683 #define SHAR_REGEX "\\#(?:!\\s?(?:/usr)?/bin/sh|\\s?(?i)this\\sis\\sa\\sshell\\sarchive)"
684 
685 /* slrn verbatim marks, case sensitive & ^-anchored */
686 #define DEFAULT_VERBATIM_BEGIN_REGEX "#v\\+\\s$"
687 #define DEFAULT_VERBATIM_END_REGEX "#v-\\s$"
688 
689 /* quoted text from external sources */
690 #define DEFAULT_EXTQUOTE_REGEX "^\\|\\s"
691 
692 /*
693  * URL related regexs:
694  * add TELNET (RFC 4248), WAIS (RFC 4156), IMAP (RFC 2192), NFS (RFC 2224)
695  * LDAP (RFC 2255), POP (RFC 2384)
696  * add IPv6 (RFC 2732, RFC 2373) support
697  */
698 /*
699  * case insensitive
700  * TODO: - split out ftp (only ftp allows username:passwd@, RFC 1738)?
701  * - test IDNA (RFC 3490) case
702  */
703 #define URL_REGEX "\\b(?:https?|ftp|gopher)://(?:[^:@/\\s]*(?::[^:@/\\s]*)?@)?(?:(?:(?:[^\\W_](?:(?:-|[^\\W_]){0,61}(?<!---)[^\\W_])?|xn--[^\\W_](?:-(?!-)|[^\\W_]){1,57}[^\\W_])\\.)+[a-z]{2,14}\\.?|localhost|(?:(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?)|\\[(?:(?:[0-9A-F]{0,4}:){1,7}[0-9A-F]{1,4}|(?:[0-9A-F]{0,4}:){1,3}(?:(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?))\\])(?::\\d+)?(?(?=[^\\)\\]\\>\"\\s]*\\()(?:/[^\\]\\>\"\\s]*|$|(?=[)\\]\\>\"\\s]))|(?:/[^)\\]\\>\"\\s]*|$|(?=[)\\]\\>\"\\s])))"
704 /*
705  * case insensitive
706  * TOFO: check against RFC 6068
707  */
708 #define MAIL_REGEX "\\b(?:mailto:(?:[-\\w$.+!*'(),;/?:@&=]|%[\\da-f]{2})+)(?<!\\))"
709 /*
710  * case insensitive
711  * TODO: check against RFC 5538
712  */
713 #define NEWS_REGEX "\\b(?:s?news|nntp):(?:(?:(?://(?:(?:[^\\W_](?:(?:-|[^\\W_]){0,61}(?<!---)[^\\W_])?|xn--[^\\W_](?:-(?!-)|[^\\W_]){1,57}[^\\W_])\\.)+[a-z]{2,14}\\.?|localhost|(?:(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?))(?::\\d+)?(?(?=[/])[^()\\^\\[\\]{}\\|\\x00-\\x1f\\x7f\\s\"<>'\\\\:,;]+|$))|[^\\^\\[\\]{}\\|\\x00-\\x1f\\x7f\\s<>\"():,;\\\\'/]+)\\b"
714 
715 #if 0 /* not implemented */
716 /*
717  * case insensitive
718  */
719 # define TELNET_REGEX "\\btelnet://(?:[^:@/]*(?::[^:@/]*)?@)?(?:(?:[^\\W_](?:(?:-|[^\\W_]){0,61}(?<!---)[^\\W_])?\\.)+[a-z]{2,14}\\.?||localhost|(?:(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(?:2[0-4]\\d|25[0-5]|[01]?\\d\\d?))(?::\\d+)?/?"
720 #endif /* 0 */
721 
722 
723 #define FILTER_FILE "filter"
724 #define INPUT_HISTORY_FILE ".inputhistory"
725 #ifdef HAVE_MH_MAIL_HANDLING
726 # define MAILGROUPS_FILE "mailgroups"
727 #endif /* HAVE_MH_MAIL_HANDLING */
728 #define NEWSRC_FILE ".newsrc"
729 #define NEWSRCTABLE_FILE "newsrctable"
730 /* ifdef APPEND_PID (default) NEWNEWSRC_FILE will be .newnewsrc<pid> */
731 #define NEWNEWSRC_FILE ".newnewsrc"
732 #define OLDNEWSRC_FILE ".oldnewsrc"
733 #ifndef OVERVIEW_FILE
734 # define OVERVIEW_FILE ".overview"
735 #endif /* !OVERVIEW_FILE */
736 #define OVERVIEW_FMT "overview.fmt"
737 #define POSTED_FILE "posted"
738 #define POSTPONED_FILE "postponed.articles"
739 #define SUBSCRIPTIONS_FILE "subscriptions"
740 #define NEWSGROUPS_FILE "newsgroups"
741 #define KEYMAP_FILE "keymap"
742 
743 #define SIGDASHES "-- \n"
744 
745 #ifndef BOOL_H
746 # include "bool.h"
747 #endif /* BOOL_H */
748 
749 /* Philip Hazel's Perl regular expressions library */
750 #include <pcre.h>
751 
752 #ifdef HAVE_ICONV
753 # define CHARSET_CONVERSION 1
754 # ifdef HAVE_ICONV_H
755 # include <iconv.h>
756 # endif /* HAVE_ICONV_H */
757 #endif /* HAVE_ICONV */
758 
759 #ifdef HAVE_LANGINFO_H
760 # include <langinfo.h>
761 #else
762 # ifdef HAVE_NL_TYPES_H
763 # include <nl_types.h>
764 # endif /* HAVE_NL_TYPES_H */
765 #endif /* HAVE_LANGINFO_H */
766 #ifndef HAVE_NL_ITEM
767  typedef int nl_item;
768 #endif /* HAVE_NL_ITEM */
769 #ifndef CODESET
770 # define CODESET ((nl_item) 1)
771 #endif /* CODESET */
772 
773 #ifdef CHARSET_CONVERSION
774 # define IS_LOCAL_CHARSET(c) (!strncasecmp(tinrc.mm_local_charset, c, strlen(c)))
775 #else
776 # define IS_LOCAL_CHARSET(c) (!strncasecmp(tinrc.mm_charset, c, strlen(c)))
777 #endif /* CHARSET_CONVERSION */
778 
779 /* TODO: move up to the 'right' place */
780 #ifdef HAVE_SYS_FILE_H
781 # include <sys/file.h>
782 #endif /* HAVE_SYS_FILE_H */
783 
784 #ifdef HAVE_LIBUTF8_H
785 # include <libutf8.h>
786 #else
787 /*
788  * order is important here:
789  * - Solaris 2.5.1 requires wchar.h before wctype.h
790  * - Tru64 with Desktop Toolkit C requires stdio.h before wchar.h
791  * - BSD/OS 4.0.1 requires stddef.h, stdio.h and time.h before wchar.h
792  */
793 # ifdef HAVE_WCHAR_H
794 # include <wchar.h>
795 # endif /* HAVE_WCHAR_H */
796 # ifdef HAVE_WCTYPE_H
797 # include <wctype.h>
798 # endif /* HAVE_WCTYPE_H */
799 #endif /* HAVE_LIBUTF8_H */
800 
801 #ifndef MAX
802 # define MAX(a,b) (((a) > (b)) ? (a) : (b))
803 #endif /* !MAX */
804 #ifndef MIN
805 # define MIN(a,b) (((a) > (b)) ? (b) : (a))
806 #endif /* !MIN */
807 
808 #ifndef forever
809 /*@notfunction@*/
810 # define forever for(;;)
811 #endif /* !forever */
812 
813 /* safe strcpy into fixed-legth buffer */
814 #define STRCPY(dst, src) (dst[sizeof(dst) - 1] = '\0', strncpy(dst, src, sizeof(dst) - 1))
815 
816 #define STRCMPEQ(s1, s2) (strcmp((s1), (s2)) == 0)
817 #define STRNCMPEQ(s1, s2, n) (strncmp((s1), (s2), n) == 0)
818 #define STRNCASECMPEQ(s1, s2, n) (strncasecmp((s1), (s2), n) == 0)
819 
820 /*
821  * PATH_LEN = max. path length (incl. terminating '\0')
822  * NAME_LEN = max. filename length (not incl. terminating '\0')
823  * LEN =
824  * HEADER_LEN = max. size of a news/mail header-line
825  * NEWSRC_LINE =
826  */
827 
828 #ifdef PATH_MAX
829 # define PATH_LEN PATH_MAX
830 #else
831 # ifdef MAXPATHLEN
832 # define PATH_LEN MAXPATHLEN
833 # else
834 # ifdef _POSIX_PATH_MAX
835 # define PATH_LEN _POSIX_PATH_MAX
836 # else
837 # define PATH_LEN 255
838 # endif /* _POSIX_PATH_MAX */
839 # endif /* MAXPATHLEN */
840 #endif /* PATH_MAX */
841 #ifdef HAVE_LONG_FILE_NAMES
842 # ifdef NAME_MAX
843 # define NAME_LEN NAME_MAX
844 # else
845 # ifdef _POSIX_NAME_MAX
846 # define NAME_LEN _POSIX_NAME_MAX
847 # else
848 # define NAME_LEN 14
849 # endif /* _POSIX_NAME_MAX */
850 # endif /* NAME_MAX */
851 #else
852 # define NAME_LEN 14
853 #endif /* HAVE_LONG_FILE_NAMES */
854 #define LEN 1024
855 
856 #define NEWSRC_LINE 8192
857 #define HEADER_LEN 1024
858 #define IMF_LINE_LEN 998 /* RFC 5322 2.1.1 */
859 
860 #define TABLE_SIZE 1409
861 
862 #define MODULO_COUNT_NUM 50
863 
864 #define DAY (60*60*24) /* Seconds in a day */
865 
866 #define ctrl(c) ((c) & 0x1F)
867 
868 #ifndef DEFAULT_ISO2ASC
869 # define DEFAULT_ISO2ASC "-1 " /* ISO -> ASCII charset conversion */
870 #endif /* !DEFAULT_ISO2ASC */
871 
872 #ifndef DEFAULT_COMMENT
873 # define DEFAULT_COMMENT "> " /* used when by follow-ups & replies */
874 #endif /* !DEFAULT_COMMENT */
875 #ifndef ART_MARK_UNREAD
876 # define ART_MARK_UNREAD '+' /* used to show that an art is unread */
877 #endif /* !ART_MARK_UNREAD */
878 #ifndef ART_MARK_RETURN
879 # define ART_MARK_RETURN '-' /* used to show that an art will return */
880 #endif /* !ART_MARK_RETURN */
881 #ifndef ART_MARK_SELECTED
882 # define ART_MARK_SELECTED '*' /* used to show that an art was auto selected */
883 #endif /* !ART_MARK_SELECTED */
884 #ifndef ART_MARK_RECENT
885 # define ART_MARK_RECENT 'o' /* used to show that an art is fresh */
886 #endif /* !ART_MARK_RECENT */
887 #ifndef ART_MARK_READ
888 # define ART_MARK_READ ' ' /* used to show that an art was not read or seen */
889 #endif /* !ART_MARK_READ */
890 #ifndef ART_MARK_READ_SELECTED
891 # define ART_MARK_READ_SELECTED ':' /* used to show that a read art is hot (kill_level >0) */
892 #endif /* !ART_MARK_READ_SELECTED */
893 #ifndef ART_MARK_KILLED
894 # define ART_MARK_KILLED 'K' /* art has been killed (kill_level >0) */
895 #endif /* !ART_MARK_KILLED */
896 #ifndef ART_MARK_DELETED
897 # define ART_MARK_DELETED 'D' /* art has been marked for deletion (mailgroup) */
898 #endif /* !ART_MARK_DELETED */
899 #ifndef MARK_INRANGE
900 # define MARK_INRANGE '#' /* group/art within a range (# command) */
901 #endif /* !MARK_INRANGE */
902 
903 
904 /*
905  * Unicode chars for thread and attachment tree and cursor (instead of "|+`->")
906  * only available when IS_LOCAL_CHARSET("UTF-8")
907  */
908 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
909  /*
910  * For CURSOR_ARROW and CURSOR_HORIZ tinrc.utf8_graphics ? :
911  * is handled inside screen.c:draw_arrow_mark().
912  */
913 # define CURSOR_ARROW (wint_t) 0x25B6
914 # define CURSOR_HORIZ (wint_t) 0x2500
915 # define TREE_ARROW (wchar_t) (tinrc.utf8_graphics ? 0x25B6 : '>')
916 # define TREE_ARROW_WRAP (wchar_t) (tinrc.utf8_graphics ? 0x25B7 : '>')
917 # define TREE_BLANK (wchar_t) ' '
918 # define TREE_HORIZ (wchar_t) (tinrc.utf8_graphics ? 0x2500 : '-')
919 # define TREE_UP_RIGHT (wchar_t) (tinrc.utf8_graphics ? 0x2514 : '`')
920 # define TREE_VERT (wchar_t) (tinrc.utf8_graphics ? 0x2502 : '|')
921 # define TREE_VERT_RIGHT (wchar_t) (tinrc.utf8_graphics ? 0x251C : '+')
922 #else
923  /*
924  * No need for CURSOR_ARROW and CURSOR_HORIZ here. This is handled inside
925  * screen.c:draw_arrow_mark().
926  */
927 # define TREE_ARROW '>'
928 # define TREE_ARROW_WRAP '>'
929 # define TREE_BLANK ' '
930 # define TREE_HORIZ '-'
931 # define TREE_UP_RIGHT '`'
932 # define TREE_VERT '|'
933 # define TREE_VERT_RIGHT '+'
934 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
935 
936 #ifdef USE_INVERSE_HACK
937 # define BLANK_PAGE_COLS 2
938 #else
939 # define BLANK_PAGE_COLS 0
940 #endif /* USE_INVERSE_HACK */
941 
942 /*
943  * Return values for tin_errno
944  */
945 #define TIN_ABORT 1 /* User requested abort or timeout */
946 
947 #define TINRC_CONFIRM_ACTION (tinrc.confirm_choice == 1 || tinrc.confirm_choice == 4 || tinrc.confirm_choice == 5 || tinrc.confirm_choice == 7)
948 #define TINRC_CONFIRM_TO_QUIT (tinrc.confirm_choice == 3 || tinrc.confirm_choice == 4 || tinrc.confirm_choice == 6 || tinrc.confirm_choice == 7)
949 #define TINRC_CONFIRM_SELECT (tinrc.confirm_choice == 2 || tinrc.confirm_choice == 5 || tinrc.confirm_choice == 6 || tinrc.confirm_choice == 7)
950 #define TINRC_CONFIRM_MAX 7
951 
952 /*
953  * defines for tinrc.auto_cc_bcc
954  */
955 #define AUTO_CC 1
956 #define AUTO_BCC 2
957 #define AUTO_CC_BCC 3
958 
959 /*
960  * defines for tinrc.goto_next_unread
961  */
962 #define NUM_GOTO_NEXT_UNREAD 4
963 #define GOTO_NEXT_UNREAD_PGDN 1
964 #define GOTO_NEXT_UNREAD_TAB 2
965 
966 /*
967  * defines for tinrc.trim_article_body
968  */
969 #define NUM_TRIM_ARTICLE_BODY 8
970 #define SKIP_LEADING 1
971 #define SKIP_TRAILING 2
972 #define COMPACT_MULTIPLE 4
973 
974 /*
975  * MIME Encodings
976  */
977 enum {
982 };
983 
984 /*
985  * Number of charset-traslation tables (iso2asci)
986  */
987 #define NUM_ISO_TABLES 7
988 
989 /*
990  * Maximum permissible colour number
991  */
992 #define MAX_COLOR 15
993 #define MAX_BACKCOLOR 7
994 
995 /*
996  * Count of available attributes for highlighting
997  */
998 #define MAX_ATTR 6
999 
1000 /*
1001  * Maximal permissible word mark type
1002  * 0 = nothing, 1 = mark, 2 = space
1003  */
1004 #define MAX_MARK 2
1005 
1006 /* Line number (starting at 0) of 1st non-header data on the screen */
1007 /* ie, size of header */
1008 #define INDEX_TOP 2
1009 #define INDEX2LNUM(i) (INDEX_TOP + (i) - currmenu->first)
1010 #ifndef USE_CURSES
1011 # define INDEX2SNUM(i) ((i) - currmenu->first)
1012 #endif /* !USE_CURSES */
1013 
1014 #define GROUP_MATCH(s1, pat, case_s) (wildmat(s1, pat, case_s))
1015 
1016 #define REGEX_FMT (tinrc.wildcard ? "%s" : "*%s*")
1017 
1018 #define IGNORE_ART(i) ((tinrc.kill_level != KILL_THREAD && arts[i].killed) || (arts[i].thread == ART_EXPIRED))
1019 /* only used for threading */
1020 #define IGNORE_ART_THREAD(i) (arts[i].thread != ART_UNTHREADED || (tinrc.kill_level == KILL_NOTHREAD && arts[i].killed))
1021 
1022 /*
1023  * Is this part text/plain?
1024  */
1025 #define IS_PLAINTEXT(x) \
1026  (x->type == TYPE_TEXT && strcasecmp("plain", x->subtype) == 0)
1027 
1028 /* TRUE if basenote has responses */
1029 #define HAS_FOLLOWUPS(i) (arts[base[i]].thread >= 0)
1030 
1031 /*
1032  * Only close off our stream when reading on local spool
1033  */
1034 #ifdef NNTP_ABLE
1035 # define TIN_FCLOSE(x) if (x != FAKE_NNTP_FP) fclose(x)
1036 #else
1037 # define TIN_FCLOSE(x) fclose(x)
1038 #endif /* NNTP_ABLE */
1039 
1040 /*
1041  * Often used macro to point to the group we are currently in
1042  */
1043 #define CURR_GROUP (active[my_group[selmenu.curr]])
1044 
1045 /*
1046  * Defines an unread group
1047  */
1048 #define UNREAD_GROUP(i) (!active[my_group[i]].bogus && active[my_group[i]].newsrc.num_unread > 0)
1049 
1050 /*
1051  * Expands to singular/plural version of string
1052  */
1053 #define PLURAL(x,y) ((x == 1) ? _(y##_singular) : _(y##_plural))
1054 
1055 /*
1056  * News/Mail group types
1057  */
1058 #define GROUP_TYPE_MAIL 0
1059 #define GROUP_TYPE_NEWS 1
1060 #define GROUP_TYPE_SAVE 2 /* saved news, read with tin -R */
1061 
1062 /*
1063  * used by get_arrow_key()
1064  */
1065 # define KEYMAP_UNKNOWN 0
1066 # define KEYMAP_UP 1
1067 # define KEYMAP_DOWN 2
1068 # define KEYMAP_LEFT 3
1069 # define KEYMAP_RIGHT 4
1070 # define KEYMAP_PAGE_UP 5
1071 # define KEYMAP_PAGE_DOWN 6
1072 # define KEYMAP_HOME 7
1073 # define KEYMAP_END 8
1074 # define KEYMAP_DEL 9
1075 # define KEYMAP_INS 10
1076 # define KEYMAP_MOUSE 11
1077 
1078 
1079 /*
1080  * used in curses.c and signal.c
1081  * it's useless trying to run tin below these sizes
1082  * (values acquired by testing ;-) )
1083  */
1084 #define MIN_LINES_ON_TERMINAL 8
1085 #define MIN_COLUMNS_ON_TERMINAL 50
1086 
1087 
1088 /*
1089  * indicate given cmd-line options
1090  */
1091 #define CMDLINE_GETART_LIMIT 1
1092 #define CMDLINE_MAILDIR 2
1093 #define CMDLINE_NNTPSERVER 4
1094 #define CMDLINE_SAVEDIR 8
1095 #define CMDLINE_USE_COLOR 16
1096 
1097 
1098 /*
1099  * used by feed_articles() & show_mini_help() & quick_filter & add_filter_rule
1100  */
1101 #define SELECT_LEVEL 1
1102 #define GROUP_LEVEL 2
1103 #define THREAD_LEVEL 3
1104 #define PAGE_LEVEL 4
1105 #define INFO_PAGER 5
1106 #define SCOPE_LEVEL 6
1107 #define CONFIG_LEVEL 7
1108 #define ATTRIB_LEVEL 8
1109 #define ATTACHMENT_LEVEL 9
1110 #define URL_LEVEL 10
1111 
1112 #define MINI_HELP_LINES 5
1113 
1114 #define FEED_MAIL 1
1115 #define FEED_PIPE 2
1116 #define FEED_PRINT 3
1117 #define FEED_SAVE 4
1118 #define FEED_AUTOSAVE 5
1119 #define FEED_REPOST 6
1120 #define FEED_MARK_READ 7
1121 #define FEED_MARK_UNREAD 8
1122 
1123 
1124 /*
1125  * Threading strategies available
1126  */
1127 #define THREAD_NONE 0
1128 #define THREAD_SUBJ 1
1129 #define THREAD_REFS 2
1130 #define THREAD_BOTH 3
1131 #define THREAD_MULTI 4
1132 #define THREAD_PERC 5
1133 
1134 #define THREAD_MAX THREAD_PERC
1135 
1136 #define THREAD_PERC_DEFAULT 75
1137 
1138 /*
1139  * Values for show_author
1140  */
1141 #define SHOW_FROM_NONE 0
1142 #define SHOW_FROM_ADDR 1
1143 #define SHOW_FROM_NAME 2
1144 #define SHOW_FROM_BOTH 3
1145 
1146 /*
1147  * Values for thread_score
1148  */
1149 #define THREAD_SCORE_MAX 0
1150 #define THREAD_SCORE_SUM 1
1151 #define THREAD_SCORE_WEIGHT 2
1152 
1153 /*
1154  * Values for interactive_mailer
1155  */
1156 enum {
1160 };
1161 
1162 /*
1163  * used in feed.c & save.c
1164  */
1165 #define POST_PROC_NO 0
1166 #define POST_PROC_SHAR 1
1167 #define POST_PROC_YES 2
1168 
1169 /*
1170  * used in art.c
1171  * sort types on arts[] array
1172  */
1173 #define SORT_ARTICLES_BY_NOTHING 0
1174 #define SORT_ARTICLES_BY_SUBJ_DESCEND 1
1175 #define SORT_ARTICLES_BY_SUBJ_ASCEND 2
1176 #define SORT_ARTICLES_BY_FROM_DESCEND 3
1177 #define SORT_ARTICLES_BY_FROM_ASCEND 4
1178 #define SORT_ARTICLES_BY_DATE_DESCEND 5
1179 #define SORT_ARTICLES_BY_DATE_ASCEND 6
1180 #define SORT_ARTICLES_BY_SCORE_DESCEND 7
1181 #define SORT_ARTICLES_BY_SCORE_ASCEND 8
1182 #define SORT_ARTICLES_BY_LINES_DESCEND 9
1183 #define SORT_ARTICLES_BY_LINES_ASCEND 10
1184 
1185 /*
1186  * used in art.c
1187  * sort types on base[] array
1188  */
1189 #define SORT_THREADS_BY_NOTHING 0
1190 #define SORT_THREADS_BY_SCORE_DESCEND 1
1191 #define SORT_THREADS_BY_SCORE_ASCEND 2
1192 #define SORT_THREADS_BY_LAST_POSTING_DATE_DESCEND 3
1193 #define SORT_THREADS_BY_LAST_POSTING_DATE_ASCEND 4
1194 
1195 /*
1196  * Different values of strip_bogus - the ways to handle bogus groups
1197  */
1198 #define BOGUS_KEEP 0 /* not used */
1199 #define BOGUS_REMOVE 1
1200 #define BOGUS_SHOW 2
1201 
1202 /*
1203  * Different extents to which we can hide killed articles
1204  */
1205 #define KILL_UNREAD 0 /* Kill only unread articles */
1206 #define KILL_THREAD 1 /* Kill all articles and show as K */
1207 #define KILL_NOTHREAD 2 /* Kill all articles, never show them */
1208 
1209 /*
1210  * Various types of quoting behaviour
1211  */
1212 #define QUOTE_COMPRESS 1 /* Compress quotes */
1213 #define QUOTE_SIGS 2 /* Quote signatures */
1214 #define QUOTE_EMPTY 4 /* Quote empty lines */
1215 
1216 
1217 /*
1218  * used in save.c/main.c
1219  */
1220 #define CHECK_ANY_NEWS 0
1221 #define START_ANY_NEWS 1
1222 #define MAIL_ANY_NEWS 2
1223 #define SAVE_ANY_NEWS 3
1224 
1225 
1226 /*
1227  * used in post.c
1228  */
1229 #define POSTED_NONE 0 /* Article wasn't posted */
1230 #define POSTED_REDRAW 1 /* redraw needed in any case */
1231 #define POSTED_OK 2 /* posted normally */
1232 
1233 
1234 /*
1235  * used in pager
1236  */
1237 #define UUE_NO 0 /* Don't hide uue data */
1238 #define UUE_YES 1 /* Hide uue data */
1239 #define UUE_ALL 2 /* Hide uue data harder */
1240 
1241 /*
1242  * used in misc.c/rfc1524.c
1243  */
1248 };
1249 
1250 
1251 /*
1252  * index_point variable values used throughout tin
1253  */
1254 
1255 /*
1256  * -1 is kind of overloaded as an error from which_thread() and other functions
1257  * where we wish to return to the next level up
1258  */
1259 enum {
1260  GRP_RETSELECT = -1, /* Pager 'T' command only -> return to selection screen */
1261  GRP_QUIT = -2, /* Set by 'Q' when coming all the way out */
1262  GRP_NEXTUNREAD = -3, /* (After catchup) goto next unread item */
1263  GRP_NEXT = -4, /* (After catchup) move to next item */
1264  GRP_ARTUNAVAIL = -5, /* show_page() Article is unavailable */
1265  GRP_ARTABORT = -6, /* show_page() User aborted article read */
1266  GRP_KILLED = -7, /* ?? Thread was killed at pager level */
1267  GRP_GOTOTHREAD = -8, /* show_page() only. Goto thread menu */
1268  GRP_ENTER = -9, /* New group is set, spin in read_groups() */
1269  GRP_EXIT = -10 /* Normal return to higher level */
1270 };
1271 
1272 #ifndef EXIT_SUCCESS
1273 # define EXIT_SUCCESS 0 /* Successful exit status */
1274 #endif /* !EXIT_SUCCESS */
1275 
1276 #ifndef EXIT_FAILURE
1277 # define EXIT_FAILURE 1 /* Failing exit status */
1278 #endif /* !EXIT_FAILURE */
1279 
1280 #define NEWS_AVAIL_EXIT 2
1281 #define NNTP_ERROR_EXIT 3
1282 
1283 /*
1284  * Assertion verifier
1285  */
1286 #ifdef assert
1287 # undef assert
1288 #endif /* assert */
1289 #ifdef NDEBUG
1290 # define assert(p) ((void) 0)
1291 #else
1292 # ifdef CPP_DOES_EXPAND
1293 # define assert(p) if(!(p)) asfail(__FILE__, __LINE__, #p); else (void) 0;
1294 # else
1295 # define assert(p) if(!(p)) asfail(__FILE__, __LINE__, "p"); else (void) 0;
1296 # endif /* CPP_DOES_EXPAND */
1297 #endif /* NDEBUG */
1298 
1299 #define ESC 27
1300 
1301 /*
1302  * filter entries expire after DEFAULT_FILTER_DAYS
1303  */
1304 #define DEFAULT_FILTER_DAYS 28
1305 
1306 /*
1307  * art.thread
1308  */
1309 #define ART_UNTHREADED -1
1310 #define ART_EXPIRED -2
1311 
1312 /*
1313  * Where does this belong?? It is overloaded
1314  */
1315 #define ART_NORMAL -1
1316 
1317 /*
1318  * art.status
1319  */
1320 #define ART_READ 0
1321 #define ART_UNREAD 1
1322 #define ART_WILL_RETURN 2
1323 #define ART_UNAVAILABLE -1 /* Also used by msgid.article */
1324 
1325 /*
1326  * art.killed
1327  */
1328 #define ART_NOTKILLED 0
1329 #define ART_KILLED 1
1330 #define ART_KILLED_UNREAD 2
1331 
1332 /*
1333  * Additionally used for user aborts in art_open()
1334  */
1335 #define ART_ABORT -2
1336 
1337 /*
1338  * used by t_group & my_group[]
1339  */
1340 #define UNSUBSCRIBED '!'
1341 #define SUBSCRIBED ':'
1342 
1343 /* Converts subscription status to char for .newsrc */
1344 #define SUB_CHAR(x) (x ? SUBSCRIBED : UNSUBSCRIBED)
1345 /* Converts .newsrc subscription char to boolean */
1346 #define SUB_BOOL(x) (x == SUBSCRIBED)
1347 
1348 /*
1349  * filter_type used in struct t_filter
1350  */
1351 #define SCORE_MAX 10000
1352 
1353 #define FILTER_SUBJ_CASE_SENSITIVE 0
1354 #define FILTER_SUBJ_CASE_IGNORE 1
1355 #define FILTER_FROM_CASE_SENSITIVE 2
1356 #define FILTER_FROM_CASE_IGNORE 3
1357 #define FILTER_MSGID 4
1358 #define FILTER_MSGID_LAST 5
1359 #define FILTER_MSGID_ONLY 6
1360 #define FILTER_REFS_ONLY 7
1361 #define FILTER_LINES 8
1362 
1363 #define FILTER_LINES_NO 0
1364 #define FILTER_LINES_EQ 1
1365 #define FILTER_LINES_LT 2
1366 #define FILTER_LINES_GT 3
1367 
1368 /*
1369  * default format strings for selection, group, thread level
1370  * and the date display in the page header.
1371  * Don't change without adjusting rc_update() and the like accordingly!
1372  */
1373 #define DEFAULT_SELECT_FORMAT "%f %n %U %G %d"
1374 #define DEFAULT_GROUP_FORMAT "%n %m %R %L %s %F"
1375 #define DEFAULT_THREAD_FORMAT "%n %m [%L] %T %F"
1376 #define DEFAULT_DATE_FORMAT "%a, %d %b %Y %H:%M:%S"
1377 
1378 /*
1379  * unicode normalization
1380  */
1381 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
1382 # ifdef HAVE_LIBICUUC
1383 # define HAVE_UNICODE_NORMALIZATION 3
1384 # else
1385 # ifdef HAVE_LIBUNISTRING
1386 # define HAVE_UNICODE_NORMALIZATION 2
1387 # else
1388 # if defined(HAVE_LIBIDN) && defined(HAVE_STRINGPREP_H)
1389 # define HAVE_UNICODE_NORMALIZATION 1
1390 # endif /* HAVE_LIBIDN && HAVE_STRINGPREP_H */
1391 # endif /* HAVE_LIBUNISTRING */
1392 # endif /* HAVE_LIBICUUC */
1393 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
1394 
1395 /*
1396  * normalization forms, we prefer NFC (see RFC 6532) if possible
1397  */
1398 #ifdef HAVE_UNICODE_NORMALIZATION
1399 enum {
1400  NORMALIZE_NONE = 0,
1401  NORMALIZE_NFKC = 1,
1402 # if (HAVE_UNICODE_NORMALIZATION >= 2)
1403  NORMALIZE_NFKD = 2,
1404  NORMALIZE_NFC = 3,
1405  NORMALIZE_NFD = 4
1406 # ifdef HAVE_UNICODE_UNORM2_H
1407  , NORMALIZE_NFKC_CF = 5
1408 # endif /* HAVE_UNICODE_UNORM2_H */
1409 # endif /* HAVE_UNICODE_NORMALIZATION >= 2 */
1410 };
1411 # if (HAVE_UNICODE_NORMALIZATION >= 2)
1412 # ifdef HAVE_UNICODE_UNORM2_H
1413 # define NORMALIZE_MAX NORMALIZE_NFKC_CF
1414 # else
1415 # define NORMALIZE_MAX NORMALIZE_NFD
1416 # endif /* HAVE_UNICODE_UNORM2_H */
1417 # define DEFAULT_NORMALIZE NORMALIZE_NFC
1418 # else
1419 # define NORMALIZE_MAX NORMALIZE_NFKC
1420 # define DEFAULT_NORMALIZE NORMALIZE_NFKC
1421 # endif /* HAVE_UNICODE_NORMALIZATION >= 2 */
1422 #endif /* HAVE_UNICODE_NORMALIZATION */
1423 
1424 #ifdef HAVE_LIBICUUC
1425 # ifdef HAVE_UNICODE_USTRING_H
1426 # include <unicode/ustring.h>
1427 # endif /* HAVE_UNICODE_USTRING_H */
1428 # ifdef HAVE_UNICODE_UNORM2_H
1429 # include <unicode/unorm2.h>
1430 # else
1431 # ifdef HAVE_UNICODE_UNORM_H
1432 # include <unicode/unorm.h>
1433 # endif /* HAVE_UNICODE_UNORM_H */
1434 # endif /* HAVE_UNICODE_UNORM2_H */
1435 # ifdef HAVE_UNICODE_UIDNA_H
1436 # include <unicode/uidna.h>
1437 # endif /* HAVE_UNICODE_UIDNA_H */
1438 # ifdef HAVE_UNICODE_UBIDI_H
1439 # include <unicode/ubidi.h>
1440 # endif /* HAVE_UNICODE_UBIDI_H */
1441 #endif /* HAVE_LIBICUUC */
1442 
1443 
1444 /*
1445  * used in checking article header before posting
1446  */
1447 #define MAX_COL 78 /* Max. line length before issuing a warning */
1448 #define MAX_SIG_LINES 4 /* Max. num. of signature lines before warning */
1449 
1450 typedef unsigned char t_bitmap;
1451 
1452 /*
1453  * Keys for add_msgid()
1454  */
1455 #define REF_REF 1 /* Add a ref->ref entry */
1456 #define MSGID_REF 2 /* Add a msgid->ref entry */
1457 
1458 /*
1459  * Size of msgid hash table
1460  */
1461 #define MSGID_HASH_SIZE 2609
1462 
1463 /*
1464  * cmd-line options
1465  */
1467  int getart_limit; /* getart_limit */
1468  char maildir[PATH_LEN]; /* maildir */
1469  char nntpserver[PATH_LEN]; /* nntpserver */
1470  char savedir[PATH_LEN]; /* savedir */
1471  unsigned int args:5; /* given options */
1472 };
1473 
1474 /*
1475  * Archive-Name: header
1476  */
1477 struct t_archive {
1478  char *name; /* name of archive */
1479  char *partnum; /* part/patch no. in archive */
1480  t_bool ispart:1; /* TRUE if part, FALSE if patch */
1481 };
1482 
1483 /*
1484  * struct t_msgid - message id
1485  */
1486 struct t_msgid {
1487  struct t_msgid *next; /* Next in hash chain */
1488  struct t_msgid *parent; /* Message-id followed up to */
1489  struct t_msgid *sibling; /* Next followup to parent */
1490  struct t_msgid *child; /* First followup to this article */
1491  int article; /* index in arts[] or ART_NORMAL */
1492  char txt[1]; /* The actual msgid */
1493 };
1494 
1495 /*
1496  * struct t_article - article header
1497  *
1498  * article.thread:
1499  * the next article in thread
1500  * -1 (ART_UNTHREADED) article exists but is not (yet) threaded
1501  * -2 (ART_EXPIRED) article has expired (wasn't found in search of spool
1502  * directory for the group)
1503  * >=0 points to another arts[] (struct t_article)
1504  *
1505  * article.prev:
1506  * the previous article in thread
1507  * -1 (ART_NORMAL) initial default, first (no previous) article in thread
1508  * >=0 points to the previous arts[] (struct t_article)
1509  */
1510 struct t_article {
1511  t_artnum artnum; /* Article number in spool directory for group */
1512  char *subject; /* Subject: line from mail header */
1513  char *from; /* From: line from mail header (address) */
1514  char *name; /* From: line from mail header (full name) */
1515  int gnksa_code; /* From: line from mail header (GNKSA error code) */
1516  time_t date; /* Date: line from header in seconds */
1517  char *xref; /* Xref: cross posted article reference line */
1518  char *path; /* Path: line */
1519  /* NB: The msgid and refs are only retained until the reference tree is built */
1520  char *msgid; /* Message-ID: unique message identifier */
1521  char *refs; /* References: article reference id's */
1522  struct t_msgid *refptr; /* Pointer to us in the reference tree */
1523  int line_count; /* Lines: number of lines in article */
1524  struct t_archive *archive; /* Archive-Name: header */
1525  int tagged; /* 0 = not tagged, >0 = tagged */
1526  int thread;
1527  int prev;
1528  int score; /* score article has reached after filtering */
1529  unsigned int status:2; /* 0 = read, 1 = unread, 2 = will return */
1530  unsigned int killed:2; /* 0 = not killed, 1 = killed, 2 = killed unread */
1531  t_bool zombie:1; /* 1 = was alive (unread) before 'X' command */
1532  t_bool delete_it:1; /* 1 = delete art when leaving group [mail group] */
1533  t_bool selected:1; /* FALSE = not selected, TRUE = selected */
1534  t_bool inrange:1; /* TRUE = article selected via # range command */
1535  t_bool matched:1; /* TRUE = article matched regex in feed.c */
1536  t_bool keep_in_base:1; /* TRUE = keep (read) article in base[] (show_only_unread_arts) */
1537 };
1538 
1539 
1540 #ifdef NNTP_ABLE
1541 /*
1542  * struct t_article_range - holds ranges of article numbers to perform actions on parts of arts[]
1543  */
1544 struct t_article_range {
1545  t_artnum start;
1546  t_artnum end;
1547  t_artnum cnt;
1548  struct t_article_range *next;
1549 };
1550 #endif /* NNTP_ABLE */
1551 
1552 
1553 /*
1554  * struct t_newsheader - holds an array of which news headers to [not] display
1555  */
1557  char **header; /* array of which headers to [not] display */
1558  int num; /* number of headers in array header */
1559 };
1560 
1561 /*
1562  * struct t_attribute - configurable attributes on a per group basis
1563  */
1564 struct t_attribute {
1565  char *maildir; /* mail dir if other than ~/Mail */
1566  char *savedir; /* save dir if other than ~/News */
1567  char *savefile; /* save articles to specified file */
1568  char *sigfile; /* sig file if other than ~/.Sig */
1569  char *group_format; /* format string for group level */
1570  char *thread_format; /* format string for thread level */
1571  char *date_format; /* format string for the date display */
1572  char *editor_format; /* editor + parameters %E +%N %F */
1573  char *organization; /* organization name */
1574  char *fcc; /* Fcc folder for mail */
1575  char *followup_to; /* where posts should be redirected */
1576  char *quick_kill_scope; /* quick filter kill scope */
1577  char *quick_select_scope; /* quick filter select scope */
1578  char *mailing_list; /* mail list email address */
1579  char *news_headers_to_display; /* which headers to display */
1580  char *news_headers_to_not_display; /* which headers to not display */
1581  char *x_headers; /* extra headers for message header */
1582  char *x_body; /* boilerplate text for message body */
1583  char *from; /* from line */
1584  char *news_quote_format; /* another way to begin a posting format */
1585  char *quote_chars; /* string to precede quoted text on each line */
1586  char *mime_types_to_save; /* MIME content major/minors we want to save */
1587 #ifdef HAVE_ISPELL
1588  char *ispell; /* path to ispell and options */
1589 #endif /* HAVE_ISPELL */
1590 #ifdef CHARSET_CONVERSION
1591  char *undeclared_charset; /* charset of articles without MIME charset declaration */
1592  int mm_network_charset; /* network charset */
1593 #endif /* CHARSET_CONVERSION */
1594  struct t_newsheader *headers_to_display; /* array of which headers to display */
1595  struct t_newsheader *headers_to_not_display; /* array of which headers to not display */
1596  unsigned global:1; /* global/group specific */
1597  unsigned quick_kill_header:3; /* quick filter kill header */
1598  unsigned quick_kill_expire:1; /* quick filter kill limited/unlimited time */
1599  unsigned quick_kill_case:1; /* quick filter kill case sensitive? */
1600  unsigned quick_select_header:3; /* quick filter select header */
1601  unsigned quick_select_expire:1; /* quick filter select limited/unlimited time */
1602  unsigned quick_select_case:1; /* quick filter select case sensitive? */
1603  unsigned add_posted_to_filter:1; /* add posted articles to filter */
1604  unsigned advertising:1; /* add User-Agent: -header */
1605  unsigned alternative_handling:1; /* skip multipart/alternative parts */
1606  unsigned ask_for_metamail:1; /* ask before using MIME viewer */
1607  unsigned auto_cc_bcc:2; /* add your name to cc/bcc automatically */
1608  unsigned auto_list_thread:1; /* list thread when entering it using right arrow */
1609  unsigned auto_select:1; /* 0=show all unread, 1='X' just hot arts */
1610  unsigned auto_save:1; /* 0=none, 1=save */
1611  unsigned batch_save:1; /* 0=none, 1=save -S/mail -M */
1612  unsigned delete_tmp_files:1; /* 0=leave, 1=delete */
1613  unsigned group_catchup_on_exit:1; /* ask if read groups are to be marked read */
1614  unsigned mail_8bit_header:1; /* allow 8bit chars. in header of mail message */
1616  unsigned mark_ignore_tags:1; /* Ignore tags for GROUP_MARK_THREAD_READ/THREAD_MARK_ARTICLE_READ */
1617  unsigned mark_saved_read:1; /* mark saved article/thread as read */
1618  unsigned pos_first_unread:1; /* position cursor at first/last unread article */
1619  unsigned post_8bit_header:1; /* allow 8bit chars. in header when posting to newsgroup */
1621  unsigned post_process_view:1; /* set TRUE to invoke mailcap viewer app */
1622 #ifndef DISABLE_PRINTING
1623  unsigned print_header:1; /* print all of mail header or just Subject: & From lines */
1624 #endif /* !DISABLE_PRINTING */
1625  unsigned process_only_unread:1; /* save/print//mail/pipe unread/all articles */
1626  unsigned prompt_followupto:1; /* display empty Followup-To header in editor */
1627  unsigned show_only_unread_arts:1; /* 0=all, 1=only unread */
1628  unsigned sigdashes:1; /* set TRUE to prepend every signature with dashes */
1629  unsigned signature_repost:1; /* set TRUE to add signature when reposting articles */
1630  unsigned start_editor_offset:1; /* start editor with line offset */
1631  unsigned thread_articles:3; /* 0=unthread, 1=subject, 2=refs, 3=both, 4=multipart, 5=percentage */
1632  unsigned thread_catchup_on_exit:1; /* catchup thread with left arrow key or not */
1633  unsigned thread_perc:7; /* percentage threading threshold */
1634  unsigned show_author:2; /* 0=none, 1=name, 2=addr, 3=both */
1635  unsigned show_signatures:1; /* 0=none, 1=show signatures */
1636  unsigned trim_article_body:3; /* 0=Don't trim article body, 1=Skip leading blank lines,
1637  2=Skip trailing blank lines, 3=Skip leading and trailing blank lines,
1638  4=Compact multiple blank lines between textblocks,
1639  5=Compact multiple blank lines between textblocks and skip leading blank lines,
1640  6=Compact multiple blank lines between textblocks and skip trailing blank lines,
1641  7=Compact multiple blank lines between textblocks and skip leading and trailing
1642  blank lines */
1643  unsigned verbatim_handling:1; /* 0=none, 1=detect verbatim blocks */
1644 #ifdef HAVE_COLOR
1645  unsigned extquote_handling:1; /* 0=none, 1=detect quoted text from external sources */
1646 #endif /* HAVE_COLOR */
1647  unsigned wrap_on_next_unread:1; /* Wrap around threads when searching next unread article */
1648  unsigned sort_article_type:4; /* 0=none, 1=subj descend, 2=subj ascend,
1649  3=from descend, 4=from ascend,
1650  5=date descend, 6=date ascend,
1651  7=score descend, 8=score ascend */
1652  unsigned sort_threads_type:3; /* 0=none, 1=score descend, 2=score ascend,
1653  3=last posting date descend, 4=last posting date ascend */
1654  unsigned post_process_type:2; /* 0=none, 1=shar, 2=uudecode */
1655  unsigned x_comment_to:1; /* insert X-Comment-To: in Followup */
1656  unsigned tex2iso_conv:1; /* Convert TeX2ISO */
1657  unsigned mime_forward:1; /* forward articles as attachment or inline */
1658 };
1659 
1660 /*
1661  * struct t_attribute_state - holds additional information
1662  * about numeric attributes within a scope
1663  */
1666  unsigned advertising:1;
1668  unsigned ask_for_metamail:1;
1669  unsigned auto_cc_bcc:1;
1670  unsigned auto_list_thread:1;
1671  unsigned auto_save:1;
1672  unsigned auto_select:1;
1673  unsigned batch_save:1;
1674  unsigned date_format:1;
1675  unsigned delete_tmp_files:1;
1676  unsigned editor_format:1;
1677  unsigned fcc:1;
1678  unsigned followup_to:1;
1679  unsigned from:1;
1681  unsigned group_format:1;
1682 #ifdef HAVE_ISPELL
1683  unsigned ispell:1;
1684 #endif /* HAVE_ISPELL */
1685  unsigned mail_8bit_header:1;
1687  unsigned maildir:1;
1688  unsigned mailing_list:1;
1689  unsigned mark_ignore_tags:1;
1690  unsigned mark_saved_read:1;
1691  unsigned mime_forward:1;
1695  unsigned news_quote_format:1;
1696  unsigned organization:1;
1697  unsigned pos_first_unread:1;
1698  unsigned post_8bit_header:1;
1700  unsigned post_process_view:1;
1701  unsigned post_process_type:1;
1702 #ifndef DISABLE_PRINTING
1703  unsigned print_header:1;
1704 #endif /* !DISABLE_PRINTING */
1706  unsigned prompt_followupto:1;
1707  unsigned quick_kill_case:1;
1708  unsigned quick_kill_expire:1;
1709  unsigned quick_kill_header:1;
1710  unsigned quick_kill_scope:1;
1711  unsigned quick_select_case:1;
1715  unsigned quote_chars:1;
1716  unsigned savedir:1;
1717  unsigned savefile:1;
1718  unsigned show_author:1;
1720  unsigned show_signatures:1;
1721  unsigned sigdashes:1;
1722  unsigned sigfile:1;
1723  unsigned signature_repost:1;
1724  unsigned sort_article_type:1;
1725  unsigned sort_threads_type:1;
1727  unsigned tex2iso_conv:1;
1728  unsigned thread_articles:1;
1730  unsigned thread_format:1;
1731  unsigned thread_perc:1;
1732  unsigned trim_article_body:1;
1733 #ifdef CHARSET_CONVERSION
1734  unsigned undeclared_charset:1;
1735  unsigned mm_network_charset:1;
1736 #endif /* CHARSET_CONVERSION */
1737  unsigned verbatim_handling:1;
1738 #ifdef HAVE_COLOR
1739  unsigned extquote_handling:1;
1740 #endif /* HAVE_COLOR */
1742  unsigned x_body:1;
1743  unsigned x_comment_to:1;
1744  unsigned x_headers:1;
1745 };
1746 
1747 /*
1748  * struct t_scope
1749  */
1750 struct t_scope {
1751  char *scope; /* scope for these group attributes */
1752  struct t_attribute *attribute; /* the attributes itself */
1753  struct t_attribute_state *state; /* additional information about numeric attributes */
1754  unsigned global:1; /* TRUE for scopes from global_attributes_file */
1755 };
1756 
1757 /*
1758  * struct t_newsrc - newsrc related info.
1759  */
1760 struct t_newsrc {
1761  t_bool present:1; /* update newsrc? */
1762  t_artnum num_unread; /* unread articles in group */
1763  t_artnum xmax; /* newsrc max */
1764  t_artnum xmin; /* newsrc min */
1765  t_artnum xbitlen; /* bitmap length (max-min+1) */
1766  t_bitmap *xbitmap; /* bitmap read/unread (max-min+1+7)/8 */
1767 };
1768 
1769 /*
1770  * struct t_group - newsgroup info from active file
1771  */
1772 struct t_group {
1773  char *name; /* newsgroup/mailbox name */
1774  char *aliasedto; /* =new.group in active file, NULL if not */
1775  char *description; /* text from NEWSLIBDIR/newsgroups file */
1776  char *spooldir; /* groups spool directory */
1777  char moderated; /* state of group moderation */
1778  t_artnum count; /* article number count */
1779  t_artnum xmax; /* max. article number */
1780  t_artnum xmin; /* min. article number */
1781  unsigned int type:4; /* grouptype - newsgroup/mailbox/savebox */
1782  t_bool inrange:1; /* TRUE if group selected via # range command */
1783  t_bool read_during_session:1; /* TRUE if group entered during session */
1784  t_bool art_was_posted:1; /* TRUE if art was posted to group */
1785  t_bool subscribed:1; /* TRUE if subscribed to group */
1786  t_bool newgroup:1; /* TRUE if group was new this session */
1787  t_bool bogus:1; /* TRUE if group is not in active list */
1788  int next; /* next active entry in hash chain */
1789  struct t_newsrc newsrc; /* newsrc bitmap specific info. */
1790  struct t_attribute *attribute; /* group specific attributes */
1791  struct t_filters *glob_filter; /* points to filter array */
1792 };
1793 
1794 /*
1795  * used in hashstr.c
1796  */
1797 struct t_hashnode {
1798  struct t_hashnode *next; /* chain for spillover */
1799  int aptr; /* used in subject threading */
1800  char txt[1]; /* stub for the string data, \0 terminated */
1801 };
1802 
1803 /*
1804  * used for variable screen layout
1805  *
1806  * holds a preparsed format string, a date format string and some
1807  * precalculated length
1808  */
1809 struct t_fmt {
1810  char str[LEN];
1811  char date_str[LEN];
1812  size_t len_date; /* %D Date */
1814  size_t len_grpdesc; /* %d newsgroup description */
1815  size_t len_from; /* %F From */
1816  size_t len_grpname; /* %G groupname */
1819  size_t len_initials; /* %I initials */
1820  size_t len_linenumber; /* %n linenumber on screen */
1821  size_t len_linecnt; /* %L line count (article) */
1822  size_t len_msgid; /* %M message-id */
1823  size_t len_respcnt; /* %R count, number of responses */
1824  size_t len_score; /* %S score */
1825  size_t len_subj; /* %s subject */
1826  size_t len_ucnt; /* %U unread count */
1828  size_t mark_offset;
1829  size_t ucnt_offset;
1835 };
1836 
1837 /*
1838  * used in filter.c
1839  *
1840  * Create 2 filter arrays - global & local. Local will be part of group_t
1841  * structure and will have priority over global filter. Should help to
1842  * speed kill/selecting within a group. The long value number that is in
1843  * ~/.tin/kill will be replaced by group name so that it is more human
1844  * readable and that if hash routine is changed it will still work.
1845  *
1846  * Add time period to filter_t struct to allow timed kills & auto-selection
1847  * Default kill & select time 28 days. Store as a long and compare when
1848  * loading against present time. If time secs is passed set flag to save
1849  * filter file and don't load expired entry. Renamed to filter because of
1850  * future directions in adding other retrieval methods to present kill &
1851  * auto selection.
1852  *
1853  * Also separate kill/select screen to allow ^K=kill ^A=auto-select
1854  */
1855 struct t_filters {
1856  int max;
1857  int num;
1858  struct t_filter *filter;
1859 };
1860 
1861 /*
1862  * struct t_filter_comment: allow multiple comment-lines in filter-file.
1863  */
1865  char *text; /* One line of comment. */
1866  struct t_filter_comment *next; /* points to next comment-entry */
1867 };
1868 
1869 /*
1870  * struct t_filter - local & global filtering (ie. kill & auto-selection)
1871  */
1872 struct t_filter {
1874  char *scope; /* NULL='*' (all groups) or 'comp.os.*' */
1875  char *subj; /* Subject: line */
1876  char *from; /* From: line */
1877  char *msgid; /* Message-ID: line */
1878  char lines_cmp; /* Lines compare <> */
1879  int lines_num; /* Lines: line */
1880  char gnksa_cmp; /* GNKSA compare <> */
1881  int gnksa_num; /* GNKSA code */
1882  int score; /* score to give if rule matches */
1883  char *xref; /* groups in xref line */
1884  char *path; /* server in path line */
1885  time_t time; /* expire time in seconds */
1886  struct t_filter *next; /* next rule valid in group */
1887  unsigned int inscope:4; /* if group matches scope e.g. 'comp.os.*' */
1888  unsigned int icase:2; /* Case sensitive filtering */
1889  unsigned int fullref:4; /* use full references or last entry only */
1890 };
1891 
1892 /*
1893  * struct t_filter_rule - provides parameters to build filter rule from
1894  */
1899  int counter;
1900  int icase;
1901  int fullref;
1904  int score;
1911 };
1912 
1913 /*
1914  * Filter cache structure using Philip Hazel's Perl regular expression
1915  * library (see pcre/pcre.[ch] for details)
1916  */
1917 struct regex_cache {
1920 };
1921 
1922 struct t_save {
1923  char *path;
1924  char *file; /* ptr to file part of *path */
1925  t_bool mailbox:1; /* Set if path is a mailbox */
1926 };
1927 
1928 #ifndef USE_CURSES
1929 struct t_screen {
1930  char *col;
1931 };
1932 #endif /* !USE_CURSES */
1933 
1934 struct t_posted {
1935  char date[10];
1936  char group[80];
1937  char action;
1938  char subj[120];
1939 };
1940 
1941 struct t_art_stat {
1942  char art_mark; /* mark to use for this thread - not used for groups */
1943  int total; /* total article count */
1944  int unread; /* number of unread articles (does not include seen) arts */
1945  int seen; /* number of seen articles (ART_WILL_RETURN) */
1946  int deleted; /* number of articles marked for deletion (mailgroups) */
1947  int inrange; /* number of articles marked in a range */
1948  int selected_total; /* total selected count */
1949  int selected_unread; /* selected and unread */
1950  int selected_seen; /* selected and seen */
1951  int killed; /* killed */
1952  int score; /* maximum score */
1953  int multipart_total; /* 0=not multipart, >0 = number of articles in the multipart */
1954  int multipart_have; /* number of articles we actually have found */
1955  int multipart_compare_len; /* length of subject which contains non-specific multipart info */
1956  time_t time; /* latest time */
1957 };
1958 
1959 
1960 /*
1961  * Used for detecting changes in active file size on different news servers
1962  */
1963 struct t_newnews {
1964  char *host;
1965  time_t time;
1966 };
1967 
1968 typedef const char constext;
1969 
1970 /*
1971  * Defines text strings used by a tinrc variable
1972  */
1973 struct opttxt {
1974  constext *help; /* Helptext on Option Menu */
1975  constext *opt; /* Text on body of Option Menu screen */
1976  constext *tinrc; /* (optional) Text written with variable to tinrc file */
1977 };
1978 
1979 /*
1980  * Used for building option menu
1981  */
1982 struct t_option {
1983  int var_type; /* type of variable (see tincfg.h) */
1984  int var_index; /* index in corresponding table */
1985  int *variable; /* ptr to variable to change */
1986  constext **opt_list; /* ptr to list entries if OPT_LIST */
1987  struct opttxt *txt; /* ptr to information/help on option */
1988 };
1989 
1990 /*
1991  * Multipart article detection
1992  */
1993 typedef struct {
1994  char *subject;
1997  int total;
1999 } MultiPartInfo;
2000 
2001 
2002 /*
2003  * Key information about current menu screen
2004  */
2005 typedef struct {
2006  int curr; /* Current cursor pos (cur_groupnum, index_point, thread_index_point) */
2007  int max; /* Max # on current menu (group_top, top_base, top_thread) */
2008  int first; /* First # on current menu */
2009  void (*redraw) (void); /* Redraw function */
2010  void (*draw_arrow) (void); /* Arrow draw */
2011  void (*draw_item) (int item); /* draw the specified item */
2012 } t_menu;
2013 
2014 
2015 /*
2016  * Packet of data needed to enter pager
2017  */
2018 typedef struct {
2019  int art;
2021 } t_pagerinfo;
2022 
2023 
2024 /*
2025  * Time functions.
2026  */
2027 typedef struct _TIMEINFO {
2028  time_t time;
2029  long usec;
2030  long tzone;
2031 } TIMEINFO;
2032 
2033 
2034 struct t_tintime {
2035  time_t tv_sec; /* seconds */
2036  long tv_nsec; /* nanoseconds */
2037 };
2038 
2039 
2040 /*
2041  * mailcap fields
2042  * the x-token field is missing, we would need something like
2043  * struct t_xtoken { char *xtoken; t_xtoken *next; } for that ...
2044  */
2045 typedef struct {
2046  char *type; /* content-type, mandatory */
2047  char *command; /* view-command, mandatory */
2048  char *compose;
2051  char *edit;
2053  char *print;
2054  char *test;
2055  char *x11bitmap;
2059 } t_mailcap;
2060 
2061 
2062 typedef struct urllist {
2063  char *url;
2064  struct urllist *next;
2065 } t_url;
2066 
2067 
2068 /*
2069  * Determine signal return type
2070  */
2071 #ifndef RETSIGTYPE
2072 # define RETSIGTYPE void
2073 #endif /* !RETSIGTYPE */
2074 
2075 /*
2076  * Determine qsort compare type
2077  */
2078 #ifdef HAVE_COMPTYPE_VOID
2079 # ifdef __STDC__
2080  typedef const void *t_comptype;
2081 # else
2082  typedef void *t_comptype;
2083 # endif /* __STDC__ */
2084 #else
2085 # ifdef HAVE_COMPTYPE_CHAR
2086  typedef char *t_comptype;
2087 # endif /* HAVE_COMPTYPE_CHAR */
2088 #endif /* HAVE_COMPTYPE_VOID */
2089 
2090 /* Define a matching function pointer type */
2091 typedef int (*t_compfunc)(t_comptype, t_comptype);
2092 typedef void (*t_sortfunc)(void *, size_t, size_t, t_compfunc);
2093 
2094 #define _CDECL
2095 
2096 /* set to (void)heapsort or qsort */
2097 #ifndef USE_HEAPSORT
2098 # define tin_sort qsort
2099 #else
2100 # define MAX_SORT_FUNCS 1
2101 #endif /* !USE_HEAPSORT */
2102 
2103 /* Separator between dir part of path & the filename */
2104 #define DIRSEP '/'
2105 
2106 /*
2107  * mouse buttons for use in xterm
2108  */
2109 #define MOUSE_BUTTON_1 0
2110 #define MOUSE_BUTTON_2 1
2111 #define MOUSE_BUTTON_3 2
2112 
2113 
2114 #define REDIRECT_OUTPUT "> /dev/null 2>&1"
2115 #define REDIRECT_PGP_OUTPUT "> /dev/null"
2116 #define ENV_VAR_MAILER "MAILER"
2117 #define ENV_VAR_SHELL "SHELL"
2118 #define TIN_EDITOR_FMT_OFF "%E %F"
2119 #define TIN_EDITOR_FMT_ON "%E +%N %F"
2120 #define MAILER_FORMAT "%M -oi -t < %F"
2121 #define TMPDIR get_val("TMPDIR", _PATH_TMP)
2122 #ifdef HAVE_KEY_PREFIX
2123 # define KEY_PREFIX 0x8f: case 0x9b
2124 #endif /* HAVE_KEY_PREFIX */
2125 
2126 #if !defined(S_ISDIR)
2127 # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
2128 #endif /* !S_ISDIR */
2129 
2130 #if !defined(S_ISREG)
2131 # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
2132 #endif /* !S_ISREG */
2133 
2134 #ifndef S_IRWXU /* should be defined in <sys/stat.h> */
2135 # define S_IRWXU 0000700 /* read, write, execute permission (owner) */
2136 # define S_IRUSR 0000400 /* read permission (owner) */
2137 # define S_IWUSR 0000200 /* write permission (owner) */
2138 # define S_IXUSR 0000100 /* execute permission (owner) */
2139 
2140 # define S_IRWXG 0000070 /* read, write, execute permission (group) */
2141 # define S_IRGRP 0000040 /* read permission (group) */
2142 # define S_IWGRP 0000020 /* write permission (group) */
2143 # define S_IXGRP 0000010 /* execute permission (group) */
2144 
2145 # define S_IRWXO 0000007 /* read, write, execute permission (other) */
2146 # define S_IROTH 0000004 /* read permission (other) */
2147 # define S_IWOTH 0000002 /* write permission (other) */
2148 # define S_IXOTH 0000001 /* execute permission (other) */
2149 #endif /* !S_IRWXU */
2150 
2151 /* the next two are needed for fcc 1.0 on linux */
2152 #ifndef S_IFMT
2153 # define S_IFMT 0xF000 /* type of file */
2154 #endif /* S_IFMT */
2155 #ifndef S_IFREG
2156 # define S_IFREG 0x8000 /* regular */
2157 #endif /* S_IFREG */
2158 
2159 #ifndef S_IRWXUGO
2160 # define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) /* read, write, execute permission (all) */
2161 # define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) /* read permission (all) */
2162 # define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) /* write permission (all) */
2163 # define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) /* execute permission (all) */
2164 #endif /* !S_IRWXUGO */
2165 
2166 #ifndef S_ISVTX
2167 # define S_ISVTX 0
2168 #endif /* !S_ISVTX */
2169 
2170 #ifdef DONT_HAVE_PIPING
2171 # define TIN_PRINTFILE "tinprint%d.tmp"
2172 #endif /* DONT_HAVE_PIPING */
2173 
2174 /*
2175  * Defines for access()
2176  */
2177 #ifndef R_OK
2178 # define R_OK 4 /* Test for Read permission */
2179 #endif /* !R_OK */
2180 #ifndef W_OK
2181 # define W_OK 2 /* Test for Write permission */
2182 #endif /* !W_OK */
2183 #ifndef X_OK
2184 # define X_OK 1 /* Test for eXecute permission */
2185 #endif /* !X_OK */
2186 #ifndef F_OK
2187 # define F_OK 0 /* Test for existence of File */
2188 #endif /* !F_OK */
2189 
2190 /* Various function redefinitions */
2191 #if defined(USE_DBMALLOC) || defined(USE_DMALLOC)
2192 # define my_malloc(size) malloc(size)
2193 # define my_calloc(nmemb, size) calloc((nmemb), (size))
2194 # define my_realloc(ptr, size) realloc((ptr), (size))
2195 #else
2196 # define my_malloc(size) my_malloc1(__FILE__, __LINE__, (size))
2197 # define my_calloc(nmemb, size) my_calloc1(__FILE__, __LINE__, (nmemb), (size))
2198 # define my_realloc(ptr, size) my_realloc1(__FILE__, __LINE__, (ptr), (size))
2199 #endif /* USE_DBMALLOC || USE_DMALLOC */
2200 
2201 #define ARRAY_SIZE(array) ((int) (sizeof(array) / sizeof(array[0])))
2202 
2203 #define FreeIfNeeded(p) if (p != NULL) free((void *) p)
2204 #define FreeAndNull(p) if (p != NULL) { free((void *) p); p = NULL; }
2205 
2206 #define BlankIfNull(p) ((p) ? (p) : "")
2207 
2208 #define my_group_find(x) add_my_group(x, FALSE, FALSE)
2209 #define my_group_add(x, y) add_my_group(x, TRUE, y)
2210 #define for_each_group(x) for (x = 0; x < num_active; x++)
2211 #define for_each_art(x) for (x = 0; x < top_art; x++)
2212 #define for_each_art_in_thread(x, y) for (x = (int) base[y]; x >= 0; x = arts[x].thread)
2213 
2214 /*
2215  * Cast for the (few!) places where we need to examine 8-bit characters w/o
2216  * sign-extension, and a corresponding test-macro.
2217  */
2218 #define EIGHT_BIT(ptr) (unsigned char *)ptr
2219 #define is_EIGHT_BIT(p) ((*EIGHT_BIT(p) < 32 && !isspace((int)*p)) || *EIGHT_BIT(p) > 127)
2220 
2221 /*
2222  * function prototypes & extern definitions
2223  */
2224 
2225 #ifndef SIG_ARGS
2226 # if defined(__STDC__)
2227 # define SIG_ARGS int sig
2228 # endif /* __STDC__ */
2229 #endif /* !SIG_ARGS */
2230 
2231 #ifndef __LCLINT__ /* lclint doesn't like it */
2232 /* stifle complaints about not-a-prototype from gcc */
2233 # ifdef DECL_SIG_CONST
2234 # undef SIG_DFL
2235 # define SIG_DFL (void (*)(SIG_ARGS))0
2236 # undef SIG_IGN
2237 # define SIG_IGN (void (*)(SIG_ARGS))1
2238 # undef SIG_ERR
2239 # define SIG_ERR (void (*)(SIG_ARGS))-1
2240 # endif /* DECL_SIG_CONST */
2241 #endif /* !__LCLINT__ */
2242 
2243 /*
2244  * tputs() function-param
2245  */
2246 #ifdef OUTC_RETURN
2247 # define OUTC_RETTYPE int
2248 #else
2249 # define OUTC_RETTYPE void
2250 #endif /* OUTC_RETURN */
2251 
2252 #ifndef OUTC_ARGS
2253 # define OUTC_ARGS int c
2254 #endif /* !OUTC_ARGS */
2255 
2256 #if __STDC__ || defined(__cplusplus)
2257 # define OUTC_FUNCTION(func) OUTC_RETTYPE func (OUTC_ARGS)
2258 #else
2259 # define OUTC_FUNCTION(func) OUTC_RETTYPE func (c) int c;
2260 #endif /* __STDC__ || __cplusplus */
2261 
2263 typedef FILE TCP;
2264 
2265 #ifndef EXTERN_H
2266 # include "extern.h"
2267 #endif /* !EXTERN_H */
2268 #ifndef TINRC_H
2269 # include "tinrc.h"
2270 #endif /* !TINRC_H */
2271 #ifndef NNTPLIB_H
2272 # include "nntplib.h"
2273 #endif /* !NNTPLIB_H */
2274 
2275 #ifndef __CPROTO__
2276 # ifndef PROTO_H
2277 # include "proto.h"
2278 # endif /* !PROTO_H */
2279 #endif /* !__CPROTO__ */
2280 
2281 /*
2282  * rfc1521/rfc1522 interface
2283  */
2284 typedef void (*BodyPtr) (char *, FILE *, int);
2285 
2286 #ifdef USE_DBMALLOC
2287 # undef strchr
2288 # undef strrchr
2289 # include <dbmalloc.h> /* dbmalloc 1.4 */
2290 #endif /* USE_DBMALLOC */
2291 
2292 #ifdef USE_DMALLOC
2293 # include <dmalloc.h>
2294 # define DMALLOC_FUNC_CHECK
2295 # ifdef HAVE_STRDUP
2296 # define my_strdup(s) strdup((s))
2297 # endif /* HAVE_STRDUP */
2298 #endif /* USE_DMALLOC */
2299 
2300 #ifdef DOALLOC
2301  extern char *doalloc(char *, size_t);
2302  extern char *docalloc(size_t, size_t);
2303  extern void dofree(char *);
2304 # undef malloc
2305 # undef realloc
2306 # undef calloc
2307 # undef free
2308 # define malloc(n) doalloc((char *) 0, n)
2309 # define realloc doalloc
2310 # define calloc docalloc
2311 # define free dofree
2312  extern void fail_alloc(char *, char *);
2313  extern void Trace(char *, ...);
2314  extern void Elapsed(char *);
2315  extern void WalkBack(void);
2316  extern void show_alloc(void);
2317  extern void no_leaks(void);
2318 #endif /* DOALLOC */
2319 
2320 /* define some standard places to look for a tin.defaults file */
2321 #define TIN_DEFAULTS_BUILTIN "/etc/opt/tin","/etc/tin","/etc","/usr/local/lib/tin","/usr/local/lib","/usr/local/etc/tin","/usr/local/etc","/usr/lib/tin","/usr/lib",NULL
2322 #ifdef TIN_DEFAULTS_DIR
2323 # define TIN_DEFAULTS TIN_DEFAULTS_DIR,TIN_DEFAULTS_BUILTIN
2324 #else
2325 # define TIN_DEFAULTS TIN_DEFAULTS_BUILTIN
2326 #endif /* TIN_DEFAULTS_DIR */
2327 
2328 /*
2329  * We force this include-ordering since socks.h contains redefinitions of
2330  * functions that probably are prototyped via other includes. The socks.h
2331  * definitions have to be included everywhere, since they're making wrappers
2332  * for the stdio functions as well as the network functions.
2333  */
2334 #ifdef USE_SOCKS5
2335 # define SOCKS
2336 # include <socks.h>
2337 /* socks.h doesn't define prototypes for use */
2338 extern size_t read(int, char *, size_t);
2339 extern int dup(int);
2340 extern int close(int);
2341 extern int fprintf(FILE *, const char *, ...);
2342 extern int fclose(FILE *);
2343 extern struct tm *localtime(time_t *);
2344 #endif /* USE_SOCKS5 */
2345 
2346 #ifdef SETVBUF_REVERSED
2347 # define SETVBUF(stream, buf, mode, size) setvbuf(stream, mode, buf, size)
2348 #else
2349 # define SETVBUF(stream, buf, mode, size) setvbuf(stream, buf, mode, size)
2350 #endif /* SETVBUF_REVERSED */
2351 
2352 #ifdef CLOSEDIR_VOID
2353 # define CLOSEDIR(DIR) closedir(DIR)
2354 #else
2355 # define CLOSEDIR(DIR) if (closedir(DIR)) error_message(2, "closedir() failed: %s %d", __FILE__, __LINE__)
2356 #endif /* CLOSEDIR_VOID */
2357 
2358 #ifdef HAVE_GETTIMEOFDAY
2359 # ifndef GETTIMEOFDAY_2ARGS
2360 # define gettimeofday(a,b) gettimeofday(a)
2361 # endif /* GETTIMEOFDAY_2ARGS */
2362 #endif /* HAVE_GETTIMEOFDAY */
2363 
2364 /* libmss */
2365 #ifdef MSS
2366 # ifdef strdup
2367 # undef strdup
2368 # endif /* strdup */
2369 # include <mss.h>
2370 # undef my_malloc
2371 # undef my_realloc
2372 # undef my_calloc
2373 # define my_malloc(size) malloc(size)
2374 # define my_realloc(ptr, size) realloc((ptr), (size))
2375 # define my_calloc(nmemb, size) calloc((nmemb), (size))
2376 #endif /* MSS */
2377 
2378 /* libcanlock */
2379 #ifdef USE_CANLOCK
2380 # include "../libcanlock/include/canlock.h"
2381 #endif /* USE_CANLOCK */
2382 
2383 /* gsasl */
2384 #ifdef USE_SASL
2385 # include <gsasl.h>
2386 #endif /* USE_SASL */
2387 
2388 /*
2389  * adapted from ncurses curses.priv.h:
2390  * If we have va_copy(), use it for assigning va_list's.
2391  */
2392 #if defined(HAVE___VA_COPY)
2393 # define begin_va_copy(dst,src) __va_copy(dst, src)
2394 # define end_va_copy(dst) va_end(dst)
2395 #else
2396 # if defined(va_copy) || defined(HAVE_VA_COPY)
2397 # define begin_va_copy(dst,src) va_copy(dst, src)
2398 # define end_va_copy(dst) va_end(dst)
2399 # else
2400 # if defined(HAVE___BUILTIN_VA_COPY)
2401 # define begin_va_copy(dst,src) __builtin_va_copy(dst, src)
2402 # define end_va_copy(dst) va_end(dst)
2403 # else
2404 # if defined(ARRAY_VA_LIST)
2405 # define begin_va_copy(dst,src) *(dst) = *(src)
2406 # define end_va_copy(dst) /* nothing */
2407 # else
2408 # define begin_va_copy(dst,src) (dst) = (src)
2409 # define end_va_copy(dst) /* nothing */
2410 # endif /* ARRAY_VA_LIST */
2411 # endif /* HAVE___BUILTIN_VA_COPY */
2412 # endif /* va_copy || HAVE_VA_COPY */
2413 #endif /* HAVE___VA_COPY */
2414 
2415 /* snprintf(), vsnprintf() */
2416 #ifndef HAVE_SNPRINTF
2417 # define snprintf plp_snprintf
2418 #endif /* HAVE_SNPRINTF */
2419 #ifndef HAVE_VSNPRINTF
2420 # define vsnprintf plp_vsnprintf
2421 #endif /* HAVE_VSNPRINTF */
2422 
2423 /* gcc-specific attributes */
2424 #if defined(__GNUC__) && !defined(__cplusplus) && !defined(__APPLE_CC__) && !defined(__NeXT__)
2425 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 6)
2426 # define UNUSED(x) x __attribute__((unused))
2427 # else
2428 # define UNUSED(x) x
2429 # endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 6) */
2430 #else
2431 # define UNUSED(x) x
2432 #endif /* __GNUC__ && !__cplusplus && !__APPLE_CC__ && !__NeXT__ */
2433 
2434 /* init_selfinfo() needs MM_CHARSET */
2435 #ifndef MM_CHARSET
2436 # define MM_CHARSET "US-ASCII"
2437 #endif /* !MM_CHARSET */
2438 
2439 
2440 #if !defined(SEEK_SET)
2441 # define SEEK_SET 0L
2442 #endif /* !SEEK_SET */
2443 
2444 #if !defined(EOF)
2445 # define EOF -1
2446 #endif /* !EOF */
2447 
2448 /* various filenames used by tin */
2449 #define TIN_ARTICLE_NAME ".article"
2450 #define TIN_CANCEL_NAME ".cancel"
2451 #define TIN_LETTER_NAME ".letter"
2452 #define TIN_BUGREPORT_NAME ".bugreport"
2453 
2454 /* read_news_active_file() / open_newsgroups_fp() */
2455 #ifndef DISABLE_PIPELINING
2456 # define PIPELINE_LIMIT 45
2457 #else
2458 # define PIPELINE_LIMIT 1
2459 #endif /* DISABLE_PIPELINING */
2460 
2461 #ifndef DEBUG_H
2462 # include "debug.h"
2463 #endif /* !DEBUG_H */
2464 
2466  char *name;
2467  enum f_type type;
2468 };
2469 
2470 struct t_version {
2472  int file_version; /* rc_majorv * 10000 + rc_minorv * 100 + rc_subv */
2473 /* int current_version;*/ /* c_majorv * 10000 + c_minorv * 100 + c_subv */
2474 };
2475 
2476 #endif /* !TIN_H */
t_attribute::wrap_on_next_unread
unsigned wrap_on_next_unread
Definition: tin.h:1647
t_fmt::len_grpname
size_t len_grpname
Definition: tin.h:1816
t_msgid::txt
char txt[1]
Definition: tin.h:1492
t_article
Definition: tin.h:1510
t_attribute::thread_catchup_on_exit
unsigned thread_catchup_on_exit
Definition: tin.h:1632
t_attribute::mime_forward
unsigned mime_forward
Definition: tin.h:1657
t_attribute_state::add_posted_to_filter
unsigned add_posted_to_filter
Definition: tin.h:1665
_TIMEINFO
Definition: tin.h:2027
t_attribute_state::mail_8bit_header
unsigned mail_8bit_header
Definition: tin.h:1685
t_attribute_state::trim_article_body
unsigned trim_article_body
Definition: tin.h:1732
cURL
@ cURL
Definition: tin.h:107
t_filter::xref
char * xref
Definition: tin.h:1883
t_fmt::d_before_u
t_bool d_before_u
Definition: tin.h:1833
t_filter_rule::fullref
int fullref
Definition: tin.h:1901
t_cmdlineopts::maildir
char maildir[255]
Definition: tin.h:1468
t_art_stat::deleted
int deleted
Definition: tin.h:1946
t_attribute::news_quote_format
char * news_quote_format
Definition: tin.h:1584
t_art_stat::multipart_have
int multipart_have
Definition: tin.h:1954
t_attribute::auto_select
unsigned auto_select
Definition: tin.h:1609
t_filter::icase
unsigned int icase
Definition: tin.h:1888
t_fmt::len_msgid
size_t len_msgid
Definition: tin.h:1822
t_attribute::batch_save
unsigned batch_save
Definition: tin.h:1611
t_filter_rule::expire_time
int expire_time
Definition: tin.h:1905
nl_item
int nl_item
Definition: tin.h:767
t_filter::msgid
char * msgid
Definition: tin.h:1877
t_overview_fmt
Definition: tin.h:2465
t_attribute::thread_perc
unsigned thread_perc
Definition: tin.h:1633
t_attribute_state::sigfile
unsigned sigfile
Definition: tin.h:1722
t_version::state
enum rc_state state
Definition: tin.h:2471
t_filter::lines_num
int lines_num
Definition: tin.h:1879
t_attribute::mark_saved_read
unsigned mark_saved_read
Definition: tin.h:1617
t_attribute_state::thread_catchup_on_exit
unsigned thread_catchup_on_exit
Definition: tin.h:1729
t_attribute::news_headers_to_display
char * news_headers_to_display
Definition: tin.h:1579
t_attribute_state::thread_articles
unsigned thread_articles
Definition: tin.h:1728
RC_IGNORE
@ RC_IGNORE
Definition: tin.h:110
t_group
Definition: tin.h:1772
RC_UPGRADE
@ RC_UPGRADE
Definition: tin.h:110
t_attribute::post_process_type
unsigned post_process_type
Definition: tin.h:1654
t_attribute::sort_threads_type
unsigned sort_threads_type
Definition: tin.h:1652
t_fmt::len_date_max
size_t len_date_max
Definition: tin.h:1813
t_hashnode::aptr
int aptr
Definition: tin.h:1799
t_tintime
Definition: tin.h:2034
cFilter
@ cFilter
Definition: tin.h:107
t_art_stat::selected_seen
int selected_seen
Definition: tin.h:1950
t_attribute_state::post_process_type
unsigned post_process_type
Definition: tin.h:1701
t_attribute::post_8bit_header
unsigned post_8bit_header
Definition: tin.h:1619
t_filter::subj
char * subj
Definition: tin.h:1875
t_article::path
char * path
Definition: tin.h:1518
t_scope::global
unsigned global
Definition: tin.h:1754
MultiPartInfo::subject_compare_len
int subject_compare_len
Definition: tin.h:1995
t_attribute_state::sort_threads_type
unsigned sort_threads_type
Definition: tin.h:1725
t_posted::action
char action
Definition: tin.h:1937
t_attribute_state::verbatim_handling
unsigned verbatim_handling
Definition: tin.h:1737
t_fmt::d_before_f
t_bool d_before_f
Definition: tin.h:1831
t_mailcap::edit
char * edit
Definition: tin.h:2051
t_filter::score
int score
Definition: tin.h:1882
t_fmt::date_str
char date_str[1024]
Definition: tin.h:1811
GRP_ARTUNAVAIL
@ GRP_ARTUNAVAIL
Definition: tin.h:1264
t_attribute::post_process_view
unsigned post_process_view
Definition: tin.h:1621
t_attribute_state::maildir
unsigned maildir
Definition: tin.h:1687
t_attribute::auto_save
unsigned auto_save
Definition: tin.h:1610
t_filter_rule
Definition: tin.h:1895
t_msgid
Definition: tin.h:1486
t_article::prev
int prev
Definition: tin.h:1527
t_newsrc::xbitlen
t_artnum xbitlen
Definition: tin.h:1765
t_article::selected
t_bool selected
Definition: tin.h:1533
t_attribute::ask_for_metamail
unsigned ask_for_metamail
Definition: tin.h:1606
t_filters
Definition: tin.h:1855
t_attribute::mailing_list
char * mailing_list
Definition: tin.h:1578
t_attribute_state::x_headers
unsigned x_headers
Definition: tin.h:1744
t_overview_fmt::name
char * name
Definition: tin.h:2466
t_attribute::quick_kill_header
unsigned quick_kill_header
Definition: tin.h:1597
quote_enum
quote_enum
Definition: tin.h:1244
t_attribute::group_format
char * group_format
Definition: tin.h:1569
t_article::refs
char * refs
Definition: tin.h:1521
cReconnect
@ cReconnect
Definition: tin.h:107
t_compfunc
int(* t_compfunc)(t_comptype, t_comptype)
Definition: tin.h:2091
t_attribute::add_posted_to_filter
unsigned add_posted_to_filter
Definition: tin.h:1603
t_attribute::tex2iso_conv
unsigned tex2iso_conv
Definition: tin.h:1656
t_fmt::len_grpdesc
size_t len_grpdesc
Definition: tin.h:1814
t_mailcap::x11bitmap
char * x11bitmap
Definition: tin.h:2055
cPage
@ cPage
Definition: tin.h:107
extern.h
t_art_stat::multipart_total
int multipart_total
Definition: tin.h:1953
t_option
Definition: tin.h:1982
cThread
@ cThread
Definition: tin.h:107
t_fmt::flags_offset
size_t flags_offset
Definition: tin.h:1827
t_attribute_state::fcc
unsigned fcc
Definition: tin.h:1677
t_attribute::quick_kill_expire
unsigned quick_kill_expire
Definition: tin.h:1598
INTERACTIVE_WITH_HEADERS
@ INTERACTIVE_WITH_HEADERS
Definition: tin.h:1158
cMain
@ cMain
Definition: tin.h:107
cHelp
@ cHelp
Definition: tin.h:107
t_attribute_state::quick_select_scope
unsigned quick_select_scope
Definition: tin.h:1714
t_group::xmin
t_artnum xmin
Definition: tin.h:1780
t_fmt::g_before_u
t_bool g_before_u
Definition: tin.h:1834
t_fmt::len_grpname_max
size_t len_grpname_max
Definition: tin.h:1818
t_attribute_state::thread_perc
unsigned thread_perc
Definition: tin.h:1731
t_attribute::sort_article_type
unsigned sort_article_type
Definition: tin.h:1648
t_msgid::next
struct t_msgid * next
Definition: tin.h:1487
MultiPartInfo::base_index
int base_index
Definition: tin.h:1998
regex_cache::extra
pcre_extra * extra
Definition: tin.h:1919
t_attribute_state::quote_chars
unsigned quote_chars
Definition: tin.h:1715
t_attribute_state::process_only_unread
unsigned process_only_unread
Definition: tin.h:1705
t_fmt::show_grpdesc
t_bool show_grpdesc
Definition: tin.h:1830
t_filter_rule::comment
struct t_filter_comment * comment
Definition: tin.h:1896
t_newsheader::header
char ** header
Definition: tin.h:1557
t_filter_rule::scope
char scope[255]
Definition: tin.h:1898
t_sortfunc
void(* t_sortfunc)(void *, size_t, size_t, t_compfunc)
Definition: tin.h:2092
t_filter_rule::lines_ok
t_bool lines_ok
Definition: tin.h:1907
TCP
FILE TCP
Definition: tin.h:2263
t_group::type
unsigned int type
Definition: tin.h:1781
t_version::file_version
int file_version
Definition: tin.h:2472
t_archive::ispart
t_bool ispart
Definition: tin.h:1480
t_msgid::sibling
struct t_msgid * sibling
Definition: tin.h:1489
cGetline
@ cGetline
Definition: tin.h:108
GRP_NEXTUNREAD
@ GRP_NEXTUNREAD
Definition: tin.h:1262
t_save::path
char * path
Definition: tin.h:1923
t_article::zombie
t_bool zombie
Definition: tin.h:1531
cAttrib
@ cAttrib
Definition: tin.h:107
cArt
@ cArt
Definition: tin.h:107
t_filter_comment
Definition: tin.h:1864
t_fmt::g_before_f
t_bool g_before_f
Definition: tin.h:1832
MIME_ENCODING_7BIT
@ MIME_ENCODING_7BIT
Definition: tin.h:981
t_article::killed
unsigned int killed
Definition: tin.h:1530
end
static char * end
Definition: plp_snprintf.c:205
opttxt::help
constext * help
Definition: tin.h:1974
t_menu::max
int max
Definition: tin.h:2007
t_attribute_state::auto_select
unsigned auto_select
Definition: tin.h:1672
t_attribute
Definition: tin.h:1564
t_art_stat::score
int score
Definition: tin.h:1952
urllist
Definition: tin.h:2062
t_art_stat::killed
int killed
Definition: tin.h:1951
urllist::next
struct urllist * next
Definition: tin.h:2064
no_quote
@ no_quote
Definition: tin.h:1245
MultiPartInfo::part_number
int part_number
Definition: tin.h:1996
t_art_stat::multipart_compare_len
int multipart_compare_len
Definition: tin.h:1955
t_filter_rule::lines_num
int lines_num
Definition: tin.h:1903
t_option::variable
int * variable
Definition: tin.h:1985
t_attribute_state::quick_kill_case
unsigned quick_kill_case
Definition: tin.h:1707
t_save::file
char * file
Definition: tin.h:1924
t_attribute::signature_repost
unsigned signature_repost
Definition: tin.h:1629
t_mailcap::compose
char * compose
Definition: tin.h:2048
t_attribute_state::x_comment_to
unsigned x_comment_to
Definition: tin.h:1743
t_attribute_state::mime_forward
unsigned mime_forward
Definition: tin.h:1691
t_attribute::group_catchup_on_exit
unsigned group_catchup_on_exit
Definition: tin.h:1613
t_msgid::parent
struct t_msgid * parent
Definition: tin.h:1488
t_attribute_state::show_author
unsigned show_author
Definition: tin.h:1718
cPostCancel
@ cPostCancel
Definition: tin.h:107
GRP_EXIT
@ GRP_EXIT
Definition: tin.h:1269
t_newnews::time
time_t time
Definition: tin.h:1965
t_fmt::len_ucnt
size_t len_ucnt
Definition: tin.h:1826
t_attribute::post_mime_encoding
unsigned post_mime_encoding
Definition: tin.h:1620
t_fmt
Definition: tin.h:1809
PATH_LEN
#define PATH_LEN
Definition: tin.h:837
t_cmdlineopts::nntpserver
char nntpserver[255]
Definition: tin.h:1469
t_art_stat
Definition: tin.h:1941
t_attribute::mail_mime_encoding
unsigned mail_mime_encoding
Definition: tin.h:1615
t_filter::gnksa_cmp
char gnksa_cmp
Definition: tin.h:1880
t_attribute_state::show_only_unread_arts
unsigned show_only_unread_arts
Definition: tin.h:1719
cSelect
@ cSelect
Definition: tin.h:107
icontext
icontext
Definition: tin.h:108
cInfopager
@ cInfopager
Definition: tin.h:107
t_attribute::savefile
char * savefile
Definition: tin.h:1567
t_fmt::mark_offset
size_t mark_offset
Definition: tin.h:1828
t_msgid::article
int article
Definition: tin.h:1491
t_screen
Definition: tin.h:1929
_TIMEINFO::time
time_t time
Definition: tin.h:2028
t_mailcap::composetyped
char * composetyped
Definition: tin.h:2049
t_attribute::process_only_unread
unsigned process_only_unread
Definition: tin.h:1625
t_attribute::maildir
char * maildir
Definition: tin.h:1565
t_attribute_state::thread_format
unsigned thread_format
Definition: tin.h:1730
t_attribute::verbatim_handling
unsigned verbatim_handling
Definition: tin.h:1643
t_newsheader::num
int num
Definition: tin.h:1558
RC_ERROR
@ RC_ERROR
Definition: tin.h:110
t_attribute::quick_select_header
unsigned quick_select_header
Definition: tin.h:1600
t_newsrc::xmax
t_artnum xmax
Definition: tin.h:1763
t_attribute::show_signatures
unsigned show_signatures
Definition: tin.h:1635
t_attribute_state::news_headers_to_display
unsigned news_headers_to_display
Definition: tin.h:1693
t_attribute::fcc
char * fcc
Definition: tin.h:1574
opttxt::tinrc
constext * tinrc
Definition: tin.h:1976
t_attribute::organization
char * organization
Definition: tin.h:1573
MIME_ENCODING_QP
@ MIME_ENCODING_QP
Definition: tin.h:980
cPromptYN
@ cPromptYN
Definition: tin.h:108
t_archive::partnum
char * partnum
Definition: tin.h:1479
t_newnews::host
char * host
Definition: tin.h:1964
t_posted::subj
char subj[120]
Definition: tin.h:1938
t_attribute::thread_format
char * thread_format
Definition: tin.h:1570
proto.h
t_art_stat::art_mark
char art_mark
Definition: tin.h:1942
t_mailcap::type
char * type
Definition: tin.h:2046
t_fmt::len_from
size_t len_from
Definition: tin.h:1815
t_attribute::x_headers
char * x_headers
Definition: tin.h:1581
t_posted::group
char group[80]
Definition: tin.h:1936
t_attribute_state::from
unsigned from
Definition: tin.h:1679
t_attribute::pos_first_unread
unsigned pos_first_unread
Definition: tin.h:1618
t_scope::state
struct t_attribute_state * state
Definition: tin.h:1753
t_fmt::len_score
size_t len_score
Definition: tin.h:1824
t_cmdlineopts
Definition: tin.h:1466
t_newsrc::xbitmap
t_bitmap * xbitmap
Definition: tin.h:1766
t_attribute_state::quick_select_case
unsigned quick_select_case
Definition: tin.h:1711
t_scope
Definition: tin.h:1750
bool.h
t_article::delete_it
t_bool delete_it
Definition: tin.h:1532
t_filter::time
time_t time
Definition: tin.h:1885
t_article::archive
struct t_archive * archive
Definition: tin.h:1524
t_fmt::len_initials
size_t len_initials
Definition: tin.h:1819
cAttachment
@ cAttachment
Definition: tin.h:107
t_filter::from
char * from
Definition: tin.h:1876
t_attribute::quick_select_scope
char * quick_select_scope
Definition: tin.h:1577
t_attribute::prompt_followupto
unsigned prompt_followupto
Definition: tin.h:1626
t_attribute_state::advertising
unsigned advertising
Definition: tin.h:1666
t_attribute::quick_select_case
unsigned quick_select_case
Definition: tin.h:1602
t_attribute_state::show_signatures
unsigned show_signatures
Definition: tin.h:1720
nntplib.h
GRP_GOTOTHREAD
@ GRP_GOTOTHREAD
Definition: tin.h:1267
t_filter_comment::next
struct t_filter_comment * next
Definition: tin.h:1866
t_scope::scope
char * scope
Definition: tin.h:1751
OUTC_ARGS
#define OUTC_ARGS
Definition: tin.h:2253
t_option::var_type
int var_type
Definition: tin.h:1983
RC_DOWNGRADE
@ RC_DOWNGRADE
Definition: tin.h:110
t_mailcap::needsterminal
t_bool needsterminal
Definition: tin.h:2057
t_fmt::str
char str[1024]
Definition: tin.h:1810
t_group::description
char * description
Definition: tin.h:1775
t_attribute::mail_8bit_header
unsigned mail_8bit_header
Definition: tin.h:1614
MultiPartInfo::total
int total
Definition: tin.h:1997
GRP_ARTABORT
@ GRP_ARTABORT
Definition: tin.h:1265
t_attribute_state::post_8bit_header
unsigned post_8bit_header
Definition: tin.h:1698
t_attribute_state::followup_to
unsigned followup_to
Definition: tin.h:1678
t_filter::fullref
unsigned int fullref
Definition: tin.h:1889
t_attribute_state::mime_types_to_save
unsigned mime_types_to_save
Definition: tin.h:1692
t_attribute::quote_chars
char * quote_chars
Definition: tin.h:1585
t_overview_fmt::type
enum f_type type
Definition: tin.h:2467
t_attribute_state::group_catchup_on_exit
unsigned group_catchup_on_exit
Definition: tin.h:1680
real_pcre
Definition: pcre_internal.h:813
t_attribute::global
unsigned global
Definition: tin.h:1596
t_menu
Definition: tin.h:2005
t_article::gnksa_code
int gnksa_code
Definition: tin.h:1515
t_filter::inscope
unsigned int inscope
Definition: tin.h:1887
t_hashnode::txt
char txt[1]
Definition: tin.h:1800
t_attribute::news_headers_to_not_display
char * news_headers_to_not_display
Definition: tin.h:1580
t_archive::name
char * name
Definition: tin.h:1478
t_filter_rule::text
char text[255]
Definition: tin.h:1897
t_group::moderated
char moderated
Definition: tin.h:1777
t_attribute_state::mail_mime_encoding
unsigned mail_mime_encoding
Definition: tin.h:1686
t_filter::next
struct t_filter * next
Definition: tin.h:1886
t_attribute::savedir
char * savedir
Definition: tin.h:1566
t_attribute_state::batch_save
unsigned batch_save
Definition: tin.h:1673
t_attribute_state::x_body
unsigned x_body
Definition: tin.h:1742
t_art_stat::selected_total
int selected_total
Definition: tin.h:1948
t_mailcap::nametemplate
char * nametemplate
Definition: tin.h:2052
t_attribute::show_only_unread_arts
unsigned show_only_unread_arts
Definition: tin.h:1627
t_attribute_state::auto_list_thread
unsigned auto_list_thread
Definition: tin.h:1670
t_attribute::x_body
char * x_body
Definition: tin.h:1582
OUTC_RETTYPE
#define OUTC_RETTYPE
Definition: tin.h:2249
t_fmt::ucnt_offset
size_t ucnt_offset
Definition: tin.h:1829
t_mailcap::description
char * description
Definition: tin.h:2050
t_article::keep_in_base
t_bool keep_in_base
Definition: tin.h:1536
t_article::xref
char * xref
Definition: tin.h:1517
OutcPtr
void(* OutcPtr)(int c)
Definition: tin.h:2262
GRP_KILLED
@ GRP_KILLED
Definition: tin.h:1266
t_attribute::followup_to
char * followup_to
Definition: tin.h:1575
t_fmt::len_subj
size_t len_subj
Definition: tin.h:1825
MultiPartInfo
Definition: tin.h:1993
t_attribute_state::quick_select_expire
unsigned quick_select_expire
Definition: tin.h:1712
t_article::inrange
t_bool inrange
Definition: tin.h:1534
LEN
#define LEN
Definition: tin.h:854
t_article::status
unsigned int status
Definition: tin.h:1529
t_article::tagged
int tagged
Definition: tin.h:1525
t_attribute_state::quick_select_header
unsigned quick_select_header
Definition: tin.h:1713
t_filter::path
char * path
Definition: tin.h:1884
t_filter_rule::from_ok
t_bool from_ok
Definition: tin.h:1906
t_cmdlineopts::savedir
char savedir[255]
Definition: tin.h:1470
t_mailcap::copiousoutput
t_bool copiousoutput
Definition: tin.h:2058
t_tintime::tv_nsec
long tv_nsec
Definition: tin.h:2036
cConfig
@ cConfig
Definition: tin.h:107
t_tintime::tv_sec
time_t tv_sec
Definition: tin.h:2035
t_fmt::len_grpname_dsc
size_t len_grpname_dsc
Definition: tin.h:1817
t_article::artnum
t_artnum artnum
Definition: tin.h:1511
t_filter::comment
struct t_filter_comment * comment
Definition: tin.h:1873
t_mailcap
Definition: tin.h:2045
cPostFup
@ cPostFup
Definition: tin.h:107
t_attribute::quick_select_expire
unsigned quick_select_expire
Definition: tin.h:1601
MIME_ENCODING_BASE64
@ MIME_ENCODING_BASE64
Definition: tin.h:979
cYes
@ cYes
Definition: tin.h:109
t_scope::attribute
struct t_attribute * attribute
Definition: tin.h:1752
cGroup
@ cGroup
Definition: tin.h:107
t_article::thread
int thread
Definition: tin.h:1526
cNo
@ cNo
Definition: tin.h:109
t_url
struct urllist t_url
t_article::subject
char * subject
Definition: tin.h:1512
GRP_NEXT
@ GRP_NEXT
Definition: tin.h:1263
t_archive
Definition: tin.h:1477
t_newsrc::xmin
t_artnum xmin
Definition: tin.h:1764
MultiPartInfo::subject
char * subject
Definition: tin.h:1994
t_attribute::advertising
unsigned advertising
Definition: tin.h:1604
t_attribute::editor_format
char * editor_format
Definition: tin.h:1572
t_filters::num
int num
Definition: tin.h:1857
regex_cache::re
pcre * re
Definition: tin.h:1918
t_attribute_state::mark_ignore_tags
unsigned mark_ignore_tags
Definition: tin.h:1689
t_attribute::print_header
unsigned print_header
Definition: tin.h:1623
f_type
f_type
Definition: nntplib.h:164
t_attribute_state::delete_tmp_files
unsigned delete_tmp_files
Definition: tin.h:1675
t_attribute_state::alternative_handling
unsigned alternative_handling
Definition: tin.h:1667
t_attribute::delete_tmp_files
unsigned delete_tmp_files
Definition: tin.h:1612
t_article::refptr
struct t_msgid * refptr
Definition: tin.h:1522
t_attribute_state::pos_first_unread
unsigned pos_first_unread
Definition: tin.h:1697
t_group::xmax
t_artnum xmax
Definition: tin.h:1779
t_group::inrange
t_bool inrange
Definition: tin.h:1782
t_attribute_state::ask_for_metamail
unsigned ask_for_metamail
Definition: tin.h:1668
t_attribute::sigfile
char * sigfile
Definition: tin.h:1568
t_attribute_state::mailing_list
unsigned mailing_list
Definition: tin.h:1688
opttxt
Definition: tin.h:1973
t_attribute::auto_list_thread
unsigned auto_list_thread
Definition: tin.h:1608
t_attribute_state::wrap_on_next_unread
unsigned wrap_on_next_unread
Definition: tin.h:1741
cPromptCONT
@ cPromptCONT
Definition: tin.h:108
t_attribute_state::prompt_followupto
unsigned prompt_followupto
Definition: tin.h:1706
t_attribute_state::news_headers_to_not_display
unsigned news_headers_to_not_display
Definition: tin.h:1694
t_group::bogus
t_bool bogus
Definition: tin.h:1787
t_attribute_state::auto_cc_bcc
unsigned auto_cc_bcc
Definition: tin.h:1669
t_pagerinfo::ignore_unavail
t_bool ignore_unavail
Definition: tin.h:2020
t_bitmap
unsigned char t_bitmap
Definition: tin.h:1450
t_filter_rule::msgid_ok
t_bool msgid_ok
Definition: tin.h:1908
t_cmdlineopts::args
unsigned int args
Definition: tin.h:1471
t_menu::curr
int curr
Definition: tin.h:2006
t_filter::gnksa_num
int gnksa_num
Definition: tin.h:1881
t_attribute_state::start_editor_offset
unsigned start_editor_offset
Definition: tin.h:1726
t_msgid::child
struct t_msgid * child
Definition: tin.h:1490
t_group::name
char * name
Definition: tin.h:1773
t_group::newsrc
struct t_newsrc newsrc
Definition: tin.h:1789
t_attribute::mark_ignore_tags
unsigned mark_ignore_tags
Definition: tin.h:1616
t_article::score
int score
Definition: tin.h:1528
t_group::art_was_posted
t_bool art_was_posted
Definition: tin.h:1784
t_filter_rule::lines_cmp
int lines_cmp
Definition: tin.h:1902
t_screen::col
char * col
Definition: tin.h:1930
dbl_quote
@ dbl_quote
Definition: tin.h:1246
t_attribute_state
Definition: tin.h:1664
t_art_stat::time
time_t time
Definition: tin.h:1956
t_posted
Definition: tin.h:1934
t_group::count
t_artnum count
Definition: tin.h:1778
t_attribute_state::auto_save
unsigned auto_save
Definition: tin.h:1671
t_attribute::mime_types_to_save
char * mime_types_to_save
Definition: tin.h:1586
t_article::msgid
char * msgid
Definition: tin.h:1520
t_attribute::auto_cc_bcc
unsigned auto_cc_bcc
Definition: tin.h:1607
tinrc.h
t_attribute::alternative_handling
unsigned alternative_handling
Definition: tin.h:1605
t_filter_rule::subj_ok
t_bool subj_ok
Definition: tin.h:1909
t_attribute_state::savefile
unsigned savefile
Definition: tin.h:1717
t_attribute_state::sigdashes
unsigned sigdashes
Definition: tin.h:1721
regex_cache
Definition: tin.h:1917
t_fmt::len_date
size_t len_date
Definition: tin.h:1812
t_filter_rule::score
int score
Definition: tin.h:1904
t_filter::lines_cmp
char lines_cmp
Definition: tin.h:1878
sgl_quote
@ sgl_quote
Definition: tin.h:1247
t_cmdlineopts::getart_limit
int getart_limit
Definition: tin.h:1467
t_newsheader
Definition: tin.h:1556
t_attribute_state::sort_article_type
unsigned sort_article_type
Definition: tin.h:1724
t_art_stat::inrange
int inrange
Definition: tin.h:1947
t_attribute::headers_to_not_display
struct t_newsheader * headers_to_not_display
Definition: tin.h:1595
t_attribute::date_format
char * date_format
Definition: tin.h:1571
t_attribute::quick_kill_scope
char * quick_kill_scope
Definition: tin.h:1576
t_pagerinfo
Definition: tin.h:2018
t_fmt::len_linenumber
size_t len_linenumber
Definition: tin.h:1820
t_artnum
long t_artnum
Definition: tin.h:226
t_attribute_state::signature_repost
unsigned signature_repost
Definition: tin.h:1723
t_group::spooldir
char * spooldir
Definition: tin.h:1776
GRP_QUIT
@ GRP_QUIT
Definition: tin.h:1261
cScope
@ cScope
Definition: tin.h:107
t_attribute_state::group_format
unsigned group_format
Definition: tin.h:1681
t_group::attribute
struct t_attribute * attribute
Definition: tin.h:1790
cRedraw
@ cRedraw
Definition: tin.h:109
t_filters::filter
struct t_filter * filter
Definition: tin.h:1858
t_filter_rule::counter
int counter
Definition: tin.h:1899
t_attribute_state::date_format
unsigned date_format
Definition: tin.h:1674
t_menu::first
int first
Definition: tin.h:2008
t_group::glob_filter
struct t_filters * glob_filter
Definition: tin.h:1791
t_attribute_state::print_header
unsigned print_header
Definition: tin.h:1703
t_attribute_state::organization
unsigned organization
Definition: tin.h:1696
t_mailcap::command
char * command
Definition: tin.h:2047
t_posted::date
char date[10]
Definition: tin.h:1935
GRP_RETSELECT
@ GRP_RETSELECT
Definition: tin.h:1260
t_attribute::start_editor_offset
unsigned start_editor_offset
Definition: tin.h:1630
t_attribute_state::post_mime_encoding
unsigned post_mime_encoding
Definition: tin.h:1699
t_filter_rule::check_string
t_bool check_string
Definition: tin.h:1910
t_option::var_index
int var_index
Definition: tin.h:1984
t_fmt::len_respcnt
size_t len_respcnt
Definition: tin.h:1823
t_group::next
int next
Definition: tin.h:1788
opttxt::opt
constext * opt
Definition: tin.h:1975
_TIMEINFO::tzone
long tzone
Definition: tin.h:2030
t_attribute_state::editor_format
unsigned editor_format
Definition: tin.h:1676
t_attribute::sigdashes
unsigned sigdashes
Definition: tin.h:1628
t_art_stat::seen
int seen
Definition: tin.h:1945
constext
const typedef char constext
Definition: tin.h:1968
t_mailcap::textualnewlines
int textualnewlines
Definition: tin.h:2056
pcre.h
t_attribute::quick_kill_case
unsigned quick_kill_case
Definition: tin.h:1599
_TIMEINFO::usec
long usec
Definition: tin.h:2029
t_art_stat::total
int total
Definition: tin.h:1943
t_attribute::thread_articles
unsigned thread_articles
Definition: tin.h:1631
t_mailcap::test
char * test
Definition: tin.h:2054
cPromptSLK
@ cPromptSLK
Definition: tin.h:108
t_hashnode
Definition: tin.h:1797
t_option::txt
struct opttxt * txt
Definition: tin.h:1987
t_attribute_state::savedir
unsigned savedir
Definition: tin.h:1716
t_hashnode::next
struct t_hashnode * next
Definition: tin.h:1798
t_article::matched
t_bool matched
Definition: tin.h:1535
t_bool
unsigned t_bool
Definition: bool.h:77
t_attribute::from
char * from
Definition: tin.h:1583
t_filters::max
int max
Definition: tin.h:1856
errno
int errno
t_filter
Definition: tin.h:1872
t_group::read_during_session
t_bool read_during_session
Definition: tin.h:1783
cNone
@ cNone
Definition: tin.h:108
t_save::mailbox
t_bool mailbox
Definition: tin.h:1925
t_filter_rule::icase
int icase
Definition: tin.h:1900
INTERACTIVE_NONE
@ INTERACTIVE_NONE
Definition: tin.h:1157
t_attribute::trim_article_body
unsigned trim_article_body
Definition: tin.h:1636
TIMEINFO
struct _TIMEINFO TIMEINFO
t_attribute_state::mark_saved_read
unsigned mark_saved_read
Definition: tin.h:1690
MIME_ENCODING_8BIT
@ MIME_ENCODING_8BIT
Definition: tin.h:978
t_newsrc::num_unread
t_artnum num_unread
Definition: tin.h:1762
GRP_ENTER
@ GRP_ENTER
Definition: tin.h:1268
t_option::opt_list
constext ** opt_list
Definition: tin.h:1986
t_newsrc::present
t_bool present
Definition: tin.h:1761
urllist::url
char * url
Definition: tin.h:2063
t_group::subscribed
t_bool subscribed
Definition: tin.h:1785
t_group::aliasedto
char * aliasedto
Definition: tin.h:1774
t_attribute_state::quick_kill_scope
unsigned quick_kill_scope
Definition: tin.h:1710
resizer
resizer
Definition: tin.h:109
context
context
Definition: tin.h:107
t_article::from
char * from
Definition: tin.h:1513
t_attribute_state::quick_kill_header
unsigned quick_kill_header
Definition: tin.h:1709
t_filter::scope
char * scope
Definition: tin.h:1874
t_attribute::headers_to_display
struct t_newsheader * headers_to_display
Definition: tin.h:1594
t_attribute::x_comment_to
unsigned x_comment_to
Definition: tin.h:1655
t_attribute_state::tex2iso_conv
unsigned tex2iso_conv
Definition: tin.h:1727
t_newsrc
Definition: tin.h:1760
cPost
@ cPost
Definition: tin.h:107
t_group::newgroup
t_bool newgroup
Definition: tin.h:1786
t_version
Definition: tin.h:2470
BodyPtr
void(* BodyPtr)(char *, FILE *, int)
Definition: tin.h:2284
pcre_extra
Definition: pcre.h:204
t_mailcap::print
char * print
Definition: tin.h:2053
t_attribute::show_author
unsigned show_author
Definition: tin.h:1634
t_article::line_count
int line_count
Definition: tin.h:1523
t_attribute_state::post_process_view
unsigned post_process_view
Definition: tin.h:1700
t_filter_comment::text
char * text
Definition: tin.h:1865
debug.h
t_fmt::len_linecnt
size_t len_linecnt
Definition: tin.h:1821
t_attribute_state::news_quote_format
unsigned news_quote_format
Definition: tin.h:1695
t_pagerinfo::art
int art
Definition: tin.h:2019
t_attribute_state::quick_kill_expire
unsigned quick_kill_expire
Definition: tin.h:1708
t_art_stat::selected_unread
int selected_unread
Definition: tin.h:1949
t_save
Definition: tin.h:1922
t_article::name
char * name
Definition: tin.h:1514
t_article::date
time_t date
Definition: tin.h:1516
rc_state
rc_state
Definition: tin.h:110
INTERACTIVE_WITHOUT_HEADERS
@ INTERACTIVE_WITHOUT_HEADERS
Definition: tin.h:1159
t_newnews
Definition: tin.h:1963
t_art_stat::unread
int unread
Definition: tin.h:1944