News:

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

Main Menu

Recent posts

#21
User contributions / Re: Github-kuba miniz for Pell...
Last post by TimoVJL - April 22, 2026, 09:29:40 AM
A simple example:#include <stdlib.h>
//#include <zip.h>
#pragma comment(lib, "zip.lib")
//#include "zip_stdcall.h"
#define ZIP_DEFAULT_COMPRESSION_LEVEL 6
typedef struct zip_t zip_t;
extern struct zip_t __stdcall *zip_open(const char *zipname, int level, char mode);
extern int __stdcall zip_entry_open(struct zip_t *zip, const char *entryname);
extern int __stdcall zip_entry_fwrite(struct zip_t *zip, const char *filename);
extern int __stdcall zip_entry_close(struct zip_t *zip);
extern int __stdcall zip_close(struct zip_t *zip);

int __cdecl main(void)
{
struct zip_t *zip = zip_open("meta.zip", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');
{
    zip_entry_open(zip, "meta.xml");
    {
        zip_entry_fwrite(zip, "meta.xml");
    }
    zip_entry_close(zip);
}
zip_close(zip);
return 0;
}
#22
Bug reports / Re: Some fonts are missing fro...
Last post by ander_cc - April 22, 2026, 04:37:38 AM
Thank you very much Pelle! It is a efficient way.
#23
User contributions / Re: Github-kuba miniz for Pell...
Last post by John Z - April 21, 2026, 09:06:54 PM
Thanks Timo,Vortex,

Yes I had that one and several other changes similar to what I did for 3.0.2
It is creating a zip file that can be opened with both Windows Explorer and 7z.

However there is something amiss.  Both LibreOffice Calc and Excel complain of a corrupted zip, but both will 'repair' it and open with all the data intact.

So it seems like something not quite right in the header, or other housekeeping part.  Checking the actual zipped files from an 'old' version and in the new 3.1.1 version shows the files themselves are identical.

Maybe I'll just start over - But I'll try your work first  :)

Thanks,
John Z


#24
Feature requests / Re: Enhanced editor suggestion...
Last post by Pelle - April 21, 2026, 09:04:13 PM
Just a few notes:
1) Workspace files was added long after project files, limiting the available options.
2) All 169 (currently) sub-projects of Pelles C is in the same workspace file. Not the biggest project in the world, but not "small". Once all the projects are set up, it's mostly a matter of switching between "Debug" and "Release" builds, which is already available for a workspace.

As always, I guess it boils down to what you are used to and what you expect...
#25
User contributions / Re: Github-kuba miniz for Pell...
Last post by Vortex - April 21, 2026, 09:00:14 PM
Hi Timo,

Great work, many thanks.
#26
Assembly discussions / Message only window
Last post by Vortex - April 21, 2026, 08:58:33 PM
A message only window is a special window not visible ( no GUI interface ) and designed to send and receive messages. The code below creates a timer and deletes a file named test12345.txt before destroying itself after 3 seconds.

.386
.model flat,stdcall
option casemap:none

include     MsgOnlyWnd.inc

.data

ClassName   db 'MessageOnlyWindow',0
file        db 'test12345.txt',0

.data?

hInstance   dd ?
wc          WNDCLASSEX <?>
msg         MSG <?>

.code

start:

    invoke  GetModuleHandle,0
    mov     hInstance,eax

    mov     wc.cbSize,SIZEOF WNDCLASSEX
    mov     wc.lpfnWndProc,OFFSET WndProc
    mov     wc.hInstance,eax
    mov     wc.lpszClassName,OFFSET ClassName

    invoke  RegisterClassEx,ADDR wc

    xor     eax,eax

    invoke  CreateWindowEx,NULL,ADDR ClassName,eax,\
            eax,eax,eax,eax,eax,\
            HWND_MESSAGE,eax,hInstance,eax

    .WHILE TRUE

        invoke  GetMessage,ADDR msg,NULL,0,0
        .BREAK .IF (!eax)
        invoke  TranslateMessage,ADDR msg
        invoke  DispatchMessage,ADDR msg

    .ENDW

    invoke  ExitProcess,0


WndProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD

    .IF uMsg==WM_CREATE

        invoke  SetTimer,hWnd,ID_TIMER,3000,ADDR TimerProc
           
    .ELSEIF uMsg==WM_DESTROY

        invoke  PostQuitMessage,NULL

    .ELSE

        invoke  DefWindowProc,hWnd,uMsg,wParam,lParam       
        ret
       
    .ENDIF
   
    xor     eax,eax
    ret

WndProc ENDP


TimerProc PROC hWnd:DWORD,uMsg:DWORD,idEvent:DWORD,dwTime:DWORD

    invoke  exist,ADDR file
    test    eax,eax
    jz      @f   
    invoke  DeleteFile,ADDR file
@@:
    invoke  KillTimer,hWnd,ID_TIMER
    xor     eax,eax
    invoke  SendMessage,hWnd,WM_DESTROY,eax,eax
    ret

TimerProc ENDP


exist PROC lpszFileName:DWORD       ; function from masm32.lib

LOCAL wfd:WIN32_FIND_DATA

    invoke  FindFirstFile,lpszFileName,ADDR wfd

    .if eax == INVALID_HANDLE_VALUE

      xor       eax,eax             ; 0 = NOT exist

    .else

      invoke    FindClose,eax
      mov       eax,1               ; 1 = exist

    .endif

    ret

exist ENDP

END start
#27
User contributions / Re: Github-kuba miniz for Pell...
Last post by Vortex - April 21, 2026, 07:48:56 PM
Hi Timo,

It look like that compiling new version is not so easy. A lot of warnings and error messages.
#28
Bug reports / Re: Some fonts are missing fro...
Last post by Pelle - April 21, 2026, 06:26:10 PM
The filtering is supposed to exclude fonts not useful in the current locale. The problem is that for a (C) programming environment, it's hard to ignore the Latin alphabet.

So, ander_cc, changing filtering code in EnumFontFaceProc() from...
if ((dwFontType & TRUETYPE_FONTTYPE) != 0 &&
        (pntm->ntmFontSig.fsCsb[0] & pls->lsCsbSupported[0]) == 0 &&
        (pntm->ntmFontSig.fsCsb[1] & pls->lsCsbSupported[1]) == 0)
        return 1;  /* unwanted font, but keep enumerating */

...to this, should fix the problem... right?
    if ((dwFontType & TRUETYPE_FONTTYPE) != 0 &&

        (pntm->ntmFontSig.fsCsb[0] & FS_LATIN1) == 0 &&    /* <=== NEW */

        (pntm->ntmFontSig.fsCsb[0] & pls->lsCsbSupported[0]) == 0 &&
        (pntm->ntmFontSig.fsCsb[1] & pls->lsCsbSupported[1]) == 0)
        return 1;  /* unwanted font, but keep enumerating */
Not pretty, but I can't a better approach right now so this will have to do...
#29
User contributions / Re: Github-kuba miniz for Pell...
Last post by TimoVJL - April 21, 2026, 04:33:43 PM
You have to modify sources a bit ?
miniz.h line 5451
from
#ifdef _MSC_VER#if defined(_MSC_VER) && !defined(__POCC__)

zip.c line 42
#if defined(_MSC_VER) && !defined(__POCC__)
#30
User contributions / Re: Github-kuba miniz for Pell...
Last post by John Z - April 21, 2026, 03:24:20 PM
Has anyone gotten the newest release version 3.1.1 of Github-kuba miniz to build in Pelles C?

https://github.com/kuba--/zip

Has new features as well as 64bit capability.

John Z