NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
perror.c File Reference

Parse Error. More...

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

Go to the source code of this file.

Functions

struct ParseErrorparse_error_new (void)
 Create a new ParseError.
 
void parse_error_free (struct ParseError **pptr)
 Free a ParseError.
 
void parse_error_reset (struct ParseError *pe)
 Clear the contents of a ParseError.
 

Detailed Description

Parse Error.

Authors
  • Richard Russon

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 http://www.gnu.org/licenses/.

Definition in file perror.c.

Function Documentation

◆ parse_error_new()

struct ParseError * parse_error_new ( void )

Create a new ParseError.

Return values
ptrNew ParseError

Definition at line 37 of file perror.c.

38{
39 struct ParseError *pc = MUTT_MEM_CALLOC(1, struct ParseError);
40
41 pc->message = buf_pool_get();
42
43 return pc;
44}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
Detailed error information from config parsing.
Definition perror.h:34
struct Buffer * message
Error message.
Definition perror.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_error_free()

void parse_error_free ( struct ParseError ** pptr)

Free a ParseError.

Parameters
pptrParseError to free

Definition at line 50 of file perror.c.

51{
52 if (!pptr || !*pptr)
53 return;
54
55 struct ParseError *pe = *pptr;
56
58
59 FREE(pptr);
60}
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_error_reset()

void parse_error_reset ( struct ParseError * pe)

Clear the contents of a ParseError.

Parameters
peParseError to clear

Definition at line 66 of file perror.c.

67{
68 buf_reset(pe->message);
69}
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition buffer.c:76
+ Here is the call graph for this function:
+ Here is the caller graph for this function: