Commit 6929560d 6929560d4d9dc95813022b9350da0f98f03e95c1 by Sergey Poznyakoff

Fix-up structure names from types.h

1 parent 6a1cb4d4
2005-08-29 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac: Raise version number to 0.6.92
Raise library current interface version to 1
* include/mailutils/filter.h,
include/mailutils/registrar.h, include/mailutils/types.h,
mailbox/filter.c, mailbox/filter_rfc822.c, mailbox/filter_trans.c,
mailbox/folder.c, mailbox/getopt.h, mailbox/locker.c,
mailbox/parse822.c, mailbox/registrar.c, mailbox/sendmail.c,
mailbox/smtp.c, mailbox/url.c, mailbox/imap/folder.c,
mailbox/include/address0.h, mailbox/include/attribute0.h,
mailbox/include/auth0.h, mailbox/include/body0.h,
mailbox/include/debug0.h, mailbox/include/envelope0.h,
mailbox/include/filter0.h, mailbox/include/folder0.h,
mailbox/include/header0.h, mailbox/include/iterator0.h,
mailbox/include/list0.h, mailbox/include/mailbox0.h,
mailbox/include/mailer0.h, mailbox/include/message0.h,
mailbox/include/mime0.h, mailbox/include/observer0.h,
mailbox/include/property0.h, mailbox/include/stream0.h,
mailbox/include/url0.h, mailbox/maildir/folder.c,
mailbox/mbox/folder.c, mailbox/mh/folder.c, mailbox/nntp/folder.c,
mailbox/pop/folder.c: Fix-up structure names from types.h
Final seasoning: Replace munre_ with mu_unre_
* include/mailutils/mutil.h
......
......@@ -34,15 +34,15 @@ extern "C" {
#define MU_FILTER_WRITE MU_STREAM_WRITE
#define MU_FILTER_RDWR MU_STREAM_RDWR
struct mu_filter_record
struct _mu_filter_record
{
const char *name;
int (*_filter) (mu_filter_t);
int (*_mu_filter) (mu_filter_t);
void *data;
/* Stub function return the fields. */
int (*_is_filter) (mu_filter_record_t, const char *);
int (*_get_filter) (mu_filter_record_t, int (*(*_filter)) (mu_filter_t));
int (*_get_filter) (mu_filter_record_t, int (*(*_mu_filter)) (mu_filter_t));
};
......
......@@ -26,22 +26,22 @@ extern "C" {
#endif
/* Public Interface, to allow static initialization. */
struct mu__record
struct _mu_record
{
int priority; /* Higher priority records are scanned first */
const char *scheme;
int (*_url) (mu_url_t);
int (*_mailbox) (mu_mailbox_t);
int (*_mailer) (mu_mailer_t);
int (*_folder) (mu_folder_t);
int (*_mu_url) (mu_url_t);
int (*_mu_mailbox) (mu_mailbox_t);
int (*_mu_mailer) (mu_mailer_t);
int (*_mu_folder) (mu_folder_t);
void *data; /* back pointer. */
/* Stub functions to override. The default is to return the fields. */
int (*_is_scheme) (mu_record_t, const char *, int);
int (*_get_url) (mu_record_t, int (*(*_url)) (mu_url_t));
int (*_get_mailbox) (mu_record_t, int (*(*_mailbox)) (mu_mailbox_t));
int (*_get_mailer) (mu_record_t, int (*(*_mailer)) (mu_mailer_t));
int (*_get_folder) (mu_record_t, int (*(*_folder)) (mu_folder_t));
int (*_get_url) (mu_record_t, int (*(*_mu_url)) (mu_url_t));
int (*_get_mailbox) (mu_record_t, int (*(*_mu_mailbox)) (mu_mailbox_t));
int (*_get_mailer) (mu_record_t, int (*(*_mu_mailer)) (mu_mailer_t));
int (*_get_folder) (mu_record_t, int (*(*_mu_folder)) (mu_folder_t));
};
/* Registration. */
......
......@@ -25,63 +25,63 @@
extern "C" {
#endif
struct _address;
struct _attribute;
struct _authority;
struct _body;
struct _debug;
struct _envelope;
struct _filter;
struct mu_filter_record;
struct _folder;
struct _header;
struct _iterator;
struct _list;
struct _locker;
struct _mailbox;
struct _mailer;
struct _message;
struct _mime;
struct _mu_address;
struct _mu_attribute;
struct _mu_authority;
struct _mu_body;
struct _mu_debug;
struct _mu_envelope;
struct _mu_filter;
struct _mu_filter_record;
struct _mu_folder;
struct _mu_header;
struct _mu_iterator;
struct _mu_list;
struct _mu_locker;
struct _mu_mailbox;
struct _mu_mailer;
struct _mu_message;
struct _mu_mime;
struct _mu_mailcap;
struct _mu_mailcap_entry;
struct _mu_refcount;
struct _observable;
struct _observer;
struct _property;
struct mu__record;
struct _stream;
struct _ticket;
struct _url;
struct _wicket;
struct _mu_observable;
struct _mu_observer;
struct _mu_property;
struct _mu_record;
struct _mu_stream;
struct _mu_ticket;
struct _mu_url;
struct _mu_wicket;
typedef struct _address *mu_address_t;
typedef struct _attribute *mu_attribute_t;
typedef struct _authority *mu_authority_t;
typedef struct _body *mu_body_t;
typedef struct _debug *mu_debug_t;
typedef struct _envelope *mu_envelope_t;
typedef struct _filter *mu_filter_t;
typedef struct mu_filter_record *mu_filter_record_t;
typedef struct _folder *mu_folder_t;
typedef struct _header * mu_header_t;
typedef struct _iterator *mu_iterator_t;
typedef struct _list *mu_list_t;
typedef struct _locker *mu_locker_t;
typedef struct _mailbox *mu_mailbox_t;
typedef struct _mailer *mu_mailer_t;
typedef struct _message *mu_message_t;
typedef struct _mime *mu_mime_t;
typedef struct _mu_address *mu_address_t;
typedef struct _mu_attribute *mu_attribute_t;
typedef struct _mu_authority *mu_authority_t;
typedef struct _mu_body *mu_body_t;
typedef struct _mu_debug *mu_debug_t;
typedef struct _mu_envelope *mu_envelope_t;
typedef struct _mu_filter *mu_filter_t;
typedef struct _mu_filter_record *mu_filter_record_t;
typedef struct _mu_folder *mu_folder_t;
typedef struct _mu_header * mu_header_t;
typedef struct _mu_iterator *mu_iterator_t;
typedef struct _mu_list *mu_list_t;
typedef struct _mu_locker *mu_locker_t;
typedef struct _mu_mailbox *mu_mailbox_t;
typedef struct _mu_mailer *mu_mailer_t;
typedef struct _mu_message *mu_message_t;
typedef struct _mu_mime *mu_mime_t;
typedef struct _mu_mailcap *mu_mailcap_t;
typedef struct _mu_mailcap_entry *mu_mailcap_entry_t;
typedef struct _mu_refcount *mu_refcount_t;
typedef struct _observable *mu_observable_t;
typedef struct _observer *mu_observer_t;
typedef struct _property *mu_property_t;
typedef struct mu__record *mu_record_t;
typedef struct _stream *mu_stream_t;
typedef struct _ticket *mu_ticket_t;
typedef struct _url *mu_url_t;
typedef struct _wicket *mu_wicket_t;
typedef struct _mu_observable *mu_observable_t;
typedef struct _mu_observer *mu_observer_t;
typedef struct _mu_property *mu_property_t;
typedef struct _mu_record *mu_record_t;
typedef struct _mu_stream *mu_stream_t;
typedef struct _mu_ticket *mu_ticket_t;
typedef struct _mu_url *mu_url_t;
typedef struct _mu_wicket *mu_wicket_t;
typedef void *mu_transport_t;
#define MU_FOLDER_ATTRIBUTE_DIRECTORY 0x001
......
......@@ -190,7 +190,7 @@ mu_filter_create (mu_stream_t *pstream, mu_stream_t stream, const char *name,
if (filter_record->_get_filter)
filter_record->_get_filter (filter_record, &f_init);
else
f_init = filter_record->_filter;
f_init = filter_record->_mu_filter;
break;
}
}
......
......@@ -44,7 +44,7 @@ struct rfc822
int residue;
};
static struct mu_filter_record _rfc822_filter =
static struct _mu_filter_record _rfc822_filter =
{
"RFC822",
rfc822_init,
......
......@@ -378,7 +378,7 @@ qp_init (mu_filter_t filter)
return 0;
}
static struct mu_filter_record _qp_filter =
static struct _mu_filter_record _qp_filter =
{
"quoted-printable",
qp_init,
......@@ -510,7 +510,7 @@ base64_init (mu_filter_t filter)
return 0;
}
static struct mu_filter_record _base64_filter =
static struct _mu_filter_record _base64_filter =
{
"base64",
base64_init,
......@@ -696,7 +696,7 @@ Q_init (mu_filter_t filter)
return 0;
}
static struct mu_filter_record _Q_filter =
static struct _mu_filter_record _Q_filter =
{
"Q",
Q_init,
......@@ -708,7 +708,7 @@ static struct mu_filter_record _Q_filter =
/* Pass-through encodings */
static struct mu_filter_record _bit8_filter =
static struct _mu_filter_record _bit8_filter =
{
"8bit",
NULL,
......@@ -717,7 +717,7 @@ static struct mu_filter_record _bit8_filter =
NULL
};
static struct mu_filter_record _bit7_filter =
static struct _mu_filter_record _bit7_filter =
{
"7bit",
NULL,
......@@ -726,7 +726,7 @@ static struct mu_filter_record _bit7_filter =
NULL
};
static struct mu_filter_record _binary_filter =
static struct _mu_filter_record _binary_filter =
{
"binary",
NULL,
......
......@@ -311,9 +311,9 @@ int
mu_folder_list (mu_folder_t folder, const char *dirname, const char *basename,
struct mu_folder_list *pflist)
{
if (folder == NULL || folder->_list == NULL)
if (folder == NULL || folder->_mu_list == NULL)
return EINVAL;
return folder->_list (folder, dirname, basename, pflist);
return folder->_mu_list (folder, dirname, basename, pflist);
}
int
......
......@@ -13,10 +13,9 @@
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, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA. */
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_H
......
......@@ -62,7 +62,7 @@
#define DEBUG_SHOW_DATA 0
/* Variable use for the registrar. */
static struct mu__record _imap_record =
static struct _mu_record _imap_record =
{
MU_IMAP_PRIO,
MU_IMAP_SCHEME,
......@@ -416,7 +416,7 @@ _folder_imap_init (mu_folder_t folder)
folder->_open = folder_imap_open;
folder->_close = folder_imap_close;
folder->_list = folder_imap_list;
folder->_mu_list = folder_imap_list;
folder->_lsub = folder_imap_lsub;
folder->_subscribe = folder_imap_subscribe;
folder->_unsubscribe = folder_imap_unsubscribe;
......
......@@ -36,7 +36,7 @@ extern "C" {
*
* Capitalized names are from RFC 822, section 6.1 (Address Syntax).
*/
struct _address
struct _mu_address
{
char *addr;
/* the original string that this list of addresses was created
......@@ -58,7 +58,7 @@ struct _address
/* size_t num; this didn't appear to be used anywhere... so I commented
it out, is that ok? -sam */
struct _address *next;
struct _mu_address *next;
};
#ifdef __cplusplus
......
......@@ -29,7 +29,7 @@
extern "C" {
#endif
struct _attribute
struct _mu_attribute
{
void *owner;
......
......@@ -31,7 +31,7 @@
extern "C" {
#endif
struct _ticket
struct _mu_ticket
{
void *owner;
char *challenge;
......@@ -40,14 +40,14 @@ struct _ticket
void (*_destroy) (mu_ticket_t);
};
struct _authority
struct _mu_authority
{
void *owner;
mu_ticket_t ticket;
mu_list_t auth_methods; /* list of int (*_authenticate) (mu_authority_t)s; */
};
struct _wicket
struct _mu_wicket
{
char *filename;
int (*_get_ticket) (mu_wicket_t, const char *, const char *, mu_ticket_t *);
......
......@@ -33,7 +33,7 @@
extern "C" {
#endif
struct _body
struct _mu_body
{
void *owner;
char *filename;
......
......@@ -29,7 +29,7 @@
extern "C" {
#endif
struct _debug
struct _mu_debug
{
size_t level;
char *buffer;
......
......@@ -29,7 +29,7 @@
extern "C" {
#endif
struct _envelope
struct _mu_envelope
{
void *owner;
int (*_destroy) (mu_envelope_t);
......
......@@ -32,7 +32,7 @@
extern "C" {
#endif
struct _filter
struct _mu_filter
{
mu_stream_t stream;
mu_stream_t filter_stream;
......
......@@ -33,7 +33,7 @@
extern "C" {
#endif
struct _folder
struct _mu_folder
{
/* Data */
mu_authority_t authority;
......@@ -55,7 +55,7 @@ struct _folder
int (*_open) (mu_folder_t, int flag);
int (*_close) (mu_folder_t);
int (*_list) (mu_folder_t, const char *, const char *,
int (*_mu_list) (mu_folder_t, const char *, const char *,
struct mu_folder_list *);
int (*_lsub) (mu_folder_t, const char *, const char *,
struct mu_folder_list *);
......
......@@ -42,7 +42,7 @@ struct _hdr
/* The blurb member represents the headers, hdr_count the number of distinct
header field and the layout is done by struct_hdr *hdr. */
struct _header
struct _mu_header
{
/* Owner. */
void *owner;
......
......@@ -29,9 +29,9 @@
extern "C" {
#endif
struct _iterator
struct _mu_iterator
{
struct _iterator *next_itr; /* Next iterator in the chain */
struct _mu_iterator *next_itr; /* Next iterator in the chain */
void *owner; /* Object whose contents is being iterated */
int is_advanced; /* Is the iterator already advanced */
......
......@@ -40,14 +40,14 @@ struct list_data
struct list_data *prev;
};
struct _list
struct _mu_list
{
struct list_data head;
size_t count;
mu_monitor_t monitor;
mu_list_comparator_t comp;
void (*destroy_item) (void *item);
struct _iterator *itr;
struct _mu_iterator *itr;
};
......
......@@ -33,7 +33,7 @@
extern "C" {
#endif
struct _mailbox
struct _mu_mailbox
{
/* Data */
mu_observable_t observable;
......
......@@ -37,7 +37,7 @@ extern "C" {
#define MAILER_LINE_BUF_SIZE 1000
struct _mailer
struct _mu_mailer
{
mu_stream_t stream;
mu_observable_t observable;
......
......@@ -34,7 +34,7 @@
extern "C" {
#endif
struct _message
struct _mu_message
{
/* Who is the owner. */
void *owner;
......
......@@ -49,7 +49,7 @@ extern "C" {
#define MIME_INSERT_BOUNDARY 0x04000000
#define MIME_ADDING_BOUNDARY 0x02000000
struct _mime
struct _mu_mime
{
mu_message_t msg;
mu_header_t hdrs;
......
......@@ -29,7 +29,7 @@
extern "C" {
#endif
struct _observer
struct _mu_observer
{
int flags;
void *owner;
......@@ -37,7 +37,7 @@ struct _observer
int (*_destroy) (mu_observer_t);
};
struct _observable
struct _mu_observable
{
void *owner;
mu_list_t list;
......
......@@ -42,7 +42,7 @@ struct property_item
struct property_item *next;
};
struct _property
struct _mu_property
{
struct property_item *items;
void *owner;
......
......@@ -38,7 +38,7 @@ struct rbuffer
off_t offset;
};
struct _stream
struct _mu_stream
{
void *owner;
mu_property_t property;
......
......@@ -29,7 +29,7 @@
extern "C" {
#endif
struct _url
struct _mu_url
{
/* Data */
char *name;
......
......@@ -47,7 +47,7 @@
/* First draft by Brian Edmond. */
/* For subsequent modifications, see the GNU mailutils ChangeLog. */
struct _locker
struct _mu_locker
{
int refcnt;
......
......@@ -99,7 +99,7 @@ _maildir_url_init (mu_url_t url)
return amd_url_init (url, MU_MAILDIR_SCHEME);
}
static struct mu__record _maildir_record =
static struct _mu_record _maildir_record =
{
MU_MAILDIR_PRIO,
MU_MAILDIR_SCHEME,
......
......@@ -45,7 +45,7 @@
/* We export url parsing and the initialisation of
the mailbox, via the register entry/record. */
static struct mu__record _mbox_record =
static struct _mu_record _mbox_record =
{
MU_MBOX_PRIO,
MU_MBOX_SCHEME,
......@@ -89,7 +89,7 @@ _path_is_scheme (mu_record_t record, const char *url, int flags)
return rc;
}
static struct mu__record _path_record =
static struct _mu_record _path_record =
{
MU_PATH_PRIO,
MU_PATH_SCHEME,
......@@ -165,7 +165,7 @@ _folder_mbox_init (mu_folder_t folder)
folder->_open = folder_mbox_open;
folder->_close = folder_mbox_close;
folder->_list = folder_mbox_list;
folder->_mu_list = folder_mbox_list;
folder->_lsub = folder_mbox_lsub;
folder->_subscribe = folder_mbox_subscribe;
folder->_unsubscribe = folder_mbox_unsubscribe;
......
......@@ -128,7 +128,7 @@ _mh_url_init (mu_url_t url)
return amd_url_init (url, MU_MH_SCHEME);
}
static struct mu__record _mh_record =
static struct _mu_record _mh_record =
{
MU_MH_PRIO,
MU_MH_SCHEME,
......
......@@ -42,7 +42,7 @@
/* We export url parsing and the initialisation of
the mailbox, via the register entry/record. */
static struct mu__record _nntp_record =
static struct _mu_record _nntp_record =
{
MU_NNTP_PRIO,
MU_NNTP_URL_SCHEME,
......@@ -80,7 +80,7 @@ _nntp_folder_init (mu_folder_t folder)
folder->_open = nntp_folder_open;
folder->_close = nntp_folder_close;
folder->_list = nntp_folder_list;
folder->_mu_list = nntp_folder_list;
/* Not supported.
folder->_lsub = folder_nntp_lsub;
folder->_subscribe = folder_nntp_subscribe;
......
......@@ -29,7 +29,7 @@ Things to consider:
- Are comments allowed in domain-literals?
- Need a way to mark the *end* of a group. Maybe add a field to _address,
- Need a way to mark the *end* of a group. Maybe add a field to _mu_address,
int group_end;, so if you care, you can search for the end of
a group with address_is_group_end();
......@@ -711,7 +711,7 @@ mu_parse822_phrase (const char **p, const char *e, char **phrase)
static mu_address_t
new_mb (void)
{
return calloc (1, sizeof (struct _address));
return calloc (1, sizeof (struct _mu_address));
}
static int
......
......@@ -41,7 +41,7 @@
/* We export url parsing and the initialisation of
the mailbox, via the register entry/record. */
static struct mu__record _pop_record =
static struct _mu_record _pop_record =
{
MU_POP_PRIO,
MU_POP_SCHEME,
......
......@@ -192,16 +192,16 @@ mu_record_get_url (mu_record_t record, int (*(*_purl)) (mu_url_t))
/* Overload. */
if (record->_get_url)
return record->_get_url (record, _purl);
*_purl = record->_url;
*_purl = record->_mu_url;
return 0;
}
int
mu_record_set_url (mu_record_t record, int (*_url) (mu_url_t))
mu_record_set_url (mu_record_t record, int (*_mu_url) (mu_url_t))
{
if (record == NULL)
return EINVAL;
record->_url = _url;
record->_mu_url = _mu_url;
return 0;
}
......@@ -225,16 +225,16 @@ mu_record_get_mailbox (mu_record_t record, int (*(*_pmailbox)) (mu_mailbox_t))
/* Overload. */
if (record->_get_mailbox)
return record->_get_mailbox (record, _pmailbox);
*_pmailbox = record->_mailbox;
*_pmailbox = record->_mu_mailbox;
return 0;
}
int
mu_record_set_mailbox (mu_record_t record, int (*_mailbox) (mu_mailbox_t))
mu_record_set_mailbox (mu_record_t record, int (*_mu_mailbox) (mu_mailbox_t))
{
if (record)
return EINVAL;
record->_mailbox = _mailbox;
record->_mu_mailbox = _mu_mailbox;
return 0;
}
......@@ -258,16 +258,16 @@ mu_record_get_mailer (mu_record_t record, int (*(*_pmailer)) (mu_mailer_t))
/* Overload. */
if (record->_get_mailer)
return record->_get_mailer (record, _pmailer);
*_pmailer = record->_mailer;
*_pmailer = record->_mu_mailer;
return 0;
}
int
mu_record_set_mailer (mu_record_t record, int (*_mailer) (mu_mailer_t))
mu_record_set_mailer (mu_record_t record, int (*_mu_mailer) (mu_mailer_t))
{
if (record)
return EINVAL;
record->_mailer = _mailer;
record->_mu_mailer = _mu_mailer;
return 0;
}
......@@ -291,16 +291,16 @@ mu_record_get_folder (mu_record_t record, int (*(*_pfolder)) (mu_folder_t))
/* Overload. */
if (record->_get_folder)
return record->_get_folder (record, _pfolder);
*_pfolder = record->_folder;
*_pfolder = record->_mu_folder;
return 0;
}
int
mu_record_set_folder (mu_record_t record, int (*_folder) (mu_folder_t))
mu_record_set_folder (mu_record_t record, int (*_mu_folder) (mu_folder_t))
{
if (record == NULL)
return EINVAL;
record->_folder = _folder;
record->_mu_folder = _mu_folder;
return 0;
}
......
......@@ -46,7 +46,7 @@
#include <mailer0.h>
#include <registrar0.h>
static struct mu__record _sendmail_record =
static struct _mu_record _sendmail_record =
{
MU_SENDMAIL_PRIO,
MU_SENDMAIL_SCHEME,
......
......@@ -52,7 +52,7 @@
#include <mailer0.h>
#include <registrar0.h>
static struct mu__record _smtp_record = {
static struct _mu_record _smtp_record = {
MU_SMTP_PRIO,
MU_SMTP_SCHEME,
_url_smtp_init, /* url init. */
......
......@@ -99,7 +99,7 @@ mu_url_parse (mu_url_t url)
{
int err = 0;
char *n = NULL;
struct _url u = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
struct _mu_url u = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
if (!url || !url->name)
return EINVAL;
......