📄 inet_msg_mem.c
字号:
* DESCRIPTION
*
* PARAMETERS
* mem_func [?]
* src [?]
* RETURNS
* void
*****************************************************************************/
void *inet_authentication_info_struct_copy_fn(inet_mem_func_struct *mem_func, void *src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
inet_authentication_info_struct *val, *in_data = (inet_authentication_info_struct*) src;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!in_data || !mem_func)
{
return in_data;
}
val = inet_malloc(mem_func, sizeof(inet_authentication_info_struct));
CHECK_INET_PARAM(val, NULL);
val->nc = in_data->nc;
if (in_data->next_nonce)
{
val->next_nonce = (kal_char*) inet_msg_strdup(mem_func, in_data->next_nonce);
if (!val->next_nonce)
{
goto exit_due_to_mem;
}
}
if (in_data->cnonce)
{
val->cnonce = (kal_char*) inet_msg_strdup(mem_func, in_data->cnonce);
if (!val->cnonce)
{
goto exit_due_to_mem;
}
}
if (in_data->qop)
{
val->qop = inet_int_str_list_struct_copy_fn(mem_func, in_data->qop);
if (!val->qop)
{
goto exit_due_to_mem;
}
}
return (void*)val;
exit_due_to_mem:
inet_authentication_info_struct_free_fn(mem_func, val);
return NULL;
}
/*****************************************************************************
* FUNCTION
* inet_addr_struct_copy_fn
* DESCRIPTION
*
* PARAMETERS
* mem_func [?]
* src [?]
* RETURNS
* void
*****************************************************************************/
void *inet_addr_struct_copy_fn(inet_mem_func_struct *mem_func, void *src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
inet_addr_struct *val, *in_data = (inet_addr_struct*) src;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!in_data || !mem_func)
{
return in_data;
}
val = inet_malloc(mem_func, sizeof(inet_addr_struct));
CHECK_INET_PARAM(val, NULL);
val->disp_charset = in_data->disp_charset;
if (in_data->display_name)
{
val->display_name = (kal_char*) inet_msg_strdup(mem_func, in_data->display_name);
if (!val->display_name)
{
goto exit_due_to_mem;
}
}
if (in_data->uri)
{
val->uri = inet_uri_struct_copy_fn(mem_func, in_data->uri);
if (!val->uri)
{
goto exit_due_to_mem;
}
}
if (in_data->param_list)
{
val->param_list = inet_param_list_struct_copy_fn(mem_func, in_data->param_list);
if (!val->param_list)
{
goto exit_due_to_mem;
}
}
return val;
exit_due_to_mem:
inet_addr_struct_free_fn(mem_func, val);
return NULL;
}
/*****************************************************************************
* FUNCTION
* inet_addr_list_struct_copy_fn
* DESCRIPTION
*
* PARAMETERS
* mem_func [?]
* src [?]
* RETURNS
* void
*****************************************************************************/
void *inet_addr_list_struct_copy_fn(inet_mem_func_struct *mem_func, void *src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
inet_addr_list_struct *val, *val_t, *in_data = (inet_addr_list_struct*) src;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!in_data || !mem_func)
{
return in_data;
}
val = inet_malloc(mem_func, sizeof(inet_addr_list_struct));
CHECK_INET_PARAM(val, NULL);
val_t = val;
while (in_data)
{
if (in_data->object)
{
val->object = inet_addr_struct_copy_fn(mem_func, in_data->object);
if (!val->object)
{
goto exit_due_to_mem;
}
}
in_data = in_data->next;
if (in_data)
{
if (val->object)
{
val->next = inet_malloc(mem_func, sizeof(inet_addr_list_struct));
val = val->next;
if (!val)
{
goto exit_due_to_mem;
}
}
}
}
return (void*)val_t;
exit_due_to_mem:
inet_addr_list_struct_free_fn(mem_func, val_t);
return NULL;
}
/*****************************************************************************
* FUNCTION
* inet_content_range_struct_copy_fn
* DESCRIPTION
*
* PARAMETERS
* mem_func [?]
* src [?]
* RETURNS
* void
*****************************************************************************/
void *inet_content_range_struct_copy_fn(inet_mem_func_struct *mem_func, void *src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
inet_content_range_struct *val, *in_data = (inet_content_range_struct*) src;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!in_data || !mem_func)
{
return in_data;
}
val = inet_malloc(mem_func, sizeof(inet_content_range_struct));
CHECK_INET_PARAM(val, NULL);
if (in_data->unit_name)
{
val->unit_name = (kal_char*) inet_msg_strdup(mem_func, in_data->unit_name);
if (!val->unit_name)
{
goto exit_due_to_mem;
}
}
val->first_pos = in_data->first_pos;
val->last_pos = in_data->last_pos;
val->instance_length = in_data->instance_length;
return (void*)val;
exit_due_to_mem:
inet_content_range_struct_free_fn(mem_func, val);
return NULL;
}
/*****************************************************************************
* FUNCTION
* inet_cookie_struct_copy_fn
* DESCRIPTION
*
* PARAMETERS
* mem_func [?]
* src [?]
* RETURNS
* void
*****************************************************************************/
void *inet_cookie_struct_copy_fn(inet_mem_func_struct *mem_func, void *src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
inet_cookie_struct *val, *in_data = (inet_cookie_struct*) src;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!in_data || !mem_func)
{
return in_data;
}
val = inet_malloc(mem_func, sizeof(inet_cookie_struct));
CHECK_INET_PARAM(val, NULL);
val->secure = in_data->secure;
val->version = in_data->version;
val->discard = in_data->discard;
val->max_age = in_data->max_age;
val->expiry_time = in_data->expiry_time;
if (in_data->comment_url)
{
val->comment_url = (kal_char*) inet_msg_strdup(mem_func, in_data->comment_url);
if (!val->comment_url)
{
goto exit_due_to_mem;
}
}
if (in_data->comment)
{
val->comment = (kal_char*) inet_msg_strdup(mem_func, in_data->comment);
if (!val->comment)
{
goto exit_due_to_mem;
}
}
if (in_data->domain)
{
val->domain = (kal_char*) inet_msg_strdup(mem_func, in_data->domain);
if (!val->domain)
{
goto exit_due_to_mem;
}
}
if (in_data->path)
{
val->path = (kal_char*) inet_msg_strdup(mem_func, in_data->path);
if (!val->path)
{
goto exit_due_to_mem;
}
}
if (in_data->portlist)
{
val->portlist = inet_int_list_struct_copy_fn(mem_func, in_data->portlist);
if (!val->portlist)
{
goto exit_due_to_mem;
}
}
if (in_data->name)
{
val->name = (kal_char*) inet_msg_strdup(mem_func, in_data->name);
if (!val->name)
{
goto exit_due_to_mem;
}
}
if (in_data->value)
{
val->value = (kal_char*) inet_msg_strdup(mem_func, in_data->value);
if (!val->value)
{
goto exit_due_to_mem;
}
}
return (void*)val;
exit_due_to_mem:
inet_cookie_struct_free_fn(mem_func, val);
return NULL;
}
/*****************************************************************************
* FUNCTION
* inet_cookie_list_struct_copy_fn
* DESCRIPTION
*
* PARAMETERS
* mem_func [?]
* src [?]
* RETURNS
* void
*****************************************************************************/
void *inet_cookie_list_struct_copy_fn(inet_mem_func_struct *mem_func, void *src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
inet_cookie_list_struct *val, *val_t, *in_data = (inet_cookie_list_struct*) src;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!in_data || !mem_func)
{
return in_data;
}
val = inet_malloc(mem_func, sizeof(inet_cookie_list_struct));
CHECK_INET_PARAM(val, NULL);
val_t = val;
while (in_data)
{
if (in_data->object)
{
val->object = inet_cookie_struct_copy_fn(mem_func, in_data->object);
if (!val->object)
{
goto exit_due_to_mem;
}
}
in_data = in_data->next;
if (in_data)
{
if (val->object)
{
val->next = inet_malloc(mem_func, sizeof(inet_cookie_list_struct));
val = val->next;
if (!val)
{
goto exit_due_to_mem;
}
}
}
}
return (void*)val_t;
exit_due_to_mem:
inet_cookie_list_struct_free_fn(mem_func, val_t);
return NULL;
}
/*****************************************************************************
* FUNCTION
* inet_content_type_struct_copy_fn
* DESCRIPTION
*
* PARAMETERS
* mem_func [?]
* src [?]
* RETURNS
* void
*****************************************************************************/
void *inet_content_type_struct_copy_fn(inet_mem_func_struct *mem_func, void *src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
inet_content_type_struct *val, *in_data = (inet_content_type_struct*) src;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (!in_data || !mem_func)
{
return in_data;
}
val = inet_malloc(mem_func, sizeof(inet_content_type_struct));
CHECK_INET_PARAM(val, NULL);
if (in_data->mime_type)
{
val->mime_type = (kal_char*) inet_msg_strdup(mem_func, in_data->mime_type);
if (!val->mime_type)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -