News:

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

Main Menu

Recent posts

#11
Bug reports / Re: O_BINARY
Last post by Pelle - Yesterday at 11:24:11 AM
This is more about policy, I think. I document only the header file where the function prototype is located, because that was easy to start with.

Some functions will "need" more header files, some functions will need a #define <symbol> before the #include <...> to activate the prototype, but with over 1000 pages in the "C runtime" folder (not all of them related to functions, but anyway) it's a bit hard to find the energy just to begin investigating what to update (and how)...
#12
Projects developed with Pelles C / Mighty Eagle
Last post by rweidner - Yesterday at 01:33:10 AM
https://github.com/xecronix/MightyEagleC


# Mighty Eagle C

Mighty Eagle C is a C implementation of the Mighty Eagle template engine.

The Mighty Eagle Templating Solution (METS) is capable of replacing a properly
tagged text document with external data. This solution has the added advantage
of being easily extended via the use of callbacks. Using callbacks a programmer
can easily model recursive data and on the fly data translations. Some use cases
include translation of data from one format to another, generic templated documents,
mail templates, and other similar tasks, batch file creation (.bat). The program is
particularly well suited for translation of relational data to hierarchical
visualizations.

This repo currently contains:

- a static library build target
- a demo executable that generates nested HTML output
- a test runner executable that validates behavior using scenario files and golden output

## Current Build Outputs

- `MightyEagleLib32.lib`
- `MightyEagleDemo32.exe`
- `MightyEagleTest32.exe`

## PellesC Workspace - Easiest build method uses the IDE
MightyEagleLib32.ppw

## Build

```console
pomake.exe MightyEagleLib32.ppj
pomake.exe MightyEagleTest32.ppj
pomake.exe MightyEagleDemo32.ppj
```

## Run Tests

```console
MightyEagleTest32.exe
```

## Run Demo

```console
MightyEagleDemo32.exe
```

## Notes

- This project was rebuilt from the original Euphoria implementation and the project specs with ChatGPT assistance.
- The main behavioral rules live in `docs/10_library_spec.md`.
- The current environment validated the 32-bit static library target.

#13
User contributions / Re: Has anyone built a crude ...
Last post by rweidner - March 13, 2026, 08:27:43 PM
Well, I looked closer at adding Crude to the tools section of PellesC IDE. While the IDE itself makes that task simple to do, Crude was designed as a per-project tool. Therefore, I stopped trying to integrate it into the PellesC IDE. For me, the juice wasn't worth the squeeze. A small setup process is required for Crude to work. The source directory and destination directory need to be configured. I put the setup in .batch files. I added two . bat files to the project as examples and pushed those to Github.

Example batch files:
1. crude.bat: Create a snapshot revision on demand.
2. compare.bat: Open WinMerge with the latest snapshot compared against the current project state.

#14
User contributions / Re: Has anyone built a crude ...
Last post by TimoVJL - March 13, 2026, 05:48:08 PM
File -> New -> Differences

Help
Integrated Environment ->Differences

EDIT 2026-03-14 From Add-In help:
QuotePurpose:
Starts a File difference job in the IDE.

Syntax (macro):
BOOL AddIn_FileDifference(HWND hwnd, PADDIN_FILE_DIFFERENCE pFileDiff);

Syntax (SendMessage):
SendMessage(hwnd, AIM_FILE_DIFFERENCE, (WPARAM)0, (LPARAM)(PADDIN_FILE_DIFFERENCE)(pFileDiff))
typedef struct tagADDIN_FILE_DIFFERENCE {
    UINT cbSize;
    const WCHAR *pszSpecLeft;
    const WCHAR *pszSpecRight;
    BOOL fRecurse;
} ADDIN_FILE_DIFFERENCE, *PADDIN_FILE_DIFFERENCE;
#15
User contributions / Re: Has anyone built a crude ...
Last post by ddainelis1 - March 13, 2026, 05:31:19 PM
Hello TimoVJL,
Would you have a link on how to use the "internal visual diff using fdiff.dll" ?   

Best regards,

DJD
#16
User contributions / Re: Has anyone built a crude ...
Last post by TimoVJL - March 13, 2026, 11:53:12 AM
poide have internal visual diff using fdiff.dll
#17
User contributions / Re: Has anyone built a crude ...
Last post by rweidner - March 13, 2026, 04:00:48 AM
I ran out of steam today.  But tomorrow I think I'll have a "Crude" revision control system complete with visual diff via winMerge "integrated" into the PellesC IDE using the tools editor.

