🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.sources.patches
1 messages
1 total messages Started by Kari E. Hurtta Sun, 03 Oct 1993 14:51
kehpager V1.02 to V1.03 - Latin/2 charset (Patch 2/3)
#31
Author: Kari E. Hurtta
Date: Sun, 03 Oct 1993 14:51
1823 lines
63700 bytes
Archive-Name: kehpager0102/Patch01.2
Part: 2/3
Description: kehpager - charset aware pager for VTxxx terminals
Patch-to: kehpager V1.02
Environment: Ansi C, SunOS 4, SunOS 5 (??), HP-UX
Author: Kari E. Hurtta <Kari.Hurtta@Helsinki.FI>

#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file charset.c.new continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> charset.c.new
X                  -1,       -1,     -1,      -1,       -1 } },
X  /* SMALL LETTER i WITHOUT DOT */
X  { "i",  {'i','i'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		  -1,       -1,      -1,     -1,      253,
X                  -1,       -1,     -1,      -1,       -1 } },
X
X  /* SMALL LETTER s WITH CEDILLA */
X  { "s,",  {'s',','}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		  -1,       -1,      -1,     -1,      254,
X                  -1,     0xBA,     -1,      -1,       -1 } },
X
X  /* BREVE */
X  { "(",  {' ','('}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		  -1,       -1,      -1,     -1,       -1,
X                  -1,     0xA2,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER L WITH STROKE */
X  { "L/",  {'L','/'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xA3,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER L WITH CARON */
X  { "L<",  {'L','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xA5,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER S WITH ACUTE ACCENT */
X  { "S'",  {'S','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xA6,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER T WITH CARON */
X  { "T<",  {'T','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xAB,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER Z WITH ACUTE ACCENT */
X  { "Z'",  {'Z','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xAC,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER Z WITH DOT ABOVE */
X  { "Z.",  {'Z','.'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xAF,     -1,      -1,       -1 } },
X  /* SMALL LETTER l WITH STROKE */
X  { "l/",  {'l','/'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xB3,     -1,      -1,       -1 } },
X  /* SMALL LETTER l WITH CARON */
X  { "l<",  {'l','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xB5,     -1,      -1,       -1 } },
X  /* SMALL LETTER s WITH ACUTE ACCENT */
X  { "s'",  {'s','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xB6,     -1,      -1,       -1 } },
X  /* SMALL LETTER t WITH CARON */
X  { "t<",  {'t','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xBB,     -1,      -1,       -1 } },
X  /* SMALL LETTER z WITH ACUTE ACCENT */
X  { "z'",  {'z','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xBC,     -1,      -1,       -1 } },
X  /* DOUBLE ACUTE ACCENT */
X  { "\"",  {'"',' '}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xBD,     -1,      -1,       -1 } },
X  /* SMALL LETTER z WITH DOT ABOVE */
X  { "z.",  {'z','.'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xBF,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER R WITH ACUTE ACCENT */
X  { "R'",  {'R','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xC0,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER A WITH BREVE */
X  { "A(",  {'A','('}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xC3,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER L WITH ACUTE ACCENT */
X  { "L'",  {'L','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xC5,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER C WITH ACUTE ACCENT */
X  { "C'",  {'C','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xC6,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER E WITH CARON */
X  { "E<",  {'E','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xCC,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER D WITH CARON */
X  { "D<",  {'D','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xCF,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER N WITH ACUTE */
X  { "N'",  {'N','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xD1,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER N WITH CARON */
X  { "N<",  {'N','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xD2,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER O WITH DOUBLE ACUTE */
X  { "O\"",  {'"','O'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xD5,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER R WITH CARON */
X  { "O<",  {'R','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xD8,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER U WITH RING ABOVE */
X  { "Uo",  {'U','o'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xD9,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER U WITH DOUBLE ACUTE ACCENT */
X  { "U\"",  {'"','U'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xDB,     -1,      -1,       -1 } },
X  /* CAPITAL LETTER T WITH CEDILLA */
X  { "T,",  {'T',','}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xDE,     -1,      -1,       -1 } },
X  /* SMALL LETTER r WITH ACUTE */
X  { "r'",  {'r','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xE0,     -1,      -1,       -1 } },
X  /* SMALL LETTER a WITH BREVE */
X  { "a(",  {'a','('}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xE3,     -1,      -1,       -1 } },
X  /* SMALL LETTER l WITH ACUTE ACCENT */
X  { "l'",  {'l','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xE5,     -1,      -1,       -1 } },
X  /* SMALL LETTER c WITH ACUTE ACCENT */
X  { "c'",  {'c','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xE6,     -1,      -1,       -1 } },
X  /* SMALL LETTER e WITH CARON */
X  { "e<",  {'e','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xEC,     -1,      -1,       -1 } },
X  /* SMALL LETTER d WITH CARON */
X  { "d<",  {'d','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xEF,     -1,      -1,       -1 } },
X  /* SMALL LETTER n WITH ACUTE ACCENT */
X  { "n'",  {'n','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xF1,     -1,      -1,       -1 } },
X  /* SMALL LETTER n WITH CARON */
X  { "n'",  {'n','\''}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xF2,     -1,      -1,       -1 } },
X  /* SMALL LETTER o WITH DOUBLE ACUTE */
X  { "o\"",  {'"','o'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xF5,     -1,      -1,       -1 } },
X  /* SMALL LETTER r WITH CARON */
X  { "r<",  {'r','<'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xF8,     -1,      -1,       -1 } },
X  /* SMALL LETTER u WITH RING ABOVE */
X  { "uo",  {'u','o'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xF9,     -1,      -1,       -1 } },
X  /* SMALL LETTER u WITH DOUBLE ACUTE */
X  { "u\"",  {'"','u'}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		   -1,      -1,      -1,     -1,       -1,
X                   -1,    0xFB,     -1,      -1,       -1 } },
X  /* SMALL LETTER t WITH CEDILLA */
X  { "t,",  {'t',','}, 1, 
X      {           -1,       -1,      -1,     -1,       -1,
X		  -1,       -1,      -1,     -1,       -1,
X                  -1,     0xFE,     -1,      -1,       -1 } },
X
X  
X};
X
Xint CHARS_COUNT_ = CHARS_COUNT;
X
Xint tables[MAP_COUNT][256];
Xint CH_SPC;
Xint CH_TAB;
Xint CH_SHY;
Xint CH_NBSP;
Xint CH_HY;
Xint CH_UL;
Xint CH_WRA = 1;
Xint CH_NL = 2;
Xint CH_ZERO;
X
Xvoid init_tables(void) {
X  int i,table;
X
X  for (table = 0; table < MAP_COUNT; table++) 
X    for (i = 0; i < 256; i++) tables[table][i] = -1;
X
X  for (i = 0; i < CHARS_COUNT; i++) 
X    for (table = 0; table < MAP_COUNT; table++) 
X      if (-1 != chars[i].vector[table]) 
X	tables[table][chars[i].vector[table] & CHAR_code] = i;
X
X  map_input(MAP_ASCII,1," ",&CH_SPC);
X  map_input(MAP_ASCII,1,"\t",&CH_TAB);
X  map_input(MAP_LATIN1,1,"\255",&CH_SHY);
X  map_input(MAP_LATIN1,1,"\240",&CH_NBSP);
X  map_input(MAP_ASCII,1,"-",&CH_HY);
X  map_input(MAP_ASCII,1,"_",&CH_UL);
X  map_input(MAP_ASCII,1,"0",&CH_ZERO);
X}
X
Xint string_value(int len, int *buffer) {
X  int value = 0;
X  while (len > 0) {
X    if (*buffer >= CH_ZERO && *buffer < CH_ZERO + 10)
X      value = value * 10 + *buffer - CH_ZERO;
X    else 
X      return value;
X    buffer++; len--;
X  }
X  return value;
X}
X
Xvoid map_input(int table, int len, unsigned char *source, int *target) {
X  /* Target[] is index to chars table or unmapped character code
X     as negative value */
X
X  int i;
X  for (i = 0; i < len; i++) 
X    if (-1 != tables[table][source[i]])
X      target[i] = tables[table][source[i]];
X    else target[i] = -source[i];
X}
X
Xint unmap_string(int table,int len, int *source, unsigned char *target) {
X  int i,res = 0;
X  for (i = 0; i < len; i++) 
X    if (source[i] >= 0 && chars[source[i]].vector[table] >= 0) 
X      target[res++] = chars[source[i]].vector[table];
X  return res;
X}
X
Xstatic struct TN { 
X  char *name;
X  int table;
X  enum nt { NT_name, NT_MIME, NT_joker } nametype;
X} tablenames[] = {
X  { "Ascii",                MAP_ASCII,         NT_name },
X  { "US-ASCII",             MAP_ASCII,         NT_MIME },
X  { "Latin/1",              MAP_LATIN1,        NT_name },
X  { "ISO-8859-1",           MAP_LATIN1,        NT_MIME },
X  { "Latin/2",              MAP_LATIN2,        NT_name },
X  { "ISO-8859-2",           MAP_LATIN2,        NT_MIME },
X  { "Latin/4",              MAP_LATIN4,        NT_name },
X  { "ISO-8859-4",           MAP_LATIN4,        NT_MIME },
X  { "Latin/5",              MAP_LATIN5,        NT_name },
X  { "ISO-8859-9",           MAP_LATIN5,        NT_MIME },
X  { "ISO 8859 family",      MAP_LATIN_ANY,     NT_name },
X  { "ISO-8859-",            MAP_LATIN_ANY,     NT_joker },
X  { "Multinational",        MAP_MULTINATIONAL, NT_name },
X  { "X-DEC-MCS",            MAP_MULTINATIONAL, NT_MIME },
X  { "Finnish",              MAP_FINNISH,       NT_name },
X  { "X-ISO646-FI",          MAP_FINNISH,       NT_MIME },
X  { "X-ISO646-SF",          MAP_FINNISH,       NT_MIME },
X  { "X-ISO646-FIN",         MAP_FINNISH,       NT_MIME },
X  { "UK-ASCII",             MAP_UK,            NT_name },
X  { "British",              MAP_UK,            NT_name },
X  { "X-UK-ASCII",           MAP_UK,            NT_MIME },
X  { "X-ISO646-UK",          MAP_UK,            NT_MIME },
X  { "Norwegian",            MAP_NOR,           NT_name },
X  { "Danish",               MAP_NOR,           NT_name },
X  { "X-ISO646-NOR",         MAP_NOR,           NT_MIME },
X  { "X-ISO646-DAN",         MAP_NOR,           NT_MIME },
X  { "French Canadian",      MAP_CAN,           NT_name },
X  { "Canadian",             MAP_CAN,           NT_name },
X  { "X-ISO646-CAN",         MAP_CAN,           NT_MIME },
X  { "French/Belgian",       MAP_BEL,           NT_name },
X  { "Flemish",              MAP_BEL,           NT_name },
X  { "X-ISO646-FRE",         MAP_BEL,           NT_MIME },
X  { "X-ISO646-BEL",         MAP_BEL,           NT_MIME },
X  { "X-ISO646-FLE",         MAP_BEL,           NT_MIME },
X  { "German",               MAP_GER,           NT_name },
X  { "X-ISO646-GER",         MAP_GER,           NT_MIME },
X  { "Swedish",              MAP_SWE,           NT_name },
X  { "X-ISO646-SWE",         MAP_SWE,           NT_MIME }
X};
X
Xchar *map_name(int map, int mime) {
X  int i;
X  for (i = 0; i < sizeof(tablenames) / sizeof (struct TN); i++) 
X    if (map == tablenames[i].table &&
X	tablenames[i].nametype == mime ? NT_MIME : NT_name)
X      return tablenames[i].name;
X  return "Unknown";
X}
X
Xint find_map (char *name) {
X  int i,l,k=strlen(name);;
X  
X  for (i = 0; i < sizeof(tablenames) / sizeof (struct TN); i++) 
X    if (NT_joker != tablenames[i].nametype && 
X	0 == strcasecmp(name,tablenames[i].name)) 
X      return tablenames[i].table;
X
X  for (i = 0; i < sizeof(tablenames) / sizeof (struct TN); i++) 
X    if (NT_joker == tablenames[i].nametype &&
X	k > (l = strlen(tablenames[i].name)) &&
X	0 == strncasecmp(name,tablenames[i].name,l)) {
X      print_notify ("Charset %s not known, using known subset: %s",
X		    name,map_name(tablenames[i].table,0));
X      return tablenames[i].table;
X    }
X  
X  return -1;
X}
X
X
SHAR_EOF
chmod 0644 charset.c.new || echo "restore of charset.c.new fails"
sed 's/^X//' << 'SHAR_EOF' > patch01 &&
Xdiff -c ./charset.h /home/hydra/hurtta/src/kehpager/charset.h
X*** ./charset.h	Sun Oct  3 13:51:14 1993
X--- /home/hydra/hurtta/src/kehpager/charset.h	Sun Oct  3 14:10:09 1993
X***************
X*** 1,5 ****
X  
X! #define MAP_COUNT 12
X  
X  #define MAP_ASCII 0
X  #define MAP_LATIN1 1
X--- 1,5 ----
X  
X! #define MAP_COUNT 15
X  
X  #define MAP_ASCII 0
X  #define MAP_LATIN1 1
X***************
X*** 12,17 ****
X--- 12,21 ----
X  #define MAP_LATIN4  8
X  #define MAP_LATIN5  9
X  #define MAP_LATIN_ANY  10
X+ #define MAP_LATIN2  11
X+ #define MAP_BEL     12
X+ #define MAP_GER     13
X+ #define MAP_CAN     14
X  
X  extern struct CV {
X    char *fallback;
X***************
X*** 27,33 ****
X--- 31,39 ----
X  
X  extern void init_tables(void);
X  extern void map_input(int table, int len, unsigned char *source, int *target);
X+ extern int unmap_string(int table,int len, int *source, unsigned char *target);
X  extern int find_map (char *name);
X+ extern char *map_name(int map, int mime);
X  extern int string_value(int len, int *buffer);
X  
X  extern int CH_SPC;
Xdiff -c ./control.c /home/hydra/hurtta/src/kehpager/control.c
X*** ./control.c	Sun Oct  3 13:51:14 1993
X--- /home/hydra/hurtta/src/kehpager/control.c	Sun Oct  3 14:10:05 1993
X***************
X*** 127,136 ****
X--- 127,140 ----
X    /* National character sets */
X    { 1, "B", "ASCII",           0  , -1 , 0,  MAP_ASCII },           /* 0 */
X    { 2, "A", "UK-ASCII",        0  , -1 , 0,  MAP_UK },
X+   { 4, "9", "French Canadian", 0  , -1 , 0,  MAP_CAN },
X    { 6, "5", "Finnish",         0  , -1 , 0,  MAP_FINNISH },
X+   { 7, "K", "German",          0  , -1 , 0,  MAP_GER },
X    { 5, "E", "Danish",          0  , -1 , 0,  MAP_NOR },
X    { 13,"E", "Norwegian",       0  , -1 , 0,  MAP_NOR },
X    { 12,"7", "Swedish",         0  , -1 , 0,  MAP_SWE },
X+   { 3, "R", "Flemish",         0  , -1 , 0,  MAP_BEL },
X+   { 14,"R", "French/Belgian",  0  , -1 , 0,  MAP_BEL },
X  
X    { -1, "<", "Multinational" , 0  , 0 , 1,   MAP_MULTINATIONAL },
X    { -1, "%5", "Multinational", 63 , -1 , 1,  MAP_MULTINATIONAL },
X***************
X*** 558,567 ****
X--- 562,583 ----
X    return S;
X  }
X  
X+ static char *Number(int v) {
X+   static int B=0;
X+   static char buffer[5][10];
X+   if (-1 == v) return "Undefined";
X+   B = (B+1)%5;
X+   sprintf(buffer[B],"%d",v);
X+   return buffer[B];
X+ }
X+ 
X  void give_debug_page(void (*printer)(char  *line, int header)) {
X    char buffer[80];
X  #define PV(T,v) { if (-1 == v) sprintf(buffer,"%-30s: Undefined",T,v); \
X  		  else sprintf(buffer,"%-30s: %d",T,v); printer(buffer,0); }
X+ #define PV1(T,v,v1) { sprintf(buffer,"%-30s: %-15s Default: %s",T,\
X+ 			      Number(v),Number(v1)); printer(buffer,0); }
X+ 
X  #define PB(T,v) { sprintf(buffer,"%-30s: %s",T,Boolean(v)); printer(buffer,0); }
X  #define PB1(T,v,v1) { sprintf(buffer,"%-30s: %-15s Default: %s",T,\
X  			      Boolean(v),Boolean(v1)); printer(buffer,0); }
X***************
X*** 569,580 ****
X  					    case -1: S = "Undefined"; break; \
X  					    default: S = sets[v].name; } \
X  		  sprintf(buffer,"%-30s: %-1s",T,S); printer(buffer,0); }
X    printer("Terminal state",1); 
X    PB1("8 bit characters", use_multinational,default_multinational);
X    PB1("8 bit personality", personality_8bit,default_personality);
X    PB("XTerm mode", xterm_latin1_magic);
X!   PV("Keyboard language", keyboard_language);
X!   PV(" - Default keyboard language", default_language);
X    PF("Bank G0 font", used_sets[0]);
X    PF("Bank G1 font", used_sets[1]);
X    PF("Bank G2 font", used_sets[2]);
X--- 585,600 ----
X  					    case -1: S = "Undefined"; break; \
X  					    default: S = sets[v].name; } \
X  		  sprintf(buffer,"%-30s: %-1s",T,S); printer(buffer,0); }
X+ #define PMP(T,v) { char *S = "??"; switch(v) { \
X+ 					    case -1: S = "Undefined"; break; \
X+ 					    default: S = map_name(v,0); } \
X+ 		  sprintf(buffer,"%-30s: %-1s",T,S); printer(buffer,0); }
X    printer("Terminal state",1); 
X    PB1("8 bit characters", use_multinational,default_multinational);
X    PB1("8 bit personality", personality_8bit,default_personality);
X    PB("XTerm mode", xterm_latin1_magic);
X!   PV1("Keyboard language", keyboard_language,default_language);
X!   PMP("Keyboard charset",keyboard_charset);
X    PF("Bank G0 font", used_sets[0]);
X    PF("Bank G1 font", used_sets[1]);
X    PF("Bank G2 font", used_sets[2]);
X***************
X*** 592,597 ****
X--- 612,618 ----
X    PF("Bank G2 font", default_sets[2]);
X    PF("Bank G3 font", default_sets[3]);
X  
X+ #undef PMP
X  #undef PV
X  #undef PB
X  #undef PB1
Xdiff -c ./kehpager.1 /home/hydra/hurtta/src/kehpager/kehpager.1
X*** ./kehpager.1	Sun Oct  3 13:51:15 1993
X--- /home/hydra/hurtta/src/kehpager/kehpager.1	Sun Oct  3 14:10:12 1993
X***************
X*** 8,15 ****
X  kehpager 
X  [\-Dn] 
X  [\-f|\-e[u|c]|\-X[+|++]|\-Nn]...
X! [[\-A|\-L[1|4|5]|\-M|\-F|\-UK|\-NR|\-SW|\-t[+]|\-b[+]|\-a[+]|\-p[+]|\-w[+]|\-CS cs]... 
X! [\-|file|-H|-T|-DS]]...
X  
X  .SH DESCRIPTION
X  Kehpager is a pager that displays the contents of a text file
X--- 8,15 ----
X  kehpager 
X  [\-Dn] 
X  [\-f|\-e[u|c]|\-X[+|++]|\-Nn]...
X! [[\-A|\-L[1|2|4|5]|\-M|\-F|\-UK|\-NR|\-SW|\-FR|\-CA|\-GR|\-t[+]|\-b[+]|\-a[+]|\-p[+]|\-w[+]|\-CS cs]... 
X! [\-|file|\-H|\-T[2]|\-DS]]...
X  
X  .SH DESCRIPTION
X  Kehpager is a pager that displays the contents of a text file
X***************
X*** 62,67 ****
X--- 62,70 ----
X  .B \-L[1]
X  Charset is Latin/1 (ISO-8859-1). (Default, if not changed in init file)
X  .TP
X+ .B \-L2
X+ Charset is Latin/2 (ISO-8859-2)
X+ .TP
X  .B \-L4
X  Charset is Latin/4 (ISO-8859-4)
X  .TP
X***************
X*** 78,88 ****
X  Charset is National (UK-ASCII)
X  .TP
X  .B \-NR
X! Charset is National (Norwegian)
X  .TP
X  .B \-SW
X  Charset is National (Swedish)
X  .TP
X  .B \-CS cs
X  Set charset
X  .TP
X--- 81,100 ----
X  Charset is National (UK-ASCII)
X  .TP
X  .B \-NR
X! Charset is National (Norwegian, Danish)
X  .TP
X  .B \-SW
X  Charset is National (Swedish)
X  .TP
X+ .B \-FR
X+ Charset is National (French/Belgian, Flemish)
X+ .TP
X+ .B \-CA
X+ Charset is National (French Canadian)
X+ .TP
X+ .B \-GR
X+ Charset is National (German)
X+ .TP
X  .B \-CS cs
X  Set charset
X  .TP
X***************
X*** 133,138 ****
X--- 145,156 ----
X  .B N
X  Next file
X  .TP
X+ .B R
X+ Rereads current file
X+ .TP
X+ .B C
X+ Rereads current file with given charset.
X+ .TP
X  .B q      
X  Quit
X  .TP
X***************
X*** 227,232 ****
X--- 245,257 ----
X  "
X  
X  .TP 8
X+ .B letter with DOUBLE ACUTE ACCENT
X+ Letters with double acute accent can type as
X+ .I compose 
X+ "
X+ .I letter
X+ 
X+ .TP 8
X  .B letter with RING ABOVE
X  Letters with ring above can type as
X  .I compose letter
X***************
X*** 233,238 ****
X--- 258,287 ----
X  .B o
X  
X  .TP 8
X+ .B letter with DOT ABOVE
X+ Letters with ring above can type as
X+ .I compose letter
X+ .B .
X+ 
X+ .TP 8
X+ .B letter with BREVE
X+ Letters with breve can type as
X+ .I compose letter
X+ .B (
X+ 
X+ .TP 8
X+ .B letter with OGONEK
X+ Letters with ogonek can type as
X+ .I compose letter
X+ .B ;
X+ 
X+ .TP 8
X+ .B letter with CARON
X+ Letters with caron can type as
X+ .I compose letter
X+ .B <
X+ 
X+ .TP 8
X  .B COMMERCIAL AT (@)
X  Commercial at can type as
X  .I compose 
X***************
X*** 258,264 ****
X  
X  .TP 8
X  .B GRAVE ACCENT (`)
X! Reverse solidus can type as
X  .I compose 
X  .B ' '
X  
X--- 307,313 ----
X  
X  .TP 8
X  .B GRAVE ACCENT (`)
X! Grave accent can type as
X  .I compose 
X  .B ' '
X  
X***************
X*** 370,432 ****
X  Active always. (Normal value: Ctrl-C) Default value: VINTR character.
X  .TP
X  .B keyboard.debug_screen
X! Displays debug page. Active in main and message.last prompts. Normal value: "D"
X  .TP
X  .B keyboard.toggle_tabbing
X! Toggles interpreting of TAB, NBSP, SHY -characters. Active in main and
X  message.last prompts. Normal value: "t"
X  .TP
X  .B keyboard.toggle_prompt
X! Toggles prompt on/off. Active in main and message.last prompts.  
X  Normal value: "p"
X  .TP
X  .B keyboard.toggle_wrapping
X! Toggles word wrap. Active in main and message.last prompts. Normal value: "w"
X  .TP
X  .B keyboard.give_help
X! Prints help page (internal manual page). Active in main and message.last 
X  prompts. Normal value: "?"
X  .TP
X  .B keyboard.next_file
X! Gives next file. Active in main and message.last 
X! prompts. Normal value: "N"
X  .TP
X  .B keyboard.next_page
X! Gives next screenful of file. Active in main prompt. Normal value: " "
X  .TP
X  .B keyboard.prev_page
X! Gives previous screenful of file. Active in main prompt and message.last
X! prompts. Normal value: "b"
X  .TP
X  .B keyboard.next_line
X! Gives next line of file. Active in main prompt. Normal value: RETURN
X  .TP
X  .B keyboard.prev_line
X! Gives previous line of file. Active in main prompt. (Normal value: DEL)
X! Default value: VERASE character.
X  .TP
X  .B keyboard.top
X! Gives top of file. Active in main prompt and message.last
X  prompts. Normal value: "g"
X  .TP
X  .B keyboard.bottom
X! Gives bottom of file. Active in main prompt and message.last
X  prompts. Normal value: "G"
X  .TP
X  .B keyboard.message.clear
X  Removes error messages.  Active in message.last prompt. Normal value: RETURN
X  .TP
X  .B keyboard.goto
X  Shows goto -prompt and inserts character to goto prompt. 
X  Active in main, message.last and goto prompts. Normal value: All digits
X  .TP
X  .B keyboard.goto.del
X! Removes character from goto prompt. Active in goto prompt. 
X! (Normal value: DEL) Default value: VERASE character.
X  .TP
X  .B keyboard.goto.erase_line
X! Removes goto prompt. Active in goto prompt. (Normal value: Ctrl-U)
X! Default value: VKILL character.
X  .TP
X  .B keyboard.goto.enter
X  Goes to given line in file and removes goto prompt.
X--- 419,499 ----
X  Active always. (Normal value: Ctrl-C) Default value: VINTR character.
X  .TP
X  .B keyboard.debug_screen
X! Displays debug page. Active in main, message and message.last prompts. 
X! Normal value: "D"
X  .TP
X  .B keyboard.toggle_tabbing
X! Toggles interpreting of TAB, NBSP, SHY -characters. Active in main, message and
X  message.last prompts. Normal value: "t"
X  .TP
X  .B keyboard.toggle_prompt
X! Toggles prompt on/off. Active in main, message and message.last prompts.  
X  Normal value: "p"
X  .TP
X  .B keyboard.toggle_wrapping
X! Toggles word wrap. Active in main, message and message.last prompts. 
X! Normal value: "w"
X  .TP
X  .B keyboard.give_help
X! Prints help page (internal manual page). Active in main, message and 
X! message.last 
X  prompts. Normal value: "?"
X  .TP
X  .B keyboard.next_file
X! Gives next file or clears message. 
X! Active in main, message and message.last prompt. 
X! Normal value: "N"
X  .TP
X+ .B keyboard.reread_file
X+ Rereads current file. Active in main
X+ prompt. Normal value: "R"
X+ .TP
X  .B keyboard.next_page
X! Gives next screenful of file. Active in main and message prompts. 
X! Normal value: " "
X  .TP
X  .B keyboard.prev_page
X! Gives previous screenful of file. Active in main, message and 
X! message.last prompts. Normal value: "b"
X  .TP
X  .B keyboard.next_line
X! Gives next line of file. Active in main and message prompts. 
X! Normal value: RETURN
X  .TP
X  .B keyboard.prev_line
X! Gives previous line of file. Active in main and message prompts. 
X! (Normal value: DEL) Default value: VERASE character.
X  .TP
X  .B keyboard.top
X! Gives top of file. Active in main, message and message.last
X  prompts. Normal value: "g"
X  .TP
X  .B keyboard.bottom
X! Gives bottom of file. Active in main prompt, message and message.last
X  prompts. Normal value: "G"
X  .TP
X  .B keyboard.message.clear
X  Removes error messages.  Active in message.last prompt. Normal value: RETURN
X  .TP
X+ .B keyboard.charset
X+ Shows charset prompt. Active in main prompt. Normal value: "C"
X+ .TP
X+ .B keyboard.charset.enter
X+ Rereads file with given charset and
X+ removes charset prompt. Active in charset prompt. Normal value: RETURN
X+ .TP
X+ .B keyboard.charset.self_insert
X+ Inserts character charset prompt. Active in charset prompt. Normal value: LETTER
X+ .TP
X  .B keyboard.goto
X  Shows goto -prompt and inserts character to goto prompt. 
X  Active in main, message.last and goto prompts. Normal value: All digits
X  .TP
X  .B keyboard.goto.del
X! OBSOLETED
X  .TP
X  .B keyboard.goto.erase_line
X! OBSOLETED
X  .TP
X  .B keyboard.goto.enter
X  Goes to given line in file and removes goto prompt.
X***************
X*** 437,456 ****
X  Active in goto prompt. Normal value: "%"
X  .TP
X  .B keyboard.search
X! Gives search prompt. Active in main and message.last prompts. 
X  Normal value: "/"
X  .TP
X  .B keyboard.search_next
X  Search next instance in file. 
X! Active in main and  message.last. Normal value: "n"
X  .TP
X  .B keyboard.search_first
X  Search first instance in file. 
X! Active in main and message.last. Normal value: PF1
X  .TP
X  .B keyboard.search.first
X  Continues search from beginning of file (removes search prompt). 
X! Active in search prompts. Normal value: PF1
X  .TP
X  .B keyboard.search.next
X  Continues search from last found position in file (removes search prompt). 
X--- 504,523 ----
X  Active in goto prompt. Normal value: "%"
X  .TP
X  .B keyboard.search
X! Gives search prompt. Active in main, message and message.last prompts. 
X  Normal value: "/"
X  .TP
X  .B keyboard.search_next
X  Search next instance in file. 
X! Active in main, message and  message.last. Normal value: "n"
X  .TP
X  .B keyboard.search_first
X  Search first instance in file. 
X! Active in main, message and message.last. Normal value: PF1
X  .TP
X  .B keyboard.search.first
X  Continues search from beginning of file (removes search prompt). 
X! Active in search prompt. Normal value: PF1
X  .TP
X  .B keyboard.search.next
X  Continues search from last found position in file (removes search prompt). 
X***************
X*** 461,468 ****
X  Active in search prompts. Normal value: RETURN
X  .TP
X  .B keyboard.search.del
X! Removes character from search prompt. Active in search prompt.
X! (Normal value: DEL) Default value: VERASE character.
X  .TP
X  .B keyboard.search.self_insert
X  Insert character to search prompt. Active in search prompt.
X--- 528,534 ----
X  Active in search prompts. Normal value: RETURN
X  .TP
X  .B keyboard.search.del
X! OBSOLETED
X  .TP
X  .B keyboard.search.self_insert
X  Insert character to search prompt. Active in search prompt.
X***************
X*** 469,481 ****
X  Normal value: LETTER (this joker value match to all printable chars)
X  .TP
X  .B keyboard.search.erase_line
X! Erases search prompt. Active in search prompt. (Normal value: Ctrl-U)
X! Default value: VKILL character.
X  .TP
X  .B keyboard.search.enter
X  Continues search from current page of file (removes search prompt). 
X  Active in search prompts. Normal value: RETURN
X  .TP
X  .B input.charset
X  Charset of input file(s). Default value: Latin/1
X  .TP
X--- 535,555 ----
X  Normal value: LETTER (this joker value match to all printable chars)
X  .TP
X  .B keyboard.search.erase_line
X! OBSOLETED
X  .TP
X  .B keyboard.search.enter
X  Continues search from current page of file (removes search prompt). 
X  Active in search prompts. Normal value: RETURN
X  .TP
X+ .B keyboard.edit.del
X+ Removes character from prompt. Active in search, charset and goto prompts.
X+ (Normal value: DEL) Default value: VERASE character.
X+ .TP
X+ .B keyboard.edit.erase_line
X+ Erases prompt. Active in search, charset and goto prompts. 
X+ (Normal value: Ctrl-U)
X+ Default value: VKILL character.
X+ .TP
X  .B input.charset
X  Charset of input file(s). Default value: Latin/1
X  .TP
X***************
X*** 540,546 ****
X  .B use.keyboard_language
X  Keyboard language - needed for correct font in national mode.
X  Supported values: 1 = North American (ASCII), 2 = British (UK-ASCII), 
X! 6 = Finnish, 5 = Danish / 13 = Norwegian, 12 = Swedish. 
X  If this values is incorrect, kehpager works incorrectly.
X  Value in this file is only used, if terminal don't report value for that field.
X  Default value: 6
X--- 614,621 ----
X  .B use.keyboard_language
X  Keyboard language - needed for correct font in national mode.
X  Supported values: 1 = North American (ASCII), 2 = British (UK-ASCII), 
X! 3 = Flemish / 14 = French/Belgian, 4 = French Canadian
X! 5 = Danish / 13 = Norwegian, 6 = Finnish, 7 = German, 12 = Swedish.
X  If this values is incorrect, kehpager works incorrectly.
X  Value in this file is only used, if terminal don't report value for that field.
X  Default value: 6
Xdiff -c ./kehpager.c /home/hydra/hurtta/src/kehpager/kehpager.c
X*** ./kehpager.c	Sun Oct  3 13:51:15 1993
X--- /home/hydra/hurtta/src/kehpager/kehpager.c	Sun Oct  3 14:10:07 1993
X***************
X*** 11,16 ****
X--- 11,17 ----
X  #else
X  #include <sys/ioctl.h>
X  #endif
X+ #include <unistd.h>
X  
X  #include <errno.h>
X  extern int errno;
X***************
X*** 26,32 ****
X  #include "env.h"
X  #include "keyboard.h"
X  
X! char *Version = "kehpager V1.02";
X  /* Author: Kari E. Hurtta <Kari.Hurtta@Helsinki.FI> */
X  char *prog="Unknown";
X  int quitflag = 0;
X--- 27,33 ----
X  #include "env.h"
X  #include "keyboard.h"
X  
X! char *Version = "kehpager V1.03";
X  /* Author: Kari E. Hurtta <Kari.Hurtta@Helsinki.FI> */
X  char *prog="Unknown";
X  int quitflag = 0;
X***************
X*** 105,110 ****
X--- 106,119 ----
X   *               Control keys bindings and defaults to/from terminal driver
X   *               Compiles on HPUX
X   *               Don't complain is can't set file to nonblocking mode
X+  * 1.03 93-10-03 composed input for BREVE, OGONEK and CARON
X+  *               LATIN2, French/Belgian, French Canadian
X+  *               key_reread, key_forward, keyedel, key_eerase, key_charset,
X+  *               key_center, key_cinsert
X+  *               (key_gdel,key_gerase,key_sdel,key_serase obsoleted)
X+  *               map_name, print_help, reread_file, reset_file_flags, eq_pair
X+  *               Info for composed input in internal help page
X+  *               find_buffer_text handles now CH_SHY and CH_NBSP specially
X   */
X  
X  static void scroll_it(int win) {
X***************
X*** 177,182 ****
X--- 186,192 ----
X  static int prev_prompt[1000];
X  static int prev_prompt_len = 0;
X  static int key_group = G_PAGER;
X+ static int map = MAP_LATIN1;
X  
X  #define MAX_GOTO 5
X  static int goto_value[MAX_GOTO+1];
X***************
X*** 186,201 ****
X  static int search_value_len = 0;
X  static int search_prompt = 0;
X  static int search_X = 1, search_Y = 1;
X  
X  static update_prompt(int win, int mode) {
X    int Y,off,roff,rl,bot,prompt_line,line;
X!   int T,W,prompt_X = 1, map=MAP_ASCII;
X    char buffer[1000],S[50];
X    int  buffer2[1000], b2len=0;
X  
X!   sprintf(S,"MORE (press %s for next page)",give_mapping(&key_page));
X!   key_group = G_PAGER;
X  
X    window_pos(win,&Y,&off,&roff);
X    rl = window_rlines(win);
X    get_window_status(win,&T,&W);
X--- 196,226 ----
X  static int search_value_len = 0;
X  static int search_prompt = 0;
X  static int search_X = 1, search_Y = 1;
X+ #define MAX_CHARSET 40
X+ static int charset_value[MAX_CHARSET+1];
X+ static int charset_value_len = 0;
X+ static int charset_prompt = 0;
X  
X+ 
X  static update_prompt(int win, int mode) {
X    int Y,off,roff,rl,bot,prompt_line,line;
X!   int T,W,prompt_X = 1;
X    char buffer[1000],S[50];
X    int  buffer2[1000], b2len=0;
X  
X!   strcpy(S,"???");
X  
X+   switch(mode) {
X+   case 3: 
X+     sprintf(S,"MESSAGE (press %s for next page)",give_mapping(&key_page));
X+     key_group = G_MESSAGE;    
X+     break;
X+   case 2: case 1: case 4:
X+     sprintf(S,"MORE (press %s for next page)",give_mapping(&key_page));
X+     key_group = G_PAGER;
X+     break;
X+   }
X+ 
X    window_pos(win,&Y,&off,&roff);
X    rl = window_rlines(win);
X    get_window_status(win,&T,&W);
X***************
X*** 223,230 ****
X    else if (6 == mode)
X      strcpy(S,"SEARCH (please wait)"); 
X  
X!   if (search_prompt && 5 !=  mode) {
X      int i;
X      strcpy(buffer,"SEARCH: ");
X      i = strlen(buffer);
X      map_input(MAP_ASCII,i,buffer,buffer2);
X--- 248,265 ----
X    else if (6 == mode)
X      strcpy(S,"SEARCH (please wait)"); 
X  
X!   if (charset_prompt && 5 !=  mode) {
X      int i;
X+     sprintf(buffer,"CHARSET (default: %s): ",map_name(map,0));
X+     i = strlen(buffer);
X+     map_input(MAP_ASCII,i,buffer,buffer2);
X+     memcpy((void *)(buffer2+i),(void *)charset_value,
X+ 	   charset_value_len*sizeof (int));
X+     b2len = charset_value_len + i;
X+     prompt_X = i+charset_value_len+1;
X+     key_group = G_CHARSET;
X+   } else if (search_prompt && 5 !=  mode) {
X+     int i;
X      strcpy(buffer,"SEARCH: ");
X      i = strlen(buffer);
X      map_input(MAP_ASCII,i,buffer,buffer2);
X***************
X*** 260,266 ****
X  
X  
X  #define HAVE_PROMPT (have_prompt || key_group == G_GOTO || \
X! 		     key_group == G_SEARCH)
X    
X    if (search_prompt && 5 !=  mode) {
X      int ln = window_rlines(WIN_PROMPT);
X--- 295,301 ----
X  
X  
X  #define HAVE_PROMPT (have_prompt || key_group == G_GOTO || \
X! 		     key_group == G_SEARCH || key_group == G_CHARSET)
X    
X    if (search_prompt && 5 !=  mode) {
X      int ln = window_rlines(WIN_PROMPT);
X***************
X*** 469,475 ****
X    }
X  }
X  
X! static void handle_file(int map,int *fp) {
X    unsigned char *ch1,*ch2;
X    int size = is_unblocking ? 4000 : 80;
X    unsigned char buffer [4000];
X--- 504,510 ----
X    }
X  }
X  
X! static void handle_file(int map,int *fp,int *eof) {
X    unsigned char *ch1,*ch2;
X    int size = is_unblocking ? 4000 : 80;
X    unsigned char buffer [4000];
X***************
X*** 482,488 ****
X    }
X  
X    if (0 == len) {
X!     close_file(fp);
X      return;
X    }
X  
X--- 517,523 ----
X    }
X  
X    if (0 == len) {
X!     *eof = 1;
X      return;
X    }
X  
X***************
X*** 540,551 ****
X    
X  }
X  
X! static void read_file(char *name, int *fp) {
X    int ft;
X    int size;
X    int fionbio_arg = 1;
X  
X    if (-1 != *fp) close_file(fp);
X  
X    if (0 == strcmp(name,"-")) {
X      if (isatty(0)) {
X--- 575,601 ----
X    
X  }
X  
X! static void reset_file_flags(int *fp,int *eof) {
X!   last_line_Y = 1;
X!   last_line_X = 0;
X!   search_X = 1;
X!   search_Y = 1;
X!   one_char_flag = 0;
X!   last_del = 0;
X!   attrib_char_flag = 0;
X!   clear_attrib_buffer();
X!   clear_window(WIN_TEXT);
X!   map_window(WIN_TEXT,1-down_line,1);
X!   *eof = 0;
X! }
X! 
X! static void read_file(char *name, int *fp, int *eof) {
X    int ft;
X    int size;
X    int fionbio_arg = 1;
X  
X    if (-1 != *fp) close_file(fp);
X+   *eof = 1;
X  
X    if (0 == strcmp(name,"-")) {
X      if (isatty(0)) {
X***************
X*** 566,598 ****
X    if (-1 == ioctl(ft,FIONBIO,&fionbio_arg)) {
X      int code = errno;
X      is_unblocking = 0;
X!     if (EINVAL != code) 
X        print_error(code,"Can't set %s to nonblocking mode",name);
X    }
X  
X-   last_line_Y = 1;
X-   last_line_X = 0;
X-   search_X = 1;
X-   search_Y = 1;
X-   one_char_flag = 0;
X-   last_del = 0;
X-   attrib_char_flag = 0;
X-   clear_attrib_buffer();
X-   clear_window(WIN_TEXT);
X-   map_window(WIN_TEXT,1-down_line,1);
X- 
X    *fp = ft;
X  }
X  
X  static int arg_left = 0;
X  static char **arg_vec = NULL;
X  static int FP = -1;
X  
X  void close_files(void) {
X    if (-1 != FP) close_file(&FP);
X  }
X  
X- static int map = MAP_LATIN1;
X  static int map_null_name = MAP_ASCII;
X  static int enable_tab = 1;
X  static int enable_wrapping = 1;
X--- 616,652 ----
X    if (-1 == ioctl(ft,FIONBIO,&fionbio_arg)) {
X      int code = errno;
X      is_unblocking = 0;
X!     /* HPUX allows only terminal to put nonblocking mode */
X!     if (EINVAL != code && ENOTTY != code) 
X        print_error(code,"Can't set %s to nonblocking mode",name);
X    }
X  
X    *fp = ft;
X+   reset_file_flags(fp,eof);
X+ 
X  }
X  
X+ static int reread_file(int *FP,int *eof) {
X+   if (-1 == *FP) return 0;
X+   if (-1 == lseek(*FP,0,SEEK_SET)) {
X+     int code = errno;
X+     if (ESPIPE == code) return 0;
X+     print_error(code,"Can't seek to start of file");
X+     return 0;
X+   }
X+   reset_file_flags(FP,eof);
X+   return 1;
X+ }
X+ 
X  static int arg_left = 0;
X  static char **arg_vec = NULL;
X  static int FP = -1;
X+ static int EOF_IN_FILE = 1;
X  
X  void close_files(void) {
X    if (-1 != FP) close_file(&FP);
X  }
X  
X  static int map_null_name = MAP_ASCII;
X  static int enable_tab = 1;
X  static int enable_wrapping = 1;
X***************
X*** 608,652 ****
X    { NULL, NULL, V_LAST }
X  };
X  
X  static void help_page(int win) {
X    char buffer[80],*MM;
X  
X  #define P(F,S) print_and_scroll(win,MAP_ASCII,F,strlen(S),S)
X  #define M(S,K) if (MM = give_mapping(K)) { sprintf(buffer,S,MM); \
X  	       print_and_scroll(win,MAP_ASCII,0,strlen(buffer),buffer); }
X      
X!   set_window_status(win,1,0);
X    P(FL_BOLD,"Charset options:");
X    P(0,"");
X    P(0," -A\tCharset is Ascii (US-ASCII)");
X    P(0," -L[1]\tCharset is Latin/1 (ISO-8859-1)");
X    P(0," -L4\tCharset is Latin/4 (ISO-8859-4)");
X    P(0," -L5\tCharset is Latin/5 (ISO-8859-9)");
X    P(0," -M\tCharset is Multinational");
X    P(0," -F\tCharset is National (Finnish)");
X    P(0," -UK\tCharset is National (UK-ASCII)");
X!   P(0," -NR\tCharset is National (Norwegian)");
X    P(0," -SW\tCharset is National (Swedish)");
X!   P(0," -CS"); print_to_column(win,MAP_ASCII,FL_UNDER,6,2,"cs");
X!   print_to_column(win,MAP_ASCII,0,8,12,"\tSet charset");
X    P(0,"");
X    P(FL_BOLD,"Keyboard commands:");
X    P(0,"");
X    M(" %s\tRedraw",&key_redraw);
X!   M(" %s\tCompose/Quote key",&key_compose);
X    M(" %s\tNext file",&key_next);
X    M(" %s\tQuit",&key_quit);
X    M(" %s\tNext page",&key_page);
X    M(" %s\tNext line",&key_lnext);
X    M(" %s\tPrevious page",&key_prev);
X    M(" %s\tPrevious line",&key_lprev);
X    M(" %s\tTop of file",&key_top);
X!   P(0," "); print_to_column(win,MAP_ASCII,FL_UNDER,2,1,"n");
X!   sprintf(buffer,"%s\tGoto line",give_mapping(&key_genter));
X!   print_to_column(win,MAP_ASCII,0,3,strlen(buffer),buffer);
X!   P(0," "); print_to_column(win,MAP_ASCII,FL_UNDER,2,1,"n");
X!   sprintf(buffer,"%s\tGoto relative(%%) line",give_mapping(&key_gpercnt));
X!   print_to_column(win,MAP_ASCII,0,3,strlen(buffer),buffer);
X    M(" %s\tBottom of file",&key_bottom);
X    M(" %s\tSearch text from current page of file",&key_search);
X    M(" %s\tSearch next instance of text",&key_searchn);
X--- 662,743 ----
X    { NULL, NULL, V_LAST }
X  };
X  
X+ static print_help(char *s,int win, int *key) {
X+   char *b,*b1;
X+   int flag = 0;
X+   print_and_scroll(win,MAP_ASCII,0,0,""); 
X+   for (b = s; '\0' != *b; b = b1) {
X+     for (b1 = b; '\0' != *b1 && '%' != *b1; b1++);
X+     print_to_column(win,MAP_ASCII,flag,-1,b1-b,b);
X+     if ('%' == *b1) {
X+       char *MM;
X+       b1++;
X+       switch (*b1++) {
X+       case 's': case 'm': 
X+ 	MM = give_mapping(key);
X+ 	print_to_column(win,MAP_ASCII,flag,-1,strlen(MM),MM);
X+ 	break;
X+       case 'u':
X+ 	flag |= FL_UNDER; break;
X+       case 'U':
X+ 	flag &= ~FL_UNDER; break;
X+       case 'b':
X+ 	flag |= FL_BOLD; break;
X+       case 'B':
X+ 	flag &= ~FL_BOLD; break;
X+       case '%':
X+ 	print_to_column(win,MAP_ASCII,flag,-1,1,"%"); break;
X+       }
X+     }
X+   }
X+ }
X+ 
X  static void help_page(int win) {
X    char buffer[80],*MM;
X  
X  #define P(F,S) print_and_scroll(win,MAP_ASCII,F,strlen(S),S)
X+ #define C(S,K) print_help(S,win,K)
X  #define M(S,K) if (MM = give_mapping(K)) { sprintf(buffer,S,MM); \
X  	       print_and_scroll(win,MAP_ASCII,0,strlen(buffer),buffer); }
X      
X!   set_window_status(win,1,1);
X!   P(FL_BLINK,Version);
X!   print_to_column(win,MAP_ASCII,0,30,48,
X! 		  "Author: Kari E. Hurtta <Kari.Hurtta@Helsinki.FI>");
X!   P(0,"");
X    P(FL_BOLD,"Charset options:");
X    P(0,"");
X    P(0," -A\tCharset is Ascii (US-ASCII)");
X    P(0," -L[1]\tCharset is Latin/1 (ISO-8859-1)");
X+   P(0," -L2\tCharset is Latin/2 (ISO-8859-2)");
X    P(0," -L4\tCharset is Latin/4 (ISO-8859-4)");
X    P(0," -L5\tCharset is Latin/5 (ISO-8859-9)");
X    P(0," -M\tCharset is Multinational");
X    P(0," -F\tCharset is National (Finnish)");
X    P(0," -UK\tCharset is National (UK-ASCII)");
X!   P(0," -NR\tCharset is National (Norwegian, Danish)");
X    P(0," -SW\tCharset is National (Swedish)");
X!   P(0," -CA\tCharset is National (French Canadian)");
X!   P(0," -FR\tCharset is National (French/Belgian, Flemish)");
X!   P(0," -GR\tCharset is National (German)");
X!   C(" -CS %ucs%U\tSet charset",NULL);
X    P(0,"");
X    P(FL_BOLD,"Keyboard commands:");
X    P(0,"");
X    M(" %s\tRedraw",&key_redraw);
X!   M(" %s\tCompose/Quote key (See COMPOSED INPUT)",&key_compose);
X    M(" %s\tNext file",&key_next);
X+   M(" %s\tReread file (file must be seekable)",&key_reread);
X+   M(" %s\tChanges charset of file (file must be seekable)",&key_charset);
X    M(" %s\tQuit",&key_quit);
X    M(" %s\tNext page",&key_page);
X+   M(" %s\tNext page (checks if file is growing)",&key_forward);
X    M(" %s\tNext line",&key_lnext);
X    M(" %s\tPrevious page",&key_prev);
X    M(" %s\tPrevious line",&key_lprev);
X    M(" %s\tTop of file",&key_top);
X!   C(" %un%U%s\tGoto line",&key_genter);
X!   C(" %un%U%s\tGoto relative(%%) line",&key_gpercnt);
X    M(" %s\tBottom of file",&key_bottom);
X    M(" %s\tSearch text from current page of file",&key_search);
X    M(" %s\tSearch next instance of text",&key_searchn);
X***************
X*** 660,669 ****
X    P(FL_BOLD,"Control keys:");
X    P(0,"");
X    M(" %s\tRefresh screen",&key_redraw);
X!   M(" %s\tErases line (goto prompt)",&key_gerase);
X!   M(" %s\tDeletes char (goto prompt)",&key_gdel);
X!   M(" %s\tErases line (search prompt)",&key_serase);
X!   M(" %s\tDeletes char (search prompt)",&key_sdel);
X  #ifdef SUNOS4
X    M(" %s\tQuotes next control character",&key_compose);
X  #endif
X--- 751,758 ----
X    P(FL_BOLD,"Control keys:");
X    P(0,"");
X    M(" %s\tRefresh screen",&key_redraw);
X!   M(" %s\tErases line",&key_eerase);
X!   M(" %s\tDeletes char",&key_edel);
X  #ifdef SUNOS4
X    M(" %s\tQuotes next control character",&key_compose);
X  #endif
X***************
X*** 682,695 ****
X    P(0," -X\tDisable forced Latin/1 on Xterm");
X    P(0," -X+\tEnable forced Latin/1 on Xterm");
X    P(0," -X++\tForce Latin/1");
X!   P(0," -N"); print_to_column(win,MAP_ASCII,FL_UNDER,4,1,"n");
X!               print_to_column(win,MAP_ASCII,0,5,32,
X! 			      "\tSet (default) keyboard language");
X  
X    P(0,"");
X    P(FL_BOLD,"Options:");
X    P(0," -H\tThis text");
X    P(0," -T\tTest Page");
X    P(0," -t\tDisable interpreting of TAB, NBSP, SHY -characters");
X    P(0," -t+\tEnable interpreting of TAB, NBSP, SHY -characters");
X    P(0," -b\tDisable interpreting of BS -character");
X--- 771,783 ----
X    P(0," -X\tDisable forced Latin/1 on Xterm");
X    P(0," -X+\tEnable forced Latin/1 on Xterm");
X    P(0," -X++\tForce Latin/1");
X!   C(" -N%un%U\tSet (default) keyboard language",NULL);
X  
X    P(0,"");
X    P(FL_BOLD,"Options:");
X    P(0," -H\tThis text");
X    P(0," -T\tTest Page");
X+   P(0," -T2\tTest Page 2");
X    P(0," -t\tDisable interpreting of TAB, NBSP, SHY -characters");
X    P(0," -t+\tEnable interpreting of TAB, NBSP, SHY -characters");
X    P(0," -b\tDisable interpreting of BS -character");
X***************
X*** 701,717 ****
X    P(0," -p\tDisable prompt");
X    P(0," -p+\tEnable prompt");
X    P(0," -\tStandard input");
X!   P(0," -D"); print_to_column(win,MAP_ASCII,FL_UNDER,4,1,"n");
X!               print_to_column(win,MAP_ASCII,0,5,37,
X! 			      "\tPrint debug output to standard error");
X    P(0," -DS\tPrint debug page");
X    P(0,"");
X!   P(FL_BLINK,Version);
X!   print_to_column(win,MAP_ASCII,0,30,48,
X! 		  "Author: Kari E. Hurtta <Kari.Hurtta@Helsinki.FI>");
X!   
X  #undef P
X  #undef M
X  }
X  
X  static int DW = -1;
X--- 789,826 ----
X    P(0," -p\tDisable prompt");
X    P(0," -p+\tEnable prompt");
X    P(0," -\tStandard input");
X!   C(" -D%un%U\tPrint debug output to standard error",NULL);
X    P(0," -DS\tPrint debug page");
X    P(0,"");
X!   P(FL_BOLD,"COMPOSED INPUT:");
X!   P(0,"");
X!   M("Some letters can enter with typing compose key (%s) "
X!     "and two printable characters.",&key_compose);
X!   P(0,"");
X!   C("%m %uletter%U '\t\t%uletter%U with ACUTE ACCENT",&key_compose);
X!   C("%m %uletter%U ,\t\t%uletter%U with CEDILLA",&key_compose);
X!   C("%m %uletter%U `\t\t%uletter%U with GRAVE ACCENT",&key_compose);
X!   C("%m %uletter%U ^\t\t%uletter%U with CIRCUMFLEX ACCENT",&key_compose);
X!   C("%m %uletter%U ~\t\t%uletter%U with TILDE",&key_compose);
X!   C("%m %uletter%U \"\t\t%uletter%U with DIAERESIS",&key_compose);
X!   C("%m \" %uletter%U\t\t%uletter%U with DOUBLE ACUTE ACCENT",&key_compose);
X!   C("%m %uletter%U o\t\t%uletter%U with RING ABOVE",&key_compose);
X!   C("%m %uletter%U .\t\t%uletter%U with DOT ABOVE",&key_compose);
X!   C("%m %uletter%U (\t\t%uletter%U with BREVE",&key_compose);
X!   C("%m %uletter%U ;\t\t%uletter%U with OGONEK",&key_compose);
X!   C("%m %uletter%U <\t\t%uletter%U with CARON",&key_compose);
X!   C("%m A A\t\tCOMMERCIAL AT (@)",&key_compose);
X!   C("%m ( (\t\tLEFT SQUARE BRACKET ([)",&key_compose);
X!   C("%m / /\t\tREVERSE SOLIDUS (\\)",&key_compose);
X!   C("%m ' '\t\tGRAVE ACCENT (`)",&key_compose);
X!   C("%m ( -\t\tLEFT CURLY BRACKET ({)",&key_compose);
X!   C("%m ) -\t\tRIGHT CURLY BRACKET ({)",&key_compose);
X!   C("%m ^ /\t\tVERTICAL LINE (|)",&key_compose);
X!   C("%m ^ ^\t\tTILDE (~)",&key_compose);
X!   P(0,"");
X  #undef P
X  #undef M
X+ #undef C
X  }
X  
X  static int DW = -1;
X***************
X*** 754,760 ****
X    P(MAP_ASCII, "Code"); T(MAP_ASCII, 10, "Ascii"); ;
X                          T(MAP_MULTINATIONAL, 22, "Multinational"); 
X    T(MAP_UK, 36, "British"); T(MAP_SWE, 48, "Swedish");
X!   T(MAP_LATIN5,60,"Latin/5");
X    P(MAP_ASCII, ""); T(MAP_LATIN1, 16, "Latin/1");
X                      T(MAP_FINNISH, 30, "Finnish");   
X                      T(MAP_NOR, 42, "Norwegian");
X--- 863,869 ----
X    P(MAP_ASCII, "Code"); T(MAP_ASCII, 10, "Ascii"); ;
X                          T(MAP_MULTINATIONAL, 22, "Multinational"); 
X    T(MAP_UK, 36, "British"); T(MAP_SWE, 48, "Swedish");
X!   T(MAP_LATIN5,60,"Latin/5");   T(MAP_LATIN2,72, "Latin/2");
X    P(MAP_ASCII, ""); T(MAP_LATIN1, 16, "Latin/1");
X                      T(MAP_FINNISH, 30, "Finnish");   
X                      T(MAP_NOR, 42, "Norwegian");
X***************
X*** 770,776 ****
X      K(MAP_MULTINATIONAL, 22, c); K(MAP_FINNISH, 30, c);
X      K(MAP_UK,36, c); K(MAP_NOR,42, c); K(MAP_SWE, 48, c);
X      K(MAP_LATIN4,54, c); K(MAP_LATIN5,60,c);
X!     K(MAP_LATIN_ANY,66,c);
X    }
X  #undef P
X  #undef T
X--- 879,885 ----
X      K(MAP_MULTINATIONAL, 22, c); K(MAP_FINNISH, 30, c);
X      K(MAP_UK,36, c); K(MAP_NOR,42, c); K(MAP_SWE, 48, c);
X      K(MAP_LATIN4,54, c); K(MAP_LATIN5,60,c);
X!     K(MAP_LATIN_ANY,66,c); K(MAP_LATIN2,72,c);
X    }
X  #undef P
X  #undef T
X***************
X*** 777,783 ****
X--- 886,923 ----
X  #undef K
X  }
X  
X+ 
X+ static void test_page2(int win) {
X+   unsigned char c;
X+   int i;
X+   char temp[5];
X+ #define P(C,S) print_and_scroll(win,C,0,strlen(S),S)
X+ #define T(C,X,S) print_to_column(win,C,0,X,strlen(S),S)
X+ #define K(C,X,c) print_to_column(win,C,0,X,1,&c)
X+ 
X+   set_window_status(win,0,0);
X+   print_and_scroll(win,MAP_ASCII,FL_UNDER,strlen("Kehpager test page (2):"), "Kehpager test page (2):");
X+   P(MAP_ASCII,"");
X+   P(MAP_ASCII, "Code"); T(MAP_LATIN1, 10, "Latin/1"); 
X+   T(MAP_GER, 22, "German"); T(MAP_CAN,30, "French Canadian");
X+   P(MAP_ASCII, ""); T(MAP_BEL, 16, "French/Belgian");
X+   
X+ 
X+   for (i = 0; i < 256; i++) {
X+     c = i;
X+     sprintf(temp,"0x%02X",i);
X+     P(MAP_ASCII,temp);
X+ 
X+     K(MAP_LATIN1, 10, c); K(MAP_BEL, 16, c);
X+     K(MAP_GER, 22, c); K(MAP_CAN, 30, c);
X+   }
X+ #undef P
X+ #undef T
X+ #undef K
X+ }
X+ 
X  static int get_next = 1;
X+ static int do_forwarding = 0;
X  
X  static void action (int *pos, int c) {
X    int visible = have_error ? WIN_ERROR : WIN_TEXT;
X***************
X*** 784,815 ****
X  
X    if (&key_quit == pos) {
X      quitflag = 1;
X    } else if (&key_search == pos) {
X      key_group = G_SEARCH;
X      search_prompt = 1;
X      search_value_len = 0;
X!  } else if (&key_serase == pos) {
X      search_value_len = 0;
X      search_prompt = 0;
X!     key_group = G_PAGER; /* not necessary correct group !! */
X    } else if (&key_sinsert == pos) {
X      if (search_value_len < MAX_SEARCH) 
X        search_value[search_value_len++] = c;
X!   } else if (&key_sdel == pos) {
X!     if (search_value_len > 0)
X!       search_value_len--;
X!     if (0 == search_value_len) {
X!       search_prompt = 0;
X!       key_group = G_PAGER; /* not necessary correct group !! */
X!     }
X    } else if (&key_senter == pos ||
X  	     &key_searchn == pos || 
X  	     &key_ssearchn == pos ||
X  	     &key_ssearchf == pos ||
X  	     &key_searchf == pos) {
X!     int rY;
X      search_prompt = 0;
X!     key_group = G_PAGER; /* not necessary correct group !! */
X      if (&key_senter == pos) {
X        int Y,offset,roffset;
X        window_pos(visible,&Y,&offset,&roffset);
X--- 924,1010 ----
X  
X    if (&key_quit == pos) {
X      quitflag = 1;
X+   } else if (&key_charset == pos) {
X+     if (-1 == FP) return;
X+     key_group = G_CHARSET;
X+     charset_prompt = 1;
X+     charset_value_len = 0;
X+   } else if (&key_cinsert == pos) {
X+     if (charset_value_len < MAX_CHARSET) 
X+       charset_value[charset_value_len++] = c;
X+   } else if (&key_center == pos) {
X+     char name[MAX_CHARSET+2];
X+     int nmap;
X+     if (0 == charset_value_len) nmap = map;
X+     else {
X+       int len = unmap_string(MAP_ASCII,charset_value_len,charset_value,name);
X+       name[len] = '\0';
X+       if (len < charset_value_len) 
X+ 	return;
X+       nmap = find_map(name);
X+       if (nmap < 0) 
X+ 	return;
X+     }
X+     if (reread_file(&FP,&EOF_IN_FILE))
X+       map = nmap;
X+     charset_prompt = 0;
X+     charset_value_len = 0;
X+ 
X+     /* not necessary correct group !! */
X+     key_group = have_error ? G_MESSAGE : G_PAGER; 
X    } else if (&key_search == pos) {
X      key_group = G_SEARCH;
X      search_prompt = 1;
X      search_value_len = 0;
X!   } else if (&key_eerase == pos) {
X!     goto_value_len = 0;   
X      search_value_len = 0;
X      search_prompt = 0;
X!     charset_value_len = 0;
X!     charset_prompt = 0;
X!     
X!     /* not necessary correct group !! */
X!     key_group = have_error ? G_MESSAGE : G_PAGER; 
X    } else if (&key_sinsert == pos) {
X      if (search_value_len < MAX_SEARCH) 
X        search_value[search_value_len++] = c;
X!   } else if (&key_edel == pos) {
X!     switch (key_group) {
X!     case G_SEARCH:
X!       if (search_value_len > 0)
X! 	search_value_len--;
X!       if (0 == search_value_len) {
X! 	search_prompt = 0;
X! 	/* not necessary correct group !! */
X! 	key_group = have_error ? G_MESSAGE : G_PAGER; 
X!       }
X!       break;
X!     case G_CHARSET:
X!       if (charset_value_len > 0)
X! 	charset_value_len--;
X!       if (0 == charset_value_len) {
X! 	charset_prompt = 0;
X! 	/* not necessary correct group !! */
X! 	key_group = have_error ? G_MESSAGE : G_PAGER; 
X!       }
X!       break;
X!     case G_GOTO:
X!       if (goto_value_len > 0)
X! 	goto_value_len--;
X!       if (0 == goto_value_len)
X! 	/* not necessary correct group !! */
X! 	key_group = have_error ? G_MESSAGE : G_PAGER; 
X!       break;
X!     }  
X    } else if (&key_senter == pos ||
X  	     &key_searchn == pos || 
X  	     &key_ssearchn == pos ||
X  	     &key_ssearchf == pos ||
X  	     &key_searchf == pos) {
X!     int rY,mlen;
X      search_prompt = 0;
X!     /* not necessary correct group !! */
X!     key_group = have_error ? G_MESSAGE : G_PAGER; 
X      if (&key_senter == pos) {
X        int Y,offset,roffset;
X        window_pos(visible,&Y,&offset,&roffset);
X***************
X*** 824,831 ****
X        search_Y = 1;
X      } else search_X++;
X      update_prompt(visible,6);
X!     if (find_buffer_text(visible,search_value_len,search_value,&search_X,&search_Y,&rY)) {
X!       set_win_hl(visible,FL_BOLD,search_X,search_X+search_value_len-1,search_Y);
X        goto_window(visible,rY);
X      } else 
X        set_win_hl(-1,0,-1,-1,-1);
X--- 1019,1027 ----
X        search_Y = 1;
X      } else search_X++;
X      update_prompt(visible,6);
X!     if (find_buffer_text(visible,search_value_len,search_value,
X! 			 &search_X,&search_Y,&rY,&mlen)) {
X!       set_win_hl(visible,FL_BOLD,search_X,search_X+mlen-1,search_Y);
X        goto_window(visible,rY);
X      } else 
X        set_win_hl(-1,0,-1,-1,-1);
X***************
X*** 833,851 ****
X      key_group = G_GOTO;
X      if (goto_value_len < MAX_GOTO) 
X        goto_value[goto_value_len++] = c;
X-   } else if (&key_gerase == pos) {
X-    goto_value_len = 0;
X-    key_group = G_PAGER; /* not necessary correct group !! */
X-   } else if (&key_gdel == pos) {
X-     if (goto_value_len > 0)
X-       goto_value_len--;
X-     if (0 == goto_value_len)
X-       key_group = G_PAGER; /* not necessary correct group !! */
X    } else if (&key_genter == pos) {
X      int value = string_value(goto_value_len,goto_value);
X      goto_window(visible,value);
X      goto_value_len = 0;
X!     key_group = G_PAGER; /* not necessary correct group !! */
X    } else if (&key_gpercnt == pos) {
X      int len = window_rlines(visible);
X      int value = string_value(goto_value_len,goto_value);
X--- 1029,1040 ----
X      key_group = G_GOTO;
X      if (goto_value_len < MAX_GOTO) 
X        goto_value[goto_value_len++] = c;
X    } else if (&key_genter == pos) {
X      int value = string_value(goto_value_len,goto_value);
X      goto_window(visible,value);
X      goto_value_len = 0;
X!     /* not necessary correct group !! */
X!     key_group = have_error ? G_MESSAGE : G_PAGER; 
X    } else if (&key_gpercnt == pos) {
X      int len = window_rlines(visible);
X      int value = string_value(goto_value_len,goto_value);
X***************
X*** 853,859 ****
X        if (0 == value) goto_window(visible,1);
X        else goto_window(visible,value*len/100);
X        goto_value_len = 0;
X!       key_group = G_PAGER; /* not necessary correct group !! */
X      }
X    } else if (&key_tab == pos) {
X      int tab, wrap;
X--- 1042,1049 ----
X        if (0 == value) goto_window(visible,1);
X        else goto_window(visible,value*len/100);
X        goto_value_len = 0;
X!       /* not necessary correct group !! */
X!       key_group = have_error ? G_MESSAGE : G_PAGER; 
X      }
X    } else if (&key_tab == pos) {
X      int tab, wrap;
X***************
X*** 872,877 ****
X--- 1062,1074 ----
X    } else if (&key_next == pos) {
X      if (have_error) clear_errors();
X      else get_next = 1;
X+   } else if (&key_forward == pos) {
X+     if (!have_error) {
X+       EOF_IN_FILE = 0;
X+       do_forwarding = 1;
X+     }
X+   } else if (&key_reread == pos) {
X+     if (!have_error) reread_file(&FP,&EOF_IN_FILE);
X    } else if (&key_page == pos) {
X      int prev,offset,Y,roffset;
X      for (window_pos(visible,&Y,&offset,&roffset),prev=roffset; 
X***************
X*** 886,894 ****
X--- 1083,1093 ----
X  	 window_pos(visible,&Y,&offset,&roffset))
X        scroll_window_R(visible); 
X    } else if (&key_help == pos) {
X+     key_group = G_MESSAGE;
X      map_errors();
X      help_page(WIN_ERROR);
X    } else if (&key_debug == pos) {
X+     key_group = G_MESSAGE;
X      map_errors();
X      debug_page(WIN_ERROR);
X    } else if(&key_redraw == pos) {
X***************
X*** 1005,1011 ****
X      FD_SET(terminal,&readfs);
X  #endif
X  
X!     if (-1 != FP) {
X  #ifdef _HPUX_SOURCE
X        readfs |= 1 << FP;
X  #else
X--- 1204,1210 ----
X      FD_SET(terminal,&readfs);
X  #endif
X  
X!     if (-1 != FP && !EOF_IN_FILE) {
X  #ifdef _HPUX_SOURCE
X        readfs |= 1 << FP;
X  #else
X***************
X*** 1135,1140 ****
X--- 1334,1340 ----
X  	  else if (0 == strcmp("-A",*arg_vec)) map = MAP_ASCII;
X  	  else if (0 == strcmp("-L",*arg_vec)) map = MAP_LATIN1;
X  	  else if (0 == strcmp("-L1",*arg_vec)) map = MAP_LATIN1;
X+ 	  else if (0 == strcmp("-L2",*arg_vec)) map = MAP_LATIN2;
X  	  else if (0 == strcmp("-L4",*arg_vec)) map = MAP_LATIN4;
X  	  else if (0 == strcmp("-L5",*arg_vec)) map = MAP_LATIN5;
X  	  else if (0 == strcmp("-M",*arg_vec)) map = MAP_MULTINATIONAL;
X***************
X*** 1142,1147 ****
X--- 1342,1350 ----
X  	  else if (0 == strcmp("-UK",*arg_vec)) map = MAP_UK;
X  	  else if (0 == strcmp("-NR",*arg_vec)) map = MAP_NOR;
X  	  else if (0 == strcmp("-SW",*arg_vec)) map = MAP_SWE;
X+ 	  else if (0 == strcmp("-FR",*arg_vec)) map = MAP_BEL;
X+ 	  else if (0 == strcmp("-CA",*arg_vec)) map = MAP_CAN;
X+ 	  else if (0 == strcmp("-GR",*arg_vec)) map = MAP_GER;
X  	  else if (0 == strcmp("-t",*arg_vec)) enable_tab = 0;
X  	  else if (0 == strcmp("-t+",*arg_vec)) enable_tab = 1;
X  	  else if (0 == strcmp("-b",*arg_vec)) interpret_bs = 0;
X***************
X*** 1157,1162 ****
X--- 1360,1367 ----
X  	    help_page(WIN_TEXT);
X  	    arg_vec++;
X  	    auto_input = 0;
X+ 	    if (-1 != FP) close_file(&FP);
X+ 	    EOF_IN_FILE = 1;
X  	    break;
X  	  } else if (0 == strcmp("-DS",*arg_vec)) {
X  	    set_window_status(WIN_TEXT,enable_tab,enable_wrapping);
X***************
X*** 1163,1168 ****
X--- 1368,1375 ----
X  	    debug_page(WIN_TEXT);
X  	    arg_vec++;
X  	    auto_input = 0;
X+ 	    if (-1 != FP) close_file(&FP);
SHAR_EOF
echo "End of part 2, continue with part 3"
echo "3" > s2_seq_.tmp
exit 0
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads