/Users/maurits/Documents/studie/afstuderen/biosphere/common/copy.c File Reference

#include "copy.h"
#include "str.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for copy.c:

Go to the source code of this file.

Functions

static bs_data_typecopy_data_type (const bs_data_type *orig)
static void copy_data_types (const bs_definition *orig, bs_definition *cpy)
static bs_message_partcopy_message_part (bs_message_part *orig, const bs_definition *curdef)
static void copy_message_parts (const bs_message *orig, bs_message *cpy, const bs_definition *curdef)
static void copy_messages (const bs_definition *orig, bs_definition *cpy)
static void copy_operation (const bs_operation *orig, bs_operation *cpy, const bs_definition *curdef)
static void copy_operations (const bs_port_type *orig, bs_port_type *cpy, const bs_definition *curdef)
static void copy_port_types (const bs_definition *orig, bs_definition *cpy)
static void copy_port (const bs_port *orig, bs_port *cpy, const bs_definition *curdef)
static void copy_ports (const bs_service *orig, bs_service *cpy, const bs_definition *curdef)
static void copy_services (const bs_definition *orig, bs_definition *cpy)
bs_definitioncopy_definition (const bs_definition *def)
static bs_part_instancecopy_part_instance (const bs_part_instance *orig)
static void copy_message_instance_data (const bs_message_instance *orig, bs_message_instance *cpy)
bs_service_requestcopy_request (const bs_service_request *req)
bs_service_responsecopy_response (const bs_service_response *resp)
static void delete_data_types (bs_definition *def)
static void delete_message_parts (bs_message *msg)
static void delete_messages (bs_definition *def)
static void delete_operations (bs_port_type *type)
static void delete_port_types (bs_definition *def)
static void delete_ports (bs_service *svc)
static void delete_services (bs_definition *def)
void delete_definition (bs_definition *def)
static void delete_instance_part (bs_part_instance *part)
static void delete_message_instance (bs_message_instance *msg)
void delete_request (bs_service_request *req)
void delete_response (bs_service_response *resp)


Function Documentation

static bs_data_type* copy_data_type ( const bs_data_type orig  )  [inline, static]

Copy the given data type and return the malloced copy.

Definition at line 46 of file copy.c.

References bs_data_type::builtin, and bs_data_type::name.

Referenced by copy_data_types(), and copy_part_instance().

static void copy_data_types ( const bs_definition orig,
bs_definition cpy 
) [static]

Copy the data types of the definition into the given copy.

Parameters:
orig Definition to copy data types from
cpy Malloced bs_definition to put the copied types into

Definition at line 64 of file copy.c.

References copy_data_type(), bs_definition::data_types, and bs_definition::num_data_types.

Referenced by copy_definition().

Here is the call graph for this function:

bs_definition* copy_definition ( const bs_definition def  ) 

Create a deep copy of the given definition which is allocated using traditional memory allocation techniques.

Parameters:
def The bs_definition that is to be deep-copied
Returns:
A malloced copy.

Definition at line 274 of file copy.c.

References copy_data_types(), copy_messages(), copy_port_types(), copy_services(), and bs_definition::name.

Referenced by copy_bs_definition().

Here is the call graph for this function:

static void copy_message_instance_data ( const bs_message_instance orig,
bs_message_instance cpy 
) [static]

Definition at line 310 of file copy.c.

References copy_part_instance(), bs_message_instance::name, bs_message_instance::num_parts, and bs_message_instance::parts.

Referenced by copy_request(), and copy_response().

Here is the call graph for this function:

static bs_message_part* copy_message_part ( bs_message_part orig,
const bs_definition curdef 
) [static]

Make a malloced copy of the message part, using the given definition, which is the definition copy being created, as a reference for the data types.

Parameters:
orig The original message part to be copied
curdef The definition copy that is being created
Returns:
A malloced copy of the message part

Definition at line 86 of file copy.c.

References bs_definition::data_types, bs_definition::from_mp, bs_data_type::name, bs_message_part::name, bs_definition::num_data_types, streq(), and bs_message_part::type.

