您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ util_realloc_string_copy函数代码示例

51自学网 2021-06-03 09:25:45
  C++
这篇教程C++ util_realloc_string_copy函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中util_realloc_string_copy函数的典型用法代码示例。如果您正苦于以下问题:C++ util_realloc_string_copy函数的具体用法?C++ util_realloc_string_copy怎么用?C++ util_realloc_string_copy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了util_realloc_string_copy函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: field_config_set_init_transform

static void field_config_set_init_transform( field_config_type * config , const char * __init_transform_name ) {    const char * init_transform_name = NULL;    if (field_trans_table_has_key( config->trans_table , __init_transform_name))        init_transform_name = __init_transform_name;    config->init_transform_name = util_realloc_string_copy( config->init_transform_name , init_transform_name );    if (init_transform_name != NULL)        config->init_transform = field_trans_table_lookup( config->trans_table , init_transform_name);    else        config->init_transform = NULL;}
开发者ID:danielfmva,项目名称:ert,代码行数:12,


示例2: ensemble_config_set_gen_kw_format

void ensemble_config_set_gen_kw_format( ensemble_config_type * ensemble_config , const char * gen_kw_format_string) {  if (!util_string_equal( gen_kw_format_string , ensemble_config->gen_kw_format_string)) {    stringlist_type * gen_kw_keys = ensemble_config_alloc_keylist_from_impl_type( ensemble_config , GEN_KW );    int i;    ensemble_config->gen_kw_format_string = util_realloc_string_copy( ensemble_config->gen_kw_format_string , gen_kw_format_string );    for (i=0; i < stringlist_get_size( gen_kw_keys ); i++) {      enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , stringlist_iget( gen_kw_keys , i ));      gen_kw_config_update_tag_format( enkf_config_node_get_ref( config_node ) , gen_kw_format_string );    }    stringlist_free( gen_kw_keys );  }}
开发者ID:chflo,项目名称:ert,代码行数:12,


示例3: model_config_select_runpath

