Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove more unused c code #1007

Merged
merged 5 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/include/resdata/nnc_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ typedef struct nnc_info_struct nnc_info_type;
const std::vector<int> &
nnc_info_get_grid_index_list(const nnc_info_type *nnc_info, int lgr_nr);
const std::vector<int> &
nnc_info_iget_grid_index_list(const nnc_info_type *nnc_info, int lgr_index);
const std::vector<int> &
nnc_info_get_self_grid_index_list(const nnc_info_type *nnc_info);
#endif

Expand All @@ -39,8 +37,6 @@ nnc_vector_type *nnc_info_get_self_vector(const nnc_info_type *nnc_info);
int nnc_info_get_lgr_nr(const nnc_info_type *nnc_info);
int nnc_info_get_size(const nnc_info_type *nnc_info);
int nnc_info_get_total_size(const nnc_info_type *nnc_info);
void nnc_info_fprintf(const nnc_info_type *nnc_info, FILE *stream);

bool nnc_info_equal(const nnc_info_type *nnc_info1,
const nnc_info_type *nnc_info2);
nnc_info_type *nnc_info_alloc_copy(const nnc_info_type *src_info);
Expand Down
45 changes: 0 additions & 45 deletions lib/include/resdata/rd_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,59 +30,32 @@ bool rd_file_write_index(const rd_file_type *rd_file,
const char *index_filename);
bool rd_file_index_valid(const char *file_name, const char *index_file_name);
void rd_file_close(rd_file_type *rd_file);
void rd_file_fortio_detach(rd_file_type *rd_file);
void rd_file_free__(void *arg);
rd_kw_type *rd_file_icopy_named_kw(const rd_file_type *rd_file, const char *kw,
int ith);
rd_kw_type *rd_file_icopy_kw(const rd_file_type *rd_file, int index);
bool rd_file_has_kw(const rd_file_type *rd_file, const char *kw);
int rd_file_get_num_named_kw(const rd_file_type *rd_file, const char *kw);
int rd_file_get_size(const rd_file_type *rd_file);
int rd_file_get_num_distinct_kw(const rd_file_type *rd_file);
const char *rd_file_iget_distinct_kw(const rd_file_type *rd_file, int index);
const char *rd_file_get_src_file(const rd_file_type *rd_file);
int rd_file_iget_occurence(const rd_file_type *rd_file, int index);
rd_version_enum rd_file_get_rd_version(const rd_file_type *file);
void rd_file_fwrite_fortio(const rd_file_type *ec_file, fortio_type *fortio,
int offset);
void rd_file_fwrite(const rd_file_type *rd_file, const char *, bool fmt_file);

void rd_file_replace_kw(rd_file_type *rd_file, rd_kw_type *old_kw,
rd_kw_type *new_kw, bool insert_copy);
int rd_file_get_phases(const rd_file_type *init_file);
void rd_file_fprintf_kw_list(const rd_file_type *rd_file, FILE *stream);

bool rd_file_writable(const rd_file_type *rd_file);
int rd_file_get_flags(const rd_file_type *rd_file);
void rd_file_set_flags(rd_file_type *rd_file, int new_flags);
bool rd_file_flags_set(const rd_file_type *rd_file, int flags);

rd_file_kw_type *rd_file_iget_file_kw(const rd_file_type *file,
int global_index);
rd_file_kw_type *rd_file_iget_named_file_kw(const rd_file_type *file,
const char *kw, int ith);
rd_kw_type *rd_file_iget_kw(const rd_file_type *file, int global_index);
rd_data_type rd_file_iget_data_type(const rd_file_type *file, int global_index);
int rd_file_iget_size(const rd_file_type *file, int global_index);
const char *rd_file_iget_header(const rd_file_type *file, int global_index);
rd_kw_type *rd_file_iget_named_kw(const rd_file_type *file, const char *kw,
int ith);
rd_data_type rd_file_iget_named_data_type(const rd_file_type *file,
const char *kw, int ith);
int rd_file_iget_named_size(const rd_file_type *file, const char *kw, int ith);
void rd_file_indexed_read(const rd_file_type *file, const char *kw, int index,
const int_vector_type *index_map, char *buffer);

rd_file_view_type *rd_file_get_global_blockview(rd_file_type *rd_file,
const char *kw, int occurence);
rd_file_view_type *rd_file_alloc_global_blockview(rd_file_type *rd_file,
const char *kw,
int occurence);
rd_file_view_type *rd_file_get_global_view(rd_file_type *rd_file);
rd_file_view_type *rd_file_get_active_view(rd_file_type *rd_file);
//bool rd_file_writable( const rd_file_type * rd_file );
bool rd_file_save_kw(const rd_file_type *rd_file, const rd_kw_type *rd_kw);
bool rd_file_has_kw_ptr(const rd_file_type *rd_file, const rd_kw_type *rd_kw);