Referenced by copy_message_parts().

Here is the call graph for this function:

static void copy_message_parts ( const bs_message orig,
bs_message cpy,
const bs_definition curdef 
) [static]

Make a deep malloced copy of the message parts of the given message.

Parameters:
orig The original message to copy
cpy The copy of the message being created
curdef The copy of the definition being created for referencing

Definition at line 117 of file copy.c.

References copy_message_part(), bs_message::num_parts, and bs_message::parts.

Referenced by copy_messages().

Here is the call graph for this function:

static void copy_messages ( const bs_definition orig,
bs_definition cpy 
) [static]

Make a deep malloced copy of all the messages from the given definition.

Parameters:
orig Original definition to copy messages from
cpy Copy being created

Definition at line 137 of file copy.c.

References copy_message_parts(), bs_definition::messages, bs_message::name, and bs_definition::num_messages.

Referenced by copy_definition().

Here is the call graph for this function:

static void copy_operation ( const bs_operation orig,
bs_operation cpy,
const bs_definition curdef 
) [static]

Copy the operation from the original definition into the copy.

Definition at line 158 of file copy.c.

References bs_operation::fault, bs_operation::input, bs_definition::messages, bs_message::name, bs_operation::name, bs_definition::num_messages, bs_operation::output, and streq().

Referenced by copy_operations().

Here is the call graph for this function:

static void copy_operations ( const bs_port_type orig,
bs_port_type cpy,
const bs_definition curdef 
) [static]

Copy the operation from the original definition into the copy.

Definition at line 184 of file copy.c.

References copy_operation(), bs_port_type::num_operations, and bs_port_type::operations.

Referenced by copy_port_types().

Here is the call graph for this function:

static bs_part_instance* copy_part_instance ( const bs_part_instance orig  )  [static]

Definition at line 293 of file copy.c.

References copy_data_type(), bs_part_instance::data, bs_part_instance::name, bs_part_instance::size, and bs_part_instance::type.

Referenced by copy_message_instance_data().

Here is the call graph for this function:

static void copy_port ( const bs_port orig,
bs_port cpy,
const bs_definition curdef 
) [static]

Definition at line 219 of file copy.c.

References bs_port_type::name, bs_port::name, bs_definition::num_port_types, bs_port::port_type, bs_definition::port_types, and streq().

Referenced by copy_ports().

Here is the call graph for this function:

static void copy_port_types ( const bs_definition orig,
bs_definition cpy 
) [static]

Definition at line 201 of file copy.c.

References copy_operations(), bs_port_type::name, bs_definition::num_port_types, and bs_definition::port_types.

Referenced by copy_definition().

Here is the call graph for this function:

static void copy_ports ( const bs_service orig,
bs_service cpy,
const bs_definition curdef 
) [static]

Definition at line 239 of file copy.c.

References copy_port(), bs_service::num_ports, and bs_service::ports.

Referenced by copy_services().

Here is the call graph for this function:

bs_service_request* copy_request ( const bs_service_request req  ) 

Create a deep copy of the given request which is allocated using traditional memory allocation techniques.

Parameters:
def The bs_service_request that is to be deep-copied
Returns:
A malloced copy.

Definition at line 327 of file copy.c.

References copy_message_instance_data(), bs_service_request::input, bs_service_request::operation, bs_service_request::port, bs_service_request::service, and bs_service_request::uuid.

Here is the call graph for this function:

bs_service_response* copy_response ( const bs_service_response resp  ) 

Create a deep copy of the given response which is allocated using traditional memory allocation techniques.

Parameters:
def The bs_service_response that is to be deep-copied
Returns:
A malloced copy.

Definition at line 354 of file copy.c.

References copy_message_instance_data(), bs_service_response::fault, bs_service_response::operation, bs_service_response::output, bs_service_response::port, bs_service_response::service, and bs_service_response::uuid.

Referenced by copy_bs_service_response(), and handle_service_request().

Here is the call graph for this function:

