News:

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

Main Menu

Recent posts

#11
User contributions / Re: Github-kuba miniz for Pell...
Last post by TimoVJL - Yesterday at 02:45:00 PM
John Z,
can you give a small example file for tests with Libre Office and MS Office ?
#12
User contributions / Re: Github-kuba miniz for Pell...
Last post by John Z - Yesterday at 02:07:32 PM
Thanks Timo, Vortex,

Well surprising results.  I built your version.  Very good I had not thought to use __MINGW32__ so my build ended up with more code 'customizations'. 

However, when I used your version to create an ODF spreadsheet it ended up with the same exact issue!  Note that I have been using using an older version of miniz to do the same thing successfully, so any issue is only related to the new miniz.

Just like with my mod of miniz, both ODF and Excel indicate a problem which they both can  'repair' and all spreadsheet data is there. Whereas Explorer ZIP, and 7z have no issue unzipping the file, and show no error report.

So there is some sort of (minor repairable) incompatibility with ODF/Excel expectations when using the newest 3.1.1 64 bit capable version.  I did try it with the 32 bit fileopen ('w'-64) and it was the same.

Looks like I'll be sticking with the old perfectly working version for now...at least until I can spend time to figure out the difference.

John Z
#13
User contributions / Re: Github-kuba miniz for Pell...
Last post by Vortex - Yesterday at 11:05:10 AM
Hi Timo,

Great work, thanks. Based on your sample, here is a modified version creating the archive test.zip and adding the file sample.docx

#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("test.zip", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');
    {
        zip_entry_open(zip, "sample.docx");
        {
            zip_entry_fwrite(zip, "sample.docx");
        }
        zip_entry_close(zip);
    }
    zip_close(zip);
    return 0;
}
#14
User contributions / Re: Github-kuba miniz for Pell...
Last post by TimoVJL - Yesterday at 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;
}
#15
Bug reports / Re: Some fonts are missing fro...
Last post by ander_cc - Yesterday at 04:37:38 AM
Thank you very much Pelle! It is a efficient way.
#16
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


#17
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...
#18
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.
#19
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
#20
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.