2024-06-16 23:07:42 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
// Build with
|
|
|
|
// cc -shared -fPIC native_test.c -o native_test.so
|
|
|
|
// or
|
|
|
|
// cc -shared -fPIC native_test.c -o native_test.dll
|
|
|
|
|
2024-06-18 11:44:41 +00:00
|
|
|
void labashka(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void), size_t max_size ) {
|
2024-06-16 23:07:42 +00:00
|
|
|
printf("At %zu, there's %d.\n", len(), pop());
|
|
|
|
push(12);
|
|
|
|
printf("Maximum size is %zu.\n", max_size);
|
|
|
|
}
|