Created
July 7, 2015 07:35
-
-
Save dnaeon/79faedd8c2c18b2e3d3d to your computer and use it in GitHub Desktop.
test-c-program-calling-rust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
typedef struct | |
{ | |
const char *key; | |
} PLUGIN; | |
PLUGIN *get_plugins(void); | |
int | |
main(void) | |
{ | |
PLUGIN *plugins; | |
printf("Retrieving plugins ...\n"); | |
plugins = get_plugins(); | |
for (int i = 0; plugins[i].key != NULL; i++) { | |
printf("Discovered plugin: '%s'\n", plugins[i].key); | |
} | |
printf("All done.\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment