Carp/core/core.h

26 lines
366 B
C
Raw Normal View History

2017-06-26 12:15:03 +03:00
#ifndef PRELUDE_H
#define PRELUDE_H
#include <assert.h>
2018-02-27 16:14:14 +03:00
#include <stdbool.h>
#include <stddef.h>
2017-06-26 12:15:03 +03:00
2018-03-18 16:53:03 +03:00
typedef char* String;
typedef char* Pattern;
2017-10-13 13:48:18 +03:00
// Array
typedef struct {
2017-12-03 21:14:58 +03:00
size_t len;
2018-03-07 14:03:59 +03:00
size_t capacity;
2017-10-13 13:48:18 +03:00
void *data;
} Array;
2017-06-26 12:15:03 +03:00
bool not(bool b) {
return !b;
}
2017-10-24 15:13:45 +03:00
bool and(bool x, bool y) { return x && y; }
bool or(bool x, bool y) { return x || y; }
2017-06-26 12:15:03 +03:00
#endif