sentinel pointers and c strings
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "include/native.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct Imported_Handle {
|
||||
int value;
|
||||
@@ -28,6 +29,13 @@ int imported_read(const Imported_Handle *value) {
|
||||
return value->value;
|
||||
}
|
||||
|
||||
int imported_string(const char *value) {
|
||||
if (strcmp(value, "hello") != 0) {
|
||||
abort();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int imported_variadic(int marker, ...) {
|
||||
va_list args;
|
||||
va_start(args, marker);
|
||||
|
||||
Reference in New Issue
Block a user