1 /**
2  * @file
3  * Struct to store the cursor position when entering text
4  *
5  * @authors
6  * Copyright (C) 2017 Richard Russon <rich@flatcap.org>
7  *
8  * @copyright
9  * This program is free software: you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License as published by the Free Software
11  * Foundation, either version 2 of the License, or (at your option) any later
12  * version.
13  *
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License along with
20  * this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef MUTT_ENTER_STATE_H
24 #define MUTT_ENTER_STATE_H
25 
26 #include <stddef.h>
27 #include <wchar.h> // IWYU pragma: keep
28 
29 /**
30  * struct EnterState - Keep our place when entering a string
31  */
32 struct EnterState
33 {
34   wchar_t *wbuf;   ///< Buffer for the string being entered
35   size_t wbuflen;  ///< Length of buffer
36   size_t lastchar; ///< Position of the last character
37   size_t curpos;   ///< Position of the cursor
38   size_t begin;    ///< Position of the start
39   int tabs;        ///< Number of times the user has hit tab
40 };
41 
42 void mutt_enter_state_free(struct EnterState **ptr);
43 struct EnterState *mutt_enter_state_new(void);
44 
45 #endif /* MUTT_ENTER_STATE_H */
46