bool model_config_select_runpath( model_config_type * model_config , const char * path_key) {  if (hash_has_key( model_config->runpath_map , path_key )) {    model_config->current_runpath = hash_get( model_config->runpath_map , path_key );    model_config->current_path_key = util_realloc_string_copy( model_config->current_path_key , path_key);    return true;  } else {    if (model_config->current_runpath != NULL)  // OK - we already have a valid selection - stick to that and return False.      return false;    else {      util_abort("%s: path_key:%s does not exist - and currently no valid runpath selected /n",__func__ , path_key);      return false;    }  }}
开发者ID:patricknraanes,项目名称:ert,代码行数:14,


示例4: field_config_set_output_transform

static void field_config_set_output_transform( field_config_type * config , const char * __output_transform_name ) {    const char * output_transform_name = NULL;    if (field_trans_table_has_key( config->trans_table , __output_transform_name))        output_transform_name = __output_transform_name;    else if (__output_transform_name) {        fprintf(stderr , "Sorry: the field transformation function:%s is not recognized /n/n",__output_transform_name);        field_trans_table_fprintf(config->trans_table , stderr);        util_exit("Exiting ... /n");    }    config->output_transform_name = util_realloc_string_copy( config->output_transform_name , output_transform_name );    if (output_transform_name != NULL)        config->output_transform = field_trans_table_lookup( config->trans_table , output_transform_name);    else        config->output_transform = NULL;}
开发者ID:bramirex,项目名称:ert,代码行数:16,


示例5: enkf_config_node_update_min_std

void enkf_config_node_update_min_std( enkf_config_node_type * config_node , const char * min_std_file ) {  if (!util_string_equal( config_node->min_std_file , min_std_file )) {    /* The current min_std_file and the new input are different, and       the min_std node must be cleared. */    if (config_node->min_std != NULL) {      enkf_node_free( config_node->min_std );      config_node->min_std = NULL;      free( config_node->min_std_file );    }  }  config_node->min_std_file = util_realloc_string_copy( config_node->min_std_file , min_std_file );  if (config_node->min_std_file != NULL) {    config_node->min_std = enkf_node_alloc( config_node );    enkf_node_fload( config_node->min_std , min_std_file );  }}
开发者ID:akva2,项目名称:ResInsight,代码行数:16,


示例6: ecl_config_set_data_file

void ecl_config_set_data_file( ecl_config_type * ecl_config , const char * data_file) {  ecl_config->data_file = util_realloc_string_copy( ecl_config->data_file , data_file );  {    FILE * stream        = util_fopen( ecl_config->data_file , "r");    parser_type * parser = parser_alloc(NULL , NULL , NULL , NULL , "--" , "/n" );    char * init_tag      = enkf_util_alloc_tagged_string( "INIT" );        ecl_config->can_restart = parser_fseek_string( parser , stream , init_tag , false , true );         free( init_tag );    parser_free( parser );    fclose( stream );  }  ecl_config->start_date = ecl_util_get_start_date( ecl_config->data_file );  ecl_config->num_cpu    = ecl_util_get_num_cpu( ecl_config->data_file );}
开发者ID:JacobStoren,项目名称:ert,代码行数:16,


示例7: subst_list_string_set_value

/**   input_value can be NULL. */static void subst_list_string_set_value(subst_list_string_type * node, const char * input_value , const char * doc_string , subst_insert_type insert_mode) {  subst_list_string_free_content( node );  {    char * value;    if (insert_mode == SUBST_DEEP_COPY)      value = util_alloc_string_copy(input_value);    else      value = (char *) input_value;        if (insert_mode == SUBST_SHARED_REF)      node->value_owner = false;    else      node->value_owner = true;        node->value = value;  }    if (doc_string != NULL)    node->doc_string = util_realloc_string_copy( node->doc_string , doc_string );}
开发者ID:akva2,项目名称:ResInsight,代码行数:23,


示例8: gen_kw_config_set_parameter_file

void gen_kw_config_set_parameter_file( gen_kw_config_type * config , const char * parameter_file ) {  config->parameter_file = util_realloc_string_copy( config->parameter_file , parameter_file );  vector_clear( config->parameters );  if (parameter_file != NULL) {    FILE * stream = util_fopen(parameter_file , "r");        while (true) {      char parameter_name[256];      int  fscanf_return;            fscanf_return = fscanf(stream , "%s" , parameter_name);      if (fscanf_return == 1) {        gen_kw_parameter_type * parameter  = gen_kw_parameter_alloc( parameter_name , config->tag_fmt);        trans_func_type       * trans_func = trans_func_fscanf_alloc( stream );        gen_kw_parameter_set_trans_func( parameter , trans_func );        vector_append_owned_ref( config->parameters , parameter , gen_kw_parameter_free__ );      } else         break; /* OK - we are ate EOF. */    }         fclose( stream );  }}
开发者ID:danielfmva,项目名称:ert,代码行数:24,


示例9: __print_helptext

static void __print_helptext(char * label, int l) {    bool end_reached = false;    char * label_copy = util_alloc_string_copy( label );    char * first_part = "Dummy3";    char * second_part = "Dummy4";    while(!end_reached) {        int i;        if(strlen(label_copy) > l) {            util_binary_split_string_from_max_length(label_copy , " ", l , &first_part , &second_part);            printf("|    %s",first_part);            for (i=strlen(first_part); i < l; i++)                fputc(' ' , stdout);            printf("    |/n");            label_copy = util_realloc_string_copy(label_copy, second_part);        }        else {            printf("|    %s",label_copy);            for (i=strlen(label_copy); i < l; i++)                fputc(' ' , stdout);            printf("    |/n");            end_reached = true;        }    }}
开发者ID:alfbr,项目名称:ResInsight,代码行数:24,


示例10: rml_enkf_log_set_log_file

void rml_enkf_log_set_log_file( rml_enkf_log_type * data , const char * log_file ) {  data->log_file = util_realloc_string_copy( data->log_file , log_file );}
开发者ID:Ensembles,项目名称:ert,代码行数:3,


示例11: runpath_list_set_line_fmt

void runpath_list_set_line_fmt( runpath_list_type * list , const char * line_fmt ) {  list->line_fmt = util_realloc_string_copy( list->line_fmt , line_fmt );}
开发者ID:Ensembles,项目名称:ert,代码行数:3,


示例12: parser_set_comment_end

void parser_set_comment_end( parser_type * parser , const char * comment_end ) {  __verify_string_length( comment_end );  parser->comment_end = util_realloc_string_copy( parser->comment_end , comment_end );}
开发者ID:akva2,项目名称:ResInsight,代码行数:4,


示例13: hook_manager_set_path

void hook_manager_set_path( hook_manager_type * hook_manager , const char * path) {  hook_manager->path = util_realloc_string_copy( hook_manager->path , path );}
开发者ID:Thif,项目名称:ert-1,代码行数:3,


示例14: plot_config_set_image_type

void plot_config_set_image_type(plot_config_type * plot_config , const char * image_type) {  plot_config->image_type = util_realloc_string_copy(plot_config->image_type , image_type);}
开发者ID:JacobStoren,项目名称:ert,代码行数:3,


示例15: matrix_set_name

void matrix_set_name( matrix_type * matrix , const char * name) {  matrix->name = util_realloc_string_copy( matrix->name , name );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:3,


示例16: util_abort_test_set_intercept_function

void util_abort_test_set_intercept_function(const char * function) {  intercept_function = util_realloc_string_copy( intercept_function , function );}
开发者ID:Ensembles,项目名称:ert,代码行数:3,


示例17: site_config_set_default_browser

void site_config_set_default_browser( site_config_type * site_config , const char * default_browser ) {  site_config->default_browser = util_realloc_string_copy( site_config->default_browser , default_browser );}
开发者ID:akva2,项目名称:ResInsight,代码行数:3,


示例18: site_config_set_lsf_request

void site_config_set_lsf_request( site_config_type * site_config , const char * lsf_request) {  queue_driver_type * lsf_driver = site_config_get_queue_driver( site_config , LSF_DRIVER_NAME);  queue_driver_set_option( lsf_driver, LSF_RESOURCE , lsf_request );  if (!site_config->user_mode)     site_config->lsf_request_site = util_realloc_string_copy( site_config->lsf_request_site , lsf_request);}
开发者ID:akva2,项目名称:ResInsight,代码行数:6,


示例19: ecl_config_set_schedule_prediction_file

void ecl_config_set_schedule_prediction_file( ecl_config_type * ecl_config , const char * schedule_prediction_file ) {  ecl_config->schedule_prediction_file = util_realloc_string_copy( ecl_config->schedule_prediction_file , schedule_prediction_file );}
开发者ID:JacobStoren,项目名称:ert,代码行数:3,


示例20: ecl_config_set_init_section

void ecl_config_set_init_section( ecl_config_type * ecl_config , const char * input_init_section ) {  /* The semantic regarding INIT_SECTION is as follows:         1. If the INIT_SECTION points to an existing file - the          ecl_config->input_init_section is set to the absolute path of          this file.       2. If the INIT_SECTION points to a not existing file:          a. We assert that INIT_SECTION points to a pure filename,             i.e. /some/path/which/does/not/exist is NOT accepted. In             the case the input argument contain a path a error message             will be printed on stderr and the ->init_section will not             be set.          b. The ecl_config->input_init_section is set to point to this             file.          c. WE TRUST THE USER TO SUPPLY CONTENT (THROUGH SOME FUNKY             FORWARD MODEL) IN THE RUNPATH. This can unfortunately not             be checked/verified before the ECLIPSE simulation fails.     The INIT_SECTION keyword and <INIT> in the datafile (checked with     ecl_config->can_restart) interplay as follows:      CASE   |   INIT_SECTION  |  <INIT>    | OK ?     ---------------------------------------------     0      |   Present       | Present    |  Yes      1      |   Not Present   | Present    |  No         2      |   Present       | Not present|  No     3      |   Not Present   | Not present|  Yes     ---------------------------------------------     Case 0: This is the most flexible case, which can do arbitrary        restart.     Case 1: In this case the datafile will contain a <INIT> tag, we        we do not have the info to replace that tag with for        initialisation, and ECLIPSE will fail. Strictly speaking this        case can actually restart, but that is not enough - we let        this case fail hard.     Case 2: We have some INIT_SECTION infor, but no tag in he        datafile to update. If the datafile has embedded        initialisation info this case will work for init; but it is        logically flawed, and not accepted. Currently only a warning.     Case 3: This case has just the right amount of information for        initialisation, but it is 'consistently unable' to restart.       */  if (ecl_config->can_restart) {  /* The <INIT> tag is set. */    ecl_config->input_init_section = util_realloc_string_copy( ecl_config->input_init_section , input_init_section );   /* input_init_section = path/to/init_section         */    if (util_file_exists( ecl_config->input_init_section )) {                                                           /* init_section       = $CWD/path/to/init_section */       util_safe_free( ecl_config->init_section );      ecl_config->init_section = util_alloc_realpath(input_init_section);    } else {      char * path;            util_alloc_file_components( ecl_config->input_init_section , &path , NULL , NULL );      if (path != NULL)         fprintf(stderr,"** Warning: %s: When INIT_SECTION:%s points to a non-existing file - you can not have any path components./n",__func__ , input_init_section);      else         ecl_config->init_section = util_alloc_string_copy(input_init_section);            util_safe_free( path );    }  } else    /*        The <INIT> tag is not set - we can not utilize the       input_init_section info, and we just ignore it.    */    fprintf(stderr,"** Warning: <INIT> tag was not found in datafile - can not utilize INIT_SECTION keyword - ignored./n");}
开发者ID:JacobStoren,项目名称:ert,代码行数:75,


示例21: runpath_list_set_export_file

void runpath_list_set_export_file( runpath_list_type * list , const char * export_file ) {  list->export_file = util_realloc_string_copy( list->export_file , export_file );}
开发者ID:Ensembles,项目名称:ert,代码行数:3,


示例22: site_config_set_manual_url

void site_config_set_manual_url( site_config_type * site_config , const char * manual_url ) {  site_config->manual_url = util_realloc_string_copy( site_config->manual_url , manual_url );}
开发者ID:akva2,项目名称:ResInsight,代码行数:3,


示例23: parser_set_quoters

void parser_set_quoters( parser_type * parser , const char * quoters ) {  __verify_string_length( quoters );  parser->quoters = util_realloc_string_copy( parser->quoters , quoters );}
开发者ID:akva2,项目名称:ResInsight,代码行数:4,


示例24: field_config_set_ecl_kw_name

void field_config_set_ecl_kw_name(field_config_type * config , const char * ecl_kw_name) {    config->ecl_kw_name = util_realloc_string_copy(config->ecl_kw_name , ecl_kw_name);}
开发者ID:bramirex,项目名称:ert,代码行数:3,


示例25: parser_set_specials

void parser_set_specials( parser_type * parser , const char * specials ) {  __verify_string_length( specials );  parser->specials = util_realloc_string_copy( parser->specials , specials );}
开发者ID:akva2,项目名称:ResInsight,代码行数:4,


示例26: plot_config_set_path

void plot_config_set_path(plot_config_type * plot_config , const char * plot_path) {  plot_config->plot_path = util_realloc_string_copy(plot_config->plot_path , plot_path);  util_make_path( plot_path );}
开发者ID:JacobStoren,项目名称:ert,代码行数:4,


示例27: parser_set_delete_set

void parser_set_delete_set( parser_type * parser , const char * delete_set ) {  __verify_string_length( delete_set );  parser->delete_set = util_realloc_string_copy( parser->delete_set , delete_set );}
开发者ID:akva2,项目名称:ResInsight,代码行数:4,


示例28: plot_config_set_driver

void plot_config_set_driver(plot_config_type * plot_config , const char * plot_driver) {  plot_config->driver = util_realloc_string_copy(plot_config->driver , plot_driver);}
开发者ID:JacobStoren,项目名称:ert,代码行数:3,


示例29: parser_set_comment_start

void parser_set_comment_start( parser_type * parser , const char * comment_start ) {  __verify_string_length( comment_start );  parser->comment_start = util_realloc_string_copy( parser->comment_start , comment_start );}
开发者ID:akva2,项目名称:ResInsight,代码行数:4,



注:本文中的util_realloc_string_copy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ util_safe_free函数代码示例
C++ util_max_layer函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。