54 Btc = IONameHandler::get_instance()->get_output_file_name(
OptGetStr(
"Output",
"BTC_elms",
"-9999" )).c_str();
97 ASSERT(!( line == NULL ),
"NULL as an argument of function count_BTC_elms()\n");
100 if( strtok( l,
" \t,;" ) == NULL )
104 while( strtok( NULL,
" \t,;" ) != NULL );
115 ASSERT(!( line == NULL ),
"NULL as an argument of function BTC_elm_list()\n");
116 ASSERT(!( n_btc < 0 ),
"Number of BTC cannot be negative in BTC_elm_list()\n");
119 cp = (
int*)
xmalloc( n_btc *
sizeof(
int ) );
120 for( i = 0; i < n_btc; i++ )
121 cp[ i ] = atoi( strtok( i == 0 ? line : NULL ,
" \t,;" ) );
128 static FILE **
open_temp_files(
struct Transport *transport,
const char *fileext,
const char *open_param)
131 char filename0[255],filename1[255],filename2[255],filename3[255];
135 out = (FILE**)
xmalloc(n*
sizeof(FILE*));
137 sub = transport->transport_sub_problem;
139 sprintf(filename0, fileext, transport->transport_out_fname);
140 out[0] =
xfopen(filename0, open_param);
145 if( ((sub & 1) == 1) && (strcmp(transport->transport_out_im_fname,
"NULL") != 0)) {
146 sprintf( filename1,fileext,transport->transport_out_im_fname);
147 out[1] =
xfopen( filename1, open_param );
150 if( ((sub & 2) == 2) && (strcmp(transport->transport_out_sorp_fname,
"NULL") != 0)) {
151 sprintf(filename2,fileext,transport->transport_out_sorp_fname);
152 out[2] =
xfopen( filename2, open_param );
155 if( ((sub & 3) == 3) && (strcmp(transport->transport_out_im_sorp_fname,
"NULL") != 0)) {
156 sprintf(filename3,fileext,transport->transport_out_im_sorp_fname);
157 out[3] =
xfopen( filename3, open_param );
175 for(sbi=0;sbi<transport->n_subst_;sbi++)
176 for(iel=0;iel<transport->btc->n_BTC_elms;iel++)
177 xfprintf(out[i],
"\t%d",transport->btc->BTC_elm[iel]);