mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 06:38:08 +00:00
content_set_buffer now takes a uint8_t* instead of a void* so it can be correctly wrapped automatically
This commit is contained in:
parent
c0a2fcd05d
commit
d5e59ae6ee
8 changed files with 20 additions and 28 deletions
|
|
@ -118,11 +118,11 @@ void linphone_content_set_subtype(LinphoneContent *content, const char *subtype)
|
|||
sal_body_handler_set_subtype(content->body_handler, subtype);
|
||||
}
|
||||
|
||||
void * linphone_content_get_buffer(const LinphoneContent *content) {
|
||||
return sal_body_handler_get_data(content->body_handler);
|
||||
uint8_t * linphone_content_get_buffer(const LinphoneContent *content) {
|
||||
return (uint8_t *)sal_body_handler_get_data(content->body_handler);
|
||||
}
|
||||
|
||||
void linphone_content_set_buffer(LinphoneContent *content, const void *buffer, size_t size) {
|
||||
void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) {
|
||||
void *data;
|
||||
sal_body_handler_set_size(content->body_handler, size);
|
||||
data = belle_sip_malloc(size + 1);
|
||||
|
|
|
|||
|
|
@ -887,7 +887,7 @@ int linphone_proxy_config_send_publish(LinphoneProxyConfig *proxy, LinphonePrese
|
|||
}
|
||||
|
||||
content = linphone_content_new();
|
||||
linphone_content_set_buffer(content,presence_body,strlen(presence_body));
|
||||
linphone_content_set_buffer(content, (const uint8_t *)presence_body,strlen(presence_body));
|
||||
linphone_content_set_type(content, "application");
|
||||
linphone_content_set_subtype(content,"pidf+xml");
|
||||
if (proxy->sip_etag) {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ LINPHONE_PUBLIC void linphone_content_set_subtype(LinphoneContent *content, cons
|
|||
* @param[in] content LinphoneContent object.
|
||||
* @return The content data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC void * linphone_content_get_buffer(const LinphoneContent *content);
|
||||
LINPHONE_PUBLIC uint8_t * linphone_content_get_buffer(const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the content data buffer, usually a string.
|
||||
|
|
@ -102,7 +102,7 @@ LINPHONE_PUBLIC void * linphone_content_get_buffer(const LinphoneContent *conten
|
|||
* @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 uint8_t *buffer, size_t size);
|
||||
|
||||
/**
|
||||
* Get the string content data buffer.
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ using namespace Xsd::ConferenceInfo;
|
|||
|
||||
static void doNotify (const string ¬ify, LinphoneEvent *lev) {
|
||||
LinphoneContent *content = linphone_core_create_content(lev->lc);
|
||||
linphone_content_set_buffer(content, notify.c_str(), strlen(notify.c_str()));
|
||||
linphone_content_set_buffer(content, (const uint8_t *)notify.c_str(), strlen(notify.c_str()));
|
||||
linphone_event_notify(lev, content);
|
||||
linphone_content_unref(content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ void linphone_subscription_state_change(LinphoneCore *lc, LinphoneEvent *lev, Li
|
|||
content = linphone_core_create_content(lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml2");
|
||||
linphone_content_set_buffer(content,notify_content,strlen(notify_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)notify_content,strlen(notify_content));
|
||||
|
||||
ms_message("Subscription state [%s] from [%s]",linphone_subscription_state_to_string(state),from);
|
||||
ms_free(from);
|
||||
|
|
@ -138,7 +138,7 @@ static void subscribe_test_declined(void) {
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
pauline->decline_subscribe=TRUE;
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ static void subscribe_test_with_args(bool_t terminated_by_subscriber, RefreshTes
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lev=linphone_core_subscribe(marie->lc,pauline->identity,"dodo",expires,content);
|
||||
linphone_event_ref(lev);
|
||||
|
|
@ -244,7 +244,7 @@ static void subscribe_test_with_args2(bool_t terminated_by_subscriber, RefreshTe
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lev=linphone_core_create_subscribe(marie->lc,pauline->identity,"dodo",expires);
|
||||
linphone_event_add_custom_header(lev,"My-Header","pouet");
|
||||
|
|
@ -332,7 +332,7 @@ static void subscribe_loosing_dialog(void) {
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lev=linphone_core_create_subscribe(marie->lc,pauline->identity,"dodo",expires);
|
||||
linphone_event_add_custom_header(lev,"My-Header","pouet");
|
||||
|
|
@ -395,7 +395,7 @@ static void subscribe_with_io_error(void) {
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lev=linphone_core_create_subscribe(marie->lc,pauline->identity,"dodo",expires);
|
||||
linphone_event_add_custom_header(lev,"My-Header","pouet");
|
||||
|
|
@ -449,7 +449,7 @@ static void subscribe_not_timely_responded(void) {
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lev=linphone_core_create_subscribe(marie->lc,pauline->identity,"dodo",expires);
|
||||
linphone_event_add_custom_header(lev,"My-Header","pouet");
|
||||
|
|
@ -495,7 +495,7 @@ static void publish_test_with_args(bool_t refresh, int expires){
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lp_config_set_int(linphone_core_get_config(marie->lc),"sip","refresh_generic_publish",refresh);
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ static void out_of_dialog_notify(void){
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content,notify_content,strlen(notify_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)notify_content,strlen(notify_content));
|
||||
|
||||
lev = linphone_core_create_notify(marie->lc,pauline->identity,"dodo");
|
||||
linphone_event_ref(lev);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ static void subscribe_forking(void) {
|
|||
content = linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"somexml");
|
||||
linphone_content_set_buffer(content, liblinphone_tester_get_subscribe_content(), strlen(liblinphone_tester_get_subscribe_content()));
|
||||
linphone_content_set_buffer(content, (const uint8_t *)liblinphone_tester_get_subscribe_content(), strlen(liblinphone_tester_get_subscribe_content()));
|
||||
|
||||
lev=linphone_core_subscribe(marie->lc,pauline->identity,"dodo",expires,content);
|
||||
|
||||
|
|
@ -1102,7 +1102,7 @@ static void test_list_subscribe (void) {
|
|||
|
||||
linphone_content_set_type(content,"application");
|
||||
linphone_content_set_subtype(content,"resource-lists+xml");
|
||||
linphone_content_set_buffer(content,subscribe_content,strlen(subscribe_content));
|
||||
linphone_content_set_buffer(content,(const uint8_t *)subscribe_content,strlen(subscribe_content));
|
||||
|
||||
lev=linphone_core_create_subscribe(marie->lc,list_name,"presence",60);
|
||||
|
||||
|
|
|
|||
|
|
@ -833,7 +833,7 @@ void info_message_base(bool_t with_content) {
|
|||
LinphoneContent* ct=linphone_core_create_content(marie->lc);
|
||||
linphone_content_set_type(ct,"application");
|
||||
linphone_content_set_subtype(ct,"somexml");
|
||||
linphone_content_set_buffer(ct,info_content,strlen(info_content));
|
||||
linphone_content_set_buffer(ct,(const uint8_t *)info_content,strlen(info_content));
|
||||
linphone_info_message_set_content(info,ct);
|
||||
linphone_content_unref(ct);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,17 +249,9 @@ class JavaTranslator(object):
|
|||
return 'char'
|
||||
elif _type.name == 'void':
|
||||
if isReturn:
|
||||
if _type.isref and jni:
|
||||
return 'jbyteArray'
|
||||
if _type.isref:
|
||||
return 'byte[]'
|
||||
return 'void'
|
||||
if jni:
|
||||
if _type.isref and _type.isconst:
|
||||
return 'jbyteArray'
|
||||
return 'jobject'
|
||||
if _type.isref and _type.isconst:
|
||||
return 'byte[]'
|
||||
return 'Object'
|
||||
return _type.name
|
||||
|
||||
|
|
@ -423,7 +415,7 @@ class JavaTranslator(object):
|
|||
methodDict['params_impl'] += '(' + argCType + ') ' + argname
|
||||
|
||||
elif type(arg.type) is AbsApi.BaseType:
|
||||
if (arg.type.name == 'integer' and arg.type.size is not None and arg.type.isref) or (arg.type.name == 'void' and arg.type.isref and arg.type.isconst):
|
||||
if arg.type.name == 'integer' and arg.type.size is not None and arg.type.isref:
|
||||
methodDict['bytes'].append({'bytesargname': argname, 'bytesargtype' : self.translate_as_c_base_type(arg.type)})
|
||||
methodDict['params_impl'] += 'c_' + argname
|
||||
elif arg.type.name == 'string':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue