News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Recent posts

#71
Tips & tricks / Re: markdown_parser
Last post by TimoVJL - November 01, 2026, 06:53:18 PM
Thanks, i will test it.
#72
Tips & tricks / Re: markdown_parser
Last post by MrBcx - November 01, 2026, 06:51:28 PM
Quote from: TimoVJL on November 01, 2026, 09:11:39 AMA smaller markdown parser found from

https://codereview.stackexchange.com/q/297742


I used an AI agent to produce an improved usable app from the stackexchange project. 

Build.bat uses Gcc but shouldn't be too tough to make a Pelles C project from it.


My zip file contains this sample .md:

https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/Controls/about-combo-boxes.md

* We can drag and drop a *.md file onto MD2HTML.exe and it will create an html file.

* Or you can do something like this:
  C:\Temp\MD2HTML>md2html --dark about-combo-boxes.md
  about-combo-boxes.md -> about-combo-boxes.html (22227 bytes)

* I manually saved the 3 images and created a folder named images next to MD2HTML.

* I made no edits to the markdown file.

* I told the AI agent to add a command line switch, "--dark"  to output a darkmode html.
  Of course, it defaults to light mode.


I personally don't have much need for this but I thought someone on this forum might.

#73
General discussion / Re: Testing code with other C ...
Last post by Michele - November 01, 2026, 01:34:46 PM
I use Eclipse IDE for all projects, from windows to embedded hardware.
I use clang to compile windows apps.
Isn't perfect, but is very helpful on writing, compiling and testing.
#74
General discussion / Re: Testing code with other C ...
Last post by TimoVJL - November 01, 2026, 12:38:24 PM
Those headers makes things easier.

clang-cl.exe don't accept WINSDK annotations and also problems with standard headers.

VCForPython27.msi is still available too.

clang.exe hello.c -Wl,-nodefaultlib:libcmt -D_DLL -lmsvcrt -o hello_clang64.exe
#75
General discussion / Re: Testing code with other C ...
Last post by Vortex - November 01, 2026, 11:43:53 AM
Hi Timo,

I think you can use only clang.exe to compile code without depending on the other Clang binaries :

C:\clang>clang -c -m32 -Wall Hello.c -o Hello32.o


C:\clang>set INCLUDE=D:\VCForPython27\VC\include;D:\VCForPython27\WinSDK\Include


C:\clang>clang -c -m32 -Wall Hello.c -o Hello32.o
#76
Tips & tricks / Re: markdown_parser
Last post by John Z - November 01, 2026, 10:14:35 AM
Nice find Timo!

I've used the free Pandoc in the past.
https://pandoc.org/ to do the conversions, very versatile but much bigger of course.
There is also a md2html.exe included in the helpfile utilities in the FAR downloads,
which unfortunately are removed, but I have available.

John Z
#78
User contributions / Re: Offline GitHub MS Document...
Last post by TimoVJL - October 31, 2026, 03:51:10 PM
A markdown (.md) conversion to RTF could be useful for md-files,
as RichEdit component could show them visually.

Currently win32-docs are not good consistent material, but a testbed for them.

Sadly also a MSDN help file material is just a huge trashcan with too many kind of formattings, no coherent material.

A md-format was a good idea, from it could format many kind of other formats, like bloated xhtml.

QuoteCybersecurity researchers have uncovered a sophisticated malware campaign exploiting Microsoft Help Index Files (.mshi) to deliver the notorious PipeMagic backdoor, marking a significant evolution in the threat actors' tactics since the malware's first detection in 2022.
#79
User contributions / Re: Offline GitHub MS Document...
Last post by TimoVJL - October 30, 2026, 02:45:44 PM
If MS don't give full keyword list, they don't even try to be helpful.

A that MessageBox keyword mystery is odd.

Microsoft should make a keyword list for every function and from where it found from their help sites and local versions.

A code for finding functions from a one folder#define WIN32_LEAN_AND_MEAN
//#include <stdio.h> // clang needs different stdio.h
#include <windows.h>

#pragma comment(lib, "kernel32.lib")
#pragma comment(lib, "user32.lib")

void CheckFile(char *szFile);
int __cdecl puts(const char *string); // clang needs different stdio.h

TCHAR szBuffer[4096];

int ScanDir(char *szDir)
{
WIN32_FIND_DATA fdFile;
HANDLE hFile;
//int i = 0;

int nLen = lstrlen(szDir);
lstrcpy(szDir+nLen, "*-flat.md");
// OutputDebugString(szDir);
hFile = FindFirstFile(szDir, &fdFile);
if (hFile != INVALID_HANDLE_VALUE)
do {
if ((fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
!= FILE_ATTRIBUTE_DIRECTORY) {
lstrcpy(szDir+nLen, fdFile.cFileName);
//puts(szDir);
//OutputDebugString(szDir);
CheckFile(szDir);
//i++;
}
} while (FindNextFile(hFile, &fdFile));
FindClose(hFile);
return 0;
}

void ParseField1(char *pStart, char *pEnd)
{
char *pPtr1 = pStart+2;
char *pPtr2 = szBuffer;
while (*pPtr1 != '|') { // until a new field separator
if (*pPtr1 != '\\')  // avoid '\'
*pPtr2++ = *pPtr1;
if (*pPtr1 == ')') break; // end of function
pPtr1++;
}
*pPtr2++ = ';';
*pPtr2 = 0;
puts(szBuffer);
}

void CheckFile(char *szFile)
{
HANDLE hFile;
BYTE *pRows;
DWORD nMax, nRead;

hFile = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
nMax = GetFileSize(hFile, NULL);
pRows = HeapAlloc(GetProcessHeap(), 0, nMax + 1);
//if (nMax > sizeof(szBuffer)) nMax = sizeof(szBuffer); // read only header
if (ReadFile(hFile, pRows, nMax, &nRead, NULL)) {
TCHAR *pPtr1, *pPtr2; //, *pPtr3;
CloseHandle(hFile);
*(pRows + nMax) = 0; // ensure 0
pPtr1 = (char*)pRows;
while (*pPtr1 != '|') pPtr1++; // find first '|'
if (pPtr1) {
while (*pPtr1 != 10) {
pPtr2 = pPtr1;
while (*pPtr2 != 10) pPtr2++; // find end of line
*pPtr2 = 0; // cut line
if (*pPtr1 != 10 && *(pPtr1+1) != '-' && *(pPtr1+2) != 'F')
ParseField1(pPtr1, pPtr2);
pPtr1 = pPtr2+1;
if (!*pPtr1 || *pPtr1 == 10) break;
}
}
} else CloseHandle(hFile);
HeapFree(GetProcessHeap(), 0, pRows);
}
}

int main(int argc, char **argv) {
char szDir[MAX_PATH];

lstrcpy(szDir, "gdiplus/");
ScanDir(szDir);
return 0;
}
#80
User contributions / Re: Offline GitHub MS Document...
Last post by John Z - October 30, 2026, 10:38:29 AM
I'm sure you are right based on prior findings. In the last 15 months it has only grown about 7Meg.

Not sure I want to reprocess it to update the MD_Files_3.db3 and MDFiles.exe I created for easily accessing the data...

Documentation access utilities like Hint, Hint_SA, MDFiles, don't see much interest by forum members.  I might post Hint_SA on SourceForge with links back to Pelles Forum if someone wants the GPL'ed source code that is required to be provided.

John Z

P.S. There is not a 'bot'/'AI' excluded Open Source License yet either . . . theoretically a 'bot'/'AI' could request the source code from any GPL'ed project and the developer would be obligated to provide it.
 
I guess anything on GitHub/GitLab has already been absorbed