From e324b3d118c0f552182d233a63750ed7900ba63c Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 16 Apr 2026 14:27:13 +0900 Subject: [PATCH] init --- .gitiginore | 5 +++++ LICENSE | 24 ++++++++++++++++++++++++ Makefile | 32 ++++++++++++++++++++++++++++++++ bindgen.c | 34 ++++++++++++++++++++++++++++++++++ objs.mk | 0 5 files changed, 95 insertions(+) create mode 100644 .gitiginore create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 bindgen.c create mode 100644 objs.mk diff --git a/.gitiginore b/.gitiginore new file mode 100644 index 0000000..5589e10 --- /dev/null +++ b/.gitiginore @@ -0,0 +1,5 @@ +/bindgen +/*.o +/*.exe +/*.so +/*.dll diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a7729ad --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2025-2026, Pyrite development team +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f9630ab --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +MILSKO = ../milsko +XEMIL = ../xemil + +CC = gcc +CXX = g++ -fno-rtti -fno-exceptions -std=c++98 + +LIB = lib +SO = .so + +EXEC = + +.PHONY: all clean +.SUFFIXES: .c .cxx .o + +all: libMwCXX$(SO) + +include objs.mk + +bindgen$(EXEC): bindgen.o + $(CC) -L$(XEMIL)/lib -L$(XEMIL)/src -o $@ bindgen.o -lxemil + +libMwCXX$(SO): $(OBJS) + $(CXX) -shared -L$(MILSKO)/lib -L$(MILSKO)/src -o $@ $(OBJS) -lMw + +.c.o: + $(CC) -c -I$(MILSKO)/include -I$(XEMIL)/include -o $@ $< + +.cxx.o: + $(CXX) -c -I$(MILSKO)/include -I$(XEMIL)/include -o $@ $< + +clean: + rm -f *.so *.dll *.o *.exe bindgen.exe diff --git a/bindgen.c b/bindgen.c new file mode 100644 index 0000000..a0b7ebf --- /dev/null +++ b/bindgen.c @@ -0,0 +1,34 @@ +#include + +int main(int argc, char** argv){ + xemil_t* h; + int fail = 0; + + if(argc < 2){ + printf("Usage: %s XML\n", argv[0]); + return 1; + } + + h = xl_open_file(argv[1]); + + if(h != NULL){ + h->param.new_text = 1; + + if(xl_parse(h)) { + }else{ + fail = 1; + } + + xl_close(h); + }else{ + fail = 1; + } + + if(fail){ + fprintf(stderr, "Failed to parse XML\n"); + + return 1; + } + + return 0; +} diff --git a/objs.mk b/objs.mk new file mode 100644 index 0000000..e69de29