libubx/ubx.c
int ubx_resolve_types(ubx_block_t *b)
{
	int ret = EINVALID_TYPE;
	ubx_type_t *typ;
	ubx_port_t *port_ptr;
	ubx_config_t *config_ptr;
	ubx_node_info_t *ni = b->ni;

	/* for each port locate type and resolve */
	if (b->ports) {
		for (port_ptr = b->ports; port_ptr->name != NULL; port_ptr++) {
			/* in-type */
			if (port_ptr->in_type_name) {
				typ = ubx_type_get(ni, port_ptr->in_type_name);
				if (typ == NULL) {
					ubx_err(b, "in-port %s: unknown type %s",
						port_ptr->name,
						port_ptr->in_type_name);
					goto out;
				}
				port_ptr->in_type = typ;
			}

			/* out-type */
			if (port_ptr->out_type_name) {
				typ = ubx_type_get(ni, port_ptr->out_type_name);
				if (typ == NULL) {
					ubx_err(b, "out-port %s: unknown type %s",
						port_ptr->name,
						port_ptr->out_type_name);
					goto out;
				}
				port_ptr->out_type = typ;
			}
		}
	}

	/* configs */
	if (b->configs != NULL) {
		for (config_ptr = b->configs; config_ptr->name != NULL; config_ptr++) {
			typ = ubx_type_get(ni, config_ptr->type_name);
			if (typ == NULL)  {
				ubx_err(b, "config %s: unknown type %s",
					config_ptr->name,
					config_ptr->type_name);
				goto out;
			}
			config_ptr->type = typ;
		}
	}

	/* all ok */
	ret = 0;
 out:
	return ret;
}
/**
 * ubx_resolve_types - resolve string type references to real type object.
 *
 * For each port and config, let the type pointers point to the
 * correct type identified by the char* name. Error if failure.
 *
 * @param ni
 * @param b
 *
 * @return 0 if all types are resolved, -1 if not.
 */
resolve string type references to real type object.
For each port and config, let the type pointers point to the
correct type identified by the char* name. Error if failure.

@param ni
@param b

@return 0 if all types are resolved, -1 if not.
resolve string type references to real type object . For each port and config let the type pointers point to the correct type identified by the char * name . Error if failure . @param ni @param b @return 0 if all types are resolved - 1 if not .
int ubx_resolve_types(ubx_block_t *b)
{
	int ret = EINVALID_TYPE;
	ubx_type_t *typ;
	ubx_port_t *port_ptr;
	ubx_config_t *config_ptr;
	ubx_node_info_t *ni = b->ni;
	if (b->ports) {
		for (port_ptr = b->ports; port_ptr->name != NULL; port_ptr++) {
			if (port_ptr->in_type_name) {
				typ = ubx_type_get(ni, port_ptr->in_type_name);
				if (typ == NULL) {
					ubx_err(b, "in-port %s: unknown type %s",
						port_ptr->name,
						port_ptr->in_type_name);
					goto out;
				}
				port_ptr->in_type = typ;
			}
			if (port_ptr->out_type_name) {
				typ = ubx_type_get(ni, port_ptr->out_type_name);
				if (typ == NULL) {
					ubx_err(b, "out-port %s: unknown type %s",
						port_ptr->name,
						port_ptr->out_type_name);
					goto out;
				}
				port_ptr->out_type = typ;
			}
		}
	}
	if (b->configs != NULL) {
		for (config_ptr = b->configs; config_ptr->name != NULL; config_ptr++) {
			typ = ubx_type_get(ni, config_ptr->type_name);
			if (typ == NULL)  {
				ubx_err(b, "config %s: unknown type %s",
					config_ptr->name,
					config_ptr->type_name);
				goto out;
			}
			config_ptr->type = typ;
		}
	}
	ret = 0;
 out:
	return ret;
}
int ubx_resolve_types ( ubx_block_t * b ) { int ret = EINVALID_TYPE ; ubx_type_t * typ ; ubx_port_t * port_ptr ; ubx_config_t * config_ptr ; ubx_node_info_t * ni = b -> ni ; if ( b -> ports ) { for ( port_ptr = b -> ports ; port_ptr -> name != NULL ; port_ptr ++ ) { if ( port_ptr -> in_type_name ) { typ = ubx_type_get ( ni , port_ptr -> in_type_name ) ; if ( typ == NULL ) { ubx_err ( b , " " , port_ptr -> name , port_ptr -> in_type_name ) ; goto out ; } port_ptr -> in_type = typ ; } if ( port_ptr -> out_type_name ) { typ = ubx_type_get ( ni , port_ptr -> out_type_name ) ; if ( typ == NULL ) { ubx_err ( b , " " , port_ptr -> name , port_ptr -> out_type_name ) ; goto out ; } port_ptr -> out_type = typ ; } } } if ( b -> configs != NULL ) { for ( config_ptr = b -> configs ; config_ptr -> name != NULL ; config_ptr ++ ) { typ = ubx_type_get ( ni , config_ptr -> type_name ) ; if ( typ == NULL ) { ubx_err ( b , " " , config_ptr -> name , config_ptr -> type_name ) ; goto out ; } config_ptr -> type = typ ; } } ret = 0 ; out : return ret ; }
ubx_resolve_types - resolve string type references to real type object.
ubx_resolve_types - resolve string type references to real type object .
/* for each port locate type and resolve */ /* in-type */ /* out-type */ /* configs */ /* all ok */