Main Page   Data Structures   File List   Data Fields   Globals   Examples  

newmail.h

Go to the documentation of this file.
00001 #ifndef foonewmailhfoo
00002 #define foonewmailhfoo
00003 
00004 /* $Id: newmail.h 31 2003-10-22 22:59:07Z lennart $ */
00005 
00006 /***
00007   This file is part of libnewmail
00008 
00009   libnewmail is free software; you can redistribute it and/or modify
00010   it under the terms of the GNU General Public License as published by
00011   the Free Software Foundation; either version 2 of the License, or
00012   (at your option) any later version.
00013   
00014   libnewmail is distributed in the hope that it will be useful, but
00015   WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017   General Public License for more details.
00018   
00019   You should have received a copy of the GNU General Public License
00020   along with libnewmail; if not, write to the Free Software
00021   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022   USA
00023 ***/
00024 
00056 #include <limits.h>
00057 #include <oop.h>
00058 
00065 enum nm_flags {
00066     NM_FLAG_SYNCHRONOUS= 1,            
00067     NM_FLAG_ASYNCHRONOUS = 2           
00068 };
00069 
00077 enum nm_error {
00078     NM_ERROR_SYSTEM = 256,                 
00079     NM_ERROR_EXPLANATION = 512,            
00080     NM_ERROR_SUCCESS = 0,                  
00081     NM_ERROR_NOCONFIG = 1,                 
00082     NM_ERROR_INVPAR = 2,                   
00083     NM_ERROR_MEMORY = 3,                   
00084     NM_ERROR_INVNAME = 4,                  
00085     NM_ERROR_DLFAIL = 5,                   
00086     NM_ERROR_NOTIMPL = 6,                  
00087     NM_ERROR_NOFILE = 7,                   
00088     NM_ERROR_FORK = 8,                     
00089     NM_ERROR_ALREADY = 9,                  
00090     NM_ERROR_CONTEXT = 10,                 
00091     NM_ERROR_INTERNAL = 11,                
00092     NM_ERROR_SERVFAIL = 12,                
00093     NM_ERROR_SERVNOTFOUND = 13,            
00094 };
00095 
00100 enum nm_query {
00101     NM_QUERY_CUR = 1,                      
00102     NM_QUERY_NEW = 2,                      
00103     NM_QUERY_NCUR = 4,                     
00104     NM_QUERY_NNEW = 8                      
00105 };
00106 
00111 struct nm_spool;
00112 
00116 struct nm_status { 
00117     int cur;                               
00118     int new;                               
00119 };
00120 
00123 struct nm_info {
00124     char name[NAME_MAX];                   
00125     char path[PATH_MAX];                   
00126     char type[32];                         
00127     char text[128];                        
00128     enum nm_flags flags;                   
00129 };
00130 
00131 
00137 typedef void (*nm_enum_cb_t) (const char *spool, void*user);
00138 
00144 typedef void (*nm_query_cb_t) (struct nm_spool *s, struct nm_status *status, void *user);
00145 
00149 extern void* (*nm_malloc)(size_t);
00150 
00155 extern void* (*nm_realloc)(void *,size_t); 
00156 
00161 extern void (*nm_free)(void *);
00162 
00167 extern const char *nm_explanation;
00168 
00172 extern enum nm_error nm_errno;
00173 
00174 
00183 struct nm_spool* nm_open(const char *spool);
00184 
00188 void nm_close(struct nm_spool *s);
00189 
00199 int nm_query(struct nm_spool *s, enum nm_query query, struct nm_status *status);
00200 
00212 int nm_query_submit(struct nm_spool *s, enum nm_query query, oop_source *oop, nm_query_cb_t cb, void *user);
00213 
00221 int nm_configure(struct nm_spool *s);
00222 
00228 int nm_info(struct nm_spool *s, struct nm_info *info);
00229 
00237 int nm_list(nm_enum_cb_t cb, void *user);
00238 
00246 const char *nm_strerror(enum nm_error n, int e, const char *explanation);
00247 
00252 void nm_perror(const char *s);
00253 
00254 #endif

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