function code_chart_header_file_rtw(fileNameInfo, chart, specsIdx)
% Copyright 1995-2009 The MathWorks, Inc.

chartNumber = sf('get',chart,'chart.number');
fileName = fullfile(fileNameInfo.targetDirName,fileNameInfo.chartHeaderFiles{chartNumber+1}{specsIdx});

sf_echo_generating('Coder',fileName);

file = fopen(fileName,'Wt');
if file<3
construct_coder_error([],sprintf('Failed to create file: %s.',fileName),1);
return;
end

fprintf(file,'%s\n',get_boiler_plate_comment('chart',chart));

fclose(file);
try_indenting_file(fileName);