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)  

keymap.c
Go to the documentation of this file.
1 /*
2  * Project : tin - a Usenet reader
3  * Module : keymap.c
4  * Author : D. Nimmich, J. Faultless
5  * Created : 2000-05-25
6  * Updated : 2019-06-05
7  * Notes : This file contains key mapping routines and variables.
8  *
9  * Copyright (c) 2000-2020 Dirk Nimmich <nimmich@muenster.de>
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 #ifndef TIN_H
41 # include "tin.h"
42 #endif /* !TIN_H */
43 #ifndef VERSION_H
44 # include "version.h"
45 #endif /* !VERSION_H */
46 
47 /*
48  * local prototypes
49  */
50 static void add_default_key(struct keylist *key_list, const char *keys, t_function func);
51 static void add_global_keys(struct keylist *keys);
52 static void free_keylist(struct keylist *keys);
53 static void upgrade_keymap_file(char *old);
54 static t_bool process_keys(t_function func, const char *keys, struct keylist *kl);
55 static t_bool process_mapping(char *keyname, char *keys);
56 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
57  static t_bool add_key(struct keylist *keys, const wchar_t key, t_function func, t_bool override);
58 #else
59  static t_bool add_key(struct keylist *keys, const char key, t_function func, t_bool override);
60 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
61 
62 struct keylist attachment_keys = { NULL, 0, 0};
63 struct keylist feed_post_process_keys = { NULL, 0, 0 };
64 struct keylist feed_supersede_article_keys = { NULL, 0, 0 };
65 struct keylist feed_type_keys = { NULL, 0, 0 };
66 struct keylist filter_keys = { NULL, 0, 0 };
67 struct keylist group_keys = { NULL, 0, 0 };
68 struct keylist info_keys = { NULL, 0, 0 };
69 struct keylist option_menu_keys = { NULL, 0, 0 };
70 struct keylist page_keys = { NULL, 0, 0 };
71 #ifdef HAVE_PGP_GPG
72  struct keylist pgp_mail_keys = { NULL, 0, 0 };
73  struct keylist pgp_news_keys = { NULL, 0, 0 };
74 #endif /* HAVE_PGP_GPG */
75 struct keylist post_cancel_keys = { NULL, 0, 0 };
76 struct keylist post_continue_keys = { NULL, 0, 0 };
77 struct keylist post_delete_keys = { NULL, 0, 0 };
78 struct keylist post_edit_keys = { NULL, 0, 0 };
79 struct keylist post_edit_ext_keys = { NULL, 0, 0 };
80 struct keylist post_ignore_fupto_keys = { NULL, 0, 0 };
81 struct keylist post_mail_fup_keys = { NULL, 0, 0 };
82 struct keylist post_post_keys = { NULL, 0, 0 };
83 struct keylist post_postpone_keys = { NULL, 0, 0 };
84 struct keylist post_send_keys = { NULL, 0, 0 };
85 struct keylist prompt_keys = { NULL, 0, 0 };
86 struct keylist save_append_overwrite_keys = { NULL, 0, 0 };
87 struct keylist scope_keys = { NULL, 0, 0 };
88 struct keylist select_keys = { NULL, 0, 0 };
89 struct keylist thread_keys = { NULL, 0, 0 };
90 struct keylist url_keys = { NULL, 0, 0 };
91 
92 
93 /*
94  * lookup the associated function to the specified key
95  */
98 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
99  const wchar_t key,
100 #else
101  const char key,
102 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
103  const struct keylist keys)
104 {
105  size_t i;
106 
107  for (i = 0; i < keys.used; i++) {
108  if (keys.list[i].key == key)
109  return keys.list[i].function;
110  }
111 
112  return NOT_ASSIGNED;
113 }
114 
115 
116 /*
117  * lookup the associated key to the specified function
118  */
119 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
120 wchar_t
121 #else
122 char
123 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
125  t_function func,
126  const struct keylist keys)
127 {
128  size_t i;
129 
130  for (i = 0; i < keys.used; i++) {
131  if (keys.list[i].function == func)
132  return keys.list[i].key;
133  }
134 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
135  return (wchar_t) '?';
136 #else
137  return '?';
138 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
139 }
140 
141 
142 /*
143  * adds a key to a keylist
144  * default_key: TRUE if a default key should be added
145  * returns TRUE if the key was successfully added else FALSE
146  */
147 static t_bool
149  struct keylist *keys,
150 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
151  const wchar_t key,
152 #else
153  const char key,
154 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
155  t_function func,
156  t_bool override)
157 {
158  size_t i;
159  struct keynode *entry = NULL;
160 
161  /* is a function already associated with this key */
162  for (i = 0; key != '\0' && i < keys->used; i++) {
163  if (keys->list[i].key == key)
164  entry = &keys->list[i];
165  }
166 
167  if (entry != NULL) {
168  if (override) {
169  entry->function = func;
170  return TRUE;
171  } else
172  return FALSE;
173  } else {
174  /* add a new entry */
175  if (keys->used >= keys->max) {
176  if (keys->list == NULL) {
177  keys->max = DEFAULT_MAPKEYS_NUM;
178  keys->list = my_malloc(keys->max * sizeof(struct keynode));
179  } else {
180  keys->max++;
181  keys->list = my_realloc(keys->list, keys->max * sizeof(struct keynode));
182  }
183  }
184  keys->list[keys->used].key = key;
185  keys->list[keys->used].function = func;
186  keys->used++;
187 
188  return TRUE;
189  }
190 }
191 
192 
193 /*
194  * FIXME:
195  * as long as we use only ASCII for default keys no need to change 'keys' to wchar_t
196  */
197 static void
199  struct keylist *key_list,
200  const char *keys,
201  t_function func)
202 {
203  const char *key = keys;
204  /* check if the function has already a key assigned before we add the default one */
205  if (func_to_key(func, *key_list) != '?')
206  return;
207 
208  for (; *key != '\0'; key++)
209 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
210  add_key(key_list, (wchar_t) *key, func, FALSE);
211 #else
212  add_key(key_list, *key, func, FALSE);
213 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
214 }
215 
216 
217 static void
219  struct keylist *keys)
220 {
221  FreeAndNull(keys->list);
222  keys->used = keys->max = 0;
223 }
224 
225 
226 /*
227  * Free all memory for keymaps.
228  */
229 void
231  void)
232 {
251 #ifdef HAVE_PGP_GPG
252  free_keylist(&pgp_mail_keys);
253  free_keylist(&pgp_news_keys);
254 #endif /* HAVE_PGP_GPG */
262 }
263 
264 
265 /*
266  * Render ch in human readable ASCII
267  * Is there no lib function to do this ?
268  * *buf must have a size of at least MAXKEYLEN
269  */
270 char *
272  char *buf,
273 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
274  wint_t ch)
275 #else
276  int ch)
277 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
278 {
279  if (ch == 0)
280  snprintf(buf, MAXKEYLEN, "%s", _("NULL"));
281 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
282  else if (iswgraph(ch)) { /* Regular printables */
283  int i = wctomb(buf, ch);
284 
285  if (i > 0)
286  buf[i] = '\0';
287  else
288  buf[0] = '\0';
289  }
290 #else
291  else if (isgraph(ch)) { /* Regular printables */
292  buf[0] = ch;
293  buf[1] = '\0';
294  }
295 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
296  else if (ch == '\t') { /* TAB */
297  snprintf(buf, MAXKEYLEN, "%s", _(txt_tab));
298  } else if ((ch == '\n') || (ch == '\r')) { /* LF, CR */
299  snprintf(buf, MAXKEYLEN, "%s", _(txt_cr));
300  } else if (ch == ESC) { /* Escape */
301  snprintf(buf, MAXKEYLEN, "%s", _(txt_esc));
302 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
303  } else if (iswcntrl(ch)) { /* Control keys */
304 #else
305  } else if (iscntrl(ch)) { /* Control keys */
306 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
307  buf[0] = '^';
308  buf[1] = ((int) ch & 0xFF) + '@';
309  buf[2] = '\0';
310  } else if (ch == ' ') /* SPACE */
311  snprintf(buf, MAXKEYLEN, "%s", _(txt_space));
312  else
313  strcpy(buf, "???"); /* Never happens? */
314 
315  return buf;
316 }
317 
318 
319 #define KEYSEPS " \t\n"
320 /*
321  * read the keymap file
322  * returns TRUE if the keymap file was read without an error else FALSE
323  */
324 t_bool
326  void)
327 {
328  FILE *fp = (FILE *) 0;
329  char *line, *keydef, *kname;
330  char *map, *ptr;
331  char buf[LEN], buff[NAME_LEN + 1], filename[PATH_LEN];
332  struct t_version *upgrade = NULL;
333  t_bool ret = TRUE;
334 
335  /*
336  * checks TIN_HOMEDIR/HOME/TIN_DEFAULTS_DIR
337  * for KEYMAP_FILE."locale" or KEYMAP_FILE
338  *
339  * locale is first match from LC_ALL, LC_CTYPE, LC_MESSAGES, LANG
340  *
341  * TODO: LC_CTYPE has higher priority than LC_MESSAGES, does this make sense?
342  */
343  /* get locale suffix */
344  map = my_strdup(get_val("LC_ALL", get_val("LC_CTYPE", get_val("LC_MESSAGES", get_val("LANG", "")))));
345  if (strlen(map)) {
346  if ((ptr = strchr(map, '.')))
347  *ptr = '\0';
348  snprintf(buff, sizeof(buff), "%s.%s", KEYMAP_FILE, map);
349  joinpath(filename, sizeof(filename), rcdir, buff);
350  fp = fopen(filename, "r");
351  }
352  if (!fp) {
353  joinpath(filename, sizeof(filename), rcdir, KEYMAP_FILE);
354  fp = fopen(filename, "r");
355  }
356 #ifdef TIN_DEFAULTS_DIR
357  if (strlen(map) && !fp) {
358  joinpath(filename, sizeof(filename), TIN_DEFAULTS_DIR, buff);
359  fp = fopen(filename, "r");
360  }
361  if (!fp) {
362  joinpath(filename, sizeof(filename), TIN_DEFAULTS_DIR, KEYMAP_FILE);
363  fp = fopen(filename, "r");
364  }
365 #endif /* TIN_DEFAULTS_DIR */
366 
367  FreeIfNeeded(map);
368 
369  if (!fp)
370  return TRUE; /* no keymap file is not an error */
371 
372  map = my_strdup(filename); /* remember keymap-name */
373 
374  /* check if keymap file is up-to-date */
375  while ((line = fgets(buf, sizeof(buf), fp)) != NULL) {
376  if (line[0] == '#') {
377  if (upgrade == NULL && match_string(buf, "# Keymap file V", NULL, 0)) {
378  /* TODO: keymap downgrade */
379  upgrade = check_upgrade(line, "# Keymap file V", KEYMAP_VERSION);
380  if (upgrade->state == RC_UPGRADE) {
381  fclose(fp);
382  upgrade_keymap_file(map);
383  upgrade->state = RC_IGNORE;
384  if (!(fp = fopen(map, "r"))) { /* TODO: issue error message? */
385  free(map);
386  FreeAndNull(upgrade);
387  return TRUE;
388  }
389  }
390  break;
391  }
392  }
393  }
394  rewind(fp);
395 
396  free_keymaps();
397  while ((line = fgets(buf, sizeof(buf), fp)) != NULL) {
398  /*
399  * Ignore blank and comment lines
400  */
401  if (line[0] == '#' || line[0] == '\n')
402  continue;
403 
404  if ((kname = strsep(&line, KEYSEPS)) != NULL) {
405  keydef = str_trim(line);
406  /*
407  * Warn about basic syntax errors
408  */
409  if (keydef == NULL || !strlen(keydef)) {
411  ret = FALSE;
412  continue;
413  }
414  } else
415  continue;
416 
417  /*
418  * TODO: useful? shared keymaps (NFS-Home) may differ
419  * depending on the OS (i.e. one tin has color the other has not)
420  */
421  if (!process_mapping(kname, keydef)) {
423  prompt_continue();
424  ret = FALSE;
425  continue;
426  }
427 
428  }
429  fclose(fp);
431  if (upgrade && upgrade->state != RC_IGNORE)
432  upgrade_prompt_quit(upgrade, map);
433 
434  free(map);
435  FreeAndNull(upgrade);
436  return ret;
437 }
438 
439 
440 /*
441  * associate the keys with the internal function and add them to the keylist
442  * returns TRUE if all keys could be recognized else FALSE
443  */
444 static t_bool
446  t_function func,
447  const char *keys,
448  struct keylist *kl)
449 {
450  char *keydef, *tmp;
451  t_bool error, ret = TRUE;
452 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
453  wchar_t *wkeydef;
454  wchar_t key = '\0';
455 #else
456  char key = '\0';
457 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
458 
459  tmp = my_strdup(keys); /* don't change "keys" */
460  keydef = strtok(tmp, KEYSEPS);
461 
462  while (keydef != NULL) {
463  error = FALSE;
464 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
465  if ((wkeydef = char2wchar_t(keydef)) == NULL) {
466  error_message(1, _(txt_invalid_multibyte_sequence));
467  ret = FALSE;
468 
469  keydef = strtok(NULL, KEYSEPS);
470  continue;
471  }
472 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
473 
474  /*
475  * Parse the key sequence into 'key'
476  * Special sequences are:
477  * ^A -> control chars
478  * TAB -> ^I
479  * SPACE -> ' '
480  */
481 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
482  if (wcslen(wkeydef) > 1) {
483  switch (wkeydef[0]) /* Only test 1st char - crude but effective */
484 #else
485  if (strlen(keydef) > 1) {
486  switch (keydef[0]) /* Only test 1st char - crude but effective */
487 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
488  {
489  case 'N':
490  key = '\0';
491  break;
492 
493  case 'S':
494  key = ' ';
495  break;
496 
497  case 'T':
498  key = ctrl('I');
499  break;
500 
501  case '^':
502 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
503  /* allow only ^A to ^Z */
504  if (wkeydef[1] >= 'A' && wkeydef[1] <= 'Z') {
505  key = ctrl(wkeydef[1]);
506  break;
507  }
508 #else
509  if (isupper((int)(unsigned char) keydef[1])) {
510  key = ctrl(keydef[1]);
511  break;
512  }
513 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
514  /* FALLTHROUGH */
515  default:
517  ret = FALSE;
518  error = TRUE;
519  break;
520  }
521  } else {
522 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
523  if (iswdigit(key = wkeydef[0]))
524 #else
525  if (isdigit(key = keydef[0]))
526 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
527  {
529  ret = FALSE;
530  error = TRUE;
531  }
532  }
533 
534  if (!error)
535  add_key(kl, key, func, TRUE);
536 
537  keydef = strtok(NULL, KEYSEPS);
538 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
539  FreeIfNeeded(wkeydef);
540 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
541  }
542  free(tmp);
543 
544  return ret;
545 }
546 
547 
548 /*
549  * map a keyname to the internal function name and assign the keys
550  * returns TRUE if a mapping was found else FALSE
551  */
552 static t_bool
554  char *keyname, /* Keyname we're searching for */
555  char *keys) /* Key to assign to keyname if found */
556 {
557  switch (keyname[0]) {
558  case 'A':
559  if (strcmp(keyname, "AttachPipe") == 0) {
561 
562  return TRUE;
563  }
564  if (strcmp(keyname, "AttachSelect") == 0) {
566 
567  return TRUE;
568  }
569  if (strcmp(keyname, "AttachSave") == 0) {
571 
572  return TRUE;
573  }
574  if (strcmp(keyname, "AttachTag") == 0) {
576 
577  return TRUE;
578  }
579  if (strcmp(keyname, "AttachTagPattern") == 0) {
581 
582  return TRUE;
583  }
584  if (strcmp(keyname, "AttachToggleTagged") == 0) {
586 
587  return TRUE;
588  }
589  if (strcmp(keyname, "AttachUntag") == 0) {
591 
592  return TRUE;
593  }
594  break;
595 
596  case 'B':
597  if (strcmp(keyname, "BugReport") == 0) {
603 
604  return TRUE;
605  }
606  break;
607 
608  case 'C':
609  if (strcmp(keyname, "Catchup") == 0) {
611  process_keys(CATCHUP, keys, &page_keys);
614 
615  return TRUE;
616  }
617  if (strcmp(keyname, "CatchupNextUnread") == 0) {
622 
623  return TRUE;
624  }
625  if (strcmp(keyname, "ConfigFirstPage") == 0) {
627 
628  return TRUE;
629  }
630  if (strcmp(keyname, "ConfigLastPage") == 0) {
632 
633  return TRUE;
634  }
635  if (strcmp(keyname, "ConfigNoSave") == 0) {
637 
638  return TRUE;
639  }
640  if (strcmp(keyname, "ConfigResetAttrib") == 0) {
642 
643  return TRUE;
644  }
645  if (strcmp(keyname, "ConfigScopeMenu") == 0) {
647 
648  return TRUE;
649  }
650  if (strcmp(keyname, "ConfigSelect") == 0) {
652 
653  return TRUE;
654  }
655  if (strcmp(keyname, "ConfigToggleAttrib") == 0) {
657 
658  return TRUE;
659  }
660  break;
661 
662  case 'D':
663  if (strcmp(keyname, "DisplayPostHist") == 0) {
668 
669  return TRUE;
670  }
671  if (strcmp(keyname, "Down") == 0) {
681 
682  return TRUE;
683  }
684  break;
685 
686  case 'E':
687  if (strcmp(keyname, "EditFilter") == 0) {
692 
693  return TRUE;
694  }
695  break;
696 
697  case 'F':
698  if (strcmp(keyname, "FeedArt") == 0) {
700 
701  return TRUE;
702  }
703  if (strcmp(keyname, "FeedHot") == 0) {
705 
706  return TRUE;
707  }
708  if (strcmp(keyname, "FeedPat") == 0) {
710 
711  return TRUE;
712  }
713  if (strcmp(keyname, "FeedRange") == 0) {
715 
716  return TRUE;
717  }
718  if (strcmp(keyname, "FeedRepost") == 0) {
720 
721  return TRUE;
722  }
723  if (strcmp(keyname, "FeedSupersede") == 0) {
725 
726  return TRUE;
727  }
728  if (strcmp(keyname, "FeedTag") == 0) {
730 
731  return TRUE;
732  }
733  if (strcmp(keyname, "FeedThd") == 0) {
735 
736  return TRUE;
737  }
738  if (strcmp(keyname, "FilterEdit") == 0) {
740 
741  return TRUE;
742  }
743  if (strcmp(keyname, "FilterSave") == 0) {
745 
746  return TRUE;
747  }
748  if (strcmp(keyname, "FirstPage") == 0) {
758 
759  return TRUE;
760  }
761  break;
762 
763  case 'G':
764  if (strcmp(keyname, "GroupAutoSave") == 0) {
766 
767  return TRUE;
768  }
769  if (strcmp(keyname, "GroupCancel") == 0) {
771 
772  return TRUE;
773  }
774  if (strcmp(keyname, "GroupDoAutoSel") == 0) {
776 
777  return TRUE;
778  }
779  if (strcmp(keyname, "GroupGoto") == 0) {
781 
782  return TRUE;
783  }
784  if (strcmp(keyname, "GroupListThd") == 0) {
786 
787  return TRUE;
788  }
789  if (strcmp(keyname, "GroupMail") == 0) {
791 
792  return TRUE;
793  }
794  if (strcmp(keyname, "GroupMarkThdRead") == 0) {
796 
797  return TRUE;
798  }
799  if (strcmp(keyname, "GroupMarkUnselArtRead") == 0) {
801 
802  return TRUE;
803  }
804  if (strcmp(keyname, "GroupNextGroup") == 0) {
806 
807  return TRUE;
808  }
809  if (strcmp(keyname, "GroupNextUnreadArt") == 0) {
811 
812  return TRUE;
813  }
814  if (strcmp(keyname, "GroupNextUnreadArtOrGrp") == 0) {
816 
817  return TRUE;
818  }
819  if (strcmp(keyname, "GroupPrevGroup") == 0) {
821 
822  return TRUE;
823  }
824  if (strcmp(keyname, "GroupPrevUnreadArt") == 0) {
826 
827  return TRUE;
828  }
829  if (strcmp(keyname, "GroupReadBasenote") == 0) {
831 
832  return TRUE;
833  }
834  if (strcmp(keyname, "GroupRepost") == 0) {
836 
837  return TRUE;
838  }
839  if (strcmp(keyname, "GroupReverseSel") == 0) {
841 
842  return TRUE;
843  }
844  if (strcmp(keyname, "GroupSave") == 0) {
846 
847  return TRUE;
848  }
849  if (strcmp(keyname, "GroupSelPattern") == 0) {
851 
852  return TRUE;
853  }
854  if (strcmp(keyname, "GroupSelThd") == 0) {
856 
857  return TRUE;
858  }
859  if (strcmp(keyname, "GroupSelThdIfUnreadSelected") == 0) {
861 
862  return TRUE;
863  }
864  if (strcmp(keyname, "GroupTag") == 0) {
866 
867  return TRUE;
868  }
869  if (strcmp(keyname, "GroupTagParts") == 0) {
871 
872  return TRUE;
873  }
874  if (strcmp(keyname, "GroupToggleGetartLimit") == 0) {
876 
877  return TRUE;
878  }
879  if (strcmp(keyname, "GroupToggleReadUnread") == 0) {
881 
882  return TRUE;
883  }
884  if (strcmp(keyname, "GroupToggleSubjDisplay") == 0) {
886 
887  return TRUE;
888  }
889  if (strcmp(keyname, "GroupToggleThdSel") == 0) {
891 
892  return TRUE;
893  }
894  if (strcmp(keyname, "GroupToggleThreading") == 0) {
896 
897  return TRUE;
898  }
899  if (strcmp(keyname, "GroupUndoSel") == 0) {
901 
902  return TRUE;
903  }
904  if (strcmp(keyname, "GroupUntag") == 0) {
906 
907  return TRUE;
908  }
909  break;
910 
911  case 'H':
912  if (strcmp(keyname, "Help") == 0) {
921 
922  return TRUE;
923  }
924  if (strcmp(keyname, "HelpFirstPage") == 0) {
926 
927  return TRUE;
928  }
929  if (strcmp(keyname, "HelpLastPage") == 0) {
931 
932  return TRUE;
933  }
934  break;
935 
936  case 'L':
937  if (strcmp(keyname, "LastPage") == 0) {
947 
948  return TRUE;
949  }
950  if (strcmp(keyname, "LastViewed") == 0) {
954 
955  return TRUE;
956  }
957  if (strcmp(keyname, "LookupMessage") == 0) {
960 #ifdef NNTP_ABLE
962 #endif /* NNTP_ABLE */
964 
965  return TRUE;
966  }
967  break;
968 
969  case 'M':
970  if (strcmp(keyname, "MarkArticleUnread") == 0) {
974 
975  return TRUE;
976  }
977  if (strcmp(keyname, "MarkThreadUnread") == 0) {
981 
982  return TRUE;
983  }
984  if (strcmp(keyname, "MarkFeedRead") == 0) {
987 
988  return TRUE;
989  }
990  if (strcmp(keyname, "MarkFeedUnread") == 0) {
993 
994  return TRUE;
995  }
996  if (strcmp(keyname, "MenuFilterKill") == 0) {
1000 
1001  return TRUE;
1002  }
1003  if (strcmp(keyname, "MenuFilterSelect") == 0) {
1007 
1008  return TRUE;
1009  }
1010  break;
1011 
1012  case 'O':
1013  if (strcmp(keyname, "OptionMenu") == 0) {
1020 
1021  return TRUE;
1022  }
1023  break;
1024 
1025  case 'P':
1026  if (strcmp(keyname, "PageAutoSave") == 0) {
1028 
1029  return TRUE;
1030  }
1031  if (strcmp(keyname, "PageBotThd") == 0) {
1033 
1034  return TRUE;
1035  }
1036  if (strcmp(keyname, "PageCancel") == 0) {
1038 
1039  return TRUE;
1040  }
1041  if (strcmp(keyname, "PageDown") == 0) {
1051 
1052  return TRUE;
1053  }
1054  if (strcmp(keyname, "PageEditArticle") == 0) {
1056 
1057  return TRUE;
1058  }
1059  if (strcmp(keyname, "PageFirstPage") == 0) {
1061 
1062  return TRUE;
1063  }
1064  if (strcmp(keyname, "PageFollowup") == 0) {
1066 
1067  return TRUE;
1068  }
1069  if (strcmp(keyname, "PageFollowupQuote") == 0) {
1071 
1072  return TRUE;
1073  }
1074  if (strcmp(keyname, "PageFollowupQuoteHeaders") == 0) {
1076 
1077  return TRUE;
1078  }
1079  if (strcmp(keyname, "PageGotoParent") == 0) {
1081 
1082  return TRUE;
1083  }
1084  if (strcmp(keyname, "PageGroupSel") == 0) {
1086 
1087  return TRUE;
1088  }
1089  if (strcmp(keyname, "PageLastPage") == 0) {
1091 
1092  return TRUE;
1093  }
1094  if (strcmp(keyname, "PageListThd") == 0) {
1096 
1097  return TRUE;
1098  }
1099  if (strcmp(keyname, "PageKillThd") == 0) {
1101 
1102  return TRUE;
1103  }
1104  if (strcmp(keyname, "PageMail") == 0) {
1105  process_keys(PAGE_MAIL, keys, &page_keys);
1106 
1107  return TRUE;
1108  }
1109  if (strcmp(keyname, "PageNextArt") == 0) {
1111 
1112  return TRUE;
1113  }
1114  if (strcmp(keyname, "PageNextThd") == 0) {
1116 
1117  return TRUE;
1118  }
1119  if (strcmp(keyname, "PageNextUnread") == 0) {
1121 
1122  return TRUE;
1123  }
1124  if (strcmp(keyname, "PageNextUnreadArt") == 0) {
1126 
1127  return TRUE;
1128  }
1129  if (strcmp(keyname, "PagePGPCheckArticle") == 0) {
1130 #ifdef HAVE_PGP_GPG
1131  process_keys(PAGE_PGP_CHECK_ARTICLE, keys, &page_keys);
1132 #endif /* HAVE_PGP_GPG */
1133 
1134  return TRUE;
1135  }
1136  if (strcmp(keyname, "PagePrevArt") == 0) {
1138 
1139  return TRUE;
1140  }
1141  if (strcmp(keyname, "PagePrevUnreadArt") == 0) {
1143 
1144  return TRUE;
1145  }
1146  if (strcmp(keyname, "PageReply") == 0) {
1148 
1149  return TRUE;
1150  }
1151  if (strcmp(keyname, "PageReplyQuote") == 0) {
1153 
1154  return TRUE;
1155  }
1156  if (strcmp(keyname, "PageReplyQuoteHeaders") == 0) {
1158 
1159  return TRUE;
1160  }
1161  if (strcmp(keyname, "PageRepost") == 0) {
1163 
1164  return TRUE;
1165  }
1166  if (strcmp(keyname, "PageReveal") == 0) {
1168 
1169  return TRUE;
1170  }
1171  if (strcmp(keyname, "PageSave") == 0) {
1172  process_keys(PAGE_SAVE, keys, &page_keys);
1173 
1174  return TRUE;
1175  }
1176  if (strcmp(keyname, "PageSkipIncludedText") == 0) {
1178 
1179  return TRUE;
1180  }
1181  if (strcmp(keyname, "PageTag") == 0) {
1182  process_keys(PAGE_TAG, keys, &page_keys);
1183 
1184  return TRUE;
1185  }
1186  if (strcmp(keyname, "PageTopThd") == 0) {
1188 
1189  return TRUE;
1190  }
1191  if (strcmp(keyname, "PageToggleAllHeaders") == 0) {
1193 
1194  return TRUE;
1195  }
1196  if (strcmp(keyname, "PageToggleHighlight") == 0) {
1198 
1199  return TRUE;
1200  }
1201  if (strcmp(keyname, "PageToggleRaw") == 0) {
1203 
1204  return TRUE;
1205  }
1206  if (strcmp(keyname, "PageToggleRot") == 0) {
1208 
1209  return TRUE;
1210  }
1211  if (strcmp(keyname, "PageToggleTabs") == 0) {
1213 
1214  return TRUE;
1215  }
1216  if (strcmp(keyname, "PageToggleTex2iso") == 0) {
1218 
1219  return TRUE;
1220  }
1221  if (strcmp(keyname, "PageToggleUue") == 0) {
1223 
1224  return TRUE;
1225  }
1226  if (strcmp(keyname, "PageUp") == 0) {
1236 
1237  return TRUE;
1238  }
1239  if (strcmp(keyname, "PageViewAttach") == 0) {
1241 
1242  return TRUE;
1243  }
1244  if (strcmp(keyname, "PageViewUrl") == 0) {
1246 
1247  return TRUE;
1248  }
1249  if (strcmp(keyname, "PgpEncrypt") == 0) {
1250 #ifdef HAVE_PGP_GPG
1251  process_keys(PGP_KEY_ENCRYPT, keys, &pgp_mail_keys);
1252 #endif /* HAVE_PGP_GPG */
1253 
1254  return TRUE;
1255  }
1256  if (strcmp(keyname, "PgpEncSign") == 0) {
1257 #ifdef HAVE_PGP_GPG
1258  process_keys(PGP_KEY_ENCRYPT_SIGN, keys, &pgp_mail_keys);
1259 #endif /* HAVE_PGP_GPG */
1260 
1261  return TRUE;
1262  }
1263  if (strcmp(keyname, "PgpIncludekey") == 0) {
1264 #ifdef HAVE_PGP_GPG
1265  process_keys(PGP_INCLUDE_KEY, keys, &pgp_news_keys);
1266 #endif /* HAVE_PGP_GPG */
1267 
1268  return TRUE;
1269  }
1270  if (strcmp(keyname, "PgpSign") == 0) {
1271 #ifdef HAVE_PGP_GPG
1272  process_keys(PGP_KEY_SIGN, keys, &pgp_news_keys);
1273  process_keys(PGP_KEY_SIGN, keys, &pgp_mail_keys);
1274 #endif /* HAVE_PGP_GPG */
1275 
1276  return TRUE;
1277  }
1278  if (strcmp(keyname, "Pipe") == 0) {
1283 
1284  return TRUE;
1285  }
1286  if (strcmp(keyname, "Post") == 0) {
1294 
1295  return TRUE;
1296  }
1297  if (strcmp(keyname, "PostAbort") == 0) {
1299 
1300  return TRUE;
1301  }
1302  if (strcmp(keyname, "PostCancel") == 0) {
1305 
1306  return TRUE;
1307  }
1308  if (strcmp(keyname, "PostContinue") == 0) {
1310 
1311  return TRUE;
1312  }
1313  if (strcmp(keyname, "PostEdit") == 0) {
1319 
1320  return TRUE;
1321  }
1322  if (strcmp(keyname, "PostIgnore") == 0) {
1324 
1325  return TRUE;
1326  }
1327  if (strcmp(keyname, "PostIspell") == 0) {
1328 #ifdef HAVE_ISPELL
1329  process_keys(POST_ISPELL, keys, &post_post_keys);
1330  process_keys(POST_ISPELL, keys, &post_send_keys);
1331 #endif /* HAVE_ISPELL */
1332 
1333  return TRUE;
1334  }
1335  if (strcmp(keyname, "PostMail") == 0) {
1337 
1338  return TRUE;
1339  }
1340  if (strcmp(keyname, "PostPGP") == 0) {
1341 #ifdef HAVE_PGP_GPG
1342  process_keys(POST_PGP, keys, &post_post_keys);
1343  process_keys(POST_PGP, keys, &post_send_keys);
1344 #endif /* HAVE_PGP_GPG */
1345 
1346  return TRUE;
1347  }
1348  if (strcmp(keyname, "PostponeAll") == 0) {
1350 
1351  return TRUE;
1352  }
1353  if (strcmp(keyname, "Postponed") == 0) {
1358 
1359  return TRUE;
1360  }
1361  if (strcmp(keyname, "PostponeOverride") == 0) {
1363 
1364  return TRUE;
1365  }
1366  if (strcmp(keyname, "PostPost") == 0) {
1370 
1371  return TRUE;
1372  }
1373  if (strcmp(keyname, "PostPostpone") == 0) {
1376 
1377  return TRUE;
1378  }
1379  if (strcmp(keyname, "PostSend") == 0) {
1381 
1382  return TRUE;
1383  }
1384  if (strcmp(keyname, "PostSupersede") == 0) {
1386 
1387  return TRUE;
1388  }
1389  if (strcmp(keyname, "PProcNo") == 0) {
1391 
1392  return TRUE;
1393  }
1394  if (strcmp(keyname, "PProcShar") == 0) {
1396 
1397  return TRUE;
1398  }
1399  if (strcmp(keyname, "PProcYes") == 0) {
1401 
1402  return TRUE;
1403  }
1404  if (strcmp(keyname, "Print") == 0) {
1405 #ifndef DISABLE_PRINTING
1409 #endif /* !DISABLE_PRINTING */
1410 
1411  return TRUE;
1412  }
1413  if (strcmp(keyname, "PromptNo") == 0) {
1416 
1417  return TRUE;
1418  }
1419  if (strcmp(keyname, "PromptYes") == 0) {
1422 
1423  return TRUE;
1424  }
1425  break;
1426 
1427  case 'Q':
1428  if (strcmp(keyname, "QuickFilterKill") == 0) {
1431 
1432  return TRUE;
1433  }
1434  if (strcmp(keyname, "QuickFilterSelect") == 0) {
1437 
1438  return TRUE;
1439  }
1440  if (strcmp(keyname, "Quit") == 0) {
1450 #ifdef HAVE_PGP_GPG
1451  process_keys(GLOBAL_QUIT, keys, &pgp_mail_keys);
1452  process_keys(GLOBAL_QUIT, keys, &pgp_news_keys);
1453 #endif /* HAVE_PGP_GPG */
1470 
1471  return TRUE;
1472  }
1473  if (strcmp(keyname, "QuitTin") == 0) {
1478 
1479  return TRUE;
1480  }
1481  break;
1482 
1483  case 'R':
1484  if (strcmp(keyname, "RedrawScr") == 0) {
1492 
1493  return TRUE;
1494  }
1495  break;
1496 
1497  case 'S':
1498  if (strcmp(keyname, "SaveAppendFile") == 0) {
1500 
1501  return TRUE;
1502  }
1503  if (strcmp(keyname, "SaveOverwriteFile") == 0) {
1505 
1506  return TRUE;
1507  }
1508  if (strcmp(keyname, "ScopeAdd") == 0) {
1510 
1511  return TRUE;
1512  }
1513  if (strcmp(keyname, "ScopeDelete") == 0) {
1515 
1516  return TRUE;
1517  }
1518  if (strcmp(keyname, "ScopeEditAttributesFile") == 0) {
1520 
1521  return TRUE;
1522  }
1523  if (strcmp(keyname, "ScopeMove") == 0) {
1525 
1526  return TRUE;
1527  }
1528  if (strcmp(keyname, "ScopeRename") == 0) {
1530 
1531  return TRUE;
1532  }
1533  if (strcmp(keyname, "ScopeSelect") == 0) {
1535 
1536  return TRUE;
1537  }
1538  if (strcmp(keyname, "ScrollDown") == 0) {
1546 
1547  return TRUE;
1548  }
1549  if (strcmp(keyname, "ScrollUp") == 0) {
1557 
1558  return TRUE;
1559  }
1560  if (strcmp(keyname, "SearchAuthB") == 0) {
1564 
1565  return TRUE;
1566  }
1567  if (strcmp(keyname, "SearchAuthF") == 0) {
1571 
1572  return TRUE;
1573  }
1574  if (strcmp(keyname, "SearchBody") == 0) {
1578 
1579  return TRUE;
1580  }
1581  if (strcmp(keyname, "SearchRepeat") == 0) {
1590 
1591  return TRUE;
1592  }
1593  if (strcmp(keyname, "SearchSubjB") == 0) {
1602 
1603  return TRUE;
1604  }
1605  if (strcmp(keyname, "SearchSubjF") == 0) {
1614 
1615  return TRUE;
1616  }
1617  if (strcmp(keyname, "SelectEnterNextUnreadGrp") == 0) {
1619 
1620  return TRUE;
1621  }
1622  if (strcmp(keyname, "SelectGoto") == 0) {
1624 
1625  return TRUE;
1626  }
1627  if (strcmp(keyname, "SelectMarkGrpUnread") == 0) {
1629 
1630  return TRUE;
1631  }
1632  if (strcmp(keyname, "SelectMoveGrp") == 0) {
1634 
1635  return TRUE;
1636  }
1637  if (strcmp(keyname, "SelectNextUnreadGrp") == 0) {
1639 
1640  return TRUE;
1641  }
1642  if (strcmp(keyname, "SelectQuitNoWrite") == 0) {
1644 
1645  return TRUE;
1646  }
1647  if (strcmp(keyname, "SelectReadGrp") == 0) {
1649 
1650  return TRUE;
1651  }
1652  if (strcmp(keyname, "SelectResetNewsrc") == 0) {
1654 
1655  return TRUE;
1656  }
1657  if (strcmp(keyname, "SelectSortActive") == 0) {
1659 
1660  return TRUE;
1661  }
1662  if (strcmp(keyname, "SelectSubscribe") == 0) {
1664 
1665  return TRUE;
1666  }
1667  if (strcmp(keyname, "SelectSubscribePat") == 0) {
1669 
1670  return TRUE;
1671  }
1672  if (strcmp(keyname, "SelectSyncWithActive") == 0) {
1674 
1675  return TRUE;
1676  }
1677  if (strcmp(keyname, "SelectToggleDescriptions") == 0) {
1679 
1680  return TRUE;
1681  }
1682  if (strcmp(keyname, "SelectToggleReadDisplay") == 0) {
1684 
1685  return TRUE;
1686  }
1687  if (strcmp(keyname, "SelectUnsubscribe") == 0) {
1689 
1690  return TRUE;
1691  }
1692  if (strcmp(keyname, "SelectUnsubscribePat") == 0) {
1694 
1695  return TRUE;
1696  }
1697  if (strcmp(keyname, "SelectYankActive") == 0) {
1699 
1700  return TRUE;
1701  }
1702  if (strcmp(keyname, "SetRange") == 0) {
1706 
1707  return TRUE;
1708  }
1709  if (strcmp(keyname, "ShellEscape") == 0) {
1710 #ifndef NO_SHELL_ESCAPE
1719 #endif /* !NO_SHELL_ESCAPE */
1720 
1721  return TRUE;
1722  }
1723  break;
1724 
1725  case 'T':
1726  if (strcmp(keyname, "ThreadAutoSave") == 0) {
1728 
1729  return TRUE;
1730  }
1731  if (strcmp(keyname, "ThreadCancel") == 0) {
1733 
1734  return TRUE;
1735  }
1736  if (strcmp(keyname, "ThreadMail") == 0) {
1738 
1739  return TRUE;
1740  }
1741  if (strcmp(keyname, "ThreadMarkArtRead") == 0) {
1743 
1744  return TRUE;
1745  }
1746  if (strcmp(keyname, "ThreadReadArt") == 0) {
1748 
1749  return TRUE;
1750  }
1751  if (strcmp(keyname, "ThreadReadNextArtOrThread") == 0) {
1753 
1754  return TRUE;
1755  }
1756  if (strcmp(keyname, "ThreadReverseSel") == 0) {
1758 
1759  return TRUE;
1760  }
1761  if (strcmp(keyname, "ThreadSave") == 0) {
1763 
1764  return TRUE;
1765  }
1766  if (strcmp(keyname, "ThreadSelArt") == 0) {
1768 
1769  return TRUE;
1770  }
1771  if (strcmp(keyname, "ThreadTag") == 0) {
1773 
1774  return TRUE;
1775  }
1776  if (strcmp(keyname, "ThreadToggleArtSel") == 0) {
1778 
1779  return TRUE;
1780  }
1781  if (strcmp(keyname, "ThreadToggleSubjDisplay") == 0) {
1783 
1784  return TRUE;
1785  }
1786  if (strcmp(keyname, "ThreadUndoSel") == 0) {
1788 
1789  return TRUE;
1790  }
1791  if (strcmp(keyname, "ThreadUntag") == 0) {
1793 
1794  return TRUE;
1795  }
1796  if (strcmp(keyname, "ToggleColor") == 0) {
1797 #ifdef HAVE_COLOR
1798  process_keys(GLOBAL_TOGGLE_COLOR, keys, &group_keys);
1799  process_keys(GLOBAL_TOGGLE_COLOR, keys, &page_keys);
1800  process_keys(GLOBAL_TOGGLE_COLOR, keys, &select_keys);
1801  process_keys(GLOBAL_TOGGLE_COLOR, keys, &thread_keys);
1802 #endif /* HAVE_COLOR */
1803 
1804  return TRUE;
1805  }
1806  if (strcmp(keyname, "ToggleHelpDisplay") == 0) {
1814 
1815  return TRUE;
1816  }
1817  if (strcmp(keyname, "ToggleInfoLastLine") == 0) {
1823 
1824  return TRUE;
1825  }
1826  if (strcmp(keyname, "ToggleInverseVideo") == 0) {
1831 
1832  return TRUE;
1833  }
1834  break;
1835 
1836  case 'U':
1837  if (strcmp(keyname, "Up") == 0) {
1847 
1848  return TRUE;
1849  }
1850  if (strcmp(keyname, "UrlSelect") == 0) {
1851  process_keys(URL_SELECT, keys, &url_keys);
1852 
1853  return TRUE;
1854  }
1855  break;
1856 
1857  case 'V':
1858  if (strcmp(keyname, "Version") == 0) {
1863 
1864  return TRUE;
1865  }
1866  break;
1867 
1868  default:
1869  break;
1870  }
1871 
1872  return FALSE;
1873 }
1874 
1875 
1876 /*
1877  * upgrades the keymap file to the current version
1878  */
1879 static void
1881  char *old)
1882 {
1883  FILE *oldfp, *newfp;
1884  char *line, *backup;
1885  const char *keyname, *keydef;
1886  char newk[NAME_LEN + 1], buf[LEN];
1887  char *bugreport[3] = { NULL, NULL, NULL };
1888  char *catchup[4] = { NULL, NULL, NULL, NULL };
1889  char *catchup_next_unread[4] = { NULL, NULL, NULL, NULL };
1890  char *config_select[2] = { NULL, NULL };
1891  char *edit_filter[2] = { NULL, NULL };
1892  char *down[2] = { NULL, NULL };
1893  char *groupreadbasenote[2] = { NULL, NULL };
1894  char *mark_article_unread[3] = { NULL, NULL, NULL };
1895  char *mark_thread_unread[3] = { NULL, NULL, NULL };
1896  char *menu_filter_kill[3] = { NULL, NULL, NULL };
1897  char *menu_filter_select[3] = { NULL, NULL, NULL };
1898  char *pagedown[3] = { NULL, NULL, NULL };
1899  char *pagenextthd[2] = { NULL, NULL };
1900  char *pageup[3] = { NULL, NULL, NULL };
1901  char *postponed[2] = { NULL, NULL };
1902  char *postpost[3] = { NULL, NULL, NULL };
1903  char *postsend[2] = { NULL, NULL };
1904  char *quick_filter_kill[2] = { NULL, NULL };
1905  char *quick_filter_select[2] = { NULL, NULL };
1906  char *selectentergroup[2] = { NULL, NULL };
1907  char *selectmarkgrpunread[2] = { NULL, NULL };
1908  char *selectreadgrp[2] = { NULL, NULL };
1909  char *threadreadart[2] = { NULL, NULL };
1910  char *up[2] = { NULL, NULL };
1911 
1912  if ((oldfp = fopen(old, "r")) == NULL)
1913  return;
1914 
1915  snprintf(newk, sizeof(newk), "%s.%ld", old, (long) process_id);
1916  if ((newfp = fopen(newk, "w")) == NULL) {
1917  fclose(oldfp);
1918  return;
1919  }
1920  fprintf(newfp, "# Keymap file V%s for the TIN newsreader\n", KEYMAP_VERSION);
1921 
1922  forever {
1923  line = fgets(buf, sizeof(buf), oldfp);
1924 
1925  if (line == NULL || line[0] == '\n') {
1926  /*
1927  * we are at the end of a block or file
1928  * write out the merged lines (if available)
1929  */
1930  if (config_select[0] || config_select[1]) {
1931  fprintf(newfp, "ConfigSelect\t\t");
1932  if (config_select[0])
1933  fprintf(newfp, "\t%s", config_select[0]);
1934  if (config_select[1])
1935  fprintf(newfp, "\t%s", config_select[1]);
1936  fprintf(newfp, "\n");
1937  FreeAndNull(config_select[0]);
1938  FreeAndNull(config_select[1]);
1939  }
1940  if (down[0] || down[1]) {
1941  fprintf(newfp, "Down\t\t\t");
1942  if (down[0])
1943  fprintf(newfp, "\t%s", down[0]);
1944  if (down[1])
1945  fprintf(newfp, "\t%s", down[1]);
1946  fprintf(newfp, "\n");
1947  FreeAndNull(down[0]);
1948  FreeAndNull(down[1]);
1949  }
1950  if (groupreadbasenote[0] || groupreadbasenote[1]) {
1951  fprintf(newfp, "GroupReadBasenote\t");
1952  if (groupreadbasenote[0])
1953  fprintf(newfp, "\t%s", groupreadbasenote[0]);
1954  if (groupreadbasenote[1])
1955  fprintf(newfp, "\t%s", groupreadbasenote[1]);
1956  fprintf(newfp, "\n");
1957  FreeAndNull(groupreadbasenote[0]);
1958  FreeAndNull(groupreadbasenote[1]);
1959  }
1960  if (pagedown[0] || pagedown[1] || pagedown[2]) {
1961  fprintf(newfp, "PageDown\t\t");
1962  if (pagedown[0])
1963  fprintf(newfp, "\t%s", pagedown[0]);
1964  if (pagedown[1])
1965  fprintf(newfp, "\t%s", pagedown[1]);
1966  if (pagedown[2])
1967  fprintf(newfp, "\t%s", pagedown[2]);
1968  fprintf(newfp, "\n");
1969  FreeAndNull(pagedown[0]);
1970  FreeAndNull(pagedown[1]);
1971  FreeAndNull(pagedown[2]);
1972  }
1973  if (pagenextthd[0] || pagenextthd[1]) {
1974  fprintf(newfp, "PageNextThd\t\t");
1975  if (pagenextthd[0])
1976  fprintf(newfp, "\t%s", pagenextthd[0]);
1977  if (pagenextthd[1])
1978  fprintf(newfp, "\t%s", pagenextthd[1]);
1979  fprintf(newfp, "\n");
1980  FreeAndNull(pagenextthd[0]);
1981  FreeAndNull(pagenextthd[1]);
1982  }
1983  if (pageup[0] || pageup[1] || pageup[2]) {
1984  fprintf(newfp, "PageUp\t\t\t");
1985  if (pageup[0])
1986  fprintf(newfp, "\t%s", pageup[0]);
1987  if (pageup[1])
1988  fprintf(newfp, "\t%s", pageup[1]);
1989  if (pageup[2])
1990  fprintf(newfp, "\t%s", pageup[2]);
1991  fprintf(newfp, "\n");
1992  FreeAndNull(pageup[0]);
1993  FreeAndNull(pageup[1]);
1994  FreeAndNull(pageup[2]);
1995  }
1996  if (postponed[0] || postponed[1]) {
1997  fprintf(newfp, "Postponed\t\t");
1998  if (postponed[0])
1999  fprintf(newfp, "\t%s", postponed[0]);
2000  if (postponed[1])
2001  fprintf(newfp, "\t%s", postponed[1]);
2002  fprintf(newfp, "\n");
2003  FreeAndNull(postponed[0]);
2004  FreeAndNull(postponed[1]);
2005  }
2006  if (postpost[0] || postpost[1] || postpost[2]) {
2007  fprintf(newfp, "PostPost\t\t");
2008  if (postpost[0])
2009  fprintf(newfp, "\t%s", postpost[0]);
2010  if (postpost[1])
2011  fprintf(newfp, "\t%s", postpost[1]);
2012  if (postpost[2])
2013  fprintf(newfp, "\t%s", postpost[2]);
2014  fprintf(newfp, "\n");
2015  FreeAndNull(postpost[0]);
2016  FreeAndNull(postpost[1]);
2017  FreeAndNull(postpost[2]);
2018  }
2019  if (postsend[0] || postsend[1]) {
2020  fprintf(newfp, "PostSend\t\t");
2021  if (postsend[0])
2022  fprintf(newfp, "\t%s", postsend[0]);
2023  if (postsend[1])
2024  fprintf(newfp, "\t%s", postsend[1]);
2025  fprintf(newfp, "\n");
2026  FreeAndNull(postsend[0]);
2027  FreeAndNull(postsend[1]);
2028  }
2029  if (selectentergroup[0] || selectentergroup[1]) {
2030  fprintf(newfp, "SelectEnterNextUnreadGrp");
2031  if (selectentergroup[0])
2032  fprintf(newfp, "\t%s", selectentergroup[0]);
2033  if (selectentergroup[1])
2034  fprintf(newfp, "\t%s", selectentergroup[1]);
2035  fprintf(newfp, "\n");
2036  FreeAndNull(selectentergroup[0]);
2037  FreeAndNull(selectentergroup[1]);
2038  }
2039  if (selectmarkgrpunread[0] || selectmarkgrpunread[1]) {
2040  fprintf(newfp, "SelectMarkGrpUnread\t");
2041  if (selectmarkgrpunread[0])
2042  fprintf(newfp, "\t%s", selectmarkgrpunread[0]);
2043  if (selectmarkgrpunread[1])
2044  fprintf(newfp, "\t%s", selectmarkgrpunread[1]);
2045  fprintf(newfp, "\n");
2046  FreeAndNull(selectmarkgrpunread[0]);
2047  FreeAndNull(selectmarkgrpunread[1]);
2048  }
2049  if (selectreadgrp[0] || selectreadgrp[1]) {
2050  fprintf(newfp, "SelectReadGrp\t\t");
2051  if (selectreadgrp[0])
2052  fprintf(newfp, "\t%s", selectreadgrp[0]);
2053  if (selectreadgrp[1])
2054  fprintf(newfp, "\t%s", selectreadgrp[1]);
2055  fprintf(newfp, "\n");
2056  FreeAndNull(selectreadgrp[0]);
2057  FreeAndNull(selectreadgrp[1]);
2058  }
2059  if (threadreadart[0] || threadreadart[1]) {
2060  fprintf(newfp, "ThreadReadArt\t\t");
2061  if (threadreadart[0])
2062  fprintf(newfp, "\t%s", threadreadart[0]);
2063  if (threadreadart[1])
2064  fprintf(newfp, "\t%s", threadreadart[1]);
2065  fprintf(newfp, "\n");
2066  FreeAndNull(threadreadart[0]);
2067  FreeAndNull(threadreadart[1]);
2068  }
2069  if (up[0] || up[1]) {
2070  fprintf(newfp, "Up\t\t\t");
2071  if (up[0])
2072  fprintf(newfp, "\t%s", up[0]);
2073  if (up[1])
2074  fprintf(newfp, "\t%s", up[1]);
2075  fprintf(newfp, "\n");
2076  FreeAndNull(up[0]);
2077  FreeAndNull(up[1]);
2078  }
2079  if (line == NULL)
2080  break; /* jump out of the while loop */
2081  else {
2082  fprintf(newfp, "\n");
2083  continue;
2084  }
2085  }
2086 
2087  if (line[0] == '#') {
2088  if (strncmp(line, "# Keymap file V", strlen("# Keymap file V")) != 0)
2089  fprintf(newfp, "%s", line);
2090  continue;
2091  }
2092 
2093  backup = my_strdup(line);
2094 
2095  if ((keyname = strsep(&line, KEYSEPS)) == NULL) {
2096  free(backup);
2097  continue;
2098  }
2099  if ((keydef = str_trim(line)) == NULL)
2100  keydef = "";
2101 
2102  switch (keyname[0]) {
2103  case 'C':
2104  if (strcmp(keyname, "ConfigFirstPage2") == 0)
2105  fprintf(newfp, "ConfigFirstPage\t\t\t%s\n", keydef);
2106  else if (strcmp(keyname, "ConfigLastPage2") == 0)
2107  fprintf(newfp, "ConfigLastPage\t\t\t%s\n", keydef);
2108  else if (strcmp(keyname, "ConfigSelect") == 0)
2109  config_select[0] = my_strdup(keydef);
2110  else if (strcmp(keyname, "ConfigSelect2") == 0)
2111  config_select[1] = my_strdup(keydef);
2112  else
2113  fprintf(newfp, "%s", backup);
2114  break;
2115 
2116  case 'D':
2117  if (strcmp(keyname, "Down") == 0)
2118  down[0] = my_strdup(keydef);
2119  else if (strcmp(keyname, "Down2") == 0)
2120  down[1] = my_strdup(keydef);
2121  else
2122  fprintf(newfp, "%s", backup);
2123  break;
2124 
2125  case 'G':
2126  if (strcmp(keyname, "GroupAutoSel") == 0)
2127  menu_filter_select[0] = my_strdup(keydef);
2128  else if (strcmp(keyname, "GroupQuickAutoSel") == 0)
2129  quick_filter_select[0] = my_strdup(keydef);
2130  else if (strcmp(keyname, "GroupQuickKill") == 0)
2131  quick_filter_kill[0] = my_strdup(keydef);
2132  else if (strcmp(keyname, "GroupKill") == 0)
2133  menu_filter_kill[0] = my_strdup(keydef);
2134  else if (strcmp(keyname, "GroupReadBasenote") == 0)
2135  groupreadbasenote[0] = my_strdup(keydef);
2136  else if (strcmp(keyname, "GroupReadBasenote2") == 0)
2137  groupreadbasenote[1] = my_strdup(keydef);
2138  else if (strcmp(keyname, "GroupEditFilter") == 0)
2139  edit_filter[0] = my_strdup(keydef);
2140  else if (strcmp(keyname, "GroupBugReport") == 0)
2141  bugreport[0] = my_strdup(keydef);
2142  else if (strcmp(keyname, "GroupMarkArtUnread") == 0)
2143  mark_article_unread[0] = my_strdup(keydef);
2144  else if (strcmp(keyname, "GroupMarkThdUnread") == 0)
2145  mark_thread_unread[0] = my_strdup(keydef);
2146  else if (strcmp(keyname, "GroupCatchup") == 0)
2147  catchup[0] = my_strdup(keydef);
2148  else if (strcmp(keyname, "GroupCatchupNextUnread") == 0)
2149  catchup_next_unread[0] = my_strdup(keydef);
2150  else
2151  fprintf(newfp, "%s", backup);
2152  break;
2153 
2154  case 'H':
2155  if (strcmp(keyname, "HelpFirstPage2") == 0)
2156  fprintf(newfp, "HelpFirstPage\t\t\t%s\n", keydef);
2157  else if (strcmp(keyname, "HelpLastPage2") == 0)
2158  fprintf(newfp, "HelpLastPage\t\t\t%s\n", keydef);
2159  else
2160  fprintf(newfp, "%s", backup);
2161  break;
2162 
2163  case 'N':
2164  /* Nrc* got removed */
2165  if (strcmp(keyname, "NrctblCreate") == 0)
2166  ;
2167  else if (strcmp(keyname, "NrctblDefault") == 0)
2168  ;
2169  else if (strcmp(keyname, "NrctblAlternative") == 0)
2170  ;
2171  else if (strcmp(keyname, "NrctblQuit") == 0)
2172  ;
2173  else
2174  fprintf(newfp, "%s", backup);
2175  break;
2176 
2177  case 'P':
2178  if (strcmp(keyname, "PageAutoSel") == 0)
2179  menu_filter_select[1] = my_strdup(keydef);
2180  else if (strcmp(keyname, "PageQuickAutoSel") == 0)
2181  quick_filter_select[1] = my_strdup(keydef);
2182  else if (strcmp(keyname, "PageQuickKill") == 0)
2183  quick_filter_kill[1] = my_strdup(keydef);
2184  else if (strcmp(keyname, "PageAutoKill") == 0)
2185  menu_filter_kill[1] = my_strdup(keydef);
2186  else if (strcmp(keyname, "PageDown") == 0)
2187  pagedown[0] = my_strdup(keydef);
2188  else if (strcmp(keyname, "PageDown2") == 0)
2189  pagedown[1] = my_strdup(keydef);
2190  else if (strcmp(keyname, "PageDown3") == 0)
2191  pagedown[2] = my_strdup(keydef);
2192  else if (strcmp(keyname, "PageEditFilter") == 0)
2193  edit_filter[1] = my_strdup(keydef);
2194  else if (strcmp(keyname, "PageNextThd") == 0)
2195  pagenextthd[0] = my_strdup(keydef);
2196  else if (strcmp(keyname, "PageNextThd2") == 0)
2197  pagenextthd[1] = my_strdup(keydef);
2198  else if (strcmp(keyname, "PageUp") == 0)
2199  pageup[0] = my_strdup(keydef);
2200  else if (strcmp(keyname, "PageUp2") == 0)
2201  pageup[1] = my_strdup(keydef);
2202  else if (strcmp(keyname, "PageUp3") == 0)
2203  pageup[2] = my_strdup(keydef);
2204  else if (strcmp(keyname, "Postponed") == 0)
2205  postponed[0] = my_strdup(keydef);
2206  else if (strcmp(keyname, "Postponed2") == 0)
2207  postponed[1] = my_strdup(keydef);
2208  else if (strcmp(keyname, "PostPost") == 0)
2209  postpost[0] = my_strdup(keydef);
2210  else if (strcmp(keyname, "PostPost2") == 0)
2211  postpost[1] = my_strdup(keydef);
2212  else if (strcmp(keyname, "PostPost3") == 0)
2213  postpost[2] = my_strdup(keydef);
2214  else if (strcmp(keyname, "PostSend") == 0)
2215  postsend[0] = my_strdup(keydef);
2216  else if (strcmp(keyname, "PostSend2") == 0)
2217  postsend[1] = my_strdup(keydef);
2218  else if (strcmp(keyname, "PageMarkArtUnread") == 0)
2219  mark_article_unread[1] = my_strdup(keydef);
2220  else if (strcmp(keyname, "PageMarkThdUnread") == 0)
2221  mark_thread_unread[1] = my_strdup(keydef);
2222  else if (strcmp(keyname, "PageCatchup") == 0)
2223  catchup[1] = my_strdup(keydef);
2224  else if (strcmp(keyname, "PageCatchupNextUnread") == 0)
2225  catchup_next_unread[1] = my_strdup(keydef);
2226  else if (strcmp(keyname, "PageToggleHeaders") == 0)
2227  fprintf(newfp, "PageToggleRaw\t\t\t%s\n", keydef);
2228  else if (strcmp(keyname, "PromptNo") == 0 || strcmp(keyname, "PromptYes") == 0) {
2229  if (strlen(keydef) == 1 && islower((int)(unsigned char) keydef[0]))
2230  fprintf(newfp, "%s\t\t\t%c\t%c\n", keyname, keydef[0], my_toupper((int)(unsigned char) keydef[0]));
2231  else
2232  fprintf(newfp, "%s", backup);
2233  } else
2234  fprintf(newfp, "%s", backup);
2235  break;
2236 
2237  case 'S':
2238  if (strcmp(keyname, "SelectEditFilter") == 0)
2239  ;
2240  else if (strcmp(keyname, "SelectEnterNextUnreadGrp") == 0)
2241  selectentergroup[0] = my_strdup(keydef);
2242  else if (strcmp(keyname, "SelectEnterNextUnreadGrp2") == 0)
2243  selectentergroup[1] = my_strdup(keydef);
2244  else if (strcmp(keyname, "SelectMarkGrpUnread") == 0)
2245  selectmarkgrpunread[0] = my_strdup(keydef);
2246  else if (strcmp(keyname, "SelectMarkGrpUnread2") == 0)
2247  selectmarkgrpunread[1] = my_strdup(keydef);
2248  else if (strcmp(keyname, "SelectReadGrp") == 0)
2249  selectreadgrp[0] = my_strdup(keydef);
2250  else if (strcmp(keyname, "SelectReadGrp2") == 0)
2251  selectreadgrp[1] = my_strdup(keydef);
2252  else if (strcmp(keyname, "SelectBugReport") == 0)
2253  bugreport[1] = my_strdup(keydef);
2254  else if (strcmp(keyname, "SelectCatchup") == 0)
2255  catchup[2] = my_strdup(keydef);
2256  else if (strcmp(keyname, "SelectCatchupNextUnread") == 0)
2257  catchup_next_unread[2] = my_strdup(keydef);
2258  else
2259  fprintf(newfp, "%s", backup);
2260  break;
2261 
2262  case 'T':
2263  if (strcmp(keyname, "ThreadEditFilter") == 0)
2264  ;
2265  else if (strcmp(keyname, "ThreadAutoSel") == 0)
2266  menu_filter_select[2] = my_strdup(keydef);
2267  else if (strcmp(keyname, "ThreadKill") == 0)
2268  menu_filter_kill[2] = my_strdup(keydef);
2269  else if (strcmp(keyname, "ThreadReadArt") == 0)
2270  threadreadart[0] = my_strdup(keydef);
2271  else if (strcmp(keyname, "ThreadReadArt2") == 0)
2272  threadreadart[1] = my_strdup(keydef);
2273  else if (strcmp(keyname, "ThreadBugReport") == 0)
2274  bugreport[2] = my_strdup(keydef);
2275  else if (strcmp(keyname, "ThreadMarkArtUnread") == 0)
2276  mark_article_unread[2] = my_strdup(keydef);
2277  else if (strcmp(keyname, "ThreadMarkThdUnread") == 0)
2278  mark_thread_unread[2] = my_strdup(keydef);
2279  else if (strcmp(keyname, "ThreadCatchup") == 0)
2280  catchup[3] = my_strdup(keydef);
2281  else if (strcmp(keyname, "ThreadCatchupNextUnread") == 0)
2282  catchup_next_unread[3] = my_strdup(keydef);
2283  else
2284  fprintf(newfp, "%s", backup);
2285  break;
2286 
2287  case 'U':
2288  if (strcmp(keyname, "Up") == 0)
2289  up[0] = my_strdup(keydef);
2290  else if (strcmp(keyname, "Up2") == 0)
2291  up[1] = my_strdup(keydef);
2292  else
2293  fprintf(newfp, "%s", backup);
2294  break;
2295 
2296  default:
2297  fprintf(newfp, "%s", backup);
2298  }
2299  free(backup);
2300  }
2301  fprintf(newfp, "\n#####\n");
2302  /* joined/renamed keys from different sections */
2303  if (bugreport[0] || bugreport[1] || bugreport[2]) {
2304  fprintf(newfp, "BugReport\t");
2305  if (bugreport[0] && bugreport[1] && !strcmp(bugreport[0], bugreport[1]))
2306  FreeAndNull(bugreport[1]);
2307  if (bugreport[0] && bugreport[2] && !strcmp(bugreport[0], bugreport[2]))
2308  FreeAndNull(bugreport[2]);
2309  if (bugreport[1] && bugreport[2] && !strcmp(bugreport[1], bugreport[2]))
2310  FreeAndNull(bugreport[2]);
2311  if (bugreport[0])
2312  fprintf(newfp, "\t%s", bugreport[0]);
2313  if (bugreport[1])
2314  fprintf(newfp, "\t%s", bugreport[1]);
2315  if (bugreport[2])
2316  fprintf(newfp, "\t%s", bugreport[2]);
2317  fprintf(newfp, "\n");
2318  FreeAndNull(bugreport[0]);
2319  FreeAndNull(bugreport[1]);
2320  FreeAndNull(bugreport[2]);
2321  }
2322  if (catchup[0] || catchup[1] || catchup[2] || catchup[3]) {
2323  fprintf(newfp, "Catchup\t");
2324  if (catchup[0] && catchup[1] && !strcmp(catchup[0], catchup[1]))
2325  FreeAndNull(catchup[1]);
2326  if (catchup[0] && catchup[2] && !strcmp(catchup[0], catchup[2]))
2327  FreeAndNull(catchup[2]);
2328  if (catchup[0] && catchup[3] && !strcmp(catchup[0], catchup[3]))
2329  FreeAndNull(catchup[3]);
2330  if (catchup[1] && catchup[2] && !strcmp(catchup[1], catchup[2]))
2331  FreeAndNull(catchup[2]);
2332  if (catchup[1] && catchup[3] && !strcmp(catchup[1], catchup[3]))
2333  FreeAndNull(catchup[3]);
2334  if (catchup[2] && catchup[3] && !strcmp(catchup[2], catchup[3]))
2335  FreeAndNull(catchup[3]);
2336  if (catchup[0])
2337  fprintf(newfp, "\t%s", catchup[0]);
2338  if (catchup[1])
2339  fprintf(newfp, "\t%s", catchup[1]);
2340  if (catchup[2])
2341  fprintf(newfp, "\t%s", catchup[2]);
2342  if (catchup[3])
2343  fprintf(newfp, "\t%s", catchup[3]);
2344  fprintf(newfp, "\n");
2345  FreeAndNull(catchup[0]);
2346  FreeAndNull(catchup[1]);
2347  FreeAndNull(catchup[2]);
2348  FreeAndNull(catchup[3]);
2349  }
2350  if (catchup_next_unread[0] || catchup_next_unread[1] || catchup_next_unread[2] || catchup_next_unread[3]) {
2351  fprintf(newfp, "CatchupNextUnread\t");
2352  if (catchup_next_unread[0] && catchup_next_unread[1] && !strcmp(catchup_next_unread[0], catchup_next_unread[1]))
2353  FreeAndNull(catchup_next_unread[1]);
2354  if (catchup_next_unread[0] && catchup_next_unread[2] && !strcmp(catchup_next_unread[0], catchup_next_unread[2]))
2355  FreeAndNull(catchup_next_unread[2]);
2356  if (catchup_next_unread[0] && catchup_next_unread[3] && !strcmp(catchup_next_unread[0], catchup_next_unread[3]))
2357  FreeAndNull(catchup_next_unread[3]);
2358  if (catchup_next_unread[1] && catchup_next_unread[2] && !strcmp(catchup_next_unread[1], catchup_next_unread[2]))
2359  FreeAndNull(catchup_next_unread[2]);
2360  if (catchup_next_unread[1] && catchup_next_unread[3] && !strcmp(catchup_next_unread[1], catchup_next_unread[3]))
2361  FreeAndNull(catchup_next_unread[3]);
2362  if (catchup_next_unread[2] && catchup_next_unread[3] && !strcmp(catchup_next_unread[2], catchup_next_unread[3]))
2363  FreeAndNull(catchup_next_unread[3]);
2364  if (catchup_next_unread[0])
2365  fprintf(newfp, "\t%s", catchup_next_unread[0]);
2366  if (catchup_next_unread[1])
2367  fprintf(newfp, "\t%s", catchup_next_unread[1]);
2368  if (catchup_next_unread[2])
2369  fprintf(newfp, "\t%s", catchup_next_unread[2]);
2370  if (catchup_next_unread[3])
2371  fprintf(newfp, "\t%s", catchup_next_unread[3]);
2372  fprintf(newfp, "\n");
2373  FreeAndNull(catchup_next_unread[0]);
2374  FreeAndNull(catchup_next_unread[1]);
2375  FreeAndNull(catchup_next_unread[2]);
2376  FreeAndNull(catchup_next_unread[3]);
2377  }
2378  if (edit_filter[0] || edit_filter[1]) {
2379  fprintf(newfp, "EditFilter\t");
2380  if (edit_filter[0])
2381  fprintf(newfp, "\t%s", edit_filter[0]);
2382  if (edit_filter[1] && edit_filter[0] && strcmp(edit_filter[0], edit_filter[1]))
2383  fprintf(newfp, "\t%s", edit_filter[1]);
2384  fprintf(newfp, "\n");
2385  FreeAndNull(edit_filter[0]);
2386  FreeAndNull(edit_filter[1]);
2387  }
2388  if (mark_article_unread[0] || mark_article_unread[1] || mark_article_unread[2]) {
2389  fprintf(newfp, "MarkArticleUnread\t");
2390  if (mark_article_unread[0] && mark_article_unread[1] && !strcmp(mark_article_unread[0], mark_article_unread[1]))
2391  FreeAndNull(mark_article_unread[1]);
2392  if (mark_article_unread[0] && mark_article_unread[2] && !strcmp(mark_article_unread[0], mark_article_unread[2]))
2393  FreeAndNull(mark_article_unread[2]);
2394  if (mark_article_unread[1] && mark_article_unread[2] && !strcmp(mark_article_unread[1], mark_article_unread[2]))
2395  FreeAndNull(mark_article_unread[2]);
2396  if (mark_article_unread[0])
2397  fprintf(newfp, "\t%s", mark_article_unread[0]);
2398  if (mark_article_unread[1])
2399  fprintf(newfp, "\t%s", mark_article_unread[1]);
2400  if (mark_article_unread[2])
2401  fprintf(newfp, "\t%s", mark_article_unread[2]);
2402  fprintf(newfp, "\n");
2403  FreeAndNull(mark_article_unread[0]);
2404  FreeAndNull(mark_article_unread[1]);
2405  FreeAndNull(mark_article_unread[2]);
2406  }
2407  if (mark_thread_unread[0] || mark_thread_unread[1] || mark_thread_unread[2]) {
2408  fprintf(newfp, "MarkThreadUnread\t");
2409  if (mark_thread_unread[0] && mark_thread_unread[1] && !strcmp(mark_thread_unread[0], mark_thread_unread[1]))
2410  FreeAndNull(mark_thread_unread[1]);
2411  if (mark_thread_unread[0] && mark_thread_unread[2] && !strcmp(mark_thread_unread[0], mark_thread_unread[2]))
2412  FreeAndNull(mark_thread_unread[2]);
2413  if (mark_thread_unread[1] && mark_thread_unread[2] && !strcmp(mark_thread_unread[1], mark_thread_unread[2]))
2414  FreeAndNull(mark_thread_unread[2]);
2415  if (mark_thread_unread[0])
2416  fprintf(newfp, "\t%s", mark_thread_unread[0]);
2417  if (mark_thread_unread[1])
2418  fprintf(newfp, "\t%s", mark_thread_unread[1]);
2419  if (mark_thread_unread[2])
2420  fprintf(newfp, "\t%s", mark_thread_unread[2]);
2421  fprintf(newfp, "\n");
2422  FreeAndNull(mark_thread_unread[0]);
2423  FreeAndNull(mark_thread_unread[1]);
2424  FreeAndNull(mark_thread_unread[2]);
2425  }
2426  if (menu_filter_kill[0] || menu_filter_kill[1] || menu_filter_kill[2]) {
2427  fprintf(newfp, "MenuFilterKill\t");
2428  if (menu_filter_kill[0] && menu_filter_kill[1] && !strcmp(menu_filter_kill[0], menu_filter_kill[1]))
2429  FreeAndNull(menu_filter_kill[1]);
2430  if (menu_filter_kill[0] && menu_filter_kill[2] && !strcmp(menu_filter_kill[0], menu_filter_kill[2]))
2431  FreeAndNull(menu_filter_kill[2]);
2432  if (menu_filter_kill[1] && menu_filter_kill[2] && !strcmp(menu_filter_kill[1], menu_filter_kill[2]))
2433  FreeAndNull(menu_filter_kill[2]);
2434  if (menu_filter_kill[0])
2435  fprintf(newfp, "\t%s", menu_filter_kill[0]);
2436  if (menu_filter_kill[1])
2437  fprintf(newfp, "\t%s", menu_filter_kill[1]);
2438  if (menu_filter_kill[2])
2439  fprintf(newfp, "\t%s", menu_filter_kill[2]);
2440  fprintf(newfp, "\n");
2441  FreeAndNull(menu_filter_kill[0]);
2442  FreeAndNull(menu_filter_kill[1]);
2443  FreeAndNull(menu_filter_kill[2]);
2444  }
2445  if (menu_filter_select[0] || menu_filter_select[1] || menu_filter_select[2]) {
2446  fprintf(newfp, "MenuFilterSelect\t");
2447  if (menu_filter_select[0] && menu_filter_select[1] && !strcmp(menu_filter_select[0], menu_filter_select[1]))
2448  FreeAndNull(menu_filter_select[1]);
2449  if (menu_filter_select[0] && menu_filter_select[2] && !strcmp(menu_filter_select[0], menu_filter_select[2]))
2450  FreeAndNull(menu_filter_select[2]);
2451  if (menu_filter_select[1] && menu_filter_select[2] && !strcmp(menu_filter_select[1], menu_filter_select[2]))
2452  FreeAndNull(menu_filter_select[2]);
2453  if (menu_filter_select[0])
2454  fprintf(newfp, "\t%s", menu_filter_select[0]);
2455  if (menu_filter_select[1])
2456  fprintf(newfp, "\t%s", menu_filter_select[1]);
2457  if (menu_filter_select[2])
2458  fprintf(newfp, "\t%s", menu_filter_select[2]);
2459  fprintf(newfp, "\n");
2460  FreeAndNull(menu_filter_select[0]);
2461  FreeAndNull(menu_filter_select[1]);
2462  FreeAndNull(menu_filter_select[2]);
2463  }
2464  if (quick_filter_kill[0] || quick_filter_kill[1]) {
2465  fprintf(newfp, "QuickFilterKill\t");
2466  if (quick_filter_kill[0])
2467  fprintf(newfp, "\t%s", quick_filter_kill[0]);
2468  if (quick_filter_kill[1] && quick_filter_kill[0] && strcmp(quick_filter_kill[0], quick_filter_kill[1]))
2469  fprintf(newfp, "\t%s", quick_filter_kill[1]);
2470  fprintf(newfp, "\n");
2471  FreeAndNull(quick_filter_kill[0]);
2472  FreeAndNull(quick_filter_kill[1]);
2473  }
2474  if (quick_filter_select[0] || quick_filter_select[1]) {
2475  fprintf(newfp, "QuickFilterSelect\t");
2476  if (quick_filter_select[0])
2477  fprintf(newfp, "\t%s", quick_filter_select[0]);
2478  if (quick_filter_select[1] && quick_filter_select[0] && strcmp(quick_filter_select[0], quick_filter_select[1]))
2479  fprintf(newfp, "\t%s", quick_filter_select[1]);
2480  fprintf(newfp, "\n");
2481  FreeAndNull(quick_filter_select[0]);
2482  FreeAndNull(quick_filter_select[1]);
2483  }
2484 
2485  fclose(oldfp);
2486  fclose(newfp);
2487  rename(newk, old);
2489  prompt_continue();
2490 }
2491 
2492 
2493 /*
2494  * add the default key bindings for still free keys
2495  */
2496 void
2498  void)
2499 {
2500  /* attachment level */
2534 #ifndef NO_SHELL_ESCAPE
2536 #endif /* !NO_SHELL_ESCAPE */
2537 
2538  /* scope level */
2566 #ifndef NO_SHELL_ESCAPE
2568 #endif /* !NO_SHELL_ESCAPE */
2569 
2570  /* select level */
2586 #ifdef NNTP_ABLE
2588 #endif /* NNTP_ABLE */
2598 
2599  /* group level */
2613 #ifndef DISABLE_PRINTING
2615 #endif /* !DISABLE_PRINTING */
2652 
2653  /* thread keys */
2664 #ifndef DISABLE_PRINTING
2666 #endif /* !DISABLE_PRINTING */
2689 
2690  /* page level */
2694 #ifdef HAVE_PGP_GPG
2695  add_default_key(&page_keys, "", PAGE_PGP_CHECK_ARTICLE);
2696 #endif /* HAVE_PGP_GPG */
2710 #ifndef DISABLE_PRINTING
2712 #endif /* !DISABLE_PRINTING */
2751 
2752  /* info pager */
2765 
2766  /* options menu */
2796 #ifndef NO_SHELL_ESCAPE
2798 #endif /* !NO_SHELL_ESCAPE */
2799 
2800  /* prompt keys */
2805 
2806  /* post keys */
2809 #ifdef HAVE_PGP_GPG
2810  add_default_key(&post_send_keys, "g", POST_PGP);
2811 #endif /* HAVE_PGP_GPG */
2812 #ifdef HAVE_ISPELL
2813  add_default_key(&post_send_keys, "i", POST_ISPELL);
2814 #endif /* HAVE_ISPELL */
2817 
2822 
2827 
2830 #ifdef HAVE_PGP_GPG
2831  add_default_key(&post_post_keys, "g", POST_PGP);
2832 #endif /* HAVE_PGP_GPG */
2833 #ifdef HAVE_ISPELL
2834  add_default_key(&post_post_keys, "i", POST_ISPELL);
2835 #endif /* HAVE_ISPELL */
2840 
2847 
2852 
2857 
2862 
2867 
2872 
2873  /* feed keys */
2879 
2888 
2893 
2894  /* filter keys */
2899 
2900 #ifdef HAVE_PGP_GPG
2901  /* pgp mail */
2902  add_default_key(&pgp_mail_keys, "", GLOBAL_ABORT);
2903  add_default_key(&pgp_mail_keys, "b", PGP_KEY_ENCRYPT_SIGN);
2904  add_default_key(&pgp_mail_keys, "e", PGP_KEY_ENCRYPT);
2905  add_default_key(&pgp_mail_keys, "q", GLOBAL_QUIT);
2906  add_default_key(&pgp_mail_keys, "s", PGP_KEY_SIGN);
2907 
2908  /* pgp news */
2909  add_default_key(&pgp_news_keys, "", GLOBAL_ABORT);
2910  add_default_key(&pgp_news_keys, "i", PGP_INCLUDE_KEY);
2911  add_default_key(&pgp_news_keys, "q", GLOBAL_QUIT);
2912  add_default_key(&pgp_news_keys, "s", PGP_KEY_SIGN);
2913 #endif /* HAVE_PGP_GPG */
2914 
2915  /* save */
2920 
2921  /* url level */
2935  add_default_key(&url_keys, "\n\r", URL_SELECT);
2949 #ifndef NO_SHELL_ESCAPE
2951 #endif /* !NO_SHELL_ESCAPE */
2952 }
2953 
2954 
2955 /*
2956  * used to add the common keys of SELECT_LEVEL, GROUP_LEVEL, THREAD_LEVEL
2957  * and PAGE_LEVEL
2958  */
2959 static void
2961  struct keylist *keys)
2962 {
2963  add_default_key(keys, "", GLOBAL_ABORT);
2964  add_default_key(keys, "0", DIGIT_0);
2965  add_default_key(keys, "1", DIGIT_1);
2966  add_default_key(keys, "2", DIGIT_2);
2967  add_default_key(keys, "3", DIGIT_3);
2968  add_default_key(keys, "4", DIGIT_4);
2969  add_default_key(keys, "5", DIGIT_5);
2970  add_default_key(keys, "6", DIGIT_6);
2971  add_default_key(keys, "7", DIGIT_7);
2972  add_default_key(keys, "8", DIGIT_8);
2973  add_default_key(keys, "9", DIGIT_9);
2974  add_default_key(keys, "b", GLOBAL_PAGE_UP);
2975  add_default_key(keys, " ", GLOBAL_PAGE_DOWN);
2977  add_default_key(keys, "j", GLOBAL_LINE_DOWN);
2978  add_default_key(keys, "k", GLOBAL_LINE_UP);
2979  add_default_key(keys, "O", GLOBAL_POSTPONED);
2980  add_default_key(keys, "h", GLOBAL_HELP);
2982  add_default_key(keys, "q", GLOBAL_QUIT);
2983  add_default_key(keys, "v", GLOBAL_VERSION);
2984  add_default_key(keys, "w", GLOBAL_POST);
2987  add_default_key(keys, "M", GLOBAL_OPTION_MENU);
2988  add_default_key(keys, "Q", GLOBAL_QUIT_TIN);
2989  add_default_key(keys, "R", GLOBAL_BUGREPORT);
2991  add_default_key(keys, "^", GLOBAL_FIRST_PAGE);
2992  add_default_key(keys, "$", GLOBAL_LAST_PAGE);
2996  add_default_key(keys, "#", GLOBAL_SET_RANGE);
2997 #ifndef NO_SHELL_ESCAPE
2999 #endif /* !NO_SHELL_ESCAPE */
3000 #ifdef HAVE_COLOR
3001  add_default_key(keys, "&", GLOBAL_TOGGLE_COLOR);
3002 #endif /* HAVE COLOR */
3003 }
PAGE_SKIP_INCLUDED_TEXT
@ PAGE_SKIP_INCLUDED_TEXT
Definition: keymap.h:292
GROUP_NEXT_UNREAD_ARTICLE
@ GROUP_NEXT_UNREAD_ARTICLE
Definition: keymap.h:241
THREAD_TOGGLE_SUBJECT_DISPLAY
@ THREAD_TOGGLE_SUBJECT_DISPLAY
Definition: keymap.h:368
GROUP_PREVIOUS_GROUP
@ GROUP_PREVIOUS_GROUP
Definition: keymap.h:243
SCOPE_RENAME
@ SCOPE_RENAME
Definition: keymap.h:338
read_keymap_file
t_bool read_keymap_file(void)
Definition: keymap.c:325
PAGE_TAG
@ PAGE_TAG
Definition: keymap.h:293
THREAD_REVERSE_SELECTIONS
@ THREAD_REVERSE_SELECTIONS
Definition: keymap.h:363
PAGE_REPOST
@ PAGE_REPOST
Definition: keymap.h:290
SCOPE_DELETE
@ SCOPE_DELETE
Definition: keymap.h:335
SCOPE_SELECT
@ SCOPE_SELECT
Definition: keymap.h:339
GLOBAL_PAGE_DOWN
@ GLOBAL_PAGE_DOWN
Definition: keymap.h:200
_
#define _(Text)
Definition: tin.h:94
GLOBAL_SHELL_ESCAPE
@ GLOBAL_SHELL_ESCAPE
Definition: keymap.h:223
PAGE_NEXT_UNREAD_ARTICLE
@ PAGE_NEXT_UNREAD_ARTICLE
Definition: keymap.h:280
SELECT_ENTER_GROUP
@ SELECT_ENTER_GROUP
Definition: keymap.h:340
thread_keys
struct keylist thread_keys
Definition: keymap.c:89
upgrade_keymap_file
static void upgrade_keymap_file(char *old)
Definition: keymap.c:1880
PAGE_REPLY_QUOTE
@ PAGE_REPLY_QUOTE
Definition: keymap.h:288
keylist::max
size_t max
Definition: keymap.h:389
my_realloc
#define my_realloc(ptr, size)
Definition: tin.h:2198
DIGIT_0
@ DIGIT_0
Definition: keymap.h:150
GROUP_TOGGLE_THREADING
@ GROUP_TOGGLE_THREADING
Definition: keymap.h:258
POSTPONE_ALL
@ POSTPONE_ALL
Definition: keymap.h:325
PAGE_FOLLOWUP_QUOTE_HEADERS
@ PAGE_FOLLOWUP_QUOTE_HEADERS
Definition: keymap.h:271
add_default_key
static void add_default_key(struct keylist *key_list, const char *keys, t_function func)
Definition: keymap.c:198
GLOBAL_SEARCH_AUTHOR_FORWARD
@ GLOBAL_SEARCH_AUTHOR_FORWARD
Definition: keymap.h:218
t_version::state
enum rc_state state
Definition: tin.h:2471
my_strdup
char * my_strdup(const char *str)
Definition: string.c:133
POST_CONTINUE
@ POST_CONTINUE
Definition: keymap.h:312
RC_IGNORE
@ RC_IGNORE
Definition: tin.h:110
RC_UPGRADE
@ RC_UPGRADE
Definition: tin.h:110
MARK_FEED_READ
@ MARK_FEED_READ
Definition: keymap.h:263
THREAD_READ_ARTICLE
@ THREAD_READ_ARTICLE
Definition: keymap.h:362
MARK_ARTICLE_UNREAD
@ MARK_ARTICLE_UNREAD
Definition: keymap.h:261
CATCHUP
@ CATCHUP
Definition: keymap.h:169
DIGIT_8
@ DIGIT_8
Definition: keymap.h:158
process_id
pid_t process_id
Definition: init.c:124
GROUP_LIST_THREAD
@ GROUP_LIST_THREAD
Definition: keymap.h:236
GLOBAL_TOGGLE_INFO_LAST_LINE
@ GLOBAL_TOGGLE_INFO_LAST_LINE
Definition: keymap.h:229
GLOBAL_DISPLAY_POST_HISTORY
@ GLOBAL_DISPLAY_POST_HISTORY
Definition: keymap.h:188
ATTACHMENT_SAVE
@ ATTACHMENT_SAVE
Definition: keymap.h:161
str_trim
char * str_trim(char *string)
Definition: string.c:532
PAGE_NEXT_THREAD
@ PAGE_NEXT_THREAD
Definition: keymap.h:278
ctrl
#define ctrl(c)
Definition: keymap.h:139
PAGE_EDIT_ARTICLE
@ PAGE_EDIT_ARTICLE
Definition: keymap.h:268
POST_ABORT
@ POST_ABORT
Definition: keymap.h:310
PAGE_SAVE
@ PAGE_SAVE
Definition: keymap.h:291
keynode::function
t_function function
Definition: keymap.h:382
keylist::list
struct keynode * list
Definition: keymap.h:387
GLOBAL_SEARCH_SUBJECT_FORWARD
@ GLOBAL_SEARCH_SUBJECT_FORWARD
Definition: keymap.h:220
process_keys
static t_bool process_keys(t_function func, const char *keys, struct keylist *kl)
Definition: keymap.c:445
THREAD_READ_NEXT_ARTICLE_OR_THREAD
@ THREAD_READ_NEXT_ARTICLE_OR_THREAD
Definition: keymap.h:361
txt_keymap_missing_key
constext txt_keymap_missing_key[]
Definition: lang.c:584
URL_SELECT
@ URL_SELECT
Definition: keymap.h:371
GROUP_UNDO_SELECTIONS
@ GROUP_UNDO_SELECTIONS
Definition: keymap.h:259
THREAD_TAG
@ THREAD_TAG
Definition: keymap.h:366
PAGE_VIEW_URL
@ PAGE_VIEW_URL
Definition: keymap.h:303
DIGIT_5
@ DIGIT_5
Definition: keymap.h:155
FEED_PATTERN
@ FEED_PATTERN
Definition: keymap.h:179
ESC
#define ESC
Definition: keymap.h:140
my_toupper
int my_toupper(int)
Definition: string.c:269
GLOBAL_LOOKUP_MESSAGEID
@ GLOBAL_LOOKUP_MESSAGEID
Definition: keymap.h:196
GLOBAL_OPTION_MENU
@ GLOBAL_OPTION_MENU
Definition: keymap.h:199
post_postpone_keys
struct keylist post_postpone_keys
Definition: keymap.c:83
PAGE_MARK_THREAD_READ
@ PAGE_MARK_THREAD_READ
Definition: keymap.h:276
txt_space
constext txt_space[]
Definition: lang.c:844
PAGE_REPLY_QUOTE_HEADERS
@ PAGE_REPLY_QUOTE_HEADERS
Definition: keymap.h:289
group_keys
struct keylist group_keys
Definition: keymap.c:67
SELECT_MARK_GROUP_UNREAD
@ SELECT_MARK_GROUP_UNREAD
Definition: keymap.h:343
feed_supersede_article_keys
struct keylist feed_supersede_article_keys
Definition: keymap.c:64
PAGE_FOLLOWUP
@ PAGE_FOLLOWUP
Definition: keymap.h:269
DIGIT_3
@ DIGIT_3
Definition: keymap.h:153
wait_message
void wait_message(unsigned int sdelay, const char *fmt,...)
Definition: screen.c:133
FreeAndNull
#define FreeAndNull(p)
Definition: tin.h:2204
setup_default_keys
void setup_default_keys(void)
Definition: keymap.c:2497
GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP
@ GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP
Definition: keymap.h:242
post_continue_keys
struct keylist post_continue_keys
Definition: keymap.c:76
CATCHUP_NEXT_UNREAD
@ CATCHUP_NEXT_UNREAD
Definition: keymap.h:170
GLOBAL_POSTPONED
@ GLOBAL_POSTPONED
Definition: keymap.h:204
upgrade_prompt_quit
void upgrade_prompt_quit(struct t_version *upgrade, const char *file)
Definition: version.c:121
select_keys
struct keylist select_keys
Definition: keymap.c:88
GLOBAL_SCROLL_DOWN
@ GLOBAL_SCROLL_DOWN
Definition: keymap.h:213
GROUP_MARK_UNSELECTED_ARTICLES_READ
@ GROUP_MARK_UNSELECTED_ARTICLES_READ
Definition: keymap.h:239
post_ignore_fupto_keys
struct keylist post_ignore_fupto_keys
Definition: keymap.c:80
SELECT_SUBSCRIBE_PATTERN
@ SELECT_SUBSCRIBE_PATTERN
Definition: keymap.h:349
PAGE_TOGGLE_UUE
@ PAGE_TOGGLE_UUE
Definition: keymap.h:300
GROUP_TOGGLE_SELECT_THREAD
@ GROUP_TOGGLE_SELECT_THREAD
Definition: keymap.h:257
GROUP_REVERSE_SELECTIONS
@ GROUP_REVERSE_SELECTIONS
Definition: keymap.h:247
PAGE_FOLLOWUP_QUOTE
@ PAGE_FOLLOWUP_QUOTE
Definition: keymap.h:270
ATTACHMENT_TAG
@ ATTACHMENT_TAG
Definition: keymap.h:163
SAVE_APPEND_FILE
@ SAVE_APPEND_FILE
Definition: keymap.h:332
prompt_keys
struct keylist prompt_keys
Definition: keymap.c:85
feed_post_process_keys
struct keylist feed_post_process_keys
Definition: keymap.c:63
PAGE_VIEW_ATTACHMENTS
@ PAGE_VIEW_ATTACHMENTS
Definition: keymap.h:302
GROUP_TOGGLE_SUBJECT_DISPLAY
@ GROUP_TOGGLE_SUBJECT_DISPLAY
Definition: keymap.h:256
GLOBAL_SCROLL_UP
@ GLOBAL_SCROLL_UP
Definition: keymap.h:214
GROUP_TOGGLE_READ_UNREAD
@ GROUP_TOGGLE_READ_UNREAD
Definition: keymap.h:255
version.h
GROUP_SAVE
@ GROUP_SAVE
Definition: keymap.h:248
SELECT_SORT_ACTIVE
@ SELECT_SORT_ACTIVE
Definition: keymap.h:347
tin.h
GLOBAL_LAST_PAGE
@ GLOBAL_LAST_PAGE
Definition: keymap.h:192
DEFAULT_MAPKEYS_NUM
#define DEFAULT_MAPKEYS_NUM
Definition: tin.h:616
FILTER_EDIT
@ FILTER_EDIT
Definition: keymap.h:184
GROUP_CANCEL
@ GROUP_CANCEL
Definition: keymap.h:233
txt_cr
constext txt_cr[]
Definition: lang.c:157
DIGIT_4
@ DIGIT_4
Definition: keymap.h:154
ATTACHMENT_SELECT
@ ATTACHMENT_SELECT
Definition: keymap.h:162
FILTER_SAVE
@ FILTER_SAVE
Definition: keymap.h:185
PATH_LEN
#define PATH_LEN
Definition: tin.h:837
PAGE_REVEAL
@ PAGE_REVEAL
Definition: keymap.h:286
GLOBAL_TOGGLE_HELP_DISPLAY
@ GLOBAL_TOGGLE_HELP_DISPLAY
Definition: keymap.h:228
rcdir
char rcdir[PATH_LEN]
Definition: init.c:100
forever
#define forever
Definition: tin.h:810
post_send_keys
struct keylist post_send_keys
Definition: keymap.c:84
CONFIG_NO_SAVE
@ CONFIG_NO_SAVE
Definition: keymap.h:174
MARK_THREAD_UNREAD
@ MARK_THREAD_UNREAD
Definition: keymap.h:262
SCOPE_MOVE
@ SCOPE_MOVE
Definition: keymap.h:337
match_string
t_bool match_string(char *line, const char *pat, char *dst, size_t dstlen)
Definition: config.c:1637
PAGE_NEXT_ARTICLE
@ PAGE_NEXT_ARTICLE
Definition: keymap.h:277
SAVE_OVERWRITE_FILE
@ SAVE_OVERWRITE_FILE
Definition: keymap.h:333
post_edit_keys
struct keylist post_edit_keys
Definition: keymap.c:78
GROUP_TAG_PARTS
@ GROUP_TAG_PARTS
Definition: keymap.h:253
save_append_overwrite_keys
struct keylist save_append_overwrite_keys
Definition: keymap.c:86
FEED_KEY_REPOST
@ FEED_KEY_REPOST
Definition: keymap.h:182
GROUP_SELECT_PATTERN
@ GROUP_SELECT_PATTERN
Definition: keymap.h:249
url_keys
struct keylist url_keys
Definition: keymap.c:90
GLOBAL_VERSION
@ GLOBAL_VERSION
Definition: keymap.h:231
SELECT_QUIT_NO_WRITE
@ SELECT_QUIT_NO_WRITE
Definition: keymap.h:355
PAGE_TOGGLE_HEADERS
@ PAGE_TOGGLE_HEADERS
Definition: keymap.h:294
GLOBAL_EDIT_FILTER
@ GLOBAL_EDIT_FILTER
Definition: keymap.h:189
post_delete_keys
struct keylist post_delete_keys
Definition: keymap.c:77
GLOBAL_QUICK_FILTER_KILL
@ GLOBAL_QUICK_FILTER_KILL
Definition: keymap.h:208
GROUP_REPOST
@ GROUP_REPOST
Definition: keymap.h:246
SELECT_TOGGLE_READ_DISPLAY
@ SELECT_TOGGLE_READ_DISPLAY
Definition: keymap.h:352
MARK_FEED_UNREAD
@ MARK_FEED_UNREAD
Definition: keymap.h:264
POST_MAIL
@ POST_MAIL
Definition: keymap.h:318
DIGIT_7
@ DIGIT_7
Definition: keymap.h:157
NAME_LEN
#define NAME_LEN
Definition: tin.h:852
GLOBAL_BUGREPORT
@ GLOBAL_BUGREPORT
Definition: keymap.h:187
PROMPT_NO
@ PROMPT_NO
Definition: keymap.h:330
PAGE_PREVIOUS_ARTICLE
@ PAGE_PREVIOUS_ARTICLE
Definition: keymap.h:284
GLOBAL_MENU_FILTER_SELECT
@ GLOBAL_MENU_FILTER_SELECT
Definition: keymap.h:198
POST_EDIT
@ POST_EDIT
Definition: keymap.h:313
buf
static char buf[16]
Definition: langinfo.c:50
FEED_SUPERSEDE
@ FEED_SUPERSEDE
Definition: keymap.h:183
POSTPONE_OVERRIDE
@ POSTPONE_OVERRIDE
Definition: keymap.h:326
GLOBAL_PRINT
@ GLOBAL_PRINT
Definition: keymap.h:206
THREAD_TOGGLE_ARTICLE_SELECTION
@ THREAD_TOGGLE_ARTICLE_SELECTION
Definition: keymap.h:367
GLOBAL_PIPE
@ GLOBAL_PIPE
Definition: keymap.h:202
GLOBAL_LINE_DOWN
@ GLOBAL_LINE_DOWN
Definition: keymap.h:194
FreeIfNeeded
#define FreeIfNeeded(p)
Definition: tin.h:2203
FEED_THREAD
@ FEED_THREAD
Definition: keymap.h:177
ATTACHMENT_TAG_PATTERN
@ ATTACHMENT_TAG_PATTERN
Definition: keymap.h:164
GLOBAL_LAST_VIEWED
@ GLOBAL_LAST_VIEWED
Definition: keymap.h:193
FEED_RANGE
@ FEED_RANGE
Definition: keymap.h:180
SELECT_TOGGLE_DESCRIPTIONS
@ SELECT_TOGGLE_DESCRIPTIONS
Definition: keymap.h:351
SELECT_SUBSCRIBE
@ SELECT_SUBSCRIBE
Definition: keymap.h:348
GLOBAL_LINE_UP
@ GLOBAL_LINE_UP
Definition: keymap.h:195
GLOBAL_SEARCH_SUBJECT_BACKWARD
@ GLOBAL_SEARCH_SUBJECT_BACKWARD
Definition: keymap.h:219
option_menu_keys
struct keylist option_menu_keys
Definition: keymap.c:69
ATTACHMENT_PIPE
@ ATTACHMENT_PIPE
Definition: keymap.h:160
GROUP_TOGGLE_GET_ARTICLES_LIMIT
@ GROUP_TOGGLE_GET_ARTICLES_LIMIT
Definition: keymap.h:254
DIGIT_9
@ DIGIT_9
Definition: keymap.h:159
LEN
#define LEN
Definition: tin.h:854
CONFIG_SCOPE_MENU
@ CONFIG_SCOPE_MENU
Definition: keymap.h:172
GLOBAL_SEARCH_AUTHOR_BACKWARD
@ GLOBAL_SEARCH_AUTHOR_BACKWARD
Definition: keymap.h:217
t_function
enum defined_functions t_function
Definition: keymap.h:373
process_mapping
static t_bool process_mapping(char *keyname, char *keys)
Definition: keymap.c:553
PAGE_TOP_THREAD
@ PAGE_TOP_THREAD
Definition: keymap.h:301
func_to_key
char func_to_key(t_function func, const struct keylist keys)
Definition: keymap.c:124
page_keys
struct keylist page_keys
Definition: keymap.c:70
GLOBAL_FIRST_PAGE
@ GLOBAL_FIRST_PAGE
Definition: keymap.h:190
GROUP_MARK_THREAD_READ
@ GROUP_MARK_THREAD_READ
Definition: keymap.h:238
THREAD_SELECT_ARTICLE
@ THREAD_SELECT_ARTICLE
Definition: keymap.h:365
SELECT_UNSUBSCRIBE_PATTERN
@ SELECT_UNSUBSCRIBE_PATTERN
Definition: keymap.h:354
GLOBAL_POST
@ GLOBAL_POST
Definition: keymap.h:203
add_key
static t_bool add_key(struct keylist *keys, const char key, t_function func, t_bool override)
Definition: keymap.c:148
POST_CANCEL
@ POST_CANCEL
Definition: keymap.h:311
KEYMAP_VERSION
#define KEYMAP_VERSION
Definition: version.h:54
catchup
static t_bool catchup
Definition: main.c:57
SCOPE_ADD
@ SCOPE_ADD
Definition: keymap.h:334
POSTPROCESS_NO
@ POSTPROCESS_NO
Definition: keymap.h:327
PAGE_GOTO_PARENT
@ PAGE_GOTO_PARENT
Definition: keymap.h:272
post_post_keys
struct keylist post_post_keys
Definition: keymap.c:82
GROUP_SELECT_THREAD
@ GROUP_SELECT_THREAD
Definition: keymap.h:250
post_mail_fup_keys
struct keylist post_mail_fup_keys
Definition: keymap.c:81
SELECT_ENTER_NEXT_UNREAD_GROUP
@ SELECT_ENTER_NEXT_UNREAD_GROUP
Definition: keymap.h:341
GROUP_MAIL
@ GROUP_MAIL
Definition: keymap.h:237
PAGE_TOGGLE_HIGHLIGHTING
@ PAGE_TOGGLE_HIGHLIGHTING
Definition: keymap.h:295
info_keys
struct keylist info_keys
Definition: keymap.c:68
MAXKEYLEN
#define MAXKEYLEN
Definition: keymap.h:136
THREAD_MARK_ARTICLE_READ
@ THREAD_MARK_ARTICLE_READ
Definition: keymap.h:360
SELECT_GOTO
@ SELECT_GOTO
Definition: keymap.h:342
PAGE_BOTTOM_THREAD
@ PAGE_BOTTOM_THREAD
Definition: keymap.h:266
keylist
Definition: keymap.h:386
THREAD_SAVE
@ THREAD_SAVE
Definition: keymap.h:364
scope_keys
struct keylist scope_keys
Definition: keymap.c:87
PAGE_PREVIOUS_UNREAD_ARTICLE
@ PAGE_PREVIOUS_UNREAD_ARTICLE
Definition: keymap.h:285
filter_keys
struct keylist filter_keys
Definition: keymap.c:66
GLOBAL_MENU_FILTER_KILL
@ GLOBAL_MENU_FILTER_KILL
Definition: keymap.h:197
KEYMAP_FILE
#define KEYMAP_FILE
Definition: tin.h:741
key_to_func
t_function key_to_func(const char key, const struct keylist keys)
Definition: keymap.c:97
GLOBAL_SET_RANGE
@ GLOBAL_SET_RANGE
Definition: keymap.h:221
GROUP_DO_AUTOSELECT
@ GROUP_DO_AUTOSELECT
Definition: keymap.h:234
free_keymaps
void free_keymaps(void)
Definition: keymap.c:230
GROUP_PREVIOUS_UNREAD_ARTICLE
@ GROUP_PREVIOUS_UNREAD_ARTICLE
Definition: keymap.h:244
POST_POSTPONE
@ POST_POSTPONE
Definition: keymap.h:322
FEED_HOT
@ FEED_HOT
Definition: keymap.h:178
THREAD_CANCEL
@ THREAD_CANCEL
Definition: keymap.h:358
GROUP_NEXT_GROUP
@ GROUP_NEXT_GROUP
Definition: keymap.h:240
SELECT_NEXT_UNREAD_GROUP
@ SELECT_NEXT_UNREAD_GROUP
Definition: keymap.h:345
FALSE
#define FALSE
Definition: bool.h:70
SELECT_MOVE_GROUP
@ SELECT_MOVE_GROUP
Definition: keymap.h:344
strsep
char * strsep(char **stringp, const char *delim)
Definition: string.c:503
ATTACHMENT_UNTAG
@ ATTACHMENT_UNTAG
Definition: keymap.h:166
PAGE_TOGGLE_TEX2ISO
@ PAGE_TOGGLE_TEX2ISO
Definition: keymap.h:299
PAGE_TOGGLE_TABS
@ PAGE_TOGGLE_TABS
Definition: keymap.h:298
GROUP_GOTO
@ GROUP_GOTO
Definition: keymap.h:235
GLOBAL_QUIT_TIN
@ GLOBAL_QUIT_TIN
Definition: keymap.h:211
SELECT_SYNC_WITH_ACTIVE
@ SELECT_SYNC_WITH_ACTIVE
Definition: keymap.h:350
GLOBAL_PAGE_UP
@ GLOBAL_PAGE_UP
Definition: keymap.h:201
THREAD_UNDO_SELECTIONS
@ THREAD_UNDO_SELECTIONS
Definition: keymap.h:369
KEYSEPS
#define KEYSEPS
Definition: keymap.c:319
keynode
Definition: keymap.h:376
joinpath
void joinpath(char *result, size_t result_size, const char *dir, const char *file)
Definition: joinpath.c:50
free_keylist
static void free_keylist(struct keylist *keys)
Definition: keymap.c:218
PROMPT_YES
@ PROMPT_YES
Definition: keymap.h:331
THREAD_MAIL
@ THREAD_MAIL
Definition: keymap.h:359
snprintf
#define snprintf
Definition: tin.h:2417
txt_keymap_invalid_key
constext txt_keymap_invalid_key[]
Definition: lang.c:585
GLOBAL_SEARCH_REPEAT
@ GLOBAL_SEARCH_REPEAT
Definition: keymap.h:216
PAGE_TOGGLE_RAW
@ PAGE_TOGGLE_RAW
Definition: keymap.h:296
DIGIT_2
@ DIGIT_2
Definition: keymap.h:152
GROUP_READ_BASENOTE
@ GROUP_READ_BASENOTE
Definition: keymap.h:245
txt_keymap_upgraded
constext txt_keymap_upgraded[]
Definition: lang.c:587
error_message
void error_message(unsigned int sdelay, const char *fmt,...)
Definition: screen.c:184
GROUP_UNTAG
@ GROUP_UNTAG
Definition: keymap.h:260
CONFIG_SELECT
@ CONFIG_SELECT
Definition: keymap.h:173
keynode::key
char key
Definition: keymap.h:380
post_edit_ext_keys
struct keylist post_edit_ext_keys
Definition: keymap.c:79
GLOBAL_HELP
@ GLOBAL_HELP
Definition: keymap.h:191
FEED_TAGGED
@ FEED_TAGGED
Definition: keymap.h:181
PAGE_CANCEL
@ PAGE_CANCEL
Definition: keymap.h:267
GLOBAL_ABORT
@ GLOBAL_ABORT
Definition: keymap.h:186
SELECT_UNSUBSCRIBE
@ SELECT_UNSUBSCRIBE
Definition: keymap.h:353
GLOBAL_QUICK_FILTER_SELECT
@ GLOBAL_QUICK_FILTER_SELECT
Definition: keymap.h:209
DIGIT_6
@ DIGIT_6
Definition: keymap.h:156
POST_SEND
@ POST_SEND
Definition: keymap.h:323
POST_SUPERSEDE
@ POST_SUPERSEDE
Definition: keymap.h:324
attachment_keys
struct keylist attachment_keys
Definition: keymap.c:62
PAGE_NEXT_UNREAD
@ PAGE_NEXT_UNREAD
Definition: keymap.h:279
PAGE_LIST_THREAD
@ PAGE_LIST_THREAD
Definition: keymap.h:274
THREAD_AUTOSAVE
@ THREAD_AUTOSAVE
Definition: keymap.h:357
t_bool
unsigned t_bool
Definition: bool.h:77
FEED_ARTICLE
@ FEED_ARTICLE
Definition: keymap.h:176
keylist::used
size_t used
Definition: keymap.h:388
TRUE
#define TRUE
Definition: bool.h:74
CONFIG_RESET_ATTRIB
@ CONFIG_RESET_ATTRIB
Definition: keymap.h:171
PAGE_REPLY
@ PAGE_REPLY
Definition: keymap.h:287
post_cancel_keys
struct keylist post_cancel_keys
Definition: keymap.c:75
SELECT_YANK_ACTIVE
@ SELECT_YANK_ACTIVE
Definition: keymap.h:356
SCOPE_EDIT_ATTRIBUTES_FILE
@ SCOPE_EDIT_ATTRIBUTES_FILE
Definition: keymap.h:336
GLOBAL_REDRAW_SCREEN
@ GLOBAL_REDRAW_SCREEN
Definition: keymap.h:212
txt_esc
constext txt_esc[]
Definition: lang.c:267
GLOBAL_TOGGLE_INVERSE_VIDEO
@ GLOBAL_TOGGLE_INVERSE_VIDEO
Definition: keymap.h:230
POST_IGNORE_FUPTO
@ POST_IGNORE_FUPTO
Definition: keymap.h:314
prompt_continue
void prompt_continue(void)
Definition: prompt.c:774
POSTPROCESS_SHAR
@ POSTPROCESS_SHAR
Definition: keymap.h:328
PAGE_MAIL
@ PAGE_MAIL
Definition: keymap.h:275
GLOBAL_SEARCH_BODY
@ GLOBAL_SEARCH_BODY
Definition: keymap.h:215
printascii
char * printascii(char *buf, int ch)
Definition: keymap.c:271
PAGE_GROUP_SELECT
@ PAGE_GROUP_SELECT
Definition: keymap.h:273
get_val
const char * get_val(const char *env, const char *def)
Definition: misc.c:355
GROUP_TAG
@ GROUP_TAG
Definition: keymap.h:252
DIGIT_1
@ DIGIT_1
Definition: keymap.h:151
GLOBAL_QUIT
@ GLOBAL_QUIT
Definition: keymap.h:210
PAGE_AUTOSAVE
@ PAGE_AUTOSAVE
Definition: keymap.h:265
t_version
Definition: tin.h:2470
SELECT_RESET_NEWSRC
@ SELECT_RESET_NEWSRC
Definition: keymap.h:346
GROUP_SELECT_THREAD_IF_UNREAD_SELECTED
@ GROUP_SELECT_THREAD_IF_UNREAD_SELECTED
Definition: keymap.h:251
GROUP_AUTOSAVE
@ GROUP_AUTOSAVE
Definition: keymap.h:232
check_upgrade
struct t_version * check_upgrade(char *line, const char *skip, const char *version)
Definition: version.c:65
PAGE_TOGGLE_ROT13
@ PAGE_TOGGLE_ROT13
Definition: keymap.h:297
feed_type_keys
struct keylist feed_type_keys
Definition: keymap.c:65
NOT_ASSIGNED
@ NOT_ASSIGNED
Definition: keymap.h:149
CONFIG_TOGGLE_ATTRIB
@ CONFIG_TOGGLE_ATTRIB
Definition: keymap.h:175
txt_tab
constext txt_tab[]
Definition: lang.c:858
POSTPROCESS_YES
@ POSTPROCESS_YES
Definition: keymap.h:329
ATTACHMENT_TOGGLE_TAGGED
@ ATTACHMENT_TOGGLE_TAGGED
Definition: keymap.h:165
txt_keymap_invalid_name
constext txt_keymap_invalid_name[]
Definition: lang.c:586
THREAD_UNTAG
@ THREAD_UNTAG
Definition: keymap.h:370
add_global_keys
static void add_global_keys(struct keylist *keys)
Definition: keymap.c:2960
my_malloc
#define my_malloc(size)
Definition: tin.h:2196