ha_msg_addstruct(copy, field, value_struct);
add_message_xml(copy, field, value_struct);
cib_msg_copy(HA_Message *msg, gboolean with_data) {	int lpc = 0;	const char *field = NULL;	const char *value = NULL;	const HA_Message *value_struct = NULL;	const char *field_list[] = {		F_TYPE		,		F_CIB_CLIENTID  ,		F_CIB_CALLOPTS  ,		F_CIB_CALLID    ,		F_CIB_OPERATION ,		F_CIB_ISREPLY   ,		F_CIB_SECTION   ,		F_CIB_HOST	,		F_CIB_RC	,		F_CIB_DELEGATED	,		F_CIB_OBJID	,		F_CIB_OBJTYPE	,		F_CIB_EXISTING	,		F_CIB_SEENCOUNT	,		F_CIB_TIMEOUT	,		F_CIB_CALLBACK_TOKEN	,		F_CIB_GLOBAL_UPDATE	,		F_CIB_CLIENTNAME	,		F_CIB_NOTIFY_TYPE	,		F_CIB_NOTIFY_ACTIVATE	};		const char *data_list[] = {		F_CIB_CALLDATA  ,		F_CIB_UPDATE	,		F_CIB_UPDATE_RESULT	};	HA_Message *copy = ha_msg_new(10);	if(copy == NULL) {		return copy;	}		for(lpc = 0; lpc < DIMOF(field_list); lpc++) {		field = field_list[lpc];		value = cl_get_string(msg, field);		if(value != NULL) {			ha_msg_add(copy, field, value);		}	}	for(lpc = 0; with_data && lpc < DIMOF(data_list); lpc++) {		field = data_list[lpc];		value_struct = cl_get_struct(msg, field);		if(value_struct != NULL) {			ha_msg_addstruct(copy, field, value_struct);		}	}	return copy;}