News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

win32-doc md files

Started by TimoVJL, May 18, 2025, 04:24:44 PM

Previous topic - Next topic

TimoVJL

https://github.com/MicrosoftDocs/win32
MS Win32 help files in md-format.

Test program just open zip-file and check all md-files for "api_name:" keywords.

At first might be better just to extract one folder and zip it again for testing.

One full test 58416 files.

Keyword test for keywordsint ParseFile(char *pMem, int nSize, char *szFile, int nLen, int nIdx)
{
char *pPtr, *pPtr1, *pPtr2;
pPtr = strstr(pMem, "api_name:"); // CRT
//pPtr = StrStr(pMem, "api_name:"); // shlwapi.dll
if (pPtr) {
printf("%s\t", szFile);
pPtr += 9; // pass
while (*pPtr != 10) pPtr++;
pPtr++;
pPtr1 = pPtr;
pPtr2 = pPtr;
//*(pPtr+10) = 0;
do {
while (*pPtr2 != 10) pPtr2++;
*pPtr2 = 0; // cut to newline
printf("%s ", pPtr1);
pPtr2++;
pPtr1 = pPtr2;
} while (*pPtr2 == '-');
printf("\n");
} else printf("%s\n", szFile);
return 0;
}
May the source be with you

John Z

Thanks TimoVJL,

Got it and the entire WIN32 zip.  Will let you know.

John Z

Quin

This is absolutely incredible, thanks Timo!
Use the assembly, Luke.

John Z

#3
Hi TimoVJL.

Here is a SQLITE3 database and some crude sample code to access it.  The DB3 file is 7Z inside of the project zip so it must be un7z'd into the application directory.  The DB contains the API NAMES your utility identified in the WIN32-docs.zip downloaded from GitHub. For each* API NAME it contains the path within the ZIP files needed to extract the .md file for the API so that the .md file can be viewed. A small dialog is used for the demo.

*This is just a first pass as the WIN32-Docs was not consistent in file naming, so there are some names it will not yet work on.  This can be handled if the project seems to be of value by making multiple queries for a given API name trying each of the various filename formats.

There is a readme in the project directory as well.

John Z

TimoVJL

A your example provide, that MS help file is just useless.

Last locally working help file is from 2019-09-05

After that, just pile of shi....
May the source be with you

John Z

Hi TimoVJL,

It is actually worse than you might think too.

HOWEVER -
I added a few code lines to your extract program and from the new extract I have built a new database, handling all identified API_NAME files.  So it accommodates the inconsistent formats, and other issues.

The GitHub documentation was clearly (to me) done by multiple people/groups with various inconsistencies and no general oversight.  Some API_NAMES are not even API functions, many files for the same base API Name bla bla bla...

So the new DB3 takes care of everything extracted by your extract program.

I'll create the new queries needed to output the filename to extract and show, next.  Where there are multiple files for the same base API NAME the user will need to select, similar to HINT when searching a partial function name.

Another possible use of the DB is to create a treeview where the top level are the directories and child level is for the API NAMEs... easy for user to see/browse for the API function they want information on, clicking a child level item pulls the file from the zip and displays it.
Depends on how much work is to be invested in the final output.

John Z

TimoVJL

Only good thing is, that now is possible to create database for online help.
You have done great job with that MS help material.
May the source be with you

John Z

Hi TimoVJL,

Attached is the new DB for the GitHub win32-docs.zip offline documentation.  Every API_NAME output by your extract program is accessible in the DB.

Had some clean-up to do and I'm looking for 'runs the first time" bug in my C access program.

So posting the DB now.  Later posting my access program when bug free, but I'm sure it is not really needed by most people.  Because of the complexity/inconsistency of the win32-doc using a sql 'like' command will often be the first step in getting to the document desired.

Like the 1st db the "Win32-docs\\desktop-src\\" is to be pre-appended to the SQL returns, that is the DB returns the SubDir and the actual filename.md, as before.

John Z