(root)/
texinfo-7.1/
info/
doc.h
       1  /* doc.h -- Structures associating function pointers with documentation.
       2  
       3     Copyright 1993-2023 Free Software Foundation, Inc.
       4  
       5     This program is free software: you can redistribute it and/or modify
       6     it under the terms of the GNU General Public License as published by
       7     the Free Software Foundation, either version 3 of the License, or
       8     (at your option) any later version.
       9  
      10     This program is distributed in the hope that it will be useful,
      11     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13     GNU General Public License for more details.
      14  
      15     You should have received a copy of the GNU General Public License
      16     along with this program.  If not, see <http://www.gnu.org/licenses/>.
      17  
      18     Originally written by Brian Fox. */
      19  
      20  #if !defined (DOC_H)
      21  #define DOC_H
      22  
      23  #include "info.h"
      24  
      25  /* For each function, we keep track of the first defined key sequence
      26     which invokes that function, for each different map.  This is so that
      27     the dynamic documentation generation in infodoc.c (a) doesn't have to
      28     search through copious KEYMAP_ENTRYs, and, more importantly, (b) the
      29     user and programmer can choose the preferred key sequence that is
      30     printed for any given function -- it's just the first one that
      31     appears in the user's infokey file or the default keymaps in
      32     infomap.c.
      33  
      34     Each FUNCTION_DOC has a linked list of FUNCTION_KEYSEQ structs
      35     hanging off it, which are created on startup when the user and/or
      36     default keymaps are being parsed.  */
      37  typedef struct function_keyseq
      38  {
      39    struct function_keyseq *next;
      40    struct keymap_entry *map;
      41    int *keyseq;
      42  } FUNCTION_KEYSEQ;
      43  
      44  /* Structure describing an Info command. */
      45  typedef struct
      46  {
      47    VFunction *func;        /* Pointer to function implementing command. */
      48    char *func_name;        /* Name of this command. */
      49    FUNCTION_KEYSEQ *keys;  /* Key sequences that could invoke this command. */
      50    char *doc;              /* Documentation string. */
      51  } FUNCTION_DOC;
      52  
      53  /* Array of FUNCTION_DOC structures defined in doc.c, generated
      54     by the makedoc utility. */
      55  extern FUNCTION_DOC function_doc_array[];
      56  
      57  typedef FUNCTION_DOC InfoCommand;
      58  #define InfoCmd(fn) (&function_doc_array[A_##fn])
      59  
      60  #include "infomap.h" /* for Keymap.  */
      61  
      62  extern char *function_name (InfoCommand *cmd);
      63  extern InfoCommand *named_function (char *name);
      64  
      65  extern char *function_documentation (InfoCommand *cmd);
      66  extern char *pretty_keyname (int key);
      67  extern char *pretty_keyseq (int *keyseq);
      68  extern char *where_is (Keymap map, InfoCommand *cmd);
      69  extern char *replace_in_documentation (const char *string,
      70      int help_is_only_window_p);
      71  extern void dump_map_to_message_buffer (char *prefix, Keymap map);
      72  
      73  #endif /* !DOC_H */