14 lines
395 B
C
14 lines
395 B
C
#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
|
|
|
|
void labashka(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void), size_t max_size ) {
|
|
printf("At %zu, there's %d.\n", len(), pop());
|
|
push(12);
|
|
printf("Maximum size is %zu.\n", max_size);
|
|
}
|