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 File Reference
#include "tin.h"
#include "version.h"
Include dependency graph for keymap.c:

Go to the source code of this file.

Macros

#define KEYSEPS   " \t\n"
 

Functions

static void add_default_key (struct keylist *key_list, const char *keys, t_function func)
 
static void add_global_keys (struct keylist *keys)
 
static void free_keylist (struct keylist *keys)
 
static void upgrade_keymap_file (char *old)
 
static t_bool process_keys (t_function func, const char *keys, struct keylist *kl)
 
static t_bool process_mapping (char *keyname, char *keys)
 
static t_bool add_key (struct keylist *keys, const char key, t_function func, t_bool override)
 
t_function key_to_func (const char key, const struct keylist keys)
 
char func_to_key (t_function func, const struct keylist keys)
 
void free_keymaps (void)
 
char * printascii (char *buf, int ch)
 
t_bool read_keymap_file (void)
 
void setup_default_keys (void)
 

Variables

struct keylist attachment_keys = { NULL, 0, 0}
 
struct keylist feed_post_process_keys = { NULL, 0, 0 }
 
struct keylist feed_supersede_article_keys = { NULL, 0, 0 }
 
struct keylist feed_type_keys = { NULL, 0, 0 }
 
struct keylist filter_keys = { NULL, 0, 0 }
 
struct keylist group_keys = { NULL, 0, 0 }
 
struct keylist info_keys = { NULL, 0, 0 }
 
struct keylist option_menu_keys = { NULL, 0, 0 }
 
struct keylist page_keys = { NULL, 0, 0 }
 
struct keylist post_cancel_keys = { NULL, 0, 0 }
 
struct keylist post_continue_keys = { NULL, 0, 0 }
 
struct keylist post_delete_keys = { NULL, 0, 0 }
 
struct keylist post_edit_keys = { NULL, 0, 0 }
 
struct keylist post_edit_ext_keys = { NULL, 0, 0 }
 
struct keylist post_ignore_fupto_keys = { NULL, 0, 0 }
 
struct keylist post_mail_fup_keys = { NULL, 0, 0 }
 
struct keylist post_post_keys = { NULL, 0, 0 }
 
struct keylist post_postpone_keys = { NULL, 0, 0 }
 
struct keylist post_send_keys = { NULL, 0, 0 }
 
struct keylist prompt_keys = { NULL, 0, 0 }
 
struct keylist save_append_overwrite_keys = { NULL, 0, 0 }
 
struct keylist scope_keys = { NULL, 0, 0 }
 
struct keylist select_keys = { NULL, 0, 0 }
 
struct keylist thread_keys = { NULL, 0, 0 }
 
struct keylist url_keys = { NULL, 0, 0 }
 

Macro Definition Documentation

◆ KEYSEPS

#define KEYSEPS   " \t\n"

Definition at line 319 of file keymap.c.

Function Documentation

◆ add_default_key()

static void add_default_key ( struct keylist key_list,
const char *  keys,
t_function  func 
)
static

Definition at line 198 of file keymap.c.

References add_key(), FALSE, func_to_key(), and keynode::key.

Referenced by add_global_keys(), and setup_default_keys().

◆ add_global_keys()

◆ add_key()

static t_bool add_key ( struct keylist keys,
const char  key,
t_function  func,
t_bool  override 
)
static

◆ free_keylist()

static void free_keylist ( struct keylist keys)
static

Definition at line 218 of file keymap.c.

References FreeAndNull, keylist::list, keylist::max, and keylist::used.

Referenced by free_keymaps().

◆ free_keymaps()

◆ func_to_key()

◆ key_to_func()

t_function key_to_func ( const char  key,
const struct keylist  keys 
)

Definition at line 97 of file keymap.c.

References NOT_ASSIGNED.

Referenced by handle_keypad(), prompt_slk_response(), and prompt_yn().

◆ printascii()

◆ process_keys()

static t_bool process_keys ( t_function  func,
const char *  keys,
struct keylist kl 
)
static

Definition at line 445 of file keymap.c.

References _, add_key(), ctrl, error_message(), FALSE, FreeIfNeeded, KEYSEPS, my_strdup(), TRUE, and txt_keymap_invalid_key.

