00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef TYPE_H
00036 #define TYPE_H
00037
00038 #include <biosphere.h>
00039 #include <apr_pools.h>
00040
00053 bs_data_type *new_bs_data_type(apr_pool_t *mp, const char *name);
00054
00062 bs_message *new_bs_message(apr_pool_t *mp, const char *name,
00063 bs_uint16 num_parts);
00064
00072 inline void add_part_to_message(bs_message *msg, bs_message_part *part, apr_pool_t *mp);
00073
00081 bs_message_part *new_bs_message_part(apr_pool_t *mp, const char *name,
00082 bs_data_type *type);
00083
00093 bs_operation *new_bs_operation(apr_pool_t *mp, const char *name,
00094 bs_message *input, bs_message *output, bs_message *fault);
00095
00103 bs_port_type *new_bs_port_type(apr_pool_t *mp, const char *name,
00104 bs_uint16 num_operations);
00105
00113 inline void add_operation_to_port_type(bs_port_type *pt, bs_operation *op,
00114 apr_pool_t *mp);
00115
00123 bs_port *new_bs_port(apr_pool_t *mp, const char *name, bs_port_type *type);
00124
00132 bs_service *new_bs_service(apr_pool_t *mp, const char *name,
00133 bs_uint16 num_ports);
00134
00142 inline void add_port_to_service(bs_service *svc, bs_port *port,
00143 apr_pool_t *mp);
00144
00155 bs_definition *new_bs_definition(apr_pool_t *mp, const char *name,
00156 bs_uint16 num_data_types, bs_uint16 num_messages,
00157 bs_uint16 num_port_types, bs_uint16 num_services);
00158
00166 inline void add_data_type_to_definition(bs_definition *def, bs_data_type *type,
00167 apr_pool_t *mp);
00168
00169 inline void add_message_to_definition(bs_definition *def, bs_message *msg,
00170 apr_pool_t *mp);
00171
00172 inline void add_port_type_to_definition(bs_definition *def, bs_port_type *pt,
00173 apr_pool_t *mp);
00174
00175 inline void add_service_to_definition(bs_definition *def, bs_service *svc,
00176 apr_pool_t *mp);
00177
00181 bs_service_request *new_bs_service_request(apr_pool_t *mp, bs_byte *uuid,
00182 char *service, char *port, char *operation,
00183 bs_message_instance *input);
00184
00188 bs_service_response *new_bs_service_response(apr_pool_t *mp,
00189 const bs_byte *uuid,
00190 const char *service, const char *port, const char *operation,
00191 bs_message_instance *output, bs_message_instance *fault);
00192
00196 bs_message_instance *new_bs_message_instance(apr_pool_t *mp, const char *name,
00197 bs_uint16 num_parts);
00198
00203 bs_part_instance *new_bs_part_instance(apr_pool_t *mp, const char *name,
00204 bs_data_type *type, const char *data, bs_uint64 size);
00205
00209 inline void add_part_to_request_instance(bs_part_instance *part,
00210 bs_message_instance *msg, apr_pool_t *mp);
00211
00219 bs_status merge_def_with_def(apr_pool_t *mp, bs_definition *result,
00220 bs_definition *d);
00221
00228 bs_status merge_bs_definitions(apr_pool_t *mp, bs_definition **def, ...);
00229
00235 bs_bool is_builtin_type(const char *name);
00236
00244 bs_status check_builtin_type(bs_part_instance *inst);
00245
00253 bs_bool request_corresponds_with_definition(const bs_service_request *request,
00254 const bs_definition *def);
00255
00260 #endif