The tool fills a need for me and was a fun little project.  Thanks for the idea.
#18
User contributions / Re: Has anyone built a crude ...
Last post by ddainelis1 - March 13, 2026, 02:18:05 AM
Good Evening RWEIDNER,

Thank you for the link to your "CRUDE" application github site. It is a good App that meets your design requirements. Also, it does use a design approach that i had not considered.  Using a DB and i will look into the method for another app soon.

Best regards
#19
General discussion / Re: Compiling using pomake
Last post by John Z - March 13, 2026, 01:07:55 AM
Hi rweidner,

Nice - many levels of complexity added.  BBBBuilder.dll builds only for the selected mode, and execution method, you've got it all covered in one. Plus you have added much more error detection/escapes. 

Next 'soon' version of BBBBuilder has the option to output a PowerShell  script or the bat file.  PowerShell works well now so I'm integrating it into the code.  I stuck with the base PowerShell 5 since it comes with windows, even though no longer updated.  I believe it will also work with 7 but not everyone will download and install pwsh.exe.

John Z

Question:
Is main.c in a different directory? 
echo Building %PROJECT_NAME%...

call :compile_one "main.c" || goto build_fail

for %%F in (src\*.c) do (
    call :compile_one "%%F" || goto build_fail
)

Otherwise it looks like it will be compiled twice   It is included in the set of all *.c files is it not?  It must be unless a different is directory is used for main.c.

Just wondering - is there a reason for a different directory if that is the case?
#20
General discussion / Re: Compiling using pomake
Last post by rweidner - March 12, 2026, 10:54:27 PM
John Z,
Inspired by BBB Builder, I worked with ChatGPT for a couple hours and we built this .bat file. Thanks for the inspiration. I believe this script will help improve my workflow.

@echo off
REM File: project.bat
REM Purpose: FBI Pursuit build/workflow entry point

setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

set "PROJECT_DIR=%~dp0"
if "%PROJECT_DIR:~-1%"=="\" set "PROJECT_DIR=%PROJECT_DIR:~0,-1%"
set "PROJECT_NAME=FBIPursuit"
set "EXE_NAME=FBIPursuit.exe"
set "OUTPUT_DIR=output"
set "CRUDE_EXE=C:\CRUDE\crude.exe"
set "CRUDE_REPO=C:\CRUDE"
set "WINMERGE_EXE=C:\Program Files\WinMerge\WinMergeU.exe"

set "CCFLAGS_DEBUG=-Tx86-coff -std:C17 -Zi -Ob0 -fp:precise -W1 -Gd -Ze -Zc-"
set "CCFLAGS_RELEASE=-Tx86-coff -std:C17 -Ot -Ob1 -fp:precise -W1 -Gd -Zc- -Ze"
set "LINKFLAGS_DEBUG=-machine:x86 -subsystem:console -safeseh -debug -debugtype:po kernel32.lib advapi32.lib delayimp.lib raylibdll.lib opengl32.lib gdi32.lib winmm.lib user32.lib shell32.lib"
set "LINKFLAGS_RELEASE=-machine:x86 -subsystem:console -safeseh kernel32.lib advapi32.lib delayimp.lib raylibdll.lib opengl32.lib gdi32.lib winmm.lib user32.lib shell32.lib"

if "%~1"=="" goto build_debug
if /I "%~1"=="build_debug" goto build_debug
if /I "%~1"=="build_release" goto build_release
if /I "%~1"=="rebuild_debug" goto rebuild_debug
if /I "%~1"=="rebuild_release" goto rebuild_release
if /I "%~1"=="run" goto run
if /I "%~1"=="clean" goto clean
if /I "%~1"=="crude" goto crude
if /I "%~1"=="diff" goto diff
if /I "%~1"=="help" goto help

echo Unknown target: %~1
goto help

:prepare_env
call "%PROJECT_DIR%\env_pelles32.bat"
if errorlevel 1 exit /b 1

pushd "%PROJECT_DIR%"
if errorlevel 1 exit /b 1

set "INCLUDE=%INCLUDE%;%PROJECT_DIR%\deps\include;%PROJECT_DIR%\src\include"
set "LIB=%LIB%;%PROJECT_DIR%\deps\lib"

if not exist "%OUTPUT_DIR%" mkdir "%OUTPUT_DIR%"
if errorlevel 1 (
    echo ERROR: Failed to create output directory.
    popd
    exit /b 1
)

