forked from KolibriOS/kolibrios
Minizip and Miniunz:
- Deleted kos_dir.c - Fixed Makefiles - Added to autobuild git-svn-id: svn://kolibrios.org@8776 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b1b61a4f19
commit
71343e1178
@ -9,7 +9,7 @@ LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds --image-base
|
|||||||
INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib
|
INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib
|
||||||
LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib
|
LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib
|
||||||
|
|
||||||
OBJECTS = miniunz.o unzip.o ioapi.o kos_dir.o
|
OBJECTS = miniunz.o unzip.o ioapi.o
|
||||||
|
|
||||||
default: $(OBJECTS)
|
default: $(OBJECTS)
|
||||||
kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem console -o miniunz $(OBJECTS) -lgcc -lc.dll -lz.dll
|
kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem console -o miniunz $(OBJECTS) -lgcc -lc.dll -lz.dll
|
||||||
|
@ -9,10 +9,11 @@ LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds --image-base
|
|||||||
INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib
|
INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib
|
||||||
LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib
|
LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib
|
||||||
|
|
||||||
OBJECTS = minizip.o zip.o ioapi.o kos_dir.o
|
OBJECTS = minizip.o zip.o ioapi.o
|
||||||
|
|
||||||
default: $(OBJECTS)
|
default: $(OBJECTS)
|
||||||
kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem console -o minizip $(OBJECTS) -lgcc -lc.dll -lz.dll
|
kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem console -o minizip $(OBJECTS) -lgcc -lc.dll -lz.dll
|
||||||
|
strip -S minizip
|
||||||
objcopy minizip -O binary
|
objcopy minizip -O binary
|
||||||
|
|
||||||
%.o : %.c Makefile.minizip
|
%.o : %.c Makefile.minizip
|
||||||
|
28
programs/fs/minizip/Tupfile.lua
Normal file
28
programs/fs/minizip/Tupfile.lua
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
if tup.getconfig("NO_GCC") ~= "" then return end
|
||||||
|
if tup.getconfig("HELPERDIR") == ""
|
||||||
|
then
|
||||||
|
HELPERDIR = "../.."
|
||||||
|
end
|
||||||
|
tup.include(HELPERDIR .. "/use_gcc.lua")
|
||||||
|
tup.include(HELPERDIR .. "/use_newlib.lua")
|
||||||
|
|
||||||
|
CFLAGS = CFLAGS .. " -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -Dunix -I. -I../../../contrib/sdk/sources/zlib"
|
||||||
|
|
||||||
|
LDFLAGS = LDFLAGS .. " --subsystem console -L../../../contrib/sdk/sources/zlib"
|
||||||
|
|
||||||
|
table.insert(LIBDEPS,"../../../contrib/sdk/lib/<libz.dll.a>")
|
||||||
|
LIBS = LIBS .. " -lz.dll"
|
||||||
|
|
||||||
|
-- Compile --
|
||||||
|
compile_gcc{
|
||||||
|
"miniunz.c", "unzip.c", "ioapi.c", "minizip.c", "zip.c",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Link miniunz
|
||||||
|
link_gcc({"miniunz.o", "unzip.o", "ioapi.o"},"miniunz")
|
||||||
|
|
||||||
|
-- Link minizip
|
||||||
|
link_gcc({"minizip.o", "zip.o", "ioapi.o"}, "minizip")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
|||||||
/* Copyright (C) 2019-2021 Logaev Maxim (turbocat2001), GPLv3 */
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#pragma pack(push,1)
|
|
||||||
typedef struct {
|
|
||||||
unsigned p00;
|
|
||||||
unsigned long long p04;
|
|
||||||
unsigned p12;
|
|
||||||
unsigned p16;
|
|
||||||
char p20;
|
|
||||||
char *p21;
|
|
||||||
} kol_struct70;
|
|
||||||
#pragma pack(pop)
|
|
||||||
|
|
||||||
int kol_file_70(kol_struct70 *k)
|
|
||||||
{
|
|
||||||
asm volatile ("int $0x40"::"a"(70), "b"(k));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool dir_operations(unsigned char fun_num, char *path)
|
|
||||||
{
|
|
||||||
kol_struct70 inf;
|
|
||||||
inf.p00 = fun_num;
|
|
||||||
inf.p04 = 0;
|
|
||||||
inf.p12 = 0;
|
|
||||||
inf.p16 = 0;
|
|
||||||
inf.p20 = 0;
|
|
||||||
inf.p21 = path;
|
|
||||||
if(!kol_file_70(&inf)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int chdir(const char* cwd)
|
|
||||||
{
|
|
||||||
__asm__ __volatile__(
|
|
||||||
"int $0x40"
|
|
||||||
::"a"(30),"b"(1),"c"(cwd));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool mkdir(const char* dir, int a)
|
|
||||||
{
|
|
||||||
return dir_operations(9, (char*)dir);
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user