#include <limits.h>
#include <oop.h>
Go to the source code of this file.
Data Structures | |
struct | nm_info |
A structure for storing information about a mail spool. More... | |
struct | nm_status |
A structure describing a mail spool status. More... | |
Typedefs | |
typedef void(* | nm_enum_cb_t )(const char *spool, void *user) |
A prototype for callback functions for enumerating configured mail spools with nm_list(). | |
typedef void(* | nm_query_cb_t )(struct nm_spool *s, struct nm_status *status, void *user) |
A prototype for callback functions for asynchronous mail spool queries. | |
Enumerations | |
enum | nm_flags { NM_FLAG_SYNCHRONOUS = 1, NM_FLAG_ASYNCHRONOUS = 2 } |
Flags for a mail spool; specifies if a query on this spool will be executed synchronously or asynchronously. More... | |
enum | nm_error { NM_ERROR_SYSTEM = 256, NM_ERROR_EXPLANATION = 512, NM_ERROR_SUCCESS = 0, NM_ERROR_NOCONFIG = 1, NM_ERROR_INVPAR = 2, NM_ERROR_MEMORY = 3, NM_ERROR_INVNAME = 4, NM_ERROR_DLFAIL = 5, NM_ERROR_NOTIMPL = 6, NM_ERROR_NOFILE = 7, NM_ERROR_FORK = 8, NM_ERROR_ALREADY = 9, NM_ERROR_CONTEXT = 10, NM_ERROR_INTERNAL = 11, NM_ERROR_SERVFAIL = 12, NM_ERROR_SERVNOTFOUND = 13 } |
An enumeration specifying a certain error condition. More... | |
enum | nm_query { NM_QUERY_CUR = 1, NM_QUERY_NEW = 2, NM_QUERY_NCUR = 4, NM_QUERY_NNEW = 8 } |
Types of mail spool queries; A combination of these flags should be specified on a call to nm_query(). More... | |
Functions | |
nm_spool * | nm_open (const char *spool) |
Open the given mail spool configuration file and return a pointer to an opaque stracture used as handle to access the mail spool. | |
void | nm_close (struct nm_spool *s) |
Free the given mail spool handle. | |
int | nm_query (struct nm_spool *s, enum nm_query query, struct nm_status *status) |
Issue a synchronous query for the specified mail spool. | |
int | nm_query_submit (struct nm_spool *s, enum nm_query query, oop_source *oop, nm_query_cb_t cb, void *user) |
Issue an asynchronous query for the specified mail spool. | |
int | nm_configure (struct nm_spool *s) |
Show an X11 configuration dialog for the specified mail spool -- Currently an NOOP This function will run an external configuration program for the specific mail spool eventually. | |
int | nm_info (struct nm_spool *s, struct nm_info *info) |
Fill a structure containing some information about the specified mail spool. | |
int | nm_list (nm_enum_cb_t cb, void *user) |
Enumerate all configured mail spools. | |
const char * | nm_strerror (enum nm_error n, int e, const char *explanation) |
Return a textual representation of the given error triplet. | |
void | nm_perror (const char *s) |
A similar function to libc's perror(). | |
Variables | |
void *(* | nm_malloc )(size_t) |
A pointer to a malloc() compatible function which is used by libnewmail for allocating memory. | |
void *(* | nm_realloc )(void *, size_t) |
A pointer to a realloc() compatible function which is used by libnewmail for reallocating memory. | |
void(* | nm_free )(void *) |
A pointer to a free() compatible function which is used by libnewmail for freeing memory. | |
const char * | nm_explanation |
A pointer to a textual string giving a terse explanation for the last failure. | |
enum nm_error | nm_errno |
A variable describing the last error occured. |
Applications linking to libnewmail should use only functions defined in this header file.
Definition in file newmail.h.
|
A prototype for callback functions for enumerating configured mail spools with nm_list().
|
|
A prototype for callback functions for asynchronous mail spool queries.
|
|
|
Flags for a mail spool; specifies if a query on this spool will be executed synchronously or asynchronously. Local mailbox queries are probably executed synchronously, while networked queries are exectued asynchronously. |
|
Types of mail spool queries; A combination of these flags should be specified on a call to nm_query().
|
|
Free the given mail spool handle.
|
|
Show an X11 configuration dialog for the specified mail spool -- Currently an NOOP This function will run an external configuration program for the specific mail spool eventually.
|
|
Fill a structure containing some information about the specified mail spool.
|
|
Enumerate all configured mail spools.
|
|
Open the given mail spool configuration file and return a pointer to an opaque stracture used as handle to access the mail spool. The returned pointer should be freed with nm_close() when it is no longer needed.
|
|
A similar function to libc's perror(). This function will show libnewmail error conditions however.
|
|
Issue a synchronous query for the specified mail spool. The function will block until the query succeeded or a failure is returned. Be aware that every query may use fork() to spawn a background process to execute the query.
|
|
Issue an asynchronous query for the specified mail spool. The function will return immediately, however the callback cb is called when the query is finished. Be aware that every query may use fork() to spawn a background process to execute the query.
|
|
Return a textual representation of the given error triplet.
|
|
A variable describing the last error occured. Only valid when the last API function call returned a failure. |
|
A pointer to a textual string giving a terse explanation for the last failure. This is only valid when NM_ERROR_EXPLANATION is set in nm_errno. |
|
A pointer to a free() compatible function which is used by libnewmail for freeing memory. Initially set to libc's free(). |
|
A pointer to a malloc() compatible function which is used by libnewmail for allocating memory. Initially set to libc's malloc(). |
|
A pointer to a realloc() compatible function which is used by libnewmail for reallocating memory. Initially set to libc's realloc(). |