exit /b 0

:build_debug
call :clean_internal || exit /b 1
set "ACTIVE_CCFLAGS=%CCFLAGS_DEBUG%"
set "ACTIVE_LINKFLAGS=%LINKFLAGS_DEBUG%"
call :do_build || exit /b 1
exit /b 0

:build_release
call :clean_internal || exit /b 1
set "ACTIVE_CCFLAGS=%CCFLAGS_RELEASE%"
set "ACTIVE_LINKFLAGS=%LINKFLAGS_RELEASE%"
call :do_build || exit /b 1
exit /b 0

:rebuild_debug
call :build_debug
exit /b %errorlevel%

:rebuild_release
call :build_release
exit /b %errorlevel%

:do_build
call :prepare_env || exit /b 1

echo Building %PROJECT_NAME%...

call :compile_one "main.c" || goto build_fail

for %%F in (src\*.c) do (
    call :compile_one "%%F" || goto build_fail
)

set "OBJLIST="
for /f "delims=" %%F in ('dir /b "%OUTPUT_DIR%\*.obj" 2^>nul') do (
    set "OBJLIST=!OBJLIST! "%OUTPUT_DIR%\%%F""
)

if not defined OBJLIST (
    echo ERROR: No object files were produced.
    goto build_fail
)

echo Linking %EXE_NAME%...
polink %ACTIVE_LINKFLAGS% -out:"%EXE_NAME%" !OBJLIST!
if errorlevel 1 goto build_fail

echo Build complete: %EXE_NAME%
popd
exit /b 0

:build_fail
echo Build failed.
popd
exit /b 1

:compile_one
echo Compiling %~1 ...
pocc %ACTIVE_CCFLAGS% "%~1" /Fo"%OUTPUT_DIR%\%~n1.obj"
if errorlevel 1 exit /b 1
exit /b 0

:run
pushd "%PROJECT_DIR%"
if not exist "%EXE_NAME%" (
    echo ERROR: %EXE_NAME% not found. Run build_debug or build_release first.
    popd
    exit /b 1
)
start "" "%PROJECT_DIR%\%EXE_NAME%"
popd
exit /b 0

:clean
call :clean_internal
exit /b %errorlevel%

:clean_internal
pushd "%PROJECT_DIR%"
if errorlevel 1 exit /b 1

echo Cleaning...
del /q "%OUTPUT_DIR%\*.obj" 2>nul
del /q "%EXE_NAME%" 2>nul

popd
exit /b 0

:crude
call :clean_internal || exit /b 1
if not exist "%CRUDE_EXE%" (
    echo ERROR: CRUDE not found:
    echo %CRUDE_EXE%
    exit /b 1
)
"%CRUDE_EXE%" "%PROJECT_DIR%" "%CRUDE_REPO%"
exit /b %errorlevel%

:diff
call :clean_internal || exit /b 1

if not exist "%WINMERGE_EXE%" (
    echo ERROR: WinMerge not found:
    echo %WINMERGE_EXE%
    exit /b 1
)

set "REVISIONS_DIR=%CRUDE_REPO%\%PROJECT_NAME%\revisions"
if not exist "%REVISIONS_DIR%" (
    echo ERROR: Revisions folder not found:
    echo %REVISIONS_DIR%
    exit /b 1
)

set "LATEST_REV="
for /f "delims=" %%D in ('dir "%REVISIONS_DIR%" /b /ad /o:-n 2^>nul') do (
    set "LATEST_REV=%%D"
    goto found_latest
)

:found_latest
if not defined LATEST_REV (
    echo ERROR: No revisions found in:
    echo %REVISIONS_DIR%
    exit /b 1
)

set "LATEST_DIR=%REVISIONS_DIR%\%LATEST_REV%"

echo Comparing:
echo  CURRENT: %PROJECT_DIR%
echo  REVISION: %LATEST_DIR%
start "" "%WINMERGE_EXE%" "%PROJECT_DIR%" "%LATEST_DIR%"
exit /b 0

:help
echo.
echo Usage:
echo    %~n0 build_debug
echo    %~n0 build_release
echo    %~n0 rebuild_debug
echo    %~n0 rebuild_release
echo    %~n0 run
echo    %~n0 clean
echo    %~n0 crude
echo    %~n0 diff
echo    %~n0 help
echo.
exit /b 1