Referenced by process_mapping().

◆ process_mapping()

static t_bool process_mapping ( char *  keyname,
char *  keys 
)
static

Definition at line 553 of file keymap.c.

References attachment_keys, ATTACHMENT_PIPE, ATTACHMENT_SAVE, ATTACHMENT_SELECT, ATTACHMENT_TAG, ATTACHMENT_TAG_PATTERN, ATTACHMENT_TOGGLE_TAGGED, ATTACHMENT_UNTAG, CATCHUP, CATCHUP_NEXT_UNREAD, CONFIG_NO_SAVE, CONFIG_RESET_ATTRIB, CONFIG_SCOPE_MENU, CONFIG_SELECT, CONFIG_TOGGLE_ATTRIB, FALSE, FEED_ARTICLE, FEED_HOT, FEED_KEY_REPOST, FEED_PATTERN, feed_post_process_keys, FEED_RANGE, FEED_SUPERSEDE, feed_supersede_article_keys, FEED_TAGGED, FEED_THREAD, feed_type_keys, FILTER_EDIT, filter_keys, FILTER_SAVE, GLOBAL_BUGREPORT, GLOBAL_DISPLAY_POST_HISTORY, GLOBAL_EDIT_FILTER, GLOBAL_FIRST_PAGE, GLOBAL_HELP, GLOBAL_LAST_PAGE, GLOBAL_LAST_VIEWED, GLOBAL_LINE_DOWN, GLOBAL_LINE_UP, GLOBAL_LOOKUP_MESSAGEID, GLOBAL_MENU_FILTER_KILL, GLOBAL_MENU_FILTER_SELECT, GLOBAL_OPTION_MENU, GLOBAL_PAGE_DOWN, GLOBAL_PAGE_UP, GLOBAL_PIPE, GLOBAL_POST, GLOBAL_POSTPONED, GLOBAL_PRINT, GLOBAL_QUICK_FILTER_KILL, GLOBAL_QUICK_FILTER_SELECT, GLOBAL_QUIT, GLOBAL_QUIT_TIN, GLOBAL_REDRAW_SCREEN, GLOBAL_SCROLL_DOWN, GLOBAL_SCROLL_UP, GLOBAL_SEARCH_AUTHOR_BACKWARD, GLOBAL_SEARCH_AUTHOR_FORWARD, GLOBAL_SEARCH_BODY, GLOBAL_SEARCH_REPEAT, GLOBAL_SEARCH_SUBJECT_BACKWARD, GLOBAL_SEARCH_SUBJECT_FORWARD, GLOBAL_SET_RANGE, GLOBAL_SHELL_ESCAPE, GLOBAL_TOGGLE_HELP_DISPLAY, GLOBAL_TOGGLE_INFO_LAST_LINE, GLOBAL_TOGGLE_INVERSE_VIDEO, GLOBAL_VERSION, GROUP_AUTOSAVE, GROUP_CANCEL, GROUP_DO_AUTOSELECT, GROUP_GOTO, group_keys, GROUP_LIST_THREAD, GROUP_MAIL, GROUP_MARK_THREAD_READ, GROUP_MARK_UNSELECTED_ARTICLES_READ, GROUP_NEXT_GROUP, GROUP_NEXT_UNREAD_ARTICLE, GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP, GROUP_PREVIOUS_GROUP, GROUP_PREVIOUS_UNREAD_ARTICLE, GROUP_READ_BASENOTE, GROUP_REPOST, GROUP_REVERSE_SELECTIONS, GROUP_SAVE, GROUP_SELECT_PATTERN, GROUP_SELECT_THREAD, GROUP_SELECT_THREAD_IF_UNREAD_SELECTED, GROUP_TAG, GROUP_TAG_PARTS, GROUP_TOGGLE_GET_ARTICLES_LIMIT, GROUP_TOGGLE_READ_UNREAD, GROUP_TOGGLE_SELECT_THREAD, GROUP_TOGGLE_SUBJECT_DISPLAY, GROUP_TOGGLE_THREADING, GROUP_UNDO_SELECTIONS, GROUP_UNTAG, info_keys, MARK_ARTICLE_UNREAD, MARK_FEED_READ, MARK_FEED_UNREAD, MARK_THREAD_UNREAD, option_menu_keys, PAGE_AUTOSAVE, PAGE_BOTTOM_THREAD, PAGE_CANCEL, PAGE_EDIT_ARTICLE, PAGE_FOLLOWUP, PAGE_FOLLOWUP_QUOTE, PAGE_FOLLOWUP_QUOTE_HEADERS, PAGE_GOTO_PARENT, PAGE_GROUP_SELECT, page_keys, PAGE_LIST_THREAD, PAGE_MAIL, PAGE_MARK_THREAD_READ, PAGE_NEXT_ARTICLE, PAGE_NEXT_THREAD, PAGE_NEXT_UNREAD, PAGE_NEXT_UNREAD_ARTICLE, PAGE_PREVIOUS_ARTICLE, PAGE_PREVIOUS_UNREAD_ARTICLE, PAGE_REPLY, PAGE_REPLY_QUOTE, PAGE_REPLY_QUOTE_HEADERS, PAGE_REPOST, PAGE_REVEAL, PAGE_SAVE, PAGE_SKIP_INCLUDED_TEXT, PAGE_TAG, PAGE_TOGGLE_HEADERS, PAGE_TOGGLE_HIGHLIGHTING, PAGE_TOGGLE_RAW, PAGE_TOGGLE_ROT13, PAGE_TOGGLE_TABS, PAGE_TOGGLE_TEX2ISO, PAGE_TOGGLE_UUE, PAGE_TOP_THREAD, PAGE_VIEW_ATTACHMENTS, PAGE_VIEW_URL, POST_ABORT, POST_CANCEL, post_cancel_keys, POST_CONTINUE, post_continue_keys, post_delete_keys, POST_EDIT, post_edit_ext_keys, post_edit_keys, POST_IGNORE_FUPTO, post_ignore_fupto_keys, POST_MAIL, post_mail_fup_keys, post_post_keys, POST_POSTPONE, post_postpone_keys, POST_SEND, post_send_keys, POST_SUPERSEDE, POSTPONE_ALL, POSTPONE_OVERRIDE, POSTPROCESS_NO, POSTPROCESS_SHAR, POSTPROCESS_YES, process_keys(), prompt_keys, PROMPT_NO, PROMPT_YES, SAVE_APPEND_FILE, save_append_overwrite_keys, SAVE_OVERWRITE_FILE, SCOPE_ADD, SCOPE_DELETE, SCOPE_EDIT_ATTRIBUTES_FILE, scope_keys, SCOPE_MOVE, SCOPE_RENAME, SCOPE_SELECT, SELECT_ENTER_GROUP, SELECT_ENTER_NEXT_UNREAD_GROUP, SELECT_GOTO, select_keys, SELECT_MARK_GROUP_UNREAD, SELECT_MOVE_GROUP, SELECT_NEXT_UNREAD_GROUP, SELECT_QUIT_NO_WRITE, SELECT_RESET_NEWSRC, SELECT_SORT_ACTIVE, SELECT_SUBSCRIBE, SELECT_SUBSCRIBE_PATTERN, SELECT_SYNC_WITH_ACTIVE, SELECT_TOGGLE_DESCRIPTIONS, SELECT_TOGGLE_READ_DISPLAY, SELECT_UNSUBSCRIBE, SELECT_UNSUBSCRIBE_PATTERN, SELECT_YANK_ACTIVE, THREAD_AUTOSAVE, THREAD_CANCEL, thread_keys, THREAD_MAIL, THREAD_MARK_ARTICLE_READ, THREAD_READ_ARTICLE, THREAD_READ_NEXT_ARTICLE_OR_THREAD, THREAD_REVERSE_SELECTIONS, THREAD_SAVE, THREAD_SELECT_ARTICLE, THREAD_TAG, THREAD_TOGGLE_ARTICLE_SELECTION, THREAD_TOGGLE_SUBJECT_DISPLAY, THREAD_UNDO_SELECTIONS, THREAD_UNTAG, TRUE, url_keys, and URL_SELECT.

