init
This commit is contained in:
commit
e324b3d118
5 changed files with 95 additions and 0 deletions
5
.gitiginore
Normal file
5
.gitiginore
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
/bindgen
|
||||
/*.o
|
||||
/*.exe
|
||||
/*.so
|
||||
/*.dll
|
||||
24
LICENSE
Normal file
24
LICENSE
Normal file
|
|
@ -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 <organization> 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 <COPYRIGHT HOLDER> 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.
|
||||
32
Makefile
Normal file
32
Makefile
Normal file
|
|
@ -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
|
||||
34
bindgen.c
Normal file
34
bindgen.c
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <xemil.h>
|
||||
|
||||
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;
|
||||
}
|
||||
0
objs.mk
Normal file
0
objs.mk
Normal file
Loading…
Add table
Add a link
Reference in a new issue