From 74a88f882ea83593d727e7031e20791349c013cd Mon Sep 17 00:00:00 2001 From: Przemyslaw Date: Mon, 1 Apr 2024 09:10:43 +0200 Subject: Init --- wrapper-icon/Jttt.rc | 1 + wrapper-icon/Makefile.old.win | 33 +++++++++++++++++++ wrapper-icon/Makefile.win | 36 ++++++++++++++++++++ wrapper-icon/config.txt | 1 + wrapper-icon/icon/Jttt.ico | Bin 0 -> 2686 bytes wrapper-icon/icon/Trefle.ico | Bin 0 -> 47826 bytes wrapper-icon/icon/ufo-small.ico | Bin 0 -> 2190 bytes wrapper-icon/wrapper.c | 71 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 142 insertions(+) create mode 100644 wrapper-icon/Jttt.rc create mode 100644 wrapper-icon/Makefile.old.win create mode 100644 wrapper-icon/Makefile.win create mode 100644 wrapper-icon/config.txt create mode 100644 wrapper-icon/icon/Jttt.ico create mode 100644 wrapper-icon/icon/Trefle.ico create mode 100644 wrapper-icon/icon/ufo-small.ico create mode 100644 wrapper-icon/wrapper.c (limited to 'wrapper-icon') diff --git a/wrapper-icon/Jttt.rc b/wrapper-icon/Jttt.rc new file mode 100644 index 0000000..a240999 --- /dev/null +++ b/wrapper-icon/Jttt.rc @@ -0,0 +1 @@ +id ICON "icon/Jttt.ico" diff --git a/wrapper-icon/Makefile.old.win b/wrapper-icon/Makefile.old.win new file mode 100644 index 0000000..107331f --- /dev/null +++ b/wrapper-icon/Makefile.old.win @@ -0,0 +1,33 @@ +CPP = g++.exe +CC = gcc.exe + +WINDRES = windres.exe +RES = +OBJ = wrapper.o $(RES) +LINKOBJ = wrapper.o $(RES) +#LIBS = -L"/lib" -lsdl -lsdl_ttf -mwindows +LIBS = -static-libgcc +INCS = +CXXINCS = +BIN = wrapper.exe +CXXFLAGS = $(CXXINCS) -g +CFLAGS = $(INCS) +RM = rm + +.PHONY: all all-before all-after clean clean-custom + +all: all-before wrapper.exe all-after + + +clean: clean-custom + ${RM} $(OBJ) + ${RM} $(BIN) + + +$(BIN): $(OBJ) + $(CC) $(LINKOBJ) -o "wrapper.exe" $(LIBS) + +wrapper.o: wrapper.c + $(CC) -c wrapper.c -o wrapper.o $(CFLAGS) -DNO_STDIO_REDIRECT + + diff --git a/wrapper-icon/Makefile.win b/wrapper-icon/Makefile.win new file mode 100644 index 0000000..1dfb90f --- /dev/null +++ b/wrapper-icon/Makefile.win @@ -0,0 +1,36 @@ +CPP = g++.exe +CC = i686-w64-mingw32-g++ + +WINDRES = i686-w64-mingw32-windres +RES = +OBJ = wrapper.o $(RES) +LINKOBJ = wrapper.o $(RES) +#LIBS = -L"/lib" -lsdl -lsdl_ttf -mwindows +LIBS = -static-libgcc +INCS = +CXXINCS = +BIN = wrapper.exe +CXXFLAGS = $(CXXINCS) -g +CFLAGS = $(INCS) +RM = rm + +.PHONY: all all-before all-after clean clean-custom + +all: all-before wrapper.exe all-after + + +clean: clean-custom + ${RM} $(OBJ) + ${RM} $(BIN) + + $(WINDRES) Jttt.rc Jttt.res + + +$(BIN): $(OBJ) + $(WINDRES) Jttt.rc -O coff -o icon.o + $(CC) $(LINKOBJ) -o "wrapper.exe" $(LIBS) icon.o + +wrapper.o: wrapper.c + $(CC) -c wrapper.c -o wrapper.o $(CFLAGS) -DNO_STDIO_REDIRECT + + diff --git a/wrapper-icon/config.txt b/wrapper-icon/config.txt new file mode 100644 index 0000000..3628a0e --- /dev/null +++ b/wrapper-icon/config.txt @@ -0,0 +1 @@ +.\jre\bin\javaw.exe -jar Jttt.jar diff --git a/wrapper-icon/icon/Jttt.ico b/wrapper-icon/icon/Jttt.ico new file mode 100644 index 0000000..c5e9ee6 Binary files /dev/null and b/wrapper-icon/icon/Jttt.ico differ diff --git a/wrapper-icon/icon/Trefle.ico b/wrapper-icon/icon/Trefle.ico new file mode 100644 index 0000000..c753797 Binary files /dev/null and b/wrapper-icon/icon/Trefle.ico differ diff --git a/wrapper-icon/icon/ufo-small.ico b/wrapper-icon/icon/ufo-small.ico new file mode 100644 index 0000000..44ed689 Binary files /dev/null and b/wrapper-icon/icon/ufo-small.ico differ diff --git a/wrapper-icon/wrapper.c b/wrapper-icon/wrapper.c new file mode 100644 index 0000000..5ea19f8 --- /dev/null +++ b/wrapper-icon/wrapper.c @@ -0,0 +1,71 @@ +#include // printf +#include // exit +#include +#include // sleep access + +/* +char * current(char * name){ + char *file; + + if (!getenv("CD")) { + printf ("Zmienna srodowiskowa \"CD\" nie istnieje !\n"); + exit (1); + } + file=malloc(strlen(getenv("CD")+strlen(name)+1)); + strcpy(file, getenv("CD")); + strcat(file, name); + + return file; +} +*/ + +char * file_exist(){ + char * name = (char *)".\\config.txt"; + //char *file = current(name); + char *file = name; + + if (access(file, F_OK)==0){ + printf("PLIK istnieje %s\n",file); + free(file); + return file; + } + printf("PLIK nie istnieje %s\n",file); + free(file); + return NULL; +} + + + +void load(){ + + char * file = file_exist(); + char bufor1[128]; + char bufor2[128]; + char bufor3[128]; + char run[384]; + + if (!file) exit(1); + + FILE * f = fopen(file, "r"); + fscanf(f, "%s %s %s", bufor1,bufor2,bufor3); + fclose(f); + strcpy(run, bufor1); + strcat(run, " "); + strcat(run, bufor2); + strcat(run, " "); + strcat(run, bufor3); + printf("Uruchamiam %s \n",run); + free(file); + + system(run); + + + + +} + +int main (){ + load(); + + return 0; +} -- cgit v1.2.3