xcdat-Cwrapper/README.md
2025-10-23 20:04:23 +00:00

41 lines
No EOL
901 B
Markdown

# xcdat-Cwrapper
this is a C wrapper for the xcdat compression library.
#### build process (with gnu make)
first install xcdat in system-wide , then:
``` shell
$ cd xcdat-Cwrapper && make
```
you can test with the [dictionary file shipped](https://git.ajattix.org/hashirama/Hakurei/src/branch/main/res/dict.bin) with Hakurei:
copy to ```~/.local/share/hakurei/```
then execute the previous compiled code:
``` shell
$ ./wrapper_executable
```
notice that the command above assumes that you're in the cloned folder.
#### haskell build
first compile the wrapper:
``` shell
g++ -shared -fPIC -o libxcdatlib.so xcdatlib.cpp -lstdc++
```
then the haskell library:
``` shell
ghc -shared -dynamic -fPIC -o xcdatlib.o Xcdaths.hs
```
and when you use that haskell library in a program , you can compile it like this:
``` shell
$ ghc -o my_program Main.hs xcdatlib.o -L. -ltrie_loader -lstdc++
```