libubx/ubx.c
static int ubx_clone_config_data(ubx_config_t *cnew,
				 const char *name,
				 const char *doc,
				 const ubx_type_t *type,
				 const long len)
{
	memset(cnew, 0x0, sizeof(ubx_config_t));

	cnew->name = strdup(name);
	if (cnew->name == NULL)
		goto out_err;

	if (doc) {
		cnew->doc = strdup(doc);
		if (cnew->doc == NULL)
			goto out_err;
	}

	cnew->type_name = strdup(type->name);
	if (cnew->type_name == NULL)
		goto out_err;

	cnew->value = __ubx_data_alloc(type, len);

	return 0; /* all ok */

 out_err:
	ubx_config_free_data(cnew);
	return -EOUTOFMEM;
}
/**
 * ubx_clone_conf_data - clone the additional config data
 *
 * @param cnew pointer to (allocated) ubx_config
 * @param name name of configuration
 * @param type ubx_type_t of configuration value
 * @param len array size of data
 *
 * @return less than zero if an error occured, 0 otherwise.
 *
 * This function allocates memory.
 */
clone the additional config data
@param cnew pointer to (allocated) ubx_config
@param name name of configuration
@param type ubx_type_t of configuration value
@param len array size of data

@return less than zero if an error occured, 0 otherwise.

This function allocates memory.
clone the additional config data @param cnew pointer to ( allocated ) ubx_config @param name name of configuration @param type ubx_type_t of configuration value @param len array size of data @return less than zero if an error occured 0 otherwise . This function allocates memory .
static int ubx_clone_config_data(ubx_config_t *cnew,
				 const char *name,
				 const char *doc,
				 const ubx_type_t *type,
				 const long len)
{
	memset(cnew, 0x0, sizeof(ubx_config_t));
	cnew->name = strdup(name);
	if (cnew->name == NULL)
		goto out_err;
	if (doc) {
		cnew->doc = strdup(doc);
		if (cnew->doc == NULL)
			goto out_err;
	}
	cnew->type_name = strdup(type->name);
	if (cnew->type_name == NULL)
		goto out_err;
	cnew->value = __ubx_data_alloc(type, len);
	return 0; 
 out_err:
	ubx_config_free_data(cnew);
	return -EOUTOFMEM;
}
static int ubx_clone_config_data ( ubx_config_t * cnew , const char * name , const char * doc , const ubx_type_t * type , const long len ) { memset ( cnew , 0x0 , sizeof ( ubx_config_t ) ) ; cnew -> name = strdup ( name ) ; if ( cnew -> name == NULL ) goto out_err ; if ( doc ) { cnew -> doc = strdup ( doc ) ; if ( cnew -> doc == NULL ) goto out_err ; } cnew -> type_name = strdup ( type -> name ) ; if ( cnew -> type_name == NULL ) goto out_err ; cnew -> value = __ubx_data_alloc ( type , len ) ; return 0 ; out_err : ubx_config_free_data ( cnew ) ; return - EOUTOFMEM ; }
ubx_clone_conf_data - clone the additional config data
 @param cnew pointer to (allocated) ubx_config
 @param name name of configuration
 @param type ubx_type_t of configuration value
 @param len array size of data
ubx_clone_conf_data - clone the additional config data @param cnew pointer to ( allocated ) ubx_config @param name name of configuration @param type ubx_type_t of configuration value @param len array size of data
/* all ok */