When for_each_buffer() iterates over .h files, .c is displayed for the extension (in the code below).
I guess this is normal- that is, Slick treats .h files as .c files, but since I've had so many problems with Slick macros today, I don't want to assume anything. So, I'm trying to verify this with the experts..
_command int My_SelectiveDisplay_Callback() name_info(',')
{
_str fileExt;
fileExt = _bufname2ext(p_buf_name);
message("Buffer name is ->" p_buf_name);
_message_box("File Ext = " fileExt, "EXTENSION", MB_OK | MB_ICONEXCLAMATION)
if (stricmp(fileExt, "h") == 0)
{
message("Preprocessing " strip_filename(p_buf_name,"PD"));
}
else
{
_message_box("Not a valid file type -> " strip_filename(p_buf_name,"PD"), "My Source Preprocessor", MB_OK | MB_ICONEXCLAMATION);
}
return 0;
}
//******************************************************************************************
_command void MyPreprocess() name_info(',')
{
int rc;
rc = for_each_buffer('My_SelectiveDisplay_Callback');
if (rc !=0) {
_message_box("RC from for_each_buffer = " rc, "FOR_EACH_BUFFER ERROR", MB_OK | MB_ICONEXCLAMATION)
}
}