Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
liblinphone
Commits
17c5372c
Commit
17c5372c
authored
10 years ago
by
Ghislain MARY
Browse files
Options
Download
Patches
Plain Diff
Add API to set/get a LinphoneContent data with a string type.
parent
3cb94ab1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
coreapi/content.c
+9
-0
coreapi/content.c
coreapi/content.h
+16
-1
coreapi/content.h
with
25 additions
and
1 deletion
coreapi/content.c
+
9
−
0
View file @
17c5372c
...
@@ -115,6 +115,15 @@ void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, s
...
@@ -115,6 +115,15 @@ void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, s
((
char
*
)
content
->
lcp
.
data
)[
size
]
=
'\0'
;
((
char
*
)
content
->
lcp
.
data
)[
size
]
=
'\0'
;
}
}
char
*
linphone_content_get_string_buffer
(
const
LinphoneContent
*
content
)
{
return
(
char
*
)
content
->
lcp
.
data
;
}
void
linphone_content_set_string_buffer
(
LinphoneContent
*
content
,
const
char
*
buffer
)
{
content
->
lcp
.
size
=
strlen
(
buffer
);
content
->
lcp
.
data
=
belle_sip_strdup
(
buffer
);
}
size_t
linphone_content_get_size
(
const
LinphoneContent
*
content
)
{
size_t
linphone_content_get_size
(
const
LinphoneContent
*
content
)
{
return
content
->
lcp
.
size
;
return
content
->
lcp
.
size
;
}
}
...
...
This diff is collapsed.
Click to expand it.
coreapi/content.h
+
16
−
1
View file @
17c5372c
...
@@ -155,10 +155,25 @@ LINPHONE_PUBLIC void * linphone_content_get_buffer(const LinphoneContent *conten
...
@@ -155,10 +155,25 @@ LINPHONE_PUBLIC void * linphone_content_get_buffer(const LinphoneContent *conten
/**
/**
* Set the content data buffer, usually a string.
* Set the content data buffer, usually a string.
* @param[in] content LinphoneContent object.
* @param[in] content LinphoneContent object.
* @param[in] data The content data buffer.
* @param[in] buffer The content data buffer.
* @param[in] size The size of the content data buffer.
*/
*/
LINPHONE_PUBLIC
void
linphone_content_set_buffer
(
LinphoneContent
*
content
,
const
void
*
buffer
,
size_t
size
);
LINPHONE_PUBLIC
void
linphone_content_set_buffer
(
LinphoneContent
*
content
,
const
void
*
buffer
,
size_t
size
);
/**
* Get the string content data buffer.
* @param[in] content LinphoneContent object
* @return The string content data buffer.
*/
LINPHONE_PUBLIC
char
*
linphone_content_get_string_buffer
(
const
LinphoneContent
*
content
);
/**
* Set the string content data buffer.
* @param[in] content LinphoneContent object.
* @param[in] buffer The string content data buffer.
*/
LINPHONE_PUBLIC
void
linphone_content_set_string_buffer
(
LinphoneContent
*
content
,
const
char
*
buffer
);
/**
/**
* Get the content data buffer size, excluding null character despite null character is always set for convenience.
* Get the content data buffer size, excluding null character despite null character is always set for convenience.
* @param[in] content LinphoneContent object.
* @param[in] content LinphoneContent object.
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets