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
ec669433
...
ec669433366ebf6957f0f9a6f94405cefe57052f
authored
2002-04-19 12:32:33 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
New interfaces: mu-message-multipart?,mu-message-get-num-parts, mu-message-get-part
1 parent
a7017bba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
libmu_scm/mu_message.c
libmu_scm/mu_message.c
View file @
ec66943
...
...
@@ -730,6 +730,64 @@ SCM_DEFINE (mu_message_get_body, "mu-message-get-body", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE
(
mu_message_multipart_p
,
"mu-message-multipart?"
,
1
,
0
,
0
,
(
SCM
MESG
),
"Returns #t if MESG is a multipart MIME message."
)
#define FUNC_NAME s_mu_message_multipart_p
{
message_t
msg
;
int
ismime
=
0
;
SCM_ASSERT
(
mu_scm_is_message
(
MESG
),
MESG
,
SCM_ARG1
,
FUNC_NAME
);
msg
=
mu_scm_message_get
(
MESG
);
message_is_multipart
(
msg
,
&
ismime
);
return
ismime
?
SCM_BOOL_T
:
SCM_BOOL_F
;
}
#undef FUNC_NAME
SCM_DEFINE
(
mu_message_get_num_parts
,
"mu-message-get-num-parts"
,
1
,
0
,
0
,
(
SCM
MESG
),
"Returns number of parts in a multipart MIME message. Returns
\n
"
"#f if the argument is not a multipart message."
)
#define FUNC_NAME s_mu_message_get_num_parts
{
message_t
msg
;
int
ismime
=
0
;
size_t
nparts
=
0
;
SCM_ASSERT
(
mu_scm_is_message
(
MESG
),
MESG
,
SCM_ARG1
,
FUNC_NAME
);
msg
=
mu_scm_message_get
(
MESG
);
message_is_multipart
(
msg
,
&
ismime
);
if
(
!
ismime
)
return
SCM_BOOL_F
;
message_get_num_parts
(
msg
,
&
nparts
);
return
scm_makenum
(
nparts
);
}
#undef FUNC_NAME
SCM_DEFINE
(
mu_message_get_part
,
"mu-message-get-part"
,
2
,
0
,
0
,
(
SCM
MESG
,
SCM
PART
),
"Returns part number PART from a multipart MIME message."
)
#define FUNC_NAME s_mu_message_get_part
{
message_t
msg
,
submsg
;
int
ismime
=
0
;
SCM_ASSERT
(
mu_scm_is_message
(
MESG
),
MESG
,
SCM_ARG1
,
FUNC_NAME
);
SCM_ASSERT
(
SCM_IMP
(
PART
)
&&
SCM_INUMP
(
PART
),
PART
,
SCM_ARG2
,
FUNC_NAME
);
msg
=
mu_scm_message_get
(
MESG
);
message_is_multipart
(
msg
,
&
ismime
);
if
(
!
ismime
)
return
SCM_BOOL_F
;
if
(
message_get_part
(
msg
,
SCM_INUM
(
PART
),
&
submsg
))
return
SCM_BOOL_F
;
return
mu_scm_message_create
(
MESG
,
submsg
);
}
#undef FUNC_NAME
SCM_DEFINE
(
mu_message_send
,
"mu-message-send"
,
1
,
3
,
0
,
(
SCM
MESG
,
SCM
MAILER
,
SCM
FROM
,
SCM
TO
),
"Sends the message MESG. Optional MAILER overrides default
\n
"
...
...
Please
register
or
sign in
to post a comment