Directly using VirtualBox from Java #5

Merged
NorbiPeti merged 60 commits from directvb into master 2019-04-18 23:29:21 +00:00
4 changed files with 47 additions and 0 deletions
Showing only changes of commit cc7cd15efa - Show all commits

3
libpxc/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
obj/
out/

10
libpxc/makefile Normal file
View file

@ -0,0 +1,10 @@
CC=gcc
# CFLAGS=-I.
pxct: pxct.c pxc
$(CC) -Wall pxct.c -Lout -lpxc -Wl,-rpath=out -o out/pxct
pxc: pxc.c
$(CC) -Wall -c -fpic pxc.c -o obj/pxc.o
$(CC) -Wall -shared obj/pxc.o -o out/libpxc.so

19
libpxc/pxc.c Normal file
View file

@ -0,0 +1,19 @@
#include <stdio.h>
int convert(int px[], int *out[]) {
printf("convert...\n");
return 0;
}
void __attribute__ ((constructor)) initLibrary(void) {
//
// Function that is called when the library is loaded
//
printf("Library is initialized\n");
}
void __attribute__ ((destructor)) cleanUpLibrary(void) {
//
// Function that is called when the library is »closed«.
//
printf("Library is exited\n");
}

15
libpxc/pxct.c Normal file
View file

@ -0,0 +1,15 @@
#include <stdio.h>
/* https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
gcc -Wall -c -fpic pxc.c
gcc -Wall -shared pxc.o -o pxc.so
gcc -Wall pxct.c -L. -lpxc -Wl,-rpath=.
*/
int convert(int px[], int *out[]);
int main() {
convert(NULL, NULL);
return 0;
}