tin  2.6.1
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.6.1.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 : 2021-02-23
7 * Notes : This file contains key mapping routines and variables.
8 *
9 * Copyright (c) 2000-2022 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 */
50static void add_default_key(struct keylist *key_list, const char *keys, t_function func);
51static void add_global_keys(struct keylist *keys);
52static void free_keylist(struct keylist *keys);
53static void upgrade_keymap_file(char *old);
54static t_bool process_keys(t_function func, const char *keys, struct keylist *kl);
55static 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
62struct keylist attachment_keys = { NULL, 0, 0};
63struct keylist feed_post_process_keys = { NULL, 0, 0 };
64struct keylist feed_supersede_article_keys = { NULL, 0, 0 };
65struct keylist feed_type_keys = { NULL, 0, 0 };
66struct keylist filter_keys = { NULL, 0, 0 };
67struct keylist group_keys = { NULL, 0, 0 };
68struct keylist info_keys = { NULL, 0, 0 };
69struct keylist option_menu_keys = { NULL, 0, 0 };
70struct 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 */
75struct keylist post_cancel_keys = { NULL, 0, 0 };
76struct keylist post_continue_keys = { NULL, 0, 0 };
77struct keylist post_delete_keys = { NULL, 0, 0 };
78struct keylist post_edit_keys = { NULL, 0, 0 };
79struct keylist post_edit_ext_keys = { NULL, 0, 0 };
80struct keylist post_ignore_fupto_keys = { NULL, 0, 0 };
81struct keylist post_mail_fup_keys = { NULL, 0, 0 };
82struct keylist post_hist_keys = { NULL, 0, 0 };
83struct keylist post_post_keys = { NULL, 0, 0 };
84struct keylist post_postpone_keys = { NULL, 0, 0 };
85struct keylist post_send_keys = { NULL, 0, 0 };
86struct keylist prompt_keys = { NULL, 0, 0 };
87struct keylist save_append_overwrite_keys = { NULL, 0, 0 };
88struct keylist scope_keys = { NULL, 0, 0 };
89struct keylist select_keys = { NULL, 0, 0 };
90struct keylist thread_keys = { NULL, 0, 0 };
91struct keylist url_keys = { NULL, 0, 0 };
92
93
94/*
95 * lookup the associated function to the specified key
96 */
99#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
100 const wchar_t key,
101#else
102 const char key,
103#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
104 const struct keylist keys)
105{
106 size_t i;
107
108 for (i = 0; i < keys.used; i++) {
109 if (keys.list[i].key == key)
110 return keys.list[i].function;
111 }
112
113 return NOT_ASSIGNED;
114}
115
116
117/*
118 * lookup the associated key to the specified function
119 */
120#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
121wchar_t
122#else
123char
124#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
127 const struct keylist keys)
128{
129 size_t i;
130
131 for (i = 0; i < keys.used; i++) {
132 if (keys.list[i].function == func)
133 return keys.list[i].key;
134 }
135#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
136 return (wchar_t) '?';
137#else
138 return '?';
139#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
140}
141
142
143/*
144 * adds a key to a keylist
145 * default_key: TRUE if a default key should be added
146 * returns TRUE if the key was successfully added else FALSE
147 */
148static t_bool
150 struct keylist *keys,
151#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
152 const wchar_t key,
153#else
154 const char key,
155#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
157 t_bool override)
158{
159 size_t i;
160 struct keynode *entry = NULL;
161
162 /* is a function already associated with this key */
163 for (i = 0; key != '\0' && i < keys->used; i++) {
164 if (keys->list[i].key == key)
165 entry = &keys->list[i];
166 }
167
168 if (entry != NULL) {
169 if (override) {
170 entry->function = func;
171 return TRUE;
172 } else
173 return FALSE;
174 } else {
175 /* add a new entry */
176 if (keys->used >= keys->max) {
177 if (keys->list == NULL) {
178 keys->max = DEFAULT_MAPKEYS_NUM;
179 keys->list = my_malloc(keys->max * sizeof(struct keynode));
180 } else {
181 keys->max++;
182 keys->list = my_realloc(keys->list, keys->max * sizeof(struct keynode));
183 }
184 }
185 keys->list[keys->used].key = key;
186 keys->list[keys->used].function = func;
187 keys->used++;
188
189 return TRUE;
190 }
191}
192
193
194/*
195 * FIXME:
196 * as long as we use only ASCII for default keys no need to change 'keys' to wchar_t
197 */
198static void
200 struct keylist *key_list,
201 const char *keys,
203{
204 const char *key = keys;
205 /* check if the function has already a key assigned before we add the default one */
206 if (func_to_key(func, *key_list) != '?')
207 return;
208
209 for (; *key != '\0'; key++)
210#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
211 add_key(key_list, (wchar_t) *key, func, FALSE);
212#else
213 add_key(key_list, *key, func, FALSE);
214#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
215}
216
217
218static void
220 struct keylist *keys)
221{
222 FreeAndNull(keys->list);
223 keys->used = keys->max = 0;
224}
225
226
227/*
228 * Free all memory for keymaps.
229 */
230void
232 void)
233{
253#ifdef HAVE_PGP_GPG
254 free_keylist(&pgp_mail_keys);
255 free_keylist(&pgp_news_keys);
256#endif /* HAVE_PGP_GPG */
264}
265
266
267/*
268 * Render ch in human readable ASCII
269 * Is there no lib function to do this ?
270 * *buf must have a size of at least MAXKEYLEN
271 */
272char *
274 char *buf,
275#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
276 wint_t ch)
277#else
278 int ch)
279#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
280{
281 if (ch == 0)
282 snprintf(buf, MAXKEYLEN, "%s", _("NULL"));
283#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
284 else if (iswgraph(ch)) { /* Regular printables */
285 int i = wctomb(buf, (wchar_t) ch);
286
287 if (i > 0)
288 buf[i] = '\0';
289 else
290 buf[0] = '\0';
291 }
292#else
293 else if (isgraph(ch)) { /* Regular printables */
294 buf[0] = ch;
295 buf[1] = '\0';
296 }
297#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
298 else if (ch == '\t') { /* TAB */
299 snprintf(buf, MAXKEYLEN, "%s", _(txt_tab));
300 } else if ((ch == '\n') || (ch == '\r')) { /* LF, CR */
301 snprintf(buf, MAXKEYLEN, "%s", _(txt_cr));
302 } else if (ch == ESC) { /* Escape */
303 snprintf(buf, MAXKEYLEN, "%s", _(txt_esc));
304#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
305 } else if (iswcntrl(ch)) { /* Control keys */
306#else
307 } else if (iscntrl(ch)) { /* Control keys */
308#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
309 buf[0] = '^';
310 buf[1] = (char) (((int) ch & 0xFF) + '@');
311 buf[2] = '\0';
312 } else if (ch == ' ') /* SPACE */
313 snprintf(buf, MAXKEYLEN, "%s", _(txt_space));
314 else
315 strcpy(buf, "???"); /* Never happens? */
316
317 return buf;
318}
319
320
321#define KEYSEPS " \t\n"
322/*
323 * read the keymap file
324 * returns TRUE if the keymap file was read without an error else FALSE
325 */
326t_bool
328 void)
329{
330 FILE *fp = (FILE *) 0;
331 char *line, *keydef, *kname;
332 char *map, *ptr;
333 char buf[LEN], buff[NAME_LEN + 1], filename[PATH_LEN];
334 struct t_version *upgrade = NULL;
335 t_bool ret = TRUE;
336
337 /*
338 * checks TIN_HOMEDIR/HOME/TIN_DEFAULTS_DIR
339 * for KEYMAP_FILE."locale" or KEYMAP_FILE
340 *
341 * locale is first match from LC_ALL, LC_CTYPE, LC_MESSAGES, LANG
342 *
343 * TODO: LC_CTYPE has higher priority than LC_MESSAGES, does this make sense?
344 */
345 /* get locale suffix */
346 map = my_strdup(get_val("LC_ALL", get_val("LC_CTYPE", get_val("LC_MESSAGES", get_val("LANG", "")))));
347 if (strlen(map)) {
348 if ((ptr = strchr(map, '.')))
349 *ptr = '\0';
350 snprintf(buff, sizeof(buff), "%s.%s", KEYMAP_FILE, map);
351 joinpath(filename, sizeof(filename), rcdir, buff);
352 fp = fopen(filename, "r");
353 }
354 if (!fp) {
355 joinpath(filename, sizeof(filename), rcdir, KEYMAP_FILE);
356 fp = fopen(filename, "r");
357 }
358#ifdef TIN_DEFAULTS_DIR
359 if (strlen(map) && !fp) {
360 joinpath(filename, sizeof(filename), TIN_DEFAULTS_DIR, buff);
361 fp = fopen(filename, "r");
362 }
363 if (!fp) {
364 joinpath(filename, sizeof(filename), TIN_DEFAULTS_DIR, KEYMAP_FILE);
365 fp = fopen(filename, "r");
366 }
367#endif /* TIN_DEFAULTS_DIR */
368
369 FreeIfNeeded(map);
370
371 if (!fp)
372 return TRUE; /* no keymap file is not an error */
373
374 map = my_strdup(filename); /* remember keymap-name */
375
376 /* check if keymap file is up-to-date */
377 while ((line = fgets(buf, sizeof(buf), fp)) != NULL) {
378 if (line[0] == '#') {
379 if (upgrade == NULL && match_string(buf, "# Keymap file V", NULL, 0)) {
380 /* TODO: keymap downgrade */
381 upgrade = check_upgrade(line, "# Keymap file V", KEYMAP_VERSION);
382 if (upgrade->state == RC_UPGRADE) {
383 fclose(fp);
385 upgrade->state = RC_IGNORE;
386 if (!(fp = fopen(map, "r"))) { /* TODO: issue error message? */
387 free(map);
388 FreeAndNull(upgrade);
389 return TRUE;
390 }
391 }
392 break;
393 }
394 }
395 }
396 rewind(fp);
397
398 free_keymaps();
399 while ((line = fgets(buf, sizeof(buf), fp)) != NULL) {
400 /*
401 * Ignore blank and comment lines
402 */
403 if (line[0] == '#' || line[0] == '\n')
404 continue;
405
406 if ((kname = strsep(&line, KEYSEPS)) != NULL) {
407 keydef = str_trim(line);
408 /*
409 * Warn about basic syntax errors
410 */
411 if (keydef == NULL || !strlen(keydef)) {
413 ret = FALSE;
414 continue;
415 }
416 } else
417 continue;
418
419 /*
420 * TODO: useful? shared keymaps (NFS-Home) may differ
421 * depending on the OS (i.e. one tin has color the other has not)
422 */
423 if (!process_mapping(kname, keydef)) {
426 ret = FALSE;
427 continue;
428 }
429
430 }
431 fclose(fp);
433 if (upgrade && upgrade->state != RC_IGNORE)
434 upgrade_prompt_quit(upgrade, map);
435
436 free(map);
437 FreeAndNull(upgrade);
438 return ret;
439}
440
441
442/*
443 * associate the keys with the internal function and add them to the keylist
444 * returns TRUE if all keys could be recognized else FALSE
445 */
446static t_bool
449 const char *keys,
450 struct keylist *kl)
451{
452 char *keydef, *tmp;
453 t_bool error, ret = TRUE;
454#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
455 wchar_t *wkeydef;
456 wchar_t key = '\0';
457#else
458 char key = '\0';
459#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
460
461 tmp = my_strdup(keys); /* don't change "keys" */
462 keydef = strtok(tmp, KEYSEPS);
463
464 while (keydef != NULL) {
465 error = FALSE;
466#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
467 if ((wkeydef = char2wchar_t(keydef)) == NULL) {
468 error_message(1, _(txt_invalid_multibyte_sequence));
469 ret = FALSE;
470
471 keydef = strtok(NULL, KEYSEPS);
472 continue;
473 }
474#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
475
476 /*
477 * Parse the key sequence into 'key'
478 * Special sequences are:
479 * ^A -> control chars
480 * TAB -> ^I
481 * SPACE -> ' '
482 */
483#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
484 if (wcslen(wkeydef) > 1) {
485 switch (wkeydef[0]) /* Only test 1st char - crude but effective */
486#else
487 if (strlen(keydef) > 1) {
488 switch (keydef[0]) /* Only test 1st char - crude but effective */
489#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
490 {
491 case 'N':
492 key = '\0';
493 break;
494
495 case 'S':
496 key = ' ';
497 break;
498
499 case 'T':
500 key = ctrl('I');
501 break;
502
503 case '^':
504#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
505 /* allow only ^A to ^Z */
506 if (wkeydef[1] >= 'A' && wkeydef[1] <= 'Z') {
507 key = ctrl(wkeydef[1]);
508 break;
509 }
510#else
511 if (isupper((int)(unsigned char) keydef[1])) {
512 key = ctrl(keydef[1]);
513 break;
514 }
515#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
516 /* FALLTHROUGH */
517 default:
519 ret = FALSE;
520 error = TRUE;
521 break;
522 }
523 } else {
524#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
525 if (iswdigit((wint_t) (key = wkeydef[0])))
526#else
527 if (isdigit(key = keydef[0]))
528#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
529 {
531 ret = FALSE;
532 error = TRUE;
533 }
534 }
535
536 if (!error)
537 add_key(kl, key, func, TRUE);
538
539 keydef = strtok(NULL, KEYSEPS);
540#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
541 FreeIfNeeded(wkeydef);
542#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
543 }
544 free(tmp);
545
546 return ret;
547}
548
549
550/*
551 * map a keyname to the internal function name and assign the keys
552 * returns TRUE if a mapping was found else FALSE
553 */
554static t_bool
556 char *keyname, /* Keyname we're searching for */
557 char *keys) /* Key to assign to keyname if found */
558{
559 switch (keyname[0]) {
560 case 'A':
561 if (strcmp(keyname, "AttachPipe") == 0) {
563
564 return TRUE;
565 }
566 if (strcmp(keyname, "AttachSelect") == 0) {
568
569 return TRUE;
570 }
571 if (strcmp(keyname, "AttachSave") == 0) {
573
574 return TRUE;
575 }
576 if (strcmp(keyname, "AttachTag") == 0) {
578
579 return TRUE;
580 }
581 if (strcmp(keyname, "AttachTagPattern") == 0) {
583
584 return TRUE;
585 }
586 if (strcmp(keyname, "AttachToggleTagged") == 0) {
588
589 return TRUE;
590 }
591 if (strcmp(keyname, "AttachUntag") == 0) {
593
594 return TRUE;
595 }
596 break;
597
598 case 'B':
599 if (strcmp(keyname, "BugReport") == 0) {
605
606 return TRUE;
607 }
608 break;
609
610 case 'C':
611 if (strcmp(keyname, "Catchup") == 0) {
616
617 return TRUE;
618 }
619 if (strcmp(keyname, "CatchupNextUnread") == 0) {
624
625 return TRUE;
626 }
627 if (strcmp(keyname, "ConfigFirstPage") == 0) {
629
630 return TRUE;
631 }
632 if (strcmp(keyname, "ConfigLastPage") == 0) {
634
635 return TRUE;
636 }
637 if (strcmp(keyname, "ConfigNoSave") == 0) {
639
640 return TRUE;
641 }
642 if (strcmp(keyname, "ConfigResetAttrib") == 0) {
644
645 return TRUE;
646 }
647 if (strcmp(keyname, "ConfigScopeMenu") == 0) {
649
650 return TRUE;
651 }
652 if (strcmp(keyname, "ConfigSelect") == 0) {
654
655 return TRUE;
656 }
657 if (strcmp(keyname, "ConfigToggleAttrib") == 0) {
659
660 return TRUE;
661 }
662 break;
663
664 case 'D':
665 if (strcmp(keyname, "DisplayPostHist") == 0) {
670
671 return TRUE;
672 }
673 if (strcmp(keyname, "Down") == 0) {
684
685 return TRUE;
686 }
687 break;
688
689 case 'E':
690 if (strcmp(keyname, "EditFilter") == 0) {
695
696 return TRUE;
697 }
698 break;
699
700 case 'F':
701 if (strcmp(keyname, "FeedArt") == 0) {
703
704 return TRUE;
705 }
706 if (strcmp(keyname, "FeedHot") == 0) {
708
709 return TRUE;
710 }
711 if (strcmp(keyname, "FeedPat") == 0) {
713
714 return TRUE;
715 }
716 if (strcmp(keyname, "FeedRange") == 0) {
718
719 return TRUE;
720 }
721 if (strcmp(keyname, "FeedRepost") == 0) {
723
724 return TRUE;
725 }
726 if (strcmp(keyname, "FeedSupersede") == 0) {
728
729 return TRUE;
730 }
731 if (strcmp(keyname, "FeedTag") == 0) {
733
734 return TRUE;
735 }
736 if (strcmp(keyname, "FeedThd") == 0) {
738
739 return TRUE;
740 }
741 if (strcmp(keyname, "FilterEdit") == 0) {
743
744 return TRUE;
745 }
746 if (strcmp(keyname, "FilterSave") == 0) {
748
749 return TRUE;
750 }
751 if (strcmp(keyname, "FirstPage") == 0) {
762
763 return TRUE;
764 }
765 break;
766
767 case 'G':
768 if (strcmp(keyname, "GroupAutoSave") == 0) {
770
771 return TRUE;
772 }
773 if (strcmp(keyname, "GroupCancel") == 0) {
775
776 return TRUE;
777 }
778 if (strcmp(keyname, "GroupDoAutoSel") == 0) {
780
781 return TRUE;
782 }
783 if (strcmp(keyname, "GroupGoto") == 0) {
785
786 return TRUE;
787 }
788 if (strcmp(keyname, "GroupListThd") == 0) {
790
791 return TRUE;
792 }
793 if (strcmp(keyname, "GroupMail") == 0) {
795
796 return TRUE;
797 }
798 if (strcmp(keyname, "GroupMarkThdRead") == 0) {
800
801 return TRUE;
802 }
803 if (strcmp(keyname, "GroupMarkUnselArtRead") == 0) {
805
806 return TRUE;
807 }
808 if (strcmp(keyname, "GroupNextGroup") == 0) {
810
811 return TRUE;
812 }
813 if (strcmp(keyname, "GroupNextUnreadArt") == 0) {
815
816 return TRUE;
817 }
818 if (strcmp(keyname, "GroupNextUnreadArtOrGrp") == 0) {
820
821 return TRUE;
822 }
823 if (strcmp(keyname, "GroupPrevGroup") == 0) {
825
826 return TRUE;
827 }
828 if (strcmp(keyname, "GroupPrevUnreadArt") == 0) {
830
831 return TRUE;
832 }
833 if (strcmp(keyname, "GroupReadBasenote") == 0) {
835
836 return TRUE;
837 }
838 if (strcmp(keyname, "GroupRepost") == 0) {
840
841 return TRUE;
842 }
843 if (strcmp(keyname, "GroupReverseSel") == 0) {
845
846 return TRUE;
847 }
848 if (strcmp(keyname, "GroupSave") == 0) {
850
851 return TRUE;
852 }
853 if (strcmp(keyname, "GroupSelPattern") == 0) {
855
856 return TRUE;
857 }
858 if (strcmp(keyname, "GroupSelThd") == 0) {
860
861 return TRUE;
862 }
863 if (strcmp(keyname, "GroupSelThdIfUnreadSelected") == 0) {
865
866 return TRUE;
867 }
868 if (strcmp(keyname, "GroupTag") == 0) {
870
871 return TRUE;
872 }
873 if (strcmp(keyname, "GroupTagParts") == 0) {
875
876 return TRUE;
877 }
878 if (strcmp(keyname, "GroupToggleGetartLimit") == 0) {
880
881 return TRUE;
882 }
883 if (strcmp(keyname, "GroupToggleReadUnread") == 0) {
885
886 return TRUE;
887 }
888 if (strcmp(keyname, "GroupToggleSubjDisplay") == 0) {
890
891 return TRUE;
892 }
893 if (strcmp(keyname, "GroupToggleThdSel") == 0) {
895
896 return TRUE;
897 }
898 if (strcmp(keyname, "GroupToggleThreading") == 0) {
900
901 return TRUE;
902 }
903 if (strcmp(keyname, "GroupUndoSel") == 0) {
905
906 return TRUE;
907 }
908 if (strcmp(keyname, "GroupUntag") == 0) {
910
911 return TRUE;
912 }
913 break;
914
915 case 'H':
916 if (strcmp(keyname, "Help") == 0) {
926
927 return TRUE;
928 }
929 if (strcmp(keyname, "HelpFirstPage") == 0) {
931
932 return TRUE;
933 }
934 if (strcmp(keyname, "HelpLastPage") == 0) {
936
937 return TRUE;
938 }
939 break;
940
941 case 'L':
942 if (strcmp(keyname, "LastPage") == 0) {
953
954 return TRUE;
955 }
956 if (strcmp(keyname, "LastViewed") == 0) {
960
961 return TRUE;
962 }
963 if (strcmp(keyname, "LookupMessage") == 0) {
966#ifdef NNTP_ABLE
968#endif /* NNTP_ABLE */
970
971 return TRUE;
972 }
973 break;
974
975 case 'M':
976 if (strcmp(keyname, "MarkArticleUnread") == 0) {
980
981 return TRUE;
982 }
983 if (strcmp(keyname, "MarkThreadUnread") == 0) {
987
988 return TRUE;
989 }
990 if (strcmp(keyname, "MarkFeedRead") == 0) {
993
994 return TRUE;
995 }
996 if (strcmp(keyname, "MarkFeedUnread") == 0) {
999
1000 return TRUE;
1001 }
1002 if (strcmp(keyname, "MenuFilterKill") == 0) {
1006
1007 return TRUE;
1008 }
1009 if (strcmp(keyname, "MenuFilterSelect") == 0) {
1013
1014 return TRUE;
1015 }
1016 break;
1017
1018 case 'O':
1019 if (strcmp(keyname, "OptionMenu") == 0) {
1026
1027 return TRUE;
1028 }
1029 break;
1030
1031 case 'P':
1032 if (strcmp(keyname, "PageAutoSave") == 0) {
1034
1035 return TRUE;
1036 }
1037 if (strcmp(keyname, "PageBotThd") == 0) {
1039
1040 return TRUE;
1041 }
1042 if (strcmp(keyname, "PageCancel") == 0) {
1044
1045 return TRUE;
1046 }
1047 if (strcmp(keyname, "PageDown") == 0) {
1058
1059 return TRUE;
1060 }
1061 if (strcmp(keyname, "PageEditArticle") == 0) {
1063
1064 return TRUE;
1065 }
1066 if (strcmp(keyname, "PageFirstPage") == 0) {
1068
1069 return TRUE;
1070 }
1071 if (strcmp(keyname, "PageFollowup") == 0) {
1073
1074 return TRUE;
1075 }
1076 if (strcmp(keyname, "PageFollowupQuote") == 0) {
1078
1079 return TRUE;
1080 }
1081 if (strcmp(keyname, "PageFollowupQuoteHeaders") == 0) {
1083
1084 return TRUE;
1085 }
1086 if (strcmp(keyname, "PageGotoParent") == 0) {
1088
1089 return TRUE;
1090 }
1091 if (strcmp(keyname, "PageGroupSel") == 0) {
1093
1094 return TRUE;
1095 }
1096 if (strcmp(keyname, "PageLastPage") == 0) {
1098
1099 return TRUE;
1100 }
1101 if (strcmp(keyname, "PageListThd") == 0) {
1103
1104 return TRUE;
1105 }
1106 if (strcmp(keyname, "PageKillThd") == 0) {
1108
1109 return TRUE;
1110 }
1111 if (strcmp(keyname, "PageMail") == 0) {
1113
1114 return TRUE;
1115 }
1116 if (strcmp(keyname, "PageNextArt") == 0) {
1118
1119 return TRUE;
1120 }
1121 if (strcmp(keyname, "PageNextThd") == 0) {
1123
1124 return TRUE;
1125 }
1126 if (strcmp(keyname, "PageNextUnread") == 0) {
1128
1129 return TRUE;
1130 }
1131 if (strcmp(keyname, "PageNextUnreadArt") == 0) {
1133
1134 return TRUE;
1135 }
1136 if (strcmp(keyname, "PagePGPCheckArticle") == 0) {
1137#ifdef HAVE_PGP_GPG
1138 process_keys(PAGE_PGP_CHECK_ARTICLE, keys, &page_keys);
1139#endif /* HAVE_PGP_GPG */
1140
1141 return TRUE;
1142 }
1143 if (strcmp(keyname, "PagePrevArt") == 0) {
1145
1146 return TRUE;
1147 }
1148 if (strcmp(keyname, "PagePrevUnreadArt") == 0) {
1150
1151 return TRUE;
1152 }
1153 if (strcmp(keyname, "PageReply") == 0) {
1155
1156 return TRUE;
1157 }
1158 if (strcmp(keyname, "PageReplyQuote") == 0) {
1160
1161 return TRUE;
1162 }
1163 if (strcmp(keyname, "PageReplyQuoteHeaders") == 0) {
1165
1166 return TRUE;
1167 }
1168 if (strcmp(keyname, "PageRepost") == 0) {
1170
1171 return TRUE;
1172 }
1173 if (strcmp(keyname, "PageReveal") == 0) {
1175
1176 return TRUE;
1177 }
1178 if (strcmp(keyname, "PageSave") == 0) {
1180
1181 return TRUE;
1182 }
1183 if (strcmp(keyname, "PageSkipIncludedText") == 0) {
1185
1186 return TRUE;
1187 }
1188 if (strcmp(keyname, "PageTag") == 0) {
1190
1191 return TRUE;
1192 }
1193 if (strcmp(keyname, "PageTopThd") == 0) {
1195
1196 return TRUE;
1197 }
1198 if (strcmp(keyname, "PageToggleAllHeaders") == 0) {
1200
1201 return TRUE;
1202 }
1203 if (strcmp(keyname, "PageToggleHighlight") == 0) {
1205
1206 return TRUE;
1207 }
1208 if (strcmp(keyname, "PageToggleRaw") == 0) {
1210
1211 return TRUE;
1212 }
1213 if (strcmp(keyname, "PageToggleRot") == 0) {
1215
1216 return TRUE;
1217 }
1218 if (strcmp(keyname, "PageToggleTabs") == 0) {
1220
1221 return TRUE;
1222 }
1223 if (strcmp(keyname, "PageToggleTex2iso") == 0) {
1225
1226 return TRUE;
1227 }
1228 if (strcmp(keyname, "PageToggleUue") == 0) {
1230
1231 return TRUE;
1232 }
1233 if (strcmp(keyname, "PageUp") == 0) {
1244
1245 return TRUE;
1246 }
1247 if (strcmp(keyname, "PageViewAttach") == 0) {
1249
1250 return TRUE;
1251 }
1252 if (strcmp(keyname, "PageViewUrl") == 0) {
1254
1255 return TRUE;
1256 }
1257 if (strcmp(keyname, "PgpEncrypt") == 0) {
1258#ifdef HAVE_PGP_GPG
1259 process_keys(PGP_KEY_ENCRYPT, keys, &pgp_mail_keys);
1260#endif /* HAVE_PGP_GPG */
1261
1262 return TRUE;
1263 }
1264 if (strcmp(keyname, "PgpEncSign") == 0) {
1265#ifdef HAVE_PGP_GPG
1266 process_keys(PGP_KEY_ENCRYPT_SIGN, keys, &pgp_mail_keys);
1267#endif /* HAVE_PGP_GPG */
1268
1269 return TRUE;
1270 }
1271 if (strcmp(keyname, "PgpIncludekey") == 0) {
1272#ifdef HAVE_PGP_GPG
1273 process_keys(PGP_INCLUDE_KEY, keys, &pgp_news_keys);
1274#endif /* HAVE_PGP_GPG */
1275
1276 return TRUE;
1277 }
1278 if (strcmp(keyname, "PgpSign") == 0) {
1279#ifdef HAVE_PGP_GPG
1280 process_keys(PGP_KEY_SIGN, keys, &pgp_news_keys);
1281 process_keys(PGP_KEY_SIGN, keys, &pgp_mail_keys);
1282#endif /* HAVE_PGP_GPG */
1283
1284 return TRUE;
1285 }
1286 if (strcmp(keyname, "Pipe") == 0) {
1291
1292 return TRUE;
1293 }
1294 if (strcmp(keyname, "Post") == 0) {
1302
1303 return TRUE;
1304 }
1305 if (strcmp(keyname, "PostAbort") == 0) {
1307
1308 return TRUE;
1309 }
1310 if (strcmp(keyname, "PostCancel") == 0) {
1313
1314 return TRUE;
1315 }
1316 if (strcmp(keyname, "PostContinue") == 0) {
1318
1319 return TRUE;
1320 }
1321 if (strcmp(keyname, "PostEdit") == 0) {
1327
1328 return TRUE;
1329 }
1330 if (strcmp(keyname, "PostIgnore") == 0) {
1332
1333 return TRUE;
1334 }
1335 if (strcmp(keyname, "PostIspell") == 0) {
1336#ifdef HAVE_ISPELL
1337 process_keys(POST_ISPELL, keys, &post_post_keys);
1338 process_keys(POST_ISPELL, keys, &post_send_keys);
1339#endif /* HAVE_ISPELL */
1340
1341 return TRUE;
1342 }
1343 if (strcmp(keyname, "PostMail") == 0) {
1345
1346 return TRUE;
1347 }
1348 if (strcmp(keyname, "PostPGP") == 0) {
1349#ifdef HAVE_PGP_GPG
1350 process_keys(POST_PGP, keys, &post_post_keys);
1351 process_keys(POST_PGP, keys, &post_send_keys);
1352#endif /* HAVE_PGP_GPG */
1353
1354 return TRUE;
1355 }
1356 if (strcmp(keyname, "PostedArticlesSelect") == 0) {
1358
1359 return TRUE;
1360 }
1361 if (strcmp(keyname, "PostponeAll") == 0) {
1363
1364 return TRUE;
1365 }
1366 if (strcmp(keyname, "Postponed") == 0) {
1371
1372 return TRUE;
1373 }
1374 if (strcmp(keyname, "PostponeOverride") == 0) {
1376
1377 return TRUE;
1378 }
1379 if (strcmp(keyname, "PostPost") == 0) {
1383
1384 return TRUE;
1385 }
1386 if (strcmp(keyname, "PostPostpone") == 0) {
1389
1390 return TRUE;
1391 }
1392 if (strcmp(keyname, "PostSend") == 0) {
1394
1395 return TRUE;
1396 }
1397 if (strcmp(keyname, "PostSupersede") == 0) {
1399
1400 return TRUE;
1401 }
1402 if (strcmp(keyname, "PProcNo") == 0) {
1404
1405 return TRUE;
1406 }
1407 if (strcmp(keyname, "PProcShar") == 0) {
1409
1410 return TRUE;
1411 }
1412 if (strcmp(keyname, "PProcYes") == 0) {
1414
1415 return TRUE;
1416 }
1417 if (strcmp(keyname, "Print") == 0) {
1418#ifndef DISABLE_PRINTING
1422#endif /* !DISABLE_PRINTING */
1423
1424 return TRUE;
1425 }
1426 if (strcmp(keyname, "PromptNo") == 0) {
1429
1430 return TRUE;
1431 }
1432 if (strcmp(keyname, "PromptYes") == 0) {
1435
1436 return TRUE;
1437 }
1438 break;
1439
1440 case 'Q':
1441 if (strcmp(keyname, "QuickFilterKill") == 0) {
1444
1445 return TRUE;
1446 }
1447 if (strcmp(keyname, "QuickFilterSelect") == 0) {
1450
1451 return TRUE;
1452 }
1453 if (strcmp(keyname, "Quit") == 0) {
1464#ifdef HAVE_PGP_GPG
1465 process_keys(GLOBAL_QUIT, keys, &pgp_mail_keys);
1466 process_keys(GLOBAL_QUIT, keys, &pgp_news_keys);
1467#endif /* HAVE_PGP_GPG */
1484
1485 return TRUE;
1486 }
1487 if (strcmp(keyname, "QuitTin") == 0) {
1492
1493 return TRUE;
1494 }
1495 break;
1496
1497 case 'R':
1498 if (strcmp(keyname, "RedrawScr") == 0) {
1506
1507 return TRUE;
1508 }
1509 break;
1510
1511 case 'S':
1512 if (strcmp(keyname, "SaveAppendFile") == 0) {
1514
1515 return TRUE;
1516 }
1517 if (strcmp(keyname, "SaveOverwriteFile") == 0) {
1519
1520 return TRUE;
1521 }
1522 if (strcmp(keyname, "ScopeAdd") == 0) {
1524
1525 return TRUE;
1526 }
1527 if (strcmp(keyname, "ScopeDelete") == 0) {
1529
1530 return TRUE;
1531 }
1532 if (strcmp(keyname, "ScopeEditAttributesFile") == 0) {
1534
1535 return TRUE;
1536 }
1537 if (strcmp(keyname, "ScopeMove") == 0) {
1539
1540 return TRUE;
1541 }
1542 if (strcmp(keyname, "ScopeRename") == 0) {
1544
1545 return TRUE;
1546 }
1547 if (strcmp(keyname, "ScopeSelect") == 0) {
1549
1550 return TRUE;
1551 }
1552 if (strcmp(keyname, "ScrollDown") == 0) {
1561
1562 return TRUE;
1563 }
1564 if (strcmp(keyname, "ScrollUp") == 0) {
1573
1574 return TRUE;
1575 }
1576 if (strcmp(keyname, "SearchAuthB") == 0) {
1580
1581 return TRUE;
1582 }
1583 if (strcmp(keyname, "SearchAuthF") == 0) {
1587
1588 return TRUE;
1589 }
1590 if (strcmp(keyname, "SearchBody") == 0) {
1594
1595 return TRUE;
1596 }
1597 if (strcmp(keyname, "SearchRepeat") == 0) {
1607
1608 return TRUE;
1609 }
1610 if (strcmp(keyname, "SearchSubjB") == 0) {
1620
1621 return TRUE;
1622 }
1623 if (strcmp(keyname, "SearchSubjF") == 0) {
1633
1634 return TRUE;
1635 }
1636 if (strcmp(keyname, "SelectEnterNextUnreadGrp") == 0) {
1638
1639 return TRUE;
1640 }
1641 if (strcmp(keyname, "SelectGoto") == 0) {
1643
1644 return TRUE;
1645 }
1646 if (strcmp(keyname, "SelectMarkGrpUnread") == 0) {
1648
1649 return TRUE;
1650 }
1651 if (strcmp(keyname, "SelectMoveGrp") == 0) {
1653
1654 return TRUE;
1655 }
1656 if (strcmp(keyname, "SelectNextUnreadGrp") == 0) {
1658
1659 return TRUE;
1660 }
1661 if (strcmp(keyname, "SelectQuitNoWrite") == 0) {
1663
1664 return TRUE;
1665 }
1666 if (strcmp(keyname, "SelectReadGrp") == 0) {
1668
1669 return TRUE;
1670 }
1671 if (strcmp(keyname, "SelectResetNewsrc") == 0) {
1673
1674 return TRUE;
1675 }
1676 if (strcmp(keyname, "SelectSortActive") == 0) {
1678
1679 return TRUE;
1680 }
1681 if (strcmp(keyname, "SelectSubscribe") == 0) {
1683
1684 return TRUE;
1685 }
1686 if (strcmp(keyname, "SelectSubscribePat") == 0) {
1688
1689 return TRUE;
1690 }
1691 if (strcmp(keyname, "SelectSyncWithActive") == 0) {
1693
1694 return TRUE;
1695 }
1696 if (strcmp(keyname, "SelectToggleDescriptions") == 0) {
1698
1699 return TRUE;
1700 }
1701 if (strcmp(keyname, "SelectToggleReadDisplay") == 0) {
1703
1704 return TRUE;
1705 }
1706 if (strcmp(keyname, "SelectUnsubscribe") == 0) {
1708
1709 return TRUE;
1710 }
1711 if (strcmp(keyname, "SelectUnsubscribePat") == 0) {
1713
1714 return TRUE;
1715 }
1716 if (strcmp(keyname, "SelectYankActive") == 0) {
1718
1719 return TRUE;
1720 }
1721 if (strcmp(keyname, "SetRange") == 0) {
1725
1726 return TRUE;
1727 }
1728 if (strcmp(keyname, "ShellEscape") == 0) {
1729#ifndef NO_SHELL_ESCAPE
1739#endif /* !NO_SHELL_ESCAPE */
1740
1741 return TRUE;
1742 }
1743 break;
1744
1745 case 'T':
1746 if (strcmp(keyname, "ThreadAutoSave") == 0) {
1748
1749 return TRUE;
1750 }
1751 if (strcmp(keyname, "ThreadCancel") == 0) {
1753
1754 return TRUE;
1755 }
1756 if (strcmp(keyname, "ThreadMail") == 0) {
1758
1759 return TRUE;
1760 }
1761 if (strcmp(keyname, "ThreadMarkArtRead") == 0) {
1763
1764 return TRUE;
1765 }
1766 if (strcmp(keyname, "ThreadReadArt") == 0) {
1768
1769 return TRUE;
1770 }
1771 if (strcmp(keyname, "ThreadReadNextArtOrThread") == 0) {
1773
1774 return TRUE;
1775 }
1776 if (strcmp(keyname, "ThreadReverseSel") == 0) {
1778
1779 return TRUE;
1780 }
1781 if (strcmp(keyname, "ThreadSave") == 0) {
1783
1784 return TRUE;
1785 }
1786 if (strcmp(keyname, "ThreadSelArt") == 0) {
1788
1789 return TRUE;
1790 }
1791 if (strcmp(keyname, "ThreadTag") == 0) {
1793
1794 return TRUE;
1795 }
1796 if (strcmp(keyname, "ThreadTagParts") == 0) {
1798
1799 return TRUE;
1800 }
1801 if (strcmp(keyname, "ThreadToggleArtSel") == 0) {
1803
1804 return TRUE;
1805 }
1806 if (strcmp(keyname, "ThreadToggleSubjDisplay") == 0) {
1808
1809 return TRUE;
1810 }
1811 if (strcmp(keyname, "ThreadUndoSel") == 0) {
1813
1814 return TRUE;
1815 }
1816 if (strcmp(keyname, "ThreadUntag") == 0) {
1818
1819 return TRUE;
1820 }
1821 if (strcmp(keyname, "ToggleColor") == 0) {
1822#ifdef HAVE_COLOR
1823 process_keys(GLOBAL_TOGGLE_COLOR, keys, &group_keys);
1824 process_keys(GLOBAL_TOGGLE_COLOR, keys, &page_keys);
1825 process_keys(GLOBAL_TOGGLE_COLOR, keys, &select_keys);
1826 process_keys(GLOBAL_TOGGLE_COLOR, keys, &thread_keys);
1827#endif /* HAVE_COLOR */
1828
1829 return TRUE;
1830 }
1831 if (strcmp(keyname, "ToggleHelpDisplay") == 0) {
1839
1840 return TRUE;
1841 }
1842 if (strcmp(keyname, "ToggleInfoLastLine") == 0) {
1848
1849 return TRUE;
1850 }
1851 if (strcmp(keyname, "ToggleInverseVideo") == 0) {
1856
1857 return TRUE;
1858 }
1859 break;
1860
1861 case 'U':
1862 if (strcmp(keyname, "Up") == 0) {
1873
1874 return TRUE;
1875 }
1876 if (strcmp(keyname, "UrlSelect") == 0) {
1878
1879 return TRUE;
1880 }
1881 break;
1882
1883 case 'V':
1884 if (strcmp(keyname, "Version") == 0) {
1889
1890 return TRUE;
1891 }
1892 break;
1893
1894 default:
1895 break;
1896 }
1897
1898 return FALSE;
1899}
1900
1901
1902/*
1903 * upgrades the keymap file to the current version
1904 */
1905static void
1907 char *old)
1908{
1909 FILE *oldfp, *newfp;
1910 char *line, *backup;
1911 const char *keyname, *keydef;
1912 char newk[NAME_LEN + 1], buf[LEN];
1913 char *bugreport[3] = { NULL, NULL, NULL };
1914 char *catchup[4] = { NULL, NULL, NULL, NULL };
1915 char *catchup_next_unread[4] = { NULL, NULL, NULL, NULL };
1916 char *config_select[2] = { NULL, NULL };
1917 char *edit_filter[2] = { NULL, NULL };
1918 char *down[2] = { NULL, NULL };
1919 char *groupreadbasenote[2] = { NULL, NULL };
1920 char *mark_article_unread[3] = { NULL, NULL, NULL };
1921 char *mark_thread_unread[3] = { NULL, NULL, NULL };
1922 char *menu_filter_kill[3] = { NULL, NULL, NULL };
1923 char *menu_filter_select[3] = { NULL, NULL, NULL };
1924 char *pagedown[3] = { NULL, NULL, NULL };
1925 char *pagenextthd[2] = { NULL, NULL };
1926 char *pageup[3] = { NULL, NULL, NULL };
1927 char *postponed[2] = { NULL, NULL };
1928 char *postpost[3] = { NULL, NULL, NULL };
1929 char *postsend[2] = { NULL, NULL };
1930 char *quick_filter_kill[2] = { NULL, NULL };
1931 char *quick_filter_select[2] = { NULL, NULL };
1932 char *selectentergroup[2] = { NULL, NULL };
1933 char *selectmarkgrpunread[2] = { NULL, NULL };
1934 char *selectreadgrp[2] = { NULL, NULL };
1935 char *threadreadart[2] = { NULL, NULL };
1936 char *up[2] = { NULL, NULL };
1937
1938 if ((oldfp = fopen(old, "r")) == NULL)
1939 return;
1940
1941 snprintf(newk, sizeof(newk), "%s.%ld", old, (long) process_id);
1942 if ((newfp = fopen(newk, "w")) == NULL) {
1943 fclose(oldfp);
1944 return;
1945 }
1946 fprintf(newfp, "# Keymap file V%s for the TIN newsreader\n", KEYMAP_VERSION);
1947
1948 forever {
1949 line = fgets(buf, sizeof(buf), oldfp);
1950
1951 if (line == NULL || line[0] == '\n') {
1952 /*
1953 * we are at the end of a block or file
1954 * write out the merged lines (if available)
1955 */
1956 if (config_select[0] || config_select[1]) {
1957 fprintf(newfp, "ConfigSelect\t\t");
1958 if (config_select[0])
1959 fprintf(newfp, "\t%s", config_select[0]);
1960 if (config_select[1])
1961 fprintf(newfp, "\t%s", config_select[1]);
1962 fprintf(newfp, "\n");
1963 FreeAndNull(config_select[0]);
1964 FreeAndNull(config_select[1]);
1965 }
1966 if (down[0] || down[1]) {
1967 fprintf(newfp, "Down\t\t\t");
1968 if (down[0])
1969 fprintf(newfp, "\t%s", down[0]);
1970 if (down[1])
1971 fprintf(newfp, "\t%s", down[1]);
1972 fprintf(newfp, "\n");
1973 FreeAndNull(down[0]);
1974 FreeAndNull(down[1]);
1975 }
1976 if (groupreadbasenote[0] || groupreadbasenote[1]) {
1977 fprintf(newfp, "GroupReadBasenote\t");
1978 if (groupreadbasenote[0])
1979 fprintf(newfp, "\t%s", groupreadbasenote[0]);
1980 if (groupreadbasenote[1])
1981 fprintf(newfp, "\t%s", groupreadbasenote[1]);
1982 fprintf(newfp, "\n");
1983 FreeAndNull(groupreadbasenote[0]);
1984 FreeAndNull(groupreadbasenote[1]);
1985 }
1986 if (pagedown[0] || pagedown[1] || pagedown[2]) {
1987 fprintf(newfp, "PageDown\t\t");
1988 if (pagedown[0])
1989 fprintf(newfp, "\t%s", pagedown[0]);
1990 if (pagedown[1])
1991 fprintf(newfp, "\t%s", pagedown[1]);
1992 if (pagedown[2])
1993 fprintf(newfp, "\t%s", pagedown[2]);
1994 fprintf(newfp, "\n");
1995 FreeAndNull(pagedown[0]);
1996 FreeAndNull(pagedown[1]);
1997 FreeAndNull(pagedown[2]);
1998 }
1999 if (pagenextthd[0] || pagenextthd[1]) {
2000 fprintf(newfp, "PageNextThd\t\t");
2001 if (pagenextthd[0])
2002 fprintf(newfp, "\t%s", pagenextthd[0]);
2003 if (pagenextthd[1])
2004 fprintf(newfp, "\t%s", pagenextthd[1]);
2005 fprintf(newfp, "\n");
2006 FreeAndNull(pagenextthd[0]);
2007 FreeAndNull(pagenextthd[1]);
2008 }
2009 if (pageup[0] || pageup[1] || pageup[2]) {
2010 fprintf(newfp, "PageUp\t\t\t");
2011 if (pageup[0])
2012 fprintf(newfp, "\t%s", pageup[0]);
2013 if (pageup[1])
2014 fprintf(newfp, "\t%s", pageup[1]);
2015 if (pageup[2])
2016 fprintf(newfp, "\t%s", pageup[2]);
2017 fprintf(newfp, "\n");
2018 FreeAndNull(pageup[0]);
2019 FreeAndNull(pageup[1]);
2020 FreeAndNull(pageup[2]);
2021 }
2022 if (postponed[0] || postponed[1]) {
2023 fprintf(newfp, "Postponed\t\t");
2024 if (postponed[0])
2025 fprintf(newfp, "\t%s", postponed[0]);
2026 if (postponed[1])
2027 fprintf(newfp, "\t%s", postponed[1]);
2028 fprintf(newfp, "\n");
2029 FreeAndNull(postponed[0]);
2030 FreeAndNull(postponed[1]);
2031 }
2032 if (postpost[0] || postpost[1] || postpost[2]) {
2033 fprintf(newfp, "PostPost\t\t");
2034 if (postpost[0])
2035 fprintf(newfp, "\t%s", postpost[0]);
2036 if (postpost[1])
2037 fprintf(newfp, "\t%s", postpost[1]);
2038 if (postpost[2])
2039 fprintf(newfp, "\t%s", postpost[2]);
2040 fprintf(newfp, "\n");
2041 FreeAndNull(postpost[0]);
2042 FreeAndNull(postpost[1]);
2043 FreeAndNull(postpost[2]);
2044 }
2045 if (postsend[0] || postsend[1]) {
2046 fprintf(newfp, "PostSend\t\t");
2047 if (postsend[0])
2048 fprintf(newfp, "\t%s", postsend[0]);
2049 if (postsend[1])
2050 fprintf(newfp, "\t%s", postsend[1]);
2051 fprintf(newfp, "\n");
2052 FreeAndNull(postsend[0]);
2053 FreeAndNull(postsend[1]);
2054 }
2055 if (selectentergroup[0] || selectentergroup[1]) {
2056 fprintf(newfp, "SelectEnterNextUnreadGrp");
2057 if (selectentergroup[0])
2058 fprintf(newfp, "\t%s", selectentergroup[0]);
2059 if (selectentergroup[1])
2060 fprintf(newfp, "\t%s", selectentergroup[1]);
2061 fprintf(newfp, "\n");
2062 FreeAndNull(selectentergroup[0]);
2063 FreeAndNull(selectentergroup[1]);
2064 }
2065 if (selectmarkgrpunread[0] || selectmarkgrpunread[1]) {
2066 fprintf(newfp, "SelectMarkGrpUnread\t");
2067 if (selectmarkgrpunread[0])
2068 fprintf(newfp, "\t%s", selectmarkgrpunread[0]);
2069 if (selectmarkgrpunread[1])
2070 fprintf(newfp, "\t%s", selectmarkgrpunread[1]);
2071 fprintf(newfp, "\n");
2072 FreeAndNull(selectmarkgrpunread[0]);
2073 FreeAndNull(selectmarkgrpunread[1]);
2074 }
2075 if (selectreadgrp[0] || selectreadgrp[1]) {
2076 fprintf(newfp, "SelectReadGrp\t\t");
2077 if (selectreadgrp[0])
2078 fprintf(newfp, "\t%s", selectreadgrp[0]);
2079 if (selectreadgrp[1])
2080 fprintf(newfp, "\t%s", selectreadgrp[1]);
2081 fprintf(newfp, "\n");
2082 FreeAndNull(selectreadgrp[0]);
2083 FreeAndNull(selectreadgrp[1]);
2084 }
2085 if (threadreadart[0] || threadreadart[1]) {
2086 fprintf(newfp, "ThreadReadArt\t\t");
2087 if (threadreadart[0])
2088 fprintf(newfp, "\t%s", threadreadart[0]);
2089 if (threadreadart[1])
2090 fprintf(newfp, "\t%s", threadreadart[1]);
2091 fprintf(newfp, "\n");
2092 FreeAndNull(threadreadart[0]);
2093 FreeAndNull(threadreadart[1]);
2094 }
2095 if (up[0] || up[1]) {
2096 fprintf(newfp, "Up\t\t\t");
2097 if (up[0])
2098 fprintf(newfp, "\t%s", up[0]);
2099 if (up[1])
2100 fprintf(newfp, "\t%s", up[1]);
2101 fprintf(newfp, "\n");
2102 FreeAndNull(up[0]);
2103 FreeAndNull(up[1]);
2104 }
2105 if (line == NULL)
2106 break; /* jump out of the while loop */
2107 else {
2108 fprintf(newfp, "\n");
2109 continue;
2110 }
2111 }
2112
2113 if (line[0] == '#') {
2114 if (strncmp(line, "# Keymap file V", strlen("# Keymap file V")) != 0)
2115 fprintf(newfp, "%s", line);
2116 continue;
2117 }
2118
2119 backup = my_strdup(line);
2120
2121 if ((keyname = strsep(&line, KEYSEPS)) == NULL) {
2122 free(backup);
2123 continue;
2124 }
2125 if ((keydef = str_trim(line)) == NULL)
2126 keydef = "";
2127
2128 switch (keyname[0]) {
2129 case 'C':
2130 if (strcmp(keyname, "ConfigFirstPage2") == 0)
2131 fprintf(newfp, "ConfigFirstPage\t\t\t%s\n", keydef);
2132 else if (strcmp(keyname, "ConfigLastPage2") == 0)
2133 fprintf(newfp, "ConfigLastPage\t\t\t%s\n", keydef);
2134 else if (strcmp(keyname, "ConfigSelect") == 0)
2135 config_select[0] = my_strdup(keydef);
2136 else if (strcmp(keyname, "ConfigSelect2") == 0)
2137 config_select[1] = my_strdup(keydef);
2138 else
2139 fprintf(newfp, "%s", backup);
2140 break;
2141
2142 case 'D':
2143 if (strcmp(keyname, "Down") == 0)
2144 down[0] = my_strdup(keydef);
2145 else if (strcmp(keyname, "Down2") == 0)
2146 down[1] = my_strdup(keydef);
2147 else
2148 fprintf(newfp, "%s", backup);
2149 break;
2150
2151 case 'G':
2152 if (strcmp(keyname, "GroupAutoSel") == 0)
2153 menu_filter_select[0] = my_strdup(keydef);
2154 else if (strcmp(keyname, "GroupQuickAutoSel") == 0)
2155 quick_filter_select[0] = my_strdup(keydef);
2156 else if (strcmp(keyname, "GroupQuickKill") == 0)
2157 quick_filter_kill[0] = my_strdup(keydef);
2158 else if (strcmp(keyname, "GroupKill") == 0)
2159 menu_filter_kill[0] = my_strdup(keydef);
2160 else if (strcmp(keyname, "GroupReadBasenote") == 0)
2161 groupreadbasenote[0] = my_strdup(keydef);
2162 else if (strcmp(keyname, "GroupReadBasenote2") == 0)
2163 groupreadbasenote[1] = my_strdup(keydef);
2164 else if (strcmp(keyname, "GroupEditFilter") == 0)
2165 edit_filter[0] = my_strdup(keydef);
2166 else if (strcmp(keyname, "GroupBugReport") == 0)
2167 bugreport[0] = my_strdup(keydef);
2168 else if (strcmp(keyname, "GroupMarkArtUnread") == 0)
2169 mark_article_unread[0] = my_strdup(keydef);
2170 else if (strcmp(keyname, "GroupMarkThdUnread") == 0)
2171 mark_thread_unread[0] = my_strdup(keydef);
2172 else if (strcmp(keyname, "GroupCatchup") == 0)
2173 catchup[0] = my_strdup(keydef);
2174 else if (strcmp(keyname, "GroupCatchupNextUnread") == 0)
2175 catchup_next_unread[0] = my_strdup(keydef);
2176 else
2177 fprintf(newfp, "%s", backup);
2178 break;
2179
2180 case 'H':
2181 if (strcmp(keyname, "HelpFirstPage2") == 0)
2182 fprintf(newfp, "HelpFirstPage\t\t\t%s\n", keydef);
2183 else if (strcmp(keyname, "HelpLastPage2") == 0)
2184 fprintf(newfp, "HelpLastPage\t\t\t%s\n", keydef);
2185 else
2186 fprintf(newfp, "%s", backup);
2187 break;
2188
2189 case 'N':
2190 /* Nrc* got removed */
2191 if (strcmp(keyname, "NrctblCreate") == 0)
2192 ;
2193 else if (strcmp(keyname, "NrctblDefault") == 0)
2194 ;
2195 else if (strcmp(keyname, "NrctblAlternative") == 0)
2196 ;
2197 else if (strcmp(keyname, "NrctblQuit") == 0)
2198 ;
2199 else
2200 fprintf(newfp, "%s", backup);
2201 break;
2202
2203 case 'P':
2204 if (strcmp(keyname, "PageAutoSel") == 0)
2205 menu_filter_select[1] = my_strdup(keydef);
2206 else if (strcmp(keyname, "PageQuickAutoSel") == 0)
2207 quick_filter_select[1] = my_strdup(keydef);
2208 else if (strcmp(keyname, "PageQuickKill") == 0)
2209 quick_filter_kill[1] = my_strdup(keydef);
2210 else if (strcmp(keyname, "PageAutoKill") == 0)
2211 menu_filter_kill[1] = my_strdup(keydef);
2212 else if (strcmp(keyname, "PageDown") == 0)
2213 pagedown[0] = my_strdup(keydef);
2214 else if (strcmp(keyname, "PageDown2") == 0)
2215 pagedown[1] = my_strdup(keydef);
2216 else if (strcmp(keyname, "PageDown3") == 0)
2217 pagedown[2] = my_strdup(keydef);
2218 else if (strcmp(keyname, "PageEditFilter") == 0)
2219 edit_filter[1] = my_strdup(keydef);
2220 else if (strcmp(keyname, "PageNextThd") == 0)
2221 pagenextthd[0] = my_strdup(keydef);
2222 else if (strcmp(keyname, "PageNextThd2") == 0)
2223 pagenextthd[1] = my_strdup(keydef);
2224 else if (strcmp(keyname, "PageUp") == 0)
2225 pageup[0] = my_strdup(keydef);
2226 else if (strcmp(keyname, "PageUp2") == 0)
2227 pageup[1] = my_strdup(keydef);
2228 else if (strcmp(keyname, "PageUp3") == 0)
2229 pageup[2] = my_strdup(keydef);
2230 else if (strcmp(keyname, "Postponed") == 0)
2231 postponed[0] = my_strdup(keydef);
2232 else if (strcmp(keyname, "Postponed2") == 0)
2233 postponed[1] = my_strdup(keydef);
2234 else if (strcmp(keyname, "PostPost") == 0)
2235 postpost[0] = my_strdup(keydef);
2236 else if (strcmp(keyname, "PostPost2") == 0)
2237 postpost[1] = my_strdup(keydef);
2238 else if (strcmp(keyname, "PostPost3") == 0)
2239 postpost[2] = my_strdup(keydef);
2240 else if (strcmp(keyname, "PostSend") == 0)
2241 postsend[0] = my_strdup(keydef);
2242 else if (strcmp(keyname, "PostSend2") == 0)
2243 postsend[1] = my_strdup(keydef);
2244 else if (strcmp(keyname, "PageMarkArtUnread") == 0)
2245 mark_article_unread[1] = my_strdup(keydef);
2246 else if (strcmp(keyname, "PageMarkThdUnread") == 0)
2247 mark_thread_unread[1] = my_strdup(keydef);
2248 else if (strcmp(keyname, "PageCatchup") == 0)
2249 catchup[1] = my_strdup(keydef);
2250 else if (strcmp(keyname, "PageCatchupNextUnread") == 0)
2251 catchup_next_unread[1] = my_strdup(keydef);
2252 else if (strcmp(keyname, "PageToggleHeaders") == 0)
2253 fprintf(newfp, "PageToggleRaw\t\t\t%s\n", keydef);
2254 else if (strcmp(keyname, "PromptNo") == 0 || strcmp(keyname, "PromptYes") == 0) {
2255 if (strlen(keydef) == 1 && islower((int)(unsigned char) keydef[0]))
2256 fprintf(newfp, "%s\t\t\t%c\t%c\n", keyname, keydef[0], my_toupper((int)(unsigned char) keydef[0]));
2257 else
2258 fprintf(newfp, "%s", backup);
2259 } else
2260 fprintf(newfp, "%s", backup);
2261 break;
2262
2263 case 'S':
2264 if (strcmp(keyname, "SelectEditFilter") == 0)
2265 ;
2266 else if (strcmp(keyname, "SelectEnterNextUnreadGrp") == 0)
2267 selectentergroup[0] = my_strdup(keydef);
2268 else if (strcmp(keyname, "SelectEnterNextUnreadGrp2") == 0)
2269 selectentergroup[1] = my_strdup(keydef);
2270 else if (strcmp(keyname, "SelectMarkGrpUnread") == 0)
2271 selectmarkgrpunread[0] = my_strdup(keydef);
2272 else if (strcmp(keyname, "SelectMarkGrpUnread2") == 0)
2273 selectmarkgrpunread[1] = my_strdup(keydef);
2274 else if (strcmp(keyname, "SelectReadGrp") == 0)
2275 selectreadgrp[0] = my_strdup(keydef);
2276 else if (strcmp(keyname, "SelectReadGrp2") == 0)
2277 selectreadgrp[1] = my_strdup(keydef);
2278 else if (strcmp(keyname, "SelectBugReport") == 0)
2279 bugreport[1] = my_strdup(keydef);
2280 else if (strcmp(keyname, "SelectCatchup") == 0)
2281 catchup[2] = my_strdup(keydef);
2282 else if (strcmp(keyname, "SelectCatchupNextUnread") == 0)
2283 catchup_next_unread[2] = my_strdup(keydef);
2284 else
2285 fprintf(newfp, "%s", backup);
2286 break;
2287
2288 case 'T':
2289 if (strcmp(keyname, "ThreadEditFilter") == 0)
2290 ;
2291 else if (strcmp(keyname, "ThreadAutoSel") == 0)
2292 menu_filter_select[2] = my_strdup(keydef);
2293 else if (strcmp(keyname, "ThreadKill") == 0)
2294 menu_filter_kill[2] = my_strdup(keydef);
2295 else if (strcmp(keyname, "ThreadReadArt") == 0)
2296 threadreadart[0] = my_strdup(keydef);
2297 else if (strcmp(keyname, "ThreadReadArt2") == 0)
2298 threadreadart[1] = my_strdup(keydef);
2299 else if (strcmp(keyname, "ThreadBugReport") == 0)
2300 bugreport[2] = my_strdup(keydef);
2301 else if (strcmp(keyname, "ThreadMarkArtUnread") == 0)
2302 mark_article_unread[2] = my_strdup(keydef);
2303 else if (strcmp(keyname, "ThreadMarkThdUnread") == 0)
2304 mark_thread_unread[2] = my_strdup(keydef);
2305 else if (strcmp(keyname, "ThreadCatchup") == 0)
2306 catchup[3] = my_strdup(keydef);
2307 else if (strcmp(keyname, "ThreadCatchupNextUnread") == 0)
2308 catchup_next_unread[3] = my_strdup(keydef);
2309 else
2310 fprintf(newfp, "%s", backup);
2311 break;
2312
2313 case 'U':
2314 if (strcmp(keyname, "Up") == 0)
2315 up[0] = my_strdup(keydef);
2316 else if (strcmp(keyname, "Up2") == 0)
2317 up[1] = my_strdup(keydef);
2318 else
2319 fprintf(newfp, "%s", backup);
2320 break;
2321
2322 default:
2323 fprintf(newfp, "%s", backup);
2324 }
2325 free(backup);
2326 }
2327 fprintf(newfp, "\n#####\n");
2328 /* joined/renamed keys from different sections */
2329 if (bugreport[0] || bugreport[1] || bugreport[2]) {
2330 fprintf(newfp, "BugReport\t");
2331 if (bugreport[0] && bugreport[1] && !strcmp(bugreport[0], bugreport[1]))
2332 FreeAndNull(bugreport[1]);
2333 if (bugreport[0] && bugreport[2] && !strcmp(bugreport[0], bugreport[2]))
2334 FreeAndNull(bugreport[2]);
2335 if (bugreport[1] && bugreport[2] && !strcmp(bugreport[1], bugreport[2]))
2336 FreeAndNull(bugreport[2]);
2337 if (bugreport[0])
2338 fprintf(newfp, "\t%s", bugreport[0]);
2339 if (bugreport[1])
2340 fprintf(newfp, "\t%s", bugreport[1]);
2341 if (bugreport[2])
2342 fprintf(newfp, "\t%s", bugreport[2]);
2343 fprintf(newfp, "\n");
2344 FreeAndNull(bugreport[0]);
2345 FreeAndNull(bugreport[1]);
2346 FreeAndNull(bugreport[2]);
2347 }
2348 if (catchup[0] || catchup[1] || catchup[2] || catchup[3]) {
2349 fprintf(newfp, "Catchup\t");
2350 if (catchup[0] && catchup[1] && !strcmp(catchup[0], catchup[1]))
2351 FreeAndNull(catchup[1]);
2352 if (catchup[0] && catchup[2] && !strcmp(catchup[0], catchup[2]))
2353 FreeAndNull(catchup[2]);
2354 if (catchup[0] && catchup[3] && !strcmp(catchup[0], catchup[3]))
2355 FreeAndNull(catchup[3]);
2356 if (catchup[1] && catchup[2] && !strcmp(catchup[1], catchup[2]))
2357 FreeAndNull(catchup[2]);
2358 if (catchup[1] && catchup[3] && !strcmp(catchup[1], catchup[3]))
2359 FreeAndNull(catchup[3]);
2360 if (catchup[2] && catchup[3] && !strcmp(catchup[2], catchup[3]))
2361 FreeAndNull(catchup[3]);
2362 if (catchup[0])
2363 fprintf(newfp, "\t%s", catchup[0]);
2364 if (catchup[1])
2365 fprintf(newfp, "\t%s", catchup[1]);
2366 if (catchup[2])
2367 fprintf(newfp, "\t%s", catchup[2]);
2368 if (catchup[3])
2369 fprintf(newfp, "\t%s", catchup[3]);
2370 fprintf(newfp, "\n");
2371 FreeAndNull(catchup[0]);
2372 FreeAndNull(catchup[1]);
2373 FreeAndNull(catchup[2]);
2374 FreeAndNull(catchup[3]);
2375 }
2376 if (catchup_next_unread[0] || catchup_next_unread[1] || catchup_next_unread[2] || catchup_next_unread[3]) {
2377 fprintf(newfp, "CatchupNextUnread\t");
2378 if (catchup_next_unread[0] && catchup_next_unread[1] && !strcmp(catchup_next_unread[0], catchup_next_unread[1]))
2379 FreeAndNull(catchup_next_unread[1]);
2380 if (catchup_next_unread[0] && catchup_next_unread[2] && !strcmp(catchup_next_unread[0], catchup_next_unread[2]))
2381 FreeAndNull(catchup_next_unread[2]);
2382 if (catchup_next_unread[0] && catchup_next_unread[3] && !strcmp(catchup_next_unread[0], catchup_next_unread[3]))
2383 FreeAndNull(catchup_next_unread[3]);
2384 if (catchup_next_unread[1] && catchup_next_unread[2] && !strcmp(catchup_next_unread[1], catchup_next_unread[2]))
2385 FreeAndNull(catchup_next_unread[2]);
2386 if (catchup_next_unread[1] && catchup_next_unread[3] && !strcmp(catchup_next_unread[1], catchup_next_unread[3]))
2387 FreeAndNull(catchup_next_unread[3]);
2388 if (catchup_next_unread[2] && catchup_next_unread[3] && !strcmp(catchup_next_unread[2], catchup_next_unread[3]))
2389 FreeAndNull(catchup_next_unread[3]);
2390 if (catchup_next_unread[0])
2391 fprintf(newfp, "\t%s", catchup_next_unread[0]);
2392 if (catchup_next_unread[1])
2393 fprintf(newfp, "\t%s", catchup_next_unread[1]);
2394 if (catchup_next_unread[2])
2395 fprintf(newfp, "\t%s", catchup_next_unread[2]);
2396 if (catchup_next_unread[3])
2397 fprintf(newfp, "\t%s", catchup_next_unread[3]);
2398 fprintf(newfp, "\n");
2399 FreeAndNull(catchup_next_unread[0]);
2400 FreeAndNull(catchup_next_unread[1]);
2401 FreeAndNull(catchup_next_unread[2]);
2402 FreeAndNull(catchup_next_unread[3]);
2403 }
2404 if (edit_filter[0] || edit_filter[1]) {
2405 fprintf(newfp, "EditFilter\t");
2406 if (edit_filter[0])
2407 fprintf(newfp, "\t%s", edit_filter[0]);
2408 if (edit_filter[1] && edit_filter[0] && strcmp(edit_filter[0], edit_filter[1]))
2409 fprintf(newfp, "\t%s", edit_filter[1]);
2410 fprintf(newfp, "\n");
2411 FreeAndNull(edit_filter[0]);
2412 FreeAndNull(edit_filter[1]);
2413 }
2414 if (mark_article_unread[0] || mark_article_unread[1] || mark_article_unread[2]) {
2415 fprintf(newfp, "MarkArticleUnread\t");
2416 if (mark_article_unread[0] && mark_article_unread[1] && !strcmp(mark_article_unread[0], mark_article_unread[1]))
2417 FreeAndNull(mark_article_unread[1]);
2418 if (mark_article_unread[0] && mark_article_unread[2] && !strcmp(mark_article_unread[0], mark_article_unread[2]))
2419 FreeAndNull(mark_article_unread[2]);
2420 if (mark_article_unread[1] && mark_article_unread[2] && !strcmp(mark_article_unread[1], mark_article_unread[2]))
2421 FreeAndNull(mark_article_unread[2]);
2422 if (mark_article_unread[0])
2423 fprintf(newfp, "\t%s", mark_article_unread[0]);
2424 if (mark_article_unread[1])
2425 fprintf(newfp, "\t%s", mark_article_unread[1]);
2426 if (mark_article_unread[2])
2427 fprintf(newfp, "\t%s", mark_article_unread[2]);
2428 fprintf(newfp, "\n");
2429 FreeAndNull(mark_article_unread[0]);
2430 FreeAndNull(mark_article_unread[1]);
2431 FreeAndNull(mark_article_unread[2]);
2432 }
2433 if (mark_thread_unread[0] || mark_thread_unread[1] || mark_thread_unread[2]) {
2434 fprintf(newfp, "MarkThreadUnread\t");
2435 if (mark_thread_unread[0] && mark_thread_unread[1] && !strcmp(mark_thread_unread[0], mark_thread_unread[1]))
2436 FreeAndNull(mark_thread_unread[1]);
2437 if (mark_thread_unread[0] && mark_thread_unread[2] && !strcmp(mark_thread_unread[0], mark_thread_unread[2]))
2438 FreeAndNull(mark_thread_unread[2]);
2439 if (mark_thread_unread[1] && mark_thread_unread[2] && !strcmp(mark_thread_unread[1], mark_thread_unread[2]))
2440 FreeAndNull(mark_thread_unread[2]);
2441 if (mark_thread_unread[0])
2442 fprintf(newfp, "\t%s", mark_thread_unread[0]);
2443 if (mark_thread_unread[1])
2444 fprintf(newfp, "\t%s", mark_thread_unread[1]);
2445 if (mark_thread_unread[2])
2446 fprintf(newfp, "\t%s", mark_thread_unread[2]);
2447 fprintf(newfp, "\n");
2448 FreeAndNull(mark_thread_unread[0]);
2449 FreeAndNull(mark_thread_unread[1]);
2450 FreeAndNull(mark_thread_unread[2]);
2451 }
2452 if (menu_filter_kill[0] || menu_filter_kill[1] || menu_filter_kill[2]) {
2453 fprintf(newfp, "MenuFilterKill\t");
2454 if (menu_filter_kill[0] && menu_filter_kill[1] && !strcmp(menu_filter_kill[0], menu_filter_kill[1]))
2455 FreeAndNull(menu_filter_kill[1]);
2456 if (menu_filter_kill[0] && menu_filter_kill[2] && !strcmp(menu_filter_kill[0], menu_filter_kill[2]))
2457 FreeAndNull(menu_filter_kill[2]);
2458 if (menu_filter_kill[1] && menu_filter_kill[2] && !strcmp(menu_filter_kill[1], menu_filter_kill[2]))
2459 FreeAndNull(menu_filter_kill[2]);
2460 if (menu_filter_kill[0])
2461 fprintf(newfp, "\t%s", menu_filter_kill[0]);
2462 if (menu_filter_kill[1])
2463 fprintf(newfp, "\t%s", menu_filter_kill[1]);
2464 if (menu_filter_kill[2])
2465 fprintf(newfp, "\t%s", menu_filter_kill[2]);
2466 fprintf(newfp, "\n");
2467 FreeAndNull(menu_filter_kill[0]);
2468 FreeAndNull(menu_filter_kill[1]);
2469 FreeAndNull(menu_filter_kill[2]);
2470 }
2471 if (menu_filter_select[0] || menu_filter_select[1] || menu_filter_select[2]) {
2472 fprintf(newfp, "MenuFilterSelect\t");
2473 if (menu_filter_select[0] && menu_filter_select[1] && !strcmp(menu_filter_select[0], menu_filter_select[1]))
2474 FreeAndNull(menu_filter_select[1]);
2475 if (menu_filter_select[0] && menu_filter_select[2] && !strcmp(menu_filter_select[0], menu_filter_select[2]))
2476 FreeAndNull(menu_filter_select[2]);
2477 if (menu_filter_select[1] && menu_filter_select[2] && !strcmp(menu_filter_select[1], menu_filter_select[2]))
2478 FreeAndNull(menu_filter_select[2]);
2479 if (menu_filter_select[0])
2480 fprintf(newfp, "\t%s", menu_filter_select[0]);
2481 if (menu_filter_select[1])
2482 fprintf(newfp, "\t%s", menu_filter_select[1]);
2483 if (menu_filter_select[2])
2484 fprintf(newfp, "\t%s", menu_filter_select[2]);
2485 fprintf(newfp, "\n");
2486 FreeAndNull(menu_filter_select[0]);
2487 FreeAndNull(menu_filter_select[1]);
2488 FreeAndNull(menu_filter_select[2]);
2489 }
2490 if (quick_filter_kill[0] || quick_filter_kill[1]) {
2491 fprintf(newfp, "QuickFilterKill\t");
2492 if (quick_filter_kill[0])
2493 fprintf(newfp, "\t%s", quick_filter_kill[0]);
2494 if (quick_filter_kill[1] && quick_filter_kill[0] && strcmp(quick_filter_kill[0], quick_filter_kill[1]))
2495 fprintf(newfp, "\t%s", quick_filter_kill[1]);
2496 fprintf(newfp, "\n");
2497 FreeAndNull(quick_filter_kill[0]);
2498 FreeAndNull(quick_filter_kill[1]);
2499 }
2500 if (quick_filter_select[0] || quick_filter_select[1]) {
2501 fprintf(newfp, "QuickFilterSelect\t");
2502 if (quick_filter_select[0])
2503 fprintf(newfp, "\t%s", quick_filter_select[0]);
2504 if (quick_filter_select[1] && quick_filter_select[0] && strcmp(quick_filter_select[0], quick_filter_select[1]))
2505 fprintf(newfp, "\t%s", quick_filter_select[1]);
2506 fprintf(newfp, "\n");
2507 FreeAndNull(quick_filter_select[0]);
2508 FreeAndNull(quick_filter_select[1]);
2509 }
2510
2511 fclose(oldfp);
2512 fclose(newfp);
2513 rename(newk, old);
2516}
2517
2518
2519/*
2520 * add the default key bindings for still free keys
2521 */
2522void
2524 void)
2525{
2526 /* attachment level */
2560#ifndef NO_SHELL_ESCAPE
2562#endif /* !NO_SHELL_ESCAPE */
2563
2564 /* scope level */
2592#ifndef NO_SHELL_ESCAPE
2594#endif /* !NO_SHELL_ESCAPE */
2595
2596 /* select level */
2612#ifdef NNTP_ABLE
2614#endif /* NNTP_ABLE */
2624
2625 /* group level */
2639#ifndef DISABLE_PRINTING
2641#endif /* !DISABLE_PRINTING */
2678
2679 /* thread keys */
2690#ifndef DISABLE_PRINTING
2692#endif /* !DISABLE_PRINTING */
2716
2717 /* page level */
2721#ifdef HAVE_PGP_GPG
2722 add_default_key(&page_keys, "␇", PAGE_PGP_CHECK_ARTICLE);
2723#endif /* HAVE_PGP_GPG */
2737#ifndef DISABLE_PRINTING
2739#endif /* !DISABLE_PRINTING */
2778
2779 /* info pager */
2792
2793 /* options menu */
2823#ifndef NO_SHELL_ESCAPE
2825#endif /* !NO_SHELL_ESCAPE */
2826
2827 /* posted articles level */
2855#ifndef NO_SHELL_ESCAPE
2857#endif /* !NO_SHELL_ESCAPE */
2858
2859 /* prompt keys */
2864
2865 /* post keys */
2868#ifdef HAVE_PGP_GPG
2869 add_default_key(&post_send_keys, "g", POST_PGP);
2870#endif /* HAVE_PGP_GPG */
2871#ifdef HAVE_ISPELL
2872 add_default_key(&post_send_keys, "i", POST_ISPELL);
2873#endif /* HAVE_ISPELL */
2876
2881
2886
2889#ifdef HAVE_PGP_GPG
2890 add_default_key(&post_post_keys, "g", POST_PGP);
2891#endif /* HAVE_PGP_GPG */
2892#ifdef HAVE_ISPELL
2893 add_default_key(&post_post_keys, "i", POST_ISPELL);
2894#endif /* HAVE_ISPELL */
2899
2906
2911
2916
2921
2926
2931
2932 /* feed keys */
2938
2947
2952
2953 /* filter keys */
2958
2959#ifdef HAVE_PGP_GPG
2960 /* pgp mail */
2961 add_default_key(&pgp_mail_keys, "␛", GLOBAL_ABORT);
2962 add_default_key(&pgp_mail_keys, "b", PGP_KEY_ENCRYPT_SIGN);
2963 add_default_key(&pgp_mail_keys, "e", PGP_KEY_ENCRYPT);
2964 add_default_key(&pgp_mail_keys, "q", GLOBAL_QUIT);
2965 add_default_key(&pgp_mail_keys, "s", PGP_KEY_SIGN);
2966
2967 /* pgp news */
2968 add_default_key(&pgp_news_keys, "␛", GLOBAL_ABORT);
2969 add_default_key(&pgp_news_keys, "i", PGP_INCLUDE_KEY);
2970 add_default_key(&pgp_news_keys, "q", GLOBAL_QUIT);
2971 add_default_key(&pgp_news_keys, "s", PGP_KEY_SIGN);
2972#endif /* HAVE_PGP_GPG */
2973
2974 /* save */
2979
2980 /* url level */
3008#ifndef NO_SHELL_ESCAPE
3010#endif /* !NO_SHELL_ESCAPE */
3011}
3012
3013
3014/*
3015 * used to add the common keys of SELECT_LEVEL, GROUP_LEVEL, THREAD_LEVEL
3016 * and PAGE_LEVEL
3017 */
3018static void
3020 struct keylist *keys)
3021{
3022 add_default_key(keys, "␛", GLOBAL_ABORT);
3023 add_default_key(keys, "0", DIGIT_0);
3024 add_default_key(keys, "1", DIGIT_1);
3025 add_default_key(keys, "2", DIGIT_2);
3026 add_default_key(keys, "3", DIGIT_3);
3027 add_default_key(keys, "4", DIGIT_4);
3028 add_default_key(keys, "5", DIGIT_5);
3029 add_default_key(keys, "6", DIGIT_6);
3030 add_default_key(keys, "7", DIGIT_7);
3031 add_default_key(keys, "8", DIGIT_8);
3032 add_default_key(keys, "9", DIGIT_9);
3033 add_default_key(keys, "␂␕b", GLOBAL_PAGE_UP);
3034 add_default_key(keys, "␄␆ ", GLOBAL_PAGE_DOWN);
3036 add_default_key(keys, "␎j", GLOBAL_LINE_DOWN);
3037 add_default_key(keys, "␐k", GLOBAL_LINE_UP);
3038 add_default_key(keys, "␏O", GLOBAL_POSTPONED);
3039 add_default_key(keys, "h", GLOBAL_HELP);
3041 add_default_key(keys, "q", GLOBAL_QUIT);
3042 add_default_key(keys, "v", GLOBAL_VERSION);
3043 add_default_key(keys, "w", GLOBAL_POST);
3047 add_default_key(keys, "Q", GLOBAL_QUIT_TIN);
3056#ifndef NO_SHELL_ESCAPE
3058#endif /* !NO_SHELL_ESCAPE */
3059#ifdef HAVE_COLOR
3060 add_default_key(keys, "&", GLOBAL_TOGGLE_COLOR);
3061#endif /* HAVE COLOR */
3062}
unsigned t_bool
Definition: bool.h:77
#define TRUE
Definition: bool.h:74
#define FALSE
Definition: bool.h:70
constext txt_tab[]
Definition: lang.c:871
constext txt_cr[]
Definition: lang.c:157
pid_t process_id
Definition: init.c:125
constext txt_space[]
Definition: lang.c:857
constext txt_keymap_invalid_name[]
Definition: lang.c:595
constext txt_esc[]
Definition: lang.c:270
char rcdir[PATH_LEN]
Definition: init.c:100
constext txt_keymap_upgraded[]
Definition: lang.c:596
constext txt_keymap_missing_key[]
Definition: lang.c:593
constext txt_keymap_invalid_key[]
Definition: lang.c:594
static void free_keylist(struct keylist *keys)
Definition: keymap.c:219
static t_bool process_keys(t_function func, const char *keys, struct keylist *kl)
Definition: keymap.c:447
void free_keymaps(void)
Definition: keymap.c:231
struct keylist select_keys
Definition: keymap.c:89
struct keylist feed_supersede_article_keys
Definition: keymap.c:64
struct keylist post_mail_fup_keys
Definition: keymap.c:81
struct keylist attachment_keys
Definition: keymap.c:62
struct keylist thread_keys
Definition: keymap.c:90
struct keylist info_keys
Definition: keymap.c:68
t_function key_to_func(const char key, const struct keylist keys)
Definition: keymap.c:98
struct keylist post_continue_keys
Definition: keymap.c:76
struct keylist feed_type_keys
Definition: keymap.c:65
struct keylist scope_keys
Definition: keymap.c:88
struct keylist prompt_keys
Definition: keymap.c:86
struct keylist post_edit_keys
Definition: keymap.c:78
struct keylist page_keys
Definition: keymap.c:70
struct keylist option_menu_keys
Definition: keymap.c:69
char * printascii(char *buf, int ch)
Definition: keymap.c:273
struct keylist save_append_overwrite_keys
Definition: keymap.c:87
struct keylist url_keys
Definition: keymap.c:91
static void upgrade_keymap_file(char *old)
Definition: keymap.c:1906
struct keylist filter_keys
Definition: keymap.c:66
struct keylist post_delete_keys
Definition: keymap.c:77
#define KEYSEPS
Definition: keymap.c:321
struct keylist post_send_keys
Definition: keymap.c:85
static t_bool process_mapping(char *keyname, char *keys)
Definition: keymap.c:555
struct keylist post_edit_ext_keys
Definition: keymap.c:79
struct keylist group_keys
Definition: keymap.c:67
static t_bool add_key(struct keylist *keys, const char key, t_function func, t_bool override)
Definition: keymap.c:149
struct keylist post_hist_keys
Definition: keymap.c:82
struct keylist post_ignore_fupto_keys
Definition: keymap.c:80
char func_to_key(t_function func, const struct keylist keys)
Definition: keymap.c:125
t_bool read_keymap_file(void)
Definition: keymap.c:327
static void add_global_keys(struct keylist *keys)
Definition: keymap.c:3019
struct keylist post_postpone_keys
Definition: keymap.c:84
void setup_default_keys(void)
Definition: keymap.c:2523
struct keylist feed_post_process_keys
Definition: keymap.c:63
struct keylist post_post_keys
Definition: keymap.c:83
static void add_default_key(struct keylist *key_list, const char *keys, t_function func)
Definition: keymap.c:199
struct keylist post_cancel_keys
Definition: keymap.c:75
#define MAXKEYLEN
Definition: keymap.h:136
#define ESC
Definition: keymap.h:140
@ GROUP_TAG
Definition: keymap.h:252
@ GROUP_SAVE
Definition: keymap.h:248
@ DIGIT_0
Definition: keymap.h:150
@ GROUP_MAIL
Definition: keymap.h:237
@ GLOBAL_SCROLL_UP
Definition: keymap.h:214
@ PAGE_TAG
Definition: keymap.h:293
@ SCOPE_DELETE
Definition: keymap.h:336
@ THREAD_SELECT_ARTICLE
Definition: keymap.h:366
@ POSTPONE_OVERRIDE
Definition: keymap.h:327
@ GROUP_DO_AUTOSELECT
Definition: keymap.h:234
@ GROUP_TOGGLE_READ_UNREAD
Definition: keymap.h:255
@ PAGE_LIST_THREAD
Definition: keymap.h:274
@ POSTPROCESS_SHAR
Definition: keymap.h:329
@ DIGIT_7
Definition: keymap.h:157
@ SAVE_APPEND_FILE
Definition: keymap.h:333
@ GLOBAL_SHELL_ESCAPE
Definition: keymap.h:223
@ GROUP_TAG_PARTS
Definition: keymap.h:253
@ GROUP_MARK_UNSELECTED_ARTICLES_READ
Definition: keymap.h:239
@ SCOPE_ADD
Definition: keymap.h:335
@ THREAD_MARK_ARTICLE_READ
Definition: keymap.h:361
@ GROUP_TOGGLE_GET_ARTICLES_LIMIT
Definition: keymap.h:254
@ DIGIT_3
Definition: keymap.h:153
@ GLOBAL_PAGE_UP
Definition: keymap.h:201
@ PAGE_TOGGLE_HEADERS
Definition: keymap.h:294
@ PAGE_TOGGLE_TABS
Definition: keymap.h:298
@ POST_EDIT
Definition: keymap.h:313
@ ATTACHMENT_UNTAG
Definition: keymap.h:166
@ GROUP_UNDO_SELECTIONS
Definition: keymap.h:259
@ GLOBAL_SET_RANGE
Definition: keymap.h:221
@ GROUP_PREVIOUS_GROUP
Definition: keymap.h:243
@ GROUP_CANCEL
Definition: keymap.h:233
@ GROUP_NEXT_UNREAD_ARTICLE
Definition: keymap.h:241
@ GROUP_SELECT_THREAD
Definition: keymap.h:250
@ GROUP_TOGGLE_SUBJECT_DISPLAY
Definition: keymap.h:256
@ FEED_ARTICLE
Definition: keymap.h:176
@ DIGIT_6
Definition: keymap.h:156
@ PAGE_TOGGLE_TEX2ISO
Definition: keymap.h:299
@ PAGE_NEXT_ARTICLE
Definition: keymap.h:277
@ THREAD_READ_ARTICLE
Definition: keymap.h:363
@ GLOBAL_PIPE
Definition: keymap.h:202
@ POST_CANCEL
Definition: keymap.h:311
@ FEED_HOT
Definition: keymap.h:178
@ FILTER_SAVE
Definition: keymap.h:185
@ ATTACHMENT_SELECT
Definition: keymap.h:162
@ PAGE_EDIT_ARTICLE
Definition: keymap.h:268
@ GLOBAL_POST
Definition: keymap.h:203
@ GLOBAL_SEARCH_SUBJECT_FORWARD
Definition: keymap.h:220
@ SELECT_MOVE_GROUP
Definition: keymap.h:345
@ PAGE_NEXT_THREAD
Definition: keymap.h:278
@ CONFIG_RESET_ATTRIB
Definition: keymap.h:171
@ THREAD_READ_NEXT_ARTICLE_OR_THREAD
Definition: keymap.h:362
@ THREAD_TOGGLE_SUBJECT_DISPLAY
Definition: keymap.h:370
@ GLOBAL_LINE_DOWN
Definition: keymap.h:194
@ POSTPROCESS_YES
Definition: keymap.h:330
@ PAGE_TOGGLE_UUE
Definition: keymap.h:300
@ ATTACHMENT_PIPE
Definition: keymap.h:160
@ SELECT_SYNC_WITH_ACTIVE
Definition: keymap.h:351
@ GLOBAL_SCROLL_DOWN
Definition: keymap.h:213
@ GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP
Definition: keymap.h:242
@ POST_POSTPONE
Definition: keymap.h:322
@ THREAD_CANCEL
Definition: keymap.h:359
@ PAGE_FOLLOWUP
Definition: keymap.h:269
@ GLOBAL_HELP
Definition: keymap.h:191
@ GLOBAL_LOOKUP_MESSAGEID
Definition: keymap.h:196
@ SCOPE_MOVE
Definition: keymap.h:338
@ SCOPE_SELECT
Definition: keymap.h:340
@ SELECT_UNSUBSCRIBE_PATTERN
Definition: keymap.h:355
@ GLOBAL_QUICK_FILTER_SELECT
Definition: keymap.h:209
@ PAGE_TOGGLE_ROT13
Definition: keymap.h:297
@ SELECT_ENTER_GROUP
Definition: keymap.h:341
@ PAGE_VIEW_URL
Definition: keymap.h:303
@ FEED_SUPERSEDE
Definition: keymap.h:183
@ GROUP_MARK_THREAD_READ
Definition: keymap.h:238
@ GROUP_NEXT_GROUP
Definition: keymap.h:240
@ DIGIT_2
Definition: keymap.h:152
@ PAGE_REPLY_QUOTE_HEADERS
Definition: keymap.h:289
@ POST_ABORT
Definition: keymap.h:310
@ PROMPT_YES
Definition: keymap.h:332
@ PAGE_MAIL
Definition: keymap.h:275
@ SELECT_NEXT_UNREAD_GROUP
Definition: keymap.h:346
@ FEED_TAGGED
Definition: keymap.h:181
@ PAGE_TOGGLE_RAW
Definition: keymap.h:296
@ THREAD_TOGGLE_ARTICLE_SELECTION
Definition: keymap.h:369
@ GLOBAL_PRINT
Definition: keymap.h:206
@ PROMPT_NO
Definition: keymap.h:331
@ GLOBAL_SEARCH_SUBJECT_BACKWARD
Definition: keymap.h:219
@ PAGE_AUTOSAVE
Definition: keymap.h:265
@ FILTER_EDIT
Definition: keymap.h:184
@ MARK_FEED_UNREAD
Definition: keymap.h:264
@ SELECT_GOTO
Definition: keymap.h:343
@ FEED_RANGE
Definition: keymap.h:180
@ SCOPE_RENAME
Definition: keymap.h:339
@ PAGE_TOP_THREAD
Definition: keymap.h:301
@ ATTACHMENT_TAG
Definition: keymap.h:163
@ POST_CONTINUE
Definition: keymap.h:312
@ GROUP_AUTOSAVE
Definition: keymap.h:232
@ GLOBAL_TOGGLE_INVERSE_VIDEO
Definition: keymap.h:230
@ POST_MAIL
Definition: keymap.h:318
@ GLOBAL_TOGGLE_HELP_DISPLAY
Definition: keymap.h:228
@ SELECT_MARK_GROUP_UNREAD
Definition: keymap.h:344
@ GLOBAL_VERSION
Definition: keymap.h:231
@ MARK_FEED_READ
Definition: keymap.h:263
@ SELECT_SUBSCRIBE_PATTERN
Definition: keymap.h:350
@ THREAD_REVERSE_SELECTIONS
Definition: keymap.h:364
@ PAGE_GROUP_SELECT
Definition: keymap.h:273
@ DIGIT_9
Definition: keymap.h:159
@ FEED_THREAD
Definition: keymap.h:177
@ PAGE_SAVE
Definition: keymap.h:291
@ PAGE_PREVIOUS_ARTICLE
Definition: keymap.h:284
@ NOT_ASSIGNED
Definition: keymap.h:149
@ GLOBAL_POSTPONED
Definition: keymap.h:204
@ PAGE_BOTTOM_THREAD
Definition: keymap.h:266
@ FEED_KEY_REPOST
Definition: keymap.h:182
@ SELECT_RESET_NEWSRC
Definition: keymap.h:347
@ POST_IGNORE_FUPTO
Definition: keymap.h:314
@ POSTPONE_ALL
Definition: keymap.h:326
@ SELECT_SORT_ACTIVE
Definition: keymap.h:348
@ SELECT_SUBSCRIBE
Definition: keymap.h:349
@ THREAD_UNTAG
Definition: keymap.h:372
@ GLOBAL_SEARCH_AUTHOR_BACKWARD
Definition: keymap.h:217
@ PAGE_REVEAL
Definition: keymap.h:286
@ GLOBAL_PAGE_DOWN
Definition: keymap.h:200
@ PAGE_NEXT_UNREAD_ARTICLE
Definition: keymap.h:280
@ FEED_PATTERN
Definition: keymap.h:179
@ SELECT_TOGGLE_DESCRIPTIONS
Definition: keymap.h:352
@ PAGE_SKIP_INCLUDED_TEXT
Definition: keymap.h:292
@ PAGE_GOTO_PARENT
Definition: keymap.h:272
@ PAGE_NEXT_UNREAD
Definition: keymap.h:279
@ ATTACHMENT_SAVE
Definition: keymap.h:161
@ CONFIG_SELECT
Definition: keymap.h:173
@ SELECT_ENTER_NEXT_UNREAD_GROUP
Definition: keymap.h:342
@ URL_SELECT
Definition: keymap.h:373
@ SAVE_OVERWRITE_FILE
Definition: keymap.h:334
@ GROUP_TOGGLE_THREADING
Definition: keymap.h:258
@ GLOBAL_EDIT_FILTER
Definition: keymap.h:189
@ POST_SEND
Definition: keymap.h:323
@ GROUP_REVERSE_SELECTIONS
Definition: keymap.h:247
@ GLOBAL_ABORT
Definition: keymap.h:186
@ PAGE_REPLY_QUOTE
Definition: keymap.h:288
@ GLOBAL_SEARCH_REPEAT
Definition: keymap.h:216
@ GLOBAL_SEARCH_AUTHOR_FORWARD
Definition: keymap.h:218
@ GLOBAL_QUIT
Definition: keymap.h:210
@ GROUP_REPOST
Definition: keymap.h:246
@ SELECT_TOGGLE_READ_DISPLAY
Definition: keymap.h:353
@ GLOBAL_FIRST_PAGE
Definition: keymap.h:190
@ GLOBAL_DISPLAY_POST_HISTORY
Definition: keymap.h:188
@ GLOBAL_REDRAW_SCREEN
Definition: keymap.h:212
@ DIGIT_8
Definition: keymap.h:158
@ GLOBAL_TOGGLE_INFO_LAST_LINE
Definition: keymap.h:229
@ PAGE_VIEW_ATTACHMENTS
Definition: keymap.h:302
@ PAGE_PREVIOUS_UNREAD_ARTICLE
Definition: keymap.h:285
@ GLOBAL_LAST_PAGE
Definition: keymap.h:192
@ DIGIT_1
Definition: keymap.h:151
@ ATTACHMENT_TOGGLE_TAGGED
Definition: keymap.h:165
@ THREAD_SAVE
Definition: keymap.h:365
@ PAGE_REPLY
Definition: keymap.h:287
@ GROUP_UNTAG
Definition: keymap.h:260
@ GLOBAL_LINE_UP
Definition: keymap.h:195
@ POSTPROCESS_NO
Definition: keymap.h:328
@ GROUP_TOGGLE_SELECT_THREAD
Definition: keymap.h:257
@ GLOBAL_SEARCH_BODY
Definition: keymap.h:215
@ DIGIT_4
Definition: keymap.h:154
@ CONFIG_TOGGLE_ATTRIB
Definition: keymap.h:175
@ THREAD_AUTOSAVE
Definition: keymap.h:358
@ THREAD_MAIL
Definition: keymap.h:360
@ GROUP_LIST_THREAD
Definition: keymap.h:236
@ GROUP_GOTO
Definition: keymap.h:235
@ GLOBAL_OPTION_MENU
Definition: keymap.h:199
@ GLOBAL_MENU_FILTER_SELECT
Definition: keymap.h:198
@ GROUP_PREVIOUS_UNREAD_ARTICLE
Definition: keymap.h:244
@ DIGIT_5
Definition: keymap.h:155
@ GLOBAL_QUIT_TIN
Definition: keymap.h:211
@ SELECT_UNSUBSCRIBE
Definition: keymap.h:354
@ PAGE_CANCEL
Definition: keymap.h:267
@ PAGE_FOLLOWUP_QUOTE_HEADERS
Definition: keymap.h:271
@ CONFIG_SCOPE_MENU
Definition: keymap.h:172
@ CATCHUP_NEXT_UNREAD
Definition: keymap.h:170
@ ATTACHMENT_TAG_PATTERN
Definition: keymap.h:164
@ POSTED_SELECT
Definition: keymap.h:325
@ MARK_ARTICLE_UNREAD
Definition: keymap.h:261
@ PAGE_MARK_THREAD_READ
Definition: keymap.h:276
@ THREAD_TAG
Definition: keymap.h:367
@ SCOPE_EDIT_ATTRIBUTES_FILE
Definition: keymap.h:337
@ THREAD_UNDO_SELECTIONS
Definition: keymap.h:371
@ CONFIG_NO_SAVE
Definition: keymap.h:174
@ GROUP_SELECT_PATTERN
Definition: keymap.h:249
@ GLOBAL_MENU_FILTER_KILL
Definition: keymap.h:197
@ GROUP_READ_BASENOTE
Definition: keymap.h:245
@ MARK_THREAD_UNREAD
Definition: keymap.h:262
@ GLOBAL_QUICK_FILTER_KILL
Definition: keymap.h:208
@ THREAD_TAG_PARTS
Definition: keymap.h:368
@ SELECT_YANK_ACTIVE
Definition: keymap.h:357
@ SELECT_QUIT_NO_WRITE
Definition: keymap.h:356
@ PAGE_FOLLOWUP_QUOTE
Definition: keymap.h:270
@ POST_SUPERSEDE
Definition: keymap.h:324
@ CATCHUP
Definition: keymap.h:169
@ PAGE_TOGGLE_HIGHLIGHTING
Definition: keymap.h:295
@ GLOBAL_BUGREPORT
Definition: keymap.h:187
@ GLOBAL_LAST_VIEWED
Definition: keymap.h:193
@ GROUP_SELECT_THREAD_IF_UNREAD_SELECTED
Definition: keymap.h:251
@ PAGE_REPOST
Definition: keymap.h:290
enum defined_functions t_function
Definition: keymap.h:375
#define ctrl(c)
Definition: keymap.h:139
static char buf[16]
Definition: langinfo.c:50
static t_bool catchup
Definition: main.c:57
char * strsep(char **stringp, const char *delim)
Definition: string.c:510
void prompt_continue(void)
Definition: prompt.c:803
char * str_trim(char *string)
Definition: string.c:539
void error_message(unsigned int sdelay, const char *fmt,...)
Definition: screen.c:224
const char * get_val(const char *env, const char *def)
Definition: misc.c:361
struct t_version * check_upgrade(char *line, const char *skip, const char *version)
Definition: version.c:65
void joinpath(char *result, size_t result_size, const char *dir, const char *file)
Definition: joinpath.c:50
char * my_strdup(const char *str)
Definition: string.c:139
t_bool match_string(char *line, const char *pat, char *dst, size_t dstlen)
Definition: config.c:1656
int my_toupper(int)
Definition: string.c:276
void wait_message(unsigned int sdelay, const char *fmt,...)
Definition: screen.c:133
void upgrade_prompt_quit(struct t_version *upgrade, const char *file)
Definition: version.c:121
void(* func)(SIG_ARGS)
Definition: signal.c:176
struct keynode * list
Definition: keymap.h:389
size_t max
Definition: keymap.h:391
size_t used
Definition: keymap.h:390
char key
Definition: keymap.h:382
t_function function
Definition: keymap.h:384
enum rc_state state
Definition: tin.h:2542
#define LEN
Definition: tin.h:860
#define NAME_LEN
Definition: tin.h:858
#define my_malloc(size)
Definition: tin.h:2245
#define DEFAULT_MAPKEYS_NUM
Definition: tin.h:622
#define FreeIfNeeded(p)
Definition: tin.h:2252
@ RC_IGNORE
Definition: tin.h:110
@ RC_UPGRADE
Definition: tin.h:110
#define _(Text)
Definition: tin.h:94
#define forever
Definition: tin.h:816
#define PATH_LEN
Definition: tin.h:843
#define snprintf
Definition: tin.h:2464
#define FreeAndNull(p)
Definition: tin.h:2253
#define my_realloc(ptr, size)
Definition: tin.h:2247
#define KEYMAP_FILE
Definition: tin.h:747
#define KEYMAP_VERSION
Definition: version.h:54