static void copy_services ( const bs_definition orig,
bs_definition cpy 
) [static]

Definition at line 256 of file copy.c.

References copy_ports(), bs_service::name, bs_definition::num_services, and bs_definition::services.

Referenced by copy_definition().

Here is the call graph for this function:

static void delete_data_types ( bs_definition def  )  [static]

Definition at line 383 of file copy.c.

References bs_definition::data_types, bs_definition::from_mp, and bs_definition::num_data_types.

Referenced by delete_definition().

void delete_definition ( bs_definition def  ) 

Free a malloced bs_definition by also freeing its internal structures. Make sure that the passed definition is allocated from a pool and not from a memory pool.

Parameters:
def The definition to be deleted

Definition at line 464 of file copy.c.

References delete_data_types(), delete_messages(), delete_port_types(), delete_services(), bs_definition::from_mp, and bs_definition::name.

Referenced by delete_bs_definition().

Here is the call graph for this function:

static void delete_instance_part ( bs_part_instance part  )  [inline, static]

Definition at line 480 of file copy.c.

References bs_part_instance::data, bs_data_type::name, bs_part_instance::name, and bs_part_instance::type.

Referenced by delete_message_instance().

static void delete_message_instance ( bs_message_instance msg  )  [static]

Definition at line 490 of file copy.c.

References delete_instance_part(), bs_message_instance::from_mp, bs_message_instance::name, bs_message_instance::num_parts, and bs_message_instance::parts.

Referenced by delete_request(), and delete_response().

Here is the call graph for this function:

static void delete_message_parts ( bs_message msg  )  [static]

Definition at line 395 of file copy.c.

References bs_message::from_mp, bs_message_part::name, bs_message::num_parts, and bs_message::parts.

Referenced by delete_messages().

static void delete_messages ( bs_definition def  )  [static]

Definition at line 405 of file copy.c.

References delete_message_parts(), bs_definition::from_mp, bs_definition::messages, and bs_definition::num_messages.

Referenced by delete_definition().

Here is the call graph for this function:

static void delete_operations ( bs_port_type type  )  [static]

Definition at line 418 of file copy.c.

References bs_port_type::from_mp, bs_operation::name, bs_port_type::num_operations, and bs_port_type::operations.

Referenced by delete_port_types().

static void delete_port_types ( bs_definition def  )  [static]

Definition at line 428 of file copy.c.

References delete_operations(), bs_definition::from_mp, bs_definition::num_port_types, and bs_definition::port_types.

Referenced by delete_definition().

Here is the call graph for this function:

static void delete_ports ( bs_service svc  )  [static]

Definition at line 441 of file copy.c.

References bs_service::from_mp, bs_port::name, bs_service::num_ports, and bs_service::ports.

Referenced by delete_services().

void delete_request ( bs_service_request req  ) 

Free a malloced bs_service_request by also freeing its internal structures. Make sure that the passed request is allocated from a pool and not from a memory pool.

Parameters:
def The definition to be deleted

Definition at line 507 of file copy.c.

References delete_message_instance(), bs_service_request::from_mp, bs_service_request::input, bs_service_request::operation, bs_service_request::port, and bs_service_request::service.

Here is the call graph for this function:

void delete_response ( bs_service_response resp  ) 

Free a malloced bs_service_response by also freeing its internal structures. Make sure that the passed response is allocated from a pool and not from a memory pool.

Parameters:
def The definition to be deleted

Definition at line 521 of file copy.c.

References delete_message_instance(), bs_service_response::fault, bs_service_response::from_mp, bs_service_response::operation, bs_service_response::output, bs_service_response::port, and bs_service_response::service.

Referenced by handle_http_post().

Here is the call graph for this function:

static void delete_services ( bs_definition def  )  [static]

Definition at line 451 of file copy.c.

References delete_ports(), bs_definition::from_mp, bs_definition::num_services, and bs_definition::services.

Referenced by delete_definition().

Here is the call graph for this function:


Generated on Tue Jul 17 09:50:53 2007 for Bio-SPHERE by  doxygen 1.5.1