Referenced by read_keymap_file().

◆ read_keymap_file()

◆ setup_default_keys()

void setup_default_keys ( void  )

Definition at line 2497 of file keymap.c.

References add_default_key(), add_global_keys(), attachment_keys, ATTACHMENT_PIPE, ATTACHMENT_SAVE, ATTACHMENT_SELECT, ATTACHMENT_TAG, ATTACHMENT_TAG_PATTERN, ATTACHMENT_TOGGLE_TAGGED, ATTACHMENT_UNTAG, CATCHUP, CATCHUP_NEXT_UNREAD, CONFIG_NO_SAVE, CONFIG_RESET_ATTRIB, CONFIG_SCOPE_MENU, CONFIG_SELECT, CONFIG_TOGGLE_ATTRIB, DIGIT_1, DIGIT_2, DIGIT_3, DIGIT_4, DIGIT_5, DIGIT_6, DIGIT_7, DIGIT_8, DIGIT_9, FEED_ARTICLE, FEED_HOT, FEED_KEY_REPOST, FEED_PATTERN, feed_post_process_keys, FEED_RANGE, FEED_SUPERSEDE, feed_supersede_article_keys, FEED_TAGGED, FEED_THREAD, feed_type_keys, FILTER_EDIT, filter_keys, FILTER_SAVE, GLOBAL_ABORT, GLOBAL_EDIT_FILTER, GLOBAL_FIRST_PAGE, GLOBAL_HELP, GLOBAL_LAST_PAGE, GLOBAL_LAST_VIEWED, GLOBAL_LINE_DOWN, GLOBAL_LINE_UP, GLOBAL_LOOKUP_MESSAGEID, GLOBAL_MENU_FILTER_KILL, GLOBAL_MENU_FILTER_SELECT, GLOBAL_OPTION_MENU, GLOBAL_PAGE_DOWN, GLOBAL_PAGE_UP, GLOBAL_PIPE, GLOBAL_POST, GLOBAL_PRINT, GLOBAL_QUICK_FILTER_KILL, GLOBAL_QUICK_FILTER_SELECT, GLOBAL_QUIT, GLOBAL_REDRAW_SCREEN, GLOBAL_SCROLL_DOWN, GLOBAL_SCROLL_UP, GLOBAL_SEARCH_AUTHOR_BACKWARD, GLOBAL_SEARCH_AUTHOR_FORWARD, GLOBAL_SEARCH_BODY, GLOBAL_SEARCH_REPEAT, GLOBAL_SEARCH_SUBJECT_BACKWARD, GLOBAL_SEARCH_SUBJECT_FORWARD, GLOBAL_SHELL_ESCAPE, GLOBAL_TOGGLE_HELP_DISPLAY, GLOBAL_TOGGLE_INFO_LAST_LINE, GLOBAL_VERSION, GROUP_AUTOSAVE, GROUP_CANCEL, GROUP_DO_AUTOSELECT, GROUP_GOTO, group_keys, GROUP_LIST_THREAD, GROUP_MAIL, GROUP_MARK_THREAD_READ, GROUP_MARK_UNSELECTED_ARTICLES_READ, GROUP_NEXT_GROUP, GROUP_NEXT_UNREAD_ARTICLE, GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP, GROUP_PREVIOUS_GROUP, GROUP_PREVIOUS_UNREAD_ARTICLE, GROUP_READ_BASENOTE, GROUP_REPOST, GROUP_REVERSE_SELECTIONS, GROUP_SAVE, GROUP_SELECT_PATTERN, GROUP_SELECT_THREAD, GROUP_SELECT_THREAD_IF_UNREAD_SELECTED, GROUP_TAG, GROUP_TAG_PARTS, GROUP_TOGGLE_GET_ARTICLES_LIMIT, GROUP_TOGGLE_READ_UNREAD, GROUP_TOGGLE_SELECT_THREAD, GROUP_TOGGLE_SUBJECT_DISPLAY, GROUP_TOGGLE_THREADING, GROUP_UNDO_SELECTIONS, GROUP_UNTAG, info_keys, MARK_ARTICLE_UNREAD, MARK_FEED_READ, MARK_FEED_UNREAD, MARK_THREAD_UNREAD, option_menu_keys, PAGE_AUTOSAVE, PAGE_BOTTOM_THREAD, PAGE_CANCEL, PAGE_EDIT_ARTICLE, PAGE_FOLLOWUP, PAGE_FOLLOWUP_QUOTE, PAGE_FOLLOWUP_QUOTE_HEADERS, PAGE_GOTO_PARENT, PAGE_GROUP_SELECT, page_keys, PAGE_LIST_THREAD, PAGE_MAIL, PAGE_MARK_THREAD_READ, PAGE_NEXT_ARTICLE, PAGE_NEXT_THREAD, PAGE_NEXT_UNREAD, PAGE_NEXT_UNREAD_ARTICLE, PAGE_PREVIOUS_ARTICLE, PAGE_PREVIOUS_UNREAD_ARTICLE, PAGE_REPLY, PAGE_REPLY_QUOTE, PAGE_REPLY_QUOTE_HEADERS, PAGE_REPOST, PAGE_REVEAL, PAGE_SAVE, PAGE_SKIP_INCLUDED_TEXT, PAGE_TAG, PAGE_TOGGLE_HEADERS, PAGE_TOGGLE_HIGHLIGHTING, PAGE_TOGGLE_RAW, PAGE_TOGGLE_ROT13, PAGE_TOGGLE_TABS, PAGE_TOGGLE_TEX2ISO, PAGE_TOGGLE_UUE, PAGE_TOP_THREAD, PAGE_VIEW_ATTACHMENTS, PAGE_VIEW_URL, POST_ABORT, POST_CANCEL, post_cancel_keys, POST_CONTINUE, post_continue_keys, post_delete_keys, POST_EDIT, post_edit_ext_keys, post_edit_keys, POST_IGNORE_FUPTO, post_ignore_fupto_keys, POST_MAIL, post_mail_fup_keys, post_post_keys, POST_POSTPONE, post_postpone_keys, POST_SEND, post_send_keys, POST_SUPERSEDE, POSTPONE_ALL, POSTPONE_OVERRIDE, POSTPROCESS_NO, POSTPROCESS_SHAR, POSTPROCESS_YES, prompt_keys, PROMPT_NO, PROMPT_YES, SAVE_APPEND_FILE, save_append_overwrite_keys, SAVE_OVERWRITE_FILE, SCOPE_ADD, SCOPE_DELETE, SCOPE_EDIT_ATTRIBUTES_FILE, scope_keys, SCOPE_MOVE, SCOPE_RENAME, SCOPE_SELECT, SELECT_ENTER_GROUP, SELECT_ENTER_NEXT_UNREAD_GROUP, SELECT_GOTO, select_keys, SELECT_MARK_GROUP_UNREAD, SELECT_MOVE_GROUP, SELECT_NEXT_UNREAD_GROUP, SELECT_QUIT_NO_WRITE, SELECT_RESET_NEWSRC, SELECT_SORT_ACTIVE, SELECT_SUBSCRIBE, SELECT_SUBSCRIBE_PATTERN, SELECT_SYNC_WITH_ACTIVE, SELECT_TOGGLE_DESCRIPTIONS, SELECT_TOGGLE_READ_DISPLAY, SELECT_UNSUBSCRIBE, SELECT_UNSUBSCRIBE_PATTERN, SELECT_YANK_ACTIVE, THREAD_AUTOSAVE, THREAD_CANCEL, thread_keys, THREAD_MAIL, THREAD_MARK_ARTICLE_READ, THREAD_READ_ARTICLE, THREAD_READ_NEXT_ARTICLE_OR_THREAD, THREAD_REVERSE_SELECTIONS, THREAD_SAVE, THREAD_SELECT_ARTICLE, THREAD_TAG, THREAD_TOGGLE_ARTICLE_SELECTION, THREAD_TOGGLE_SUBJECT_DISPLAY, THREAD_UNDO_SELECTIONS, THREAD_UNTAG, url_keys, and URL_SELECT.

