Main Page   Data Structures   File List   Data Fields   Globals   Examples  

util.h File Reference

Some utility functions which may be used by plugins. More...

#include "newmail.h"

Go to the source code of this file.

Functions

char * nm_chomp (char *ln)
 Remove all newline and carriage return characters from the end of the string.

char * nm_specials (const char *format)
 Replace all special characters like "%h" by their respective meanings.

char * nm_strdup (const char *s)
 Like libc's strdup() but uses nm_malloc() for memory allocation.

void nm_error (enum nm_error en, const char *exp)
 Set the current error condition to the given values.


Detailed Description

Some utility functions which may be used by plugins.

Definition in file util.h.


Function Documentation

char* nm_chomp char *    ln
 

Remove all newline and carriage return characters from the end of the string.

Parameters:
ln  The string to chomp
Returns:
The same string, chomped

void nm_error enum nm_error    en,
const char *    exp
 

Set the current error condition to the given values.

Parameters:
en  Specifies the error condition to set
exp  Specifies an explanation for the error, if sensible. May be NULL. NM_ERROR_EXPLANATION is set iff exp is not NULL.

char* nm_specials const char *    format
 

Replace all special characters like "%h" by their respective meanings.

Parameters:
format  The format string to expand
Returns:
A pointer to a static memory region containing the expanded string

char* nm_strdup const char *    s
 

Like libc's strdup() but uses nm_malloc() for memory allocation.

Parameters:
s  The string to duplicate
Returns:
A pointer to a newly allocated memory block containing the copied string


Generated on Thu Oct 23 01:52:10 2003 for libnewmail by doxygen1.2.18