double rd_file_iget_restart_sim_days(const rd_file_type *restart_file,
int index);
Expand All @@ -93,8 +66,6 @@ int rd_file_get_restart_index(const rd_file_type *restart_file,
bool rd_file_has_report_step(const rd_file_type *rd_file, int report_step);
bool rd_file_has_sim_time(const rd_file_type *rd_file, time_t sim_time);

void rd_file_close_fortio_stream(rd_file_type *rd_file);

rd_file_view_type *rd_file_get_restart_view(rd_file_type *rd_file,
int input_index, int report_step,
time_t sim_time, double sim_days);
Expand All @@ -103,24 +74,8 @@ rd_file_view_type *rd_file_get_summary_view(rd_file_type *rd_file,

UTIL_IS_INSTANCE_HEADER(rd_file);

//Deprecated:

void rd_file_push_block(rd_file_type *rd_file);
void rd_file_pop_block(rd_file_type *rd_file);
bool rd_file_subselect_block(rd_file_type *rd_file, const char *kw,
int occurence);
bool rd_file_select_block(rd_file_type *rd_file, const char *kw, int occurence);

bool rd_file_select_rstblock_sim_time(rd_file_type *rd_file, time_t sim_time);
bool rd_file_select_rstblock_report_step(rd_file_type *rd_file,
int report_step);
bool rd_file_iselect_rstblock(rd_file_type *rd_file, int seqnum_index);
rd_file_type *rd_file_open_rstblock_report_step(const char *filename,
int report_step, int flags);
rd_file_type *rd_file_open_rstblock_sim_time(const char *filename,
time_t sim_time, int flags);
rd_file_type *rd_file_iopen_rstblock(const char *filename, int seqnum_index,
int flags);

#ifdef __cplusplus
}
Expand Down
5 changes: 0 additions & 5 deletions lib/include/resdata/rd_file_kw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@ rd_file_kw_type *rd_file_kw_alloc(const rd_kw_type *rd_kw, offset_type offset);
rd_file_kw_type *rd_file_kw_alloc0(const char *header, rd_data_type data_type,
int size, offset_type offset);
void rd_file_kw_free(rd_file_kw_type *file_kw);
void rd_file_kw_free__(void *arg);
rd_kw_type *rd_file_kw_get_kw(rd_file_kw_type *file_kw, fortio_type *fortio,
inv_map_type *inv_map);
rd_kw_type *rd_file_kw_get_kw_ptr(rd_file_kw_type *file_kw);
rd_file_kw_type *rd_file_kw_alloc_copy(const rd_file_kw_type *src);
const char *rd_file_kw_get_header(const rd_file_kw_type *file_kw);
int rd_file_kw_get_size(const rd_file_kw_type *file_kw);
rd_data_type rd_file_kw_get_data_type(const rd_file_kw_type *);
offset_type rd_file_kw_get_offset(const rd_file_kw_type *file_kw);
bool rd_file_kw_ptr_eq(const rd_file_kw_type *file_kw, const rd_kw_type *rd_kw);
void rd_file_kw_replace_kw(rd_file_kw_type *file_kw, fortio_type *target,
rd_kw_type *new_kw);
bool rd_file_kw_fskip_data(const rd_file_kw_type *file_kw, fortio_type *fortio);
void rd_file_kw_inplace_fwrite(rd_file_kw_type *file_kw, fortio_type *fortio);

Expand Down
23 changes: 0 additions & 23 deletions lib/include/resdata/rd_file_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ bool rd_file_view_check_flags(int state_flags, int query_flags);

rd_file_view_type *rd_file_view_alloc(fortio_type *fortio, int *flags,
inv_map_type *inv_map, bool owner);
int rd_file_view_get_global_index(const rd_file_view_type *rd_file_view,
const char *kw, int ith);
void rd_file_view_make_index(rd_file_view_type *rd_file_view);
bool rd_file_view_has_kw(const rd_file_view_type *rd_file_view, const char *kw);
rd_file_kw_type *
rd_file_view_iget_file_kw(const rd_file_view_type *rd_file_view,
int global_index);
rd_file_kw_type *
rd_file_view_iget_named_file_kw(const rd_file_view_type *rd_file_view,
const char *kw, int ith);
rd_kw_type *rd_file_view_iget_kw(const rd_file_view_type *rd_file_view,
int index);
void rd_file_view_index_fload_kw(const rd_file_view_type *rd_file_view,
Expand All @@ -56,34 +51,18 @@ const char *rd_file_view_iget_distinct_kw(const rd_file_view_type *rd_file_view,
int index);
int rd_file_view_get_num_distinct_kw(const rd_file_view_type *rd_file_view);
int rd_file_view_get_size(const rd_file_view_type *rd_file_view);
rd_data_type rd_file_view_iget_data_type(const rd_file_view_type *rd_file_view,
int index);
int rd_file_view_iget_size(const rd_file_view_type *rd_file_view, int index);
const char *rd_file_view_iget_header(const rd_file_view_type *rd_file_view,
int index);
rd_kw_type *rd_file_view_iget_named_kw(const rd_file_view_type *rd_file_view,
const char *kw, int ith);
rd_data_type
rd_file_view_iget_named_data_type(const rd_file_view_type *rd_file_view,
const char *kw, int ith);
int rd_file_view_iget_named_size(const rd_file_view_type *rd_file_view,
const char *kw, int ith);
void rd_file_view_replace_kw(rd_file_view_type *rd_file_view,
rd_kw_type *old_kw, rd_kw_type *new_kw,
bool insert_copy);
bool rd_file_view_load_all(rd_file_view_type *rd_file_view);
void rd_file_view_add_kw(rd_file_view_type *rd_file_view,
rd_file_kw_type *file_kw);
void rd_file_view_free(rd_file_view_type *rd_file_view);
void rd_file_view_free__(void *arg);
int rd_file_view_get_num_named_kw(const rd_file_view_type *rd_file_view,
const char *kw);
void rd_file_view_fwrite(const rd_file_view_type *rd_file_view,
fortio_type *target, int offset);
int rd_file_view_iget_occurence(const rd_file_view_type *rd_file_view,
int global_index);
void rd_file_view_fprintf_kw_list(const rd_file_view_type *rd_file_view,
FILE *stream);
rd_file_view_type *rd_file_view_add_blockview(rd_file_view_type *rd_file_view,
const char *header,
int occurence);
Expand All @@ -104,8 +83,6 @@ rd_file_view_alloc_blockview2(const rd_file_view_type *rd_file_view,
const char *start_kw, const char *end_kw,
int occurence);

void rd_file_view_add_child(rd_file_view_type *parent,
rd_file_view_type *child);
bool rd_file_view_drop_flag(rd_file_view_type *file_view, int flag);
void rd_file_view_add_flag(rd_file_view_type *file_view, int flag);

Expand Down
4 changes: 0 additions & 4 deletions lib/include/resdata/rd_rft_cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ rd_rft_cell_type *rd_rft_cell_alloc_RFT(int i, int j, int k, double depth,
double pressure, double swat,
double sgas);
void rd_rft_cell_free(rd_rft_cell_type *cell);
void rd_rft_cell_free__(void *arg);

bool rd_rft_cell_ijk_equal(const rd_rft_cell_type *cell, int i, int j, int k);
void rd_rft_cell_get_ijk(const rd_rft_cell_type *cell, int *i, int *j, int *k);
Expand All @@ -47,9 +46,6 @@ double rd_rft_cell_get_oil_flowrate(const rd_rft_cell_type *cell);
double rd_rft_cell_get_gas_flowrate(const rd_rft_cell_type *cell);
double rd_rft_cell_get_water_flowrate(const rd_rft_cell_type *cell);

int rd_rft_cell_cmp__(const void *arg1, const void *arg2);
int rd_rft_cell_cmp(const rd_rft_cell_type *cell1,
const rd_rft_cell_type *cell2);
bool rd_rft_cell_lt(const rd_rft_cell_type *cell1,
const rd_rft_cell_type *cell2);
#ifdef __cplusplus
Expand Down
21 changes: 0 additions & 21 deletions lib/resdata/nnc_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,24 +208,3 @@ int nnc_info_get_total_size(const nnc_info_type *nnc_info) {
}
return num_nnc;
}

void nnc_info_fprintf(const nnc_info_type *nnc_info, FILE *stream) {
fprintf(stream, "LGR_NR:%d \n", nnc_info->lgr_nr);
{
int lgr_nr;
for (lgr_nr = 0; lgr_nr < int_vector_size(nnc_info->lgr_index_map);
lgr_nr++) {
int lgr_index = int_vector_iget(nnc_info->lgr_index_map, lgr_nr);
if (lgr_index >= 0) {
printf(" %02d -> %02d => ", lgr_nr, lgr_index);
{
const std::vector<int> &index_list =
nnc_info_iget_grid_index_list(nnc_info, lgr_index);
vector_util_fprintf<int>(index_list, stream, " ", "%d");
printf("\n");
}
}
}
}
fprintf(stream, "\n");
}
Loading