Referenced by main(), and read_keymap_file().

◆ upgrade_keymap_file()

static void upgrade_keymap_file ( char *  old)
static

Variable Documentation

◆ attachment_keys

struct keylist attachment_keys = { NULL, 0, 0}

◆ feed_post_process_keys

struct keylist feed_post_process_keys = { NULL, 0, 0 }

Definition at line 63 of file keymap.c.

Referenced by free_keymaps(), get_post_proc_type(), process_mapping(), and setup_default_keys().

◆ feed_supersede_article_keys

struct keylist feed_supersede_article_keys = { NULL, 0, 0 }

Definition at line 64 of file keymap.c.

Referenced by feed_articles(), free_keymaps(), process_mapping(), and setup_default_keys().

◆ feed_type_keys

struct keylist feed_type_keys = { NULL, 0, 0 }

Definition at line 65 of file keymap.c.

Referenced by free_keymaps(), get_feed_key(), process_mapping(), and setup_default_keys().

◆ filter_keys

struct keylist filter_keys = { NULL, 0, 0 }

Definition at line 66 of file keymap.c.

Referenced by filter_menu(), free_keymaps(), process_mapping(), and setup_default_keys().

◆ group_keys

struct keylist group_keys = { NULL, 0, 0 }

◆ info_keys

