NeoMutt  2024-04-25-97-g7d2481
Teaching an old dog new tricks
No Matches
search_state.c File Reference

Holds state of a search. More...

#include "config.h"
#include "mutt/lib.h"
#include "search_state.h"
#include "lib.h"
+ Include dependency graph for search_state.c:

Go to the source code of this file.


struct SearchStatesearch_state_new (void)
 Create a new SearchState.
void search_state_free (struct SearchState **ptr)
 Free a SearchState.

Detailed Description

Holds state of a search.

  • Richard Russon
  • Dennis Schön

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

Definition in file search_state.c.

Function Documentation

◆ search_state_new()

struct SearchState * search_state_new ( void  )

Create a new SearchState.

Return values
ptrNew SearchState

Definition at line 39 of file search_state.c.

41 struct SearchState *s = mutt_mem_calloc(1, sizeof(struct SearchState));
42 s->string = buf_pool_get();
44 return s;
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:81
Holds state of a search.
Definition: search_state.h:36
struct Buffer * string
search string
Definition: search_state.h:38
struct Buffer * string_expn
expanded search string
Definition: search_state.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ search_state_free()

void search_state_free ( struct SearchState **  ptr)

Free a SearchState.

ptrSearchState to free

Definition at line 51 of file search_state.c.

53 if (!ptr || !*ptr)
54 return;
56 struct SearchState *s = *ptr;
61 FREE(ptr);
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
Definition: compile.c:778
#define FREE(x)
Definition: memory.h:45
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
struct PatternList * pattern
compiled search pattern
Definition: search_state.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function: