Changeset afa200a


Ignore:
Timestamp:
Aug 15, 2009, 7:08:20 PM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
12bc46a
Parents:
f1d7d0f
git-author:
Anders Kaseorg <andersk@mit.edu> (08/04/09 00:18:32)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:20)
Message:
Add const qualifiers for owl_keymap *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r9e5c9f3 rafa200a  
    29012901  owl_list l;
    29022902  owl_fmtext fm;
    2903   owl_keymap *km;
     2903  const owl_keymap *km;
    29042904  owl_keyhandler *kh;
    29052905  int i, numkm;
     
    29302930char *owl_function_keymap_summary(const char *name)
    29312931{
    2932   owl_keymap *km
     2932  const owl_keymap *km
    29332933    = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name);
    29342934  if (km) return owl_keymap_summary(km);
     
    29402940{
    29412941  owl_fmtext fm;
    2942   owl_keymap *km;
     2942  const owl_keymap *km;
    29432943
    29442944  owl_fmtext_init_null(&fm);
  • keymap.c

    rf1d7d0f rafa200a  
    2424}
    2525
    26 void owl_keymap_set_submap(owl_keymap *km, owl_keymap *submap)
     26void owl_keymap_set_submap(owl_keymap *km, const owl_keymap *submap)
    2727{
    2828  km->submap = submap;
     
    5454
    5555/* returns a summary line describing this keymap.  the caller must free. */
    56 char *owl_keymap_summary(owl_keymap *km)
     56char *owl_keymap_summary(const owl_keymap *km)
    5757{
    5858  char *s;
     
    6666
    6767/* Appends details about the keymap to fm */
    68 void owl_keymap_get_details(owl_keymap *km, owl_fmtext *fm)
     68void owl_keymap_get_details(const owl_keymap *km, owl_fmtext *fm)
    6969{
    7070  int i, nbindings;
     
    187187/* sets the active keymap, which will also reset any key state.
    188188 * returns the new keymap, or NULL on failure. */
    189 owl_keymap *owl_keyhandler_activate(owl_keyhandler *kh, const char *mapname)
    190 {
    191   owl_keymap *km;
     189const owl_keymap *owl_keyhandler_activate(owl_keyhandler *kh, const char *mapname)
     190{
     191  const owl_keymap *km;
    192192  if (kh->active && !strcmp(mapname, kh->active->name)) return(kh->active);
    193193  km = owl_dict_find_element(&kh->keymaps, mapname);
     
    202202int owl_keyhandler_process(owl_keyhandler *kh, owl_input j)
    203203{
    204   owl_keymap     *km;
     204  const owl_keymap     *km;
    205205  const owl_keybinding *kb;
    206206  int i, match;
  • owl.h

    rbd65108 rafa200a  
    448448  char     *desc;               /* description */
    449449  owl_list  bindings;           /* key bindings */
    450   struct _owl_keymap *submap;   /* submap */
     450  const struct _owl_keymap *submap;     /* submap */
    451451  void (*default_fn)(owl_input j);      /* default action (takes a keypress) */
    452452  void (*prealways_fn)(owl_input  j);   /* always called before a keypress is received */
     
    456456typedef struct _owl_keyhandler {
    457457  owl_dict  keymaps;            /* dictionary of keymaps */
    458   owl_keymap *active;           /* currently active keymap */
     458  const owl_keymap *active;             /* currently active keymap */
    459459  int       in_esc;             /* escape pressed? */
    460460  int       kpstack[OWL_KEYMAP_MAXSTACK+1]; /* current stack of keypresses */
Note: See TracChangeset for help on using the changeset viewer.