struct keylist info_keys = { NULL, 0, 0 }

◆ option_menu_keys

struct keylist option_menu_keys = { NULL, 0, 0 }

◆ page_keys

struct keylist page_keys = { NULL, 0, 0 }

◆ post_cancel_keys

struct keylist post_cancel_keys = { NULL, 0, 0 }

Definition at line 75 of file keymap.c.

Referenced by cancel_article(), free_keymaps(), process_mapping(), and setup_default_keys().

◆ post_continue_keys

struct keylist post_continue_keys = { NULL, 0, 0 }

Definition at line 76 of file keymap.c.

Referenced by free_keymaps(), mail_to_author(), process_mapping(), and setup_default_keys().

◆ post_delete_keys

struct keylist post_delete_keys = { NULL, 0, 0 }

Definition at line 77 of file keymap.c.

Referenced by cancel_article(), free_keymaps(), process_mapping(), and setup_default_keys().

◆ post_edit_ext_keys

struct keylist post_edit_ext_keys = { NULL, 0, 0 }

Definition at line 79 of file keymap.c.

Referenced by free_keymaps(), process_mapping(), repair_article(), and setup_default_keys().

◆ post_edit_keys

struct keylist post_edit_keys = { NULL, 0, 0 }

Definition at line 78 of file keymap.c.

