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
55dfffac
...
55dfffacc957af32b017b1e3dcefbb7d59743f89
authored
2001-08-18 17:30:13 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
mu_scm_message_add_owner() - add new object to the owner chain of the message.
1 parent
17c5c45b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
libmu_scm/mu_message.c
libmu_scm/mu_message.c
View file @
55dfffa
...
...
@@ -22,7 +22,7 @@ long message_tag;
struct
mu_message
{
message_t
msg
;
/* Message itself */
SCM
mbox
;
/* Mailbox it belong to */
SCM
mbox
;
/* Mailbox it belong
s
to */
};
/* SMOB functions: */
...
...
@@ -39,8 +39,6 @@ mu_scm_message_free (SCM message_smob)
{
struct
mu_message
*
mum
=
(
struct
mu_message
*
)
SCM_CDR
(
message_smob
);
free
(
mum
);
/* NOTE: Currently there is no way for this function to return the
amount of memory *actually freed* by mailbox_destroy */
return
sizeof
(
struct
mu_message
);
}
...
...
@@ -122,6 +120,33 @@ mu_scm_message_create (SCM owner, message_t msg)
SCM_RETURN_NEWSMOB
(
message_tag
,
mum
);
}
void
mu_scm_message_add_owner
(
SCM
MESG
,
SCM
owner
)
{
struct
mu_message
*
mum
=
(
struct
mu_message
*
)
SCM_CDR
(
MESG
);
SCM
cell
;
if
(
SCM_IMP
(
mum
->
mbox
)
&&
SCM_BOOLP
(
mum
->
mbox
))
{
mum
->
mbox
=
owner
;
return
;
}
SCM_NEWCELL
(
cell
);
SCM_SETCAR
(
cell
,
owner
);
if
(
SCM_NIMP
(
mum
->
mbox
)
&&
SCM_CONSP
(
mum
->
mbox
))
SCM_SETCDR
(
cell
,
mum
->
mbox
);
else
{
SCM
scm
;
SCM_NEWCELL
(
scm
);
SCM_SETCAR
(
scm
,
mum
->
mbox
);
SCM_SETCDR
(
scm
,
SCM_EOL
);
SCM_SETCDR
(
cell
,
scm
);
}
mum
->
mbox
=
cell
;
}
const
message_t
mu_scm_message_get
(
SCM
MESG
)
{
...
...
@@ -330,7 +355,7 @@ SCM_DEFINE (mu_message_get_header_fields, "mu-message-get-header-fields", 1, 1,
message_t
msg
;
header_t
hdr
=
NULL
;
SCM
scm_first
=
SCM_EOL
,
scm_last
;
SCM
headers
=
NUL
L
;
SCM
headers
=
SCM_EO
L
;
SCM_ASSERT
(
mu_scm_is_message
(
MESG
),
MESG
,
SCM_ARG1
,
FUNC_NAME
);
msg
=
mu_scm_message_get
(
MESG
);
...
...
@@ -349,7 +374,7 @@ SCM_DEFINE (mu_message_get_header_fields, "mu-message-get-header-fields", 1, 1,
char
*
name
,
*
value
;
header_aget_field_name
(
hdr
,
i
,
&
name
);
if
(
headers
&&
string_sloppy_member
(
headers
,
name
)
==
0
)
if
(
headers
!=
SCM_EOL
&&
string_sloppy_member
(
headers
,
name
)
==
0
)
continue
;
header_aget_field_value
(
hdr
,
i
,
&
value
);
...
...
Please
register
or
sign in
to post a comment