File: doc.h

package info (click to toggle)
texinfo 7.2.91-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 99,372 kB
  • sloc: perl: 639,678; ansic: 153,056; sh: 17,327; xml: 9,180; makefile: 2,531; javascript: 1,935; awk: 1,902; python: 74; pascal: 68; sed: 39
file content (73 lines) | stat: -rw-r--r-- 2,815 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* doc.h -- Structures associating function pointers with documentation.

   Copyright 1993-2026 Free Software Foundation, Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>.

   Originally written by Brian Fox. */

#if !defined (DOC_H)
#define DOC_H

#include "info.h"

/* For each function, we keep track of the first defined key sequence
   which invokes that function, for each different map.  This is so that
   the dynamic documentation generation in infodoc.c (a) doesn't have to
   search through copious KEYMAP_ENTRYs, and, more importantly, (b) the
   user and programmer can choose the preferred key sequence that is
   printed for any given function -- it's just the first one that
   appears in the user's infokey file or the default keymaps in
   infomap.c.

   Each InfoCommand has a linked list of FUNCTION_KEYSEQ structs
   hanging off it, which are created on startup when the user and/or
   default keymaps are being parsed.  */
typedef struct function_keyseq
{
  struct function_keyseq *next;
  struct keymap_entry *map;
  int *keyseq;
} FUNCTION_KEYSEQ;

/* Structure describing an Info command. */
typedef struct InfoCommand
{
  COMMAND_FUNCTION *func; /* Pointer to function implementing command. */
  char *func_name;        /* Name of this command. */
  FUNCTION_KEYSEQ *keys;  /* Key sequences that could invoke this command. */
  char *doc;              /* Documentation string. */
} InfoCommand;

/* Array of InfoCommand structures defined in doc.c, generated
   by the makedoc utility. */
extern InfoCommand function_doc_array[];

#define InfoCmd(fn) (&function_doc_array[A_##fn])

#include "infomap.h" /* for Keymap.  */

extern const char *function_name (InfoCommand *cmd);
extern InfoCommand *named_function (char *name);

extern const char *function_documentation (InfoCommand *cmd);
extern char *pretty_keyname (int key);
extern const char *pretty_keyseq (const int *keyseq);
extern const char *pretty_keyseq_ext (const int *keyseq, int);
extern const char *where_is (Keymap map, InfoCommand *cmd);
extern const char *replace_in_documentation (const char *string,
    int help_is_only_window_p);
extern void dump_map_to_message_buffer (char *prefix, Keymap map);

#endif /* !DOC_H */