Referenced by free_keymaps(), process_mapping(), prompt_rejected(), and setup_default_keys().

◆ post_ignore_fupto_keys

struct keylist post_ignore_fupto_keys = { NULL, 0, 0 }

Definition at line 80 of file keymap.c.

Referenced by free_keymaps(), post_response(), process_mapping(), and setup_default_keys().

◆ post_mail_fup_keys

struct keylist post_mail_fup_keys = { NULL, 0, 0 }

Definition at line 81 of file keymap.c.

Referenced by free_keymaps(), post_response(), process_mapping(), and setup_default_keys().

◆ post_post_keys

struct keylist post_post_keys = { NULL, 0, 0 }

Definition at line 82 of file keymap.c.

Referenced by free_keymaps(), post_loop(), process_mapping(), repost_article(), and setup_default_keys().

◆ post_postpone_keys

struct keylist post_postpone_keys = { NULL, 0, 0 }

◆ post_send_keys

struct keylist post_send_keys = { NULL, 0, 0 }

Definition at line 84 of file keymap.c.

Referenced by free_keymaps(), process_mapping(), prompt_to_send(), and setup_default_keys().

◆ prompt_keys

struct keylist prompt_keys = { NULL, 0, 0 }

Definition at line 85 of file keymap.c.

Referenced by free_keymaps(), process_mapping(), prompt_yn(), and setup_default_keys().

◆ save_append_overwrite_keys

struct keylist save_append_overwrite_keys = { NULL, 0, 0 }

Definition at line 86 of file keymap.c.

Referenced by free_keymaps(), open_save_filename(), process_mapping(), and setup_default_keys().

◆ scope_keys

struct keylist scope_keys = { NULL, 0, 0 }

◆ select_keys

struct keylist select_keys = { NULL, 0, 0 }

◆ thread_keys

struct keylist thread_keys = { NULL, 0, 0 }

◆ url_keys

struct keylist url_keys = { NULL, 0, 0 }