Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
920a217a
...
920a217a52d60d5a42e3e6d3371198827e3cd611
authored
2007-11-12 12:41:19 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(amd_quick_get_message): Implement quick_get method.
1 parent
9f08b185
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
mailbox/amd.c
mailbox/amd.c
View file @
920a217
...
...
@@ -76,6 +76,8 @@ static void amd_destroy (mu_mailbox_t mailbox);
static
int
amd_open
(
mu_mailbox_t
,
int
);
static
int
amd_close
(
mu_mailbox_t
);
static
int
amd_get_message
(
mu_mailbox_t
,
size_t
,
mu_message_t
*
);
static
int
amd_quick_get_message
(
mu_mailbox_t
mailbox
,
mu_message_qid_t
qid
,
mu_message_t
*
pmsg
);
static
int
amd_append_message
(
mu_mailbox_t
,
mu_message_t
);
static
int
amd_messages_count
(
mu_mailbox_t
,
size_t
*
);
static
int
amd_messages_recent
(
mu_mailbox_t
,
size_t
*
);
...
...
@@ -276,6 +278,7 @@ amd_init_mailbox (mu_mailbox_t mailbox, size_t amd_size,
/* Overloading of the entire mailbox object methods. */
mailbox
->
_get_message
=
amd_get_message
;
mailbox
->
_quick_get_message
=
amd_quick_get_message
;
mailbox
->
_append_message
=
amd_append_message
;
mailbox
->
_messages_count
=
amd_messages_count
;
mailbox
->
_messages_recent
=
amd_messages_recent
;
...
...
@@ -528,6 +531,36 @@ amd_get_message (mu_mailbox_t mailbox, size_t msgno, mu_message_t *pmsg)
return
_amd_attach_message
(
mailbox
,
mhm
,
pmsg
);
}
static
int
amd_quick_get_message
(
mu_mailbox_t
mailbox
,
mu_message_qid_t
qid
,
mu_message_t
*
pmsg
)
{
int
status
;
struct
_amd_data
*
amd
=
mailbox
->
data
;
if
(
amd
->
msg_count
)
{
mu_message_qid_t
vqid
;
mu_message_t
msg
=
amd
->
msg_array
[
0
]
->
message
;
status
=
mu_message_get_qid
(
msg
,
&
vqid
);
if
(
status
)
return
status
;
status
=
strcmp
(
qid
,
vqid
);
free
(
vqid
);
if
(
status
)
return
MU_ERR_EXISTS
;
*
pmsg
=
msg
;
}
else
if
(
amd
->
qfetch
)
{
status
=
amd
->
qfetch
(
amd
,
qid
);
if
(
status
)
return
status
;
return
_amd_attach_message
(
mailbox
,
amd
->
msg_array
[
0
],
pmsg
);
}
return
ENOSYS
;
}
static
FILE
*
_amd_tempfile
(
struct
_amd_data
*
amd
,
char
**
namep
)
{
...
...
Please
register
or
sign in
to post a comment