Commit 094d5087 094d508772a3b9dd706daa95ed43035153d1043c by Alain Magloire

attribute.c attribute.h header.c mailbox.c mailbox0.h

 	mbx_unix.c message.c

remove reference to attribrute0.h

 	attribute0.h
collapse in attribute.c
1 parent af3dcca9
......@@ -15,12 +15,27 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <attribute0.h>
#include <attribute.h>
#include <sys/types.h>
#include <stdlib.h>
#include <errno.h>
#define MU_ATTRIBUTE_SEEN ((int)1)
#define MU_ATTRIBUTE_ANSWERED (MU_ATTRIBUTE_SEEN << 1)
#define MU_ATTRIBUTE_FLAGGED (MU_ATTRIBUTE_ANSWERED << 1)
#define MU_ATTRIBUTE_DELETED (MU_ATTRIBUTE_FLAGGED << 1)
#define MU_ATTRIBUTE_DRAFT (MU_ATTRIBUTE_DELETED << 1)
#define MU_ATTRIBUTE_RECENT (MU_ATTRIBUTE_DRAFT << 1)
#define MU_ATTRIBUTE_READ (MU_ATTRIBUTE_RECENT << 1)
struct _attribute
{
size_t flag;
void *owner;
int ref_count;
};
int
attribute_init (attribute_t *pattr, void *owner)
{
......
......@@ -62,6 +62,8 @@ extern int attribute_unset_read __P ((attribute_t));
extern int attribute_is_equal __P ((attribute_t att1, attribute_t att2));
extern int attribute_copy __P ((attribute_t dst, attribute_t src));
extern int attribute_get_owner __P ((attribute_t attr, void **owner));
#ifdef __cplusplus
}
#endif
......
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
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 Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _ATTRIBUTE0_H
#define _ATTRIBUTE0_H
#include <message.h>
#include <attribute.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __P
# ifdef __STDC__
# define __P(args) args
# else
# define __P(args) ()
# endif
#endif /*__P */
#define MU_ATTRIBUTE_SEEN ((int)1)
#define MU_ATTRIBUTE_ANSWERED (MU_ATTRIBUTE_SEEN << 1)
#define MU_ATTRIBUTE_FLAGGED (MU_ATTRIBUTE_ANSWERED << 1)
#define MU_ATTRIBUTE_DELETED (MU_ATTRIBUTE_FLAGGED << 1)
#define MU_ATTRIBUTE_DRAFT (MU_ATTRIBUTE_DELETED << 1)
#define MU_ATTRIBUTE_RECENT (MU_ATTRIBUTE_DRAFT << 1)
#define MU_ATTRIBUTE_READ (MU_ATTRIBUTE_RECENT << 1)
struct _attribute
{
size_t flag;
void *owner;
int ref_count;
};
/* not user visible ?? */
extern int attribute_copy __P ((attribute_t dst, attribute_t src));
extern int attribute_get_owner __P ((attribute_t attr, void **owner));
#ifdef __cplusplus
}
#endif
#endif /* _ATTRIBUTE0_H */
......@@ -27,19 +27,6 @@
#include <errno.h>
static int header_parse (header_t *h, const char *blurb, size_t len);
/*
static int rfc822_set_value (header_t h, const char *fn, const char *fb,
size_t n, int replace);
static int rfc822_get_value (header_t h, const char *fn, char *fb,
size_t len, size_t *n);
static int rfc822_entry_count (header_t, size_t *num);
static int rfc822_entry_name (header_t h, size_t num, char *buf,
size_t buflen, size_t *total);
static int rfc822_entry_value (header_t h, size_t num, char *buf,
size_t buflen, size_t *total);
static int rfc822_get_istream (header_t h, istream_t *pis);
static int rfc822_get_ostream (header_t h, ostream_t *pos);
*/
static int header_read (istream_t is, char *buf, size_t buflen,
off_t off, ssize_t *pnread);
......@@ -70,8 +57,6 @@ struct _header
int ref_count;
};
int
header_init (header_t *ph, const char *blurb, size_t len, void *owner)
{
......
......@@ -178,14 +178,6 @@ mailbox_is_updated (mailbox_t mbox)
return mbox->_is_updated (mbox);
}
ssize_t
mailbox_get_size (mailbox_t mbox, size_t msgno, size_t *h, size_t *b)
{
if (mbox == NULL || mbox->_get_size == NULL)
return EINVAL;
return mbox->_get_size (mbox, msgno, h, b);
}
/* locking */
int
mailbox_set_locker (mailbox_t mbox, locker_t locker)
......
......@@ -71,8 +71,6 @@ struct _mailbox
int (*_undelete) __P ((mailbox_t, size_t msgno));
int (*_is_deleted) __P ((mailbox_t, size_t msgno));
int (*_num_deleted) __P ((mailbox_t, size_t *));
int (*_get_size) __P ((mailbox_t, size_t msgno,
size_t *h, size_t *b));
};
/* private */
......@@ -80,12 +78,6 @@ extern int mailbox_delete __P ((mailbox_t, size_t msgno));
extern int mailbox_undelete __P ((mailbox_t, size_t msgno));
extern int mailbox_is_deleted __P ((mailbox_t, size_t msgno));
extern int mailbox_num_deleted __P ((mailbox_t, size_t *));
extern int mailbox_get_size __P ((mailbox_t, size_t msgno,
size_t *h, size_t *b));
extern ssize_t mailbox_get_header __P ((mailbox_t, size_t msgno, char *h,
size_t len, off_t off, int *err));
extern ssize_t mailbox_get_body __P ((mailbox_t, size_t msgno, char *b,
size_t len, off_t off, int *err));
extern int mailbox_get_auth __P ((mailbox_t mbox, auth_t *auth));
extern int mailbox_set_auth __P ((mailbox_t mbox, auth_t auth));
......
......@@ -21,7 +21,7 @@
#include <registrar0.h>
#include <message0.h>
#include <url0.h>
#include <attribute0.h>
#include <attribute.h>
#include <io0.h>
#include <header.h>
#include <auth.h>
......@@ -118,8 +118,6 @@ static int mailbox_unix_undelete (mailbox_t, size_t msgno);
static int mailbox_unix_is_deleted (mailbox_t, size_t msgno);
static int mailbox_unix_expunge (mailbox_t);
static int mailbox_unix_num_deleted (mailbox_t, size_t *);
static int mailbox_unix_get_size (mailbox_t, size_t msgno, size_t *header,
size_t *body);
static int mailbox_unix_parse (mailbox_t, size_t *msgs);
static int mailbox_unix_is_updated (mailbox_t);
......@@ -279,7 +277,6 @@ mailbox_unix_init (mailbox_t *pmbox, const char *name)
mbox->_is_deleted = mailbox_unix_is_deleted;
mbox->_expunge = mailbox_unix_expunge;
mbox->_num_deleted = mailbox_unix_num_deleted;
mbox->_get_size = mailbox_unix_get_size;
mbox->_is_updated = mailbox_unix_is_updated;
......@@ -1454,25 +1451,6 @@ mailbox_unix_size (mailbox_t mbox, off_t *size)
}
static int
mailbox_unix_get_size (mailbox_t mbox, size_t msgno, size_t *h, size_t *b)
{
mailbox_unix_data_t mud;
mailbox_unix_message_t mum;
if (mbox == NULL ||
(mud = (mailbox_unix_data_t)mbox->data) == NULL ||
!mailbox_unix_is_valid (mbox, msgno))
return EINVAL;
mum = &(mud->umessages[msgno]);
if (h)
*h = mum->header_end - mum->header;
if (b)
*b = mum->body_end - mum->body;
return 0;
}
static int
mailbox_unix_messages_count (mailbox_t mbox, size_t *count)
{
mailbox_unix_data_t mud;
......
......@@ -16,8 +16,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <header0.h>
#include <attribute0.h>
#include <header.h>
#include <attribute.h>
#include <message0.h>
#include <mailbox0.h>
#include <io0.h>
......