Possible I guess. This code adds a comment to every open buffer - for_each_buffer iterates through all visible open buffers. The comment gets added to the "newest version" of the file in the backup history. If you want to create a new entry in the backup history you'll probably have to make a change to the file and save it. I think you can "touch" a file with _save_file() - but this doesn't get you a new entry in the backup history. If you need to add a multi-line comment instead of a single line you'll need to make your own dialog - select "new form" in the Macro menu. Let me know if you need help with that.
Dunno how to get a list of all "source files". You can get a list of all project files like this, then iterate through them selectively. You can use the function get_extension(filename) to return the file extension.
_str files_to_comment [];
_getProjectFiles( _workspace_filename, _project_get_filename(), files_to_comment, 1);
int xdelta_add_a_comment()
{
_str versionList[];
DSListVersions(p_buf_name, versionList);
if ( versionList._length() == 0 ) {
return 0;
}
DSSetVersionComment(p_buf_name, versionList._length() - 1, _param1);
return 0;
}
_command void xdelta_add_comment_to_all_buffers() name_info(',')
{
int result = textBoxDialog(
"blah", // Form caption
TB_RETRIEVE, // Flags
11000, // textbox width
"", // Help item
"\t Enter a comment",
"blahblah1",
"Comment :" );
if (result == COMMAND_CANCELLED_RC) {
return;
}
if (_param1 == '') {
return;
}
for_each_buffer("xdelta_add_a_comment");
}